{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcade-games-nl/json-schema/arcade-games-nl-player-profile-schema.json",
  "title": "PlayerProfile",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcade-games-nl-openapi.json#/components/schemas/PlayerProfile",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "joined": {
      "type": "string",
      "format": "date-time"
    },
    "runs": {
      "type": "integer",
      "minimum": 0
    },
    "wins": {
      "type": "integer",
      "minimum": 0
    },
    "favourite": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "signal-hunter",
            "circuit-garden",
            "protocol-duel",
            "crate-current",
            "bloom-shift",
            "tidal-atlas",
            "orrery-of-echoes"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "games": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/PlayerGameStats"
      }
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PlayerResult"
      }
    }
  },
  "required": [
    "accountId",
    "name",
    "joined",
    "runs",
    "wins",
    "favourite",
    "games",
    "results"
  ],
  "$defs": {
    "PlayerGameStats": {
      "type": "object",
      "properties": {
        "runs": {
          "type": "integer",
          "minimum": 0
        },
        "wins": {
          "type": "integer",
          "minimum": 0
        },
        "bestScore": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "runs",
        "wins",
        "bestScore"
      ]
    },
    "PlayerResult": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "game": {
          "type": "string",
          "enum": [
            "signal-hunter",
            "circuit-garden",
            "protocol-duel",
            "crate-current",
            "bloom-shift",
            "tidal-atlas",
            "orrery-of-echoes"
          ]
        },
        "mode": {
          "type": "string",
          "enum": [
            "free",
            "daily"
          ],
          "default": "free"
        },
        "day": {
          "type": "string",
          "format": "date"
        },
        "score": {
          "type": "integer",
          "minimum": 0
        },
        "won": {
          "type": "boolean"
        },
        "replayAvailable": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "game",
        "mode",
        "day",
        "score",
        "won",
        "replayAvailable"
      ]
    }
  }
}