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

@Valid on method parameter does not apply validation in 1.1.2 #624

Closed
koenpunt opened this issue Mar 1, 2023 · 4 comments
Closed

@Valid on method parameter does not apply validation in 1.1.2 #624

koenpunt opened this issue Mar 1, 2023 · 4 comments
Assignees
Labels
type: regression A bug that is also a regression
Milestone

Comments

@koenpunt
Copy link
Contributor

koenpunt commented Mar 1, 2023

To raise a bit more awareness of a comment I placed on a specific commit.

4c3e75a#commitcomment-102568551

In 1.1.2 parameter validation was changed to somehow also support the @Validated annotation on individual arguments. This, however, did break validation with the @Valid annotation for us.

To elaborate a bit on our scenario; we use spring-graphql with kotlin and coroutines, and have input objects with nested @Valid annotations.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 1, 2023
@rstoyanchev
Copy link
Contributor

Can you provide something more specific to reproduce the scenario?

@koenpunt
Copy link
Contributor Author

koenpunt commented Mar 2, 2023

I've created a sample application with some of the type definitions of our application, with spring-graphql pinned to 1.1.1. When you run the playground and perform the following mutation you'll see validation errors in the application log:

mutation {
  createCustomerDetails(input:{
    email:"",
    name:"",
    phoneNumber:"",
    locale:"",
    deliveryDetails: null
  }) {
    id
  }
}

When you remove the override for the 1.1.1 version from the build.gradle.kt file, and rely on 1.1.2 provided through the boot started no validation errors are logged, and the application errors on the TODO(..) statement.

@rstoyanchev rstoyanchev self-assigned this Mar 6, 2023
@rstoyanchev rstoyanchev added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 6, 2023
@rstoyanchev rstoyanchev added this to the 1.1.3 milestone Mar 6, 2023
@rstoyanchev
Copy link
Contributor

Thanks for the sample, I see the problem.

@rstoyanchev rstoyanchev changed the title 1.1.2 breaks parameter validation with @Valid annotation @Valid on method parameter does not apply validation in 1.1.2 Mar 6, 2023
@rstoyanchev
Copy link
Contributor

This should be fixed now in 1.1.3 snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants