Skip to content
Discussion options

You must be logged in to vote

Hey! AdonisJS uses the qs package to parse the query string and by default, when nesting objects, qs will only parse up to 5 children. In the controller, you can manually parse a query string of any depth.

import qs from 'qs'
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'

export default class TestController {
  public async index({ request }: HttpContextContract) {
    const query = qs.parse(request.parsedUrl.query, { depth: 10 });
  }
}

Also you can try to override the query string somewhere in the middleware (I haven't tested) with Request.updateQs(...)

Here you can find more about how query string parsing works.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@abdalem
Comment options

@aikrom
Comment options

Answer selected by abdalem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants