{
  "openapi": "3.0.0",
  "info": {
    "title": "PSX",
    "version": "1"
  },
  "servers": [
    {
      "url": "http:\/\/api.phpsx.org"
    }
  ],
  "paths": {
    "\/foo\/{name}\/{type}": {
      "get": {
        "description": "Returns a collection",
        "operationId": "list.foo",
        "parameters": [
          {
            "name": "startIndex",
            "in": "query",
            "description": "startIndex parameter",
            "required": true,
            "schema": {
              "description": "startIndex parameter",
              "type": "integer",
              "minimum": 0,
              "maximum": 32
            }
          },
          {
            "name": "float",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "boolean",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "name": "datetime",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "GET 200 Response",
            "content": {
              "application\/json": {
                "schema": {
                  "$ref": "#\/components\/schemas\/EntryCollection"
                }
              }
            }
          }
        }
      },
      "put": {
        "requestBody": {
          "description": "PUT Request",
          "content": {
            "application\/json": {
              "schema": {
                "$ref": "#\/components\/schemas\/EntryUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PUT 200 Response",
            "content": {
              "application\/json": {
                "schema": {
                  "$ref": "#\/components\/schemas\/EntryMessage"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create.foo",
        "requestBody": {
          "description": "POST Request",
          "content": {
            "application\/json": {
              "schema": {
                "$ref": "#\/components\/schemas\/EntryCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "POST 201 Response",
            "content": {
              "application\/json": {
                "schema": {
                  "$ref": "#\/components\/schemas\/EntryMessage"
                }
              }
            }
          }
        }
      },
      "delete": {
        "requestBody": {
          "description": "DELETE Request",
          "content": {
            "application\/json": {
              "schema": {
                "$ref": "#\/components\/schemas\/EntryDelete"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "DELETE 200 Response",
            "content": {
              "application\/json": {
                "schema": {
                  "$ref": "#\/components\/schemas\/EntryMessage"
                }
              }
            }
          }
        }
      },
      "patch": {
        "requestBody": {
          "description": "PATCH Request",
          "content": {
            "application\/json": {
              "schema": {
                "$ref": "#\/components\/schemas\/EntryPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PATCH 200 Response",
            "content": {
              "application\/json": {
                "schema": {
                  "$ref": "#\/components\/schemas\/EntryMessage"
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "description": "Name parameter",
          "required": true,
          "schema": {
            "description": "Name parameter",
            "type": "string",
            "pattern": "[A-z]+",
            "minLength": 0,
            "maxLength": 16
          }
        },
        {
          "name": "type",
          "in": "path",
          "required": false,
          "schema": {
            "enum": [
              "foo",
              "bar"
            ],
            "type": "string"
          }
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "Entry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "userId": {
            "type": "integer"
          },
          "title": {
            "type": "string",
            "pattern": "[A-z]+",
            "minLength": 3,
            "maxLength": 16
          },
          "date": {
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "EntryCollection": {
        "type": "object",
        "properties": {
          "entry": {
            "type": "array",
            "items": {
              "$ref": "#\/components\/schemas\/Entry"
            }
          }
        }
      },
      "EntryCreate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "userId": {
            "type": "integer"
          },
          "title": {
            "type": "string",
            "pattern": "[A-z]+",
            "minLength": 3,
            "maxLength": 16
          },
          "date": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "title",
          "date"
        ]
      },
      "EntryDelete": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "userId": {
            "type": "integer"
          },
          "title": {
            "type": "string",
            "pattern": "[A-z]+",
            "minLength": 3,
            "maxLength": 16
          },
          "date": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "EntryMessage": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "EntryPatch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "userId": {
            "type": "integer"
          },
          "title": {
            "type": "string",
            "pattern": "[A-z]+",
            "minLength": 3,
            "maxLength": 16
          },
          "date": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "EntryUpdate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "userId": {
            "type": "integer"
          },
          "title": {
            "type": "string",
            "pattern": "[A-z]+",
            "minLength": 3,
            "maxLength": 16
          },
          "date": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "GetQuery": {
        "type": "object",
        "properties": {
          "startIndex": {
            "description": "startIndex parameter",
            "type": "integer",
            "minimum": 0,
            "maximum": 32
          },
          "float": {
            "type": "number"
          },
          "boolean": {
            "type": "boolean"
          },
          "date": {
            "format": "date",
            "type": "string"
          },
          "datetime": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "startIndex"
        ]
      },
      "Path": {
        "type": "object",
        "properties": {
          "name": {
            "description": "Name parameter",
            "type": "string",
            "pattern": "[A-z]+",
            "minLength": 0,
            "maxLength": 16
          },
          "type": {
            "enum": [
              "foo",
              "bar"
            ],
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      }
    }
  }
}