Adds reusable components to this OpenApi Specification.
Component object.
Extend the specification with an extension object schema.
key value mappings with names MUST beginning with "x-"
Adds external documentation reference.
External documentation object with URL and optional description
Adds metadata about the API.
Object containing API metadata including title, version, description, etc.
Adds the JSON Schema dialect used for the API specification.
URI of the JSON Schema dialect (e.g., "https://json-schema.org/draft/2020-12/schema")
Adds the current version of the OpenAPI Specification.
The OpenAPI specification version (e.g., "3.1.0")
Adds the available paths and operations for the API.
Object containing path definitions with their operations (GET, POST, etc.)
Adds security requirements that apply to the entire API.
Array of security requirement objects
Adds an array of server objects which provide connectivity information to target servers.
Array of server objects containing URL and optional description/variables
Adds metadata tags for grouping operations.
Array of tag objects containing name and optional description
Adds a webhook to this OpenAPI specification.
Overrides the toJSON method for a custom serialization.
WARNING: overrideVal must be serializable and future changes are subject to breaking.
Overrides the serialization of this object into this value.
Serializes the object into its equivalent OpenApi JSON value.
Writes the OpenAPI specification asynchronously to a file or outputs it.
Optional
filePath: stringOptional file path where the specification should be written
Writes the OpenAPI specification synchronously to a file or outputs it.
Optional
filePath: stringOptional file path where the specification should be written
Root OpenAPI Object. Allows for method chaining to build a single API Specification.