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

Attempt to find response example based on request body #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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