UNPKG

@loopback/docs

Version:
1,168 lines (742 loc) 25 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="#7">constructor</a> </li> <li class="depth-4"> <a href="#14">build</a> </li> <li class="depth-4"> <a href="#10">withExtension</a> </li> <li class="depth-3"> <a href="#OpenApiSpecBuilder">Class: OpenApiSpecBuilder</a> </li> <li class="depth-4"> <a href="#17">constructor</a> </li> <li class="depth-4"> <a href="#19">withOperation</a> </li> <li class="depth-4"> <a href="#24">withOperationReturningString</a> </li> <li class="depth-3"> <a href="#OperationSpecBuilder">Class: OperationSpecBuilder</a> </li> <li class="depth-4"> <a href="#36">constructor</a> </li> <li class="depth-4"> <a href="#51">withOperationName</a> </li> <li class="depth-4"> <a href="#45">withParameter</a> </li> <li class="depth-4"> <a href="#48">withRequestBody</a> </li> <li class="depth-4"> <a href="#38">withResponse</a> </li> <li class="depth-4"> <a href="#42">withStringResponse</a> </li> <li class="depth-4"> <a href="#54">withTags</a> </li> <li class="depth-3"> <a href="#Extendable">Interface: Extendable</a> </li> <li class="depth-3"> <a href="#63">Function: anOpenApiSpec</a> </li> <li class="depth-3"> <a href="#65">Function: 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="7"></a> <h4 class="code-ref">constructor(initialSpec: T) : BuilderBase</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">initialSpec</strong> </td> <td class="code-arg-types"> <code>T</code> </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="14"></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="10"></a> <h4 class="code-ref">withExtension(key: string, value: <a href="#ExtensionValue">ExtensionValue</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>Add a custom (extension) property to the spec object.</p> </p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">key</strong> </td> <td class="code-arg-types"> <code>string</code> </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> <strong class="code-arg-name">value</strong> </td> <td class="code-arg-types"> <code><a href="#ExtensionValue">ExtensionValue</a></code> </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="17"></a> <h4 class="code-ref">constructor() : OpenApiSpecBuilder</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="19"></a> <h4 class="code-ref">withOperation(verb: string, path: string, spec: undefined) : 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> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">verb</strong> </td> <td class="code-arg-types"> <code>string</code> </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> <strong class="code-arg-name">path</strong> </td> <td class="code-arg-types"> <code>string</code> </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> <strong class="code-arg-name">spec</strong> </td> <td class="code-arg-types"> <code></code> </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="24"></a> <h4 class="code-ref">withOperationReturningString(verb: string, path: string, operationName: undefined) : 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> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">verb</strong> </td> <td class="code-arg-types"> <code>string</code> </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> <strong class="code-arg-name">path</strong> </td> <td class="code-arg-types"> <code>string</code> </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> <strong class="code-arg-name">operationName</strong> </td> <td class="code-arg-types"> <code></code> </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="36"></a> <h4 class="code-ref">constructor() : OperationSpecBuilder</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="51"></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> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">name</strong> </td> <td class="code-arg-types"> <code>string</code> </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="45"></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> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <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-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="48"></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). --> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <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-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="38"></a> <h4 class="code-ref">withResponse(status: undefined, 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> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">status</strong> </td> <td class="code-arg-types"> <code></code> </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> <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-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="42"></a> <h4 class="code-ref">withStringResponse(status: undefined) : this</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">status</strong> </td> <td class="code-arg-types"> <code></code> </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="54"></a> <h4 class="code-ref">withTags(tags: undefined) : 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> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">tags</strong> </td> <td class="code-arg-types"> <code></code> </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="Extendable"></a> <h3 class="code-ref">Interface: Extendable</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="63"></a> <h3 class="code-ref">Function: anOpenApiSpec</h3> <section class="code-doc "> <a name="63"></a> <h4 class="code-ref">anOpenApiSpec() : OpenApiSpecBuilder</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="65"></a> <h3 class="code-ref">Function: anOperationSpec</h3> <section class="code-doc "> <a name="65"></a> <h4 class="code-ref">anOperationSpec() : OperationSpecBuilder</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>