You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swagger provides the field format for integer types to distinguish between int32 and int64 (https://swagger.io/specification/#dataTypeFormat). This field is parsed in IntegerItem, though the SwiftFormatter ignores it and uses always Int as Swift type.
This can lead to loss of data, e.g. when Swagger specification contains int32 and generated code is running on device with 64-bit architecture. Putting a value bigger than int32 max into the field will result in a wrong value on receivers side.
The text was updated successfully, but these errors were encountered:
Hi @martinknabbe.
Yes, you’re right. This was actually done on purpose to make working with Ints easier to work with in the swift client, and follows Apple’s recommendations with regards to the use of Int.
I can understand though if someone would want to be more strict for certain use cases, so it should be an option added to the template. I don’t have time to work on this right now, but would happily accept a PR.
Swagger provides the field format for integer types to distinguish between int32 and int64 (https://swagger.io/specification/#dataTypeFormat). This field is parsed in IntegerItem, though the SwiftFormatter ignores it and uses always Int as Swift type.
This can lead to loss of data, e.g. when Swagger specification contains int32 and generated code is running on device with 64-bit architecture. Putting a value bigger than int32 max into the field will result in a wrong value on receivers side.
The text was updated successfully, but these errors were encountered: