Skip to content

GroupSequence validation not working #2343

@markastott

Description

@markastott

API Platform version(s) affected: 3.0.1

Description
I have been unable to get the GroupSequence validation to work in my code 3.0.7

How to reproduce
Using the API-Platform demo I modified MySequencedGroup.php such that it triggered the Default group for Book as 'first' and 'second' are not defined on Book.

public function __invoke()
{
// return new GroupSequence(['first', 'second']); // now, no matter which is first in the class declaration, it will be tested in this order.
return new GroupSequence(['Book']);
}

I invoked a POST for Book and the Default validation is not triggered

The documentation for services.yml is also incorrect

api/config/services.yaml

services:
App\Validator\MySequencedGroup: ~
public: true

I believe it should be

api/config/services.yaml

services:
App\Validator\MySequencedGroup:
public: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions