I am working with Swagger-UI in an attempt to standardize API documentation. I realized that for verbs (GET, PUT, POST, etc.) that use the body parameter and therefore should show the model and model diagram, the scheme is defined at the resource level (/ pet or / store in the pet store example). However, in our API, the necessary parameters of the body will vary from verb to verb, and it would be nice to have a model for everyone that accurately reflects this.
The current version of the model definition is at http://petstore.swagger.wordnik.com/api/api-docs/pet , where the model definition looks like this:
Is there a way to override the default resource level model at the verb level?
swagger 2.0 HTTP- (get, post, delete ..). , , , JSON . , $ref, , .
$ref
{ name: "body", in: "body", description: "set the properties of a pet", schema: { $ref: "#/definitions/PetPut" }, required: true }