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

Type for money (decimal) #376

Closed
worldmind opened this issue Jan 5, 2017 · 7 comments
Closed

Type for money (decimal) #376

worldmind opened this issue Jan 5, 2017 · 7 comments

Comments

@worldmind
Copy link

Now connexion cast number to float, but for money parameters needed decimal type

@rafaelcaricio
Copy link
Collaborator

@worldmind please take a look at http://connexion.readthedocs.io/en/latest/cookbook.html#custom-type-format . Let me know if it does not help.

@worldmind
Copy link
Author

If i understood right is only part of solution - it is only about validation, but user shoud be manually convert goted string to decimal type for using it.
I think it framework job - it must return value with right type.

@rafaelcaricio
Copy link
Collaborator

I think if we would do this in Connexion we would need to carry out all the responsibility to handle precision, etc. Not sure how we would tackle this issue.

@rafaelcaricio
Copy link
Collaborator

Also OpenAPI spec does not provide the decimal type.

@rafaelcaricio
Copy link
Collaborator

Due to no support for decimals in the OpenAPI spec, I think this issue should be closed. You can support decimal in your API, but you need to implement yourself the conversion.

@worldmind
Copy link
Author

Create OAI/OpenAPI-Specification#889

@worldmind
Copy link
Author

As I understood they think that frameworks must create decimal values from type: number, format: decimal and some people do it OAI/OpenAPI-Specification#607 (comment)
They move formats from specification to separate registry in OAI/OpenAPI-Specification#845 and add format decimal in OAI/OpenAPI-Specification#607
I think that will be not bad if connexion will support format decimal and convert type: number, format: decimal to Decimal type.

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