ResourceController
does most of the heavy lifting when it comes to generating OpenAPI documents. It will reflect on the bound variables of operation methods to provide the majority of an OpenAPI document. You only need to provide the possible responses. You do this by overriding documentOperationResponses
in your ResourceController
subclass. The below shows a trivial example of a resource controller that returns a 200 OK with no body for every request.APIResponse
object. An APIResponse
object is highly configurable, but in most cases, you only need to declare the schema of its body. For this purpose, a convenience constructor named APIResponse.schema
exists. Here is an example where the JSON response body contains a single integer field named 'id':operation
argument tells you which operation you are documenting.documentOperationParameters
, or you may override documentOperations
to take over the whole process.ResourceController
, you must override documentOperations
in your controller and provide all of the operation information yourself.