Created by: codymikol
this fixes a bug where the parser would return null when missing parameters rather than reporting some useful error.
Fixes N/A
This bumps the swagger-parser library form 2.0.20 to 2.0.22, this fixes a bug in the parser library that would cause openapi-generator to mysteriously fail when parameters are not defined in your api spec
My original issue was opened over here: https://github.com/OpenAPITools/openapi-generator/issues/7453 , but my fix just prevented openapi-generator from throwing a null pointer exception. This update fixes the underlying problem to that issue.
This is the specific PR that fixed that issue: https://github.com/swagger-api/swagger-parser/pull/1410 (thank you, I appreciate you)
2.0.22 changes: https://github.com/swagger-api/swagger-parser/releases/tag/v2.0.22
2.0.21 changes: https://github.com/swagger-api/swagger-parser/releases/tag/v2.0.21
Changes Related to this version bump
The petstore examples have a new parameter relating to: Add extension to keep track of original swagger version in PR #1374
The InlineModelResolver fixStringModel
method needs to be adjusted per Fix for Empty and Blank query parameters issue PR - #1376 as it will no longer return null values for empty url parameters, but rather empty strings.
There is also a test that essentially just proves the same getExample method will return null, I have changed the test to instead just assert the returned value is an empty string. I do think that this is an unnecessary test for this project as it is essentially testing a 3rd party dependency and would be fine with removing it based on feedback.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
If contributing template-only or documentation-only changes which will change sample output, build the project beforehand. -
Run the shell script ./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
-
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.