8000 Automatic validation may cause issues with fields that are generated · Issue #1211 · api-platform/api-platform · GitHub
[go: up one dir, main page]

Skip to content

Automatic validation may cause issues with fields that are generated #1211

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

Open
soyuka opened this issue Aug 2, 2019 · 4 comments
Open

Automatic validation may cause issues with fields that are generated #1211

soyuka opened this issue Aug 2, 2019 · 4 comments
Labels

Comments

@soyuka
Copy link
Member
soyuka commented Aug 2, 2019

Say you have an entity with a createdAt/updatedAt field that is automatically filled. When creating a request, you may have a 400 error because these fields can not be empty/null.
The solution is to disable automatic validation for now?

This was working before the update of the validator recipe: symfony/recipes#559
Feature PR initiating the feature: symfony/symfony#27735
Disabling auto mapping: symfony/recipes#612
Related issue: symfony/symfony#32070 (comment)

Thanks @Kocal for the bug report. I'm not sure if the end solution is to document this behavior or fix it upstream (in symfony) @dunglas ?

@ismail1432
Copy link

I think this one can be closed, isn’t it ?

@Kocal
Copy link
Kocal commented Aug 14, 2019

Why?

@ismail1432
Copy link

I thougth that #1211 resolves the problem but it’s a « small » fix and we are looking for a better solution ?

@karatektus
Copy link

For everyone that comes here and is looking to disable auto validation: just comment out the following lines:

        auto_mapping:
            App\Entity\: []

in config/packages/validator.yaml

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

No branches or pull requests

4 participants
0