Skip to content

Does not support JSON serialization using System.Text.Json #26

Description

@pocketken

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

  1. Create a H3Index
  2. Attempt to serialize it using JsonSerializer.Serialize()
  3. Observe stack trace

Expected Result

We should be serializing to/from the hex string representation of the index.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions