Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that @Validated results in the use of a proxy and warn users about the side-effects #24338

Closed
wilkinsona opened this issue Jan 13, 2020 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Jan 13, 2020

Affects: All supported versions

Using @Validated can result in a CGLib proxy being created for a bean. This has the sometimes unexpected side-effect of changing how the bean's fields behave when accessed directly. Please see this Spring Boot issue for an example of a problem that this unexpected behavior can cause.

I think it would be good if the Framework reference documentation noted the use of a proxy and forewarned users about the side-effects.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 13, 2020
@sbrannen sbrannen changed the title Document that @Validated results in the use of a proxy and warns users about the side-effects Document that @Validated results in the use of a proxy and warn users about the side-effects Jan 13, 2020
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 13, 2020
@sbrannen sbrannen added this to the 5.x Backlog milestone Jan 13, 2020
@rstoyanchev rstoyanchev self-assigned this Jan 15, 2020
@rstoyanchev rstoyanchev modified the milestones: 5.x Backlog, 5.2.4 Jan 15, 2020
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Jan 15, 2020

We can add something to this section.

Looking through that entire 3.7 Spring Validation it looks like it could use a little bit of polishing, e.g. to avoid dated references to features added in Spring Framework 3. Also the title of that section should really be Bean Validation API as it is focused on JSR-303 support specifically (the section id is already bean-validation).

This in contrast to and in addition to coverage of "Spring Validation" earlier at the top of Section 3 which covers the Spring Validator contract in more detail. Those parts could use a little polishing as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

4 participants