Page Contents

Home > @loopback/openapi-spec-builder > OpenApiSpecBuilder

OpenApiSpecBuilder class

A builder for creating OpenApiSpec documents.

Signature:

export declare class OpenApiSpecBuilder extends BuilderBase<OpenAPIObject> 

Extends: BuilderBase<OpenAPIObject>

Constructors

Constructor Modifiers Description
[(constructor)()](/doc/en/lb4/apidocs.openapi-spec-builder.openapispecbuilder._constructor_.html) Constructs a new instance of the `OpenApiSpecBuilder` class

Methods

Method Modifiers Description
[withComponents(spec)](/doc/en/lb4/apidocs.openapi-spec-builder.openapispecbuilder.withcomponents.html) Define a new ComponentsObject.
[withOperation(verb, path, spec)](/doc/en/lb4/apidocs.openapi-spec-builder.openapispecbuilder.withoperation.html) Define a new OperationObject at the given path and verb (method).
[withOperationReturningString(verb, path, operationName)](/doc/en/lb4/apidocs.openapi-spec-builder.openapispecbuilder.withoperationreturningstring.html) Define a new operation that returns a string response.