Skip to content

Commit c64f4a1

Browse files
Merge pull request #16 from metaplex-foundation/mark/json-schema
Update JSON Schema
2 parents 7d6ad66 + 0e66963 commit c64f4a1

File tree

2 files changed

+5459
-898
lines changed

2 files changed

+5459
-898
lines changed

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -622,3 +622,49 @@ The tests included in this repository can be run locally to test different endpo
622622
```bash
623623
pnpm build && pnpm test
624624
```
625+
626+
## Updating the JSON Schema
627+
The Schema is generated from the OpenRPC specification. To update the schema, follow the steps below:
628+
629+
1. Run [DAS](https://github.com/metaplex-foundation/digital-asset-rpc-infrastructure) locally
630+
2. Run the following command to generate the schema:
631+
632+
```bash
633+
curl --request POST --url http://localhost:9090 --header 'Content-Type: application/json' --data '{
634+
"jsonrpc": "2.0",
635+
"method": "schema",
636+
"id": 0
637+
}' | jq '.' > metaplex-das-api.json
638+
```
639+
640+
3. Update the beginning of the schema in the `specification` folder manually to allow it being used in the [OpenRPC playground](https://playground.open-rpc.org/?url=https://raw.githubusercontent.com/metaplex-foundation/digital-asset-standard-api/main/specification/metaplex-das-api.json).
641+
642+
```json
643+
// E.g. Instead of the following:
644+
645+
{
646+
"jsonrpc": "2.0",
647+
"result": {
648+
"openrpc": "1.2.6",
649+
"info": {
650+
"title": "",
651+
"version": ""
652+
},
653+
[...]
654+
655+
// replace it with this.
656+
{
657+
"openrpc": "1.2.6",
658+
"info": {
659+
"title": "Metaplex Digital Asset Standard API"
660+
"version": "1.1.0",
661+
},
662+
[...]
663+
664+
// And remove this part of the bottom of the file:
665+
,
666+
"id": 0
667+
}
668+
```
669+
4. Format the JSON file (e.g. using [jq](https://stedolan.github.io/jq/), vscode, etc.).
670+
5. Update the schema in the `specification` folder with the new file.

0 commit comments

Comments
 (0)