From b6080a4c1d97a423387fd6cd04f8248249502f25 Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Fri, 4 May 2018 08:48:57 +0000
Subject: [PATCH] FEAT #7640 new version for schema.json

---
 rest/schema.json | 86 ++++++++++++++++++++++--------------------------
 1 file changed, 39 insertions(+), 47 deletions(-)

diff --git a/rest/schema.json b/rest/schema.json
index 606d890b15c..d704d38c57d 100644
--- a/rest/schema.json
+++ b/rest/schema.json
@@ -9,62 +9,54 @@
             "email" : "info@maarch.org"
         }
     },
+    "basePath" : "/rest",
     "paths" : {
-        "/rest/res/resource/status" : {
+        "/res/resource/status" : {
             "put" :  {
                 "description" : "Update documents status",
                 "operationId" : " Resource/controllers/ResController::updateStatus",
                 "parameters" : [
                     {
-                        "name" : "resId",
-                        "description" : "Documents identifier",
+                        "name" : "body",
                         "in" : "body",
-                        "required" : false,
                         "schema": {
-                            "type" : "array",
-                            "items" : {
-                                "type" : "integer",
-                                "example" : 101
-                            }
-                        }
-                    },
-                    {
-                        "name" : "chrono",
-                        "description" : "Documents chrono number",
-                        "in" : "body",
-                        "required" : false,
-                        "schema": {
-                            "type" : "array",
-                            "items" : {
-                                "type" : "string",
-                                "maxLength" : 255,
-                                "example" : "MAARCH/2017A/91"
+                            "type": "object",
+                            "properties": {
+                                "resId": {
+                                    "type": "array",
+                                    "description" : "Documents identifier",
+                                    "items": {
+                                        "type": "integer",
+                                        "minimum": 1,
+                                        "example" : 101
+                                    }
+                                },
+                                "chrono": {
+                                    "type": "array",
+                                    "description" : "Documents chrono number",
+                                    "items": {
+                                        "type": "string",
+                                        "maxLength": 255,
+                                        "example" : "MAARCH/2017A/91"
+                                    }
+                                },
+                                "status": {
+                                    "type": "string",
+                                    "description" : "New status",
+                                    "maxLength": 10,
+                                    "default": "COU",
+                                    "example" : "NEW"
+                        
+                                },
+                                "historyMessage": {
+                                    "type": "string",
+                                    "description" : "Message in history table",
+                                    "default": "status update",
+                                    "example" : "Document is reopen"
+                                }
                             }
                         }
-                    },
-                    {
-                        "name" : "status",
-                        "description" : "New status",
-                        "in" : "body",
-                        "required" : false,
-                        "schema": {
-                            "type" : "string",
-                            "maxLength" : 10,
-                            "default" : "COU",
-                            "example" : "NEW"
-                        }
-                    },
-                    {
-                        "name" : "historyMessage",
-                        "description" : "Message in history table",
-                        "in" : "body",
-                        "required" : false,
-                        "schema": {
-                            "type" : "string",
-                            "default" : "status update",
-                            "example" : "Document is reopen"
-                        }
-                    }  
+                    } 
                 ],
                 "responses" : {
                     "200" : {
@@ -118,7 +110,7 @@
                 }
             } 
         },
-        "/rest/entities/{id}" : {
+        "/entities/{id}" : {
             "get" : {
                 "description" : "Get entity informations",
                 "operationId" : "Entity/controllers/EntityController::getById",
-- 
GitLab