Skip to content

Commit

Permalink
Merge pull request #805 from ndv99/fix-openapi-script
Browse files Browse the repository at this point in the history
fix(api): Fix openapi documentation display script
  • Loading branch information
ndv99 authored Sep 4, 2023
2 parents d76ab5c + c5c7339 commit b526e19
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions templates/docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,10 @@ <h3>{{tag}}</h3>
{%endfor%}
{%endif%}
{%if "requestBody" in item[endpoint][method]%}
{%if "parameters" not in item[endpoint] and "parameters" not in item[endpoint][method]%}
<p><strong>Parameters</strong></p>
<hr />
{%endif%}
{%for property in item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["properties"]%}
<p><md-block><code>{{property}}</code> (<em>{{item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["properties"][property]["type"]}}</em>): {%if property in item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["required"]%}Required{%else%}Optional{%endif%}. {{item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["properties"][property]["description"].replace(" -", "\n -")}}</md-block></p>
<p><strong>Request body (multipart/form-data)</strong></p>
<hr />
{%for property in item[endpoint][method]["requestBody"]["content"]["multipart/form-data"]["schema"]["properties"]%}
<p><md-block><code>{{property}}</code> (<em>{{item[endpoint][method]["requestBody"]["content"]["multipart/form-data"]["schema"]["properties"][property]["type"]}}</em>): {%if property in item[endpoint][method]["requestBody"]["content"]["multipart/form-data"]["schema"]["required"]%}Required{%else%}Optional{%endif%}. {{item[endpoint][method]["requestBody"]["content"]["multipart/form-data"]["schema"]["properties"][property]["description"].replace(" -", "\n -")}}</md-block></p>
{%endfor%}
{%endif%}
<p><strong>Responses</strong></p>
Expand Down

0 comments on commit b526e19

Please sign in to comment.