OpenApiGenerator
The OpenApiGenerator module orchestrates converting OpenAPI and Swagger documents into generated Effect source.
It normalizes Swagger 2.0 input, resolves local references, builds the parsed operation model, registers request and response schemas, applies HttpApi-specific adaptations such as multipart helpers and security metadata, emits warnings for unsupported or lossy OpenAPI features, and then delegates final rendering to the HttpClient or HttpApi code generators.
Constructors
Layers
layerTransformerSchema
Layer providing an OpenAPI generator for Schema-backed HTTP client and HttpApi output.
Signature
declare const layerTransformerSchema: Layer.Layer<OpenApiGenerator>;layerTransformerTs
Layer providing an OpenAPI generator for type-only HTTP client output.
Signature
declare const layerTransformerTs: Layer.Layer<OpenApiGenerator>;Models
OpenApiGeneratorFormat type
Output targets supported by the OpenAPI generator.
Signature
type OpenApiGeneratorFormat = "httpclient" | "httpclient-type-only" | "httpapi";OpenApiGeneratorWarning interface
Describes a non-fatal issue encountered while mapping an OpenAPI operation to generated Effect source.
Signature
interface OpenApiGeneratorWarning { readonly code: OpenApiGeneratorWarningCode; readonly message: string; readonly method?: OpenAPISpecMethodName; readonly operationId?: string; readonly path?: string;}OpenApiGeneratorWarningCode type
Stable identifiers for non-fatal OpenAPI generation warnings.
Signature
type OpenApiGeneratorWarningCode = | "cookie-parameter-dropped" | "additional-tags-dropped" | "sse-operation-skipped" | "response-headers-ignored" | "optional-request-body-approximated" | "default-response-remapped" | "security-and-downgraded" | "no-body-method-request-body-skipped" | "naming-collision";Options
OpenApiGenerateOptions interface
Options that control one OpenAPI generation run.
Signature
interface OpenApiGenerateOptions { readonly format: OpenApiGeneratorFormat; readonly name: string; readonly onEnter?: (js: JsonSchema) => JsonSchema; readonly onWarning?: (warning: OpenApiGeneratorWarning) => void;}Services
OpenApiGenerator
Service for turning OpenAPI or Swagger specifications into generated Effect HTTP client or HttpApi source code.
Signature
declare class OpenApiGenerator extends Shape< "OpenApiGenerator", { readonly generate: (spec: OpenAPISpec, options: OpenApiGenerateOptions) => Effect<string>; }, this> { constructor(_: never);}
Constructs the OpenAPI generator service implementation.