Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2210

Resteasy validation: endpoint method is invoked even though a parameter is not valid

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 3.0.19.Final
    • jaxrs
    • None

    Description

      Hello,

      I'm currently facing a problem with RestEasy 3.0.19 (I'm stuck with this versions) and the validation. Configuration (JBOSS AS 7.0) is standard.

      Here is the endpoint, very simple:

      @POST
          @Consumes(MediaType.APPLICATION_JSON)
          @ApiOperation(value = "Create")
          @ApiResponses(value = {
                  @ApiResponse(code = 201, message = "Created", response = URI.class),
                  @ApiResponse(code = 400, message = "Bad Request parameter(s).", response = Problem.class),
                  @ApiResponse(code = 404, message = "Not Found", response = Problem.class),
                  @ApiResponse(code = 500, message = "Unexpected error from the server", response = Problem.class)
          })
          Response methodYYY(@Context UriInfo info, @Valid XXX xxx) ;
      

      In GeneralValidatorImpl.validateAllParameters, validation occurs, there are some violations
      because xxx is not valid (this is correct) but no ResteasyViolationException is thrown.

      It appears that this condition "violationsContainer.isFieldsValidated()" is always false. I can't understand how to change this?

      After that, the method is called and of course after there is another exception in a business method. It's like it's waiting to validate the Response to throw the exception if there is any violation.

      Thanks for your support.

      Attachments

        Activity

          People

            Unassigned Unassigned
            howhigh_be@hotmail.com Philip Maes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: