Skip to content

Move SystemTextJsonSerializer base class to Elastic.Transport #117

@flobernd

Description

@flobernd

Proposal

Move SystemTextJsonSerializer from Elastic.Clients.Elasticsearch to Elastic.Transport as a public base serializer.

Apply the required modifications to strip IElasticsearchClientSettings.

In Elastic.Transport, make LowLevelRequestResponseSerializer derive from SystemTextJsonSerializer.

In Elastic.Clients.Elasticsearch, make DefaultSourceSerializer derive from SystemTextJsonSerializer.

Intention

This is a predecessor step of moving the static SourceSerialization helper class from Elastic.Clients.Elasticsearch to Elastic.Transport and renaming it to SerializerHelper.

This class should serve as a user-facing interface for (de-)serialization as an alternative to directly calling the methods defined in Serializer.

The class should primarily provide System.Text.Json based overloads (like using Utf8JsonReader, JsonNode, etc. instead of Stream) and internally shortcut these overloads to directly use JsonSerializer, if the given Serializer implementation derives from SystemTextJsonSerializer.

Why?

This makes it easier for our users to further convert object/JsonElement values into specialized types without having to use complicated workarounds.

It as well allows use to use the shortcut serialization path in high level integrations in a standard way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions