{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "XPlanValidatorAPI",
    "description" : "XPlanValidator REST API",
    "termsOfService" : "",
    "contact" : {
      "email" : ""
    },
    "license" : {
      "name" : "Apache 2.0",
      "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version" : "1.7.0"
  },
  "servers" : [ {
    "url" : "/xplan-validator-api/xvalidator/api/v1"
  } ],
  "security" : [ {
    "Bearer" : [ ]
  } ],
  "tags" : [ {
    "name" : "validate",
    "description" : "Validate XPlanGML documents",
    "externalDocs" : {
      "description" : "xPlanBox",
      "url" : ""
    }
  } ],
  "paths" : {
    "/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"
          }
        },
        "deprecated" : true
      }
    },
    "/validate" : {
      "post" : {
        "tags" : [ "validate" ],
        "summary" : "Validate XPlanGML or XPlanArchive",
        "description" : "Validates XPlanGML or XPlanArchive file",
        "operationId" : "validate",
        "parameters" : [ {
          "name" : "X-Filename",
          "in" : "header",
          "description" : "Name of the file to be uploaded",
          "schema" : {
            "pattern" : "^[A-Za-z0-9.()_\\-]*$",
            "type" : "string"
          },
          "example" : "File names such as xplan.gml, xplan.xml, xplan.zip"
        }, {
          "name" : "name",
          "in" : "query",
          "description" : "Name of the validation",
          "schema" : {
            "pattern" : "^[A-Za-z0-9.()_\\-]*$",
            "type" : "string"
          },
          "example" : "xplan-1Pruefbericht_Torstrasse_10_report-4223"
        }, {
          "name" : "skipSemantisch",
          "in" : "query",
          "description" : "skip semantische Validierung",
          "schema" : {
            "type" : "boolean",
            "default" : false
          }
        }, {
          "name" : "skipGeometrisch",
          "in" : "query",
          "description" : "skip geometrische Validierung",
          "schema" : {
            "type" : "boolean",
            "default" : false
          }
        }, {
          "name" : "skipFlaechenschluss",
          "in" : "query",
          "description" : "skip Flaechenschluss Ueberpruefung",
          "schema" : {
            "type" : "boolean",
            "default" : false
          }
        }, {
          "name" : "skipGeltungsbereich",
          "in" : "query",
          "description" : "skip Geltungsbereich Ueberpruefung",
          "schema" : {
            "type" : "boolean",
            "default" : false
          }
        }, {
          "name" : "skipLaufrichtung",
          "in" : "query",
          "description" : "skip Laufrichtung Ueberpruefung",
          "schema" : {
            "type" : "boolean",
            "default" : false
          }
        }, {
          "name" : "profiles",
          "in" : "query",
          "description" : "Names of profiles which shall be additionaly used for validation",
          "explode" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/octet-stream" : {
              "schema" : {
                "type" : "string",
                "description" : "XPlanGML or XPlanArchive (application/zip) file to upload",
                "format" : "binary"
              }
            },
            "application/zip" : {
              "schema" : {
                "type" : "string",
                "description" : "XPlanGML or XPlanArchive (application/zip) file to upload",
                "format" : "binary"
              }
            },
            "application/x-zip" : {
              "schema" : {
                "type" : "string",
                "description" : "XPlanGML or XPlanArchive (application/zip) file to upload",
                "format" : "binary"
              }
            },
            "application/x-zip-compressed" : {
              "schema" : {
                "type" : "string",
                "description" : "XPlanGML or XPlanArchive (application/zip) file to upload",
                "format" : "binary"
              }
            },
            "text/xml" : {
              "schema" : {
                "type" : "string",
                "description" : "XPlanGML to upload",
                "format" : "binary"
              }
            },
            "application/gml+xml" : {
              "schema" : {
                "type" : "string",
                "description" : "XPlanGML to upload",
                "format" : "binary"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "ValidationReport",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ValidationReport"
                }
              },
              "application/xml" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ValidationReport"
                }
              },
              "text/xml" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ValidationReport"
                }
              },
              "application/pdf" : {
                "schema" : {
                  "type" : "string",
                  "format" : "binary"
                }
              },
              "application/zip" : {
                "schema" : {
                  "type" : "object",
                  "format" : "binary"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid input"
          },
          "406" : {
            "description" : "Requested format is not available"
          },
          "415" : {
            "description" : "Unsupported media type or content - only xml/gml, zip are accepted; all zip files entries must also match the supported content types for XPlanArchives"
          },
          "422" : {
            "description" : "Invalid content - the content of the XPlanGML file must conform to the specification of xPlanBox XPlanGML files"
          }
        },
        "deprecated" : true
      }
    },
    "/" : {
      "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" : {
      "RulesMetadata" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "string",
            "example" : "profil1"
          },
          "name" : {
            "type" : "string",
            "example" : "GemeindeMusterdorf"
          },
          "description" : {
            "type" : "string",
            "example" : "Beschreibung des Profils der Gemeinde Musterdorf"
          },
          "version" : {
            "type" : "string",
            "example" : "0.9.14"
          },
          "source" : {
            "type" : "string",
            "example" : "https://bitbucket.org/geowerkstatt-hamburg/xplanung/get/v0.9.14.zip"
          }
        }
      },
      "SystemConfig" : {
        "type" : "object",
        "properties" : {
          "skipRasterEvaluation" : {
            "type" : "boolean"
          },
          "version" : {
            "type" : "string",
            "description" : "Version der xPlanBox",
            "example" : "v3.4.0"
          },
          "rulesMetadata" : {
            "$ref" : "#/components/schemas/RulesMetadata"
          },
          "profiles" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/RulesMetadata"
            }
          },
          "supportedXPlanGmlVersions" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "example" : "XPLAN_51",
              "enum" : [ "XPLAN_40", "XPLAN_41", "XPLAN_50", "XPLAN_51", "XPLAN_52", "XPLAN_53", "XPLAN_54", "XPLAN_60", "XPLAN_61" ]
            }
          }
        }
      },
      "DocumentSummary" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string",
            "example" : "Othmarschen3"
          },
          "type" : {
            "type" : "string",
            "example" : "BP_Plan"
          }
        }
      },
      "ExternalReferenceResult" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string",
            "example" : "stelling.png"
          },
          "status" : {
            "type" : "string",
            "example" : "AVAILABLE",
            "enum" : [ "AVAILABLE", "MISSING", "UNCHECKED", "UNREFERENCED" ]
          }
        },
        "description" : "since v1.1.0, replaces externalReferences"
      },
      "PlanInfoBbox" : {
        "type" : "object",
        "properties" : {
          "minX" : {
            "type" : "number",
            "format" : "double",
            "example" : 9.880772
          },
          "minY" : {
            "type" : "number",
            "format" : "double",
            "example" : 53.544973
          },
          "maxX" : {
            "type" : "number",
            "format" : "double",
            "example" : 9.890302
          },
          "maxY" : {
            "type" : "number",
            "format" : "double",
            "example" : 53.546704
          },
          "crs" : {
            "type" : "string",
            "example" : "epsg:4326"
          }
        }
      },
      "RasterEvaluationResult" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string",
            "example" : "stelling.png"
          },
          "crsStatus" : {
            "type" : "string",
            "example" : "SUPPORTED",
            "enum" : [ "SUPPORTED", "UNSUPPORTED", "INVALID", "MISSING" ]
          },
          "imageFormatStatus" : {
            "type" : "string",
            "example" : "SUPPORTED",
            "enum" : [ "SUPPORTED", "UNSUPPORTED", "MISSING" ]
          }
        }
      },
      "SemanticInvalidRuleResult" : {
        "type" : "object",
        "properties" : {
          "message" : {
            "type" : "string"
          },
          "invalidGmlIds" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "description" : "GML-Id",
              "example" : "GML_b4e47d29-d21c-42ab-85b7-b12ea57e89f2"
            }
          }
        }
      },
      "ValidationReport" : {
        "type" : "object",
        "properties" : {
          "documentSummary" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/DocumentSummary"
            }
          },
          "rasterEvaluationResults" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/RasterEvaluationResult"
            }
          },
          "version" : {
            "type" : "string",
            "example" : "XPLAN_51",
            "enum" : [ "XPLAN_40", "XPLAN_41", "XPLAN_50", "XPLAN_51", "XPLAN_52", "XPLAN_53", "XPLAN_54", "XPLAN_60", "XPLAN_61" ]
          },
          "filename" : {
            "type" : "string",
            "example" : "xplan52-test.gml"
          },
          "name" : {
            "type" : "string",
            "example" : "xplan52-test"
          },
          "bbox" : {
            "$ref" : "#/components/schemas/PlanInfoBbox"
          },
          "date" : {
            "type" : "string",
            "format" : "date-time",
            "example" : "2020-08-24T15:06:36.662Z"
          },
          "valid" : {
            "type" : "boolean",
            "example" : false
          },
          "status" : {
            "type" : "string",
            "example" : "Die Validierung wurde ausgeführt."
          },
          "externalReferences" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "description" : "deprecated as of v1.1.0, replaced by externalReferencesResult",
              "example" : "stelling.png",
              "deprecated" : true
            }
          },
          "externalReferencesResult" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/ExternalReferenceResult"
            }
          },
          "wmsUrl" : {
            "type" : "string",
            "description" : "deprecated: XPlanValidatorWMS will be removed in a future version",
            "format" : "uri",
            "example" : "https://xplanbox.lat-lon.de/xplan-validator-wms/services/wms?PLANWERK_MANAGERID=13",
            "deprecated" : true
          },
          "rulesMetadata" : {
            "$ref" : "#/components/schemas/RulesMetadata"
          },
          "validationResult" : {
            "$ref" : "#/components/schemas/ValidationReportValidationResult"
          }
        }
      },
      "ValidationReportValidationResult" : {
        "type" : "object",
        "properties" : {
          "semantisch" : {
            "$ref" : "#/components/schemas/ValidationReportValidationResultSemantisch"
          },
          "geometrisch" : {
            "$ref" : "#/components/schemas/ValidationReportValidationResultGeometrisch"
          },
          "syntaktisch" : {
            "$ref" : "#/components/schemas/ValidationReportValidationResultSyntaktisch"
          },
          "profile" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/ValidationReportValidationResultSemantischProfil"
            }
          }
        }
      },
      "ValidationReportValidationResultGeometrisch" : {
        "type" : "object",
        "properties" : {
          "valid" : {
            "type" : "boolean",
            "example" : false
          },
          "errors" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          },
          "warnings" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        }
      },
      "ValidationReportValidationResultSemantisch" : {
        "type" : "object",
        "properties" : {
          "valid" : {
            "type" : "boolean",
            "example" : false
          },
          "rules" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/ValidationReportValidationResultSemantischRules"
            }
          }
        }
      },
      "ValidationReportValidationResultSemantischProfil" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string",
            "example" : "GemeindeMusterdorf"
          },
          "description" : {
            "type" : "string",
            "example" : "Beschreibung des Profils der Gemeinde Musterdorf"
          },
          "ergebnis" : {
            "$ref" : "#/components/schemas/ValidationReportValidationResultSemantisch"
          }
        }
      },
      "ValidationReportValidationResultSemantischRules" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string"
          },
          "isValid" : {
            "type" : "boolean"
          },
          "message" : {
            "type" : "string"
          },
          "recommendedFeatures" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/SemanticInvalidRuleResult"
            }
          },
          "warnedFeatures" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/SemanticInvalidRuleResult"
            }
          },
          "erroredFeatures" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/SemanticInvalidRuleResult"
            }
          }
        }
      },
      "ValidationReportValidationResultSyntaktisch" : {
        "type" : "object",
        "properties" : {
          "valid" : {
            "type" : "boolean",
            "example" : false
          },
          "messages" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        }
      }
    },
    "securitySchemes" : {
      "Bearer" : {
        "type" : "http",
        "scheme" : "bearer",
        "bearerFormat" : "JWT"
      }
    }
  }
}