There is no need to implement a custom DefaultContractResolver
. The solution is to put [JsonProperty]
on _hexes
and [JsonIgnore]
on all the other properties and fields.
More Related Contents:
- Deserializing polymorphic json classes without type information using json.net
- How can I change property names when serializing with Json.net?
- Parsing JSON using Json.net
- How to deserialize an array of values with a fixed schema to a strongly typed data class?
- JSON.Net throws StackOverflowException when using [JsonConvert()]
- How do I get json.net to serialize members of a class deriving from List?
- “Self Referencing Loop Detected” exception with JSON.Net
- Newtonsoft.JSON cannot convert model with TypeConverter attribute
- Deserialize json array stream one item at a time
- JSON.NET Parser *seems* to be double serializing my objects
- Converting newtonsoft code to System.Text.Json in .net core 3. what’s equivalent of JObject.Parse and JsonProperty
- Serialize Property, but Do Not Deserialize Property in Json.Net
- Self referencing loop detected – Getting back data from WebApi to the browser
- How to make JSON.Net serializer to call ToString() when serializing a particular type?
- How to force Newtonsoft Json to serialize all properties? (Strange behavior with “Specified” property)
- Cannot deserialize the current JSON array (e.g. [1,2,3])
- Cannot deserialize JSON array into type – Json.NET
- How to apply indenting serialization only to some properties?
- Using JSON.net, how do I prevent serializing properties of a derived class, when used in a base class context?
- Repeated serialization and deserialization creates duplicate items
- How to apply ObjectCreationHandling.Replace to selected properties when deserializing JSON?
- Json.net deserialization null guid case
- Serialize only interface properties to JSON with Json.net
- Deserializing JSON into an object with Json.NET
- Ignore Base Class Properties in Json.NET Serialization
- How to deserialize object derived from Exception class using Json.net?
- JSON.NET StackOverflowException while serialization
- NewtonSoft.Json Serialize and Deserialize class with property of type IEnumerable
- Json.net serialization of custom collection implementing IEnumerable
- how to get newtonsoft to deserialize yes and no to boolean