Skip to content
Effect Days 2026 Get your ticket

ParsedOperation

Normalized OpenAPI operation model shared by the generator pipeline.

This module records the shape produced after an OpenAPI document is resolved into stable generator inputs: document metadata, tags, security schemes, per-operation parameters, request bodies, response media types, derived schema references, path templates, and streaming capabilities. Renderers consume this representation to emit HttpClient or HttpApi modules without reinterpreting raw OpenAPI path-item structures.

14 exports Added in v4.0.0 Source

Constructors

Creates a mutable operation accumulator populated with parser defaults.

Signature

declare function makeDeepMutable(options: {
readonly description: string | undefined;
readonly id: string;
readonly method: OpenAPISpecMethodName;
readonly pathIds: Array<string>;
readonly pathTemplate: string;
}): {
readonly cookies: Array<string>;
readonly defaultResponse: {
readonly contentTypes: Array<string>;
readonly description: string | undefined;
readonly hasHeaders: boolean;
readonly isEmpty: boolean;
readonly representable: Array<{
readonly contentType: string;
readonly effectStream?: undefined;
readonly encoding: ParsedOperationMediaTypeEncoding;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "sse";
readonly encoding: "text";
readonly errorSchema: string;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "uint8array";
readonly encoding: "binary";
readonly schema?: undefined;
}>;
readonly status: string;
} | undefined;
readonly description: string | undefined;
readonly effectiveSecurity: Array<{
[key: string]: Array<string>;
}>;
readonly headers: Array<string>;
readonly headersSchema: string | undefined;
readonly headersSchemaOptional: boolean;
readonly httpClientResponses: {
readonly binarySuccessStatuses: Set<string>;
readonly errorSchemas: Map<string, string>;
readonly sseSchema?: string;
readonly sseSchemaMode: "data" | "event";
readonly successSchemas: Map<string, string>;
readonly voidErrorStatuses: Set<string>;
readonly voidSuccessStatuses: Set<string>;
};
readonly id: string;
readonly metadata: {
readonly deprecated: boolean;
readonly description: string | undefined;
readonly externalDocs: {
description?: string;
url: string;
} | undefined;
readonly summary: string | undefined;
};
readonly method: OpenAPISpecMethodName;
readonly operationId: string | undefined;
readonly parameters: {
readonly cookie: Array<{
readonly description: string | undefined;
readonly in: "path" | "header" | "query" | "cookie";
readonly name: string;
readonly required: boolean;
readonly schema: {};
}>;
readonly header: Array<{
readonly description: string | undefined;
readonly in: "path" | "header" | "query" | "cookie";
readonly name: string;
readonly required: boolean;
readonly schema: {};
}>;
readonly path: Array<{
readonly description: string | undefined;
readonly in: "path" | "header" | "query" | "cookie";
readonly name: string;
readonly required: boolean;
readonly schema: {};
}>;
readonly query: Array<{
readonly description: string | undefined;
readonly in: "path" | "header" | "query" | "cookie";
readonly name: string;
readonly required: boolean;
readonly schema: {};
}>;
};
readonly params?: string;
readonly paramsOptional: boolean;
readonly path: string;
readonly pathIds: Array<string>;
readonly pathSchema: string | undefined;
readonly pathTemplate: string;
readonly payload?: string;
readonly payloadFormData: boolean;
readonly payloadFormUrlEncoded: boolean;
readonly querySchema: string | undefined;
readonly querySchemaOptional: boolean;
readonly requestBody: {
readonly contentTypes: Array<string>;
readonly required: boolean;
} | undefined;
readonly requestBodyRepresentable: Array<{
readonly contentType: string;
readonly effectStream?: undefined;
readonly encoding: ParsedOperationMediaTypeEncoding;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "sse";
readonly encoding: "text";
readonly errorSchema: string;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "uint8array";
readonly encoding: "binary";
readonly schema?: undefined;
}>;
readonly responses: Array<{
readonly contentTypes: Array<string>;
readonly description: string | undefined;
readonly hasHeaders: boolean;
readonly isEmpty: boolean;
readonly representable: Array<{
readonly contentType: string;
readonly effectStream?: undefined;
readonly encoding: ParsedOperationMediaTypeEncoding;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "sse";
readonly encoding: "text";
readonly errorSchema: string;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "uint8array";
readonly encoding: "binary";
readonly schema?: undefined;
}>;
readonly status: string;
}>;
readonly tags: Array<string>;
readonly urlParams: Array<string>;
}

Models

ParsedOpenApi interface

Added in v4.0.0 Source

Normalized OpenAPI document consumed by the generator renderers.

Signature

interface ParsedOpenApi {
readonly metadata: ParsedOpenApiMetadata;
readonly operations: readonly Array<ParsedOperation>;
readonly securitySchemes: readonly Array<ParsedOpenApiSecurityScheme>;
readonly tags: readonly Array<ParsedOpenApiTag>;
}

ParsedOpenApiMetadata interface

Added in v4.0.0 Source

Root OpenAPI metadata preserved for generated client and HttpApi output.

Signature

interface ParsedOpenApiMetadata {
readonly description: string | undefined;
readonly license: OpenAPISpecLicense | undefined;
readonly servers: readonly Array<OpenAPISpecServer> | undefined;
readonly summary: string | undefined;
readonly title: string;
readonly version: string;
}

ParsedOpenApiSecurityScheme interface

Added in v4.0.0 Source

Supported security scheme extracted from an OpenAPI components section.

Signature

interface ParsedOpenApiSecurityScheme {
readonly bearerFormat: string | undefined;
readonly description: string | undefined;
readonly in: "header" | "query" | "cookie" | undefined;
readonly key: string | undefined;
readonly name: string;
readonly scheme: string | undefined;
readonly type: "basic" | "bearer" | "apiKey" | "http";
}

ParsedOpenApiTag interface

Added in v4.0.0 Source

Tag metadata used to group and annotate generated operations.

Signature

interface ParsedOpenApiTag {
readonly description: string | undefined;
readonly externalDocs: OpenAPISpecExternalDocs | undefined;
readonly name: string;
}

ParsedOperation interface

Added in v4.0.0 Source

Normalized operation model shared by all OpenAPI generator backends.

Signature

interface ParsedOperation {
readonly cookies: readonly Array<string>;
readonly defaultResponse: ParsedOperationResponse | undefined;
readonly description: string | undefined;
readonly effectiveSecurity: readonly Array<Readonly<OpenAPISecurityRequirement>>;
readonly headers: readonly Array<string>;
readonly headersSchema: string | undefined;
readonly headersSchemaOptional: boolean;
readonly httpClientResponses: ParsedOperationHttpClientResponses;
readonly id: string;
readonly metadata: ParsedOperationMetadata;
readonly method: OpenAPISpecMethodName;
readonly operationId: string | undefined;
readonly parameters: {
readonly cookie: readonly Array<ParsedOperationParameter>;
readonly header: readonly Array<ParsedOperationParameter>;
readonly path: readonly Array<ParsedOperationParameter>;
readonly query: readonly Array<ParsedOperationParameter>;
};
readonly params?: string;
readonly paramsOptional: boolean;
readonly path: string;
readonly pathIds: readonly Array<string>;
readonly pathSchema: string | undefined;
readonly pathTemplate: string;
readonly payload?: string;
readonly payloadFormData: boolean;
readonly payloadFormUrlEncoded: boolean;
readonly querySchema: string | undefined;
readonly querySchemaOptional: boolean;
readonly requestBody: ParsedOperationRequestBody | undefined;
readonly requestBodyRepresentable: readonly Array<ParsedOperationMediaTypeSchema>;
readonly responses: readonly Array<ParsedOperationResponse>;
readonly tags: readonly Array<string>;
readonly urlParams: readonly Array<string>;
}

Response state used only by the generated HttpClient renderers.

Signature

interface ParsedOperationHttpClientResponses {
readonly binarySuccessStatuses: ReadonlySet<string>;
readonly errorSchemas: ReadonlyMap<string, string>;
readonly sseSchema?: string;
readonly sseSchemaMode: "data" | "event";
readonly successSchemas: ReadonlyMap<string, string>;
readonly voidErrorStatuses: ReadonlySet<string>;
readonly voidSuccessStatuses: ReadonlySet<string>;
}

Encoding strategy the generator can use for a request or response media type.

Signature

type ParsedOperationMediaTypeEncoding = "json" | "multipart" | "form-url-encoded" | "text" | "binary"

Media type whose schema can be represented in generated Effect code.

Signature

type ParsedOperationMediaTypeSchema = {
readonly contentType: string;
readonly effectStream?: undefined;
readonly encoding: ParsedOperationMediaTypeEncoding;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "sse";
readonly encoding: "text";
readonly errorSchema: string;
readonly schema: string;
} | {
readonly contentType: string;
readonly effectStream: "uint8array";
readonly encoding: "binary";
readonly schema?: undefined;
}

ParsedOperationMetadata interface

Added in v4.0.0 Source

Documentation and lifecycle metadata associated with an operation.

Signature

interface ParsedOperationMetadata {
readonly deprecated: boolean;
readonly description: string | undefined;
readonly externalDocs: OpenAPISpecExternalDocs | undefined;
readonly summary: string | undefined;
}

ParsedOperationParameter interface

Added in v4.0.0 Source

Resolved OpenAPI parameter grouped by where it appears in the request.

Signature

interface ParsedOperationParameter {
readonly description: string | undefined;
readonly in: "path" | "header" | "query" | "cookie";
readonly name: string;
readonly required: boolean;
readonly schema: {};
}

ParsedOperationRequestBody interface

Added in v4.0.0 Source

Summary of the request body declaration before per-media schemas are rendered.

Signature

interface ParsedOperationRequestBody {
readonly contentTypes: Array<string>;
readonly required: boolean;
}

ParsedOperationResponse interface

Added in v4.0.0 Source

Parsed response metadata together with generated schema references.

Signature

interface ParsedOperationResponse {
readonly contentTypes: Array<string>;
readonly description: string | undefined;
readonly hasHeaders: boolean;
readonly isEmpty: boolean;
readonly representable: readonly Array<ParsedOperationMediaTypeSchema>;
readonly status: string;
}

Resolved security requirement applied to a parsed operation.

Signature

type ParsedOperationSecurityRequirement = Readonly<OpenAPISecurityRequirement>