{
  "$id": "https://schema.nfh.global/CatalogSubscriptionResponse/v2.0",
  "x-iri": "https://schema.nfh.global/CatalogSubscriptionResponse/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "CatalogSubscriptionResponse",
  "description": "The response envelope returned synchronously by the CS (Cataloging Service) for subscription management operations — create, update, list, and deactivate.\n\nThis schema appears in the Catalog Subscription phase. The CS produces it as the synchronous response to POST /catalog/subscription (creation or update), GET /catalog/subscription (listing), and DELETE /catalog/subscription (deactivation). The DS consumes it to confirm subscription state.\n\nFabric context: Produced synchronously by the CS; no async callback is delivered for subscription management operations. The context.action is always catalog/on_subscription.\n\nRelationship: Composes one or more CatalogSubscription records in the message.subscriptions array, and an optional Pagination object for list responses.",
  "type": "object",
  "required": [
    "context",
    "message"
  ],
  "properties": {
    "context": {
      "allOf": [
        {
          "$ref": "https://schema.nfh.global/Context/v2.0/schema.json"
        },
        {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "const": "catalog/on_subscription"
            }
          }
        }
      ]
    },
    "message": {
      "type": "object",
      "required": [
        "subscriptions"
      ],
      "properties": {
        "subscriptions": {
          "type": "array",
          "items": {
            "$ref": "https://schema.nfh.global/CatalogSubscription/v2.0/schema.json"
          }
        },
        "pagination": {
          "$ref": "https://schema.nfh.global/Pagination/v2.0/schema.json"
        }
      }
    }
  }
}
