{
  "openapi": "3.2.0",
  "info": {
    "title": "Simulation Mode",
    "description": "A simulated API, each request generates a new set of data but responses are processed by an API handler.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://apichallenges.eviltester.com",
      "description": "cloud hosted version"
    },
    {
      "url": "http://localhost:4567",
      "description": "local execution"
    }
  ],
  "paths": {
    "/sim/entities": {
      "get": {
        "summary": "return all the instances of entity",
        "description": "return all the instances of entity",
        "parameters": [
          {
            "name": "_sortBy",
            "in": "query",
            "description": "Sort collection results by a field. Use +field or field for ascending order, and -field for descending order. Multiple fields can be combined with commas, e.g. +field,-other.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "+id"
          }
        ],
        "responses": {
          "200": {
            "description": "All the entities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/entities"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/entities"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json-seq": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "we should be able to create entity without a ID using the field values in the body of the message. ",
        "description": "we should be able to create entity without a ID using the field values in the body of the message. ",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/create_entity"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/create_entity"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created a entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json-seq": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Error when creating a entity"
          },
          "422": {
            "description": "Validation error when creating a entity"
          },
          "409": {
            "description": "Conflict when creating a entity"
          }
        }
      },
      "options": {
        "summary": "show all Options for endpoint of /sim/entities",
        "description": "show all Options for endpoint of /sim/entities",
        "responses": {
          "204": {
            "description": "the endpoint verb options"
          }
        }
      },
      "head": {
        "summary": "headers for all the instances of entity",
        "description": "headers for all the instances of entity",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "query": {
        "summary": "query all the instances of entity using application/x-www-form-urlencoded query content",
        "description": "query all the instances of entity using application/x-www-form-urlencoded query content",
        "parameters": [
          {
            "name": "_sortBy",
            "in": "query",
            "description": "Sort collection results by a field. Use +field or field for ascending order, and -field for descending order. Multiple fields can be combined with commas, e.g. +field,-other.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "+id"
          }
        ],
        "responses": {
          "200": {
            "description": "All the matching entities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/entities"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/entities"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json-seq": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Error processing request"
          },
          "413": {
            "description": "Standard Status Code Meaning"
          },
          "415": {
            "description": "Standard Status Code Meaning"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/sim/entities/{id}": {
      "get": {
        "summary": "return a specific instances of entity using a id",
        "description": "return a specific instances of entity using a id",
        "responses": {
          "200": {
            "description": "A specific entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json-seq": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Could not find a specific entity"
          }
        }
      },
      "put": {
        "summary": "amend a specific instances of entity using a id with a body containing the fields to amend",
        "description": "amend a specific instances of entity using a id with a body containing the fields to amend",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/entity"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/entity"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK, Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json-seq": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json-seq": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Standard Status Code Meaning"
          },
          "409": {
            "description": "Standard Status Code Meaning"
          }
        }
      },
      "post": {
        "summary": "amend a specific instances of entity using a id with a body containing the fields to amend",
        "description": "amend a specific instances of entity using a id with a body containing the fields to amend",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/entity"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/entity"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Amended the specific entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/entity"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json-seq": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Could not find a specific entity"
          },
          "422": {
            "description": "Validation error when amending a entity"
          },
          "409": {
            "description": "Conflict when amending a entity"
          }
        }
      },
      "delete": {
        "summary": "delete a specific instances of entity using a id",
        "description": "delete a specific instances of entity using a id",
        "responses": {
          "204": {
            "description": "Deleted a specific entity"
          },
          "404": {
            "description": "Could not find a specific entity"
          }
        }
      },
      "options": {
        "summary": "show all Options for endpoint of /sim/entities/:id",
        "description": "show all Options for endpoint of /sim/entities/:id",
        "responses": {
          "204": {
            "description": "OK, No Content"
          }
        }
      },
      "head": {
        "summary": "headers for a specific instances of entity using a id",
        "description": "headers for a specific instances of entity using a id",
        "responses": {
          "200": {
            "description": "Headers for a specific entity"
          },
          "404": {
            "description": "Could not find a specific entity"
          }
        }
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer"
          },
          "example": "14"
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "entity": {
        "type": "object",
        "description": "entity",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Field is an ID and should not be amended or set.",
            "example": "53"
          },
          "name": {
            "type": "string",
            "description": "Value is mandatory. Maximum length allowed is 50.",
            "example": "unnamed"
          },
          "description": {
            "type": "string",
            "description": "Maximum length allowed is 200.",
            "example": ""
          }
        },
        "title": "entity",
        "xml": {
          "name": "entity",
          "wrapped": true
        }
      },
      "create_entity": {
        "type": "object",
        "description": "entity",
        "properties": {
          "name": {
            "type": "string",
            "description": "Value is mandatory. Maximum length allowed is 50.",
            "example": "unnamed"
          },
          "description": {
            "type": "string",
            "description": "Maximum length allowed is 200.",
            "example": ""
          }
        },
        "title": "create entity",
        "xml": {
          "name": "entity",
          "wrapped": true
        }
      },
      "entities": {
        "type": "array",
        "description": "entities",
        "items": {
          "$ref": "#/components/schemas/entity"
        },
        "title": "entities",
        "xml": {
          "wrapped": true
        }
      }
    }
  }
}