{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sbox-watch/json-schema/sbox-watch-package-detail-schema.json",
  "title": "PackageDetail",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sbox-watch-openapi.json#/components/schemas/PackageDetail",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "ident",
    "title",
    "canonicalUrl",
    "markdownUrl",
    "generation",
    "generatedAt",
    "contentNotice",
    "updates",
    "liveServers",
    "apiUrl"
  ],
  "properties": {
    "ident": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "creator": {
      "type": [
        "string",
        "null"
      ]
    },
    "summary": {
      "type": "string"
    },
    "playersNow": {
      "type": [
        "number",
        "null"
      ]
    },
    "playersPeak24h": {
      "type": [
        "number",
        "null"
      ]
    },
    "totalSeconds": {
      "type": [
        "number",
        "null"
      ]
    },
    "weeklyPlaytimeSeconds": {
      "type": [
        "number",
        "null"
      ],
      "description": "Current cumulative playtime minus the baseline total; null if unavailable or reset."
    },
    "weeklyPlaytimeBaselineAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "favorites": {
      "type": [
        "number",
        "null"
      ]
    },
    "upvotes": {
      "type": [
        "number",
        "null"
      ]
    },
    "downvotes": {
      "type": [
        "number",
        "null"
      ]
    },
    "score": {
      "type": [
        "number",
        "null"
      ]
    },
    "momentum24h": {
      "type": [
        "number",
        "null"
      ]
    },
    "serversOnline": {
      "type": [
        "number",
        "null"
      ],
      "description": "Live dedicated servers running this map; null when the server feed is unavailable. Present for map packages."
    },
    "updated": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "jams": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GameJam"
      }
    },
    "playFund": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "state",
            "observedAt"
          ],
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "enabled",
                "disabled",
                "unknown"
              ]
            },
            "observedAt": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Latest fresh Playfund page observation for games; null when unavailable or stale."
    },
    "canonicalUrl": {
      "type": "string",
      "format": "uri"
    },
    "markdownUrl": {
      "type": "string",
      "format": "uri"
    },
    "sboxUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "generation": {
      "type": [
        "string",
        "number"
      ]
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "contentNotice": {
      "type": "string"
    },
    "apiUrl": {
      "type": "string",
      "format": "uri"
    },
    "description": {
      "type": "string"
    },
    "created": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "fileSize": {
      "type": [
        "number",
        "null"
      ]
    },
    "totalUsers": {
      "type": [
        "number",
        "null"
      ]
    },
    "totalSessions": {
      "type": [
        "number",
        "null"
      ]
    },
    "supportsVr": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "supportsController": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "updatesTotal": {
      "type": "integer",
      "minimum": 0
    },
    "updates": {
      "type": "array",
      "maxItems": 5,
      "items": {
        "$ref": "#/$defs/PackageUpdate"
      }
    },
    "liveServers": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "name",
          "online",
          "canonicalUrl",
          "markdownUrl"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "online": {
            "type": "boolean"
          },
          "players": {
            "type": [
              "number",
              "null"
            ]
          },
          "maxPlayers": {
            "type": [
              "number",
              "null"
            ]
          },
          "playersPeak24h": {
            "type": [
              "number",
              "null"
            ]
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "gameTitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "map": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonicalUrl": {
            "type": "string",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  },
  "$defs": {
    "GameJam": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "ident",
        "title",
        "url"
      ],
      "properties": {
        "ident": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "deadline": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "PackageUpdate": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "title": {
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "summary": {
          "type": "string"
        },
        "changeCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": []
    }
  }
}