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
Context
• Follow-up to the discussion in PR #232 (“consistent relative framework $ref in endpoints”).
• Root-cause analysis in Issue #206 shows that missing$id values break Biovalidator/AJV resolution.
• A working prototype exists in M-casado#1 (where I injected $ids automatically).
Problem statement
Beacon v2 schemas currently mix absolute and relative $refs without defining canonical $ids for each schema document.
JSON-Schema Draft 2020-12 (§8.2.1.1) recommends that every root schema provides an absolute $id, and validators such as AJV treat this $id as the base-URI for resolving further $refs.
Lack of $id values leads to:
Broken resolution chains when model ↔ framework schemas reference each other.
Inability to rely on Biovalidator, AJV and other off-the-shelf tooling.
Hidden coupling to the main branch through hard-coded raw-GitHub URLs.
Proposal
Inject a canonical $id into every JSON and YAML schema under
framework/json/**, framework/src/**
models/json/**, models/src/**
Canonical URI format
Use https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/<branch>/<path-to-file>
MUST be main on release and the current branch for PR artefacts.
Fragments (#...) are not included in the $id itself.
(Optional, but honestly... very recommended) Add a GitHub Actions workflow that:
Fails if any schema lacks $id
Fails on duplicate or non-absolute $ids
Checks if the 'repo owner' (e.g., ga4gh-beacon), the 'branch' (e.g., main), and the path to file match the expected. For example, to avoid that there's a fork or another branch, with the URI pointing to a different branch.
Expected benefits
Full compatibility with Biovalidator, AJV ≥ 8.12, Swagger-UI and other tooling.
Context
• Follow-up to the discussion in PR #232 (“consistent relative framework
$refin endpoints”).• Root-cause analysis in Issue #206 shows that missing
$idvalues break Biovalidator/AJV resolution.• A working prototype exists in M-casado#1 (where I injected
$ids automatically).Problem statement
Beacon v2 schemas currently mix absolute and relative
$refs without defining canonical$ids for each schema document.JSON-Schema Draft 2020-12 (§8.2.1.1) recommends that every root schema provides an absolute
$id, and validators such as AJV treat this$idas the base-URI for resolving further$refs.Lack of
$idvalues leads to:mainbranch through hard-coded raw-GitHub URLs.Proposal
Inject a canonical
$idinto every JSON and YAML schema underframework/json/**,framework/src/**models/json/**,models/src/**Canonical URI format
https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/<branch>/<path-to-file>mainon release and the current branch for PR artefacts.#...) are not included in the$iditself.Tooling
$id$idsExpected benefits
$idd schemas (see example: https://w3id.org/ga4gh/schema/vrs/2.0.0/json/Allele).$refs.References
$refs and the need for$id)$refis resolved using the schema$idas base URI”