Bug 33145: Fix ERM swagger specs
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Mar 2023 10:02:04 +0000 (10:02 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 6 Mar 2023 12:51:43 +0000 (09:51 -0300)
This patch adds the missing 'Provider name' parameter definition to the
various ERM paths that were missing it.

Test plan
1) Run:
   docker run --rm -v $PWD/api/v1/swagger:/swagger \
          jeanberu/swagger-cli \
          swagger-cli validate swagger/swagger.yaml
=> FAIL: The spec is not valid!
2) Apply this patch
3) Repeat 1
=> SUCCESS: Tests pass!

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tcohen edited the test plan because of the failure to install
swagger-cli cleanly
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
api/v1/swagger/paths/erm_eholdings_packages.yaml
api/v1/swagger/paths/erm_eholdings_titles.yaml
api/v1/swagger/paths/erm_eholdings_titles_resources.yaml

index 604f6bb..51899e3 100644 (file)
     produces:
       - application/json
     parameters:
+      - description: Provider name
+        in: path
+        name: provider
+        required: true
+        type: string
       - description: A JSON object containing information about the new package
         in: body
         name: body
     produces:
       - application/json
     parameters:
+      - description: Provider name
+        in: path
+        name: provider
+        required: true
+        type: string
       - $ref: "../swagger.yaml#/parameters/eholdings_package_id_pp"
       - name: body
         in: body
     produces:
       - application/json
     parameters:
+      - description: Provider name
+        in: path
+        name: provider
+        required: true
+        type: string
       - $ref: "../swagger.yaml#/parameters/eholdings_package_id_pp"
     responses:
       204:
index d09627b..b8a58df 100644 (file)
     produces:
       - application/json
     parameters:
+      - description: Provider name
+        in: path
+        name: provider
+        required: true
+        type: string
       - description: A JSON object containing information about the new title
         in: body
         name: body
     produces:
       - application/json
     parameters:
+      - description: Provider name
+        in: path
+        name: provider
+        required: true
+        type: string
       - $ref: "../swagger.yaml#/parameters/eholdings_title_id_pp"
       - name: body
         in: body
     produces:
       - application/json
     parameters:
+      - description: Provider name
+        in: path
+        name: provider
+        required: true
+        type: string
       - $ref: "../swagger.yaml#/parameters/eholdings_title_id_pp"
     responses:
       204:
     x-koha-authorization:
       permissions:
         erm: 1
-
 /erm/eholdings/local/titles/import:
   post:
     x-mojo-to: ERM::EHoldings::Titles#import_from_list
index 1a871bf..d5ce1e6 100644 (file)
@@ -9,6 +9,11 @@
     produces:
       - application/json
     parameters:
+      - description: Provider name
+        in: path
+        name: provider
+        required: true
+        type: string
       - description: Case insensitive search on resource_id
         in: query
         name: resource_id