swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

when using allOf swagger-ui ignores parent schema for display

Open paulhill opened this issue 11 years ago • 3 comments

Swagger uses allOf to denote inheritance to support polymorphism but swagger-ui doesn't take it into account. It should show either the parent schema with some kind of indication it is the parent, or just merge the attributes so the model displayed correctly represents what is required.

paulhill avatar May 22 '15 20:05 paulhill

https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#models-with-polymorphism-support

e.g. using the above example, if you reference Cat as the response schema it won't include "name" in the displayed schema.

paulhill avatar May 22 '15 21:05 paulhill

http://editor.swagger.io/ does an ok job of listing the parent schema

paulhill avatar May 22 '15 21:05 paulhill

@paulhill - long time! allOf is known to be not supported yet. Please follow https://github.com/swagger-api/swagger-js/issues/188.

webron avatar May 22 '15 22:05 webron