documentOperationResponses method Null safety

Map<String, APIResponse> documentOperationResponses(
  1. APIDocumentContext context,
  2. Operation operation
)

Returns a map of possible responses for operation.

To provide documentation for an operation, you must override this method and return a map of possible responses. The key is a String representation of a status code (e.g., "200") and the value is an APIResponse object.

Implementation

Map<String, APIResponse> documentOperationResponses(
  APIDocumentContext context,
  Operation operation,
) {
  return {"200": APIResponse("Successful response.")};
}