Skip to content

Support discriminator mapping #1108

@magnusjtvisma

Description

@magnusjtvisma

Support for deep discriminators was recently added (discriminator: true sent to ajv).

The problem I'm facing is that AJV doesn't support discriminator mappings, but I need to have them because openapi-typescript doesn't generate correct types without them. That is, there is a bug in both libraries, and they contradict each other.

There is an open PR in AJV to ignore mapping, but AJV seems almost abandoned at this point?
ajv-validator/ajv#2263

See also this unresolved issue in openapi-typescript:
openapi-ts/openapi-typescript#2318

Proposal:

Remove discriminator mapping from the spec before passing it to AJV. It shouldn't affect validation in any way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions