docs(configuration): document requestSnippetsEnabled config option
Along with that fix formatting of request snippet value.
This commit is contained in:
@@ -51,29 +51,239 @@ Parameter name | Docker variable | Description
|
|||||||
|
|
||||||
##### Display
|
##### Display
|
||||||
|
|
||||||
Parameter name | Docker variable | Description
|
<table role="table">
|
||||||
--- | --- | -----
|
<thead>
|
||||||
<a name="deepLinking"></a>`deepLinking` | `DEEP_LINKING` | `Boolean=false`. If set to `true`, enables deep linking for tags and operations. See the [Deep Linking documentation](/docs/usage/deep-linking.md) for more information.
|
<tr>
|
||||||
<a name="displayOperationId"></a>`displayOperationId` | `DISPLAY_OPERATION_ID` | `Boolean=false`. Controls the display of operationId in operations list. The default is `false`.
|
<th>Parameter name</th>
|
||||||
<a name="defaultModelsExpandDepth"></a>`defaultModelsExpandDepth` | `DEFAULT_MODELS_EXPAND_DEPTH` | `Number=1`. The default expansion depth for models (set to -1 completely hide the models).
|
<th>Docker variable</th>
|
||||||
<a name="defaultModelExpandDepth"></a>`defaultModelExpandDepth` | `DEFAULT_MODEL_EXPAND_DEPTH` | `Number=1`. The default expansion depth for the model on the model-example section.
|
<th>Description</th>
|
||||||
<a name="defaultModelRendering"></a>`defaultModelRendering` | `DEFAULT_MODEL_RENDERING` | `String=["example"*, "model"]`. Controls how the model is shown when the API is first rendered. (The user can always switch the rendering for a given model by clicking the 'Model' and 'Example Value' links.)
|
</tr>
|
||||||
<a name="displayRequestDuration"></a>`displayRequestDuration` | `DISPLAY_REQUEST_DURATION` | `Boolean=false`. Controls the display of the request duration (in milliseconds) for "Try it out" requests.
|
</thead>
|
||||||
<a name="docExpansion"></a>`docExpansion` | `DOC_EXPANSION` | `String=["list"*, "full", "none"]`. Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing).
|
<tbody>
|
||||||
<a name="filter"></a>`filter` | `FILTER` | `Boolean=false OR String`. If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag.
|
<tr>
|
||||||
<a name="maxDisplayedTags"></a>`maxDisplayedTags` | `MAX_DISPLAYED_TAGS` | `Number`. If set, limits the number of tagged operations displayed to at most this many. The default is to show all operations.
|
<td><a name="user-content-deeplinking"></a><code>deepLinking</code></td>
|
||||||
<a name="operationsSorter"></a>`operationsSorter` | _Unavailable_ | `Function=(a => a)`. Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged.
|
<td><code>DEEP_LINKING</code></td>
|
||||||
<a name="showExtensions"></a>`showExtensions` | `SHOW_EXTENSIONS` | `Boolean=false`. Controls the display of vendor extension (`x-`) fields and values for Operations, Parameters, Responses, and Schema.
|
<td><code>Boolean=false</code>. If set to <code>true</code>, enables
|
||||||
<a name="showCommonExtensions"></a>`showCommonExtensions` | `SHOW_COMMON_EXTENSIONS` | `Boolean=false`. Controls the display of extensions (`pattern`, `maxLength`, `minLength`, `maximum`, `minimum`) fields and values for Parameters.
|
deep linking for tags and operations. See the <a
|
||||||
<a name="tagSorter"></a>`tagsSorter` | _Unavailable_ | `Function=(a => a)`. Apply a sort to the tag list of each API. It can be 'alpha' (sort by paths alphanumerically) or a function (see [Array.prototype.sort()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) to learn how to write a sort function). Two tag name strings are passed to the sorter for each pass. Default is the order determined by Swagger UI.
|
href="/docs/usage/deep-linking.md">Deep Linking
|
||||||
<a name="useUnsafeMarkdown"></a>`useUnsafeMarkdown` | `USE_UNSAFE_MARKDOWN` | `Boolean=false`. When enabled, sanitizer will leave `style`, `class` and `data-*` attributes untouched on all HTML Elements declared inside markdown strings. This parameter is **Deprecated** and will be removed in `4.0.0`.
|
documentation</a> for more information.
|
||||||
<a name="onComplete"></a>`onComplete` | _Unavailable_ | `Function=NOOP`. Provides a mechanism to be notified when Swagger UI has finished rendering a newly provided definition.
|
</td>
|
||||||
<a name="syntaxHighlight"></a>`syntaxHighlight` | _Unavailable_ | Set to `false` to deactivate syntax highlighting of payloads and cURL command, can be otherwise an object with the `activate` and `theme` properties.
|
</tr>
|
||||||
<a name="syntaxHighlight.activate"></a>`syntaxHighlight.activate` | _Unavailable_ | `Boolean=true`. Whether syntax highlighting should be activated or not.
|
<tr>
|
||||||
<a name="syntaxHighlight.theme"></a>`syntaxHighlight.theme` | _Unavailable_ | `String=["agate"*, "arta", "monokai", "nord", "obsidian", "tomorrow-night"]`. [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. (Only these 6 styles are available.)
|
<td><a name="user-content-displayoperationid"></a><code>displayOperationId</code>
|
||||||
<a name="tryItOutEnabled"></a>`tryItOutEnabled` | `TRY_IT_OUT_ENABLED` | `Boolean=false`. Controls whether the "Try it out" section should be enabled by default.
|
</td>
|
||||||
<a name="requestSnippets"></a>`requestSnippets` | _Unavailable_ | `Object`. This is the default configuration section for the the requestSnippets plugin.<br>requestSnippets: {<br> generators: {<br> "curl_bash": {<br> title: "cURL (bash)",<br> syntax: "bash"<br> },<br> "curl_powershell": {<br> title: "cURL (PowerShell)",<br> syntax: "powershell"<br> },<br> "curl_cmd": {<br> title: "cURL (CMD)",<br> syntax: "bash"<br> },<br> },<br> defaultExpanded: true,<br> languages: null, // e.g. only show curl bash = \["curl_bash"\]<br>},
|
<td><code>DISPLAY_OPERATION_ID</code></td>
|
||||||
|
<td><code>Boolean=false</code>. Controls the display of operationId in
|
||||||
|
operations list. The default is <code>false</code>.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-defaultmodelsexpanddepth"></a><code>defaultModelsExpandDepth</code>
|
||||||
|
</td>
|
||||||
|
<td><code>DEFAULT_MODELS_EXPAND_DEPTH</code></td>
|
||||||
|
<td><code>Number=1</code>. The default expansion depth for models (set
|
||||||
|
to -1 completely hide the models).
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-defaultmodelexpanddepth"></a><code>defaultModelExpandDepth</code>
|
||||||
|
</td>
|
||||||
|
<td><code>DEFAULT_MODEL_EXPAND_DEPTH</code></td>
|
||||||
|
<td><code>Number=1</code>. The default expansion depth for the model on
|
||||||
|
the model-example section.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-defaultmodelrendering"></a><code>defaultModelRendering</code>
|
||||||
|
</td>
|
||||||
|
<td><code>DEFAULT_MODEL_RENDERING</code></td>
|
||||||
|
<td><code>String=["example"*, "model"]</code>. Controls how the model is
|
||||||
|
shown when the API is first rendered. (The user can always switch
|
||||||
|
the rendering for a given model by clicking the 'Model' and 'Example
|
||||||
|
Value' links.)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-displayrequestduration"></a><code>displayRequestDuration</code>
|
||||||
|
</td>
|
||||||
|
<td><code>DISPLAY_REQUEST_DURATION</code></td>
|
||||||
|
<td><code>Boolean=false</code>. Controls the display of the request
|
||||||
|
duration (in milliseconds) for "Try it out" requests.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-docexpansion"></a><code>docExpansion</code>
|
||||||
|
</td>
|
||||||
|
<td><code>DOC_EXPANSION</code></td>
|
||||||
|
<td><code>String=["list"*, "full", "none"]</code>. Controls the default
|
||||||
|
expansion setting for the operations and tags. It can be 'list'
|
||||||
|
(expands only the tags), 'full' (expands the tags and operations) or
|
||||||
|
'none' (expands nothing).
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-filter"></a><code>filter</code></td>
|
||||||
|
<td><code>FILTER</code></td>
|
||||||
|
<td><code>Boolean=false OR String</code>. If set, enables filtering. The
|
||||||
|
top bar will show an edit box that you can use to filter the tagged
|
||||||
|
operations that are shown. Can be Boolean to enable or disable, or a
|
||||||
|
string, in which case filtering will be enabled using that string as
|
||||||
|
the filter expression. Filtering is case sensitive matching the
|
||||||
|
filter expression anywhere inside the tag.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a name="user-content-maxdisplayedtags"></a><code>maxDisplayedTags</code>
|
||||||
|
</td>
|
||||||
|
<td><code>MAX_DISPLAYED_TAGS</code></td>
|
||||||
|
<td><code>Number</code>. If set, limits the number of tagged operations
|
||||||
|
displayed to at most this many. The default is to show all
|
||||||
|
operations.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a name="user-content-operationssorter"></a><code>operationsSorter</code>
|
||||||
|
</td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td><code>Function=(a => a)</code>. Apply a sort to the operation
|
||||||
|
list of each API. It can be 'alpha' (sort by paths
|
||||||
|
alphanumerically), 'method' (sort by HTTP method) or a function (see
|
||||||
|
Array.prototype.sort() to know how sort function works). Default is
|
||||||
|
the order returned by the server unchanged.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a name="user-content-showextensions"></a><code>showExtensions</code>
|
||||||
|
</td>
|
||||||
|
<td><code>SHOW_EXTENSIONS</code></td>
|
||||||
|
<td><code>Boolean=false</code>. Controls the display of vendor extension
|
||||||
|
(<code>x-</code>) fields and values for Operations, Parameters,
|
||||||
|
Responses, and Schema.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-showcommonextensions"></a><code>showCommonExtensions</code>
|
||||||
|
</td>
|
||||||
|
<td><code>SHOW_COMMON_EXTENSIONS</code></td>
|
||||||
|
<td><code>Boolean=false</code>. Controls the display of extensions
|
||||||
|
(<code>pattern</code>, <code>maxLength</code>,
|
||||||
|
<code>minLength</code>, <code>maximum</code>, <code>minimum</code>)
|
||||||
|
fields and values for Parameters.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-tagsorter"></a><code>tagsSorter</code></td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td><code>Function=(a => a)</code>. Apply a sort to the tag list of
|
||||||
|
each API. It can be 'alpha' (sort by paths alphanumerically) or a
|
||||||
|
function (see <a
|
||||||
|
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort"
|
||||||
|
rel="nofollow">Array.prototype.sort()</a> to learn how to
|
||||||
|
write a sort function). Two tag name strings are passed to the
|
||||||
|
sorter for each pass. Default is the order determined by Swagger UI.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a name="user-content-useunsafemarkdown"></a><code>useUnsafeMarkdown</code>
|
||||||
|
</td>
|
||||||
|
<td><code>USE_UNSAFE_MARKDOWN</code></td>
|
||||||
|
<td><code>Boolean=false</code>. When enabled, sanitizer will leave
|
||||||
|
<code>style</code>, <code>class</code> and <code>data-*</code>
|
||||||
|
attributes untouched on all HTML Elements declared inside markdown
|
||||||
|
strings. This parameter is <strong>Deprecated</strong> and will be
|
||||||
|
removed in <code>4.0.0</code>.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-oncomplete"></a><code>onComplete</code></td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td><code>Function=NOOP</code>. Provides a mechanism to be notified when
|
||||||
|
Swagger UI has finished rendering a newly provided definition.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a name="user-content-syntaxhighlight"></a><code>syntaxHighlight</code>
|
||||||
|
</td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td>Set to <code>false</code> to deactivate syntax highlighting of
|
||||||
|
payloads and cURL command, can be otherwise an object with the
|
||||||
|
<code>activate</code> and <code>theme</code> properties.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-syntaxhighlight.activate"></a><code>syntaxHighlight.activate</code>
|
||||||
|
</td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td><code>Boolean=true</code>. Whether syntax highlighting should be
|
||||||
|
activated or not.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-syntaxhighlight.theme"></a><code>syntaxHighlight.theme</code>
|
||||||
|
</td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td><code>String=["agate"*, "arta", "monokai", "nord", "obsidian",
|
||||||
|
"tomorrow-night"]</code>. <a
|
||||||
|
href="https://highlightjs.org/static/demo/" rel="nofollow">Highlight.js</a>
|
||||||
|
syntax coloring theme to use. (Only these 6 styles are available.)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a name="user-content-tryitoutenabled"></a><code>tryItOutEnabled</code>
|
||||||
|
</td>
|
||||||
|
<td><code>TRY_IT_OUT_ENABLED</code></td>
|
||||||
|
<td><code>Boolean=false</code>. Controls whether the "Try it out"
|
||||||
|
section should be enabled by default.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a name="user-content-requestsnippetsenabled"></a><code>requestSnippetsEnabled</code>
|
||||||
|
</td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td><code>Boolean=false</code>. Enables the request snippet section.
|
||||||
|
When disabled, the legacy curl snippet will be used.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a name="user-content-requestsnippets"></a><code>requestSnippets</code>
|
||||||
|
</td>
|
||||||
|
<td><em>Unavailable</em></td>
|
||||||
|
<td>
|
||||||
|
<pre lang="javascript">
|
||||||
|
<code>Object={
|
||||||
|
generators: {
|
||||||
|
curl_bash: {
|
||||||
|
title: "cURL (bash)",
|
||||||
|
syntax: "bash"
|
||||||
|
},
|
||||||
|
curl_powershell: {
|
||||||
|
title: "cURL (PowerShell)",
|
||||||
|
syntax: "powershell"
|
||||||
|
},
|
||||||
|
curl_cmd: {
|
||||||
|
title: "cURL (CMD)",
|
||||||
|
syntax: "bash"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultExpanded: true,
|
||||||
|
languages: null,
|
||||||
|
// e.g. only show curl bash = ["curl_bash"]
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
</pre>
|
||||||
|
This is the default configuration section for the the
|
||||||
|
requestSnippets plugin.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
##### Network
|
##### Network
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user