Default JSON mapper collection limit is hard-coded and replaces all collection deserialization
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
Read the JacksonMapper bean method in ContextFunctionCatalogAutoConfiguration first, then CollectionLimitModule and LimitedCollectionDeserializer to see how the deserializer modifier replaces every Collection deserializer. There is no test coverage today, so start by writing a failing test that deserializes a LinkedList and a TreeSet through the default mapper, plus one that exceeds the limit. Done means the limit is configurable, the requested collection type and any pre-existing deserializer are preserved by delegation, violations surface as Jackson exceptions, and the Joda UTCProvider call no longer depends on the fallback path.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The default JacksonMapper created in ContextFunctionCatalogAutoConfiguration registers CollectionLimitModule, whose deserializer modifier replaces the deserializer of every Collection type with LimitedCollectionDeserializer. This has several problems:
- the limit is a constant (
MAX_ITEMS = 1000) and can not be configured, so a legitimate batch with more than 1000 elements fails - the failure is a plain
IllegalStateException("Collection size exceeds limit of 1000")rather than a Jackson exception, so it is not handled like other deserialization errors - the deserializer always creates an
ArrayList, or aHashSetforSettypes, regardless of the requested type, soLinkedList,TreeSet,LinkedHashSet(order is lost),ArrayDequeand similar targets do not get the collection type that was asked for - any custom or more specific collection deserializer, including ones registered on the user's
ObjectMapperthat the mapper is rebuilt from, is replaced, because the modifier ignores the deserializer it is given - the deserializer reads elements with
getBoundType(0)of the declared type and does not handlenulltokens, polymorphic type information or a start token that is not an array
There are no tests for LimitedCollectionDeserializer or CollectionLimitModule.
Separately, when no ObjectMapper bean can be rebuilt, the fallback in the same method calls DateTimeZone.setProvider(new UTCProvider()), which changes the Joda time zone provider for the whole JVM depending on whether a bean was present.
Proposed change: make the limit configurable (or use Jackson's own stream read constraints), keep the requested collection type and any existing deserializer by delegating to it, throw a Jackson exception on violations, and add tests for the cases above. The Joda provider change should not depend on the fallback path.
- Lenguaje dominante
- Java
- Estrellas
- 1.1k
- Forks
- 655
- Merge medio
- 4 h 54 min
- PR fusionados (30 d)
- 10
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-cloud/spring-cloud-function
-
ClassCastException with spring-cloud-function 4.3.6 when a field of type Set is deserializedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
spring-cloud/spring-cloud-function#1542 ·
Los mantenedores suelen responder en 1 día
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invokerPosiblemente ocupada @zemiles la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 32/100
spring-cloud/spring-cloud-function#1544 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
spring-cloud/spring-cloud-function#1538 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Kotlin function wrapper treats empty input as no inputPosiblemente ocupada @seonwooj0810 la tomó hoy. Abierto5.0.x backport bug
Dificultad 3/5 Medio día Aptitud para principiantes 30/100
spring-cloud/spring-cloud-function#1537 ·
Los mantenedores suelen responder en 1 día
-
SmartCompositeMessageConverter fails with NullPointerException or ClassCastException in several conversion pathsPosiblemente ocupada @seonwooj0810 la tomó hace 1 día. Abierto5.0.x backport bug
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
spring-cloud/spring-cloud-function#1535 ·
Los mantenedores suelen responder en 1 día
Todos los issues de spring-cloud/spring-cloud-function
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
bug devops low
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
enhancement
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
MDMesh-app/MDMesh#252 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día