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

Elastic Search import ENUM type deserialization error for JSON payload. #2097

Closed
whitingjr opened this issue Oct 17, 2024 · 0 comments · Fixed by #2107
Closed

Elastic Search import ENUM type deserialization error for JSON payload. #2097

whitingjr opened this issue Oct 17, 2024 · 0 comments · Fixed by #2107
Assignees
Labels
area/backend priority/high High priority type/bug Something isn't working

Comments

@whitingjr
Copy link
Collaborator

Describe the bug

Users that are providing a Payload in JSON provide a type attribute.
Currently users defining the type in lower case will always see the request rejected.

Could not parse request: {"type":"search","index":"blah","query":{"from":0,"size":3,"query":{"bool":{"must":[{"term":{"name.keyword":"Foo bar baz"}}]}}, Cannot deserialize value of type io.hyperfoil.tools.horreum.datastore.ElasticsearchDatastore$RequestType from String "search": not one of the values accepted for Enum class: [SEARCH, MULTI_INDEX, DOC]}}

To Reproduce

Provide an upload JSON with the type in lower or mixed case.

{"type":"search","index":"blah","query":{"from":0,"size":3,"query":{"bool":{"must":[{"term":{"name.keyword":"Foo bar baz"}}]}}

Expected outcome

The type is converted to upper case before attempting the ENUM lookup.

Version

0.15.6

Java

17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend priority/high High priority type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants