ERROR in validation: ... validation error: '2023-03-23 13:35:45' is not a 'date-time' - 'timestamp'
niv-Inator opened this issue · 2 comments
Hello guys,
we just upgraded
openapi-schema-validator | 0.4.0 | 0.4.4
openapi-spec-validator | 0.3.0 | 0.5.6
and now in certain situations we get the following error:
[2023-04-12 10:55:55,777] ERROR in validation: http://127.0.0.1:9081/xrfapi/xrfDetectorCalibration/import validation error: '2023-03-23 13:35:45' is not a 'date-time' - 'timestamp'
when processing JSON data that looks like this:
{
"uuid": "eea1804b-542f-4d6c-b88b-b2f2c0dc5915",
...
"timestamp": "2023-03-23 13:35:45",
...
}
The identical json worked without issues before. Any troubleshooting hints?
It is possible that the upgrade pulled other upgrades that cause this effect or that it did not pull other upgrades it should have pulled -- anything to watch out for?
Upgrading openapi-schema-validator is not the root cause here. It works with both old and new versions of openapi-schema-validator. The important thing is that upgrading openapi-schema-validator pulls in rfc3339-validator. The presence of rfc3339-validator is a problem.
- With
rfc3339-validatorinstalled'2023-03-23 13:35:45' is not a 'date-time' - With
rfc3339-validatorremoved '2023-03-23 13:35:45' becomes a date-time with all versions ofopenapi-schema-validator
Can you explain that behavior? Can it be configured? Is removing rfc3339-validator the right thing for us? If so, why does openapi-schema-validator pull rfc3339-validator now in the first place?
Hi @niv-Inator
thanks for the report.
You get the validation error because your value is invalid date-time format based on RFC 3339, section 5.6
The issue was fixed in version 0.4.4 and when you choose to remove rfc3339-validator format checker skips date-time format validation.