Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC][Validator] Configure XML or Yaml mappings for Validator #15655

Copy link
Copy link
Closed
@sroze

Description

@sroze
Issue body actions

Right now, to use the validator component within a Symfony application, we need to configure the validation constraints as annotations or in XML or Yaml files in the Resources/config/validation directory or in a big Resources/config/validation.[x|y]ml file in a bundle directory.

In order to be able to re-use validation across libraries or just make the validation living where the user wants, I propose to introduce a validation mapping configuration in the framework configuration:

framework:
    validation:
        mappings:
            - %kernel.root_dir%/../src/Acme/Demo/Resources/validation
            - %kernel.root_dir%/../src/Acme/Library/Resources/validation.yml

The mapping values can be either a directory or a file. If it's a file, will be added as YML or XML based on the extension. If it's a directory, then using the finder we will be able to locate all the *.[x|y]ml files.

Before PR this feature, what do you think about it ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.