question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove references to jakarta from co.elastic.clients.json.JsonpMapper

See original GitHub issue

Description

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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
unoexpertocommented, Oct 31, 2022

We won’t change this decision

That’s ok 😃 I appreciate your time explaining your position to me!

0reactions
swallezcommented, Nov 2, 2022

Thanks! So I guess we can close this issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found