-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support creating a Swagger def with no schemes #1075
Support creating a Swagger def with no schemes #1075
Conversation
Make it so if you do not specify the schemes then no schemes will be present in the generated Swagger definition. The OpenAPIv2 spec says this means to use the same scheme that was used to access the Swagger definition itself. Fixes #1069
Codecov Report
@@ Coverage Diff @@
## master #1075 +/- ##
=========================================
- Coverage 54.01% 54% -0.02%
=========================================
Files 42 42
Lines 4199 4198 -1
=========================================
- Hits 2268 2267 -1
Misses 1683 1683
Partials 248 248
Continue to review full report at Codecov.
|
I remember from earlier threads that this has the affect that some generators will default to cc @johanbrandhorst I know you have more context on this |
@achew22 unfortunately if the default is not empty there is currently no way to override the default with an empty value. I mentioned some alternatives to changing the default in #1069 (comment) but after further discussion with @johanbrandhorst it seemed like changing the default might be okay after all.
Yes, I looked into three code generators in #1069 (comment) and unfortunately |
I think, on balance, it is not our responsibility to limit the functionality of our project in order to avoid potential security shortcomings of other projects. The rules we should be bound by for the swagger generator should be the swagger spec. We'll have to exercise judgment, of course, but I think we can get the best of both worlds by contributing safer defaults to the downstream projects, too. Do you agree @achew22? I'm happy to discuss further, the security of our users is of course paramount. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @achew22 will wait for your response before merging.
If the analysis has been done then I'm comfortable with it. @ailurarctos thanks for your contribution and for putting up with me 😉! |
Thanks very much @johanbrandhorst and @achew22! |
Make it so if you do not specify the schemes then no schemes
will be present in the generated Swagger definition. The
OpenAPIv2 spec says this means to use the same scheme that
was used to access the Swagger definition itself.
Fixes #1069