//#region src/core/openapiConstants.d.ts /** * Shared OpenAPI / Swagger constants and helpers. * * Single source of truth for HTTP method tuples, default content types, and * the Swagger 2.0 → OpenAPI 3.x reference-prefix rewriting table. Consumers * import the named exports rather than hand-maintaining sibling copies that * silently drift when methods or prefixes change. */ /** * Canonical OpenAPI 3.x HTTP method tuple in path-item iteration order. * Spec: https://spec.openapis.org/oas/v3.1.1#path-item-object */ declare const HTTP_METHODS: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"]; /** Canonical OpenAPI 3.x HTTP method literal, derived from {@link HTTP_METHODS}. */ type HttpMethod = (typeof HTTP_METHODS)[number]; /** * Swagger 2.0 omits `trace` — the keyword was introduced in OpenAPI 3.0. * Derived from `HTTP_METHODS` so adding a method to the canonical tuple * automatically propagates here (after which the filter may need updating). */ declare const SWAGGER_2_METHODS: readonly Exclude[]; /** * Default media type used when an OpenAPI document elides `consumes` / * `produces` or a Schema Object stands alone (no parent Media Type). */ declare const DEFAULT_OPENAPI_CONTENT_TYPE = "application/json"; /** * Canonical `$ref` prefix table for the JSON Pointer locations used by * OpenAPI 3.x and Swagger 2.0 documents. */ declare const REF_PREFIXES: { /** OpenAPI 3.x — most schemas live under `components.schemas`. */readonly components: { readonly schemas: "#/components/schemas/"; readonly parameters: "#/components/parameters/"; readonly responses: "#/components/responses/"; readonly requestBodies: "#/components/requestBodies/"; readonly headers: "#/components/headers/"; readonly examples: "#/components/examples/"; readonly links: "#/components/links/"; readonly callbacks: "#/components/callbacks/"; readonly securitySchemes: "#/components/securitySchemes/"; readonly pathItems: "#/components/pathItems/"; }; /** Swagger 2.0 legacy prefixes. */ readonly swagger2: { readonly definitions: "#/definitions/"; readonly parameters: "#/parameters/"; readonly responses: "#/responses/"; }; }; /** * Swagger 2.0 → OpenAPI 3.x `$ref` prefix mapping. Applied during the * 2.0 → 3.x lift to rewrite legacy pointer prefixes onto their components * counterparts. Order matters: longer prefixes first prevents `#/parameters/` * from shadowing `#/components/parameters/` during a partial migration. */ declare const REF_REWRITES: readonly { readonly from: string; readonly to: string; }[]; /** * Rewrite a Swagger 2.0 ref prefix onto the equivalent OpenAPI 3.x location. * Returns the ref unchanged when no prefix matches. Pure string operation — * does not validate that the target exists. */ declare function rewriteSwaggerRefPrefix(ref: string): string; //#endregion export { DEFAULT_OPENAPI_CONTENT_TYPE, HTTP_METHODS, HttpMethod, REF_PREFIXES, REF_REWRITES, SWAGGER_2_METHODS, rewriteSwaggerRefPrefix };