Hi,
it seems that the "discriminator" and/or "subTypes" declaration existing in api json is not anyhow reflected in the swagger-ui ResponseClass model view (checked in 2.0.1).
This concerns the polymorphic result classes, as described in the article: https://gist.github.com/leedm777/5730877.
Is there any vision/timeframe for the implemention of such a feature?
Hi,
I've the same issue.
I'm also seeing same issue.
Swagger is processing subtypes specified in @ApiModel annotation and adding details in Model class. But Swagger UI not showing the subTypes declaration existing in Api Json.
If you click Raw link in Swaggger UI, we can see the subtypes details in Raw Api Json.
Is there any plan to address this issue?
Would love to see this too.
Same here, this is a feature I am missing.
Me too.
Hi, We are using swagger UI in our project. We can see "discriminator" and/or "subTypes" declaration in Raw types.
Is But we want all the subType properties(its model) to be visible as well.
Seeking urgent help on this.
I've created a patch for this on swagger-ui and swagger-js:
https://github.com/wordnik/swagger-ui/pull/495
https://github.com/wordnik/swagger-js/pull/105
Does your PR cover this? https://groups.google.com/d/msg/swagger-swaggersocket/kE4bL1xkSoQ/nWh2B1W-ZwgJ
I'm using a version of swagger-ui including your PR, but child models are not printed.
Thanks
Hi, I'd love to merge the PR but it's failing tests. Will try to get it sorted out soon, but if the tests can pass first, it'll move much more swiftly.
Before asking to merge (:P) this PR, i would like to know if it is supposed to cover this https://groups.google.com/d/msg/swagger-swaggersocket/kE4bL1xkSoQ/nWh2B1W-ZwgJ
I think it doesn't or it's not working as expected :/
Thanks!
@fehguy even the tests on master cannot pass, so there's no point for me to fix the tests for this per patch until master is clean
https://rawgit.com/wordnik/swagger-js/master/model-spec.html
@fgaule In order to test the patch in swagger-ui, you will have to:
@garryyao any plans to PR this in master ?
Whats about this feature? I am still missing it... ;-)
I think the work by @garryyao goes a long way toward this, but from what I can see there is still no way to see the subtypes in the swagger-ui. Consider a simple hierarchy with Animal having two subclasses, Cat and Dog. I think there are really two cases to worry about here:
1.) Ensuring that if a method returns/consumes a leaf type (say Cat) that Cat includes all of the properties inherited from Animal.
2.) Ensuring that if a method returns/consumes the base class (say Animal) there is a way to see that it might return/accept a concrete class of Cat or Dog and view the properties of each.
I can't see how this change implements case 2, so I've taken a stab at doing that here:
Swagger JS - I merged @garryyao 's work and added the following
https://github.com/mpoindexter/swagger-js/commit/68ea66f509bf90ace813c0ce1353248e3a46f2ca
Swagger UI-
https://github.com/mpoindexter/swagger-ui/commit/dd3018216b922289f11b955c2fd9211fe18d1136
Hi @mpoindexter,
I tested your swaggerUI, it can show subtypes for polymophism parameter, but not for return base type.
I have an api method that returned base type, and swagger UI just show model for base type.
Could you tell me how to make swaggerUI show subtypes for returned model?
Thanks in advance!
Thanh
I think there was one case that was not handled for showing the proper return type. If the return type was a single instance (i.e. Foo) it would work, but if it was a collection type (i.e. array[Foo]) it would fail. I've fixed here, as well as adding ensuring subtypes show up in the signature display when included as a property type in a returned model:
SwaggerUI: https://github.com/mpoindexter/swagger-ui/commit/dc93066efb5fadb069f7fe4b76ad97913d4f071f
SwaggerJS: https://github.com/mpoindexter/swagger-js/commit/80d91209e5824c092b534737425d5c39434a3db7
Thanks @mpoindexter , it works great. Do you have plan fix when method return collection types?
Hi all,
I just want to show document for client to know my Api services. Does swaggerUI have configuration to ignore try to make request to server?
Thanks
Hi, @luuvthanh87 I don't know what you mean. Is this related to ploymorphism?
Hi @fehguy
Server has 2 api controllers, but I just want client show document for 1 and ignore the other. Can swaggerUI do that or I have to do ignore on my server?
Hi @luuvthanh87 this sounds like a different issue. Can you please open a new one? I don't think this has anything to do with polymorphism
Thanks @mpoindexter , it works great.
This issue is now more than a year old. Any progress to merge that into the master branch?
it's going to happen with the 2.0 work, since the polymorphism mechanism has changed.
Any news ? It would be great to have it merged soon :)
It's close
Nice to hear that a mege is close, would the merge be to develop or develop_2.0?
I'm also curious if the proposed fix will show models that "extends": "SomeBaseModel".
Is this still an active issue? Looking for this functionality at the moment - is there any work left to be done on this?
This is all pending work on swagger-js.
What's the timeline for v2.1 ?
This is still a problem for me in 2.1.4
I still don't see this in 2.1.4
How is this supposed to look like? Would like to see it in action, I think it is an important feature.
@SebastianStehle like in https://github.com/Rebilly/ReDoc

Hi, @raderio My answer is 2 years old. I already moved over to Redoc long ago ;)
Most helpful comment
How is this supposed to look like? Would like to see it in action, I think it is an important feature.