<div dir="auto"><div><p dir="ltr">Hello,</p>
<p dir="ltr">So, if such a Json library is added to the JDK, the Java Http module now should accept a JsonDocument implementing something like BodyPublishers.ofJsonDocument, or better yet BodyPublishers.ofJsonEncodable (assuming Eteh proposal).</p><p dir="ltr">I think also JDBC API should be modified so prepared statements can implement .setJson and .getJson for DBMS supporting Json type (like Postgres).</p><p dir="ltr">David.</p><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>De: <strong class="gmail_sendername" dir="auto">Paul Sandoz</strong> <span dir="auto"><<a href="mailto:paul.sandoz@oracle.com" target="_blank" rel="noreferrer">paul.sandoz@oracle.com</a>></span><br>Date: mar, 20 de may de 2025, 14:46<br>Subject: Re: Towards a JSON API for the JDK<br>To: Swaranga Sarma <<a href="mailto:sarma.swaranga@gmail.com" target="_blank" rel="noreferrer">sarma.swaranga@gmail.com</a>><br>Cc: Remi Forax <<a href="mailto:forax@univ-mlv.fr" target="_blank" rel="noreferrer">forax@univ-mlv.fr</a>>, Brian Goetz <<a href="mailto:brian.goetz@oracle.com" target="_blank" rel="noreferrer">brian.goetz@oracle.com</a>>, core-libs-dev <<a href="mailto:core-libs-dev@openjdk.org" target="_blank" rel="noreferrer">core-libs-dev@openjdk.org</a>><br></div><br><br>Data binding is a complex feature, even if some examples make it appear simple. Our intention is to explore alignment with the serialization 2.0 effort, when we are ready to so. Hence, I would urge folks to be patience and watch out Brian and Viktor’s Devoxx 2024 talk on the topic.<br>
<br>
Paul.<br>
<br>
> On May 20, 2025, at 12:21 PM, Swaranga Sarma <<a href="mailto:sarma.swaranga@gmail.com" rel="noreferrer noreferrer" target="_blank">sarma.swaranga@gmail.com</a>> wrote:<br>
> <br>
> > A potential advantage that we (the OpenJDK community) can more easily do is devise an API that resonates with direction the Java platform is heading, specifically around the pattern matching and serialization 2.0<br>
> <br>
> Right, but most of the discussion here seems to be on the low level tree API and how one might navigate it (perhaps using pattern matching). I am not seeing any discussion on the serialization/deserialization or any reasoning why that is not the goal of the new JEP. Basically a very focused and narrow API:<br>
> <br>
> ```<br>
> var jsonStr = "..."<br>
> var myRecord = Json.deserialize(jsonString, UserRecord.class); //and a few other variants<br>
> var serialized = Json.serialize(myRecord)<br>
> ```<br>
> <br>
> This leaves the tree API open to reimplementation later when pattern matching and other features are firmly in place in the JDK. I am making a case that this would be more immediately useful for the most common and simpler cases.<br>
> <br>
> <br>
> Regards<br>
> Swaranga<br>
<br>
</div></div></div>