schema-components - v3.7.0
    Preparing search index...

    Function liftExampleToExamples

    • Lift OpenAPI 3.x singular example onto the plural examples key.

      Two output shapes are spec-correct depending on the parent object type:

      • "array" — Schema Object: examples: [example] (Draft 2020-12 plural).
      • "map" — Parameter / Header / Media Type Object: an Examples Map keyed by name. The single value is wrapped under the synthetic key default to produce a valid one-entry map of one Example Object.

      When both example and examples coexist the spec declares them mutually exclusive — example is dropped and examples wins.

      Parameters

      • node: Record<string, unknown>
      • shape: "array" | "map"

      Returns void