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

Decimal type is missed for number format. What is a reason? #316

Closed
alexkostyanikov opened this Issue Mar 26, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@alexkostyanikov
Copy link

alexkostyanikov commented Mar 26, 2015

Hello,
I am developing a swagger documentation for our API and encountered with misunderstanding:
Decimal type is missed for number format.
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#data-types

It is very important for us to use Decimal type because of we work with financial systems.
Is it possible to include Decimal type to the spec?
Thank you

@webron

This comment has been minimized.

Copy link
Member

webron commented Mar 26, 2015

Don't float and double cover that (and number in general)?

@fehguy

This comment has been minimized.

Copy link
Contributor

fehguy commented Mar 26, 2015

i believe (and this may not be what's in the swagger spec), that number without a format implies decimal

@alexkostyanikov

This comment has been minimized.

Copy link

alexkostyanikov commented Mar 26, 2015

There is one more type is used in .Net.
The float keyword signifies a simple type that stores 32-bit floating-point values
The double keyword signifies a simple type that stores 64-bit floating-point values.
The decimal keyword indicates a 128-bit data type.

Now we don't have a way to understand what a type exactly we have to expect.

@webron

This comment has been minimized.

Copy link
Member

webron commented Mar 26, 2015

The specification can't relate to specific data types in specific languages. Is decimal in .Net fixed or floating point?

The spec does allow you to use whichever format you want, so if you want to call it float128bit or decimal, you can. It doesn't mean the tools will be able to parse it automatically though. As for the type, it's definitely number in this case.

@alexkostyanikov

This comment has been minimized.

Copy link

alexkostyanikov commented Mar 26, 2015

Decimal is a floating point.

"The spec does allow you to use whichever format you want"
Cool. Where i can read about this? Developers which create frameworks strongly follow to spec instruction.

@webron

This comment has been minimized.

@alexkostyanikov

This comment has been minimized.

Copy link

alexkostyanikov commented Mar 26, 2015

ah. thanx a lot

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