Open stesvis opened 5 years ago
😨 Yes that should be working.
1.7.2 was a minor change to fix a bug where int->string conversions on Ids were not occurring on relationships, but it included some refactoring of Id processing code. There must be tests missing around null ids
Will fix this ASAP!
Thanks @alex-davies ! Yes it has to do with null Ids because it happens when I serialize objects during creation, so the Id is null.
It also seems to happen in v1.7.0 but only in iOS...
Issue should be solved in 1.7.3 (https://github.com/codecutout/JsonApiSerializer/pull/104)
Not sure about your iOS issue, are you using the serializer in xamarin?
Also with the later versions of the library you no longer need to convert int
ids to string
, it will now output int
s as strings when serialising
Thank you! After a "clean solution" i rebuilt it and it worked in iOS on v1.7.0
So i can just leave public int Id {get; set;}
?
Btw, this is an awesome package, you did a great job! I'll wait for v1.7.3 (still can't see the update)
Not sure if v1.7.0 was supposed to work with Id as an int only, but i tried and i got this exception:
{System.InvalidCastException: Specified cast is not valid. at (wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr) at JsonApiSerializer.Util.WriterUtil.ShouldWriteProperty[T] (System.Object value, Newtonsoft.Json.Serialization.Json…}
I'll try again once i can install v1.7.3
Hello, after updating from v1.7.0 to v1.7.2 I get this exception when I execute
JsonConvert.SerializeObject(postData, new JsonApiSerializerSettings())
:My postData is a class that inherits from a BaseDTO that looks like this:
It always worked up until v1.7.0. What changed, shouldn't that keep working as before at least?