From caf4fa7fddcc3bc412e8acb2a4219644091ee362 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 8 Jul 2017 12:55:33 +0200 Subject: [PATCH] Documented list tags endpoint --- docs/swagger/paths/v1_tags.json | 53 +++++++++++++++++++++++++++++++++ docs/swagger/swagger.json | 15 +++++++--- 2 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 docs/swagger/paths/v1_tags.json diff --git a/docs/swagger/paths/v1_tags.json b/docs/swagger/paths/v1_tags.json new file mode 100644 index 00000000..6f5be49b --- /dev/null +++ b/docs/swagger/paths/v1_tags.json @@ -0,0 +1,53 @@ +{ + "get": { + "tags": [ + "Tags" + ], + "summary": "List existing tags", + "description": "Returns the list of all tags used in any short URL, ordered by name", + "parameters": [ + { + "$ref": "../parameters/Authorization.json" + } + ], + "responses": { + "200": { + "description": "The list of tags", + "schema": { + "type": "object", + "properties": { + "tags": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "examples": { + "application/json": { + "shortUrls": { + "data": [ + "games", + "php", + "shlink", + "tech" + ] + } + } + } + }, + "500": { + "description": "Unexpected error.", + "schema": { + "$ref": "../definitions/Error.json" + } + } + } + } +} diff --git a/docs/swagger/swagger.json b/docs/swagger/swagger.json index 6e9244f7..b60ab79c 100644 --- a/docs/swagger/swagger.json +++ b/docs/swagger/swagger.json @@ -3,7 +3,7 @@ "info": { "title": "Shlink", "description": "Shlink, the self-hosted URL shortener", - "version": "1.2.0" + "version": "1.0" }, "schemes": [ "http", @@ -22,17 +22,24 @@ "/v1/authenticate": { "$ref": "paths/v1_authenticate.json" }, + "/v1/short-codes": { "$ref": "paths/v1_short-codes.json" }, "/v1/short-codes/{shortCode}": { "$ref": "paths/v1_short-codes_{shortCode}.json" }, - "/v1/short-codes/{shortCode}/visits": { - "$ref": "paths/v1_short-codes_{shortCode}_visits.json" - }, "/v1/short-codes/{shortCode}/tags": { "$ref": "paths/v1_short-codes_{shortCode}_tags.json" + }, + + "/v1/tags": { + "$ref": "paths/v1_tags.json" + }, + + + "/v1/short-codes/{shortCode}/visits": { + "$ref": "paths/v1_short-codes_{shortCode}_visits.json" } } }