docs(configuration): document requestSnippetsEnabled config option

Along with that fix formatting of request snippet
value.
This commit is contained in:
Vladimir Gorej
2021-11-08 11:32:07 +01:00
parent 4a78313ebf
commit c7b215b6bb

View File

@@ -51,29 +51,239 @@ Parameter name | Docker variable | Description
##### Display
Parameter name | Docker variable | Description
--- | --- | -----
<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.
<a name="displayOperationId"></a>`displayOperationId` | `DISPLAY_OPERATION_ID` | `Boolean=false`. Controls the display of operationId in operations list. The default is `false`.
<a name="defaultModelsExpandDepth"></a>`defaultModelsExpandDepth` | `DEFAULT_MODELS_EXPAND_DEPTH` | `Number=1`. The default expansion depth for models (set to -1 completely hide the models).
<a name="defaultModelExpandDepth"></a>`defaultModelExpandDepth` | `DEFAULT_MODEL_EXPAND_DEPTH` | `Number=1`. The default expansion depth for the model on the model-example section.
<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.)
<a name="displayRequestDuration"></a>`displayRequestDuration` | `DISPLAY_REQUEST_DURATION` | `Boolean=false`. Controls the display of the request duration (in milliseconds) for "Try it out" requests.
<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).
<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.
<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.
<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.
<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.
<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.
<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.
<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`.
<a name="onComplete"></a>`onComplete` | _Unavailable_ | `Function=NOOP`. Provides a mechanism to be notified when Swagger UI has finished rendering a newly provided definition.
<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.
<a name="syntaxHighlight.activate"></a>`syntaxHighlight.activate` | _Unavailable_ | `Boolean=true`. Whether syntax highlighting should be activated or not.
<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.)
<a name="tryItOutEnabled"></a>`tryItOutEnabled` | `TRY_IT_OUT_ENABLED` | `Boolean=false`. Controls whether the "Try it out" section should be enabled by default.
<a name="requestSnippets"></a>`requestSnippets` | _Unavailable_ | `Object`. This is the default configuration section for the the requestSnippets plugin.<br>requestSnippets: {<br>&nbsp;&nbsp;generators: {<br>&nbsp;&nbsp;&nbsp;&nbsp;"curl_bash": {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title: "cURL (bash)",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;syntax: "bash"<br>&nbsp;&nbsp;&nbsp;&nbsp;},<br>&nbsp;&nbsp;&nbsp;&nbsp;"curl_powershell": {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title: "cURL (PowerShell)",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;syntax: "powershell"<br>&nbsp;&nbsp;&nbsp;&nbsp;},<br>&nbsp;&nbsp;&nbsp;&nbsp;"curl_cmd": {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title: "cURL (CMD)",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;syntax: "bash"<br>&nbsp;&nbsp;&nbsp;&nbsp;},<br>&nbsp;&nbsp;},<br>&nbsp;&nbsp;defaultExpanded: true,<br>&nbsp;&nbsp;languages: null, // e.g. only show curl bash = \["curl_bash"\]<br>},
<table role="table">
<thead>
<tr>
<th>Parameter name</th>
<th>Docker variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a name="user-content-deeplinking"></a><code>deepLinking</code></td>
<td><code>DEEP_LINKING</code></td>
<td><code>Boolean=false</code>. If set to <code>true</code>, enables
deep linking for tags and operations. See the <a
href="/docs/usage/deep-linking.md">Deep Linking
documentation</a> for more information.
</td>
</tr>
<tr>
<td><a name="user-content-displayoperationid"></a><code>displayOperationId</code>
</td>
<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 =&gt; 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 =&gt; 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