Skip to content

Report schema findings as the specification grades them - #18

Merged
DavidMStraub merged 1 commit into
mainfrom
validator-recommendations
Nov 17, 2026
Merged

DavidMStraub merged 1 commit into
mainfrom
validator-recommendations

Conversation

@DavidMStraub

@DavidMStraub DavidMStraub commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • validate() results now have a severity field: "error" (default) or "recommendation".
  • A URI abbreviated by two tags (2 TAG _LOC … and 2 TAG _GOV … with the same URI) is still reported as schema-conflict, now with severity "recommendation". The spec says a schema should map only one tag to each URI and lists unique URIs as recommended, so such a file still conforms.
  • dumps(validate=True) raises only for findings with severity "error".
  • A tag mapped to several URIs is no longer reported. The spec explicitly permits this when the concepts cannot appear in the same place (the section "Extensions", with a _LOC example). Its requirements list also says each tag definition's extension tag must be unique; the specific permission is taken to govern, and _check_schema's docstring records this. The parser still leaves such a tag unresolved, as before.
  • Regression tests: lower-case identifiers and pointers fail to parse at the right line, FORM png is reported as malformed-payload with its path.
  • README: what Error holds, what severity means, and what an empty result does not prove.

Behaviour changes

  • A tag defined with two URIs no longer produces a schema-conflict finding.
  • dumps(validate=True) now writes a dataset whose only finding is a shared URI.

Test plan

  • pytest (469 passed)
  • ruff check, ruff format --check, mypy gedcom7

A URI abbreviated by two tags breaks only a recommendation, so validate()
now marks it with severity "recommendation" and dumps(validate=True) no
longer refuses to write it. One tag defined with several URIs is permitted
where their concepts never meet, so it is no longer reported.

Also pins down the parser's rejection of lower-case cross-reference
identifiers and the validator's report of a FORM that is not a media type,
and documents what an empty validate() result does and does not prove.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidMStraub
DavidMStraub merged commit eb78d3c into main Nov 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant