{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/suomi-fi/json-schema/suomi-fi-service-collection-response-schema.json",
  "title": "ServiceCollectionResponse",
  "description": "Service collection response",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/suomi-fi-ptv-openapi.yml#/components/schemas/ServiceCollectionResponse",
  "type": "object",
  "required": [
    "contentId",
    "organizationContentId",
    "languageVersions",
    "publishedAt",
    "items"
  ],
  "properties": {
    "migratedAt": {
      "anyOf": [
        {
          "$ref": "#/$defs/DateTime"
        },
        {
          "type": "null"
        }
      ]
    },
    "contentId": {
      "$ref": "#/$defs/ContentIdType"
    },
    "organizationContentId": {
      "$ref": "#/$defs/ContentIdType"
    },
    "languageVersions": {
      "$ref": "#/$defs/ServiceCollectionLanguageVersionsResponse"
    },
    "publishedAt": {
      "anyOf": [
        {
          "$ref": "#/$defs/DateTime"
        },
        {
          "type": "null"
        }
      ]
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceCollectionItem"
      }
    }
  },
  "$defs": {
    "ContentIdType": {
      "type": "string",
      "format": "uuid",
      "description": "Content id type",
      "title": "ContentIdType"
    },
    "DateTime": {
      "type": "string",
      "format": "date-time",
      "description": "string, e.g. 2025-09-22T07:32:52.026Z",
      "title": "DateTime"
    },
    "ServiceCollectionItem": {
      "type": "object",
      "required": [
        "itemType",
        "contentId"
      ],
      "properties": {
        "itemType": {
          "enum": [
            "Service",
            "ServiceChannel"
          ],
          "type": "string"
        },
        "contentId": {
          "$ref": "#/$defs/ContentIdType"
        }
      },
      "additionalProperties": false,
      "description": "Service collection item",
      "title": "ServiceCollectionItem"
    },
    "ServiceCollectionLanguageVersionResponse": {
      "type": "object",
      "required": [
        "name",
        "summary",
        "description"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "description": {
          "anyOf": [
            {
              "type": "string",
              "description": "Markdown-formatted content. Use a Markdown parser/renderer when presenting it."
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Service collection language version response",
      "title": "ServiceCollectionLanguageVersionResponse"
    },
    "ServiceCollectionLanguageVersionsResponse": {
      "type": "object",
      "properties": {
        "fi": {
          "$ref": "#/$defs/ServiceCollectionLanguageVersionResponse"
        },
        "sv": {
          "$ref": "#/$defs/ServiceCollectionLanguageVersionResponse"
        },
        "en": {
          "$ref": "#/$defs/ServiceCollectionLanguageVersionResponse"
        },
        "se": {
          "$ref": "#/$defs/ServiceCollectionLanguageVersionResponse"
        },
        "smn": {
          "$ref": "#/$defs/ServiceCollectionLanguageVersionResponse"
        },
        "sms": {
          "$ref": "#/$defs/ServiceCollectionLanguageVersionResponse"
        }
      },
      "additionalProperties": false,
      "description": "Service collection language version response",
      "title": "ServiceCollectionLanguageVersionsResponse"
    }
  }
}