You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when using the Groups attribute from Symfony's built-in serializer (Symfony\Component\Serializer\Attribute\Groups) in my Symfony 7 project. The grouping seems to work correctly within Symfony's serialization process, but it doesn't reflect properly in the Swagger UI (using NelmioApiDocBundle).
Here is an example of the entity property where the problem occurs:
use Symfony\Component\Serializer\Attribute\Groups;
use Doctrine\ORM\Mapping as ORM;
use App\SerializerGroups;
#[ORM\Column(nullable: true)]
#[Groups([SerializerGroups::PUBLIC])]
private ?int $number = null;
When I switch to using JMS\Serializer\Annotation\Groups, everything works fine in the Swagger UI:
use JMS\Serializer\Annotation\Groups;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Column(nullable: true)]
#[Groups([SerializerGroups::PUBLIC])]
private ?int $number = null;
It appears there is a lack of full integration between Symfony's serializer and the Swagger documentation generator.
Create an entity and use Symfony's Groups attribute (Symfony\Component\Serializer\Attribute\Groups).
Define the serialization groups for an API endpoint in the controller.
Check the Swagger UI documentation generated by NelmioApiDocBundle.
Expected Behavior:
The Groups attribute from Symfony's built-in serializer should work seamlessly with Swagger UI to group properties correctly in the API documentation.
Actual Behavior:
The properties annotated with Symfony's Groups attribute do not appear correctly grouped in Swagger UI.
Additional Context:
Symfony version: 7.2
NelmioApiDocBundle version: [4.33]
PHP version: [8.3]
Any relevant configuration or setup details
I would appreciate any guidance on whether this is a known issue, a configuration problem, or if there are plans to enhance the integration.
JSON OpenApi
JSON OpenApi
Replace this text with your JSON (`bin/console nelmio:apidoc:dump`)
Additional context
No response
The text was updated successfully, but these errors were encountered:
Version
4.33
Description
I encountered an issue when using the Groups attribute from Symfony's built-in serializer (Symfony\Component\Serializer\Attribute\Groups) in my Symfony 7 project. The grouping seems to work correctly within Symfony's serialization process, but it doesn't reflect properly in the Swagger UI (using NelmioApiDocBundle).
Here is an example of the entity property where the problem occurs:
When I switch to using JMS\Serializer\Annotation\Groups, everything works fine in the Swagger UI:
It appears there is a lack of full integration between Symfony's serializer and the Swagger documentation generator.
Usage:
Steps to Reproduce:
Create an entity and use Symfony's Groups attribute (Symfony\Component\Serializer\Attribute\Groups).
Define the serialization groups for an API endpoint in the controller.
Check the Swagger UI documentation generated by NelmioApiDocBundle.
Expected Behavior:
The Groups attribute from Symfony's built-in serializer should work seamlessly with Swagger UI to group properties correctly in the API documentation.
Actual Behavior:
The properties annotated with Symfony's Groups attribute do not appear correctly grouped in Swagger UI.
Additional Context:
Symfony version: 7.2
NelmioApiDocBundle version: [4.33]
PHP version: [8.3]
Any relevant configuration or setup details
I would appreciate any guidance on whether this is a known issue, a configuration problem, or if there are plans to enhance the integration.
JSON OpenApi
JSON OpenApi
Replace this text with your JSON (`bin/console nelmio:apidoc:dump`)
Additional context
No response
The text was updated successfully, but these errors were encountered: