JSON Schema to check date of YYYY-MM-DD

JSON Schema already have defined format for date, time, datetime, email, hostname, IP address. You can prefer this easier and recommended method rather than writing your own regex.

"date": {
  "type": "string",
  "format": "date"
}

Date and time format names are derived from RFC 3339, section 5.6 [RFC3339].

Reference: http://json-schema.org/latest/json-schema-validation.html#rfc.section.7.3

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)