ajv-validator / ajv

The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
https://ajv.js.org
MIT License
13.86k stars 878 forks source link

validateSchema error on unencoded definition names #1131

Closed thejuan closed 4 years ago

thejuan commented 4 years ago

What version of Ajv you are you using? 6.10.2

What problem do you want to solve? Validate JSON Schemas are compliant with spec for use with other systems i.e. AWS

What do you think is the correct solution to problem? validateSchema should throw if definitions are not valid URI paths Currently it coerces them

Will you be able to implement it? Maybe.

I think this runkit should fail https://runkit.com/embed/wp25psmgtnwn definition names have < and > in them

epoberezkin commented 4 years ago

By default Ajv uses simplified regex that only does structural validation. That schema would fail if you use format: 'full' option. See https://runkit.com/esp/5def4d646658c0001a2f2069