mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Handle [] leniently in constructor binding
See gh-34305
This commit is contained in:
+11
@@ -188,6 +188,17 @@ class DataBinderConstructTests {
|
||||
assertThat(target.integerList()).containsExactly(1, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
void simpleListBindingEmptyBrackets() {
|
||||
MapValueResolver valueResolver = new MapValueResolver(Map.of("integerList[]", "1"));
|
||||
|
||||
DataBinder binder = initDataBinder(IntegerListRecord.class);
|
||||
binder.construct(valueResolver);
|
||||
|
||||
IntegerListRecord target = getTarget(binder);
|
||||
assertThat(target.integerList()).containsExactly(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void simpleMapBinding() {
|
||||
MapValueResolver valueResolver = new MapValueResolver(Map.of("integerMap[a]", "1", "integerMap[b]", "2"));
|
||||
|
||||
Reference in New Issue
Block a user