-
Notifications
You must be signed in to change notification settings - Fork 937
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unused tags to be kept (#1647)
- Loading branch information
1 parent
1da72fc
commit 8e19141
Showing
3 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @license Apache 2.0 | ||
*/ | ||
|
||
namespace OpenApi\Tests\Fixtures; | ||
|
||
use OpenApi\Attributes as OAT; | ||
|
||
#[OAT\OpenApi( | ||
info: new OAT\Info( | ||
title: 'test', | ||
description: 'test', | ||
version: '2.0.0' | ||
), | ||
tags: [ | ||
// definding tag 'other' globally with nice description | ||
new OAT\Tag('other', 'Other description'), | ||
// making a tag that has no operations referencing it, but we wish to keep it | ||
new OAT\Tag('fancy', 'Fancy description'), | ||
// making a tag that it not used, but we do not wish to keep | ||
new OAT\Tag('notused', 'remove this one'), | ||
] | ||
)] | ||
class UnusedTags | ||
{ | ||
#[OAT\Get(path: '/other/', tags: ['other'], responses: [new OAT\Response(response: '200', description: 'success')])] | ||
public function hello(): void | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters