Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix date string format validation (#130)
Quoting from the JSON schema validation vocabulary > date: A string instance is valid against this attribute if it is a > valid representation according to the "full-date" production. and from RFC 3339 ``` date-fullyear = 4DIGIT date-month = 2DIGIT ; 01-12 date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on ; month/year full-date = date-fullyear "-" date-month "-" date-mday ``` The current implementations allows date strings that don't comply, for example `"12-12-12"`. The regex based check fixes that. References: * OAS 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#dataTypes * JSON validation vocabulary https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-7.3 * RFC 3339, section 5.6 https://datatracker.ietf.org/doc/html/rfc3339#section-5.6 Co-authored-by: Nemo Oudeis <dfrey@moneytree.jp>
- Loading branch information