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

[BUG] PutTemplateRequest _DESERIALIZER not able to parse the name #417

Closed
chenqi0805 opened this issue Mar 27, 2023 · 2 comments
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@chenqi0805
Copy link
Contributor

What is the bug?

Cannot get template name populated through deserializer

How can one reproduce the bug?

final JsonpMapper mapper = openSearchClient._transport().jsonpMapper();
final JsonpMapper mapper1 = new PreSerializedJsonpMapper();
final Map<String, Object> indexTemplateMap = readIndexTemplate();
indexTemplateMap.put("name", "test-template");
indexTemplateMap.put("index_patterns", "test-index-*");
final String indexTemplate = new ObjectMapper().writeValueAsString(indexTemplateMap);
// Parse byte array to Map
final ByteArrayInputStream byteIn = new ByteArrayInputStream(indexTemplate.getBytes(StandardCharsets.UTF_8));
final JsonParser parser = mapper1.jsonProvider().createParser(byteIn);
final PutTemplateRequest putTemplateRequest = PutTemplateRequest._DESERIALIZER.deserialize(parser, mapper1);

What is the expected behavior?

A clear and concise description of what you expected to happen.

What is your host/environment?

Operating system, version.

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

@wbeckler
Copy link

wbeckler commented Apr 7, 2023

Feel free to add a fix. Is this blocking data-prepper?

@Bfindlay
Copy link
Contributor

I have also been encountering this.
I have raised a PR #723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants