I have some JSON object:
"opf": {
"type": "2014",
"code": "12247",
"full": "Публичное акционерное общество",
"short": "ПАО"
}
I want it to deserialize it into my class:
class SuggestionInfoDataOpf
{
public string code;
public string full;
public string short; //ERROR. Of course I can't declare this field
public string type;
}
I want to deserialize it like
Newtonsoft.Json.JsonConvert.DeserializeObject<SuggestionInfoDataOpf>(json_str);
but fields names should match.
@short
. or name it however you like, and use the JsonPropertyAttribute – Athabaska