Default JSON mapper collection limit is hard-coded and replaces all collection deserialization
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 1.1k
- Fork
- 655
- Merge medio
- 4h 54m
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di spring-cloud/spring-cloud-function
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
spring-cloud/spring-cloud-function#1542 ·
I maintainer di solito rispondono entro 1 giorno
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invokerForse già presa @zemiles l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 32/100
spring-cloud/spring-cloud-function#1544 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
spring-cloud/spring-cloud-function#1538 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Kotlin function wrapper treats empty input as no inputForse già presa @seonwooj0810 l’ha presa oggi. Aperta5.0.x backport bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 30/100
spring-cloud/spring-cloud-function#1537 ·
I maintainer di solito rispondono entro 1 giorno
-
SmartCompositeMessageConverter fails with NullPointerException or ClassCastException in several conversion pathsForse già presa @seonwooj0810 l’ha presa 1 giorno fa. Aperta5.0.x backport bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
spring-cloud/spring-cloud-function#1535 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di spring-cloud/spring-cloud-function
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug devops low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
enhancement
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
MDMesh-app/MDMesh#252 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno