chore: clean up repo structure and add real schemas#4
Merged
Conversation
Restructure the schemas repo around a stable, versioned URL pattern
(`schemas/<name>/v<version>/schema.json`) and replace placeholder content
with real JSON Schemas.
Cleanup:
- Drop space-in-name `energy credentials/` directory
- Move `schemas/salary-slip/{schema.json,README.md}` -> `schemas/salary-slip/v1/`
- Rename the existing `schema.json` (which was a sample instance, not a
schema) to `example.json` and add a real JSON Schema alongside it
- Fix typo in root README, list available schemas, document URL pattern
and immutability/versioning policy
- Add CONTRIBUTING.md describing add/revise workflow
Real schemas added under `schemas/<name>/v1/` with `$id` matching their
raw GitHub URL:
- education, employment, identity, health, business
(sourced from OpenCred's bundled built-in templates)
- electricity (Customer Credential, sourced from beckn/DEG#208 with
upstream attribution)
All schemas validated with ajv (draft-07 and 2020-12). Both examples
(electricity, salary-slip) validate against their schemas.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures the schemas repo around a stable, versioned URL pattern (
schemas/<name>/v<version>/schema.json) and replaces placeholder content with real JSON Schemas.What changed
Cleanup
energy credentials/directoryschemas/salary-slip/{schema.json,README.md}→schemas/salary-slip/v1/schema.json(which was a sample instance, not a JSON Schema) toexample.jsonand add a real JSON Schema alongside itstandards|) in root README, list available schemas, document the URL pattern and immutability/versioning policyCONTRIBUTING.mddescribing the add/revise workflowReal schemas added (under
schemas/<name>/v1/with$idmatching their raw GitHub URL)education,employment,identity,health,business— sourced from OpenCred's bundled built-in templates (packages/schema-engine/src/schemas/); these used to point athttps://opencred.dev/schemas/...which is unhostedelectricity— Customer Credential, sourced from beckn/DEG#208 with upstream attribution in the READMEFinal tree
URL pattern
Every schema is reachable at:
This same URL is the schema's
\$id, so JSON Schema processors resolve it directly. OpenCred will reference these URLs in the W3C VCcredentialSchemafield (follow-up in opencred#300).Versioning policy
Once
v<n>is merged, it is immutable. Breaking and non-breaking shape changes both produce a newv<n+1>directory; older versions stay frozen so existing credentials in the wild keep validating.Test plan
schema.jsonfiles parse as valid JSONajv(withajv-formats)ajv/2020schemas/electricity/v1/example.jsonvalidates against its schemaschemas/salary-slip/v1/example.jsonvalidates against its schema\$idfields match their raw GitHub URLs🤖 Generated with Claude Code