# Interface OpenSpec2

Interface
Module
import { OpenSpec2 } from "@tsed/openspec"
Source/packages/openspec/src/openspec2/OpenSpec2.ts

# Overview

interface OpenSpec2 {
swagger<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>

info?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecInfo.html"><span class="token">OpenSpecInfo</span></a><span class="token punctuation">;</span>

host?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>

basePath?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>

schemes?<span class="token punctuation">:</span> <span class="token punctuation">(</span>"http" | "https" | "ws" | "wss"<span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

consumes?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

produces?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

paths?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecHash.html"><span class="token">OpenSpecHash</span></a>&lt;<a href="/api/openspec/openspec2/OS2Paths.html"><span class="token">OS2Paths</span></a>&gt;<span class="token punctuation">;</span>

definitions?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecHash.html"><span class="token">OpenSpecHash</span></a>&lt;<a href="/api/openspec/openspec2/OS2Schema.html"><span class="token">OS2Schema</span></a>&gt;<span class="token punctuation">;</span>

parameters?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecHash.html"><span class="token">OpenSpecHash</span></a>&lt;<a href="/api/openspec/openspec2/OS2BodyParameter.html"><span class="token">OS2BodyParameter</span></a> | <a href="/api/openspec/openspec2/OS2QueryParameter.html"><span class="token">OS2QueryParameter</span></a>&gt;<span class="token punctuation">;</span>

responses?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecHash.html"><span class="token">OpenSpecHash</span></a>&lt;<a href="/api/openspec/openspec2/OS2Response.html"><span class="token">OS2Response</span></a>&gt;<span class="token punctuation">;</span>

security?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecSecurity.html"><span class="token">OpenSpecSecurity</span></a><span class="token punctuation">;</span>

securityDefinitions?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecHash.html"><span class="token">OpenSpecHash</span></a>&lt;<a href="/api/openspec/openspec2/OS2Security.html"><span class="token">OS2Security</span></a>&gt;<span class="token punctuation">;</span>

tags?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecTag.html"><span class="token">OpenSpecTag</span></a><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

externalDocs?<span class="token punctuation">:</span> <a href="/api/openspec/common/OpenSpecExternalDocs.html"><span class="token">OpenSpecExternalDocs</span></a><span class="token punctuation">;</span>

}

# Members

swagger: string;

Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be "2.0".


info?: OpenSpecInfo;

Provides metadata about the API. The metadata can be used by the clients if needed.


host?: string;

The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating.


basePath?: string;

The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). The basePath does not support path path templating.


schemes?: ("http" | "https" | "ws" | "wss")[];

The transfer protocol of the API. Values MUST be from the list: http, https, ws, wss. If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.


consumes?: string[];

A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types.


produces?: string[];

A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types.


The available paths and operations for the API.


definitions?: OpenSpecHash<OS2Schema>;

An object to hold data types produced and consumed by operations.


An object to hold parameters that can be used across operations. This property does not define global parameters for all operations.


An object to hold responses that can be used across operations. This property does not define global responses for all operations.


security?: OpenSpecSecurity;

A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition.


securityDefinitions?: OpenSpecHash<OS2Security>;

Security scheme definitions that can be used across the specification.


tags?: OpenSpecTag[];

A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared may be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.


externalDocs?: OpenSpecExternalDocs;

Additional external documentation.

Other topics