spring-framework/spring-test
Simon Baslé 0f38c28e91 Fix ServletRequestDataBinder ctor binding with `[]`-indexed query params
This change ensures that a request containing query parameters in the
array format `someArray[]=value` can be bound into a simple array in
constructors, even for cases where the array values don't have nested
properties.

The value resolver is directly called in the constructor case, before
any mutable properties are considered or even cleared (see
`WebDataBinder#adaptEmptyArrayIndices` method). As a result, we need to
accommodate the possibility that the request stores array elements under
the `name[]` key rather than `name`. This change attempts a secondary
lookup with the `[]` suffix if the type is a list or array, and the key
doesn't include an index.

Closes gh-34121
2024-12-27 10:59:15 +01:00
..
src Fix ServletRequestDataBinder ctor binding with `[]`-indexed query params 2024-12-27 10:59:15 +01:00
.springBeans Support classes AND locations in @ContextConfiguration 2014-04-01 19:45:56 +02:00
spring-test.gradle Introduce @⁠EasyMockBean bean override example 2024-09-18 17:10:06 +02:00