Default JSON mapper collection limit is hard-coded and replaces all collection deserialization
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 1.1k
- フォーク
- 655
- 平均マージ
- 4時間 54分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
spring-cloud/spring-cloud-function のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
spring-cloud/spring-cloud-function#1542 ·
メンテナーはふだん 1 日以内に返信
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invoker対応中かも @zemiles が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 32/100
spring-cloud/spring-cloud-function#1544 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
spring-cloud/spring-cloud-function#1538 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Kotlin function wrapper treats empty input as no input対応中かも @seonwooj0810 が今日担当しました。 オープン5.0.x backport bug
難易度 3/5 半日 初心者へのやさしさ 30/100
spring-cloud/spring-cloud-function#1537 ·
メンテナーはふだん 1 日以内に返信
-
SmartCompositeMessageConverter fails with NullPointerException or ClassCastException in several conversion paths対応中かも @seonwooj0810 が 1 日前に担当しました。 オープン5.0.x backport bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
spring-cloud/spring-cloud-function#1535 ·
メンテナーはふだん 1 日以内に返信
spring-cloud/spring-cloud-function の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug devops low
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
MDMesh-app/MDMesh#252 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信