From 4db0acc0e7b065d9151d40bd6a429ce304cf3a4b Mon Sep 17 00:00:00 2001
From: Alejandro Celaya <alejandro@alejandrocelaya.com>
Date: Fri, 16 Nov 2018 16:57:18 +0100
Subject: [PATCH] Updated swagger response schemas and added missing response
 examples

---
 docs/swagger/paths/v1_short-urls.json         | 29 +++++++++----------
 docs/swagger/paths/v1_short-urls_shorten.json | 28 +++++++-----------
 2 files changed, 24 insertions(+), 33 deletions(-)

diff --git a/docs/swagger/paths/v1_short-urls.json b/docs/swagger/paths/v1_short-urls.json
index 42cf2c27..b58cd7f1 100644
--- a/docs/swagger/paths/v1_short-urls.json
+++ b/docs/swagger/paths/v1_short-urls.json
@@ -209,23 +209,22 @@
                 "content": {
                     "application/json": {
                         "schema": {
-                            "type": "object",
-                            "properties": {
-                                "longUrl": {
-                                    "type": "string",
-                                    "description": "The original long URL that has been parsed"
-                                },
-                                "shortUrl": {
-                                    "type": "string",
-                                    "description": "The generated short URL"
-                                },
-                                "shortCode": {
-                                    "type": "string",
-                                    "description": "the short code that is being used in the short URL"
-                                }
-                            }
+                            "$ref": "../definitions/ShortUrl.json"
                         }
                     }
+                },
+                "examples": {
+                    "application/json": {
+                        "shortCode": "12C18",
+                        "shortUrl": "https://doma.in/12C18",
+                        "longUrl": "https://store.steampowered.com",
+                        "dateCreated": "2016-08-21T20:34:16+02:00",
+                        "visitsCount": 0,
+                        "tags": [
+                            "games",
+                            "tech"
+                        ]
+                    }
                 }
             },
             "400": {
diff --git a/docs/swagger/paths/v1_short-urls_shorten.json b/docs/swagger/paths/v1_short-urls_shorten.json
index 6c736251..00af215d 100644
--- a/docs/swagger/paths/v1_short-urls_shorten.json
+++ b/docs/swagger/paths/v1_short-urls_shorten.json
@@ -45,21 +45,7 @@
                 "content": {
                     "application/json": {
                         "schema": {
-                            "type": "object",
-                            "properties": {
-                                "longUrl": {
-                                    "type": "string",
-                                    "description": "The original long URL that has been shortened"
-                                },
-                                "shortUrl": {
-                                    "type": "string",
-                                    "description": "The generated short URL"
-                                },
-                                "shortCode": {
-                                    "type": "string",
-                                    "description": "the short code that is being used in the short URL"
-                                }
-                            }
+                            "$ref": "../definitions/ShortUrl.json"
                         }
                     },
                     "text/plain": {
@@ -71,10 +57,16 @@
                 "examples": {
                     "application/json": {
                         "longUrl": "https://github.com/shlinkio/shlink",
-                        "shortUrl": "https://dom.ain/abc123",
-                        "shortCode": "abc123"
+                        "shortUrl": "https://doma.in/abc123",
+                        "shortCode": "abc123",
+                        "dateCreated": "2016-08-21T20:34:16+02:00",
+                        "visitsCount": 0,
+                        "tags": [
+                            "games",
+                            "tech"
+                        ]
                     },
-                    "text/plain": "https://dom.ain/abc123"
+                    "text/plain": "https://doma.in/abc123"
                 }
             },
             "400": {