Skip to content

Support for JSR-303 Bean Validation #114

@francis-a

Description

@francis-a

Although it should be possible to validate any managed bean with Spring directly the following example doesn't seem to work in the current snapshot build.

@GraphQlController
@Validated
class Mutations {
    @MutationMapping
    fun mutate(
        @Argument
        @Valid
        update: Update
    ): Result {
      ....
   }
}

Where Update contains validation constraint annotations such as

data class Update(
   @field:Length(min = 2)
   val name: String?
)

It seems currently an unvalidated data object is passed into the mutate handler.

I haven't dug too deep yet but I think the root cause could be how the Update object is instantiated and passed to the handler method. It could also be a missunderstanding of how this should be working on my end.

Is JSR-303 validation supported in the current snapshot?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions