json-schema
json-schema copied to clipboard
JsonType missing "integer" as an allowed value
Currently the definition of JsonType
is as follows: https://github.com/hyperjump-io/json-schema-core/blob/c808bedbb80e90b649b263c92c38df23a32e87bb/lib/common.d.ts#L1
I've haven't read all the specs, but draft-07 and 2020-12 have identical definitions for "type":
String values MUST be one of the six primitive types ("null", "boolean", "object", "array", "number", or "string"), or "integer" which matches any number with a zero fractional part.
It appears "integer"
is missing from the definitions.
Links to the specifications:
- https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6.1.1
- https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#section-6.1.1
That type intentionally only includes JSON types, which doesn't include "integer".
However, it appears I have incorrectly used that type in the Schema types such as, https://github.com/hyperjump-io/json-schema-validator/blob/main/lib/draft-2020-12.d.ts#L51. I'll need to define a new type to use in the schema types.
Thanks for bringing reporting this issue!