{
  "swagger": "2.0",
  "info": {
    "description": "Random APIs Andrew has created",
    "version": "1.0.1",
    "title": "Random APIs",
    "contact": {
      "email": "andrew.norman@gmail.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "api.andrewnorman.uk",
  "basePath": "/",
  "tags": [
    {
      "name": "headline-puzzle",
      "description": "Encrypt headlines for the headline puzzle",
      "externalDocs": {
        "description": "Find out more",
        "url": "https://www.andrewnorman.uk"
      }
    },
    {
      "name": "planet-calculator",
      "description": "Find your weight on different planets",
      "externalDocs": {
        "description": "Find out more",
        "url": "https://www.andrewnorman.uk"
      }
    }
  ],
  "schemes": [
    "https",
    "http"
  ],
  "paths": {
    "/headline-puzzle/encrypt": {
      "post": {
        "tags": [
          "headline-puzzle"
        ],
        "summary": "Encrypt 5 headlines",
        "description": "",
        "operationId": "encryptHeadline",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "Headlines",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Headline"
            }
          },
          {
            "in": "query",
            "name": "key",
            "description": "Key, with no repeating characters, used for encryption.",
            "required": true,
            "type": "string"
          },
          {
            "in": "query",
            "name": "setting",
            "description": "A 5 character string defining how each headline alphabet is offset from the original.",
            "required": true,
            "type": "string"
          },
          {
            "in": "query",
            "name": "hat",
            "description": "The hat, used to create the alphabet.",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Headline"
            }
          },
          "422": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/planet-calculator": {
      "get": {
        "tags": [
          "planet-calculator"
        ],
        "summary": "Calculate your weight on different planets",
        "description": "",
        "operationId": "planetCalculator",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "description": "Full name, or partial name of the planet.",
            "required": true,
            "type": "string"
          },
          {
            "in": "query",
            "name": "weight",
            "description": "Your weight.",
            "required": true,
            "type": "number"
          },
          {
            "in": "query",
            "name": "measure",
            "description": "kg.  Just put in \"kg\".",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/PlanetResults"
            }
          },
          "422": {
            "description": "Invalid input"
          }
        }  
      }
    }
  },
  "definitions": {
    "Headline": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "PlanetResults": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "weight": {
            "type": "number"
          },
          "measure": {
            "type": "string"
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Find out",
    "url": "https://andrewnorman.uk"
  }
}