quarkus-smallrye-openapi integrates SmallRye OpenAPI with a Quarkus REST application. It generates an OpenAPI document describing exposed endpoints and provides Swagger UI for exploring and testing them during development. section 4.2 section 4.2.3
A Reservation service uses the extension to:
- Expose the generated document at /q/openapi. section 4.2.3
- Expose Swagger UI at /q/swagger-ui while running in Dev mode. section 4.2.3
- Describe JSON request and response schemas, including Reservation objects. section 4.2.3
- Include Swagger UI in production when quarkus.swagger-ui.always-include=true is configured. section 4.2.3
Reservation service API exploration
Create the service with the quarkus-smallrye-openapi extension, start Quarkus Dev mode, and open http://localhost:8081/q/swagger-ui. The UI lists the availability and reservation endpoints, while /q/openapi exposes the generated OpenAPI 3.0.3 document. section 4.2 section 4.2.3
$ quarkus create app org.acme:reservation-service -P 3.15.1 \ --extension quarkus-rest-jackson,quarkus-rest-client-jackson,\ quarkus-smallrye-openapi --no-code
Use the application-creation command to add quarkus-smallrye-openapi alongside the REST and REST client Jackson extensions. section 4.2
$ quarkus dev
Start Quarkus Dev mode before opening Swagger UI and exercising the generated REST operations. section 4.2
