fix(json-schema-2020-12-samples): Don't use maxint as default example value for int32 and int64 #10230
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.
Description
Swagger UI's example generator for OpenAPI 3.0 and 2.0 uses
0
as the default example value for integers withformat: int32
andformat: int62
. But the example generator for OAS 3.1 uses1073741824
and9007199254740991
for some reason.This change in example values can confuse people who migrate from OAS 3.0 to 3.1 - as reported in #9816. Also these huge values are unlikely to be encountered in real-life APIs.
This PR changes the default int32 and int64 examples used for OAS 3.1 back to
0
for consistency between OAS 3.1 and 3.0/2.0 example generators.Note
If you prefer 1 (or 2 or another "small" number) as the default example value, let me know and I'll update the PR.
Motivation and Context
How Has This Been Tested?
Tested manually + updated unit tests.
Screenshots (if appropriate):
Before:
After:
Test schema:
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests