Skip to content

Range types do not serialize with the correct property names #8044

Closed
@jeffpapp

Description

@jeffpapp

Elastic.Clients.Elasticsearch version: 8.12.0

Elasticsearch version: 8.12.1

.NET runtime version: .NET 8

Operating system version: Windows 11

Description of the problem including expected versus actual behavior:

The Range types are using [DataMember] attributes to define the JSON property names but these aren't used by System.Net.Json. The JsonPropertyName attribute should be used instead. This causes an error when trying to index a document because the JSON looks like { "greaterThanOrEqualTo": 1, "lessThanOrEqualTo": 2 } instead of { "gte": 1, "lte": 2 }

Expected behavior
Using a range type should properly serialize with the correct JSON property names

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions