Skip to content

Support for MultiStringQueryParameter in ApiGateway V2 #125

@maxkre96

Description

@maxkre96

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Since the API Gateway V2 does not support the field MultiValueQueryStringParameters (see AWS Docs) anymore,
I would suggest to enable the framework to offer the possibility to parse comma separated query parameters to an array.

The API Gateway V2 provides multiValueQueryStringParameters like
example.com?query=Value0&query=Value1
using a comma separated query parameter just like:
queryStringParameters : { queryParameter: '"Value0,Value1" }.

Motivation

Enables Frameworks like nestjs to retrieve multi value queries such as ?value=one&value=twp to an array ['one', 'two'] without further modification just like in the API Gateway V1. It might be useful to implemented an adapter option which can be used to enable parsing comma separed query params or not.

Example

NestJS Example:

<url>?value='foo'&value='bar'

Should in the future results in an query object:
query: { value: ['foo', 'bar'] }

Currently the above mentioned query results in the following query object:
query: { value: 'bar' }

NestJs for Instance can then be used with a fastify backend without further data manipulation or transformation:
@Get() getHello(@Query('value') value: string[]): string { return value?.toString() // Return value: ['foo', 'bar'] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions