@suluk/openapi-compat - v0.1.3
    Preparing search index...

    Function downgrade

    @suluk/openapi-compat — convert between the OpenAPI v4 "Suluk" candidate and OpenAPI 3.1.

    downgrade(v4) → 3.1 is the lever for Scalar & Swagger UI (they consume 3.x). upgrade(3.1) → v4 is the reverse. The pair is lossless for documents that fit 3.1's expressivity; where v4 exceeds 3.1 (notably multiple requests per method on one path, C003), downgrade() reports it in diagnostics rather than losing it silently. Schema Objects are shared verbatim (both are JSON Schema 2020-12). CANDIDATE tooling.

    • Project a v4 "Suluk" document to OpenAPI 3.1. Returns the 3.1 document plus diagnostics for everything that could not be carried losslessly. Schema Objects are shared verbatim (identical dialect).

      Parameters

      • doc: OpenAPIv4Document

      Returns DowngradeResult