-
Notifications
You must be signed in to change notification settings - Fork 6k
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] number type cast to nonexistent BigDecimal instead of float #9612
Comments
Thanks for the workaround |
I ran into the same issue today with the same version... However the fix to run I ended up using v2.4.7 over v3.0.10 and this seemed to work fine for me. |
frantuma
added a commit
to swagger-api/swagger-codegen-generators
that referenced
this issue
Aug 23, 2019
…en#8855 - fix BigDecimal typeMapping in typescript and python
frantuma
added a commit
to swagger-api/swagger-codegen-generators
that referenced
this issue
Aug 23, 2019
refs swagger-api/swagger-codegen#9612, refs swagger-api/swagger-codegen#8855 - fix BigDecimal typeMapping in typescript and python
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This is coming out of a python flask app, but we are using
--lang python
:A
number
type in ourswagger.json
gets incorrectly mapped toBigDecimal
rather thanfloat
, which is a nonexistent model:will cause you to hit this line in the parent model
which will result in
because
my_client.models.big_decimal
is never generated.Swagger-codegen version
3.0.10
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
swagger.json
with the above snippetRelated issues/PRs
#8855
#9353
Suggest a fix/enhancement
I think this may be because the following line present in the
python-flask
generator is not present in thepython
generator:https://github.com/swagger-api/swagger-codegen-generators/blob/781c5a407c831130285c16eac735d56c0f9edd76/src/main/java/io/swagger/codegen/v3/generators/python/PythonFlaskConnexionCodegen.java#L78
absent in
https://github.com/swagger-api/swagger-codegen-generators/blob/781c5a407c831130285c16eac735d56c0f9edd76/src/main/java/io/swagger/codegen/v3/generators/python/PythonClientCodegen.java#L94
Temporary workaround
I was able to get around this by passing in
--import-mappings BigDecimal=float
toswagger-codegen-cli
The text was updated successfully, but these errors were encountered: