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 annotation in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Annotate your endpoint definitions by using the
@Tagannotation. Enter 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