schemars icon indicating copy to clipboard operation
schemars copied to clipboard

format `double` & `int64` & `int` not compatible with ajv

Open 0x8f701 opened this issue 4 years ago • 3 comments
trafficstars

I use schemars to generate schema but the generated schema cannot be validated by ajv, https://github.com/ajv-validator/ajv

0x8f701 avatar Aug 15 '21 12:08 0x8f701

if I remove all format: int64, format:int, format:double then it's ok

0x8f701 avatar Aug 15 '21 12:08 0x8f701

That sounds like a bug in ajv:

https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.7.2.3

An implementation MUST NOT fail validation or cease processing due to an unknown format attribute.

ahl avatar Aug 18 '21 22:08 ahl

I had the same problem with "format": uint with Ruff and it was likewise solved by removing it.

JonathanPlasse avatar Jan 22 '23 13:01 JonathanPlasse