Product Guide

ReadMe Documentation

Welcome to the ReadMe Documentation, where you'll find comprehensive guides and community support to help you start working with ReadMe as quickly as possible!

Get Started
Ask A Question



No discriminator support in Swagger

I used the `discriminator` feature of Swagger, in combination with `allOf` and `$ref` to create a form of polymorphism in my API spec. * Here's the documentation on the intended use of `discriminator` in Swagger specs: * And here's a more clarifying example: I use this in [my own spec]( a couple of times. It doesn't get rendered right in's swagger implementation. The `discriminator` field is rendered as an ordinary text field, whereas it should be rendered as a drop down to select the desired sub type. Also, whenever a subtype is selected, the additional fields defined in that sub type should be rendered as well. Otherwise, there is no way to read the documentation of the sub types, let alone test them. The "Swagger UI" that is provided by the Swagger project itself, doesn't render this right either. However, the [Redoc]( documentation template proves that it is perfectly possible to implement this. As a work around, I don't use's Swagger support now, but link to a self-hosted website where I host a Redoc-rendered version of my API documentation. Needless to say that it would be much better if I could use for this as well, enabling the creation of examples in different languages,'s excellent feedback options and of course the "try it" functionality, all of which I am missing in my current solution.

Posted by Bart Kummel 3 years ago