Open rajsenthil opened 1 year ago
This is a coherence check, as keywords adjacent to enum
are not effective there and can cause confusion: they either disallow some value listed in enum
, or are not doing anything at all.
This can be fixed by either removing unused maxLength
/minLength
keywords that are adjacent to enum
from the schema (recommended), or by using the allowUnusedKeywords: true
option (not recommended).
That said, this is much less dangerous than other types of unused keywords, just something that can cause confusion in the schema. So perhaps a separate option is needed to relax this separately from allowUnusedKeywords
-- I'll think about that.
I have this below json schema drafted with version 2020-12. I tested online here and also using this golang package. The schema is successfully parsed and could validate the json. Using schemasafe I am getting error
Error: Unexpected keywords mixed with const or enum: ["maxLength","minLength"] at #/properties/productType
Can you please check and see if there is any fix for this?
Jsonschema
I am getting error while parsing this jsonschema Error: Unexpected keywords mixed with const or enum: ["maxLength","minLength"] at #/properties/productType