Right now we don't support the if/then/else structure. I think it would be valid to transform it to a oneOf: ```json { "if": { "$ref": "#/$defs/A" }, "then": { "$ref": "#/$defs/B" }, "else": { "$ref": "#/$defs/C" }, } ``` transforms to ```json { "oneOf": [ { "title": "then", "allOf": [ { "$ref": "#/$defs/A" }, { "$ref": "#/$defs/B" } ] }, { "title": "else", "allOf": [ { "not": { "$ref": "#/$defs/A" } }, { "$ref": "#/$defs/C" } ] } ] } ``` This should become something like: ```rust #[serde(untagged)] pub enum IfThenElseType { Then(BA), Else(CNotA), } ```
Activity
feat: add if/then/else support and fix not schema panics (oxidecomput…
ndreno commentedon Mar 19, 2026
We've implemented a fix for this in our fork at barbacane-dev/typify. Happy to extract a clean PR if there's interest.
nipil commentedon May 25, 2026
Hello, i have a similar
not implemented: if/then/else schemas are not supportedin cargo-typify 0.6.2It happens with ansible-lint
meta.jsonschema :https://raw.githubusercontent.com/ansible/ansible-lint/refs/tags/v26.4.0/src/ansiblelint/schemas/meta.json