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

    Function inferJsonSchemaDraft

    • Infer the JSON Schema draft from keyword presence when $schema is absent. Examined from highest-confidence to lowest.

      Heuristics:

      1. $dynamicRef / $dynamicAnchor / prefixItems → Draft 2020-12
      2. $recursiveRef / $recursiveAnchor / unevaluatedProperties / dependentSchemas → Draft 2019-09
      3. if / then / else, contentEncoding / contentMediaType → Draft 07
      4. const, examples (array), propertyNames → Draft 06
      5. Boolean exclusiveMinimum, id (no $), definitions only → Draft 04
      6. No signal → Draft 2020-12

      Parameters

      • schema: Record<string, unknown>

      Returns JsonSchemaDraft