Skip to content

CITATION.cff does not validate against the CFF 1.2.0 schema #285

Description

@medley56

Context

Found while adding the Zenodo DOI in #280 / #284.
CITATION.cff has never validated against the CFF 1.2.0 schema it declares on line 1. This is
independent of that PR — the unmodified file from main fails identically:

$ git show main:CITATION.cff > /tmp/citation_main.cff
$ uvx cffconvert --validate -i /tmp/citation_main.cff
jsonschema.exceptions.ValidationError: Additional properties are not allowed
('description', 'maintainers' were unexpected)

Because the document is rejected outright, cffconvert cannot produce BibTeX or APA output at all.
GitHub's "Cite this repository" widget is more lenient and still renders a citation, which is
presumably why this has gone unnoticed.

The violations

Problem Detail
description is not a CFF key The schema is additionalProperties: false at root. The CFF field for this is abstract, which the file already has — so description is redundant as well as invalid.
maintainers is not a CFF key The CFF analogue is contact.
orcid format Must be a full https://orcid.org/0000-0002-3520-9715 URI, not the bare 0000-0002-3520-9715.
message is missing It is a required key. Conventionally: message: "If you use this software, please cite it as below."

Driving Requirements

CITATION.cff should validate against CFF 1.2.0, so that cffconvert and the BibTeX/APA exports it
drives actually work, and so the DOI added in #280 reaches the tools that consume this file.

Implementation Requirements

  • Add the required message key.
  • Replace the root-level description with the existing abstract (verify the abstract text is what
    you want the citation to carry, then delete description).
  • Rename maintainers to contact.
  • Expand both orcid values to full https://orcid.org/... URIs.
  • Verify with uvx cffconvert --validate -i CITATION.cff, and confirm
    uvx cffconvert -f bibtex -i CITATION.cff emits an entry containing the DOI.

Considerations

  • This is coupled to tooling and cannot be a pure CFF edit. scripts/check_metadata.py reads
    citation_cff["description"] and citation_cff["maintainers"] directly to cross-validate against
    pyproject.toml and meta.yaml. Removing or renaming those keys will break the
    check-space-packet-parser-metadata pre-commit hook
    , which runs with always_run: true. Both
    files must change in the same PR.
    • For description: point the check at abstract, or at whichever field should be authoritative.
      Worth deciding deliberately — pyproject.toml's description is a one-liner while abstract is
      a paragraph, so they may not be comparable and the check may need to drop that comparison.
    • For maintainers: the check compares {(name, email)} sets; contact has the same shape, so
      this should be a rename.
  • Adding a cff-validator pre-commit hook would stop this recurring, but it needs network access on
    every commit. Probably a separate discussion — note that validate-codecov-yaml already sets the
    precedent of a network-dependent hook listed in ci.skip.
  • No urgency: the citation still renders on GitHub today. This is about the file being correct for
    every other consumer.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions