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

Constructor data binding support for List, Map and array arguments #32426

Closed
rstoyanchev opened this issue Mar 12, 2024 · 0 comments
Closed

Constructor data binding support for List, Map and array arguments #32426

rstoyanchev opened this issue Mar 12, 2024 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Mar 12, 2024

In Spring Framework 6.1 we added a number of improvements to data binding via constructor args such as DataBinder support for constructor binding (#26721) including nested constructors (#20806), customizing request parameter names for constructor binding (#30947), and declarative binding mode (#30948).

This makes constructor data binding a safer alternative to setter binding because it's selective about what we bind from, but to make it more complete, it needs to support collection and map arguments.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Mar 12, 2024
@rstoyanchev rstoyanchev added this to the 6.2.x milestone Mar 12, 2024
@rstoyanchev rstoyanchev self-assigned this Mar 12, 2024
@rstoyanchev rstoyanchev modified the milestones: 6.2.x, 6.2.0-M5 Jun 12, 2024
@rstoyanchev rstoyanchev changed the title Support collections and maps with constructor data binding Constructor data binding support for List, Map and array arguments Jun 24, 2024
djkeh added a commit to djkeh/test-data that referenced this issue Jul 31, 2024
현재 스프링 프레임워크 버전에서는
컨트롤러 핸들러 메소드의 입력 파라미터로
`record`를 자유롭게 쓸 수 없음.

이 문제는 아래 참조 링크에 따라 스프링 버전 6.2,
스프링 부트로는 버전 3.4 이후부터
수정될 것으로 전망.
따라서 일단 이 dto들만
기본 생성자와 setter를 갖춘 class로 전환한다.

추후 프로젝트의 부트 버전을 올리게 되면
이 부분을 `record`로 되돌리는 것을 검토할 것.

## Reference

* spring-projects/spring-framework#32426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant