From 8555c8a0f941b85a6e8122f7373c0074b5dbc134 Mon Sep 17 00:00:00 2001
From: Stefan Haun <tux@netz39.de>
Date: Thu, 5 Nov 2020 20:55:22 +0100
Subject: [PATCH] Add endpoint for validation

---
 OAS3.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/OAS3.yml b/OAS3.yml
index 16c65a6..85e9891 100644
--- a/OAS3.yml
+++ b/OAS3.yml
@@ -200,6 +200,36 @@ paths:
         '404':
           $ref: '#/components/responses/NotFound'
 
+  /validate:
+    parameters:
+      - in: header
+        name: Authentication
+        schema:
+          type: string
+        description: Authentication token
+    post:
+      summary: Validate an entity
+      tags:
+        - entities
+      requestBody:
+        content:
+          application/json:
+            schema:
+              type: object
+              description: Entity JSON
+      responses:
+        '200':
+          description: Validation result
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/validation'
+        '400':
+          $ref: '#/components/responses/InvalidInput'
+        '401':
+          $ref: '#/components/responses/AuthenticationRequired'
+        '403':
+          $ref: '#/components/responses/NotAllowed'
 components:
   schemas:
     health:
@@ -215,6 +245,20 @@ components:
         uptime:
           type: string
           example: ISO8601 conforming timespan
+    validation:
+      type: object
+      properties:
+        valid:
+          type: boolean
+        findings:
+          type: array
+          items:
+            type: object
+            properties:
+              field:
+                type: string
+              message:
+                type: string
   responses:
     AuthenticationRequired:
       description: Authentication is required (401)