You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello all,
I've been using Bref successfully to deploy Symfony Lambdas on AWS using php-fpm (REST API) and everything works as intended, really great work there.
I've encountered an issue lately with query strings that I was not able to solve, and it blocking me right in the development.
Background
The feature I am working on is supposed to give users the ability to perform pagination/filtering/sorting on the result set when interacting with the api, so instead of getting the complete result set (which can be 100s items), to do that I rely on users using query parameters to let me know what they want.
an user could issue the following request /items?variables[*].name=contains:test
to target the appropriate fields.
Problem
So far so good but with Bref, as soon as I receive the query params everything after the square brackets [] disappears.... query params like variables[*].name=contains:test becomes variables[*]=contains:test
I had the same issue with Symfony (that does apparently the exact same thing) while testing locally , but I was able to the access the original query string using $_SERVER['QUERY_STRING'], but I am not able to do the same within Bref on a Lambda as the $_SERVER is populated by Bref itself apparently so it already contains changes.
I tried various approaches but nothing seem to help.
Checking the Lambda logs it seems to be receiving and forwarding correctly the query string the user is sending Method request query string: {contents[*].elements[*].type=contains:button, meta['title']=exists:true}
but then it gets passed to Bref and something is lost.
Is there a way to access the original event that was sent originally so that I can possibly parse it by myself or get the original query string? I tried to look around but I have not found a reliable way to do it.
PS: Sorry if this was a long post but I wanted to give you clear background.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello all,
I've been using Bref successfully to deploy Symfony Lambdas on AWS using php-fpm (REST API) and everything works as intended, really great work there.
I've encountered an issue lately with query strings that I was not able to solve, and it blocking me right in the development.
Background
The feature I am working on is supposed to give users the ability to perform pagination/filtering/sorting on the result set when interacting with the api, so instead of getting the complete result set (which can be 100s items), to do that I rely on users using query parameters to let me know what they want.
Ex:
/items?updatedOn=between:2024-12-03T11:16:59,2024-12-03T13:16:59
will return only those items with an updatedOn date between the ones specified.
Users will use, as part of the specs provided, JSONPath syntax to pinpoint the property they want to apply a filter to.
This works great but as soon as I have arrays to be handled the query parameters that reach the application are missing information
Ex: assuming the following item structure
an user could issue the following request
/items?variables[*].name=contains:test
to target the appropriate fields.
Problem
So far so good but with Bref, as soon as I receive the query params everything after the square brackets [] disappears.... query params like
variables[*].name=contains:test
becomesvariables[*]=contains:test
I had the same issue with Symfony (that does apparently the exact same thing) while testing locally , but I was able to the access the original query string using
$_SERVER['QUERY_STRING']
, but I am not able to do the same within Bref on a Lambda as the $_SERVER is populated by Bref itself apparently so it already contains changes.I tried various approaches but nothing seem to help.
Checking the Lambda logs it seems to be receiving and forwarding correctly the query string the user is sending
Method request query string: {contents[*].elements[*].type=contains:button, meta['title']=exists:true}
but then it gets passed to Bref and something is lost.
Something is mentioned on the docs page here about URI parameters
https://bref.sh/docs/use-cases/http#differences-in-uri-query-parameters
Is there a way to access the original event that was sent originally so that I can possibly parse it by myself or get the original query string? I tried to look around but I have not found a reliable way to do it.
PS: Sorry if this was a long post but I wanted to give you clear background.
Beta Was this translation helpful? Give feedback.
All reactions