for curl fix next line issue

This commit is contained in:
Pascal Fischer
2023-05-08 18:51:25 +02:00
parent 4c51e12888
commit 4d189d2e39
12 changed files with 49 additions and 49 deletions

View File

@@ -63,12 +63,12 @@ export const title = '<%- tag %>'
<CodeGroup title="Request" tag="<%- operation.operation.toUpperCase() %>" label="<%- operation.path %>">
\`\`\`bash {{ title: 'cURL' }}
<% if(true){ -%>
curl -X <%- operation.operation.toUpperCase() %> <%- operation.fullPath %> \\
-H "Authorization: Token <TOKEN>" \\<% }; -%>
curl -X <%- operation.operation.toUpperCase() %> <%- operation.fullPath %> \\<% }; -%>
<% if(operation.responseList[0].content && operation.responseList[0].content['application/json']){ %>
-H 'Accept: application/json' \\<% }; -%>
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>
-H 'Content-Type: application/json' \\\n--data-raw '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) -%>'<% }; %>
-H 'Content-Type: application/json' \\<% }; %>
-H "Authorization: Token <TOKEN>" <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>\\\n--data-raw '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) -%>'<% }; %>
\`\`\`
\`\`\`js