From 1f5faee3564cfb7ded2b1aa1150083c8e7005379 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 20 Sep 2018 19:55:24 +0200 Subject: [PATCH 1/6] Renamed rest actions to use the short-url concept instead of the short-code concept --- module/Rest/config/auth.config.php | 2 +- module/Rest/config/dependencies.config.php | 28 +++++++++---------- module/Rest/config/routes.config.php | 14 +++++----- .../AbstractCreateShortUrlAction.php} | 4 +-- .../CreateShortUrlAction.php} | 5 ++-- .../DeleteShortUrlAction.php} | 4 +-- .../EditShortUrlAction.php} | 4 +-- .../EditShortUrlTagsAction.php} | 4 +-- .../ListShortUrlsAction.php} | 4 +-- .../ResolveShortUrlAction.php} | 4 +-- .../SingleStepCreateShortUrlAction.php} | 5 ++-- .../CreateShortUrlActionTest.php} | 10 +++---- .../DeleteShortUrlActionTest.php} | 10 +++---- .../EditShortUrlActionTest.php} | 10 +++---- .../EditShortUrlTagsActionTest.php} | 10 +++---- .../ListShortUrlsActionTest.php} | 10 +++---- .../ResolveShortUrlActionTest.php} | 10 +++---- .../SingleStepCreateShortUrlActionTest.php} | 10 +++---- 18 files changed, 75 insertions(+), 73 deletions(-) rename module/Rest/src/Action/{ShortCode/AbstractCreateShortCodeAction.php => ShortUrl/AbstractCreateShortUrlAction.php} (97%) rename module/Rest/src/Action/{ShortCode/CreateShortCodeAction.php => ShortUrl/CreateShortUrlAction.php} (89%) rename module/Rest/src/Action/{ShortCode/DeleteShortCodeAction.php => ShortUrl/DeleteShortUrlAction.php} (96%) rename module/Rest/src/Action/{ShortCode/EditShortCodeAction.php => ShortUrl/EditShortUrlAction.php} (96%) rename module/Rest/src/Action/{ShortCode/EditShortCodeTagsAction.php => ShortUrl/EditShortUrlTagsAction.php} (95%) rename module/Rest/src/Action/{ShortCode/ListShortCodesAction.php => ShortUrl/ListShortUrlsAction.php} (96%) rename module/Rest/src/Action/{ShortCode/ResolveUrlAction.php => ShortUrl/ResolveShortUrlAction.php} (96%) rename module/Rest/src/Action/{ShortCode/SingleStepCreateShortCodeAction.php => ShortUrl/SingleStepCreateShortUrlAction.php} (90%) rename module/Rest/test/Action/{ShortCode/CreateShortCodeActionTest.php => ShortUrl/CreateShortUrlActionTest.php} (92%) rename module/Rest/test/Action/{ShortCode/DeleteShortCodeActionTest.php => ShortUrl/DeleteShortUrlActionTest.php} (86%) rename module/Rest/test/Action/{ShortCode/EditShortCodeActionTest.php => ShortUrl/EditShortUrlActionTest.php} (90%) rename module/Rest/test/Action/{ShortCode/EditShortCodeTagsActionTest.php => ShortUrl/EditShortUrlTagsActionTest.php} (86%) rename module/Rest/test/Action/{ShortCode/ListShortCodesActionTest.php => ShortUrl/ListShortUrlsActionTest.php} (84%) rename module/Rest/test/Action/{ShortCode/ResolveUrlActionTest.php => ShortUrl/ResolveShortUrlActionTest.php} (91%) rename module/Rest/test/Action/{ShortCode/SingleStepCreateShortCodeActionTest.php => ShortUrl/SingleStepCreateShortUrlActionTest.php} (92%) diff --git a/module/Rest/config/auth.config.php b/module/Rest/config/auth.config.php index b43c333f..c60cc358 100644 --- a/module/Rest/config/auth.config.php +++ b/module/Rest/config/auth.config.php @@ -8,7 +8,7 @@ return [ 'auth' => [ 'routes_whitelist' => [ Action\AuthenticateAction::class, - Action\ShortCode\SingleStepCreateShortCodeAction::class, + Action\ShortUrl\SingleStepCreateShortUrlAction::class, ], ], diff --git a/module/Rest/config/dependencies.config.php b/module/Rest/config/dependencies.config.php index ae500a22..8b8a4f02 100644 --- a/module/Rest/config/dependencies.config.php +++ b/module/Rest/config/dependencies.config.php @@ -20,14 +20,14 @@ return [ ApiKeyService::class => ConfigAbstractFactory::class, Action\AuthenticateAction::class => ConfigAbstractFactory::class, - Action\ShortCode\CreateShortCodeAction::class => ConfigAbstractFactory::class, - Action\ShortCode\SingleStepCreateShortCodeAction::class => ConfigAbstractFactory::class, - Action\ShortCode\EditShortCodeAction::class => ConfigAbstractFactory::class, - Action\ShortCode\DeleteShortCodeAction::class => ConfigAbstractFactory::class, - Action\ShortCode\ResolveUrlAction::class => ConfigAbstractFactory::class, + Action\ShortUrl\CreateShortUrlAction::class => ConfigAbstractFactory::class, + Action\ShortUrl\SingleStepCreateShortUrlAction::class => ConfigAbstractFactory::class, + Action\ShortUrl\EditShortUrlAction::class => ConfigAbstractFactory::class, + Action\ShortUrl\DeleteShortUrlAction::class => ConfigAbstractFactory::class, + Action\ShortUrl\ResolveShortUrlAction::class => ConfigAbstractFactory::class, Action\Visit\GetVisitsAction::class => ConfigAbstractFactory::class, - Action\ShortCode\ListShortCodesAction::class => ConfigAbstractFactory::class, - Action\ShortCode\EditShortCodeTagsAction::class => ConfigAbstractFactory::class, + Action\ShortUrl\ListShortUrlsAction::class => ConfigAbstractFactory::class, + Action\ShortUrl\EditShortUrlTagsAction::class => ConfigAbstractFactory::class, Action\Tag\ListTagsAction::class => ConfigAbstractFactory::class, Action\Tag\DeleteTagsAction::class => ConfigAbstractFactory::class, Action\Tag\CreateTagsAction::class => ConfigAbstractFactory::class, @@ -46,38 +46,38 @@ return [ ApiKeyService::class => ['em'], Action\AuthenticateAction::class => [ApiKeyService::class, JWTService::class, 'translator', 'Logger_Shlink'], - Action\ShortCode\CreateShortCodeAction::class => [ + Action\ShortUrl\CreateShortUrlAction::class => [ Service\UrlShortener::class, 'translator', 'config.url_shortener.domain', 'Logger_Shlink', ], - Action\ShortCode\SingleStepCreateShortCodeAction::class => [ + Action\ShortUrl\SingleStepCreateShortUrlAction::class => [ Service\UrlShortener::class, 'translator', ApiKeyService::class, 'config.url_shortener.domain', 'Logger_Shlink', ], - Action\ShortCode\EditShortCodeAction::class => [Service\ShortUrlService::class, 'translator', 'Logger_Shlink'], - Action\ShortCode\DeleteShortCodeAction::class => [ + Action\ShortUrl\EditShortUrlAction::class => [Service\ShortUrlService::class, 'translator', 'Logger_Shlink'], + Action\ShortUrl\DeleteShortUrlAction::class => [ Service\ShortUrl\DeleteShortUrlService::class, 'translator', 'Logger_Shlink', ], - Action\ShortCode\ResolveUrlAction::class => [ + Action\ShortUrl\ResolveShortUrlAction::class => [ Service\UrlShortener::class, 'translator', 'config.url_shortener.domain', ], Action\Visit\GetVisitsAction::class => [Service\VisitsTracker::class, 'translator', 'Logger_Shlink'], - Action\ShortCode\ListShortCodesAction::class => [ + Action\ShortUrl\ListShortUrlsAction::class => [ Service\ShortUrlService::class, 'translator', 'config.url_shortener.domain', 'Logger_Shlink', ], - Action\ShortCode\EditShortCodeTagsAction::class => [ + Action\ShortUrl\EditShortUrlTagsAction::class => [ Service\ShortUrlService::class, 'translator', 'Logger_Shlink', diff --git a/module/Rest/config/routes.config.php b/module/Rest/config/routes.config.php index 7058ad59..b1ab3d78 100644 --- a/module/Rest/config/routes.config.php +++ b/module/Rest/config/routes.config.php @@ -11,17 +11,17 @@ return [ Action\AuthenticateAction::getRouteDef(), // Short codes - Action\ShortCode\CreateShortCodeAction::getRouteDef([ + Action\ShortUrl\CreateShortUrlAction::getRouteDef([ Middleware\ShortCode\CreateShortCodeContentNegotiationMiddleware::class, ]), - Action\ShortCode\SingleStepCreateShortCodeAction::getRouteDef([ + Action\ShortUrl\SingleStepCreateShortUrlAction::getRouteDef([ Middleware\ShortCode\CreateShortCodeContentNegotiationMiddleware::class, ]), - Action\ShortCode\EditShortCodeAction::getRouteDef(), - Action\ShortCode\DeleteShortCodeAction::getRouteDef(), - Action\ShortCode\ResolveUrlAction::getRouteDef(), - Action\ShortCode\ListShortCodesAction::getRouteDef(), - Action\ShortCode\EditShortCodeTagsAction::getRouteDef(), + Action\ShortUrl\EditShortUrlAction::getRouteDef(), + Action\ShortUrl\DeleteShortUrlAction::getRouteDef(), + Action\ShortUrl\ResolveShortUrlAction::getRouteDef(), + Action\ShortUrl\ListShortUrlsAction::getRouteDef(), + Action\ShortUrl\EditShortUrlTagsAction::getRouteDef(), // Visits Action\Visit\GetVisitsAction::getRouteDef(), diff --git a/module/Rest/src/Action/ShortCode/AbstractCreateShortCodeAction.php b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php similarity index 97% rename from module/Rest/src/Action/ShortCode/AbstractCreateShortCodeAction.php rename to module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php index 833f49c6..fbf1817a 100644 --- a/module/Rest/src/Action/ShortCode/AbstractCreateShortCodeAction.php +++ b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php @@ -1,7 +1,7 @@ urlShortener = $this->prophesize(UrlShortener::class); - $this->action = new CreateShortCodeAction($this->urlShortener->reveal(), Translator::factory([]), [ + $this->action = new CreateShortUrlAction($this->urlShortener->reveal(), Translator::factory([]), [ 'schema' => 'http', 'hostname' => 'foo.com', ]); diff --git a/module/Rest/test/Action/ShortCode/DeleteShortCodeActionTest.php b/module/Rest/test/Action/ShortUrl/DeleteShortUrlActionTest.php similarity index 86% rename from module/Rest/test/Action/ShortCode/DeleteShortCodeActionTest.php rename to module/Rest/test/Action/ShortUrl/DeleteShortUrlActionTest.php index 3c5a5c87..abcd61cf 100644 --- a/module/Rest/test/Action/ShortCode/DeleteShortCodeActionTest.php +++ b/module/Rest/test/Action/ShortUrl/DeleteShortUrlActionTest.php @@ -1,23 +1,23 @@ service = $this->prophesize(DeleteShortUrlServiceInterface::class); - $this->action = new DeleteShortCodeAction($this->service->reveal(), Translator::factory([])); + $this->action = new DeleteShortUrlAction($this->service->reveal(), Translator::factory([])); } /** diff --git a/module/Rest/test/Action/ShortCode/EditShortCodeActionTest.php b/module/Rest/test/Action/ShortUrl/EditShortUrlActionTest.php similarity index 90% rename from module/Rest/test/Action/ShortCode/EditShortCodeActionTest.php rename to module/Rest/test/Action/ShortUrl/EditShortUrlActionTest.php index e96ccdf8..e0cfb13e 100644 --- a/module/Rest/test/Action/ShortCode/EditShortCodeActionTest.php +++ b/module/Rest/test/Action/ShortUrl/EditShortUrlActionTest.php @@ -1,7 +1,7 @@ shortUrlService = $this->prophesize(ShortUrlServiceInterface::class); - $this->action = new EditShortCodeAction($this->shortUrlService->reveal(), Translator::factory([])); + $this->action = new EditShortUrlAction($this->shortUrlService->reveal(), Translator::factory([])); } /** diff --git a/module/Rest/test/Action/ShortCode/EditShortCodeTagsActionTest.php b/module/Rest/test/Action/ShortUrl/EditShortUrlTagsActionTest.php similarity index 86% rename from module/Rest/test/Action/ShortCode/EditShortCodeTagsActionTest.php rename to module/Rest/test/Action/ShortUrl/EditShortUrlTagsActionTest.php index d7eab463..dc4b4a5c 100644 --- a/module/Rest/test/Action/ShortCode/EditShortCodeTagsActionTest.php +++ b/module/Rest/test/Action/ShortUrl/EditShortUrlTagsActionTest.php @@ -1,21 +1,21 @@ shortUrlService = $this->prophesize(ShortUrlService::class); - $this->action = new EditShortCodeTagsAction($this->shortUrlService->reveal(), Translator::factory([])); + $this->action = new EditShortUrlTagsAction($this->shortUrlService->reveal(), Translator::factory([])); } /** diff --git a/module/Rest/test/Action/ShortCode/ListShortCodesActionTest.php b/module/Rest/test/Action/ShortUrl/ListShortUrlsActionTest.php similarity index 84% rename from module/Rest/test/Action/ShortCode/ListShortCodesActionTest.php rename to module/Rest/test/Action/ShortUrl/ListShortUrlsActionTest.php index 7c414e44..eecbb8d8 100644 --- a/module/Rest/test/Action/ShortCode/ListShortCodesActionTest.php +++ b/module/Rest/test/Action/ShortUrl/ListShortUrlsActionTest.php @@ -1,21 +1,21 @@ service = $this->prophesize(ShortUrlService::class); - $this->action = new ListShortCodesAction($this->service->reveal(), Translator::factory([]), [ + $this->action = new ListShortUrlsAction($this->service->reveal(), Translator::factory([]), [ 'hostname' => 'doma.in', 'schema' => 'https', ]); diff --git a/module/Rest/test/Action/ShortCode/ResolveUrlActionTest.php b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php similarity index 91% rename from module/Rest/test/Action/ShortCode/ResolveUrlActionTest.php rename to module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php index bde3e89a..a6159ec1 100644 --- a/module/Rest/test/Action/ShortCode/ResolveUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php @@ -1,7 +1,7 @@ urlShortener = $this->prophesize(UrlShortener::class); - $this->action = new ResolveUrlAction($this->urlShortener->reveal(), Translator::factory([]), []); + $this->action = new ResolveShortUrlAction($this->urlShortener->reveal(), Translator::factory([]), []); } /** diff --git a/module/Rest/test/Action/ShortCode/SingleStepCreateShortCodeActionTest.php b/module/Rest/test/Action/ShortUrl/SingleStepCreateShortUrlActionTest.php similarity index 92% rename from module/Rest/test/Action/ShortCode/SingleStepCreateShortCodeActionTest.php rename to module/Rest/test/Action/ShortUrl/SingleStepCreateShortUrlActionTest.php index 0a7d6981..438132cb 100644 --- a/module/Rest/test/Action/ShortCode/SingleStepCreateShortCodeActionTest.php +++ b/module/Rest/test/Action/ShortUrl/SingleStepCreateShortUrlActionTest.php @@ -1,7 +1,7 @@ urlShortener = $this->prophesize(UrlShortenerInterface::class); $this->apiKeyService = $this->prophesize(ApiKeyServiceInterface::class); - $this->action = new SingleStepCreateShortCodeAction( + $this->action = new SingleStepCreateShortUrlAction( $this->urlShortener->reveal(), Translator::factory([]), $this->apiKeyService->reveal(), From 622edd2ed17b9bab49e78fe670bdf89de90b2571 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 20 Sep 2018 20:00:53 +0200 Subject: [PATCH 2/6] Renamed rest middlewares to use the short-url concept instead of the short-code concept --- module/Rest/config/dependencies.config.php | 2 +- module/Rest/config/routes.config.php | 4 ++-- .../CreateShortUrlContentNegotiationMiddleware.php} | 4 ++-- ...CreateShortUrlContentNegotiationMiddlewareTest.php} | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) rename module/Rest/src/Middleware/{ShortCode/CreateShortCodeContentNegotiationMiddleware.php => ShortUrl/CreateShortUrlContentNegotiationMiddleware.php} (94%) rename module/Rest/test/Middleware/{ShortCode/CreateShortCodeContentNegotiationMiddlewareTest.php => ShortUrl/CreateShortUrlContentNegotiationMiddlewareTest.php} (90%) diff --git a/module/Rest/config/dependencies.config.php b/module/Rest/config/dependencies.config.php index 8b8a4f02..595377d7 100644 --- a/module/Rest/config/dependencies.config.php +++ b/module/Rest/config/dependencies.config.php @@ -37,7 +37,7 @@ return [ Middleware\CrossDomainMiddleware::class => InvokableFactory::class, Middleware\PathVersionMiddleware::class => InvokableFactory::class, Middleware\CheckAuthenticationMiddleware::class => ConfigAbstractFactory::class, - Middleware\ShortCode\CreateShortCodeContentNegotiationMiddleware::class => InvokableFactory::class, + Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class => InvokableFactory::class, ], ], diff --git a/module/Rest/config/routes.config.php b/module/Rest/config/routes.config.php index b1ab3d78..a937bc42 100644 --- a/module/Rest/config/routes.config.php +++ b/module/Rest/config/routes.config.php @@ -12,10 +12,10 @@ return [ // Short codes Action\ShortUrl\CreateShortUrlAction::getRouteDef([ - Middleware\ShortCode\CreateShortCodeContentNegotiationMiddleware::class, + Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class, ]), Action\ShortUrl\SingleStepCreateShortUrlAction::getRouteDef([ - Middleware\ShortCode\CreateShortCodeContentNegotiationMiddleware::class, + Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class, ]), Action\ShortUrl\EditShortUrlAction::getRouteDef(), Action\ShortUrl\DeleteShortUrlAction::getRouteDef(), diff --git a/module/Rest/src/Middleware/ShortCode/CreateShortCodeContentNegotiationMiddleware.php b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php similarity index 94% rename from module/Rest/src/Middleware/ShortCode/CreateShortCodeContentNegotiationMiddleware.php rename to module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php index 3a2f0f4d..8ea8f259 100644 --- a/module/Rest/src/Middleware/ShortCode/CreateShortCodeContentNegotiationMiddleware.php +++ b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php @@ -1,7 +1,7 @@ middleware = new CreateShortCodeContentNegotiationMiddleware(); + $this->middleware = new CreateShortUrlContentNegotiationMiddleware(); $this->requestHandler = $this->prophesize(RequestHandlerInterface::class); } From 7ab993b764a0ce618d83384a7e5cb65ddc6f1a6b Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 20 Sep 2018 20:27:34 +0200 Subject: [PATCH 3/6] Created and registered middleware which replaces short-code from short-url on rest paths --- .../autoload/middleware-pipeline.global.php | 23 ++++----- module/Rest/config/dependencies.config.php | 19 ++++--- .../Action/ShortUrl/CreateShortUrlAction.php | 2 +- .../Action/ShortUrl/DeleteShortUrlAction.php | 2 +- .../Action/ShortUrl/EditShortUrlAction.php | 2 +- .../ShortUrl/EditShortUrlTagsAction.php | 2 +- .../Action/ShortUrl/ListShortUrlsAction.php | 2 +- .../Action/ShortUrl/ResolveShortUrlAction.php | 2 +- .../SingleStepCreateShortUrlAction.php | 2 +- .../ShortUrl/ShortCodePathMiddleware.php | 30 +++++++++++ .../ShortUrl/ShortCodePathMiddlewareTest.php | 50 +++++++++++++++++++ 11 files changed, 109 insertions(+), 27 deletions(-) create mode 100644 module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php create mode 100644 module/Rest/test/Middleware/ShortUrl/ShortCodePathMiddlewareTest.php diff --git a/config/autoload/middleware-pipeline.global.php b/config/autoload/middleware-pipeline.global.php index dc17bd53..308315bb 100644 --- a/config/autoload/middleware-pipeline.global.php +++ b/config/autoload/middleware-pipeline.global.php @@ -1,12 +1,8 @@ [ ErrorHandler::class, Expressive\Helper\ContentLengthMiddleware::class, - LocaleMiddleware::class, + Common\Middleware\LocaleMiddleware::class, ], - 'priority' => 11, + 'priority' => 12, ], 'pre-routing-rest' => [ 'path' => '/rest', 'middleware' => [ - PathVersionMiddleware::class, + Rest\Middleware\PathVersionMiddleware::class, + Rest\Middleware\ShortUrl\ShortCodePathMiddleware::class, ], 'priority' => 11, ], @@ -39,10 +36,10 @@ return [ 'rest' => [ 'path' => '/rest', 'middleware' => [ - CrossDomainMiddleware::class, + Rest\Middleware\CrossDomainMiddleware::class, Expressive\Router\Middleware\ImplicitOptionsMiddleware::class, - BodyParserMiddleware::class, - CheckAuthenticationMiddleware::class, + Rest\Middleware\BodyParserMiddleware::class, + Rest\Middleware\CheckAuthenticationMiddleware::class, ], 'priority' => 5, ], @@ -50,7 +47,7 @@ return [ 'post-routing' => [ 'middleware' => [ Expressive\Router\Middleware\DispatchMiddleware::class, - NotFoundHandler::class, + Core\Response\NotFoundHandler::class, ], 'priority' => 1, ], diff --git a/module/Rest/config/dependencies.config.php b/module/Rest/config/dependencies.config.php index 595377d7..c9a9da98 100644 --- a/module/Rest/config/dependencies.config.php +++ b/module/Rest/config/dependencies.config.php @@ -1,12 +1,11 @@ [ 'factories' => [ - JWTService::class => ConfigAbstractFactory::class, + Authentication\JWTService::class => ConfigAbstractFactory::class, ApiKeyService::class => ConfigAbstractFactory::class, Action\AuthenticateAction::class => ConfigAbstractFactory::class, @@ -38,14 +37,20 @@ return [ Middleware\PathVersionMiddleware::class => InvokableFactory::class, Middleware\CheckAuthenticationMiddleware::class => ConfigAbstractFactory::class, Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class => InvokableFactory::class, + Middleware\ShortUrl\ShortCodePathMiddleware::class => InvokableFactory::class, ], ], ConfigAbstractFactory::class => [ - JWTService::class => [AppOptions::class], + Authentication\JWTService::class => [AppOptions::class], ApiKeyService::class => ['em'], - Action\AuthenticateAction::class => [ApiKeyService::class, JWTService::class, 'translator', 'Logger_Shlink'], + Action\AuthenticateAction::class => [ + ApiKeyService::class, + Authentication\JWTService::class, + 'translator', + 'Logger_Shlink', + ], Action\ShortUrl\CreateShortUrlAction::class => [ Service\UrlShortener::class, 'translator', @@ -88,7 +93,7 @@ return [ Action\Tag\UpdateTagAction::class => [Service\Tag\TagService::class, Translator::class, LoggerInterface::class], Middleware\CheckAuthenticationMiddleware::class => [ - JWTService::class, + Authentication\JWTService::class, 'translator', 'config.auth.routes_whitelist', 'Logger_Shlink', diff --git a/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php index 925da8d0..13c92994 100644 --- a/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php @@ -12,7 +12,7 @@ use Zend\Diactoros\Uri; class CreateShortUrlAction extends AbstractCreateShortUrlAction { - protected const ROUTE_PATH = '/short-codes'; + protected const ROUTE_PATH = '/short-urls'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_POST]; /** diff --git a/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php b/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php index aea480cb..d752cc9b 100644 --- a/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php @@ -16,7 +16,7 @@ use Zend\I18n\Translator\TranslatorInterface; class DeleteShortUrlAction extends AbstractRestAction { - protected const ROUTE_PATH = '/short-codes/{shortCode}'; + protected const ROUTE_PATH = '/short-urls/{shortCode}'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_DELETE]; /** diff --git a/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php b/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php index 523edc3d..0c1e243a 100644 --- a/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php @@ -17,7 +17,7 @@ use Zend\I18n\Translator\TranslatorInterface; class EditShortUrlAction extends AbstractRestAction { - protected const ROUTE_PATH = '/short-codes/{shortCode}'; + protected const ROUTE_PATH = '/short-urls/{shortCode}'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_PUT]; /** diff --git a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php index 3db0d900..064f5d19 100644 --- a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php +++ b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php @@ -15,7 +15,7 @@ use Zend\I18n\Translator\TranslatorInterface; class EditShortUrlTagsAction extends AbstractRestAction { - protected const ROUTE_PATH = '/short-codes/{shortCode}/tags'; + protected const ROUTE_PATH = '/short-urls/{shortCode}/tags'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_PUT]; /** diff --git a/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php b/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php index c58dcba0..5e19f866 100644 --- a/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php +++ b/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php @@ -18,7 +18,7 @@ class ListShortUrlsAction extends AbstractRestAction { use PaginatorUtilsTrait; - protected const ROUTE_PATH = '/short-codes'; + protected const ROUTE_PATH = '/short-urls'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET]; /** diff --git a/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php b/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php index e1ab9639..8afb55f3 100644 --- a/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php @@ -17,7 +17,7 @@ use Zend\I18n\Translator\TranslatorInterface; class ResolveShortUrlAction extends AbstractRestAction { - protected const ROUTE_PATH = '/short-codes/{shortCode}'; + protected const ROUTE_PATH = '/short-urls/{shortCode}'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET]; /** diff --git a/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php index 1003ebfd..399e6393 100644 --- a/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php @@ -15,7 +15,7 @@ use Zend\I18n\Translator\TranslatorInterface; class SingleStepCreateShortUrlAction extends AbstractCreateShortUrlAction { - protected const ROUTE_PATH = '/short-codes/shorten'; + protected const ROUTE_PATH = '/short-urls/shorten'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET]; /** diff --git a/module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php b/module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php new file mode 100644 index 00000000..a04a50b3 --- /dev/null +++ b/module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php @@ -0,0 +1,30 @@ +getUri(); + $path = $uri->getPath(); + + // If the path starts with the old prefix, replace it by the new one + return $handler->handle( + $request->withUri($uri->withPath(\str_replace(self::OLD_PATH_PREFIX, self::NEW_PATH_PREFIX, $path))) + ); + } +} diff --git a/module/Rest/test/Middleware/ShortUrl/ShortCodePathMiddlewareTest.php b/module/Rest/test/Middleware/ShortUrl/ShortCodePathMiddlewareTest.php new file mode 100644 index 00000000..d28acf40 --- /dev/null +++ b/module/Rest/test/Middleware/ShortUrl/ShortCodePathMiddlewareTest.php @@ -0,0 +1,50 @@ +middleware = new ShortCodePathMiddleware(); + $this->requestHandler = $this->prophesize(RequestHandlerInterface::class); + $this->requestHandler->handle(Argument::type(ServerRequestInterface::class))->willReturn(new Response()); + } + + /** + * @test + */ + public function properlyReplacesTheOldPathByTheNewOne() + { + $uri = new Uri('/short-codes/foo'); + + $request = $this->prophesize(ServerRequestInterface::class); + $request->getUri()->willReturn($uri); + $withUri = $request->withUri(Argument::that(function (UriInterface $uri) { + $path = $uri->getPath(); + + Assert::assertContains('/short-urls', $path); + Assert::assertNotContains('/short-codes', $path); + + return $uri; + }))->willReturn($request->reveal()); + + $this->middleware->process($request->reveal(), $this->requestHandler->reveal()); + + $withUri->shouldHaveBeenCalledTimes(1); + } +} From 80fe3a73e236c5b910e49a8c456ce0163a2d05bc Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 20 Sep 2018 20:38:51 +0200 Subject: [PATCH 4/6] More classes renamed and fixes for usage of the short code concept in place of short URL --- ...ortCodeData.php => CreateShortUrlData.php} | 2 +- .../ShortUrl/AbstractCreateShortUrlAction.php | 24 +++++++++---------- .../Action/ShortUrl/CreateShortUrlAction.php | 8 +++---- .../SingleStepCreateShortUrlAction.php | 9 ++++--- .../Rest/src/Action/Visit/GetVisitsAction.php | 4 ++-- module/Rest/src/Util/RestUtils.php | 1 + 6 files changed, 24 insertions(+), 24 deletions(-) rename module/Core/src/Model/{CreateShortCodeData.php => CreateShortUrlData.php} (96%) diff --git a/module/Core/src/Model/CreateShortCodeData.php b/module/Core/src/Model/CreateShortUrlData.php similarity index 96% rename from module/Core/src/Model/CreateShortCodeData.php rename to module/Core/src/Model/CreateShortUrlData.php index 880c32c2..a1d9d018 100644 --- a/module/Core/src/Model/CreateShortCodeData.php +++ b/module/Core/src/Model/CreateShortUrlData.php @@ -5,7 +5,7 @@ namespace Shlinkio\Shlink\Core\Model; use Psr\Http\Message\UriInterface; -final class CreateShortCodeData +final class CreateShortUrlData { /** * @var UriInterface diff --git a/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php index fbf1817a..db5d9818 100644 --- a/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php @@ -9,7 +9,7 @@ use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Exception\InvalidArgumentException; use Shlinkio\Shlink\Core\Exception\InvalidUrlException; use Shlinkio\Shlink\Core\Exception\NonUniqueSlugException; -use Shlinkio\Shlink\Core\Model\CreateShortCodeData; +use Shlinkio\Shlink\Core\Model\CreateShortUrlData; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; @@ -52,10 +52,10 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction public function handle(Request $request): Response { try { - $shortCodeData = $this->buildUrlToShortCodeData($request); - $shortCodeMeta = $shortCodeData->getMeta(); - $longUrl = $shortCodeData->getLongUrl(); - $customSlug = $shortCodeMeta->getCustomSlug(); + $shortUrlData = $this->buildShortUrlData($request); + $shortUrlMeta = $shortUrlData->getMeta(); + $longUrl = $shortUrlData->getLongUrl(); + $customSlug = $shortUrlMeta->getCustomSlug(); } catch (InvalidArgumentException $e) { $this->logger->warning('Provided data is invalid.' . PHP_EOL . $e); return new JsonResponse([ @@ -67,11 +67,11 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction try { $shortUrl = $this->urlShortener->urlToShortCode( $longUrl, - $shortCodeData->getTags(), - $shortCodeMeta->getValidSince(), - $shortCodeMeta->getValidUntil(), + $shortUrlData->getTags(), + $shortUrlMeta->getValidSince(), + $shortUrlMeta->getValidUntil(), $customSlug, - $shortCodeMeta->getMaxVisits() + $shortUrlMeta->getMaxVisits() ); $transformer = new ShortUrlDataTransformer($this->domainConfig); @@ -95,7 +95,7 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction ), ], self::STATUS_BAD_REQUEST); } catch (\Throwable $e) { - $this->logger->error('Unexpected error creating shortcode.' . PHP_EOL . $e); + $this->logger->error('Unexpected error creating short url.' . PHP_EOL . $e); return new JsonResponse([ 'error' => RestUtils::UNKNOWN_ERROR, 'message' => $this->translator->translate('Unexpected error occurred'), @@ -105,8 +105,8 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction /** * @param Request $request - * @return CreateShortCodeData + * @return CreateShortUrlData * @throws InvalidArgumentException */ - abstract protected function buildUrlToShortCodeData(Request $request): CreateShortCodeData; + abstract protected function buildShortUrlData(Request $request): CreateShortUrlData; } diff --git a/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php index 13c92994..696c47b3 100644 --- a/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php @@ -5,7 +5,7 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl; use Psr\Http\Message\ServerRequestInterface as Request; use Shlinkio\Shlink\Core\Exception\InvalidArgumentException; -use Shlinkio\Shlink\Core\Model\CreateShortCodeData; +use Shlinkio\Shlink\Core\Model\CreateShortUrlData; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Rest\Action\ShortUrl\AbstractCreateShortUrlAction; use Zend\Diactoros\Uri; @@ -17,18 +17,18 @@ class CreateShortUrlAction extends AbstractCreateShortUrlAction /** * @param Request $request - * @return CreateShortCodeData + * @return CreateShortUrlData * @throws InvalidArgumentException * @throws \InvalidArgumentException */ - protected function buildUrlToShortCodeData(Request $request): CreateShortCodeData + protected function buildShortUrlData(Request $request): CreateShortUrlData { $postData = (array) $request->getParsedBody(); if (! isset($postData['longUrl'])) { throw new InvalidArgumentException($this->translator->translate('A URL was not provided')); } - return new CreateShortCodeData( + return new CreateShortUrlData( new Uri($postData['longUrl']), (array) ($postData['tags'] ?? []), ShortUrlMeta::createFromParams( diff --git a/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php index 399e6393..38057f5c 100644 --- a/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php @@ -6,9 +6,8 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Exception\InvalidArgumentException; -use Shlinkio\Shlink\Core\Model\CreateShortCodeData; +use Shlinkio\Shlink\Core\Model\CreateShortUrlData; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; -use Shlinkio\Shlink\Rest\Action\ShortUrl\AbstractCreateShortUrlAction; use Shlinkio\Shlink\Rest\Service\ApiKeyServiceInterface; use Zend\Diactoros\Uri; use Zend\I18n\Translator\TranslatorInterface; @@ -36,11 +35,11 @@ class SingleStepCreateShortUrlAction extends AbstractCreateShortUrlAction /** * @param Request $request - * @return CreateShortCodeData + * @return CreateShortUrlData * @throws \InvalidArgumentException * @throws InvalidArgumentException */ - protected function buildUrlToShortCodeData(Request $request): CreateShortCodeData + protected function buildShortUrlData(Request $request): CreateShortUrlData { $query = $request->getQueryParams(); @@ -56,6 +55,6 @@ class SingleStepCreateShortUrlAction extends AbstractCreateShortUrlAction throw new InvalidArgumentException($this->translator->translate('A URL was not provided')); } - return new CreateShortCodeData(new Uri($query['longUrl'])); + return new CreateShortUrlData(new Uri($query['longUrl'])); } } diff --git a/module/Rest/src/Action/Visit/GetVisitsAction.php b/module/Rest/src/Action/Visit/GetVisitsAction.php index 96010ce0..3d5890cc 100644 --- a/module/Rest/src/Action/Visit/GetVisitsAction.php +++ b/module/Rest/src/Action/Visit/GetVisitsAction.php @@ -16,7 +16,7 @@ use Zend\I18n\Translator\TranslatorInterface; class GetVisitsAction extends AbstractRestAction { - protected const ROUTE_PATH = '/short-codes/{shortCode}/visits'; + protected const ROUTE_PATH = '/short-urls/{shortCode}/visits'; protected const ROUTE_ALLOWED_METHODS = [self::METHOD_GET]; /** @@ -58,7 +58,7 @@ class GetVisitsAction extends AbstractRestAction ], ]); } catch (InvalidArgumentException $e) { - $this->logger->warning('Provided nonexistent shortcode' . PHP_EOL . $e); + $this->logger->warning('Provided nonexistent short code' . PHP_EOL . $e); return new JsonResponse([ 'error' => RestUtils::getRestErrorCodeFromException($e), 'message' => sprintf( diff --git a/module/Rest/src/Util/RestUtils.php b/module/Rest/src/Util/RestUtils.php index c783f6cb..35b6cbc9 100644 --- a/module/Rest/src/Util/RestUtils.php +++ b/module/Rest/src/Util/RestUtils.php @@ -10,6 +10,7 @@ use Shlinkio\Shlink\Rest\Exception as Rest; class RestUtils { public const INVALID_SHORTCODE_ERROR = 'INVALID_SHORTCODE'; + // FIXME Should be INVALID_SHORT_URL_DELETION public const INVALID_SHORTCODE_DELETION_ERROR = 'INVALID_SHORTCODE_DELETION'; public const INVALID_URL_ERROR = 'INVALID_URL'; public const INVALID_ARGUMENT_ERROR = 'INVALID_ARGUMENT'; From d53a3222d0ef08271ddc08aa544d2986264d3550 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 20 Sep 2018 20:52:27 +0200 Subject: [PATCH 5/6] Changed documented paths on short URL-related endpoints from short-code to short-url --- docs/swagger/paths/v1_authenticate.json | 1 + docs/swagger/paths/v1_short-codes.json | 6 ++-- .../swagger/paths/v1_short-codes_shorten.json | 3 +- .../paths/v1_short-codes_{shortCode}.json | 9 ++++-- .../v1_short-codes_{shortCode}_tags.json | 4 +-- .../v1_short-codes_{shortCode}_visits.json | 2 +- docs/swagger/paths/v1_tags.json | 4 +++ docs/swagger/swagger.json | 29 +++++++++++++++---- 8 files changed, 44 insertions(+), 14 deletions(-) diff --git a/docs/swagger/paths/v1_authenticate.json b/docs/swagger/paths/v1_authenticate.json index 55160087..49a690fb 100644 --- a/docs/swagger/paths/v1_authenticate.json +++ b/docs/swagger/paths/v1_authenticate.json @@ -1,5 +1,6 @@ { "post": { + "operationId": "authenticate", "tags": [ "Authentication" ], diff --git a/docs/swagger/paths/v1_short-codes.json b/docs/swagger/paths/v1_short-codes.json index 48d16a16..80c950e8 100644 --- a/docs/swagger/paths/v1_short-codes.json +++ b/docs/swagger/paths/v1_short-codes.json @@ -1,7 +1,8 @@ { "get": { + "operationId": "listShortUrls", "tags": [ - "ShortCodes" + "Short URLs" ], "summary": "List short URLs", "description": "Returns the list of short codes", @@ -142,8 +143,9 @@ }, "post": { + "operationId": "createShortUrl", "tags": [ - "ShortCodes" + "Short URLs" ], "summary": "Create short URL", "description": "Creates a new short code", diff --git a/docs/swagger/paths/v1_short-codes_shorten.json b/docs/swagger/paths/v1_short-codes_shorten.json index 1ee3387c..cb3fd18b 100644 --- a/docs/swagger/paths/v1_short-codes_shorten.json +++ b/docs/swagger/paths/v1_short-codes_shorten.json @@ -1,7 +1,8 @@ { "get": { + "operationId": "shortenUrl", "tags": [ - "ShortCodes" + "Short URLs" ], "summary": "Create a short URL", "description": "Creates a short URL in a single API call. Useful for third party integrations", diff --git a/docs/swagger/paths/v1_short-codes_{shortCode}.json b/docs/swagger/paths/v1_short-codes_{shortCode}.json index e17881af..e6ad06f2 100644 --- a/docs/swagger/paths/v1_short-codes_{shortCode}.json +++ b/docs/swagger/paths/v1_short-codes_{shortCode}.json @@ -1,7 +1,8 @@ { "get": { + "operationId": "getShortUrl", "tags": [ - "ShortCodes" + "Short URLs" ], "summary": "Parse short code", "description": "Get the long URL behind a short code.", @@ -78,8 +79,9 @@ }, "put": { + "operationId": "editShortUrl", "tags": [ - "ShortCodes" + "Short URLs" ], "summary": "Edit short code", "description": "Update certain meta arguments from an existing short URL.", @@ -162,8 +164,9 @@ }, "delete": { + "operationId": "deleteShortUrl", "tags": [ - "ShortCodes" + "Short URLs" ], "summary": "Delete short code", "description": "Deletes the short URL for provided short code.", diff --git a/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json b/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json index 7a1c1759..95e24038 100644 --- a/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json +++ b/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json @@ -1,8 +1,8 @@ { "put": { + "operationId": "editShortUrlTags", "tags": [ - "ShortCodes", - "Tags" + "Short URLs" ], "summary": "Edit tags on short URL", "description": "Edit the tags on provided short code.", diff --git a/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json b/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json index ec8d372e..c075e774 100644 --- a/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json +++ b/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json @@ -1,7 +1,7 @@ { "get": { + "operationId": "getShortUrlVisits", "tags": [ - "ShortCodes", "Visits" ], "summary": "List visits for short URL", diff --git a/docs/swagger/paths/v1_tags.json b/docs/swagger/paths/v1_tags.json index b33b9606..fb4df70d 100644 --- a/docs/swagger/paths/v1_tags.json +++ b/docs/swagger/paths/v1_tags.json @@ -1,5 +1,6 @@ { "get": { + "operationId": "listTags", "tags": [ "Tags" ], @@ -60,6 +61,7 @@ }, "post": { + "operationId": "createTags", "tags": [ "Tags" ], @@ -143,6 +145,7 @@ }, "put": { + "operationId": "renameTag", "tags": [ "Tags" ], @@ -216,6 +219,7 @@ }, "delete": { + "operationId": "deleteTags", "tags": [ "Tags" ], diff --git a/docs/swagger/swagger.json b/docs/swagger/swagger.json index c5dbd791..8dec455c 100644 --- a/docs/swagger/swagger.json +++ b/docs/swagger/swagger.json @@ -32,21 +32,40 @@ } }, + "tags": [ + { + "name": "Authentication", + "description": "Authentication-related endpoints" + }, + { + "name": "Short URLs", + "description": "Operations that can be performed on short URLs" + }, + { + "name": "Tags", + "description": "Let you handle the list of available tags" + }, + { + "name": "Visits", + "description": "Operations to manage visits on short URLs" + } + ], + "paths": { "/v1/authenticate": { "$ref": "paths/v1_authenticate.json" }, - "/v1/short-codes": { + "/v1/short-urls": { "$ref": "paths/v1_short-codes.json" }, - "/v1/short-codes/shorten": { + "/v1/short-urls/shorten": { "$ref": "paths/v1_short-codes_shorten.json" }, - "/v1/short-codes/{shortCode}": { + "/v1/short-urls/{shortCode}": { "$ref": "paths/v1_short-codes_{shortCode}.json" }, - "/v1/short-codes/{shortCode}/tags": { + "/v1/short-urls/{shortCode}/tags": { "$ref": "paths/v1_short-codes_{shortCode}_tags.json" }, @@ -54,7 +73,7 @@ "$ref": "paths/v1_tags.json" }, - "/v1/short-codes/{shortCode}/visits": { + "/v1/short-urls/{shortCode}/visits": { "$ref": "paths/v1_short-codes_{shortCode}_visits.json" } } From 00e7d5724549c3968a99c4b2de245a82a82d9862 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 20 Sep 2018 20:53:57 +0200 Subject: [PATCH 6/6] Improved API descriptions --- docs/swagger/paths/v1_short-codes_{shortCode}_tags.json | 2 +- docs/swagger/paths/v1_short-codes_{shortCode}_visits.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json b/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json index 95e24038..d3bb8b86 100644 --- a/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json +++ b/docs/swagger/paths/v1_short-codes_{shortCode}_tags.json @@ -10,7 +10,7 @@ { "name": "shortCode", "in": "path", - "description": "The shortCode in which we want to edit tags.", + "description": "The short code for the short URL in which we want to edit tags.", "required": true, "schema": { "type": "string" diff --git a/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json b/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json index c075e774..a59fd5d4 100644 --- a/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json +++ b/docs/swagger/paths/v1_short-codes_{shortCode}_visits.json @@ -10,7 +10,7 @@ { "name": "shortCode", "in": "path", - "description": "The shortCode from which we want to get the visits.", + "description": "The short code for the short URL from which we want to get the visits.", "required": true, "schema": { "type": "string"