-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[Python][Flask] pythonic params #2374
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
[Python][Flask] pythonic params #2374
Conversation
…file correct with reference to the original spec file.
… conversion of the OpenAPI spec file in Python server implementation(s).
...r/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java
Show resolved
Hide resolved
required: false | ||
schema: | ||
type: integer | ||
format: int32 |
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.
We'll remove this as we want to keep it in sync with petstore.yaml (OAS v2)
Additional test cases should go to https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml instead
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
,./bin/security/{LANG}-petstore.sh
and./bin/openapi3/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,. Default:3.4.x
,4.0.x
master
.Description of the PR
We have an OpenAPI spec file with
camelCase
(query and path) parameters.When generating a Python (
connexion
-based) server those parameters are converted to ("pythonic")snake_case
parameters.During generation of the supporting files there is also an OpenAPI spec file generated for use with
connexion
. This spec file does not match the original one regarding parameter names.Especially when defining "query" parameters, the REST interface will be different than the one defined in the original OpenAPI spec file.
Such (query) parameters are incompatible with generated clients (and other server implementations)
Fixes #1671
We have been using this fix some time on a local checkout for generating
python-flask
server implementations without issues.Notes
This PR also updates the
python-aiohttp
but it is untested.Please feel free to try it out.
These changes do not limit on query or path parameters and should also work on header and cookie parameters.