import { Api } from "../../models"; import { OpenAPI2SchemaType } from "./openapi2-schema"; import { HttpContentType } from "@zenclabs/api"; export declare function generateOpenApiV2(api: Api, format: "json" | "yaml"): string; export declare function openApiV2(api: Api): OpenApiV2; export interface OpenApiV2 { swagger: "2.0"; tags?: OpenAPIV2TagObject[]; info: { version: string; title: string; description?: string; termsOfService?: string; contact?: { name?: string; url?: string; email?: string; }; license?: { name: string; url?: string; }; }; host?: string; paths: { [endpointPath: string]: { [method: string]: OpenAPIV2Operation; }; }; definitions: { [typeName: string]: OpenAPI2SchemaType; }; } export interface OpenAPIV2TagObject { name: string; description?: string; } export interface OpenAPIV2Operation { operationId: string; description?: string; consumes?: HttpContentType[]; tags?: string[]; parameters: OpenAPIV2Parameter[]; requestBody?: OpenAPI2SchemaType; responses: { default?: OpenAPIV2Response; [statusCode: string]: OpenAPIV2Response | undefined; }; } export declare type OpenAPIV2Parameter = OpenAPIV2BodyParameter | OpenAPIV2NonBodyParameter; export declare type OpenAPIV2NonBodyParameter = { in: "path" | "query"; name: string; description?: string; required: boolean; } & OpenAPI2SchemaType; export declare type OpenAPIV2BodyParameter = { in: "body"; name: "body"; description?: string; required: true; schema: OpenAPI2SchemaType | undefined; }; export interface OpenAPIV2Response { schema?: OpenAPI2SchemaType; description: string; }