{
  "schema": 1,
  "sqlstate": "22039",
  "condition_name": "sql_json_array_not_found",
  "sources": [
    {
      "id": "src.errcodes.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L224",
      "lines": "224"
    },
    {
      "id": "src.jsonpath.array-accessors",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L836",
      "lines": "836-979"
    },
    {
      "id": "src.jsonpath.array-size",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L1101",
      "lines": "1101-1117"
    },
    {
      "id": "src.jsonpath.context-flags",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L235",
      "lines": "235-249"
    },
    {
      "id": "src.jsonpath.execute-context",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L654",
      "lines": "654-727"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "22039 is sql_json_array_not_found in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "resolved-path",
      "statement": "The fixed jpiAnyArray wildcard, jpiIndexArray indexed accessor, and .size() item-method branches can each auto-wrap a non-array item when jspAutoWrap(cxt) is enabled by lax mode. If auto-wrap is not permitted, jspIgnoreStructuralErrors can suppress the structural mismatch; when neither applies, the corresponding array-only branch reports 22039. Array index out-of-bounds is a separate 22033 guard.",
      "sources": [
        "src.jsonpath.array-accessors",
        "src.jsonpath.array-size",
        "src.jsonpath.context-flags",
        "src.jsonpath.execute-context"
      ],
      "method": "Read the complete array wildcard/index and size-method guards, including structural-error suppression and the adjacent subscript boundary.",
      "limits": "Source confirmation is not a natural runtime observation."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 22039 from 12.0 without proving exact implementation introduction.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.wildcard-array",
      "sqlstate": "22039",
      "primary_template": "jsonpath wildcard array accessor can only be applied to an array",
      "severity_source": "ERROR",
      "sources": [
        "src.jsonpath.array-accessors"
      ]
    },
    {
      "id": "message.index-array",
      "sqlstate": "22039",
      "primary_template": "jsonpath array accessor can only be applied to an array",
      "severity_source": "ERROR",
      "sources": [
        "src.jsonpath.array-accessors"
      ]
    },
    {
      "id": "message.size-array",
      "sqlstate": "22039",
      "primary_template": "jsonpath item method .%s() can only be applied to an array",
      "severity_source": "ERROR",
      "sources": [
        "src.jsonpath.array-size"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "resolved-path"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "resolved-path"
      ]
    }
  ],
  "runtime": []
}
