JSON Schema collection formatted for OpenAPI v3.0 specification.

This interface represents a collection of JSON schemas that comply with OpenAPI v3.0 standards, which are compatible with Swagger tools and legacy OpenAPI implementations. OpenAPI v3.0 has some limitations compared to v3.1, particularly around tuple types and pattern properties.

Key characteristics of v3.0:

  • Cannot express tuple types natively (falls back to array representations)
  • Cannot express pattern properties in object schemas
  • Uses nullable property instead of union with null type
  • Limited JSON Schema Draft compatibility (based on Draft 4)
interface IV3_0<Types = unknown[]> {
    __types?: Types;
    components: IComponents;
    schemas: IJsonSchema[];
    version: "3.0";
}

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's primarily used for type safety and doesn't affect runtime behavior. The property is marked as optional and undefined to prevent it from appearing in serialized JSON output.

This enables:

  • Compile-time type checking against the original types
  • IDE intellisense and autocompletion
  • Type-safe schema validation and usage
components: IComponents

Reusable schema components for OpenAPI v3.0.

Contains reusable schema definitions, security schemes, and other components that can be referenced from the main schemas. This follows the OpenAPI v3.0 components structure and enables schema reuse and modularity.

Components include:

  • schemas: Named type definitions that can be referenced via $ref
  • securitySchemes: Authentication and authorization schemes
  • parameters: Reusable parameter definitions
  • requestBodies: Reusable request body definitions
  • responses: Reusable response definitions
  • headers: Reusable header definitions
  • examples: Reusable example definitions
schemas: IJsonSchema[]

Array of generated JSON schemas.

Contains the actual JSON schema definitions generated from the input TypeScript types. Each schema in this array corresponds to one of the types specified in the Types template parameter. The schemas follow OpenAPI v3.0 format and may contain references to components defined in the components property.

Schema references typically use the format: { "$ref": "#/components/schemas/TypeName" }

version: "3.0"

OpenAPI specification version identifier.

Always set to "3.0" to indicate this collection uses OpenAPI v3.0 schema format and constraints.