Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeffpapp opened this issue Feb 21, 2024 · 1 comment · Fixed by #8053
Closed

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

jeffpapp opened this issue Feb 21, 2024 · 1 comment · Fixed by #8053
Labels
8.x Relates to a 8.x client version Area: Client Category: Bug

Comments

@jeffpapp
Copy link

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

@jeffpapp jeffpapp added the 8.x Relates to a 8.x client version label Feb 21, 2024
@flobernd flobernd added the bug label Mar 4, 2024
@flobernd
Copy link
Member

flobernd commented Mar 4, 2024

Good catch! Thanks for reporting. This is probably a lookover from the time when this was ported over from NEST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version Area: Client Category: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants