Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Validation][FrameworkBundle] Add auto_mapping config #12728

Closed
ogizanagi opened this issue Nov 29, 2019 · 10 comments
Closed

[Validation][FrameworkBundle] Add auto_mapping config #12728

ogizanagi opened this issue Nov 29, 2019 · 10 comments

Comments

@ogizanagi
Copy link
Member

I may have missed it, but I didn't find any documentation about the validation.auto_mapping config in FrameworkBundle (nor in the fwb ref page).

Ex:

framework:
    validation: 
        # Enables validator auto-mapping support.
        # For instance, basic validation constraints will be inferred from Doctrine's metadata.
        auto_mapping:
            App\Entity\: []

(ref symfony/recipes#664)

@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link
Collaborator

Hello? This issue is about to be closed if nobody replies.

@ogizanagi
Copy link
Member Author

This feature still isn't documented

@carsonbot carsonbot removed the Stalled label Jan 1, 2021
@ro0NL
Copy link
Contributor

ro0NL commented Dec 20, 2021

@ogizanagi can you tell me if an an empty array is intended to disable auto-validation, or could it mean validate everything actually? We got this issue symfony/symfony#44693 :D

@ogizanagi
Copy link
Member Author

An empty array where? IIRC:

framework:
    validation:
        auto_mapping:
            App\Entity\: []

should auto-validate everything in the App\Entity\ ns.

framework:
    validation:
        auto_mapping: []

should not enable auto-validation in any ns.

@ro0NL
Copy link
Contributor

ro0NL commented Dec 20, 2021

Sorry, it's about your second example. This is the default config, and it causes validation to run on our 4.4 app 🙈

symfony/symfony#44698 im a bit less hesitant now to apply patch on 4.4 :)

@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link
Collaborator

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

@carsonbot
Copy link
Collaborator

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

@zacharywp
Copy link

zacharywp commented Apr 23, 2023

This feature still isn't documented

Correct. This still isn't documented in the fwb ref page nor can I find any inline documentation in symfony/framework-bundle.

This feature is presently disabled by default, or opt-in, as you know.

It is mentioned in Databases and the Doctrine ORM: Validating Objects, but the feature being opt-in isn't.

I think it would be nicer to move this new section to a complete new article, linked at the bottom of the guide. It's not really a base feature we should explain in Doctrine imo. Ideally, we should make the main guides as short as possible.

Originally posted by @wouterj in #11132 (comment)

I would agree in the context of the lack of a reference to this feature in FrameworkBundle documentation being an issue and the feature presently being opt-in. Otherwise, the feature itself would be explained in the Doctrine documentation alongside a note of it being opt-in, how to opt-in, and then referenced in the FrameworkBundle documentation.

Ref: #18245, #11132, symfony/symfony#34860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants