Skip to content

fix: pin missing schema versions to their real version (Quantity, EnergyCustomerProfile) - #490

Merged
nirmalnr merged 1 commit into
beckn:mainfrom
nirmalnr:fix/pin-missing-schema-versions
Sep 2, 2026
Merged

fix: pin missing schema versions to their real version (Quantity, EnergyCustomerProfile)#490
nirmalnr merged 1 commit into
beckn:mainfrom
nirmalnr:fix/pin-missing-schema-versions

Conversation

@nirmalnr

@nirmalnr nirmalnr commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Fixes 81 document URLs (context.jsonld/vocab.jsonld/etc.) across 51 files that referenced Quantity and EnergyCustomerProfile with no version segment at all — e.g. schema.nfh.global/Quantity/context.jsonld instead of schema.nfh.global/Quantity/v2.0/context.jsonld.

  • Quantity → pinned to v2.0 (79 occurrences — devkits/demand-flex examples, Postman collections, response fixtures, docs, examples/demand-flex)
  • EnergyCustomerProfile → pinned to v1.0 (2 occurrences — inside this repo's own canonical schema definitions: specification/schema/EnergyBillingSummaryCredential/v1.0/context.jsonld and .../EnergyMeterDataGBCredential/v1.0/context.jsonld)

A version-less reference resolves to "whatever the current latest happens to be," which isn't safe to depend on — schema versions here aren't guaranteed backward-compatible (e.g. PriceSpecification has v2.0/v2.1/v2.2 with real field differences, TimePeriod and CategoryCode similarly). A $ref/@context pointing at "latest" can silently start resolving to different, possibly incompatible content the moment a new version ships, with no change on the referencing side — the same failure mode dependency pinning in npm/pip exists to prevent. Pinning to the exact version actually being used makes these references reproducible instead of a moving target.

Separate PR from #487 since this is a distinct problem: missing version entirely, vs. missing the v prefix on an existing version number.

Test plan

  • Automated before/after scan: version-less document URLs 81 → 0
  • Diff audit: every changed line pins to Quantity/v2.0 or EnergyCustomerProfile/v1.0 — no unrelated content touched
  • JSON/YAML syntax validation passes on all 51 changed files

🤖 Generated with Claude Code

Quantity and EnergyCustomerProfile were referenced with no version
segment at all (e.g. schema.nfh.global/Quantity/context.jsonld) across
81 occurrences in 51 files. Pinned to their real, current version:
Quantity -> v2.0, EnergyCustomerProfile -> v1.0.

A version-less reference resolves to whatever the current latest
happens to be, which isn't safe to depend on - versions here aren't
guaranteed backward-compatible (PriceSpecification v2.0/v2.1/v2.2,
TimePeriod, CategoryCode all have real field differences across
versions). Pinning makes these references reproducible instead of a
moving target that can silently change underneath callers.
@nirmalnr
nirmalnr requested a review from nirmay September 1, 2026 13:21

@nirmay nirmay left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved.

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.

2 participants