Whole file
keleshev/schema
The author described this change as “fix: JSON Schema missing title in subschemas”. It counts as a record because the check below fails on the code as it stood at c3aea9068 and passes on 481f2ee0b, with nothing else changed between the two runs.
Projectkeleshev/schema
Fix saved2025-02-27
Sharing licenceMIT · LICENSE-MIT
Change size+3 −0
What the code was meant to do, written into the code itself as a save note
fix: JSON Schema missing title in subschemas
The change
| 671 | 671 | ||
| 672 | 672 | return_schema["$ref"] = "#/definitions/" + cast(str, schema.name) | |
| 673 | 673 | else: | |
| 674 | + | if schema.name and not title: | |
| 675 | + | return_schema["title"] = schema.name | |
| 676 | + | ||
| 674 | 677 | if flavor == TYPE: | |
| 675 | 678 | # Handle type | |
| 676 | 679 | return_schema["type"] = _get_type_name(s) |
The check that tells the two apart
fail→pass·test_schema.py::test_json_schema_title_in_or
Check file test_schema.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itc3aea90689f7adbc14f6eec8a39bc653d3f7ae41
Broken version dated2025-02-24
Moduleschema.__init__
Units changedSchema
Fingerprint7c98b5e6009b2c45
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in keleshev/schema
- 2026-06-15Fix custom error on a key schema being lost for wrong keys
- 2026-06-13Fix TypeError when building the key error message for a tuple key
- 2017-01-17fix: Schema can be inherited (#127)
- 2016-02-16add strict flag in Schema class to skip wrong key validation without wildcard
- 2015-09-26Fix reliance on `__name__` of callables
- 2014-02-03Handle wrong keys better. Fixes #3 and #15