Skip to content

[REQ] Add Decimal Support for Python #19198

@m-standfuss

Description

@m-standfuss

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions