fix(validation): use jsonschema[format-nongpl] for the format checkers - #140
Merged
Conversation
Contributor
Release previewMerging this PR would release v0.18.4 (current: Changelog preview (truncated)## v0.18.4 (2026-08-31)
### Bug Fixes
- **validation**: Use jsonschema[format-nongpl] for format checks
([`51043c1`](https://github.com/OO-LD/oold-python/commit/51043c1dcd6e3416b32899f6914b78b78bad69e6))
### Testing
- **parity**: Compare against oold-js instead of oold-schema's scripts
([#144](https://github.com/OO-LD/oold-python/pull/144),
[`42d0d74`](https://github.com/OO-LD/oold-python/commit/42d0d740fec4285ca6c3b9bd9c0c028a9368b601))
Preview via python-semantic-release and conventional commits. |
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Aug 31, 2026
- swap most format checkers onto jsonschema[format-nongpl], never jsonschema[format], which pulls the GPLv3+ rfc3987 into an Apache-2.0 package - keep date-time, time, email, idn-email and uuid hand-written, since the library's checkers diverge from the reference toolchain there - add jsonschema[format-nongpl] to the validation/mcp/all extras and the dev group, not as a core dependency - assert in CI that rfc3987 never lands in uv.lock
LukasGold
force-pushed
the
fix/format-checkers-nongpl
branch
from
August 31, 2026 13:15
b6dce18 to
51043c1
Compare
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #121.
Most of
formats.pynow delegates tojsonschema[format-nongpl]'s checkers. The module stays as the seam, so no caller changes:OOLD_FORMAT_CHECKER,is_iri,is_iri_reference,IRI_FORMATSandFORMAT_SAMPLESare unchanged. 234 lines to 194.The issue's premise was partly wrong, and the divergences are kept
The issue said the library covers all 18 formats with "identical behaviour on the cases that matter". Checked against
tests/data/format_parity.json, the 98-case table already in the repository, and 9 of those cases mismatch across 5 formats. Those 5 stay hand-written, with the reason recorded in the module docstring:date-time,timerfc3339_validatorrejects the space separator, offsets without a colon (+0200), and the leap second23:59:60, all accepted by the reference toolchainemail,idn-email"@" in instance, far looser than ajv-formats' patternuuiduuid.UUID, which strips aurn:uuid:prefix, then range-checks dash positions assuming no prefix, so a prefixed UUID is wrongly rejectedThe
uuidone is a genuine library defect rather than a taste difference, andurn:uuid:is a form this package's own fixtures use.The 13 formats that did match exactly were swapped:
date,duration,hostname,idn-hostname,ipv4,ipv6,iri,iri-reference,json-pointer,regex,relative-json-pointer,uri,uri-reference. That includes every row the issue measured, the compact-IRI casesex:aliceandschema:Personamong them, and the non-ASCII behaviour asserted bytest_iri_allows_non_ascii_but_uri_does_not.Licence
jsonschema[format-nongpl], neverjsonschema[format]. The latter pullsrfc3987, which is GPLv3+, into a package that is Apache-2.0. Whatformat-nongpldoes pull:fqdnis MPL-2.0,rfc3986-validatoris MIT,rfc3987-syntaxis Apache-2.0. MPL-2.0 is file-level copyleft with no obligation on the combined work.The extra lands on the optional dependency groups (
validation,mcp,all, and thedevgroup), not the core, which is the answer to the 20-transitive-package cost the issue raises..github/workflows/main.ymlgains an assertion thatrfc3987never appears inuv.lock. The failure mode it catches is the dangerous one precisely because it works: someone typesjsonschema[format], the build is green, the tests pass, and the distribution has quietly become GPLv3+. That grep is the only moment anyone would look. It was confirmed to actually fail by running it against a synthetic lock fragment containingrfc3987, not just by observing it pass.Verification
Rebased onto
mainat v0.18.3 and re-verified there, since the first run measured against amainthat has since moved by five commits:tests/test_validation/test_formats.py: 140 passedmainmake check: clean, includingdeptryand lock consistencyuv run oold validate tests/data/oold --offline: PASS, 380 ok, 21 warnings, unchangedrfc3987confirmed absent fromuv.lockThe rebase produced no conflicts. #144 also edits
.github/workflows/main.yml, but in a disjoint section, so itsoold-jsparity setup and this branch'srfc3987assertion both survive.uv.lockwas regenerated withuv lockrather than merged by hand and came out byte-identical to the auto-merged result.