1

I'm using the ruby gem json-schema

I have json schema code that uses format "date" which doesn't work, however, "format": "date-time" works. Any clue why it's not working?

schema.json

{
  "id": "url here",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Person",
  "description": "Person data",
  "type": "object",
  "definitions": {
  },
  "properties": {
    "arrival": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        }
      },
      "required": ["date"]
    }
  },
  "required": ["arrival"]
}
abdi test
  • 11
  • 1
  • Seems like your schema is too old. The separate `date` and `time` formats were introduced in draft 7. – Stefan May 09 '19 at 12:09
  • @Stefan this is using the json-schema ruby gem which uses draft 4 : / . Thanks. Do you know a way around without using pattern matching? – abdi test May 09 '19 at 13:00

0 Answers0