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

Missing body parameter code for API languages other than JavaScript #528

Open
Nurmatron123 opened this issue Oct 5, 2022 · 2 comments
Open

Comments

@Nurmatron123
Copy link

Nurmatron123 commented Oct 5, 2022

Issue :
Missing body parameter code for API languages other than JavaScript in the output file.

For this issue I tried adding several different parameters to the widdershins conversion to get the body parameter to display in other API languages, but was not able to affect any change in the imported API code.

  • [ x] - I have checked that my input document is valid OpenAPI 2.0/3.0.x or AsyncAPI 1.x

To Reproduce
convert attached zip -> yml to a Markdown output.

Expected behavior
body parameter to be present

Screenshots
image

command that we use to invoke widderShin :

$cmd = 'widdershins %s %s --maxDepth %s --search false --expandBody --omitBody --summary -o %s';

openapi 4.yml.zip

@ben741
Copy link

ben741 commented Oct 17, 2022

You can check the templates directory and see that the default templates don't include the body. The workaround is to provide your own custom templates to override them, as described here. You can look at code_javascript.dot for an example of what needs to be done in the other ones to add body examples.

Alternatively you can also provide specific code samples for each request that has a body using x-code-samples.

@jakobsisk
Copy link

Is there any specific reason why the default templates don't include the body? Or just that nobody's implemented it yet.

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

3 participants