You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jakarta.json.JsonException: Cannot find a serializer for type java.lang.String. Consider using a full-featured JsonpMapper.
at org.opensearch.client.json.JsonpUtils$1.serialize(JsonpUtils.java:84)
at org.opensearch.client.json.JsonpUtils.serialize(JsonpUtils.java:158)
at org.opensearch.client.opensearch.core.IndexRequest.serialize(IndexRequest.java:288)
at org.opensearch.client.json.PlainJsonSerializable.toJsonString(PlainJsonSerializable.java:29)
at opensearchtest.OpenSearchSerializationTest.indexRequestToJson(OpenSearchSerializationTest.java:16)
What is your host/environment?
Java 21, opensearch-java 2.22.0
Do you have any additional context?
This is an isolated test, but in the context of our application we use toJsonString() to log the content of various requests and responses. I can probably work around with a custom serialization utility, but I was expecting this to "just work". Why expose it otherwise?
The text was updated successfully, but these errors were encountered:
What is the bug?
IndexRequest.toJsonString()
fails withJsonException
.How can one reproduce the bug?
Consider this minimal JUnit 5 test:
It fails with:
What is your host/environment?
Java 21, opensearch-java 2.22.0
Do you have any additional context?
This is an isolated test, but in the context of our application we use
toJsonString()
to log the content of various requests and responses. I can probably work around with a custom serialization utility, but I was expecting this to "just work". Why expose it otherwise?The text was updated successfully, but these errors were encountered: