Default JSON mapper collection limit is hard-coded and replaces all collection deserialization
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 22/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 1.1k
- Fork
- 655
- Merge trung bình
- 4 giờ 54 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spring-cloud/spring-cloud-function
-
ClassCastException with spring-cloud-function 4.3.6 when a field of type Set is deserializedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
spring-cloud/spring-cloud-function#1542 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invokerCó thể đã có người làm @zemiles đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 32/100
spring-cloud/spring-cloud-function#1544 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
spring-cloud/spring-cloud-function#1538 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Kotlin function wrapper treats empty input as no inputCó thể đã có người làm @seonwooj0810 đã nhận hôm nay. Đang mở5.0.x backport bug
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 30/100
spring-cloud/spring-cloud-function#1537 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SmartCompositeMessageConverter fails with NullPointerException or ClassCastException in several conversion pathsCó thể đã có người làm @seonwooj0810 đã nhận 1 ngày trước. Đang mở5.0.x backport bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
spring-cloud/spring-cloud-function#1535 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spring-cloud/spring-cloud-function
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug devops low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
enhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
MDMesh-app/MDMesh#252 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày