You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Correction, added while PR #130 is in review: this issue's original "Scope" section stated rfc3986-validator was already sufficient and "no new dependency required." That was wrong. It reasoned from #121's finding that date format checking works natively in jsonschema with no extra package, and assumed that transferred here. It doesn't: this issue is about date-time (used by the record schema's published field), a different format string than date (used by the crosswalk schema's generated field), with its own separate registration requirement. rfc3986-validator covers uri, not date-time. mmaxjr caught this in #130 by actually running the check rather than assuming the earlier finding applied, and added rfc3339-validator as the real missing dependency. #130 is still open, pending review — not merged yet. Leaving the original wrong text below intact rather than rewriting it, so the correction is visible, not silent.
Summary
validate_records.py builds its jsonschema validator without a
format checker enabled. date-time and uri formats on published, last_updated, and researcher_url are currently annotations the
validator reads but does not act on, not enforced constraints. A
malformed value in any of these three fields passes validation silently.
Where this came from
Found by astrogilda while building the crosswalk schema and validator
in #121. That PR's own validate_crosswalks.py runs Draft202012Validator with FORMAT_CHECKER enabled deliberately, and
the PR's own header comment originally overclaimed that both date and uri were enforced there, when only date actually was without an
extra dependency. That got corrected in #121 itself (see the rfc3986-validator addition to pyproject.toml), which is what
surfaces this issue: validate_records.py never had that dependency or
that validator flag to begin with.
Scope
Add format_checker=jsonschema.Draft202012Validator.FORMAT_CHECKER
to wherever validate_records.py constructs its validator, the same
change already made in validate_crosswalks.py.
Already confirmed safe: astrogilda checked ahead before proposing
this and confirmed all 70 records in the corpus currently pass ave-record-1.1.0.schema.json with format checking fully enabled.
Nothing in the existing corpus goes red from this change.
Out of scope
Any change to the schema itself. This is purely about the validator
script actually enforcing what the schema already declares.
Credit
astrogilda offered to take this issue directly during the #121 review
thread. Found and fixed by mmaxjr in #130 (open, pending review), a
first-time contributor, who also caught and corrected the dependency
assumption above.
Correction, added while PR #130 is in review: this issue's original "Scope" section stated
rfc3986-validatorwas already sufficient and "no new dependency required." That was wrong. It reasoned from #121's finding thatdateformat checking works natively injsonschemawith no extra package, and assumed that transferred here. It doesn't: this issue is aboutdate-time(used by the record schema'spublishedfield), a different format string thandate(used by the crosswalk schema'sgeneratedfield), with its own separate registration requirement.rfc3986-validatorcoversuri, notdate-time. mmaxjr caught this in #130 by actually running the check rather than assuming the earlier finding applied, and addedrfc3339-validatoras the real missing dependency. #130 is still open, pending review — not merged yet. Leaving the original wrong text below intact rather than rewriting it, so the correction is visible, not silent.Summary
validate_records.pybuilds itsjsonschemavalidator without aformat checker enabled.
date-timeanduriformats onpublished,last_updated, andresearcher_urlare currently annotations thevalidator reads but does not act on, not enforced constraints. A
malformed value in any of these three fields passes validation silently.
Where this came from
Found by astrogilda while building the crosswalk schema and validator
in #121. That PR's own
validate_crosswalks.pyrunsDraft202012ValidatorwithFORMAT_CHECKERenabled deliberately, andthe PR's own header comment originally overclaimed that both
dateanduriwere enforced there, when onlydateactually was without anextra dependency. That got corrected in #121 itself (see the
rfc3986-validatoraddition topyproject.toml), which is whatsurfaces this issue:
validate_records.pynever had that dependency orthat validator flag to begin with.
Scope
format_checker=jsonschema.Draft202012Validator.FORMAT_CHECKERto wherever
validate_records.pyconstructs its validator, the samechange already made in
validate_crosswalks.py.Wrong,rfc3986-validatoris already a dev dependency as of Add the crosswalk schema every crosswalk already declares #121 (neededfor
uriformat checking), no new dependency required here.see correction above:
date-timeneeded its own separate package,rfc3339-validator, added in Validate AVE record string formats #130.this and confirmed all 70 records in the corpus currently pass
ave-record-1.1.0.schema.jsonwith format checking fully enabled.Nothing in the existing corpus goes red from this change.
Out of scope
script actually enforcing what the schema already declares.
Credit
astrogilda offered to take this issue directly during the #121 review
thread. Found and fixed by mmaxjr in #130 (open, pending review), a
first-time contributor, who also caught and corrected the dependency
assumption above.