datamodel-code-generator
datamodel-code-generator copied to clipboard
Support if/then/else from JSON Schema Core
JSON Schema Core has the keywords if, then and `else for conditional schema validation.
Currently datamodel-codegen seems to ignore these fields within a JSON Schema.
Ideally when generating a pydantic model from a schema that contains these keywords I expect a generated model that enforces the requirements imposed by these keywords.
https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-02#section-9.2.2.1
https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse