Skip to content

reject invalid discriminators at compile time with clear error and use purely stack based runtime  #102

Description

@simbo1905

Summary

Discriminator validation currently diverges between the stack-based engine and legacy per-schema validate methods. As it is deferred work to runtime, the compiler is allowing completely invalid discriminators through. Tighten compile-time schema checks and retire the duplicate validation path so discriminators always honour the "tag exemption" rules.

Scope

  • Enforce discriminator mapping constraints during schema compilation (properties schemas only, no nullable mappings, discriminator key not shadowed).
  • Remove direct validate implementations on schema records and rely exclusively on the stack validator.
  • Update stack handling to apply the discriminator tag exemption without special casing.
  • Refresh tests and documentation to match the stricter behaviour.

Plan

See PLAN.md in the repository root for the proposed work breakdown, risks, and testing strategy.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions