Skip to content

DirectFieldAccessor should support collections [SPR-12206] #16820

@spring-projects-issues

Description

@spring-projects-issues

Artyom Dmitriev opened SPR-12206 and commented

I encountered the issue while trying to use DirectFieldAccessor along with JSR-303 Validation. Say, we have class Bar:

public class Bar {
    @NotNull
    private String value;
}

This code would work fine:

public class Foo {
    @Valid
    @NotNull
    private Bar bar;
}

whereas the code below would not work and I would get " java.lang.IllegalStateException: JSR-303 validated property 'bars[0].value' does not have a corresponding accessor for Spring data binding...":

public class Foo {
    @Valid
    @NotNull
    private List<Bar> bars;
}

Affects: 4.1 GA

Issue Links:

Referenced from: commits 3d86f15

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions