liveBook · Manning

Quarkus-smallrye-openapi

As explained in Quarkus in Action

A Quarkus extension that integrates SmallRye OpenAPI to generate OpenAPI descriptions for application APIs and support development-time API exploration.

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

How Quarkus in Action covers it

How deep it goes
Explains generated documents, UI endpoints, schemas, and production inclusion, while deferring customization details.
Examples
Demonstrates a Reservation service with availability and reservation endpoints, JSON schemas, requests, and responses.
What it assumes
Assumes a Quarkus REST application and introduces OpenAPI documents and Swagger UI through a Reservation service.
What you can do after
Apply it via Quarkus CLI and Dev mode to inspect, test, and expose generated REST API descriptions.
How it connects
Connects OpenAPI with Quarkus REST, Swagger UI, MicroProfile OpenAPI, JSON serialization, and REST endpoint schemas.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.