{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "XPlanDokumenteAPI",
    "description" : "XPlanDokumente REST API",
    "license" : {
      "name" : "Apache 2.0",
      "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version" : "1.1.0"
  },
  "servers" : [ {
    "url" : "/xplan-dokumente-api/xdokumente/api/v1"
  } ],
  "tags" : [ {
    "name" : "download",
    "description" : "Download XPlanDokumente"
  }, {
    "name" : "config",
    "description" : "Administrate config files"
  } ],
  "paths" : {
    "/config" : {
      "get" : {
        "tags" : [ "config" ],
        "summary" : "List config files",
        "description" : "List all config files",
        "operationId" : "listConfigFiles",
        "responses" : {
          "200" : {
            "description" : "Config files",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/ConfigFile"
                  }
                }
              }
            }
          },
          "406" : {
            "description" : "Requested format is not available"
          }
        }
      },
      "post" : {
        "tags" : [ "config" ],
        "summary" : "Upload config file",
        "description" : "Upload a new config file",
        "operationId" : "postConfigFile",
        "parameters" : [ {
          "name" : "X-Filename",
          "in" : "header",
          "description" : "Name of the config file to be uploaded",
          "required" : true,
          "schema" : {
            "pattern" : "^[A-Za-z0-9.()_\\-]*$",
            "type" : "string"
          },
          "example" : "sldFile.xml"
        } ],
        "requestBody" : {
          "content" : {
            "text/xml" : {
              "schema" : {
                "type" : "string",
                "description" : "xml file to upload",
                "format" : "binary"
              }
            },
            "application/xml" : {
              "schema" : {
                "type" : "string",
                "description" : "xml file to upload",
                "format" : "binary"
              }
            },
            "text/plain" : {
              "schema" : {
                "type" : "string",
                "description" : "gfi file to upload",
                "format" : "binary"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "description" : "successful operation",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConfigFile"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid input"
          },
          "406" : {
            "description" : "Requested format is not available"
          },
          "409" : {
            "description" : "File with the same name already exists"
          },
          "415" : {
            "description" : "Unsupported media type or content"
          }
        }
      }
    },
    "/config/{fileName}" : {
      "get" : {
        "tags" : [ "config" ],
        "summary" : "Download config file",
        "description" : "Download a config file",
        "operationId" : "getConfigFile",
        "parameters" : [ {
          "name" : "fileName",
          "in" : "path",
          "description" : "Name of the config file",
          "required" : true,
          "schema" : {
            "pattern" : "^[A-Za-z0-9.()_\\-]*$",
            "type" : "string"
          },
          "example" : "sldFile.xml"
        } ],
        "responses" : {
          "200" : {
            "description" : "Config file"
          },
          "404" : {
            "description" : "Invalid fileName, config file not found"
          },
          "406" : {
            "description" : "Requested format is not available"
          }
        }
      },
      "put" : {
        "tags" : [ "config" ],
        "summary" : "Replace config file",
        "description" : "Replace an existing config file",
        "operationId" : "putConfigFile",
        "parameters" : [ {
          "name" : "fileName",
          "in" : "path",
          "description" : "Name of the config file to replace",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : "sldFile.xml"
        } ],
        "requestBody" : {
          "content" : {
            "text/xml" : {
              "schema" : {
                "type" : "string",
                "description" : "xml file to upload",
                "format" : "binary"
              }
            },
            "application/xml" : {
              "schema" : {
                "type" : "string",
                "description" : "xml file to upload",
                "format" : "binary"
              }
            },
            "text/plain" : {
              "schema" : {
                "type" : "string",
                "description" : "gfi file to upload",
                "format" : "binary"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConfigFile"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid input"
          },
          "404" : {
            "description" : "Invalid fileName, config file not found"
          },
          "406" : {
            "description" : "Requested format is not available"
          },
          "415" : {
            "description" : "Unsupported media type or content"
          }
        }
      },
      "delete" : {
        "tags" : [ "config" ],
        "summary" : "Delete config file",
        "description" : "Delete an existing config file",
        "operationId" : "deleteConfigFile",
        "parameters" : [ {
          "name" : "fileName",
          "in" : "path",
          "description" : "Name of the config file to delete",
          "required" : true,
          "schema" : {
            "pattern" : "^[A-Za-z0-9.()_\\-]*$",
            "type" : "string"
          },
          "example" : "sldFile.xml"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation"
          },
          "404" : {
            "description" : "Invalid fileName, config file not found"
          }
        }
      },
      "head" : {
        "tags" : [ "config" ],
        "summary" : "Show config file header",
        "description" : "Show the header of a config file",
        "operationId" : "headConfigFile",
        "parameters" : [ {
          "name" : "fileName",
          "in" : "path",
          "description" : "Name of the config file",
          "required" : true,
          "schema" : {
            "pattern" : "^[A-Za-z0-9.()_\\-]*$",
            "type" : "string"
          },
          "example" : "sldFile.xml"
        } ],
        "responses" : {
          "200" : {
            "description" : "Config file"
          },
          "404" : {
            "description" : "Invalid fileName, config file not found"
          },
          "406" : {
            "description" : "Requested format is not available"
          }
        }
      }
    },
    "/dokument/{planId}" : {
      "get" : {
        "tags" : [ "download" ],
        "summary" : "List documents",
        "description" : "List all documents of the plan",
        "operationId" : "listDocuments",
        "parameters" : [ {
          "name" : "planId",
          "in" : "path",
          "description" : "ID of the plan to return document",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : 123
        } ],
        "responses" : {
          "200" : {
            "description" : "Documents"
          },
          "400" : {
            "description" : "Invalid input"
          },
          "404" : {
            "description" : "Invalid planID"
          }
        }
      }
    },
    "/info" : {
      "get" : {
        "summary" : "Show system and application configuration",
        "description" : "Returns the system and application configuration",
        "operationId" : "showConfig",
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SystemConfig"
                }
              }
            }
          },
          "406" : {
            "description" : "Requested format is not available"
          }
        }
      }
    },
    "/dokument/{planId}/{fileName}" : {
      "get" : {
        "tags" : [ "download" ],
        "summary" : "Download document",
        "description" : "Download a document",
        "operationId" : "getDocument",
        "parameters" : [ {
          "name" : "planId",
          "in" : "path",
          "description" : "ID of the plan to return document",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : 123
        }, {
          "name" : "fileName",
          "in" : "path",
          "description" : "Name of the document",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : 123
        } ],
        "responses" : {
          "200" : {
            "description" : "Document"
          },
          "400" : {
            "description" : "Invalid input"
          },
          "404" : {
            "description" : "Invalid planID or fileName, document not found"
          }
        }
      },
      "head" : {
        "tags" : [ "download" ],
        "summary" : "Show download header",
        "description" : "Download a document",
        "operationId" : "headDocument",
        "parameters" : [ {
          "name" : "planId",
          "in" : "path",
          "description" : "ID of the plan to return document",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : 123
        }, {
          "name" : "fileName",
          "in" : "path",
          "description" : "Name of the document",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "example" : 123
        } ],
        "responses" : {
          "200" : {
            "description" : "Document"
          },
          "400" : {
            "description" : "Invalid input"
          },
          "404" : {
            "description" : "Invalid planID or fileName, document not found"
          }
        }
      }
    },
    "/" : {
      "get" : {
        "summary" : "OpenAPI document",
        "description" : "API documentation",
        "operationId" : "openApi",
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "object"
                }
              }
            }
          },
          "406" : {
            "description" : "Requested format is not available"
          }
        }
      }
    }
  },
  "components" : {
    "schemas" : {
      "ConfigFile" : {
        "type" : "object",
        "properties" : {
          "fileName" : {
            "maxLength" : 100,
            "minLength" : 0,
            "pattern" : "^[A-Za-z0-9.@:%_\\+.~#?&//=\\-]*$",
            "type" : "string"
          },
          "link" : {
            "$ref" : "#/components/schemas/Link"
          }
        }
      },
      "Link" : {
        "required" : [ "href" ],
        "type" : "object",
        "properties" : {
          "href" : {
            "type" : "string",
            "format" : "uri",
            "example" : "https://xplanbox.lat-lon.de/xmanager/api/v1/plan/123"
          },
          "type" : {
            "type" : "string",
            "example" : "application/json"
          },
          "hreflang" : {
            "type" : "string",
            "example" : "en"
          },
          "title" : {
            "type" : "string",
            "example" : "Othmarschen 3, Hamburg"
          },
          "length" : {
            "type" : "integer",
            "format" : "int32"
          },
          "rel" : {
            "type" : "string",
            "example" : "self",
            "enum" : [ "self", "alternate", "planwerkwms", "gml" ]
          }
        },
        "description" : "Link to a resource related to the resource such as XPlanWerkWMS or the resource itself"
      },
      "SystemConfig" : {
        "type" : "object",
        "properties" : {
          "version" : {
            "type" : "string",
            "description" : "Version der xPlanBox",
            "example" : "v3.4.0"
          }
        }
      }
    }
  }
}