Support JSON binding with the JDK's built-in JSON API (`jdk.incubator.json`)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- java, json
- Área
- api, backend-api-design
Línea de trabajo
Read the linked proposal and inspect the prototype’s JsonRecordHttpMessageConverter to understand the proposed mapping and constraints. Compare the reflection, generated, hybrid, and tree-only options for spring-web and spring-messaging; done means the project has a decided scope and approach, or has explained why this belongs in a separate library.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Use case
I want to build Spring MVC REST endpoints that read and write Java records as JSON without a third-party JSON library:
@PostMapping("/hello")
public HelloResponse hello(@RequestBody HelloRequest request) { ... }
The same records should also work as Kafka message payloads:
@KafkaListener(topics = "hello")
public void onHello(HelloRequest request) { ... }
JDK 28 ships an incubating JSON API (jdk.incubator.json) that parses JSON into a JsonValue tree and writes it back, but it does not map JSON to Java types.
Spring has HTTP and messaging converters for Jackson, Gson, JSON-B and Kotlin Serialization, but none for the JDK API.
Reasons for a JDK-only option:
- Fewer dependencies for applications that only need simple JSON.
- A smaller attack surface:
jackson-databindhas 86 advisories in OSV, 17 of them published in 2026. - GraalVM native images without reflection metadata for the JSON library.
What I have tried so far
A prototype on Spring Boot 4.1 / JDK 28-ea: https://github.com/drnow4u/springboot-jdk28-json
JsonRecordHttpMessageConverter, anAbstractHttpMessageConverter<Record>that maps JSON objects to and from records using reflection over record components (String, numeric and boolean types, nested records).- Malformed JSON or a wrong value type is mapped to
HttpMessageNotReadableException(400). - The JDK parser has no size limits and repeats the offending input in its error messages, so the converter limits the body size (
413) and shortens error messages. - Spring AOT already registers reflection hints for the records used in the controller signature, so option A below may work in a native image; this cannot be verified until GraalVM supports JDK 28.
Questions
The main design question is how the mapping should work:
- A. Reflection over record components (what the prototype does). No setup, but needs AOT hints for native images.
- B. Compile-time generated bindings (annotation processor), similar to Kotlin Serialization. No reflection, errors at compile time, but needs a processor on the build path.
- C. Hybrid: generated bindings when present, reflection otherwise.
- D. Tree types only: a converter for
JsonValue/JsonObject/JsonArray, with mapping left to applications or libraries.
Whichever option is chosen, the mapping would be shared by an HttpMessageConverter (spring-web) and a MessageConverter (spring-messaging, used by @KafkaListener); a Kafka Serializer/Deserializer would belong in Spring for Apache Kafka.
Would the Spring team consider any of these for Spring Framework, and which one? Or should this live in a separate library until the JDK API leaves incubation?
The full proposal, covering security, performance, native image and open questions, is here:
https://github.com/drnow4u/springboot-jdk28-json/blob/main/docs/proposal-jdk-json-binding.md
- Lenguaje dominante
- Java
- Estrellas
- 60.3k
- Forks
- 38.7k
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 33
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de spring-projects/spring-framework
-
status: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
spring-projects/spring-framework#37613 ·
Los mantenedores suelen responder en 1 día
-
`YamlProcessor.getFlattenedMap` with `includeEmpty` returns a `null` key for an empty root mappingQuizá libre de nuevo @erfannvb la tomó hace 14 días y no hay ningún pull request abierto. Abiertostatus: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
spring-projects/spring-framework#37522 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`WebClient` with default codecs drops `ProblemDetail` extension membersQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertostatus: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
spring-projects/spring-framework#37503 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
StandardApiVersionDeprecationHandler generates nonconforming Sunset HTTP datesQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertostatus: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
spring-projects/spring-framework#37486 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
FastByteArrayOutputStream input stream rejects valid skip(long) argumentsQuizá libre de nuevo @hickey-ai la tomó hace 17 días y no hay ningún pull request abierto. Abiertostatus: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
spring-projects/spring-framework#37471 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de spring-projects/spring-framework
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
a2aproject/a2a-java#1275 ·
Los mantenedores suelen responder en 1 día
-
module/ftp Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ballerina-platform/ballerina-library#9476 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anwilli5/coin-collection-android-US#515 ·
Los mantenedores suelen responder en 1 día
-
status: waiting-for-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
spring-projects/spring-integration#11654 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Menos de una hora Aptitud para principiantes 70/100
Vakore/ZappierGames#248 ·