tdegrunt / jsonschema

JSON Schema validation
Other
1.82k stars 262 forks source link

Date as custom type #370

Closed urdarinda closed 1 year ago

urdarinda commented 2 years ago

Hi, I wanted to understand why date is a type that is supported out of the box while the json spec does lists it only as a format to string. It should not be a types on its own

In this, we also mention that date is not a type but a format

urdarinda commented 2 years ago

https://github.com/tdegrunt/jsonschema/blob/master/lib/validator.js#L325

awwright commented 1 year ago

This is a custom extension so that you can use this library with other kinds of data besides objects read from JSON. It's not a standard part of JSON Schema.