-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix validation of date-time field in API and Parameter schemas (#29395)
The open-api-schema-validator 0.4.3 made RFC3339 validation of the date-time fields mandatory and this revealed problems in our test URLs - the '+' was not url-encoded and it was replaced with space - thus the dates passed were not valid RFC3339 date-time specifications. This however revealed one more problem. The RFC3339-validator package is automatically installed by the open-api-schema-validator, but when installed, it also adds validation to date-time fields validated by the Params of ours - for example naive date-time parameters. We are limiting the supported parameters now to be iso8601-compliant for backwards compatibility but we deprecate iso8601 in favor of RFC3339. This might introduce breaking changes for users who use non-valid date-time parameters in the API, however we should consider that as a bugfix, and accidental support, because the date-time schema should expect RFC3999-formatted date time. Co-authored-by: Andrey Anshin <Andrey.Anshin@taragol.is>
- Loading branch information
Showing
9 changed files
with
170 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The date-time fields passed as API parameters or Params should be RFC3339-compliant. | ||
|
||
In case of API calls, it was possible that "+" passed as part of the date-time fields were not URL-encoded, and | ||
such date-time fields could pass validation. Such date-time parameters should now be URL-encoded (as ``%2B``). | ||
|
||
In case of parameters, we still allow IS8601-compliant date-time (so for example it is possible that | ||
' ' was used instead of ``T`` separating date from time and no timezone was specified) but we raise | ||
deprecation warning. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.