{
  "x-generator": "NSwag v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v10.0.0.0))",
  "openapi": "3.0.0",
  "info": {
    "title": "A-maze-ing API",
    "description": "This document describes the API of the A-maze-ing evening server.\r\n\r\nThis API consists of three different endpoints, which are detailed below. \r\n- To register yourself as a player use the Player endpoint. \r\n- To get information about the available mazes and enter a specific maze use the Mazes endpoint. \r\n- To navigate a maze use the Maze endpoint.",
    "version": "v2"
  },
  "servers": [
    {
      "url": "http://maze.kluster.htiprojects.nl"
    }
  ],
  "paths": {
    "/api/maze/possibleActions": {
      "get": {
        "tags": [
          "Maze"
        ],
        "summary": "👀 Get the list of possible actions, from the tile where you are standing.",
        "description": "You must have already entered a maze. Also, you shouldn't require this method that much, given than any action you perform on the maze will return this same information.",
        "operationId": "PossibleActions",
        "responses": {
          "200": {
            "description": "The actions you can perform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PossibleActionsAndCurrentScore"
                }
              }
            }
          },
          "412": {
            "description": "You haven't entered a maze yet. Use the enter action to get this party started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/maze/move": {
      "post": {
        "tags": [
          "Maze"
        ],
        "summary": "Move in the supplied direction.",
        "description": "You must have already entered a maze. This method will return 200 even if you could not move in this direction. If there is a \"wall\" in your way and you try to move there.. well, it's gonna hurt, but you will remain in the same place.. which.. technically.. is valid.. 🤷🏻‍",
        "operationId": "Move",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Direction"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "The actions you can perform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PossibleActionsAndCurrentScore"
                }
              }
            }
          },
          "412": {
            "description": "You haven't entered a maze yet. Use the enter action to get this party started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/maze/tag": {
      "post": {
        "tags": [
          "Maze"
        ],
        "summary": "Tag the current tile with the given (non-negative) number",
        "description": "You must have already entered a maze. This method will return 200 even if you already tagged this tile. By tagging a tile \"again\" you will rewrite the previous tag.‍",
        "operationId": "Tag",
        "parameters": [
          {
            "name": "tagValue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "The actions you can perform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PossibleActionsAndCurrentScore"
                }
              }
            }
          },
          "412": {
            "description": "You haven't entered a maze yet. Use the enter action to get this party started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/maze/collectScore": {
      "post": {
        "tags": [
          "Maze"
        ],
        "summary": "💰 Collect score from your hand to your bag.",
        "description": "Remember that when you exit a maze, only score in your bag will carry over and be awarded to your overall player score. Any score left in your hand will be lost.",
        "operationId": "CollectScore",
        "responses": {
          "200": {
            "description": "The actions you can perform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PossibleActionsAndCurrentScore"
                }
              }
            }
          },
          "403": {
            "description": "Hey! Are you trying to collect score on a non score collection place, or without having any score in your hand to collect? No, no no.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "You haven't entered a maze yet. Use the enter action to get this party started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/maze/exit": {
      "post": {
        "tags": [
          "Maze"
        ],
        "summary": "🚪 Exit the maze.",
        "description": "Remember that when you exit a maze, only score in your bag will carry over and be awarded to your overall player score. Any score left in your hand will be lost.\nAlso, remember that you can only play the same maze once, so make sure you have collected as much score as you can.",
        "operationId": "ExitMaze",
        "responses": {
          "200": {
            "description": "You have now exited the maze. We hope you enjoyed it. Maybe there are more mazes available?"
          },
          "403": {
            "description": "Hey! Are you trying to exit the maze on a non exit place? No, no no.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Wait, what? You haven't entered a maze yet and you are trying to exit it? 😱",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/mazes/all": {
      "get": {
        "tags": [
          "Mazes"
        ],
        "summary": "📜 All the mazes that are active in the game.",
        "description": "Even though you can only play a maze once, this method will return all the mazes. This is not laziness from the server side, this is to make it slightly more \"interesting\", because you need to keep track of the mazes you have already played on your implementation.",
        "operationId": "AllMazes",
        "responses": {
          "200": {
            "description": "All mazes that exist in the game.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MazeInfo"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mazes/enter": {
      "post": {
        "tags": [
          "Mazes"
        ],
        "summary": "🌟 Enter a maze.",
        "description": "Keep in mind that you can only be playing one maze at a time. Invoking this method when you are already in a maze will result in a failure. Also, you can only play the same maze once. If you wish to play the same maze \"multiple times\", you need to request to forget your player data (via the player API).",
        "operationId": "EnterMaze",
        "parameters": [
          {
            "name": "mazeName",
            "in": "query",
            "required": true,
            "description": "What maze do you wish to enter.",
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Welcome to this maze. Here are the possible actions you can take. Enjoy! 🎉",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PossibleActionsAndCurrentScore"
                }
              }
            }
          },
          "400": {
            "description": "The mazeName parameter was not supplied or an empty string. Have a look at the mazes API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The maze you requested does not exist. Have a look at the mazes API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "You are either already playing a maze, or you have already played this maze.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "You haven't registered yet. You need to register (via the player API) before you can enter a maze.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/player/register": {
      "post": {
        "tags": [
          "Player"
        ],
        "summary": "📝 Register yourself here.",
        "description": "You need to register to be able to start navigating through mazes.",
        "operationId": "RegisterPlayer",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "description": "The name you wish to represent you in the leader board.",
            "schema": {
              "type": "string",
              "maxLength": 50,
              "minLength": 1
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "You have successfully registered. Cool 👍🏻",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerInfo"
                }
              }
            }
          },
          "400": {
            "description": "Empty or whitespace-only names or names longer than 50 characters are not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "You are already registered. If you wish to re-register, you should invoke Forget first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/player": {
      "get": {
        "tags": [
          "Player"
        ],
        "summary": "👤 Obtain information about yourself.",
        "operationId": "GetPlayerInfo",
        "responses": {
          "200": {
            "description": "Your current information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerInfo"
                }
              }
            }
          },
          "404": {
            "description": "You haven't registered yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/player/forget": {
      "delete": {
        "tags": [
          "Player"
        ],
        "summary": "🙈 Forget your current progress.",
        "description": "👻 This allows you to re-register with a different name, and even repeat the mazes that you have played before.",
        "operationId": "ForgetPlayer",
        "responses": {
          "202": {
            "description": ""
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PossibleActionsAndCurrentScore": {
        "type": "object",
        "description": "From the current tile where you stand, what actions are available on it and on the surrounding tiles.",
        "additionalProperties": false,
        "required": [
          "possibleMoveActions",
          "canCollectScoreHere",
          "canExitMazeHere",
          "currentScoreInHand",
          "currentScoreInBag"
        ],
        "properties": {
          "possibleMoveActions": {
            "type": "array",
            "description": "The actions available on your surrounding tiles (lookahead of one tile).",
            "items": {
              "$ref": "#/components/schemas/MoveAction"
            }
          },
          "canCollectScoreHere": {
            "type": "boolean",
            "description": "In the tile where you are standing, is it possible to collect score (from hand to bag)."
          },
          "canExitMazeHere": {
            "type": "boolean",
            "description": "In the tile where you are standing, is it possible to exit the maze. Remember you will lose any score in hand\nand only be rewarded with the score you have in your bag."
          },
          "currentScoreInHand": {
            "type": "integer",
            "description": "What is the score you currently have in your hand. Find a score collection point and issue a collect\nscore command to move this score into your bag. Score in your hand is not awarded when you exit a maze."
          },
          "currentScoreInBag": {
            "type": "integer",
            "description": "What is the score currently in your bag. When you exit the maze this score will be rewarded to your total\noverall score."
          },
          "tagOnCurrentTile": {
            "type": "integer",
            "description": "The tag on the current tile",
            "format": "int64",
            "nullable": true
          },
          "numberOfVisitsToTile": {
            "type": "integer",
            "description": "The number of times the current tile has been visited.",
            "format": "int64"
          }
        }
      },
      "MoveAction": {
        "type": "object",
        "description": "A tile",
        "additionalProperties": false,
        "required": [
          "direction",
          "isStart",
          "allowsExit",
          "allowsScoreCollection",
          "hasBeenVisited",
          "numberOfVisitsToTile",
          "rewardOnDestination"
        ],
        "properties": {
          "direction": {
            "description": "What is the relative direction of this tile.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/Direction"
              }
            ]
          },
          "isStart": {
            "type": "boolean",
            "description": "Is this the tile where the maze begun."
          },
          "allowsExit": {
            "type": "boolean",
            "description": "Can you exit the maze on this tile."
          },
          "allowsScoreCollection": {
            "type": "boolean",
            "description": "Does this tile allow for score collection (moving score from your hand to your bag)."
          },
          "hasBeenVisited": {
            "type": "boolean",
            "description": "Have you visited this tile before."
          },
          "numberOfVisitsToTile": {
            "type": "integer",
            "description": "Counter of the times this tile has been visited.",
            "format": "int64"
          },
          "rewardOnDestination": {
            "type": "integer",
            "description": "What reward is available on this tile."
          },
          "tagOnTile": {
            "type": "integer",
            "description": "The tag on this tile. NOTE: default tag is 0",
            "format": "int64",
            "nullable": true
          }
        }
      },
      "Direction": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Up",
          "Right",
          "Down",
          "Left"
        ],
        "enum": [
          "Up",
          "Right",
          "Down",
          "Left"
        ]
      },
      "ProblemDetails": {
        "type": "object",
        "additionalProperties": {
          "nullable": true
        },
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "MazeInfo": {
        "type": "object",
        "description": "Information related to a Maze.",
        "additionalProperties": false,
        "required": [
          "name",
          "totalTiles",
          "potentialReward"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the maze. Might give you a hint regarding its structure.",
            "minLength": 1
          },
          "totalTiles": {
            "type": "integer",
            "description": "How many tiles exist in this maze."
          },
          "potentialReward": {
            "type": "integer",
            "description": "The total available reward in this maze."
          }
        }
      },
      "PlayerInfo": {
        "type": "object",
        "description": "The data structure that represents information related to a player.",
        "additionalProperties": false,
        "required": [
          "playerId",
          "name",
          "isInMaze",
          "hasFoundEasterEgg",
          "playerScore"
        ],
        "properties": {
          "playerId": {
            "type": "string",
            "description": "The public unique identifier of a player.",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "description": "The name a player has chosen to represent her.",
            "minLength": 1
          },
          "isInMaze": {
            "type": "boolean",
            "description": "An indication of whether a player is currently playing a maze or not."
          },
          "maze": {
            "type": "string",
            "description": "The name of the maze the player is currently playing. Might be null if player\nis not currently playing a maze.",
            "nullable": true
          },
          "hasFoundEasterEgg": {
            "type": "boolean",
            "description": "Wink wink."
          },
          "mazeScoreInHand": {
            "type": "integer",
            "description": "How much score the player has in her hand. Only available if player is playing a maze.",
            "nullable": true
          },
          "mazeScoreInBag": {
            "type": "integer",
            "description": "How much score the player has in her bag. Only available if player is playing a maze.",
            "nullable": true
          },
          "playerScore": {
            "type": "integer",
            "description": "The accumulated score across all played mazes."
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API key needed to access the endpoints.",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}