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
Required form fields for PUT method always false? #565
Comments
bump .. |
Well, PUT should not be all set to |
Sorry. am confused from the answer. Are saying that it is a bug then ? |
Up the original question. In this article @willdurand has stated:
So as I understand all fields for an entity should be required in case of if ('PUT' === $annotation->getMethod()) {
// All parameters are optional with PUT (update)
array_walk($parameters, function ($val, $key) use (&$parameters) {
$parameters[$key]['required'] = false;
});
} |
@michaelpopok I suggest you provide PR :) |
I think someone mixed up PUT with PATCH. |
Is there a chance to merge the fix kuborgh@72ab9b9 from @kuborgh-hgiesenow ? |
Can someone open a Pull Request for that? |
The codebase (especially tests) have changed too much since 2.10.0, so it's not mergable anymore. I had no time to look at it again. |
Change PUT by PATCH
Change PUT by PATCH Refactor tests for nelmio#565
Is there a reason why for the PUT request the required form fields are always false, while for the POST / PATCH methods they reflect what is specified in the form class?
If this has to do with the idempotence of the PUT method, my inclination was to do it the other way round (POST/PATCH does not require all the form fields while PUT does)...
PUT request:
POST / PATCH requests:
The text was updated successfully, but these errors were encountered: