Skip to content

Conversation

@joelbyler
Copy link

In an effort to offer a solution to #66 this PR attempts to match the request body to a requestBody example and use the name of that example to find a corresponding response example. This could be used as an alternative to supplying a Prefer header.

if(this.requestBody.content) {
let resultingExampleName;

Object.entries(this.requestBody.content).find(contentEntries => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in some places this project assumes application/json as the content type, if we're comfortable with that assumption then I think I can make this a little more simple here.

@joelbyler
Copy link
Author

I'll admit that I'm not great with js and appreciate any feedback you have on this PR. Thanks in advance!

@joelbyler
Copy link
Author

@jormaechea do you have any feedback on this? Would love to use this feature, or an alternative if you have something in mind?

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

Successfully merging this pull request may close these issues.

1 participant