{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nordic-financial-news/json-schema/nordic-financial-news-story-detail-schema.json",
  "title": "StoryDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nordic-financial-news-stories-api-openapi.yml#/components/schemas/StoryDetail",
  "allOf": [
    {
      "$ref": "#/$defs/StorySummary"
    },
    {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "format": "markdown",
          "description": "Full story content in Markdown format"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the story was last updated (ISO 8601)"
        },
        "companies": {
          "type": "array",
          "description": "Companies mentioned in this story",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique company identifier"
              },
              "name": {
                "type": "string",
                "description": "Company name"
              },
              "ticker": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Primary stock ticker"
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "StorySummary": {
      "type": "object",
      "required": [
        "id",
        "title",
        "summary",
        "article_count",
        "published_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique story identifier"
        },
        "title": {
          "type": "string",
          "description": "Story title"
        },
        "summary": {
          "type": "string",
          "description": "Story summary"
        },
        "article_count": {
          "type": "integer",
          "description": "Number of articles in this story (matches the length of article_ids)"
        },
        "published_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the story's newest source article was published (ISO 8601). This is editorial time, not the time the story reached this API: a story about older news carries an older date. Use it to filter by when news happened, never to track what is new to you."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "When this record last changed (ISO 8601). This is the clock incremental sync runs on. It only ever moves forward, unlike published_at. To sync: pass your last completed sync time as `updated_after`, drain every page via `pagination.next_cursor`, and only then advance your stored timestamp."
        },
        "article_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IDs of articles in this story, most relevant first"
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "Country code (ISO 3166-1 alpha-2)"
        },
        "company_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IDs of companies mentioned in this story"
        },
        "category": {
          "type": "object",
          "description": "Story category",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        },
        "event_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "ID of the event this story was generated from. An event that has since been merged or removed still answers `GET /events/{id}` with a tombstone rather than a 404."
        }
      }
    }
  }
}