Swagger-ui: Inherited model name and description ignored in the documentation

Created on 5 Jul 2017  路  5Comments  路  Source: swagger-api/swagger-ui

_From @prakashguru on July 5, 2017 13:32_

I have a yaml definition where a model "OrderEx" inherited using allOf from "Order". And the OrderEx is used as model for an api. The problem is the documentation shows name and description of the Order model (base) instead of OrderEx.

image

Am I doing something wrong? The yaml definition attached.

buggy.txt

_Copied from original issue: swagger-api/swagger-editor#1392_

P2 lock-bot bug 3.x

Most helpful comment

1+

The "Example value" issue is the most critical one. For the model name and description, one can have a workaround by writing some generic description that can actually be used throughout the inherited models
(we can live with that), but the lack of specific examples for the inherited models is actually preventing me to use the inheritance at all.

All 5 comments

@owenconti can you take a look at this? You've touched the area before.

Also the "Example Value" shows the base model's example instead of derived.

1+

The "Example value" issue is the most critical one. For the model name and description, one can have a workaround by writing some generic description that can actually be used throughout the inherited models
(we can live with that), but the lack of specific examples for the inherited models is actually preventing me to use the inheritance at all.

Is inheritance works in Swagger UI? Is there an example?

Fixed by https://github.com/swagger-api/swagger-js/pull/1130, which should be released this week 馃帀

messages image 3481647048

Was this page helpful?
0 / 5 - 0 ratings