Description
H3Index instances are unable to be serialized to JSON using System.Text.Json, with JsonSerializer.Serialize(someIndex) resulting in an exception:
System.Text.Json.JsonException : A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 64. Consider using ReferenceHandler.Preserve on JsonSerializerOptions to support cycles.
Steps to Reproduce
- Create a
H3Index
- Attempt to serialize it using
JsonSerializer.Serialize()
- Observe stack trace
Expected Result
We should be serializing to/from the hex string representation of the index.
Description
H3Indexinstances are unable to be serialized to JSON usingSystem.Text.Json, withJsonSerializer.Serialize(someIndex)resulting in an exception:System.Text.Json.JsonException : A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 64. Consider using ReferenceHandler.Preserve on JsonSerializerOptions to support cycles.
Steps to Reproduce
H3IndexJsonSerializer.Serialize()Expected Result
We should be serializing to/from the hex string representation of the index.