{
  "openapi": "3.1.0",
  "info": {
    "title": "Swiftjective-C Public Content API",
    "version": "1.0.0",
    "description": "A public, read-only API for discovering recent Swiftjective-C articles. It requires no authentication and has no write operations.",
    "license": {
      "name": "All rights reserved",
      "identifier": "LicenseRef-All-Rights-Reserved"
    },
    "contact": {
      "name": "Jordan Morgan",
      "url": "https://www.swiftjectivec.com/contact",
      "email": "jordan@swiftjectivec.com"
    }
  },
  "servers": [
    {
      "url": "https://www.swiftjectivec.com",
      "description": "Production and read-only testing server"
    }
  ],
  "security": [],
  "externalDocs": {
    "description": "Swiftjective-C developer portal",
    "url": "https://www.swiftjectivec.com/developers"
  },
  "paths": {
    "/api/posts": {
      "get": {
        "operationId": "listSwiftjectiveCPosts",
        "summary": "List recent Swiftjective-C posts",
        "description": "Returns public metadata for the newest Swiftjective-C articles in reverse chronological order. Use the canonical URL in each item to read the article or request it as Markdown.",
        "tags": ["Posts"],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of recent posts to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            },
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Recent post metadata was returned successfully.",
            "headers": {
              "Cache-Control": {
                "description": "Shared-cache policy for public content.",
                "schema": { "type": "string" }
              }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PostListResponse" }
              }
            }
          },
          "400": {
            "description": "The supplied limit is not a valid integer from 1 through 50.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" },
                "example": {
                  "error": {
                    "code": "invalid_limit",
                    "message": "The limit query parameter must be an integer from 1 through 50.",
                    "resolution": "Remove limit to use the default of 20, or provide a whole number between 1 and 50."
                  }
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported by this read-only endpoint.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          },
          "502": {
            "description": "The site's public feed is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Post": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "url", "title", "summary", "image", "datePublished", "dateModified", "author", "tags"],
        "properties": {
          "id": { "type": "string", "format": "uri", "description": "Stable post identifier." },
          "url": { "type": "string", "format": "uri", "description": "Canonical article URL." },
          "title": { "type": "string", "description": "Article title." },
          "summary": { "type": "string", "description": "Short plain-text article summary." },
          "image": {
            "description": "Public article image URL when available.",
            "oneOf": [
              { "type": "string", "format": "uri" },
              { "type": "null" }
            ]
          },
          "datePublished": { "type": "string", "format": "date-time", "description": "Original publication timestamp." },
          "dateModified": { "type": "string", "format": "date-time", "description": "Latest modification timestamp." },
          "author": { "type": "string", "description": "Public author name." },
          "tags": {
            "type": "array",
            "description": "Public topic labels.",
            "items": { "type": "string" }
          }
        }
      },
      "PostListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Post" }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "required": ["count", "limit", "source"],
            "properties": {
              "count": { "type": "integer", "minimum": 0, "description": "Number of items returned." },
              "limit": { "type": "integer", "minimum": 1, "maximum": 50, "description": "Applied result limit." },
              "source": { "type": "string", "format": "uri", "description": "Underlying JSON Feed URL." }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "required": ["code", "message", "resolution"],
        "properties": {
          "code": { "type": "string", "description": "Stable machine-readable error code." },
          "message": { "type": "string", "description": "Human-readable explanation." },
          "resolution": { "type": "string", "description": "Action an agent or developer can take to recover." }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["error"],
        "properties": {
          "error": { "$ref": "#/components/schemas/Error" }
        }
      }
    }
  }
}
