Skip to main content Link Search Menu Expand Document (external link)

OpenApiTypes overview

OpenAPI types.

Added in v1.0.0


Table of contents


models

AnySchema (type alias)

Signature

export type AnySchema = Schema.Schema<any, any, any>

Added in v1.0.0

OpenAPIApiKeySecurityScheme (type alias)

Signature

export type OpenAPIApiKeySecurityScheme = {
  type: "apiKey"
  description?: string
  name: string
  in: "query" | "header" | "cookie"
}

Added in v1.0.0

OpenAPIComponents (type alias)

Signature

export type OpenAPIComponents<S = AnySchema> = {
  schemas?: Record<string, S>
  securitySchemes?: Record<string, OpenAPISecurityScheme>
}

Added in v1.0.0

OpenAPIHTTPSecurityScheme (type alias)

Signature

export type OpenAPIHTTPSecurityScheme = {
  type: "http"
  description?: string
  scheme: "bearer" | "basic" | string
  /* only for scheme: 'bearer' */
  bearerFormat?: string
}

Added in v1.0.0

OpenAPIMutualTLSSecurityScheme (type alias)

Signature

export type OpenAPIMutualTLSSecurityScheme = {
  type: "mutualTLS"
  description?: string
}

Added in v1.0.0

OpenAPIOAuth2SecurityScheme (type alias)

Signature

export type OpenAPIOAuth2SecurityScheme = {
  type: "oauth2"
  description?: string
  flows: Record<"implicit" | "password" | "clientCredentials" | "authorizationCode", Record<string, unknown>>
}

Added in v1.0.0

OpenAPIOpenIdConnectSecurityScheme (type alias)

Signature

export type OpenAPIOpenIdConnectSecurityScheme = {
  type: "openIdConnect"
  description?: string
  openIdConnectUrl: string
}

Added in v1.0.0

OpenAPISchemaAllOfType (type alias)

Signature

export type OpenAPISchemaAllOfType = {
  allOf: Array<OpenAPISchemaType>
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaAnyType (type alias)

Signature

export type OpenAPISchemaAnyType = {}

Added in v1.0.0

OpenAPISchemaArrayType (type alias)

Signature

export type OpenAPISchemaArrayType = {
  type: "array"
  items?: OpenAPISchemaType | Array<OpenAPISchemaType>
  minItems?: number
  maxItems?: number
  additionalItems?: OpenAPISchemaType
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaBooleanType (type alias)

Signature

export type OpenAPISchemaBooleanType = {
  type: "boolean"
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaEnumType (type alias)

Signature

export type OpenAPISchemaEnumType = {
  type: "string" | "number" | "boolean"
  enum: Array<string | number | boolean | null>
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaNullType (type alias)

Signature

export type OpenAPISchemaNullType = {
  type: "null"
}

Added in v1.0.0

OpenAPISchemaNumberType (type alias)

Signature

export type OpenAPISchemaNumberType = {
  type: "number" | "integer"
  minimum?: number
  exclusiveMinimum?: boolean
  maximum?: number
  exclusiveMaximum?: boolean
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaObjectType (type alias)

Signature

export type OpenAPISchemaObjectType = {
  type: "object"
  required?: Array<string>
  properties?: { [x: string]: OpenAPISchemaType }
  additionalProperties?: boolean | OpenAPISchemaType
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaOneOfType (type alias)

Signature

export type OpenAPISchemaOneOfType = {
  oneOf: ReadonlyArray<OpenAPISchemaType>
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaStringType (type alias)

Signature

export type OpenAPISchemaStringType = {
  type: "string"
  minLength?: number
  maxLength?: number
  nullable?: boolean
}

Added in v1.0.0

OpenAPISchemaType (type alias)

Signature

export type OpenAPISchemaType = {
  description?: string
} & (
  | OpenAPISchemaNullType
  | OpenAPISchemaStringType
  | OpenAPISchemaNumberType
  | OpenAPISchemaBooleanType
  | OpenAPISchemaArrayType
  | OpenAPISchemaEnumType
  | OpenAPISchemaOneOfType
  | OpenAPISchemaAllOfType
  | OpenAPISchemaObjectType
  | OpenAPISchemaAnyType
  | OpenAPISpecReference
)

Added in v1.0.0

OpenAPISecurityRequirement (type alias)

Signature

export type OpenAPISecurityRequirement = Record<string, Array<string>>

Added in v1.0.0

OpenAPISecurityScheme (type alias)

Signature

export type OpenAPISecurityScheme =
  | OpenAPIHTTPSecurityScheme
  | OpenAPIApiKeySecurityScheme
  | OpenAPIMutualTLSSecurityScheme
  | OpenAPIOAuth2SecurityScheme
  | OpenAPIOpenIdConnectSecurityScheme
  | OpenAPISpecReference

Added in v1.0.0

OpenAPISpec (type alias)

Signature

export type OpenAPISpec<S = AnySchema> = {
  openapi: "3.0.3"
  info: OpenAPISpecInfo
  servers?: Array<OpenAPISpecServer>
  paths: OpenAPISpecPaths<S>
  components?: OpenAPIComponents<S>
  security?: Array<OpenAPISecurityRequirement>
  tags?: Array<OpenAPISpecTag>
  externalDocs?: OpenAPISpecExternalDocs
}

Added in v1.0.0

OpenAPISpecExternalDocs (type alias)

Signature

export type OpenAPISpecExternalDocs = {
  url: string
  description?: string
}

Added in v1.0.0

OpenAPISpecInfo (type alias)

Signature

export type OpenAPISpecInfo = {
  title: string
  version: string
  description?: string
  license?: OpenAPISpecLicense
}

Added in v1.0.0

OpenAPISpecLicense (type alias)

Signature

export type OpenAPISpecLicense = {
  name: string
  url?: string
}

Added in v1.0.0

OpenAPISpecMethodName (type alias)

Signature

export type OpenAPISpecMethodName = "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace"

Added in v1.0.0

OpenAPISpecOperation (type alias)

Signature

export type OpenAPISpecOperation<S = AnySchema> = {
  requestBody?: OpenAPISpecRequestBody<S>
  responses?: OpenAPISpecResponses<S>
  operationId?: string
  description?: string
  parameters?: Array<OpenAPISpecParameter<S>>
  summary?: string
  deprecated?: boolean
  tags?: Array<string>
  security?: Array<OpenAPISecurityRequirement>
  externalDocs?: OpenAPISpecExternalDocs
}

Added in v1.0.0

OpenAPISpecParameter (type alias)

Signature

export type OpenAPISpecParameter<S = AnySchema> = {
  name: string
  in: "query" | "header" | "path" | "cookie"
  schema: S
  description?: string
  required?: boolean
  deprecated?: boolean
  allowEmptyValue?: boolean
}

Added in v1.0.0

OpenAPISpecPathItem (type alias)

Signature

export type OpenAPISpecPathItem<S = AnySchema> = {
  [K in OpenAPISpecMethodName]?: OpenAPISpecOperation<S>
} & {
  summary?: string
  description?: string
  parameters?: Array<OpenAPISpecParameter>
}

Added in v1.0.0

OpenAPISpecPaths (type alias)

Signature

export type OpenAPISpecPaths<S = AnySchema> = Record<string, OpenAPISpecPathItem<S>>

Added in v1.0.0

OpenAPISpecReference (type alias)

Signature

export type OpenAPISpecReference = {
  $ref: string
}

Added in v1.0.0

OpenAPISpecRequestBody (type alias)

Signature

export type OpenAPISpecRequestBody<S = AnySchema> = {
  content: OpenApiSpecContent<S>
  description?: string
  required?: boolean
}

Added in v1.0.0

OpenAPISpecResponses (type alias)

Signature

export type OpenAPISpecResponses<S = AnySchema> = {
  [K in OpenAPISpecStatusCode]?: OpenApiSpecResponse<S>
}

Added in v1.0.0

OpenAPISpecServer (type alias)

Signature

export type OpenAPISpecServer = {
  url: string
  description?: string
  variables?: Record<string, OpenAPISpecServerVariable>
}

Added in v1.0.0

OpenAPISpecServerVariable (type alias)

Signature

export type OpenAPISpecServerVariable = {
  default: string
  enum?: [string, ...Array<string>]
  description?: string
}

Added in v1.0.0

OpenAPISpecStatusCode (type alias)

Signature

export type OpenAPISpecStatusCode = 200 | 201 | 204

Added in v1.0.0

OpenAPISpecTag (type alias)

Signature

export type OpenAPISpecTag = {
  name: string
  description?: string
  externalDocs?: OpenAPISpecExternalDocs
}

Added in v1.0.0

OpenApiSpecContent (type alias)

Signature

export type OpenApiSpecContent<S = AnySchema> = {
  [K in OpenApiSpecContentType]?: OpenApiSpecMediaType<S>
}

Added in v1.0.0

OpenApiSpecContentType (type alias)

Signature

export type OpenApiSpecContentType = "application/json" | "application/xml"

Added in v1.0.0

OpenApiSpecMediaType (type alias)

Signature

export type OpenApiSpecMediaType<S = AnySchema> = {
  schema?: S
  example?: object
  description?: string
}

Added in v1.0.0

OpenApiSpecResponse (type alias)

Signature

export type OpenApiSpecResponse<S = AnySchema> = {
  content?: OpenApiSpecContent<S>
  headers?: OpenApiSpecResponseHeaders<S>
  description: string
}

Added in v1.0.0

OpenApiSpecResponseHeader (type alias)

Signature

export type OpenApiSpecResponseHeader<S = AnySchema> = {
  description?: string
  schema: S
}

Added in v1.0.0

OpenApiSpecResponseHeaders (type alias)

Signature

export type OpenApiSpecResponseHeaders<S = AnySchema> = Record<string, OpenApiSpecResponseHeader<S>>

Added in v1.0.0