-
Notifications
You must be signed in to change notification settings - Fork 708
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
Add file uploads support #1097
Add file uploads support #1097
Conversation
please rebase on master |
can you also add something to the docs? |
I add some examples in the |
} | ||
|
||
return $default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and what happens now in this case .. we return null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look the code, it's the same thing, I just removed an useless call to simplify.
needs a rebase |
done. |
and another one :-/ |
done :-) |
{ | ||
return $this->name; | ||
} | ||
/** {@inheritdoc} */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add an empty line between methods
actually .. I just activated styleci .. |
I'll wait that you merge #1115 to see if there is some standard mistakes related to this PR. |
indeed .. needs another rebase :-/ form now on it should then also show you any CS violations automatically |
Yes, I fixed them. |
awesome! |
In attempting to test this out (specifically using the example with } elseif (gettype($values[$property]) !== $type['type'] && !$values[$property] instanceof $type['type']) { Note the Since string !== (scalar|array|Constraint|null)... 💥 The specific error I'm receiving is: [Doctrine\Common\Annotations\AnnotationException]
[Type Error] Attribute "requirements" of @FOSRest\QueryParam declared on method AppBundle\Controller\XyzController::indexAction() expects a(n) scalar|array|Constraint|null, but got string. I didn't see any changes to the dependencies that would suggest a different version of the Doctrine library. Am I missing something here? |
Hum so it seems that the doctrine annotations reader doesn't support the scalar type... If you have the time, can you change this doc and add a test for this case please? Instead I'll fix this later, probably tomorrow. |
@Ener-Getick @lsmith77 For some reason it seems that this change is not in the |
@xabbuh Yeah it needs a lot of changes to be backported this is why I didn't do it. |
@Ener-Getick Alright, thanks for the confirmation. |
But at least we can backport the |
This PR add file uploads support. (#793)
Currently, there are no requirements supported.
I moved the scalar constraints (notBlank, array) in another abstract class
ScalarParam
, I don't know if this is a really good name ...The
requirements
parameter of@FileParam
must be a constraint or an array that can contain all the fields of http://symfony.com/doc/current/reference/constraints/File.html or http://symfony.com/doc/current/reference/constraints/Image.html. It depends of theimage
parameter.