Swagger UI client
Turn Spring Web annotated methods into a runnable REST client. The plugin generates an OpenAPI definition from your annotations and executes requests through Swagger UI inside the IDE.
There is no custom DSL to learn: you reuse Spring Web, OpenAPI, and Swagger UI, all of which you likely already know.
How it works
1. Define the request with a Spring Web annotation. The method body is irrelevant — the annotation carries the request definition. Use an absolute URL:
@GetMapping("https://api.openweathermap.org/data/2.5/weather")
public String getWeather() {
// The implementation does not matter
}
The same works in Kotlin:
@GetMapping("https://api.openweathermap.org/data/2.5/weather")
fun getWeather(): String = TODO()
2. The plugin generates an OpenAPI definition from the annotated method, including parameters, headers, and body schema.
3. Click the Run gutter icon. Methods with an absolute URL get a gutter action labelled Explyt: Open in Swagger UI. It opens Swagger UI in an IDE tab, backed by the generated definition.
4. Execute and inspect. Fill in parameters through the Swagger form, execute, and read the response body, status, and headers. You can copy the cURL command Swagger generates to reuse the request elsewhere.
Working with the generated OpenAPI
The generated files are ordinary OpenAPI documents, and you can edit them directly with completion and validation. The plugin also validates OpenAPI specifications in your project — JSON and YAML alike — resolves $ref references for navigation, and checks version compatibility.
To produce a specification deliberately rather than as a side effect, use the Generate OpenApi Specification action for the whole project, or Generate OpenApi Doc in the gutter of an individual controller. See Code generation.
Testing your own controllers
The same mechanism works against the controllers you are writing, not just third-party APIs. Because Explyt knows your endpoints from the Endpoints tool window, you can open a controller method in Swagger UI and exercise it against your locally running application.
Notes and limits
- The Run gutter icon only appears for methods whose mapping is an absolute URL. A relative path like
/api/ordersdescribes an endpoint your app serves, not a request to send. - Requests from the embedded browser are routed through a custom handler that bypasses CORS restrictions, so browser security policy does not block your testing.
- The proxy timeout defaults to 10 seconds and is adjustable through the
explyt.openapi.ui.proxy.timeoutregistry key. See Troubleshooting.
Further reading
See also: .http and .rest files · Code generation