Skip to content

[html2] Add curl headers for consumes/produces options #4493

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

Merged
merged 2 commits into from
Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@

<div class="tab-content">
<div class="tab-pane active" id="examples-{{baseName}}-{{nickname}}-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X <span style="text-transform: uppercase;">{{httpMethod}}</span>{{#authMethods}}{{#isApiKey}}{{#isKeyInHeader}} -H "{{keyParamName}}: [[apiKey]]" {{/isKeyInHeader}}{{/isApiKey}}{{#isBasic}} -H "Authorization: Basic [[basicHash]]" {{/isBasic}}{{/authMethods}} "{{basePath}}{{path}}{{#hasQueryParams}}?{{#queryParams}}{{^-first}}&{{/-first}}{{paramName}}={{vendorExtensions.x-eg}}{{/queryParams}}{{/hasQueryParams}}"</code></pre>
<pre class="prettyprint"><code class="language-bsh">curl -X <span style="text-transform: uppercase;">{{httpMethod}}</span>{{#authMethods}}{{#isApiKey}}{{#isKeyInHeader}} -H "{{keyParamName}}: [[apiKey]]"{{/isKeyInHeader}}{{/isApiKey}}{{#isBasic}}{{#hasProduces}} -H "Accept: {{#produces}}{{{mediaType}}}{{#hasMore}},{{/hasMore}}{{/produces}}"{{/hasProduces}}{{#hasConsumes}} -H "Content-Type: {{#consumes}}{{{mediaType}}}{{#hasMore}},{{/hasMore}}{{/consumes}}"{{/hasConsumes}} -H "Authorization: Basic [[basicHash]]"{{/isBasic}}{{/authMethods}} "{{basePath}}{{path}}{{#hasQueryParams}}?{{#queryParams}}{{^-first}}&{{/-first}}{{paramName}}={{vendorExtensions.x-eg}}{{/queryParams}}{{/hasQueryParams}}"</code></pre>
</div>
<div class="tab-pane" id="examples-{{baseName}}-{{nickname}}-0-java">
<pre class="prettyprint"><code class="language-java">{{>sample_java}}</code></pre>
Expand Down
14 changes: 7 additions & 7 deletions samples/html2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ <h3>Usage and SDK Samples</h3>

<div class="tab-content">
<div class="tab-pane active" id="examples-Pet-getPetById-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X <span style="text-transform: uppercase;">get</span> -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/pet/{petId}"</code></pre>
<pre class="prettyprint"><code class="language-bsh">curl -X <span style="text-transform: uppercase;">get</span> -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/pet/{petId}"</code></pre>
</div>
<div class="tab-pane" id="examples-Pet-getPetById-0-java">
<pre class="prettyprint"><code class="language-java">import io.swagger.client.*;
Expand Down Expand Up @@ -3140,7 +3140,7 @@ <h3>Usage and SDK Samples</h3>
var apiInstance = new PetApi();
var petId = 789; // Long | ID of pet to update
var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server (optional)
var file = /path/to/file.txt; // File | file to upload (optional)
var file = new File(); // File | file to upload (optional)

try
{
Expand Down Expand Up @@ -3531,7 +3531,7 @@ <h2>Parameters</h2>
"description" : "ID of the order that needs to be deleted",
"required" : true,
"type" : "string",
"minimum" : 1.0
"minimum" : 1
};
var schema = schemaWrapper;

Expand Down Expand Up @@ -3597,7 +3597,7 @@ <h3>Usage and SDK Samples</h3>

<div class="tab-content">
<div class="tab-pane active" id="examples-Store-getInventory-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X <span style="text-transform: uppercase;">get</span> -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"</code></pre>
<pre class="prettyprint"><code class="language-bsh">curl -X <span style="text-transform: uppercase;">get</span> -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"</code></pre>
</div>
<div class="tab-pane" id="examples-Store-getInventory-0-java">
<pre class="prettyprint"><code class="language-java">import io.swagger.client.*;
Expand Down Expand Up @@ -4005,8 +4005,8 @@ <h2>Parameters</h2>
"description" : "ID of pet that needs to be fetched",
"required" : true,
"type" : "integer",
"maximum" : 5.0,
"minimum" : 1.0,
"maximum" : 5,
"minimum" : 1,
"format" : "int64"
};
var schema = schemaWrapper;
Expand Down Expand Up @@ -6303,7 +6303,7 @@ <h3> Status: 404 - User not found </h3>
</div>
<div id="generator">
<div class="content">
Generated 2016-12-16T18:07:47.864+08:00
Generated 2017-01-03T10:36:42.650-08:00
</div>
</div>
</div>
Expand Down