assertj-swagger icon indicating copy to clipboard operation
assertj-swagger copied to clipboard

GET/DELETE shouldn't verify request media type

Open marcelstoer opened this issue 6 years ago • 0 comments

(I know this project is looking for a new maintainer but we can still report issues in the meantime)

As per https://swagger.io/docs/specification/2-0/mime-types/

Note that consumes only affects operations with a request body, such as POST, PUT and PATCH. It is ignored for bodiless operations like GET.

Hence, this library shouldn't verify consumes for GET and DELETE and failures like below should be ignored.

The following 6 assertions failed:
1) [Checking 'consumes' of 'GET' operation of path '/v1/failure-messages'] 
Expecting:
  <["*/*"]>
to contain only:
  <["application/json"]>
elements not found:
  <["application/json"]>
and elements not expected:
  <["*/*"]>

marcelstoer avatar Feb 21 '19 20:02 marcelstoer