Bug 23667: Add spec
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 23 Sep 2019 15:48:02 +0000 (12:48 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 29 Oct 2019 12:20:35 +0000 (12:20 +0000)
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

api/v1/swagger/paths.json
api/v1/swagger/paths/items.json

index d705760..e786775 100644 (file)
   "/holds/{hold_id}/suspension": {
     "$ref": "paths/holds.json#/~1holds~1{hold_id}~1suspension"
   },
+  "/items": {
+    "$ref": "paths/items.json#/~1items"
+  },
+  "/items/{item_id}": {
+    "$ref": "paths/items.json#/~1items~1{item_id}"
+  },
   "/libraries": {
     "$ref": "paths/libraries.json#/~1libraries"
   },
@@ -53,9 +59,6 @@
   "/checkouts/{checkout_id}/allows_renewal": {
     "$ref": "paths/checkouts.json#/~1checkouts~1{checkout_id}~1allows_renewal"
   },
-  "/items/{item_id}": {
-    "$ref": "paths/items.json#/~1items~1{item_id}"
-  },
   "/patrons": {
     "$ref": "paths/patrons.json#/~1patrons"
   },
index 28e136d..86197ea 100644 (file)
@@ -1,4 +1,80 @@
 {
+  "/items": {
+    "get": {
+      "x-mojo-to": "Items#list",
+      "operationId": "listItems",
+      "tags": [
+        "items"
+      ],
+      "parameters": [
+        {
+          "name": "external_id",
+          "in": "query",
+          "description": "Search on the item's barcode",
+          "required": false,
+          "type": "string"
+        },
+        {
+          "$ref": "../parameters.json#/match"
+        },
+        {
+          "$ref": "../parameters.json#/order_by"
+        },
+        {
+          "$ref": "../parameters.json#/page"
+        },
+        {
+          "$ref": "../parameters.json#/per_page"
+        }
+      ],
+      "consumes": [
+        "application/json"
+      ],
+      "produces": [
+        "application/json"
+      ],
+      "responses": {
+        "200": {
+          "description": "A list of item",
+          "schema": {
+            "type": "array",
+            "items": {
+              "$ref": "../definitions.json#/item"
+            }
+          }
+        },
+        "401": {
+          "description": "Authentication required",
+          "schema": {
+            "$ref": "../definitions.json#/error"
+          }
+        },
+        "403": {
+          "description": "Access forbidden",
+          "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": {
+          "catalogue": "1"
+        }
+      }
+    }
+  },
   "/items/{item_id}": {
     "get": {
       "x-mojo-to": "Items#get",