From 544836b986e86bb054f7901e57a92f343cb26408 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 2 Nov 2020 11:05:14 +0100 Subject: [PATCH 1/2] Deprecated tags creation --- docs/swagger/paths/v1_tags.json | 3 ++- module/CLI/src/Command/Tag/CreateTagCommand.php | 3 ++- module/Core/src/Tag/TagService.php | 1 + module/Core/src/Tag/TagServiceInterface.php | 1 + module/Rest/src/Action/Tag/CreateTagsAction.php | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/swagger/paths/v1_tags.json b/docs/swagger/paths/v1_tags.json index 83bc7d68..cb6a6bb3 100644 --- a/docs/swagger/paths/v1_tags.json +++ b/docs/swagger/paths/v1_tags.json @@ -87,12 +87,13 @@ }, "post": { + "deprecated": true, "operationId": "createTags", "tags": [ "Tags" ], "summary": "Create tags", - "description": "Provided a list of tags, creates all that do not yet exist", + "description": "Provided a list of tags, creates all that do not yet exist
This endpoint is deprecated, as tags are automatically created while creating a short URL", "security": [ { "ApiKey": [] diff --git a/module/CLI/src/Command/Tag/CreateTagCommand.php b/module/CLI/src/Command/Tag/CreateTagCommand.php index 451eb81e..0003319d 100644 --- a/module/CLI/src/Command/Tag/CreateTagCommand.php +++ b/module/CLI/src/Command/Tag/CreateTagCommand.php @@ -12,6 +12,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +/** @deprecated */ class CreateTagCommand extends Command { public const NAME = 'tag:create'; @@ -28,7 +29,7 @@ class CreateTagCommand extends Command { $this ->setName(self::NAME) - ->setDescription('Creates one or more tags.') + ->setDescription('[Deprecated] Creates one or more tags.') ->addOption( 'name', 't', diff --git a/module/Core/src/Tag/TagService.php b/module/Core/src/Tag/TagService.php index 7137e885..4e0261a5 100644 --- a/module/Core/src/Tag/TagService.php +++ b/module/Core/src/Tag/TagService.php @@ -58,6 +58,7 @@ class TagService implements TagServiceInterface /** * Provided a list of tag names, creates all that do not exist yet * + * @deprecated * @param string[] $tagNames * @return Collection|Tag[] */ diff --git a/module/Core/src/Tag/TagServiceInterface.php b/module/Core/src/Tag/TagServiceInterface.php index ed643fc5..3c8c6e69 100644 --- a/module/Core/src/Tag/TagServiceInterface.php +++ b/module/Core/src/Tag/TagServiceInterface.php @@ -28,6 +28,7 @@ interface TagServiceInterface public function deleteTags(array $tagNames): void; /** + * @deprecated * @param string[] $tagNames * @return Collection|Tag[] */ diff --git a/module/Rest/src/Action/Tag/CreateTagsAction.php b/module/Rest/src/Action/Tag/CreateTagsAction.php index 08f617c2..8aaf907b 100644 --- a/module/Rest/src/Action/Tag/CreateTagsAction.php +++ b/module/Rest/src/Action/Tag/CreateTagsAction.php @@ -10,6 +10,7 @@ use Psr\Http\Message\ServerRequestInterface; use Shlinkio\Shlink\Core\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; +/** @deprecated */ class CreateTagsAction extends AbstractRestAction { protected const ROUTE_PATH = '/tags'; From 1346d7902e870142cc605e4690940b621d7d7090 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 2 Nov 2020 11:06:41 +0100 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3379e11..c20ebcaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#858](https://github.com/shlinkio/shlink/issues/858) Updated to latest infection version. Updated docker images to PHP 7.4.11 and swoole 4.5.5 ### Deprecated -* *Nothing* +* [#883](https://github.com/shlinkio/shlink/issues/883) Deprecated `POST /tags` endpoint and `tag:create` command, as tags are created automatically while creating short URLs. ### Removed * *Nothing*