Mermade / widdershins

OpenAPI / Swagger, AsyncAPI & Semoasa definitions to (re)Slate compatible markdown

Home Page:https://mermade.github.io/reslate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing body parameter code for API languages other than JavaScript

Nurmatron123 opened this issue · comments

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

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.

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