Closed bgergo93 closed 5 months ago
PR:s are welcome.
Here is a test case with combinations of produces and consumes: https://github.com/wiremock/wiremock-jaxrs/blob/master/src/test/java/se/bjurr/wiremock/test/testcases/ConsumesAndProducesIntergrationTest.java
Can you point at which one of them you think is incorrect? Or provide an annotated interface along with a mapping you think it should translate to.
I agree with your opinions here but I think the test case shows that it is implemented as you suggest. Closing this issue, but please open it again if I am not correct here.
The code incorrectly sets expectations on the ACCEPT header, based on the responseTypeList(Produces).. As per my understanding of the terminology, both Produces/Consumes are related to the content-type header, the only difference is, the first for the response and the latter is for the request.
ACCEPT - Defined by the client, what kind of response they want.
CONTENT-TYPE - Both HTTP request and response could have a content-type, which defines the media type of the payload (HTTP POST/PUT request’s body, or any HTTP response’s body).
@Produces - These are the content-types, that the server can provide, so it yields to HTTP response's content-type.
@Consumes - These are the content-types, that the server is able to handle, so it yields to HTTP request's content-type.