Issue with deserializing Enums in saved JSON
Hey, I've been trying to deserialize a list of cards I serialized in C#, the issue I'm having is it converts all the enums perfectly except for the cardResource enum, after researching I learned you could use the stringConverter and it might help, and it did work in converting the enums into strings instead of ints and made the JSON more readable, but still for the cardResource I am always getting the value of 0 or Move
7 Replies
example JSON for card:
as you can see just loading this json, it doesnt convert the enum properly
\
while it converts all the other ones fine
the warning highlighting is also just that it could be null and I am casting it to a nonnullable
so that shouldnt really be an issue
or is it better to just use xml?
Can you post your model too?
It’s just a normal class, should I make a copy that’s just a model, and serialize that then?
I’m not on my pc right now*