Remove references to jakarta from co.elastic.clients.json.JsonpMapper
See original GitHub issueDescription
Hi folks,
I see that you rewrote Java client and instantly I have feature request for you.
I’d like references to jakarta to be removed from co.elastic.clients.json.JsonpMapper
because current abstraction is not much of an abstraction really because it prevents me from implementing json mapper that uses something other than Jackson. In my case I’d love to use Moshi and I’m ready to contribute the implementation to you.
JsonMapper
interface should be something like this:
import java.io.InputStream;
import java.lang.reflect.Type;
public interface JsonMapper {
<T> T deserialize(Type type, String json);
<T> T deserialize(Type type, InputStream source);
<T> void serialize(Type type, T value);
}
Use of Type
instead of Class<T>
is intentional so that we can properly serialize generic value such as List<Map<String, Int>>
whose type will be represented by ParameterizedTypeImpl
.
I’m looking forward to your feedback, @swallez
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
DeleteByQueryRequest (java-client 8.1.0 API) - Elastic
What to do when the delete by query hits version conflicts? Operator, defaultOperator(). The default operator for query string query (AND or OR)....
Read more >JsonpMapper (java-client 8.2.2 API) - Elastic
A JsonpMapper combines a JSON-P provider and object serialization/deserialization based on JSON-P events. Method Summary. All Methods Instance Methods
Read more >JsonbJsonpMapper (java-client 8.2.0 API) - Elastic
Serialize an object. jsonProvider. public jakarta.json.spi.JsonProvider jsonProvider(). Description copied from interface: JsonpMapper.
Read more >JacksonJsonpMapper (java-client 8.1.0 API) - Elastic
Returns the underlying Jackson mapper. <T> void, serialize(T value, jakarta.json.stream.JsonGenerator generator).
Read more >JsonData (java-client 8.1.0 API) - Elastic
declaration: package: co.elastic.clients.json, interface: JsonData. ... this class returned by API clients keep a reference to the client's JsonpMapper and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s ok 😃 I appreciate your time explaining your position to me!
Thanks! So I guess we can close this issue.