{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/saaskly-com/json-schema/saaskly-com-article-schema.json",
  "title": "Article",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/saaskly-com-openapi.json#/components/schemas/Article",
  "type": "object",
  "required": [
    "id",
    "title",
    "slug",
    "contentType"
  ],
  "properties": {
    "id": {
      "type": "integer"
    },
    "title": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "contentType": {
      "type": "string",
      "enum": [
        "comparison",
        "buying-guide",
        "review",
        "news",
        "opinion"
      ]
    },
    "excerpt": {
      "type": [
        "string",
        "null"
      ]
    },
    "body": {
      "$ref": "#/$defs/RichText"
    },
    "categories": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "$ref": "#/$defs/Category"
          }
        ]
      }
    },
    "publishedDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "sponsored": {
      "type": "boolean"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "Category": {
      "type": "object",
      "required": [
        "id",
        "name",
        "slug"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "RichText": {
      "type": "object",
      "description": "Lexical editor JSON. Prefer the `.md` mirror for prose."
    }
  }
}