Skip to content

schema.json is invalid #29

@IMD-Solutions-xyz

Description

@IMD-Solutions-xyz

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$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions