ResourceControllerdoes 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
ResourceControllersubclass. The below shows a trivial example of a resource controller that returns a 200 OK with no body for every request.
APIResponseobject 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.schemaexists. Here is an example where the JSON response body contains a single integer field named 'id':
operationargument tells you which operation you are documenting.
documentOperationParameters, or you may override
documentOperationsto take over the whole process.
ResourceController, you must override
documentOperationsin your controller and provide all of the operation information yourself.