wso2 / micro-integrator

The cloud-native configuration driven runtime that helps developers implement composite microservices.

Home Page:https://wso2.com/integration/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with timestamp validation in json schema

vikumkbv opened this issue · comments

Hi Team,

We have a json schema like this

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "myDateTimeField": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": ["TIME"]
} 

Sample payload

{
  "TIME": "2024-04-08T16:58:48.986063391+02:00"
} 

When we tried this via a validate mediator it is giving the following error

gdcValidationStatus = failed, ERROR_CODE = null, 
ERROR_MESSAGE = string "2024-04-08T16:58:48.986063391+02:00" is invalid against requested date format(s) [yyyy-MM-dd'T'HH:mm:ssZ, yyyy-MM-dd'T'HH:mm:ss.SSSZ], ERROR_DETAIL = Error while validating Json message error: string "2024-04-08T16:58:48.986063391+02:00" is invalid against requested date format(s) [yyyy-MM-dd'T'HH:mm:ssZ, yyyy-MM-dd'T'HH:mm:ss.SSSZ]

Hope we need to update the json schema validator version.

Thanks,
Vikum