Sometimes it may be necessary to perform date validation to confirm invalid data is not supplied.
For example, you may need to prevent bad data like February 52, 2018 from being sent to a back end server.
The attached sample policy retrieves a data from a JSON Payload and validates it. This will also check for valid leap years. February 29, 2018 will fail where as February 29, 2020 will success as it is a valid leap year.
1) Load the sample policy in policy manager
2) Edit the date on line 2 to any value, ie: 2020-10-52 (October 52, 2020 as an example of invalid data)
3) Consume the service