C
C#13mo ago
Hampus

Deserialization of json object

I have this method and im trying to deserialize it into the JsonData class. ill send images of the method, as well as the error im getting. I'll also post images of what im trying to deserialize it into, as well as the data that is in the json file.
No description
No description
No description
No description
No description
10 Replies
Hampus
HampusOP13mo ago
No description
FestivalDelGelato
probably parameter name roomSlug should be slug
Hampus
HampusOP13mo ago
I changed that in the jsonfile but it still didn’t work
FestivalDelGelato
the param name in the class, not the json
Hampus
HampusOP13mo ago
So I can’t change it in the json file?
FestivalDelGelato
as long as the field name is the same everywhere it's ok
Hampus
HampusOP13mo ago
hm, i cant seem to solve it
Hampus
HampusOP13mo ago
No description
Hampus
HampusOP13mo ago
No description
Hampus
HampusOP13mo ago
isnt this strange i solved it the parameters in the constructor apparently had to be the same as in the json file makes sense

Did you find this page helpful?