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

So Nested record is not supported as the handler method argument? #33281

Closed
djkeh opened this issue Jul 27, 2024 · 2 comments
Closed

So Nested record is not supported as the handler method argument? #33281

djkeh opened this issue Jul 27, 2024 · 2 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@djkeh
Copy link

djkeh commented Jul 27, 2024

Affects: 6.1.11


I checked #32379 and relevant issue #32426, so I tested it in Spring Boot 3.3.2, yet it seems it is still not working. The error mesage goes like this:

Invalid property 'schemaFields[0]' of bean class [uno.fastcampus.testdata.dto.request.TableSchemaRequest]: Illegal attempt to get property 'schemaFields' threw exception

This appears exactly to be the same message when I use POJO class but without setter as the handler method argument. The tested code looks like this:

@PostMapping(path = "/table-schema", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
public String createTableSchema(
        TableSchemaRequest tableSchemaRequest,
        RedirectAttributes redirectAttrs
) {

    return "redirect:table-schema";
}
// This code works. If I remove setter or turn the class to record, it fails.
@Data
public class TableSchemaRequest {
    private String schemaName;
    private String userId;
    private List<SchemaFieldRequest> schemaFields;
}

So in spite of #32426, it is still not possible to use unmodifiable nested objects as the hander method argument.
Is it normal and intended behavior? or is it a bug?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 27, 2024
@simonbasle
Copy link
Contributor

@djkeh please note that he issue you are referencing has been fixed in the 6.2.0-M5 milestone, so this is not supported in the 6.1.x branch of Spring Framework. Would you be able to try it out with the latest milestone of 6.2 ?

@simonbasle simonbasle added the status: waiting-for-feedback We need additional information before we can continue label Jul 29, 2024
@djkeh
Copy link
Author

djkeh commented Jul 30, 2024

Oh, my. I missed the milestone number. I tried again on spring boot 3.4.0-SNAPSHOT, and it works beautifully as intended.
I'm closing the issue. Thank you!

@djkeh djkeh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2024
@rstoyanchev rstoyanchev added status: invalid An issue that we don't feel is valid and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants