@@ -, +, @@ - Makes 'status' an enum, as we know the list of possible values/codes... - Removes allow-owner and allow-guarantor, as said before, endpoints in - Some numeric values are marked as such - Dates are strings in OpenAPI, but there's a way to specify the format --- api/v1/swagger/definitions/suggestion.json | 18 +++++++++++++--- api/v1/swagger/paths/suggestions.json | 34 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 20 deletions(-) --- a/api/v1/swagger/definitions/suggestion.json +++ a/api/v1/swagger/definitions/suggestion.json @@ -11,6 +11,7 @@ }, "suggested_date": { "type": ["string", "null"], + "format": "date", "description": "the suggestion was submitted" }, "managed_by": { @@ -19,6 +20,7 @@ }, "managed_date": { "type": ["string", "null"], + "format": "date", "description": "date the suggestion was updated" }, "accepted_by": { @@ -27,6 +29,7 @@ }, "accepted_date": { "type": ["string", "null"], + "format": "date", "description": "date the suggestion was marked as accepted" }, "rejected_by": { @@ -35,11 +38,18 @@ }, "rejected_date": { "type": ["string", "null"], + "format": "date", "description": "date the suggestion was marked as rejected" }, "status": { "type": "string", - "description": "suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)" + "description": "Suggestion status", + "enum": [ + "ASKED", + "CHECKED", + "ACCEPTED", + "REJECTED" + ] }, "note": { "type": ["string", "null"], @@ -55,6 +65,7 @@ }, "copyright_date": { "type": ["string", "null"], + "format": "date", "description": "copyright date of the suggested item" }, "publisher_code": { @@ -63,6 +74,7 @@ }, "date_created": { "type": ["string", "null"], + "format": "date", "description": "date created" }, "volume_desc": { @@ -118,10 +130,10 @@ "description": "suggested currency for the suggested price" }, "item_price": { - "type": ["string", "null"], + "type": ["number", "null"], "description": "suggested price" }, - "total": { + "total_price": { "type": ["string", "null"], "description": "suggested total cost (price*quantity updated for currency)" } --- a/api/v1/swagger/paths/suggestions.json +++ a/api/v1/swagger/paths/suggestions.json @@ -6,40 +6,46 @@ "tags": ["patrons", "suggestions"], "parameters": [ { - "name": "suggestionid", + "name": "suggestion_id", "in": "query", "type": "integer", "description": "Internal suggestion identifier" }, { - "name": "suggestedby", + "name": "suggested_by", "in": "query", "type": "integer", "description": "patron_id for the person making the suggestion, foreign key linking to the borrowers table" }, { - "name": "managedby", + "name": "managed_by", "in": "query", "type": "integer", "description": "patron_id for the librarian managing the suggestion, foreign key linking to the borrowers table" }, { - "name": "acceptedby", + "name": "accepted_by", "in": "query", "type": "integer", "description": "patron_id for the librarian who accepted the suggestion, foreign key linking to the borrowers table" }, { - "name": "rejectedby", + "name": "rejected_by", "in": "query", "type": "integer", "description": "patron_id for the librarian who rejected the suggestion, foreign key linking to the borrowers table" }, { - "name": "STATUS", + "name": "status", "in": "query", "type": "string", - "description": "suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)" + "description": "Suggestion status", + "enum": [ + "ASKED", + "CHECKED", + "ACCEPTED", + "REJECTED" + ] }, { "name": "author", @@ -54,19 +60,19 @@ "description": "title of the suggested item" }, { - "name": "publishercode", + "name": "publisher_code", "in": "query", "type": "string", "description": "publisher of the suggested item" }, { - "name": "date", + "name": "date_created", "in": "query", "type": "string", "description": "date created" }, { - "name": "publicationyear", + "name": "publication_year", "in": "query", "type": "string", "description": "year of publication" @@ -84,7 +90,7 @@ "description": "collection name for the suggested item" }, { - "name": "itemtype", + "name": "item_type", "in": "query", "type": "string", "description": "suggested item type" @@ -111,7 +117,6 @@ } }, "x-koha-authorization": { - "allow-owner": true, "permissions": { "acquisition": "1" } @@ -160,7 +165,6 @@ } }, "x-koha-authorization": { - "allow-owner": true, "permissions": { "acquisition": "1" } @@ -200,8 +204,6 @@ } }, "x-koha-authorization": { - "allow-owner": true, - "allow-guarantor": true, "permissions": { "acquisition": "1" } @@ -258,7 +260,6 @@ } }, "x-koha-authorization": { - "allow-owner": true, "permissions": { "acquisition": "1" } @@ -301,7 +302,6 @@ } }, "x-koha-authorization": { - "allow-owner": true, "permissions": { "acquisition": "1" } --