Mermade / widdershins

OpenAPI / Swagger, AsyncAPI & Semoasa definitions to (re)Slate compatible markdown
https://mermade.github.io/reslate
MIT License
1.5k stars 322 forks source link

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

Open Nurmatron123 opened 2 years ago

Nurmatron123 commented 2 years ago

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.

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 commented 2 years ago

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 commented 2 years ago

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