-
Notifications
You must be signed in to change notification settings - Fork 280
How to use blueprint for resource creates when id is provisioned by server? #96
Comments
HI, this will be solve in next release of Dredd respectively Gavel which is used in Dredd for validating HTTP messages. Only value of |
@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 |
👍 |
Hi, we recently changed the way how we validate headers in Gavel, please refer to: apiaryio/gavel.js#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 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 |
…things Consolidate (de)serialization of refract and refactor tests
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?
The text was updated successfully, but these errors were encountered: