Skip to content

invalid_discriminator_mapping error #114

Description

@jd-lara

We maintain a multi-file JSON Schema tree (~110 files) that is the source of truth for several generated client packages. Every discriminated union in it crosses a file boundary, so we carry a ~200-line bundling script whose only remaining job is to flatten each spec into one document so mappings resolve. With this fixed, that script goes away and the generator can read our sources directly.

The client generator resolves a cross-file $ref fine, but a discriminator.mapping value pointing at that same file fails with invalid_discriminator_mapping. The effect is that a spec split across multiple files works right up until it uses a discriminated union, which forces consumers to pre-bundle every spec into a single document purely to satisfy mapping resolution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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