-
-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: custom JMS enum type handling (#2372)
| Q | A | |---------------|---------------------------------------------------------------------------------------------------------------------------| | Bug fix? | yes | | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | | Issues | Fix #2327 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | JMS implemented the enum type annotations inconsistently compared to the other type annotations. I've created schmittjoh/serializer#1561 to fix that (which has been merged and released with 3.31.0), and this PR adds compatibility for both methods. --------- Co-authored-by: Djordy Koert <[email protected]>
- Loading branch information
1 parent
3a58743
commit 1e283ef
Showing
4 changed files
with
73 additions
and
2 deletions.
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
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,25 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the NelmioApiDocBundle package. | ||
* | ||
* (c) Nelmio | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
class JMSEnum81 | ||
{ | ||
#[Serializer\Type('enum<'.ArticleType81::class.", 'value'>")] | ||
#[Serializer\Expose] | ||
public $enumValue; | ||
|
||
#[Serializer\Type('array<enum<'.ArticleType81::class.", 'value'>>")] | ||
#[Serializer\Expose] | ||
public $enumValues; | ||
} |
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