JSON Schema collection formatted for OpenAPI v3.1 specification.

This interface represents a collection of JSON schemas that comply with OpenAPI v3.1 standards, which provide enhanced JSON Schema compatibility and support for modern JSON Schema features. OpenAPI v3.1 is based on JSON Schema Draft 2020-12 and offers significant improvements over v3.0.

Key advantages of v3.1:

  • Full tuple type support with prefixItems
  • Pattern properties support for dynamic object keys
  • Proper null type handling via union types
  • Enhanced JSON Schema Draft 2020-12 compatibility
  • Better const, enum, and validation support
interface IV3_1<Types = unknown[]> {
    __types?: Types;
    components: IComponents;
    schemas: IJsonSchema[];
    version: "3.1";
}

Type Parameters

  • Types = unknown[]

    Array of original TypeScript types used to generate the schemas. This provides compile-time type information about what types were analyzed during schema generation.

Properties

__types?: Types

Type metadata for compile-time type tracking.

This optional property stores the original TypeScript types that were used to generate the JSON schemas. It provides compile-time type safety and enables better development experience without affecting runtime behavior.

Benefits include:

  • Strong typing connection to original TypeScript definitions
  • Enhanced IDE support and autocompletion
  • Compile-time validation of schema usage
  • Type-safe integration with validation libraries
components: IComponents

Reusable schema components for OpenAPI v3.1.

Contains reusable schema definitions and other components following the OpenAPI v3.1 specification. This structure is similar to v3.0 but supports enhanced JSON Schema features and improved type definitions.

Components include:

  • schemas: Named type definitions with enhanced JSON Schema support
  • securitySchemes: Authentication and authorization schemes

The emended OpenAPI v3.1 format used here removes ambiguous expressions and standardizes certain patterns for better tooling compatibility.

schemas: IJsonSchema[]

Array of generated JSON schemas with v3.1 enhancements.

Contains JSON schema definitions that take advantage of OpenAPI v3.1's enhanced capabilities. These schemas can express more complex TypeScript types accurately, including:

  • Tuple types using prefixItems
  • Union types with proper null handling
  • Complex nested object structures
  • Pattern-based property definitions

Each schema corresponds to one of the input TypeScript types and may reference components defined in the components property.

version: "3.1"

OpenAPI specification version identifier.

Always set to "3.1" to indicate this collection uses OpenAPI v3.1 schema format with enhanced JSON Schema compatibility.