{
  "openapi": "3.0.0",
  "info": {
    "version": "2.0.3",
    "title": "Regels verifieren service",
    "description": "Service voor het verifieren van STTR bestanden. De aangeboden STTR inhoud wordt gecontroleerd op XSD, DMN en Schematron. Voor het gebruik van de service is een x-api-key nodig.",
    "contact": {
      "name": "Ontwikkelaarsportaal Omgevingswet",
      "url": "https://developer.omgevingswet.overheid.nl/services/contact/"
    }
  },
  "paths": {
    "/": {
      "get": {
        "summary": "OpenApi Specification",
        "tags": [
          "Meta"
        ],
        "responses": {
          "200": {
            "description": "OpenApi Specification Json",
            "content": {
              "application/json": {
                "schema": {
                  "example": "{\"openapi\": \"3.0.0\", ... }"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "health info",
        "tags": [
          "Meta"
        ],
        "responses": {
          "200": {
            "description": "Health",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "UP"
                      ]
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Health",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "DOWN",
                        "OUT_OF_SERVICE"
                      ]
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/info": {
      "get": {
        "summary": "applicatie info",
        "tags": [
          "Meta"
        ],
        "responses": {
          "200": {
            "description": "Info",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Info",
                  "required": [
                    "app"
                  ],
                  "properties": {
                    "app": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        },
                        "version2": {
                          "type": "string"
                        },
                        "buildtime": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/verifieren": {
      "post": {
        "summary": "Verifieren STTR file",
        "tags": [
          "Verificatie"
        ],
        "description": "Verifieert een STTR bestand. Als de verificatie niet succesvol is wordt een lijst met verificatie fouten geretourneerd.",
        "parameters": [
          {
            "$ref": "#/components/parameters/sttrType"
          },
          {
            "$ref": "#/components/parameters/x_api_key"
          }
        ],
        "responses": {
          "200": {
            "description": "Verifieren Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/verifierenResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "requestBody": {
          "content": {
            "application/xml": {
              "schema": {
                "type": "string"
              }
            }
          },
          "description": "Inhoud van het te verifieren STTR bestand",
          "required": true
        }
      }
    }
  },
  "components": {
    "parameters": {
      "x_api_key": {
        "name": "x-api-key",
        "in": "header",
        "description": "De api-key ter authenticatie, verkrijgbaar via het ontwikkelaarsportaal",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "sttrType": {
        "name": "sttrType",
        "description": "De regels worden geverifieerd op basis van het STTR type. Als er geen STTR type is meegegeven, dan wordt de standaardwaarde (\"toepasbareRegels\") gebruikt.",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "toepasbareRegels",
            "toepasbareRegelsAansluitpunt",
            "toepasbareRegelsStandaardAansluiting",
            "toepasbareRegelsLokaleAansluiting"
          ]
        },
        "required": false
      }
    },
    "responses": {
      "400": {
        "description": "Fouten (missing parameter; niet bestaande parameter; invalide waarde voor parameter)",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "required": [
                    "type",
                    "title",
                    "status"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Het type fout dat opgetreden is. Bijvoorbeeld VALIDATIE_FOUT of ONVERWACHTE_FOUT."
                    },
                    "title": {
                      "type": "string",
                      "description": "Informatie over de opgetreden fout."
                    },
                    "status": {
                      "type": "integer",
                      "format": "int64",
                      "description": "De statuscode van de fout (= 400) overeenkomend met de http-status code van de response."
                    },
                    "detail": {
                      "type": "string",
                      "description": "Meer detail informatie over de opgetreden fout"
                    },
                    "instance": {
                      "type": "string",
                      "description": "Het unieke instance id van het request dat resulteerde in de foutmelding."
                    }
                  }
                },
                {
                  "properties": {
                    "invalid-params": {
                      "type": "array",
                      "items": {
                        "required": [
                          "type",
                          "name",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "Een type van de fout, bijvoorbeeld 'Validatie melding'"
                          },
                          "name": {
                            "type": "string",
                            "description": "'Naam van de parameter die een fout bevat, bijvoorbeeld: activiteitFunctioneleStructuurRef'"
                          },
                          "reason": {
                            "type": "string",
                            "description": "Bijvoorbeeld 'de activiteitFunctioneleStructuurRef mag geen speciale karakters bevatten.'"
                          }
                        }
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "500": {
        "description": "Er is een onverwachte technische fout opgetreden",
        "content": {
          "application/json": {
            "schema": {
              "required": [
                "type",
                "title",
                "status"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Het type fout dat opgetreden is. Bijvoorbeeld VALIDATIE_FOUT of ONVERWACHTE_FOUT."
                },
                "title": {
                  "type": "string",
                  "description": "Informatie over de opgetreden fout."
                },
                "status": {
                  "type": "integer",
                  "format": "int64",
                  "description": "De statuscode (= 500) van de fout overeenkomend met de http-status code van de response."
                },
                "detail": {
                  "type": "string",
                  "description": "Meer detail informatie over de opgetreden fout"
                },
                "instance": {
                  "type": "string",
                  "description": "Het unieke instance id van het request dat resulteerde in de foutmelding."
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "verifierenResponse": {
        "properties": {
          "responseCode": {
            "type": "string",
            "description": "Verificatie response code"
          },
          "responseMessage": {
            "type": "string",
            "description": "Verificatie response message"
          },
          "validationMessages": {
            "type": "array",
            "description": "Verificatie error messages",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "x-wso2-cors": {
    "accessControlAllowOrigins": [
      "*"
    ],
    "corsConfigurationEnabled": true,
    "accessControlAllowCredentials": false,
    "accessControlAllowMethods": [
      "GET",
      "PUT",
      "POST",
      "DELETE",
      "PATCH",
      "OPTIONS"
    ],
    "accessControlAllowHeaders": [
      "authorization",
      "Access-Control-Allow-Origin",
      "Content-Type",
      "SOAPAction"
    ]
  }
}

