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
I was wondering if you've ever considered whether or not it might be nice to allow for dynamically evaluating the request match mocks, similar to how you dynamically fill in the response once you've got a match?
The specific use case I was thinking of would be to allow someone to define a two yaml files that could in turn handle requests for many paths, but respond properly to qualifiers such as If-None-Match.
A set of examples, of course these don't work because there is no expansion on request header values, but I think they show the intent:
description:
A request for an item with a weak etag, if
if-none-match is provided but does not
match then status 200 is returned.
request:
method: HEAD|GET
path: /data/:item/weak/:policy
response:
statusCode: 200
headers:
Content-Type:
- application/octet-stream
Etag:
- 'W/"{{ request.path.item }}"'
Last-Modified:
- Thu, 07 Dec 2017 23:15:34 GMT
Cache-Control:
- '{{request.path.policy}}'
body:
'{{ persist.entity.content }}'
persist:
entity:
'{{ request.path.item }}'
description:
A request for an item with a weak etag, if
if-none-match is provided and does match
then status 304 and no body is returned.
request:
method: HEAD|GET
path: /data/:item/weak/:policy
headers:
If-None-Match:
- 'W/"{{ request.path.item }}"'
response:
statusCode: 304
headers:
Content-Type:
- application/octet-stream
Etag:
- 'W/"{{ request.path.item }}"'
Last-Modified:
- Thu, 07 Dec 2017 23:15:34 GMT
Cache-Control:
- '{{request.path.policy}}'
The text was updated successfully, but these errors were encountered:
I was wondering if you've ever considered whether or not it might be nice to allow for dynamically evaluating the request match mocks, similar to how you dynamically fill in the response once you've got a match?
The specific use case I was thinking of would be to allow someone to define a two yaml files that could in turn handle requests for many paths, but respond properly to qualifiers such as If-None-Match.
A set of examples, of course these don't work because there is no expansion on request header values, but I think they show the intent:
The text was updated successfully, but these errors were encountered: