Mismatch in datatype of DateCode 'components/component/transceiver/state/date-code' : implementation vs expectation
Closed this issue · 5 comments
To bring to your notice, we observe that there is a mismatch of datatype of date-code in implementation and the expected value.
DateCode *string path:"state/date-code" module:"openconfig-platform-transceiver/openconfig-platform-transceiver"
| +--ro date-code oc-yang:date-and-time
Hence unmarshalling fails with ondatra automation.
Get(t) on dut(DUT) at &{{Component_Transceiver true 0xc003b5d740 0x61c9a40 0x61c9ae0 0xc0030d8fc0 true}}: noncompliant data encountered while unmarshalling leaf: Noncompliance Errors by category:
Path Noncompliance Errors: None
Type Noncompliance Errors: None
Value Restriction Noncompliance Errors:
/root/components/component/transceiver/state/date-code: schema "date-code": "2022-10-17T00:00:00Z+00:00" does not match regular expression pattern "^([0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])[Tt](0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9]):(0[0-9]|[1-5][0-9]|60)(\\.[0-9]+)?([Zz]|([+-](0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9]))))$"
@greg-dennis @DanG100 I think this is about ygnmi ygot-generated code, as @jyotigup-cisco discovered while working on openconfig/featureprofiles#1188
@wenovus for any ygot implications
This is working as intended, the string "2022-10-17T00:00:00Z+00:00" does not match the regex and is not valid. Either "Z" or "+00:00", but not both should be specified for a RFC3339 date and time string.
It looks like the regex is correct for the standard, but the text description isn't https://github.com/openconfig/public/blob/master/release/models/types/openconfig-yang-types.yang#L145
Wow, thanks for looking! I missed that Z and UTC offset are mutually exclusive. Nice catch!
Closing issue as intended behavior