Swagger definition errors

179 views Asked by At

Trying to use Swagger on my JAX-RS application with enunciate Maven plugin.

The generated JSON definition works well.

But when I try to validate it online with Swagger Editor, the converted YAML file has some weird errors.

For example: Definition:

 parameters:
        - name: body
          in: body
          type: file
          description: 'Bla bla'
      responses:
        '201':

ERROR: Parameters with "type: file" must have "in: formData"

JAX-RS Code:

@POST
@Path(value = "/validatedata")
public Response validate(ValidateDataFromInput validateDataFromInput) throws CustomException {
    return Response.status(Status.ACCEPTED).entity(validationActionService.getDataFromInput(validateDataFromInput.getConsumerInput(),
        validateDataFromInput.getValidateInput(), null)).build();
}

I am using: swagger-core-1.5.21 and enunciate-maven-plugin-2.11.1. Not sure which is wrong here.

0

There are 0 answers