Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a schema for the beckn.json document #470

Open
wants to merge 15 commits into
base: Verifiable-Credentials
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions api/about-endpoint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Steps to generate beckn.json file

1. install ```json-dereference-cli```

```npm install -g json-dereference-cli```

2. Make sure we have api/about.json.

3. Generate verifiableCredential json from schema/credential.yaml

```json-dereference -s schema/Credential.yaml -o api/about-endpoint/becknVerifiableCredential.json```

4. The generate document is just a json file, to make it a json schema definition, add the below lines manually in the ```api/about-endpoint/becknVerifiableCredential.json``` at the root of the object.

```
"$id": "becknVerifiableCredential",
"$schema": "https://json-schema.org/draft/2020-12/schema"
```

5. Genearte beckn.json using about.json

```
json-dereference -s api/about-endpoint/about.json -o api/about-endpoint/beckn.json
```
18 changes: 18 additions & 0 deletions api/about-endpoint/about.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$id": "aboutSchema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Json schema describing the structure of beckn.json",
"type": "object",
"properties": {
"credentials": {
"type": "array",
"items": {
"$ref": "becknVerifiableCredential.json#"
}
},
"layer2Config": {
"type": "string",
"format": "url"
}
}
}
456 changes: 456 additions & 0 deletions api/about-endpoint/beckn.json

Large diffs are not rendered by default.

Loading