From 544836b986e86bb054f7901e57a92f343cb26408 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 2 Nov 2020 11:05:14 +0100 Subject: [PATCH] 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';