Using bracketed query parameters in an API call with Nuxtjs

I have an API call structured as follows:

fetch( '/api/test-api-call?page[size]=500&page[number]=1')

which should allow me to get a query argument of

  page: {
    size: '500',
    number: '1'

However, it appears that when deployed to the Layer0 stack, the entire query string after the first [ is being stripped. So the logged URL ends up being /api/test-api-call?page and all other data on the query is totally stripped. This does not happen during local development trying to use layer0 dev or layer0 build && layer0 run.

The Nuxt app is using Express to serve an API endpoint back.
Code for app: GitHub - jeffpatzer/layer0-nuxt-api-test
Code for a deploy to test things:
Permalink =>

Visit the deploy and enter the following into your JS console to test. All calls below would be using the permalink to avoid caching

Call fails

fetch( '/api/test-api-call?page[size]=500&page[number]=1')
// Resp

Call works and returns correctly

fetch( '/api/test-api-call?page{size}=[500]&page{number}=[1]')
// Resp

fetch( '/api/test-api-call?page_size=500&page_number=1')
// Resp

Log line in the deploy server logs (notice the truncation)

Request details: GET

The local app works as expected

// Resp

It looks like there may indeed be an issue handling the open bracket in our serverless layer. We are investigating.

Mark, thanks for looking. Any success in fixing?

Nothing yet, it’s been on the backburner for the last week or so. I’ll see if we can get an update soon.

Hi Jeff, we have fixed this issue in v3.16.11. Thanks for reporting this!

1 Like

Testing the new version prove successful

1 Like