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 trying out prism and noticed you could specify Prefer example=... as a header which provides a different response for the caller. This however doesn't work with Postman collections that have multiple resources with the same method/path, because all examples for a response have the key default.
That or update the key field to be a hash of the content. Although, this would make it harder to expose in prism.
Additional context
I don't mind adding a PR, but I'd prefer to understand the reasoning about it being statically set to default and if using something like response.name is correct.
The text was updated successfully, but these errors were encountered:
mtraynham
changed the title
Use the operation name for Postman response example
Postman response examples unique keys
Mar 2, 2021
User story.
As a user, I would prefer that responses for Postman Collections have a different key other than
default
which make them unique. https://github.com/stoplightio/http-spec/blob/master/src/postman/transformers/params.ts#L76-L99Is your feature request related to a problem?
I was trying out prism and noticed you could specify
Prefer example=...
as a header which provides a different response for the caller. This however doesn't work with Postman collections that have multiple resources with the same method/path, because all examples for a response have the keydefault
.Describe the solution you'd like
Passing the
response.name
as a 3rd argument totransformRawBody
would likely be sufficient to supply a unique name other thandefault
, https://github.com/stoplightio/http-spec/blob/master/src/postman/transformers/response.ts#L15.That or update the
key
field to be a hash of the content. Although, this would make it harder to expose in prism.Additional context
I don't mind adding a PR, but I'd prefer to understand the reasoning about it being statically set to
default
and if using something likeresponse.name
is correct.The text was updated successfully, but these errors were encountered: