datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

Support if/then/else from JSON Schema Core

Open lenard-mosys opened this issue 7 months ago • 0 comments

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

lenard-mosys avatar Apr 23 '25 09:04 lenard-mosys