Override the verb-level model / model in the Swagger-UI interface

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:

swagger-ui-model-def

Is there a way to override the default resource level model at the verb level?

+4
1

swagger 2.0 HTTP- (get, post, delete ..). , , , JSON . , $ref, , .

{
    name: "body",
    in: "body",
    description: "set the properties of a pet",
    schema: {
        $ref: "#/definitions/PetPut"
    },
    required: true
}
+1

All Articles