Skip to content
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

[REQ] Add Decimal Support for Python #19198

Closed
m-standfuss opened this issue Jul 18, 2024 · 2 comments
Closed

[REQ] Add Decimal Support for Python #19198

m-standfuss opened this issue Jul 18, 2024 · 2 comments

Comments

@m-standfuss
Copy link
Contributor

Is your feature request related to a problem? Please describe.

We have a financial api so it deals alot with money, which means we deal with Decimal class in python alot. We tried to use the open api generator for those decimal values and it barfed on us. In order to fix we forked and added this logic in

https://github.com/OpenAPITools/openapi-generator/commit/5ade1775efae9dd866260046c0abe8f6a3fe3f4b.patch

Describe the solution you'd like

I would like decimal backed fields in the API spec to be handled correctly.

Describe alternatives you've considered

This was earlier this year, and I wish I would have logged this sooner when I still had all of my notes, but we tried a ton of different options to try and get the generator to recognize our open api spec as decimals but none worked as documented. We ended up forking and writing those couple of lines in the patch code above on python's api_client.mustache file and it worked perfect.

Additional context

If we are using the generator incorrectly and it does support decimal for python out of the box please let me know but I found all the documentation around it confusing and contradicting.

If the proposed patch file code looks good I can submit it as a PR instead.

@wing328
Copy link
Member

wing328 commented Jul 19, 2024

please open a PR to start with and we will review accordingly

@m-standfuss
Copy link
Contributor Author

Thanks for the look @wing328 here is the PR #19203

i will work on getting the build step setup so i can run it and include as well later today.

Run the following to [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) and update samples:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants