Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postman response examples unique keys #133

Open
mtraynham opened this issue Mar 2, 2021 · 0 comments
Open

Postman response examples unique keys #133

mtraynham opened this issue Mar 2, 2021 · 0 comments

Comments

@mtraynham
Copy link

mtraynham commented 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-L99

Is 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 key default.

Screen Shot 2021-03-01 at 7 26 43 PM

Describe the solution you'd like

Passing the response.name as a 3rd argument to transformRawBody would likely be sufficient to supply a unique name other than default, 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 like response.name is correct.

@mtraynham mtraynham changed the title Use the operation name for Postman response example Postman response examples unique keys Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant