@loopback/docs
Version:
Documentation for LoopBack 4
2,249 lines (1,663 loc) • 84.3 kB
HTML
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/code-themes/sl-theme.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">docs.strongloop.com</a>
</div>
<div id="modules"></div>
</div>
<div class="row">
<div class="col-lg-3 column scroll-spy-target">
<ul class="nav nav-pills nav-stacked">
<div id="versions"></div>
<li class="depth-3">
<a href="#ControllerSpec">Interface: ControllerSpec</a>
</li>
<li class="depth-4">
<a href="#218">basePath</a>
</li>
<li class="depth-4">
<a href="#220">components</a>
</li>
<li class="depth-4">
<a href="#219">paths</a>
</li>
<li class="depth-3">
<a href="#RestEndpoint">Interface: RestEndpoint</a>
</li>
<li class="depth-4">
<a href="#223">path</a>
</li>
<li class="depth-4">
<a href="#224">spec</a>
</li>
<li class="depth-4">
<a href="#222">verb</a>
</li>
<li class="depth-3">
<a href="#229">getControllerSpec()</a>
</li>
<li class="depth-3">
<a href="#233">api()</a>
</li>
<li class="depth-3">
<a href="#42">del()</a>
</li>
<li class="depth-3">
<a href="#2">get()</a>
</li>
<li class="depth-3">
<a href="#52">operation()</a>
</li>
<li class="depth-3">
<a href="#32">patch()</a>
</li>
<li class="depth-3">
<a href="#12">post()</a>
</li>
<li class="depth-3">
<a href="#22">put()</a>
</li>
<li class="depth-3">
<a href="#param">Namespace: param</a>
</li>
<li class="depth-4">
<a href="#154">array()</a>
</li>
<li class="depth-4">
<a href="#header">Object: header</a>
</li>
<li class="depth-4">
<a href="#path">Object: path</a>
</li>
<li class="depth-4">
<a href="#query">Object: query</a>
</li>
<li class="depth-3">
<a href="#requestBody">Namespace: requestBody</a>
</li>
<li class="depth-4">
<a href="#169">array()</a>
</li>
<li class="depth-3">
<a href="#REQUEST_BODY_INDEX">REQUEST_BODY_INDEX</a>
</li>
<li class="depth-3">
<a href="#67">getSchemaForParam()</a>
</li>
<li class="depth-3">
<a href="#71">getSchemaForRequestBody()</a>
</li>
<li class="depth-3">
<a href="#180">jsonOrBooleanToJSON()</a>
</li>
<li class="depth-3">
<a href="#177">jsonToSchemaObject()</a>
</li>
<li class="depth-3">
<a href="#OAI3Keys">Namespace: OAI3Keys</a>
</li>
<li class="depth-4">
<a href="#CLASS_KEY">CLASS_KEY</a>
</li>
<li class="depth-4">
<a href="#CONTROLLER_SPEC_KEY">CONTROLLER_SPEC_KEY</a>
</li>
<li class="depth-4">
<a href="#METHODS_KEY">METHODS_KEY</a>
</li>
<li class="depth-4">
<a href="#PARAMETERS_KEY">PARAMETERS_KEY</a>
</li>
<li class="depth-4">
<a href="#REQUEST_BODY_KEY">REQUEST_BODY_KEY</a>
</li>
</ul>
</div>
<div class="col-lg-9 col-lg-offset-3 column" data-spy="scroll" data-target=".scroll-spy-target" data-offset="0">
<div class="readability">
<section class="code-doc ">
<a name="ControllerSpec"></a>
<h3 class="code-ref">Interface: ControllerSpec</h3>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
</section>
<section class="code-doc">
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Properties</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name="218"></a>
<strong class="code-arg-name">
basePath
</strong>
</td>
<td class="code-arg-types">
<code>undefined | string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
exported optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>The base path on which the Controller API is served.
If it is not included, the API is served directly under the host.
The value MUST start with a leading slash (/).</p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name="220"></a>
<strong class="code-arg-name">
components
</strong>
</td>
<td class="code-arg-types">
<code><a href="#ComponentsObject">ComponentsObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
exported optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>OpenAPI components.schemas generated from model metadata</p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name="219"></a>
<strong class="code-arg-name">
paths
</strong>
</td>
<td class="code-arg-types">
<code><a href="#PathObject">PathObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>The available paths and operations for the API.</p>
</p>
<p></p>
</div>
</td>
</tr>
</table>
</section>
<section class="code-doc ">
<a name="RestEndpoint"></a>
<h3 class="code-ref">Interface: RestEndpoint</h3>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Data structure for REST related metadata</p>
</p>
<p></p>
</div>
</section>
<section class="code-doc">
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Properties</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name="223"></a>
<strong class="code-arg-name">
path
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Data structure for REST related metadata</p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name="224"></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#OperationObject">OperationObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
exported optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Data structure for REST related metadata</p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name="222"></a>
<strong class="code-arg-name">
verb
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Data structure for REST related metadata</p>
</p>
<p></p>
</div>
</td>
</tr>
</table>
</section>
<section class="code-doc ">
<a name="229"></a>
<h3 class="code-ref">Function: getControllerSpec</h3>
<section class="code-doc ">
<a name="229"></a>
<h4 class="code-ref">getControllerSpec(constructor: <a href="#Function">Function</a>) : <a href="#ControllerSpec">ControllerSpec</a></h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Get the controller spec for the given class</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
constructor
</strong>
</td>
<td class="code-arg-types">
<code><a href="#Function">Function</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>Controller class</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="233"></a>
<h3 class="code-ref">Function: api</h3>
<section class="code-doc ">
<a name="233"></a>
<h4 class="code-ref">api(spec: <a href="#ControllerSpec">ControllerSpec</a>) : anonymous</h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Decorate the given Controller constructor with metadata describing
the HTTP/REST API the Controller implements/provides.</p>
</p>
<p><p><code>@api</code> can be applied to controller classes. For example,</p>
<pre><code><span class="hljs-meta">@api</span>({<span class="hljs-string">basePath:</span> <span class="hljs-string">'/my'</span>})
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyController</span> {</span>
<span class="hljs-comment">// ...</span>
}
</code></pre></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#ControllerSpec">ControllerSpec</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>OpenAPI specification describing the endpoints
handled by this controller</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="42"></a>
<h3 class="code-ref">Function: del</h3>
<section class="code-doc ">
<a name="42"></a>
<h4 class="code-ref">del(path: string, spec: <a href="#OperationObject">OperationObject</a>) : anonymous</h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Expose a Controller method as a REST API operation
mapped to <code>DELETE</code> request method.</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
path
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The URL path of this operation, e.g. <code>/product/{id}</code></p>
</p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#OperationObject">OperationObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The OpenAPI specification describing parameters and responses
of this operation.</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="2"></a>
<h3 class="code-ref">Function: get</h3>
<section class="code-doc ">
<a name="2"></a>
<h4 class="code-ref">get(path: string, spec: <a href="#OperationObject">OperationObject</a>) : anonymous</h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Expose a Controller method as a REST API operation
mapped to <code>GET</code> request method.</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
path
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The URL path of this operation, e.g. <code>/product/{id}</code></p>
</p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#OperationObject">OperationObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The OpenAPI specification describing parameters and responses
of this operation.</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="52"></a>
<h3 class="code-ref">Function: operation</h3>
<section class="code-doc ">
<a name="52"></a>
<h4 class="code-ref">operation(verb: string, path: string, spec: <a href="#OperationObject">OperationObject</a>) : anonymous</h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Expose a Controller method as a REST API operation.</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
verb
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>HTTP verb, e.g. <code>GET</code> or <code>POST</code>.</p>
</p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
path
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The URL path of this operation, e.g. <code>/product/{id}</code></p>
</p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#OperationObject">OperationObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The OpenAPI specification describing parameters and responses
of this operation.</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="32"></a>
<h3 class="code-ref">Function: patch</h3>
<section class="code-doc ">
<a name="32"></a>
<h4 class="code-ref">patch(path: string, spec: <a href="#OperationObject">OperationObject</a>) : anonymous</h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Expose a Controller method as a REST API operation
mapped to <code>PATCH</code> request method.</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
path
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The URL path of this operation, e.g. <code>/product/{id}</code></p>
</p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#OperationObject">OperationObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The OpenAPI specification describing parameters and responses
of this operation.</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="12"></a>
<h3 class="code-ref">Function: post</h3>
<section class="code-doc ">
<a name="12"></a>
<h4 class="code-ref">post(path: string, spec: <a href="#OperationObject">OperationObject</a>) : anonymous</h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Expose a Controller method as a REST API operation
mapped to <code>POST</code> request method.</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
path
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The URL path of this operation, e.g. <code>/product/{id}</code></p>
</p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#OperationObject">OperationObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The OpenAPI specification describing parameters and responses
of this operation.</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="22"></a>
<h3 class="code-ref">Function: put</h3>
<section class="code-doc ">
<a name="22"></a>
<h4 class="code-ref">put(path: string, spec: <a href="#OperationObject">OperationObject</a>) : anonymous</h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Expose a Controller method as a REST API operation
mapped to <code>PUT</code> request method.</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
path
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The URL path of this operation, e.g. <code>/product/{id}</code></p>
</p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
spec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#OperationObject">OperationObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
optional
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p></p>
<p><p>The OpenAPI specification describing parameters and responses
of this operation.</p>
</p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="param"></a>
<h3 class="code-ref">Namespace: param</h3>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Shortcut parameter decorators</p>
</p>
<p></p>
</div>
</section>
<section class="code-doc ">
<a name="154"></a>
<h3 class="code-ref">Function: param.array</h3>
<section class="code-doc ">
<a name="154"></a>
<h4 class="code-ref">param.array(name: string, source: <a href="#ParameterLocation">ParameterLocation</a>, itemSpec: <a href="#SchemaObject">SchemaObject</a> | <a href="#ReferenceObject">ReferenceObject</a>) : <a href="#(Anonymous function)">(Anonymous function)</a></h4>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of <code>array</code> type.</p>
</p>
<p></p>
</div>
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Parameters</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
name
</strong>
</td>
<td class="code-arg-types">
<code>string</code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Parameter name</p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
source
</strong>
</td>
<td class="code-arg-types">
<code><a href="#ParameterLocation">ParameterLocation</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Source of the parameter value</p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
itemSpec
</strong>
</td>
<td class="code-arg-types">
<code><a href="#SchemaObject">SchemaObject</a> | <a href="#ReferenceObject">ReferenceObject</a></code>
</td>
<td class="code-arg-default-value">
</td>
<td class="code-arg-flags">
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Item type for the array or the full item object</p>
</p>
<p></p>
</div>
</td>
</tr>
</table>
</section>
</section>
<section class="code-doc ">
<a name="header"></a>
<h3 class="code-ref">Object literal: param.header</h3>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Shortcut parameter decorators</p>
</p>
<p></p>
</div>
</section>
<section class="code-doc">
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Variables</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
binary
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.binary)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "binary" type that's read from a request header.
Usage: <code>@param.header.binary('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
boolean
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.boolean)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "boolean" type that's read from a request header.
Usage: <code>@param.header.boolean('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
byte
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.byte)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "byte" type that's read from a request header.
Usage: <code>@param.header.byte('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
date
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.date)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "date" type that's read from a request header.
Usage: <code>@param.header.date('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
dateTime
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.dateTime)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "dateTime" type that's read from a request header.
Usage: <code>@param.header.dateTime('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
double
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.double)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "double" type that's read from a request header.
Usage: <code>@param.header.double('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
float
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.float)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "float" type that's read from a request header.
Usage: <code>@param.header.float('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
integer
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.integer)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "integer" type that's read from a request header.
Usage: <code>@param.header.integer('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
long
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.long)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "long" type that's read from a request header.
Usage: <code>@param.header.long('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
number
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.number)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "number" type that's read from a request header.
Usage: <code>@param.header.number('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
password
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.password)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "password" type that's read from a request header.
Usage: <code>@param.header.password('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
string
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('header', builtinTypes.string)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "string" type that's read from a request header.
Usage: <code>@param.header.string('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
</table>
</section>
<section class="code-doc ">
<a name="path"></a>
<h3 class="code-ref">Object literal: param.path</h3>
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Shortcut parameter decorators</p>
</p>
<p></p>
</div>
</section>
<section class="code-doc">
<!-- A table of members such as parameters/properties/variables -->
<div class="code-arguments-hdr">Variables</div>
<table class="params code-arguments">
<tr>
<th class="hdr-name">Name</th>
<th class="hdr-type">Type</th>
<th class="hdr-default-value">Default Value</th>
<th class="hdr-flags">Flags</th>
<th class="hdr-desc">Description</th>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
binary
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('path', builtinTypes.binary)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "binary" type that's read from request path.
Usage: <code>@param.path.binary('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
boolean
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('path', builtinTypes.boolean)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "boolean" type that's read from request path.
Usage: <code>@param.path.boolean('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
byte
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('path', builtinTypes.byte)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function.
(Excludes Type alias).
-->
<div class="code-desc">
<p><p>Define a parameter of "byte" type that's read from request path.
Usage: <code>@param.path.byte('paramName')</code></p>
</p>
<p></p>
</div>
</td>
</tr>
<tr class="code-arg">
<td>
<a name=""></a>
<strong class="code-arg-name">
date
</strong>
</td>
<td class="code-arg-types">
<code><a href="#(Anonymous function)">(Anonymous function)</a></code>
</td>
<td class="code-arg-default-value">
createParamShortcut('path', builtinTypes.date)
</td>
<td class="code-arg-flags">
exported
</td>
<td class="code-arg-desc">
<!--
Used for displaying comments in Class, Interface, Properties Constructor,
Function and Parameters of constructor or function