fix: handle boolean JSON Schema nodes in `JsonSchemaTransformer`
Merged
DH
8mo ago+65+65+01234567890123456789-19-19-01234567890123456789
- Closes #4771
Summary
JsonSchemaTransformer.walk() crashes with AttributeError: 'bool' object has no attribute 'get' when a JSON Schema contains boolean schema nodes (e.g. "value": true). Boolean schemas are valid per the JSON Schema spec (true is equivalent to {}, false is equivalent to {"not": {}}), but the walker unconditionally called .get() on every child node assuming it was a dict.
This PR treats boolean schema nodes as terminal leaves in the internal walker so they pass through untouched, and adds a parametrized regression test covering both True and False.
Pre-Review Checklist
- Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
- No breaking changes in accordance with the version policy.
- Linting and type checking pass per
make formatandmake typecheck. - PR title is fit for the release changelog.
Pre-Merge Checklist
- New tests for any fix or new behavior, maintaining 100% coverage.
- Updated documentation for new features and behaviors, including docstrings for API docs.
Made with Cursor