OpenAPI path/query parameters nested structure serialization

Short answer: It’s undefined behavior. Most OpenAPI serialization styles are based on RFC 6570, which provides guidance only for: primitive values, arrays of primitives, simple non-nested objects (with primitive properties). In case of other types of values (nested objects, objects containing arrays, nested arrays, arrays of objects) the behavior is undefined. Similarly, OpenAPI’s own deepObject … Read more

Post a json body with swagger

You need to use the body parameter: “parameters”: [ { “in”: “body”, “name”: “body”, “description”: “Pet object that needs to be added to the store”, “required”: false, “schema”: { “$ref”: “#/definitions/Pet” } } ], and #/definitions/Pet is defined as a model: “Pet”: { “required”: [ “name”, “photoUrls” ], “properties”: { “id”: { “type”: “integer”, “format”: … Read more

How do I include subclasses in Swagger API documentation/ OpenAPI specification using Swashbuckle?

It seems Swashbuckle doesn’t implement polymorphism correctly and I understand the point of view of the author about subclasses as parameters (if an action expects an Animal class and behaves differently if you call it with a dog object or a cat object, then you should have 2 different actions…) but as return types I … Read more