Skip to content
Advertisement

Does not conform date-time in ajv based middy validator

I use middy as validator package which is based on ajv, I set jsonschema like follows

JavaScript

my request is ilke this,this is basically aligned with date-time

JavaScript

But it returned following error response. I totally confused what is the wrong point of that. If someone has opinion ,please let me know. Thanks

JavaScript

I found following list which come from validation packages.I still have not found root cause of this

JavaScript

Advertisement

Answer

Your input "2022-03-06T00:00:00" doesn’t match the date-time regex

JavaScript

It almost does. It matches this part of regex:

JavaScript

You are missing the other part:

JavaScript

Which enforces you to supply a time zone. A few examples:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement