fluid-oas
    Preparing search index...

    Interface OpenApiV3

    Root OpenAPI Object. Allows for method chaining to build a single API Specification.

    interface OpenApiV3 {
        addComponents(components: OpenApiComponent): this;
        addExtensions(mappings: { [key: `x-${string}`]: OpenApiSchema }): this;
        addExternalDocs(docs: OpenApiDocumentation): this;
        addInfo(info: OpenApiInfo): this;
        addOpenApiVersion(version: string): this;
        addPaths(path: OpenApiPath): this;
        addSecurity(security: OpenApiSecurityRequirement[]): this;
        addServers(servers: OpenApiServer[]): this;
        addTags(tags: OpenApiTag[]): this;
        override(overrideVal: unknown): this;
        toJSON(): unknown;
        writeOASASync(filePath?: string): void;
        writeOASSync(filePath?: string): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Extend the specification with an extension object schema.

      Parameters

      • mappings: { [key: `x-${string}`]: OpenApiSchema }

        key value mappings with names MUST beginning with "x-"

      Returns this

    • Adds the current version of the OpenAPI Specification.

      Parameters

      • version: string

        The OpenAPI specification version (e.g., "3.1.0")

      Returns this

    • Adds an array of server objects which provide connectivity information to target servers.

      Parameters

      • servers: OpenApiServer[]

        Array of server objects containing URL and optional description/variables

      Returns this

    • Overrides the toJSON method for a custom serialization.

      WARNING: overrideVal must be serializable and future changes are subject to breaking.

      Parameters

      • overrideVal: unknown

        Overrides the serialization of this object into this value.

      Returns this

    • Serializes the object into its equivalent OpenApi JSON value.

      Returns unknown

    • Writes the OpenAPI specification asynchronously to a file or outputs it.

      Parameters

      • OptionalfilePath: string

        Optional file path where the specification should be written

      Returns void

    • Writes the OpenAPI specification synchronously to a file or outputs it.

      Parameters

      • OptionalfilePath: string

        Optional file path where the specification should be written

      Returns void