Chia-Network / Chia-Network/chips
schema.json is invalid
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 50
- Forks
- 28
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 2
Description
Hi,
I was trying to validate the metadata JSON files against the https://github.com/Chia-Network/chips/blob/metadata-schema/assets/chip-0007/schema.json using https://github.com/ajv-validator/ajv-cli and I got "schema.json is invalid".
Steps to reproduce:
leonid@asus:~$ node -v
v16.16.0
leonid@asus:~$ npm -v
8.11.0
leonid@asus:~$ sudo npm install -g ajv-cli
...
leonid@asus:~$ ajv help
Validate data file(s) against schema
ajv [validate] -s schema[.json] -d data[.json]
ajv [validate] -s schema[.json] -d "data*.json"
Compile schema(s)
ajv compile -s schema[.json]
ajv compile -s "schema*.json"
Migrate schema(s) to draft-07 or draft-2019-09
ajv migrate -s schema[.json] -o migrated_schema.json
ajv migrate -s "schema*.json"
Test data validation result
ajv test -s schema[.json] -d data[.json] --valid
ajv test -s schema[.json] -d data[.json] --invalid
ajv test -s schema[.json] -d "data*.json" --valid
options:
--spec= JSON schema specification to use
draft7 JSON Schema draft-07 (default)
draft2019 JSON Schema draft-2019-09
More information:
ajv help validate
ajv help compile
ajv help migrate
ajv help test
leonid@asus:~$
leonid@asus:~$ git clone https://github.com/Chia-Network/chips.git
Cloning into 'chips'...
remote: Enumerating objects: 607, done.
remote: Counting objects: 100% (139/139), done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 607 (delta 78), reused 130 (delta 70), pack-reused 468
Receiving objects: 100% (607/607), 2.41 MiB | 14.84 MiB/s, done.
Resolving deltas: 100% (275/275), done.
leonid@asus:~$ cd chips
leonid@asus:~/chips$ git checkout metadata-schema
Branch 'metadata-schema' set up to track remote branch 'metadata-schema' from 'origin'.
Switched to a new branch 'metadata-schema'
leonid@asus:~/chips$ cd assets/chip-0007/
leonid@asus:~/chips/assets/chip-0007$ ls -l
total 12
-rw-rw-r-- 1 leonid leonid 1880 Aug 21 10:36 example.json
-rw-rw-r-- 1 leonid leonid 5076 Aug 21 10:36 schema.json
leonid@asus:~/chips/assets/chip-0007$
leonid@asus:~/chips/assets/chip-0007$ ajv validate -s schema.json -d example.json --spec=draft2020
strict mode: use allowUnionTypes to allow union type keyword at "https://raw.githubusercontent.com/Chia-Network/chips/main/assets/chip-0007/schema.json#/properties/sensitive_content" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "https://raw.githubusercontent.com/Chia-Network/chips/main/assets/chip-0007/schema.json#/properties/attributes/items/properties/trait_type" (strictTypes)
strict mode: use allowUnionTypes to allow union type keyword at "https://raw.githubusercontent.com/Chia-Network/chips/main/assets/chip-0007/schema.json#/properties/attributes/items/properties/value" (strictTypes)
schema schema.json is invalid
error: unknown format "uuid" ignored in schema at path "#/properties/collection/properties/id"
leonid@asus:~/chips/assets/chip-0007$
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The reproduction points to assets/chip-0007/schema.json and example.json; start by running the shown ajv validate command with the repository's schema. Confirm the schema compiles without the reported format error and that example.json still validates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100