Chapter 7. Adding MicroProfile OpenAPI annotations to your REST controller code
You can add MicroProfile OpenAPI annotations to your rest controller code to generate a more detailed OpenAPI schema for your rest endpoints.
Procedure
Add the
@OpenApiDefinitionannotation at the class level of yourGreetingController. Include the data that is shown in the example in the annotation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Annotate your endpoint definitions using the
@Tagannotation. Give a name and a description for each endpoint:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The data that you provided in the annotations appears in the generated OpenAPI schema:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow