Under the input parameters are listed the possible responses for the resource:
The 200 response is determined by the return type on the method, in this case a collection of Pet objects:
| @RestGet(
| path="/pet",
| summary="All pets in the store",
| ...
| )
| public Collection<Pet> getPets() throws NotAcceptable {
| return store.getPets();
| }
Note that additional responses can be specified by throwing exceptions annotated with the {@link oaj.http.annotation.Response @Response} annotation such
as this one:
| @Response
| @StatusCode(406)
| @Schema(description="Not Acceptable")
| public class NotAcceptable extends BasicHttpException {...}
Like input parameters, the Swagger for responses can be define in multiple locations such as:
- {@link oaj.http.annotation.Response @Response} annotated classes, methods, and parameters.
- {@link oajr.annotation.Rest#swagger() @Rest(swagger)} / {@link oajr.annotation.RestOp#swagger() @RestOp(swagger)} annotations.