8000 [Validation][RFC] Allow to mix group sequence and validation group · Issue #7204 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Validation][RFC] Allow to mix group sequence and validation group #7204
Closed
@lyrixx

Description

@lyrixx

I would like to know if it is possible to mix validation group and group sequence ?

I used GroupSequence like this :

 * @Assert\GroupSequence({"Branch", "Step2"})
 * @ProjectAssert\Configuration(groups={"Step2"})
 */
class Branch

    // some property with validator.
    // and
    /**
     * @SensioAssert\Yaml() 
     */
    private $configurationVariables;

    /**
     * @SensioAssert\Twig()
     */
    private $configurationTemplate;

And it works like a charm.

But now, I want to preview the branch configuration. So I do not need validate everything. I just want to validate configurationVariables and configurationTemplate in a first step, and then the whole configuration with ProjectAssert\Configuration in a second step.

So I added groups={"preview"} on configurationVariables and configurationTemplate.
But I do not know how to add a group on my validation sequence.
AFAIK, a POPO can attach only one GroupSequence, and a GroupSequence can not be inside a group.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0