JEP 540 Proposed to Target JDK 28 with a Simple JSON API

A N M Bazlur Rahman ยท rss ยท 2026-08-17 source โ†— Reader ๐Ÿ–ฅ๏ธ

Changeability & OptionalityModularity & CouplingSoftware Design FundamentalsWorse Is Better
JEP 540 proposes a deliberately narrow, strict, immutable, dependency-free JSON API for the JDK standard library โ€” trading the completeness of libraries like Jackson and Gson for interface simplicity โ€” and ships it as an incubating module so the community can pressure-test its navigation, exception, conversion and construction ergonomics before the design is finalized.

theoretical ยท expository โ€” News reporting on a JDK Enhancement Proposal's design and status. It is mostly explanatory (what the API does, how it is shaped) rather than argumentative, but it carries an implicit design-philosophy argument: a JDK-provided JSON API should trade completeness for narrow scope, strictness and zero dependency, with incubation as the mechanism for testing that bet.

Structure

PartRole
Status and scope framing: JEP 540 moves to Proposed to Target for JDK 28; deliberately narrower than Jackson/Gson (no data binding, no streaming, no lenient parsing).context
Core API walkthrough: Json/JsonValue sealed hierarchy, direct access methods, parse() example.evidence for the 'simple navigation' half of the design bet
Construction walkthrough: factory methods (JsonObject.of, JsonString.of, etc.) and the added ceremony this requires.evidence + acknowledged weakness, held up as a likely area of incubation feedback
Strictness discussion: no lenient mode, duplicate-key rejection, its RFC 8259 conformance and interoperability risk.evidence for the 'strict semantics' half of the design bet, with a flagged tradeoff
Pattern-matching and conversion methods (asInt/asLong/asDouble/tryGet/tryValue).evidence of ergonomic design choices building on the sealed hierarchy
Historical contrast with JEP 198 (2014, never delivered, broader scope).context establishing this as a second, narrower attempt at the same goal
Incubation mechanics: --add-modules requirement, what incubation is meant to test.conclusion / next steps

Key terms

Propositions

Arguments

A minimal, strict, immutable, dependency-free JSON API belongs in the JDK standard library, even alongside mature third-party alternatives.
Explicit premises:
Implicit premises:
Inferences:

Narratives

Questions addressed

Gaps

Related documents