{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ibm-api-connect/json-schema/ibm-api-connect-global-policy-schema.json",
  "title": "GlobalPolicy",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ibm-api-connect-catalog-resources-api-openapi.yml#/components/schemas/GlobalPolicy",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "type": {
      "type": "string",
      "readOnly": true,
      "enum": [
        "global_policy"
      ]
    },
    "api_version": {
      "type": "string",
      "readOnly": true,
      "enum": [
        "2.0.0"
      ]
    },
    "id": {
      "type": "string",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "version": {
      "type": "string",
      "maxLength": 255
    },
    "title": {
      "type": "string",
      "maxLength": 1023
    },
    "summary": {
      "type": "string",
      "maxLength": 65535
    },
    "scope": {
      "type": "string"
    },
    "global_policy": {
      "$ref": "#/$defs/GlobalPolicyDocument"
    },
    "global_policy_kind": {
      "$ref": "#/$defs/ProjectGlobalPolicy"
    },
    "user_registry_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "tls_client_profile_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "policy_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "global_policy_prehook_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "global_policy_posthook_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "global_policy_error_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "org_url": {
      "type": "string",
      "format": "uri"
    },
    "catalog_url": {
      "type": "string",
      "format": "uri"
    },
    "space_url": {
      "type": "string",
      "format": "uri"
    },
    "gateway_service_url": {
      "type": "string",
      "format": "uri"
    },
    "state": {
      "type": "string",
      "enum": [
        "staged",
        "published"
      ]
    },
    "service_status": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "service_url": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time"
          },
          "processed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "url": {
      "type": "string",
      "readOnly": true,
      "format": "uri"
    }
  },
  "$defs": {
    "GlobalPolicyDocument": {
      "type": "object",
      "additionalProperties": true
    },
    "ProjectGlobalPolicy": {
      "type": "object",
      "required": [
        "kind",
        "apiVersion",
        "metadata",
        "spec"
      ],
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "GlobalPolicy"
          ],
          "type": "string"
        },
        "apiVersion": {
          "type": "string"
        },
        "metadata": {
          "$ref": "#/$defs/ProjectMetadata"
        },
        "spec": {
          "type": "object",
          "required": [
            "policy-sequence"
          ],
          "additionalProperties": false,
          "properties": {
            "filter-api-type": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string"
              }
            },
            "filter-http-methods": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "enum": [
                  "GET",
                  "POST",
                  "PUT",
                  "DELETE",
                  "PATCH",
                  "HEAD"
                ]
              }
            },
            "filter-attributes": {
              "type": "string"
            },
            "policy-sequence": {
              "$ref": "#/$defs/ProjectReferenceList"
            }
          }
        }
      }
    },
    "ProjectMetadata": {
      "description": "Defines a message named Metadata",
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "namespace": {
          "type": "string"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "type": {
          "enum": [
            "REST",
            "SWAGGER",
            "SOAP",
            "GRAPHQL",
            "ODATA"
          ],
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "domain": {
          "enum": [
            "api",
            "ai-platform",
            "mcp"
          ],
          "type": "string"
        },
        "labels": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "gatewayTypes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "ProjectReference": {
      "type": "object",
      "required": [
        "$ref"
      ],
      "additionalProperties": false,
      "properties": {
        "$ref": {
          "description": "Field 'ref' with JSON name '$ref' accepts the value of either 'ref' or '$ref' from the YAML file. If both 'ref' and '$ref' are specified, the value of '$ref' takes priority.",
          "type": "string"
        }
      }
    },
    "ProjectReferenceList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProjectReference"
      }
    }
  }
}