Layer7 API Management

Expand all | Collapse all

Validate JSON Schema assertion is not validating the date-time format

Jump to Best Answer
  • 1.  Validate JSON Schema assertion is not validating the date-time format

    Posted 06-26-2018 07:14 AM

    I am using Gateway Version 9.0. I have created a JSON Shema as per the Draft -2 (draft-zyp-json-schema-02 - JSON Schema: core definitions and terminology ) to validate a date-time field as below. 

     

    JSON Schema:

        {
          "$schema": "http://json-schema.org/draft-04/schema#",
             "type": "object",
                "properties": {
                   "myDateTime": {
                              "type": "string",
                             "minLength": 1,
                             "format": "date-time"
                      }         

          }}

       

    I was expecting "Validate JSON Schema" assertion to fail against the below JSON Request, But it didn't.

     

    JSON Request:

        { "myDateTime": "thisisnotvalid" }



  • 2.  Re: Validate JSON Schema assertion is not validating the date-time format
    Best Answer

    Posted 07-03-2018 06:59 PM

    JsonValidation for Schema V2 does not have support for the "format" field (Draft V2 Section 5.20). 

    In Gateway 9.3 we support Json Schema Validation V4 with the format field.

    Please upgrade to gateway 9.3

     

    Please refer to document,

    Known Issues - CA API Gateway - 9.0 - CA Technologies Documentation