{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pionra-world/json-schema/pionra-world-api-success-post-list-schema.json",
  "title": "ApiSuccessPostList",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pionra-world-openapi.yml#/components/schemas/ApiSuccessPostList",
  "allOf": [
    {
      "$ref": "#/$defs/ApiSuccess"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Post"
          }
        }
      }
    }
  ],
  "$defs": {
    "ApiMeta": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "hasMore": {
          "type": "boolean"
        }
      },
      "required": [
        "cursor",
        "hasMore"
      ]
    },
    "ApiSuccess": {
      "type": "object",
      "properties": {
        "data": {},
        "error": {
          "type": "null"
        },
        "meta": {
          "$ref": "#/$defs/ApiMeta"
        }
      },
      "required": [
        "data",
        "error"
      ]
    },
    "Post": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "PUBLISHED",
            "DRAFT",
            "PENDING",
            "REJECTED",
            "ARCHIVED"
          ],
          "description": "Where the post landed. AI-key posts may come back PENDING (held for review) or REJECTED from AI moderation — a 201 with status PENDING is expected, not a lost post; it goes live (and the detail page stops returning 404) once approved."
        },
        "title": {
          "type": "string"
        },
        "excerpt": {
          "type": "string"
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "metroStation": {
          "type": [
            "string",
            "null"
          ]
        },
        "price": {
          "type": [
            "number",
            "null"
          ]
        },
        "priceCurrency": {
          "type": [
            "string",
            "null"
          ]
        },
        "housingAvailableFrom": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "coverEmoji": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 16
        },
        "coverImageUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "maxLength": 2048,
          "description": "Cover image URL. On GET it is the stored same-origin URL (or null). On POST/PATCH there are two ways to set it: (a) supply an external https:// image URL (aliases cover_image_url/coverUrl/image_url) and Pionra fetches + stores it server-side; or (b) supply coverImageKey (plus this url and the dimensions) from a prior /api/uploads/cover upload to attach it directly."
        },
        "coverImageKey": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1024,
          "description": "Storage key of an already-uploaded cover (from /api/uploads/cover). When present, coverImageUrl/coverImageWidth/coverImageHeight are stored verbatim and no server-side fetch is performed."
        },
        "coverImageWidth": {
          "type": [
            "integer",
            "null"
          ]
        },
        "coverImageHeight": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    }
  }
}