Skip to content

Support for discriminator objects inside schemas #170

Closed
@sm-Fifteen

Description

@sm-Fifteen

https://github.com/mrin9/RapiDoc/blob/9c5401f06f3f1fe162b1a80a540b45da26ae74db/docs/specs/petstore_extended.yaml#L781-L786

In the extended petstore OpenAPI example, the Pet schema has a petType tag that is used as a discriminator to determine which of the 3 variants of pet is actually used. Redoc supports it (see the POST /pet route) and adjusts the properties presented in the UI based on the value of the discriminator property. RapiDoc does not currently appear to support this, at least not in the way the above example does it. For the record, Swagger UI doesn't support it either, despite this being a standard OpenAPI property).

There was recently a discussion from the OpenAPI team to deprecate discriminator (see OAI/OpenAPI-Specification#2143), but the consensus now seems to be that it does have a clear purpose (namely: identify tagged unions) and should be kept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions