{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/open-education-api/json-schema/open-education-api-news-item-schema.json",
  "title": "NewsItem",
  "description": "A newsitem contains the message and metadata of that message",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/open-education-api-news-api-openapi.yml#/components/schemas/NewsItem",
  "type": "object",
  "required": [
    "newsItemId",
    "name"
  ],
  "properties": {
    "newsItemId": {
      "type": "string",
      "description": "Unique id for this news item",
      "format": "uuid"
    },
    "newsItemType": {
      "$ref": "#/$defs/newsItemType"
    },
    "name": {
      "type": "array",
      "description": "The name for this news item",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/LanguageTypedString"
      }
    },
    "authors": {
      "type": "array",
      "description": "The authors of the article with this news item",
      "items": {
        "type": "string",
        "maxLength": 256
      }
    },
    "image": {
      "type": "string",
      "description": "The url containing the address of the image belonging to this news item",
      "format": "uri",
      "maxLength": 2048
    },
    "link": {
      "type": "string",
      "description": "The url containing the address of the article belonging to this news item",
      "format": "uri",
      "maxLength": 2048
    },
    "content": {
      "type": "array",
      "description": "The content of this news item.",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/LanguageTypedString"
      }
    },
    "newsFeeds": {
      "description": "The newsFeeds where this item can be found. [`expandable`](#tag/news_feed_model)",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/Identifier",
            "title": "newsFeedId"
          },
          {
            "$ref": "#/$defs/NewsFeed",
            "title": "NewsFeed"
          }
        ]
      }
    },
    "validFrom": {
      "type": "string",
      "description": "The moment from which this news item is valid, RFC3339 (date-time)",
      "format": "date-time"
    },
    "validUntil": {
      "type": "string",
      "description": "The moment until which this news item is valid, RFC3339 (date-time)",
      "format": "date-time"
    },
    "lastModified": {
      "type": "string",
      "description": "The moment on which this news item was updated, RFC3339 (date-time)",
      "format": "date-time"
    },
    "consumers": {
      "description": "The additional consumer elements that can be provided, see the [documentation on support for specific consumers](https://openonderwijsapi.nl/v5/#/technical/consumers-and-profiles/) for more information about this mechanism.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Consumer"
      }
    },
    "ext": {
      "$ref": "#/$defs/Ext"
    }
  },
  "$defs": {
    "Consumer": {
      "type": "object",
      "description": "Object for communicating data to a specific consumer (destination). This object has no relationship with the `consumer` query parameter.",
      "required": [
        "consumerKey"
      ],
      "properties": {
        "consumerKey": {
          "description": "The key of the consumer (destination) for which this information is intended. See the [consumer registry](https://openonderwijsapi.nl/v5/#/technical/consumers-and-profiles/) for more information.",
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "Ext": {
      "type": "object",
      "description": "Object for additional non-standard attributes"
    },
    "Identifier": {
      "type": "string",
      "description": "An identifier of another resource.",
      "format": "uuid"
    },
    "LanguageTypedString": {
      "type": "object",
      "description": "A String with an associated language code.",
      "properties": {
        "language": {
          "description": "The language used in the described entity. A string formatted according to RFC3066.",
          "type": "string",
          "pattern": "^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
        },
        "value": {
          "description": "String to describe the entity.",
          "type": "string"
        }
      }
    },
    "NewsFeed": {
      "type": "object",
      "description": "A placeholder or collection of news items",
      "required": [
        "newsFeedId",
        "newsFeedType",
        "name",
        "description"
      ],
      "properties": {
        "newsFeedId": {
          "type": "string",
          "description": "Unique id for this news feed",
          "format": "uuid"
        },
        "newsFeedType": {
          "type": "string",
          "description": "The type of the object this news feed relates to",
          "enum": [
            "organization",
            "program",
            "course",
            "component",
            "person",
            "building",
            "room"
          ]
        },
        "name": {
          "type": "array",
          "description": "The name for this news feed",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/LanguageTypedString"
          }
        },
        "description": {
          "type": "array",
          "description": "The description of this news feed.",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/LanguageTypedString"
          }
        },
        "consumers": {
          "description": "The additional consumer elements that can be provided, see the [documentation on support for specific consumers](https://openonderwijsapi.nl/v5/#/technical/consumers-and-profiles/) for more information about this mechanism.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Consumer"
          }
        },
        "ext": {
          "$ref": "#/$defs/Ext"
        }
      }
    },
    "newsItemType": {
      "type": "string",
      "description": "The type of this news item\n- calamity: calamiteit\n- general: algemeen\n- schedule-change: roosterwijziging\n- announcement: aankondiging\n",
      "enum": [
        "calamity",
        "general",
        "schedule-change",
        "announcement"
      ]
    }
  }
}