import type { ParseContextType } from '../../../context/parseTypes.js'; import type { OpenAPIV3 } from 'openapi-types'; import { OasExample } from '../../../oas/example/Example.js'; import type { OasRef } from '../../../oas/ref/Ref.js'; import type { StackTrail } from '../../../context/StackTrail.js'; /** A 3.2 Example Object: the 3.0 shape plus `dataValue` and `serializedValue`. */ export type ExampleObjectV32 = OpenAPIV3.ExampleObject & { dataValue?: unknown; serializedValue?: string; }; export type ToExampleSimpleV3Args = { /** * The example value itself. The singular `example` field of a media type, * parameter or header is a LITERAL value — not an Example Object — so it * carries no `summary`, `description` or `externalValue` to read. */ example: unknown; /** The stack trail for tracing */ stackTrail: StackTrail; /** Parse context for tracing and error handling */ context: ParseContextType; }; /** * Creates a simple OAS example from a value. * * Wraps a literal example value as an {@link OasExample}. Used for the singular * `example` field, where only the value exists. * * @param args - Arguments containing the example value * @returns OasExample object with the provided value */ export declare const toExampleSimpleV3: ({ example }: ToExampleSimpleV3Args) => OasExample | OasRef<"example">; /** * Arguments for processing OpenAPI v3 examples into OAS example objects. * * Handles both single example and examples collection scenarios, * with context for tracing and error handling. */ export type ToExamplesV3Args = { /** The singular `example` field — a literal value, not an Example Object */ example: unknown; /** Collection of named examples (OpenAPI v3 format) */ examples: Record | undefined; /** Key name for the example context */ exampleKey: string; /** The stack trail for tracing */ stackTrail: StackTrail; /** Parse context for tracing and error handling */ context: ParseContextType; }; /** * Processes OpenAPI v3 examples into OAS example objects. * * Handles both single example and examples collection scenarios, * converting them to the internal OAS representation. Provides * warnings when both formats are specified simultaneously. * * @param args - Arguments containing example data and context * @returns Record of processed examples, or undefined if no examples */ export declare const toExamplesV3: ({ example, examples, exampleKey, stackTrail, context }: ToExamplesV3Args) => Record> | undefined; export type ToExampleV3Args = { example: ExampleObjectV32 | OpenAPIV3.ReferenceObject; stackTrail: StackTrail; context: ParseContextType; }; /** * Processes a single OpenAPI v3 example into an OAS example object. * * Converts OpenAPI v3 example objects or references into the internal * OAS representation, handling both direct examples and $ref references. * Processes specification extensions and maintains all example metadata. * * @param args - Arguments containing the example and parsing context * @returns OasExample object or reference to an example */ export declare const toExampleV3: ({ example, stackTrail, context }: ToExampleV3Args) => OasExample | OasRef<"example">;