From 209ff7f5093144abfcedca60c3915332ce857928 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Fri, 10 Jun 2016 16:52:54 +0300 Subject: [PATCH] Bug 16699: Add borrowernumberQueryParam for reusability The borrowernumber as a query parameter should be defined in parameters.json in order to allow its reusability. To test: 1. Apply patch 2. Run minifySwagger.pl 3. Validate swagger.min.json in online.swagger.io/validator/debug?url=url_to+ _your_swagger_min_json or your local swagger-api/validator-badge validator 4. Observe that validation passes --- api/v1/parameters.json | 3 +++ api/v1/parameters/patron.json | 7 +++++++ api/v1/paths/holds.json | 6 +----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api/v1/parameters.json b/api/v1/parameters.json index 9778ac7..b20e19f 100644 --- a/api/v1/parameters.json +++ b/api/v1/parameters.json @@ -2,6 +2,9 @@ "borrowernumberPathParam": { "$ref": "parameters/patron.json#/borrowernumberPathParam" }, + "borrowernumberQueryParam": { + "$ref": "parameters/patron.json#/borrowernumberQueryParam" + }, "holdIdPathParam": { "$ref": "parameters/hold.json#/holdIdPathParam" } diff --git a/api/v1/parameters/patron.json b/api/v1/parameters/patron.json index 285ee04..2b204c1 100644 --- a/api/v1/parameters/patron.json +++ b/api/v1/parameters/patron.json @@ -5,5 +5,12 @@ "description": "Internal patron identifier", "required": true, "type": "integer" + }, + "borrowernumberQueryParam": { + "name": "borrowernumber", + "in": "query", + "description": "Internal borrower identifier", + "required": true, + "type": "integer" } } diff --git a/api/v1/paths/holds.json b/api/v1/paths/holds.json index 06c9af5..770565a 100644 --- a/api/v1/paths/holds.json +++ b/api/v1/paths/holds.json @@ -4,11 +4,7 @@ "operationId": "listHolds", "tags": ["borrowers", "holds"], "parameters": [{ - "name": "borrowernumber", - "in": "query", - "description": "Internal borrower identifier", - "required": true, - "type": "integer" + "$ref": "../parameters.json#/borrowernumberQueryParam" } ], "produces": ["application/json"], -- 1.9.1