Skip to content

strictProperties for date-time formatMinimum and formatMaximum #179

Open
@avrilvg

Description

@avrilvg

I'm having problems with Json Schema Validator when I'm trying to validate date-time value between interval of time [2013-11-17T00:00Z, 2015-11-17T00:00Z] I have this Json Schema:

{
  "strictProperties": true ,
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "exampleDate": {
          "format": "date-time",
          "formatMinimum": "2013-11-17T00:00Z",
          "formatMaximum": "2015-11-17T00:00Z"
        }
      }
    }
  },
  "required": [
    "data"
  ]
}

And with this json always out is as valid json:

{
    "data": {
        "exampleDate": "2010-11-17T00:00:00Z"
    }
}

But as you can see, this json is not valid because of the date, it is out of valid range.

I've tested in online tools http://www.jsonschemavalidator.net/, http://jsonschemalint.com/draft4/# and with com.github.fge:json-schema-validator:2.2.6. I thougth in order to enable v5 options, should be enough put strictProperties as true (as here https://github.com/fge/json-schema-validator/wiki/v5:-strictProperties), but is not working. Could someone help me please? Maybe I missing some configuration besides strictProperties? some step?. Thanks in advance =)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions