Bug 22206: OpenAPI spec
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 28 Jan 2019 10:39:27 +0000 (07:39 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 15 Mar 2019 19:35:30 +0000 (19:35 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

api/v1/swagger/paths.json
api/v1/swagger/paths/holds.json

index 48452ec..3eab013 100644 (file)
@@ -20,6 +20,9 @@
   "/holds/{hold_id}": {
     "$ref": "paths/holds.json#/~1holds~1{hold_id}"
   },
+  "/holds/{hold_id}/suspension": {
+    "$ref": "paths/holds.json#/~1holds~1{hold_id}~1suspension"
+  },
   "/libraries": {
     "$ref": "paths/libraries.json#/~1libraries"
   },
index afeaac4..2dea98c 100644 (file)
         }
       }
     }
+  },
+  "/holds/{hold_id}/suspension": {
+    "post": {
+      "x-mojo-to": "Holds#suspend",
+      "operationId": "suspendHold",
+      "tags": ["holds"],
+      "parameters": [{
+          "$ref": "../parameters.json#/hold_id_pp"
+        }, {
+          "name": "body",
+          "in": "body",
+          "description": "A JSON object containing fields to modify",
+          "required": false,
+          "schema": {
+            "type": "object",
+            "properties": {
+              "expiration_date": {
+                "description": "Date the hold suspension expires",
+                "type": "string",
+                "format": "date"
+              }
+            }
+          }
+        }
+      ],
+      "consumes": ["application/json"],
+      "produces": ["application/json"],
+      "responses": {
+        "201": {
+          "description": "Hold suspended"
+        },
+        "400": {
+          "description": "Missing or wrong parameters",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "401": {
+          "description": "Authentication required",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "403": {
+          "description": "Hold not allowed",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "404": {
+          "description": "Hold not found",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "500": {
+          "description": "Internal server error",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "503": {
+          "description": "Under maintenance",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        }
+      },
+      "x-koha-authorization": {
+        "permissions": {
+          "reserveforothers": "1"
+        }
+      }
+    },
+    "delete": {
+      "x-mojo-to": "Holds#resume",
+      "operationId": "resumeHold",
+      "tags": ["holds"],
+      "parameters": [
+        {
+          "$ref": "../parameters.json#/hold_id_pp"
+        }
+      ],
+      "consumes": ["application/json"],
+      "produces": ["application/json"],
+      "responses": {
+        "204": {
+          "description": "Hold resumed"
+        },
+        "400": {
+          "description": "Missing or wrong parameters",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "401": {
+          "description": "Authentication required",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "403": {
+          "description": "Hold not allowed",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "404": {
+          "description": "Hold not found",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "500": {
+          "description": "Internal server error",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "503": {
+          "description": "Under maintenance",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        }
+      },
+      "x-koha-authorization": {
+        "permissions": {
+          "reserveforothers": "1"
+        }
+      }
+    }
   }
 }