Page Contents

Home > @loopback/openapi-v3

openapi-v3 package

@loopback/openapi-v3

Functions

Function Description
api(spec) Decorate the given Controller constructor with metadata describing the HTTP/REST API the Controller implements/provides.@api can be applied to controller classes.
del(path, spec) Expose a Controller method as a REST API operation mapped to DELETE request method.
get(path, spec) Expose a Controller method as a REST API operation mapped to GET request method.
getControllerSpec(constructor) Get the controller spec for the given class
getFilterSchemaFor(modelCtor) Build an OpenAPI schema describing the format of the “filter” object used to query model instances.Note we don’t take the model properties into account yet and return a generic json schema allowing any “where” condition.
getModelSchemaRef(modelCtor, options) Describe the provided Model as a reference to a definition shared by multiple endpoints. The definition is included in the returned schema.
getWhereSchemaFor(modelCtor) Build a OpenAPI schema describing the format of the “where” object used to filter model instances to query, update or delete.Note we don’t take the model properties into account yet and return a generic json schema allowing any “where” condition.
jsonOrBooleanToJSON(jsonOrBool) Helper function used to interpret boolean values as JSON Schemas. See http://json-schema.org/draft-06/json-schema-release-notes.html
jsonToSchemaObject(json) Converts JSON Schemas into a SchemaObject
operation(verb, path, spec) Expose a Controller method as a REST API operation.
param(paramSpec) Describe an input parameter of a Controller method.@param must be applied to parameters.
patch(path, spec) Expose a Controller method as a REST API operation mapped to PATCH request method.
post(path, spec) Expose a Controller method as a REST API operation mapped to POST request method.
put(path, spec) Expose a Controller method as a REST API operation mapped to PUT request method.
requestBody(requestBodySpec) Describe the request body of a Controller method parameter.A typical OpenAPI requestBody spec contains property: - description - required - content.

Interfaces

Interface Description
ControllerSpec  
RestEndpoint Data structure for REST related metadata

Namespaces

Namespace Description
param Describe an input parameter of a Controller method. The @param decorator takes an argument of ParameterObject to define how to map the parameter to OpenAPI specification.@param(paramSpec) must be applied to parameters.
requestBody  

Variables

Variable Description
REQUEST_BODY_INDEX  
TS_TYPE_KEY  

Type Aliases

Type Alias Description
SchemaRef Custom LoopBack extension: a reference to Schema object that’s bundled inside definitions property.