You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However as @oliyh points out this might change the existing behaviour. To get round this one option would be to enable users to define weights for their custom encodings and then the result list could include weights.
I think it would be fair to say that I don't know how many endpoints worry about the weights of responses, but clearly it is there for a purpose. My expectations would be that the weights would come into play on a single success response so that you could say that you wanted a choice of responses depending upon what the server could deliver - If that is the case would that not be indicated in the OpenAPI spec?
The text was updated successfully, but these errors were encountered:
There is a function in the encoding namespace as follows:
By default this picks only one encoding even if options contains more that one possible.
Multiple Accept content types can occur when the response has multiple responses such as 200, and 400. Each of these might have different mime types.
In my swagger I have application/yaml as the happy path Accept content type. So I added a customer encoder:
I then added this to my martian as follows:
However, when I run the request-for on a suitable end point I only see Accept application/json.
And when I run the response-for function I get a 415 as the response is yaml.
There appear to be a couple of options for fixing this:
Change the
choose-content-type
to give a comma separated list this could be done using:However as @oliyh points out this might change the existing behaviour. To get round this one option would be to enable users to define weights for their custom encodings and then the result list could include weights.
I think it would be fair to say that I don't know how many endpoints worry about the weights of responses, but clearly it is there for a purpose. My expectations would be that the weights would come into play on a single success response so that you could say that you wanted a choice of responses depending upon what the server could deliver - If that is the case would that not be indicated in the OpenAPI spec?
The text was updated successfully, but these errors were encountered: