Skip to content

Support use of JSON Pointers (RFC 6901) for serializing object graphs (Object Id) #5920

@scottslewis

Description

@scottslewis

Is your feature request related to a problem? Please describe.

RFC 6901 specifies the syntax for json pointers.

Currently, upon serialization of an object graph, Jackson inserts a separate copy for each reference. When serializing a large data structure (e.g. a tree) such copying can come at a significant size and transmission cost.

Jackson has JsonIdentityInfo currently for identifying object instances in the serialized stream, but this mechanism is unique to Jackson, and so cannot work for cross-language or cross-library interoperability. Only a specification like RFC 6901 can provide such interoperability.

There exist multiple implementations of the RFC 6901 json pointer syntax for multiple languages, and here are three relatively new ones coming from the jref project:

Java, Typescript,
Python

We (the authors of these implementations) will offer to contribute any/all of them as they are, or with any modifications (or rewrite) as needed to fit into the appropriate Jackson layer or layers. The architecture of these implementations is quite simple...i.e. a depth-first traversal of the given object graph to find and construct json pointers in place of object references).

Describe the solution you'd like

An optional means for Jackson to serialize an object graph and use json pointer syntax to represent a more efficient/compact form for transmission.

Usage example

No response

Additional context

For context relative to the JsonIdentityInfo Jackson annotation, see this discussion

Metadata

Metadata

Assignees

No one assigned

    Labels

    objectidto-evaluateIssue that has been received but not yet evaluated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions