| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| basePath |
undefined | string
|
exported optional |
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 (/). |
|
| components |
ComponentsObject
|
exported optional |
OpenAPI components.schemas generated from model metadata |
|
| paths |
PathObject
|
exported |
The available paths and operations for the API. |
Data structure for REST related metadata
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| path |
string
|
exported |
Data structure for REST related metadata |
|
| spec |
OperationObject
|
exported optional |
Data structure for REST related metadata |
|
| verb |
string
|
exported |
Data structure for REST related metadata |
Get the controller spec for the given class
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| constructor |
Function
|
Controller class |
Decorate the given Controller constructor with metadata describing the HTTP/REST API the Controller implements/provides.
@api can be applied to controller classes. For example,
@api({basePath: '/my'})
class MyController {
// ...
}
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| spec |
ControllerSpec
|
OpenAPI specification describing the endpoints handled by this controller |
Expose a Controller method as a REST API operation
mapped to DELETE request method.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| path |
string
|
The URL path of this operation, e.g. |
||
| spec |
OperationObject
|
optional |
The OpenAPI specification describing parameters and responses of this operation. |
Expose a Controller method as a REST API operation
mapped to GET request method.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| path |
string
|
The URL path of this operation, e.g. |
||
| spec |
OperationObject
|
optional |
The OpenAPI specification describing parameters and responses of this operation. |
Expose a Controller method as a REST API operation.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| verb |
string
|
HTTP verb, e.g. |
||
| path |
string
|
The URL path of this operation, e.g. |
||
| spec |
OperationObject
|
optional |
The OpenAPI specification describing parameters and responses of this operation. |
Expose a Controller method as a REST API operation
mapped to PATCH request method.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| path |
string
|
The URL path of this operation, e.g. |
||
| spec |
OperationObject
|
optional |
The OpenAPI specification describing parameters and responses of this operation. |
Expose a Controller method as a REST API operation
mapped to POST request method.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| path |
string
|
The URL path of this operation, e.g. |
||
| spec |
OperationObject
|
optional |
The OpenAPI specification describing parameters and responses of this operation. |
Expose a Controller method as a REST API operation
mapped to PUT request method.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| path |
string
|
The URL path of this operation, e.g. |
||
| spec |
OperationObject
|
optional |
The OpenAPI specification describing parameters and responses of this operation. |
Shortcut parameter decorators
Define a parameter of array type.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| name |
string
|
Parameter name |
||
| source |
ParameterLocation
|
Source of the parameter value |
||
| itemSpec |
SchemaObject | ReferenceObject
|
Item type for the array or the full item object |
Shortcut parameter decorators
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| binary |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.binary) | exported |
Define a parameter of "binary" type that's read from a request header.
Usage: |
| boolean |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.boolean) | exported |
Define a parameter of "boolean" type that's read from a request header.
Usage: |
| byte |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.byte) | exported |
Define a parameter of "byte" type that's read from a request header.
Usage: |
| date |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.date) | exported |
Define a parameter of "date" type that's read from a request header.
Usage: |
| dateTime |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.dateTime) | exported |
Define a parameter of "dateTime" type that's read from a request header.
Usage: |
| double |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.double) | exported |
Define a parameter of "double" type that's read from a request header.
Usage: |
| float |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.float) | exported |
Define a parameter of "float" type that's read from a request header.
Usage: |
| integer |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.integer) | exported |
Define a parameter of "integer" type that's read from a request header.
Usage: |
| long |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.long) | exported |
Define a parameter of "long" type that's read from a request header.
Usage: |
| number |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.number) | exported |
Define a parameter of "number" type that's read from a request header.
Usage: |
| password |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.password) | exported |
Define a parameter of "password" type that's read from a request header.
Usage: |
| string |
(Anonymous function)
|
createParamShortcut('header', builtinTypes.string) | exported |
Define a parameter of "string" type that's read from a request header.
Usage: |
Shortcut parameter decorators
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| binary |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.binary) | exported |
Define a parameter of "binary" type that's read from request path.
Usage: |
| boolean |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.boolean) | exported |
Define a parameter of "boolean" type that's read from request path.
Usage: |
| byte |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.byte) | exported |
Define a parameter of "byte" type that's read from request path.
Usage: |
| date |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.date) | exported |
Define a parameter of "date" type that's read from request path.
Usage: |
| dateTime |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.dateTime) | exported |
Define a parameter of "dateTime" type that's read from request path.
Usage: |
| double |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.double) | exported |
Define a parameter of "double" type that's read from request path.
Usage: |
| float |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.float) | exported |
Define a parameter of "float" type that's read from request path.
Usage: |
| integer |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.integer) | exported |
Define a parameter of "integer" type that's read from request path.
Usage: |
| long |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.long) | exported |
Define a parameter of "long" type that's read from request path.
Usage: |
| number |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.number) | exported |
Define a parameter of "number" type that's read from request path.
Usage: |
| password |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.password) | exported |
Define a parameter of "password" type that's read from request path.
Usage: |
| string |
(Anonymous function)
|
createParamShortcut('path', builtinTypes.string) | exported |
Define a parameter of "string" type that's read from request path.
Usage: |
Shortcut parameter decorators
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| binary |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.binary) | exported |
Define a parameter of "binary" type that's read from the query string.
Usage: |
| boolean |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.boolean) | exported |
Define a parameter of "boolean" type that's read from the query string.
Usage: |
| byte |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.byte) | exported |
Define a parameter of "byte" type that's read from the query string.
Usage: |
| date |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.date) | exported |
Define a parameter of "date" type that's read from the query string.
Usage: |
| dateTime |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.dateTime) | exported |
Define a parameter of "dateTime" type that's read from the query string.
Usage: |
| double |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.double) | exported |
Define a parameter of "double" type that's read from the query string.
Usage: |
| float |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.float) | exported |
Define a parameter of "float" type that's read from the query string.
Usage: |
| integer |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.integer) | exported |
Define a parameter of "integer" type that's read from the query string.
Usage: |
| long |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.long) | exported |
Define a parameter of "long" type that's read from the query string.
Usage: |
| number |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.number) | exported |
Define a parameter of "number" type that's read from the query string.
Usage: |
| password |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.password) | exported |
Define a parameter of "password" type that's read from the query string.
Usage: |
| string |
(Anonymous function)
|
createParamShortcut('query', builtinTypes.string) | exported |
Define a parameter of "integer" type that's read from the query string.
Usage: |
Define a requestBody of array type.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| itemSpec |
SchemaObject | ReferenceObject
|
the full item object |
||
| properties |
undefined | anonymous
|
optional |
The requestBody properties other than |
Generate the type and format property in a Schema Object according to a
parameter's type.
type and format will be preserved if provided in schema
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| type |
Function
|
The JavaScript type of a parameter |
||
| schema |
SchemaObject
|
optional |
The schema object provided in an parameter object |
Get OpenAPI Schema for a JavaScript type for a body parameter
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| type |
Function
|
The JavaScript type of an argument deccorated by @requestBody |
Helper function used to interpret boolean values as JSON Schemas. See http://json-schema.org/draft-06/json-schema-release-notes.html
A JSON Schema document representing the input value.
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| jsonOrBool |
boolean | JsonSchema
|
converts boolean values into their representative JSON Schemas |
Converts JSON Schemas into a SchemaObject
| Name | Type | Default Value | Flags | Description |
|---|---|---|---|---|
| json |
JsonSchema
|
JSON Schema to convert from |
Binding key used to set or retrieve @api metadata
Binding key used to set or retrieve a controller spec
Binding key used to set or retrieve @operation metadata.
Binding key used to set or retrieve param decorator metadata
Binding key used to set or retrieve @requestBody metadata