FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

param fetcher convert integer query parameters to strings

Open hatemBBN opened this issue 7 years ago • 6 comments

i have this annotation @queryParam(name="page", requirements="\d+", nullable=true, default=1, allowBlank=false) i expect page to be integer but the value i get by $paramFetcher->get('page') is string am i missing something or it is intended behaviour?

hatemBBN avatar Jul 25 '18 15:07 hatemBBN

requirements="\d+" is only for validation so I think that it is the intended behaviour.

caciobanu avatar Jul 27 '18 11:07 caciobanu

Having the same issue when upgrading from 1.7 to latest.

ruudk avatar Aug 06 '18 11:08 ruudk

@ruudk Are you sure that this worked differently in 1.7?

xabbuh avatar Aug 06 '18 16:08 xabbuh

No sorry, something else changed. When you have allow blank without nullable the value becomes an empty string, that changed between 1.7 and up. Sorry for confusion.

ruudk avatar Aug 06 '18 18:08 ruudk

Esta tarea nunca se soluciono?

gonzaloalonsod avatar Mar 30 '23 13:03 gonzaloalonsod

@gonzaloalonsod You're commenting on an issue from 2018 .... in Spanish. Come on.

ruudk avatar Mar 30 '23 13:03 ruudk