{
  "id": 1502043,
  "title": "JEP 540 Proposed to Target JDK 28 with a Simple JSON API",
  "url": "https://urgent.news/2026/08/17/jep-540-proposed-to-target-jdk-28-with-a-simple-json-api",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-17T14:18:00.000Z",
  "source": {
    "name": "InfoQ",
    "slug": "infoq",
    "url": "https://www.infoq.com/news/2026/08/java-native-json-api/"
  },
  "original_language": "en",
  "account": "The JEP 540 proposal aims to introduce a new JSON API for JDK 28, providing a simple and JDK-provided solution for working with RFC 8259 JSON documents. This compact API will be housed in the incubating jdk.incubator.json module, allowing for potential future changes or removal based on developer feedback. The proposed API focuses on common JSON tasks, such as parsing configuration files, inspecting REST responses, and generating small JSON payloads. The core of the API is the Json class and its sealed JsonValue interface, which defines six non-sealed subinterfaces for JSON objects, arrays, strings, numbers, booleans, and null. Instances of JsonValue are immutable and thread-safe.\n\nThe design of the API centers around declaring access methods directly on JsonValue, enabling callers to traverse objects and arrays without frequent casting. Access methods like get(String) on non-object values, get(int) on non-array values, requesting missing members, or using invalid indices will result in a JsonValueException. Parsing a complete in-memory JSON document can be done using Json.parse(String) or Json.parse(char[]), which returns a JsonValue.\n\nThe main ergonomic trade-offs of this API involve the construction of JSON values. Factory methods on the corresponding interfaces are used to create JSON values, such as creating a boolean using Json.Boolean(true). While this approach makes JSON types clear, it also adds ceremony since Java primitives must be wrapped when placed in objects or arrays. The API prioritizes strictness, rejecting syntax such as comments, trailing commas, and duplicate object-member names, which could lead to interoperability issues. Invalid syntax and duplicate names are reported through unchecked JsonParseException instances that include the line and position of the detected error.\n\nThe API does not provide a lenient parsing mode or syntax extensions, and it does not expose a structured JSON path. The sealed value hierarchy integrates well with pattern matching for handling different JSON types. Conversion methods, such as asInt() and asLong(), require an exact integral value within the destination type's range, while asDouble() converts numbers to finite doubles, which may result in some precision loss. Optional member access through tryGet(String) returns an Optional JsonValue, distinguishing between missing members and explicitly containing JSON null values. The API also emphasizes the distinction between missing members and explicitly null values, as tryGet() returns an Optional containing JsonNull for the latter, while tryValue() returns an empty Optional for JsonNull.",
  "summary": "JEP 540, Simple JSON API, has progressed to Target status for JDK 28. It introduces a compact API for parsing and generating JSON documents without external dependencies. Focused on core tasks, it provides an immutable value hierarchy. The API allows simple traversal and conversion while enforcing strict syntax rules. Feedback during incubation will shape its future development. By A N M Bazlur…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}