Closed gobengo closed 9 years ago
HI, this will be solve in next release of Dredd respectively Gavel which is used in Dredd for validating HTTP messages. Only value of content-type
headers will be validated. Other header values will not be validated, so your location
header will pass.
@netmilk Would that help at all with trying to do a flow where I create a resource, the server provisions an id and responds with it, and another endpoint is exposed at a path that needs that dynamic ID passed to it?
+1 to this feature. It'll very useful.
when is the next version scheduled?
+1 I would like this too. Other similar things can be solved with hooks. But I think hooks are not useful in this case.
Hi, this can be solved by creating response stash in hooks and replacing expected header value in the transaction before its execution.
Reopening after discussion in #108
:+1:
Hi,
we recently changed the way how we validate headers in Gavel, please refer to: https://github.com/apiaryio/gavel.js/pull/53. Only values of content-negotiation significant headers are treated as constants. This functionality is in Dredd > 0.4.8.
For example: value of the Location
header can be different in real response then given in blueprint.
This should fix this issue when you rely on data provisioned by server and you have no way how to retrieve it and modify expectation in before hooks.
Adam
Hey, I have the following in my blueprint.
I'm trying to 'create a new app'. When I do this, the server provisions and id and includes it in the response body JSON. It also includes a location header in the response which is a relative URL to the newly created app resource. This location header should be considered opaque, but happens to be using the newly provisioned id.
Whenever I run dredd against this, it fails because the location header in practice is some id other than what's in the blueprint.
Is there any way to author my blueprint to ensure that the location header is present in the response, but not fail the thing just because it's a new unique id?