UNPKG

@loopback/docs

Version:
1,315 lines (874 loc) 28 kB
<!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="#BuilderBase">Class: BuilderBase</a> </li> <li class="depth-4"> <a href="#BuilderBase.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#BuilderBase.prototype.build">build()</a> </li> <li class="depth-4"> <a href="#BuilderBase.prototype.withExtension">withExtension()</a> </li> <li class="depth-3"> <a href="#OpenApiSpecBuilder">Class: OpenApiSpecBuilder</a> </li> <li class="depth-4"> <a href="#OpenApiSpecBuilder.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#OpenApiSpecBuilder.prototype.withOperation">withOperation()</a> </li> <li class="depth-4"> <a href="#OpenApiSpecBuilder.prototype.withOperationReturningString">withOperationReturningString()</a> </li> <li class="depth-3"> <a href="#OperationSpecBuilder">Class: OperationSpecBuilder</a> </li> <li class="depth-4"> <a href="#OperationSpecBuilder.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#OperationSpecBuilder.prototype.withOperationName">withOperationName()</a> </li> <li class="depth-4"> <a href="#OperationSpecBuilder.prototype.withParameter">withParameter()</a> </li> <li class="depth-4"> <a href="#OperationSpecBuilder.prototype.withRequestBody">withRequestBody()</a> </li> <li class="depth-4"> <a href="#OperationSpecBuilder.prototype.withResponse">withResponse()</a> </li> <li class="depth-4"> <a href="#OperationSpecBuilder.prototype.withStringResponse">withStringResponse()</a> </li> <li class="depth-4"> <a href="#OperationSpecBuilder.prototype.withTags">withTags()</a> </li> <li class="depth-3"> <a href="#anOpenApiSpec">anOpenApiSpec()</a> </li> <li class="depth-3"> <a href="#anOperationSpec">anOperationSpec()</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="BuilderBase"></a> <h3 class="code-ref">Class: builderbase = new BuilderBase()</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 name="BuilderBase.constructor"></a> <h4 class="code-ref">constructor(initialSpec: T) : <a href="#BuilderBase">BuilderBase</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <!-- 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"> initialSpec </strong> </td> <td class="code-arg-types"> <code>T</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). --> </td> </tr> </table> </section> <section class="code-doc "> <a name="BuilderBase.prototype.build"></a> <h4 class="code-ref">build() : T</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>Build the spec object.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="BuilderBase.prototype.withExtension"></a> <h4 class="code-ref">withExtension(key: string, value: any) : this</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>Add a custom (extension) property to the spec object.</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"> key </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 property name starting with &quot;x-&quot;.</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> value </strong> </td> <td class="code-arg-types"> <code>any</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 property value.</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OpenApiSpecBuilder"></a> <h3 class="code-ref">Class: openapispecbuilder = new OpenApiSpecBuilder()</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>A builder for creating OpenApiSpec documents.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="OpenApiSpecBuilder.constructor"></a> <h4 class="code-ref">constructor() : <a href="#OpenApiSpecBuilder">OpenApiSpecBuilder</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> <p></p> </div> </section> <section class="code-doc "> <a name="OpenApiSpecBuilder.prototype.withOperation"></a> <h4 class="code-ref">withOperation(verb: string, path: string, spec: <a href="#OperationObject">OperationObject</a> | <a href="#OperationSpecBuilder">OperationSpecBuilder</a>) : this</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 new OperationObject at the given path and verb (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"> 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>The HTTP verb.</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 path relative to basePath.</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> | <a href="#OperationSpecBuilder">OperationSpecBuilder</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>Additional specification of the operation.</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OpenApiSpecBuilder.prototype.withOperationReturningString"></a> <h4 class="code-ref">withOperationReturningString(verb: string, path: string, operationName: undefined | string) : this</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 new operation that returns a string response.</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>The HTTP verb.</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 path relative to basePath.</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> operationName </strong> </td> <td class="code-arg-types"> <code>undefined | string</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 name of the controller method implementing this operation (<code>x-operation-name</code> field).</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OperationSpecBuilder"></a> <h3 class="code-ref">Class: operationspecbuilder = new OperationSpecBuilder()</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>A builder for creating OperationObject specifications.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="OperationSpecBuilder.constructor"></a> <h4 class="code-ref">constructor() : <a href="#OperationSpecBuilder">OperationSpecBuilder</a></h4> <!-- 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 name="OperationSpecBuilder.prototype.withOperationName"></a> <h4 class="code-ref">withOperationName(name: string) : this</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 the operation name (controller method name).</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> <p><p>The name of the controller method implementing this operation.</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OperationSpecBuilder.prototype.withParameter"></a> <h4 class="code-ref">withParameter(parameterSpec: <a href="#ParameterObject">ParameterObject</a>) : this</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>Describe a parameter accepted by the operation. Note that parameters are positional in OpenAPI Spec, therefore the first call of <code>withParameter</code> defines the first parameter, the second call defines the second parameter, etc.</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"> parameterSpec </strong> </td> <td class="code-arg-types"> <code><a href="#ParameterObject">ParameterObject</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> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OperationSpecBuilder.prototype.withRequestBody"></a> <h4 class="code-ref">withRequestBody(requestBodySpec: <a href="#RequestBodyObject">RequestBodyObject</a>) : this</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <!-- 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"> requestBodySpec </strong> </td> <td class="code-arg-types"> <code><a href="#RequestBodyObject">RequestBodyObject</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>A builder for creating OperationObject specifications.</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OperationSpecBuilder.prototype.withResponse"></a> <h4 class="code-ref">withResponse(status: number | , responseSpec: <a href="#ResponseObject">ResponseObject</a>) : this</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>Describe a response for a given HTTP status code.</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"> status </strong> </td> <td class="code-arg-types"> <code>number | </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 status code or string &quot;default&quot;</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> responseSpec </strong> </td> <td class="code-arg-types"> <code><a href="#ResponseObject">ResponseObject</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>Specification of the response</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OperationSpecBuilder.prototype.withStringResponse"></a> <h4 class="code-ref">withStringResponse(status: number | ) : this</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <!-- 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"> status </strong> </td> <td class="code-arg-types"> <code>number | </code> </td> <td class="code-arg-default-value"> 200 </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>A builder for creating OperationObject specifications.</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="OperationSpecBuilder.prototype.withTags"></a> <h4 class="code-ref">withTags(tags: string | string[]) : this</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>Describe tags associated with the 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"> tags </strong> </td> <td class="code-arg-types"> <code>string | 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> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="anOpenApiSpec"></a> <h3 class="code-ref">Function: anOpenApiSpec</h3> <section class="code-doc "> <a name="anOpenApiSpec"></a> <h4 class="code-ref">anOpenApiSpec() : <a href="#OpenApiSpecBuilder">OpenApiSpecBuilder</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>Create a new instance of OpenApiSpecBuilder.</p> </p> <p></p> </div> </section> </section> <section class="code-doc "> <a name="anOperationSpec"></a> <h3 class="code-ref">Function: anOperationSpec</h3> <section class="code-doc "> <a name="anOperationSpec"></a> <h4 class="code-ref">anOperationSpec() : <a href="#OperationSpecBuilder">OperationSpecBuilder</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>Create a new instance of OperationSpecBuilder.</p> </p> <p></p> </div> </section> </section> </div> <div class="intentionally-left-blank"></div> </div> </div> <script src="js/vendor/jquery-1.10.1.min.js"></script> <script src="js/vendor/jquery.scrollTo-1.4.3.1.js"></script> <script src="js/vendor/bootstrap.min.js"></script> <script src="js/main.js"></script> </body> </html>