Unable to validate a schema from https://www.schemastore.org/json/
See original GitHub issueWhat version of Ajv are you using? Does the issue happen if you use the latest version? Latest, 8.11.0 Ajv options object
const ajv = new Ajv2019({ allErrors: true, strict: false });
ajvErrors(ajv);
const validate = ajv.compile(composeSchema);
JSON Schema
Available at https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
I have added HTTPS instead of HTTP to the schema
Sample data
{
version: '3.4',
services: {
'beacon-chain': {
image: 'beacon-chain.lighthouse-prater.dnp.dappnode.eth:0.1.0',
build: { context: 'beacon-chain', args: { UPSTREAM_VERSION: 'v2.2.0' } },
volumes: [ 'beacon-data:/root/.lighthouse' ],
ports: [ '9000/tcp', '9000/udp' ],
restart: 'unless-stopped',
environment: {
BEACON_API_PORT: 3500,
HTTP_WEB3PROVIDER: 'http://goerli-geth.dappnode:8545',
CORSDOMAIN: 'http://lighthouse.dappnode',
CHECKPOINT_SYNC_URL: '',
EXTRA_OPTS: ''
}
},
valdator: {
image: 'valdator.lighthouse-prater.dnp.dappnode.eth:0.1.0',
build: { context: 'valdator', args: { UPSTREAM_VERSION: 'v2.2.0' } },
restart: 'unless-stopped',
environment: {
VALIDATORS_FILE: '/root/.lighthouse/valdators/valdator_definitions.yml',
PUBLIC_KEYS_FILE: '/public_keys.txt',
HTTP_WEB3SIGNER: 'http://web3signer.web3signer-prater.dappnode:9000',
BEACON_NODE_ADDR: 'http://beacon-chain.lighthouse-prater.dappnode:3500',
GRAFFITI: 'valdating_from_DAppNode',
SUPERVISOR_CONF: '/etc/supervisor/conf.d/supervisord.conf',
DEFAULT_VALIDATOR_PUBLIC_KEY: '',
EXTRA_OPTS: ''
}
}
},
volumes: { 'beacon-data': {} },
wrongKey: {}
}
Your code
https://runkit.com/pablomendezroyo/6255f60913beb2000928fafb
const ajv = new Ajv2019({ allErrors: true, strict: false });
ajvErrors(ajv);
const validate = ajv.compile(composeSchema); // FAILS
const valid = validate(compose);
Validation result, data AFTER validation, error messages
NOT SUPPORTED: keyword "id", use "$id" for schema ID
What results did you expect? Valid schema, wrong validation Are you going to resolve the issue? No, but happy to contribute
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
JSON Schema Store
JSON Schemas for common JSON file formats. ... can detect all JSON and YAML files and validate them if a matching schema is...
Read more >Ask Question - Stack Overflow
json file, I got this message: "Problems loading reference 'https://json.schemastore.org/package': Unable to load schema from 'https://json.
Read more >ajv-validator/ajv - Gitter
Hello, im testing ajv v7 beta 3 and with this schema ... it fails with Error: strict mode: "additionalItems" without "items" is ignored...
Read more >Implementations - JSON Schema
Code generation; Web UI generation; Data from schemas. Utilities. General processing; Schema to ... SchemaStore.org - validate against common JSON Schemas ...
Read more >Support json schema draft-06 & draft-07
https ://json-schema.org/draft-06/schema# and ... https://json.schemastore.org/global.json ... Visual Studio is unable to apply validation to the JSON.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
worked with draft7! thanks
Or you can use draft7 instead if you are not using any draft 2019 features - it produces smaller code size for validation functions.