Skip to content

Prepare sample server.json exercising v2.0.0 extension fields #28

@LittleCoinCoin

Description

@LittleCoinCoin

Context

This is a sub-issue of Issue #27 (draft v2.0.0 schema proposal). A concrete sample server.json serves two purposes:

  1. Drives schema iteration during Issue Draft Hatch-Schemas v2.0.0 extension schema proposal #27 — authoring the sample makes schema gaps and awkward field names visible before the Day 1 meeting
  2. Reused later: smoke-test hatch package validate and live registry round-trip both need a ready-made server.json to avoid blocking on authoring during hackathon sessions

Work on this alongside Issue #27, not after it.


Task

Create examples/server_v2.0.0_example.json in the Hatch-Schemas repo (or in the hackathon working directory if the repo is not yet ready). The file must be a complete, valid server.json that exercises all v2.0.0 extension features.

Minimum required coverage

One entry per citations[] format type — at least one of each must appear:

"citations": [
  { "format": "doi",       "value": "10.1234/example",          "note": "primary paper" },
  { "format": "arxiv",     "value": "2301.12345",               "note": "preprint" },
  { "format": "pmid",      "value": "12345678",                 "note": "method reference" },
  { "format": "url",       "value": "https://example.org/docs", "note": "documentation" },
  { "format": "bibtex",    "value": "@article{key, ...}",       "note": "dataset" },
  { "format": "formatted", "value": "Author et al. (2024) ...", "note": "software" }
]

provenance{} both fields populated:

"provenance": {
  "git_sha": "abc1234",
  "build_env": "conda-lock"
}

schema_version set to the draft version:

"schema_version": "2.0.0"

All v1.2.2 dependencies types represented (at least one entry each):

"dependencies": {
  "python": [{ "name": "numpy", "version_constraint": "==1.26.0", "package_manager": "conda", "channel": "conda-forge" }],
  "system": [{ "name": "libgomp1", "version_constraint": "==12.3.0", "package_manager": "apt" }],
  "docker": [{ "name": "ghcr.io/example/image", "tag": "1.0.0", "digest": "sha256:abc123..." }],
  "hatch":  [{ "name": "io.github.example/peer-pkg", "version_constraint": "==0.1.0" }]
}

Also include a negative test case

Create a second file examples/server_v2.0.0_invalid_example.json that intentionally fails validation — for example, a citations entry with an unknown format value or a provenance block with neither field set.


Acceptance Criteria

  • examples/server_v2.0.0_example.json validates successfully against package/v2.0.0/hatch_pkg_metadata_schema.json
  • All 9 citations[].format values are represented (or all values defined in the schema at the time of writing)
  • provenance is populated with both git_sha and build_env
  • All four dependencies types have at least one entry
  • examples/server_v2.0.0_invalid_example.json fails validation with a clear, actionable error message
  • Both files are committed on feat/schema-v2.0.0-extension

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions