{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-feed-public-profile-page-schema.json",
  "title": "FeedPublicProfilePage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-feed-api-openapi.yml#/components/schemas/FeedPublicProfilePage",
  "type": "object",
  "required": [
    "profile",
    "posts",
    "next_cursor"
  ],
  "properties": {
    "profile": {
      "type": "object",
      "required": [
        "username",
        "badge",
        "post_count",
        "first_post_at"
      ],
      "properties": {
        "username": {
          "type": "string"
        },
        "badge": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "team",
            null
          ]
        },
        "post_count": {
          "type": "integer",
          "minimum": 0
        },
        "first_post_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "posts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FeedPublicPost"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "FeedLinkPreview": {
      "type": "object",
      "description": "Preview of a link, fetched once when the post was created.",
      "required": [
        "url",
        "title",
        "description",
        "site_name",
        "image_url"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The link the preview card opens."
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200,
          "description": "Page title (up to 200 characters)."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 300,
          "description": "Page description (up to 300 characters)."
        },
        "site_name": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 80,
          "description": "Site name (up to 80 characters)."
        },
        "image_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Public preview image (`GET /v1/feed/previews/{postId}`), or null."
        }
      }
    },
    "FeedPostImage": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        }
      }
    },
    "FeedPostMedia": {
      "type": "object",
      "description": "Inline media of a post: a C2PA-signed Studio render.",
      "required": [
        "kind",
        "url",
        "poster_url",
        "width",
        "height",
        "duration_ms",
        "c2pa"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "video",
            "audio"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Public URL (`GET /v1/feed/media/{postId}`) that redirects to a 10-minute signed URL."
        },
        "poster_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Poster frame (`GET /v1/feed/media/{postId}/poster`), or null."
        },
        "width": {
          "type": [
            "integer",
            "null"
          ]
        },
        "height": {
          "type": [
            "integer",
            "null"
          ]
        },
        "duration_ms": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "c2pa": {
          "type": "boolean",
          "enum": [
            true
          ],
          "description": "Always true: only renders with Content Credentials (C2PA) are attached."
        }
      }
    },
    "FeedPublicPost": {
      "type": "object",
      "description": "A post as shown on the public web: the feed post without viewer-specific and moderation fields; `mentions` lists only users who opted in to the public web.",
      "required": [
        "id",
        "kind",
        "body",
        "link_url",
        "images",
        "author",
        "like_count",
        "created_at",
        "lang",
        "comment_count",
        "link_preview",
        "tags",
        "mentions",
        "media",
        "public_url"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "project",
            "seeking",
            "idea"
          ]
        },
        "body": {
          "type": "string",
          "maxLength": 2000
        },
        "link_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "images": {
          "type": "array",
          "maxItems": 4,
          "items": {
            "$ref": "#/$defs/FeedPostImage"
          }
        },
        "author": {
          "type": "object",
          "required": [
            "username",
            "badge"
          ],
          "properties": {
            "username": {
              "type": [
                "string",
                "null"
              ]
            },
            "badge": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "team",
                null
              ],
              "description": "`team` for official codai accounts; otherwise null."
            }
          }
        },
        "like_count": {
          "type": "integer",
          "minimum": 0
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "lang": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "en",
            "ro",
            null
          ]
        },
        "comment_count": {
          "type": "integer",
          "minimum": 0
        },
        "link_preview": {
          "oneOf": [
            {
              "$ref": "#/$defs/FeedLinkPreview"
            },
            {
              "type": "null"
            }
          ]
        },
        "tags": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "type": "string"
          }
        },
        "mentions": {
          "type": "array",
          "maxItems": 5,
          "items": {
            "type": "string"
          }
        },
        "media": {
          "oneOf": [
            {
              "$ref": "#/$defs/FeedPostMedia"
            },
            {
              "type": "null"
            }
          ]
        },
        "public_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    }
  }
}