How to validate date format in request attribute
I have to validate that a field in request of a Rest API is having YYYY-MM-DDThh:mm:ss.sssZ format. Any help is most welcome.
TIA
Tagged:
0
I have to validate that a field in request of a Rest API is having YYYY-MM-DDThh:mm:ss.sssZ format. Any help is most welcome.
TIA
Comments
I would use a "Regular Expression Assertion" in a JSON/XML Assertor tool.
The Diff tool's Text mode also has a "Regular Expresion" option.
For ISO 8601 or RFC3339 date-time format, I've used a regex like this. I have it split across multiple lines for readability but you would normally put it all on one line: