Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims at converting the formats defined only by OpenAPI but not in JSON schema v4, into something that is valid JSON schema v4.
All JSON schema v4 formats are left as is. Custom formats are also left as is. However the following OpenAPI-only formats are converted by adding extra keywords:
int32
,int64
,float
,double
: add relatedminimum
andmaximum
keywordsbyte
: addpattern
keyword to match base64. We are using standard base64, not base64url, as this is what is intendedpassword
andbinary
: left as is since they are just semantic/UI hintsI respected the following principles of JSON schema v4:
format
value is valid (i.e. custom formats are possible)type
(including a specific format) might appear even if thetype
is differentI added unit tests.
I also removed the
format
keyword from non-format related unit tests, as this makes tests inter-dependent. Indeed when working on this feature, some unit tests were failing even though they were related to another feature.