Closed tonnylitao closed 8 years ago
@TonnyTao thank you for reporting this issue. Can you please provide us with a simple application to reproduce this problem, see Reporting issues?
why force change type to int? Is it a bug?
See #168 which introduced this change, and the issues #143 and #167 it was fixing.
I think this may be a bug in the iOS SDK if it does not correctly support numeric ids. @hideya could you please check?
@TonnyTao would you please check the type of the property with which you are having the trouble?
I guess it is set to any
. My understanding is that the coercion code runs only for untyped arg.
If it were any
, would you check what Obj-C type do you use for the property? It needs to be id
, and the code needs to be prepared for handling any type including NSString
and NSNumber
.
I checked iOS SDK's behavior against any
, and found it is a bit tricky.
Say, a model with a property of any
type is defined on the server side, and on the iOS app side, I declare the property type is NSString
. Then if I set a string like @"123"
to the property in the iOS app, save the model to and retrieve it from the server, then the property holds an object of type NSNumber
(@123
) regardless of the Obj-C type declaration. I guess this might be something happening in your app. If it is the case, I'd say it is not a bug but an issue cause by the type mismatch (please consider to specify string
explicitly on the server side). Does this make sense?
@TonnyTao, I see that this issue is pretty old so I will close it. If you are still having issues, please re-open and mention me directly and I will see what I can do!
json data in http post body will lost it's type. And will cause a crash bug in iOS project if got unexpected type.
such as
it will become
why force change type to int? Is it a bug?