src/AnnotationGenerator/SerializerGroupsAnnotationGenerator.php
public function generateFieldAnnotations(string $className, string $fieldName): array
    {
        if (null === $field = $this->config['types'][$className]['properties'] ?? null) {
            return [];
        }

        if (false === $this->classes[$className]['fields'][$fieldName]['isId'] && $groups = $field[$fieldName]['groups'] ?? false) {
            return [sprintf('@Groups({"%s"})', implode('", "', $groups))];
        }

        return [];
    }
public function generateFieldAnnotations(string $className, string $fieldName): array
    {
        if (null === $field = $this->config['types'][$className]['properties'] ?? null) {
            return [];
        }

        if (false === $this->classes[$className]['fields'][$fieldName]['isId'] && $groups = $field[$fieldName]['groups'] ?? false) {
            return [sprintf('@Groups({"%s"})', implode('", "', $groups))];
        }

        return [];
    }
{@inheritdoc}