Skip to content

Conversation

@jimschubert
Copy link
Contributor

Changes the default primitive for number with no specified format from double to decimal in C#.

Other number/integer mappings remain unchanged:

type format C# type
number float System.Float
number double System.Double
number ------ System.Decimal
integer int64 System.Int64
integer int32 System.Int32
integer ------ System.Int32

See #2967 and #2813.

@wing328 this seems like an extremely simple fix, and I feel like I've missed something. I generated the csharp client and verified that types looked fine and tests passed.

@wing328
Copy link
Contributor

wing328 commented May 29, 2016

@jimschubert I agree with you that this should be a simple fix. I'll mark this as a breaking change with fallback as number will be mapped to decimal instead of double.

@wing328
Copy link
Contributor

wing328 commented May 29, 2016

Upgrade note from 2.1.6 to 2.2.0

Starting from 2.2.0, number (without format) will be mapped to decimal? for C#-related generator to make it more consistent with other languages (e.g. Java).

To fallback, please specify the format of the property/parameter as double

Ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants