Skip to content

Relaxation of the discriminator validation #436

@FWiesner

Description

@FWiesner

OpenAPI 3 requires that the field used for discrimination must be mandatory. While this of course is making sense for new APIs, APIs that get migrated step-by-step from Swagger and especially the clients can have a problem with this approach. Therefore the idea is to fall back in case of an absent discriminator value to standard anyOf validation.

If the discrimination field is required in the schema, then validation will fail. If the schema is not requiring the discrimination field, behaviour is as in regular anyOf case with discriminators not being evaluated at all.

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