<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg" -->

---
title: Java finally gets a JSON API, and it's not for you
description: JEP 540 brings a built-in JSON parser incubator API to the JDK, targeted for Java 28, aimed at lightweight use cases like config files and small HTTP payloads...
canonical: https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Java finally gets a JSON API, and it's not for you | daily.dev
og:description: JEP 540 brings a built-in JSON parser incubator API to the JDK, targeted for Java 28, aimed at lightweight use cases like config files and small HTTP payloads...
og:url: https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg
og:image: https://api.daily.dev/og/posts/VpZQR7npG.png
og:image:alt: Java finally gets a JSON API, and it's not for you
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Java finally gets a JSON API, and it's not for you

**[Trends](https://daily.dev/sources/trends)** · 3 min read · 17 upvotes · 1 comments

## Summary

JEP 540 brings a built-in JSON parser incubator API to the JDK, targeted for Java 28, aimed at lightweight use cases like config files and small HTTP payloads rather than replacing Jackson. Presented at Devoxx Belgium as part of a Data-Oriented Programming approach, it models JSON as a sealed value hierarchy with parse, toDisplayString, get, tryGet, and tryValue methods. The parser strictly enforces RFC 8259, rejecting comments, trailing commas, and duplicate keys. Missing pieces include mature JSON generation, BigDecimal/BigInteger handling in the core surface, and record-to-JSON mapping, which is expected to dominate incubator feedback. The JEP also appeared alongside confined memory arenas and PEM encodings in JDK 28 proposal discussions.

## Content

The JDK is about to ship its own JSON parser, and the pitch is almost aggressively modest. JEP 540 is an incubator API targeted at Java 28 for the small stuff: a config file, an HTTP payload, a prototype. The kind of job where adding Jackson to the build feels like hiring a moving company to carry one chair.

The talk from Devoxx Belgium, "Everyday JSON in Java," is explicit that this isn't a Jackson replacement. It's a design trade-off walkthrough, and Data-Oriented Programming is doing the heavy lifting. The model is a sealed JSON value hierarchy: string, number, boolean, null, object, array. You get `parse` and `toDisplayString`, plus `get`, `tryGet` and `tryValue` for navigating.

## The strict part

The sharpest design choice is that the parser enforces RFC 8259 and nothing else. No comments. No trailing commas. No duplicate member names. The speakers reject Postel's law-style leniency outright, which will annoy anyone who has ever hand-edited a JSON config and wanted to leave a note to future self. Strictness is a feature when you're the one debugging a payload that two parsers read differently. It's a tax when you're editing by hand.

## What the demos show

The examples are deliberately mundane:

- Reading a config file
- Building an HTTP JSON request
- Averaging temperatures from a weather API response
- Parsing JDK thread dumps and JFR recordings, which already emit JSON

That last one is the quiet argument for inclusion. The JDK is already producing JSON, so consuming it without a dependency is a fair ask.

## What's missing

The speakers are upfront about the gaps. JSON generation support is immature. There's no built-in `BigDecimal` or `BigInteger` handling in the core surface, though the JEP documents it. And there's no record-to-JSON mapping, which is exactly the feature most developers will reach for in the first five minutes. Expect that to be the center of the incubator feedback.

Possible future integration points include HTTP client body handlers, JMX over JSON, and persisting `Properties` as JSON.

## Where it sits

JEP 540 also turned up in the latest Java Weekly (issue 667) alongside other JDK 28 proposals: confined memory arenas and PEM encodings. Meanwhile the same issue lists Maven 3.10.0 and Hibernate 8.0.0.Beta3.

My read: the real fight won't be over the parser. It'll be over how long the JDK can stay out of object mapping before everyone demands it.

## Questions this post answers

### What is JEP 540 and what does it add to Java 28?

JEP 540 is an incubator JSON API targeted for Java 28 that adds a built-in JSON parser to the JDK, intended for small tasks like reading config files or building HTTP payloads rather than replacing libraries like Jackson. It models JSON as a sealed hierarchy of string, number, boolean, null, object, and array types, with parse, toDisplayString, get, tryGet, and tryValue methods.

_Track JDK proposals like this one on daily.dev to stay ahead of changes affecting how you handle JSON in Java._

### Does the new JDK JSON parser in JEP 540 support lenient parsing like comments or trailing commas?

No, the JEP 540 parser strictly enforces RFC 8259 with no leniency allowed: no comments, no trailing commas, and no duplicate member names. The designers deliberately rejected Postel's law-style leniency, prioritizing consistent, predictable parsing over convenience when hand-editing JSON files.

_Developers weighing strict versus lenient parsing trade-offs can follow Java ecosystem debates like this on daily.dev._

### Does JEP 540 support converting Java records to JSON automatically?

No, record-to-JSON mapping is not included in JEP 540. This is noted as the feature most developers will likely request first, since JSON generation support overall is still immature and there is no built-in BigDecimal or BigInteger handling in the core surface, though the JEP documents it.

_Anyone deciding whether to adopt the new JDK JSON API or stick with Jackson can follow this discussion on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@pdfopsdev** · 2 upvotes

> record-to-JSON mapping missing is going to be the thing everyone complains about in the incubator feedback, that's literally the only reason most people would reach for a built-in parser instead of Jackson. strict RFC 8259 enforcement (no trailing commas) will also bite anyone copy-pasting config from JS land.

## Similar posts on daily.dev

- [Java News Roundup: Simple JSON API, JEPs for JDK 28, Oracle CPUs, Embabel 1.0, Azul Payara, Helidon](https://daily.dev/posts/java-news-roundup-simple-json-api-jeps-for-jdk-28-oracle-cpus-embabel-1-0-azul-payara-helidon-yhdif1kfx) · InfoQ · 2 upvotes · 0 comments
- [JDK 27: The quiet before the storm](https://daily.dev/posts/jdk-27-the-quiet-before-the-storm-eixxzoapd) · InfoWorld · 2 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java)

[View this post on daily.dev](https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Java finally gets a JSON API, and it's not for you","url":"https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg"},"datePublished":"2026-10-14T07:44:50.397Z","dateModified":"2026-10-14T07:45:29.581Z","description":"JEP 540 brings a built-in JSON parser incubator API to the JDK, targeted for Java 28, aimed at lightweight use cases like config files and small HTTP payloads...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32bf638c636109231e23c03afad232f8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32bf638c636109231e23c03afad232f8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Trends","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Trends","logo":"https://media.daily.dev/image/upload/s--ZfSp3asX--/f_auto,q_auto/v1780996004/logos/trends?_a=BAMAMiWQ0","url":"https://daily.dev/sources/trends"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":15},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"java","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Trends","item":"https://daily.dev/sources/trends"},{"@type":"ListItem","position":3,"name":"Java finally gets a JSON API, and it's not for you"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg","comment":[{"@type":"Comment","text":"record-to-JSON mapping missing is going to be the thing everyone complains about in the incubator feedback, that’s literally the only reason most people would reach for a built-in parser instead of Jackson. strict RFC 8259 enforcement (no trailing commas) will also bite anyone copy-pasting config from JS land.","datePublished":"2026-10-14T18:13:03.252Z","url":"https://daily.dev/posts/VpZQR7npG#c-jy2R643Ld","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/java-finally-gets-a-json-api-and-it-s-not-for-you-vpzqr7npg#faq","mainEntity":[{"@type":"Question","name":"What is JEP 540 and what does it add to Java 28?","acceptedAnswer":{"@type":"Answer","text":"JEP 540 is an incubator JSON API targeted for Java 28 that adds a built-in JSON parser to the JDK, intended for small tasks like reading config files or building HTTP payloads rather than replacing libraries like Jackson. It models JSON as a sealed hierarchy of string, number, boolean, null, object, and array types, with parse, toDisplayString, get, tryGet, and tryValue methods. Track JDK proposals like this one on daily.dev to stay ahead of changes affecting how you handle JSON in Java."}},{"@type":"Question","name":"Does the new JDK JSON parser in JEP 540 support lenient parsing like comments or trailing commas?","acceptedAnswer":{"@type":"Answer","text":"No, the JEP 540 parser strictly enforces RFC 8259 with no leniency allowed: no comments, no trailing commas, and no duplicate member names. The designers deliberately rejected Postel's law-style leniency, prioritizing consistent, predictable parsing over convenience when hand-editing JSON files. Developers weighing strict versus lenient parsing trade-offs can follow Java ecosystem debates like this on daily.dev."}},{"@type":"Question","name":"Does JEP 540 support converting Java records to JSON automatically?","acceptedAnswer":{"@type":"Answer","text":"No, record-to-JSON mapping is not included in JEP 540. This is noted as the feature most developers will likely request first, since JSON generation support overall is still immature and there is no built-in BigDecimal or BigInteger handling in the core surface, though the JEP documents it. Anyone deciding whether to adopt the new JDK JSON API or stick with Jackson can follow this discussion on daily.dev."}}]}
```

