Skip to content
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

Fixed deserializing GeoValidationMethod enum values when uppercase #1431

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Fixed
- Fixed serialization of `KnnQuery`'s `method_parameters` property ([#1427](https://github.com/opensearch-project/opensearch-java/pull/1427))
- Fixed deserializing `GeoValidationMethod` enum values when uppercase ([#1431](https://github.com/opensearch-project/opensearch-java/pull/1431))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,32 @@

@JsonpDeserializable
public enum GeoValidationMethod implements JsonEnum {
Coerce("coerce"),
Coerce("coerce", "COERCE"),

IgnoreMalformed("ignore_malformed"),
IgnoreMalformed("ignore_malformed", "IGNORE_MALFORMED"),

Strict("strict"),
Strict("strict", "STRICT"),

;

private final String jsonValue;
private final String[] aliases;

GeoValidationMethod(String jsonValue) {
GeoValidationMethod(String jsonValue, String... aliases) {
this.jsonValue = jsonValue;
this.aliases = aliases;
}

@Override
public String jsonValue() {
return this.jsonValue;
}

@Override
public String[] aliases() {
return this.aliases;
}

public static final JsonEnum.Deserializer<GeoValidationMethod> _DESERIALIZER = new JsonEnum.Deserializer<>(
GeoValidationMethod.values()
);
Expand Down
Loading