ocpp
ocpp copied to clipboard
Strict OCPP 2.0.1 date-time conformity and validation
OCPP 2.0.1 - Part 2 - Section 2.1.4 Primitive Datatypes
"All time values exchanged between CSMS and Charging Station SHALL be formatted as defined in [RFC3339]. Additionally fractional seconds have been given an extra limit. The number of decimal places SHALL NOT exceed the maximum of 3. Example 1: 2019-04-12T23:20:50.52Z represents 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 2019 in UTC. Example 2: 2019-12-19T16:39:57+01:00 represents 39 minutes and 57 seconds after the 16th hour of December 19th, 2019 with an offset of +01:00 from UTC (Central European Time)"
I think we've to roll our own validation. That should be possible according to the json-schema's docs::
To add a check for a custom format use the FormatChecker.checks decorator.
In addition, all date-time formatting in the library should confirm to the above