Some usage examples of MicroProfile OpenAPI annotations are as follows:
Example 1 – Simple operation description (abbreviated):
@GET@Path("/findByMake")@Operation(summary = "Finds cars by make", description = "Find cars by their manufacturer")public Response findCarsByMake(...){ ... }
The following is the output for example 1:
/car/findByMake: get: summary: Finds cars by make description: Find cars by their manufacturer
Example 2 – Operation with different responses (abbreviated):
@GET@Path("/{name}")@Operation(summary = "Get customer by name") @APIResponse(description = "The customer", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Customer.class))),@APIResponse(responseCode = "400", ...