---
lang: en
title: 'API docs: openapi-spec-builder.openapispecbuilder'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.openapi-spec-builder.openapispecbuilder.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/openapi-spec-builder](./openapi-spec-builder.md) &gt; [OpenApiSpecBuilder](./openapi-spec-builder.openapispecbuilder.md)

## OpenApiSpecBuilder class

A builder for creating OpenApiSpec documents.

<b>Signature:</b>

```typescript
export declare class OpenApiSpecBuilder extends BuilderBase<OpenApiSpec> 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)()](./openapi-spec-builder.openapispecbuilder._constructor_.md) |  | Constructs a new instance of the <code>OpenApiSpecBuilder</code> class |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [withOperation(verb, path, spec)](./openapi-spec-builder.openapispecbuilder.withoperation.md) |  | Define a new OperationObject at the given path and verb (method). |
|  [withOperationReturningString(verb, path, operationName)](./openapi-spec-builder.openapispecbuilder.withoperationreturningstring.md) |  | Define a new operation that returns a string response. |


