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

Issue with Constraint as (Query|Request)Param's requirements #726

Closed
pyrech opened this issue Mar 27, 2014 · 5 comments
Closed

Issue with Constraint as (Query|Request)Param's requirements #726

pyrech opened this issue Mar 27, 2014 · 5 comments

Comments

@pyrech
Copy link
Contributor

pyrech commented Mar 27, 2014

An exception is thrown (when running phpunit) in JMS metadata when using new feature from #700.
Can someone confirm we can use this:

use FOS\RestBundle\Controller\Annotations as Rest;
use Symfony\Component\Validator\Constraints as Assert;

...
@Rest\QueryParam(name="foo", requirements=@Assert\Regex("#bar#u"), description="toto")

Edit: This is a strange bug, when I'm calling my api in the browser, it works, but when I'm unitesting it, an exception is thrown (coming from a PHP warning):

Undefined offset: 13" at myrepos\vendor\jms\serializer\src\JMS\Serializer\Metadata\ClassMetadata.php line 251
@pyrech pyrech changed the title Issue with Contraint Issue with Constraint as (Query|Request)Param's requirements Mar 27, 2014
@lsmith77
Copy link
Member

@ClementGautier can you have a look?

@lsmith77
Copy link
Member

can you paste the exception?

@pyrech
Copy link
Contributor Author

pyrech commented Mar 27, 2014

After some research, this don't seem to be related to FOSRestBundle because when i remove the Regex requirement, the issue is still here. I don't understand why because it worked before I update some vendors. I think the problem is more in the jms/serializer repos.

Can you just confirm me that I'm using the feature the right way?

@pyrech
Copy link
Contributor Author

pyrech commented Mar 27, 2014

This is definitely due to a bug in jms/serializer, not in this bundle because after removing the requirement, it still happen. Sorry for this is issue.

@lsmith77
Copy link
Member

ok ..

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

No branches or pull requests

2 participants