FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

Param Fetcher - Name with dot

Open matiux opened this issue 10 years ago • 2 comments

HI, I would like to use name with dot. For example name="customer.name" But when I try to use this syntax in the query string, the param is not fetch:

.../some/route?param=ok&customer.name=isnotok

Thanks

matiux avatar Aug 20 '15 21:08 matiux

can you create a test case for this?

lsmith77 avatar Aug 22 '15 20:08 lsmith77

FYI this is an issue with PHP, not with FOSRestBundle. See http://stackoverflow.com/questions/68651/get-php-to-stop-replacing-characters-in-get-or-post-arrays.

Symfony has the same issue in HttpFoundation and they said

Closing this one as this is just the way PHP parses HTTP requests and we won't workaround that.

See https://github.com/symfony/symfony/issues/9009

For anyone wondering what the simplest solution is - just change your annotation to:

@QueryParam(name="customer_name")

or do $paramFetcher->get("customer_name") and it will find it.

davidjwilkins avatar Feb 02 '17 18:02 davidjwilkins