Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How/where to insert multiValueQueryStringParameters? #19

Open
gilneto8 opened this issue Feb 19, 2020 · 4 comments
Open

How/where to insert multiValueQueryStringParameters? #19

gilneto8 opened this issue Feb 19, 2020 · 4 comments

Comments

@gilneto8
Copy link

Hi,

Right now I'm trying to test a deployment I made where I'm checking if one or more values are present on a specific field in any item. As such, this is what I'm sending:

--additional-params {\"queryParams\":{\"tag\":\"Rust\",\"tag\":\"nodejs\",\"op\":\"or\"}}

I can use the tag parameter on the multiValueQueryStringParameters object, as such:

{
  "queryStringParameters": {
    "op": "or"
  },
  "multiValueQueryStringParameters": {
    "tag": ["Rust","nodejs"]
  },
  "requestContext": {
    "identity": {
      "cognitoIdentityId": "admin123"
    }
  }
}

this logic is ok when I'm testing locally, but isn't working against dynamodb using the aws-api-gateway-cli-test, while there are values to be returned for such a query. What am I missing?

Gil

@jayair
Copy link
Member

jayair commented Feb 23, 2020

I'm not sure I completely follow. Are you passing the multiValueQueryStringParameters as a CLI option?

@gilneto8
Copy link
Author

Let me try to be clearer, then.

On the AWS documentation, it states that when you pass repeated query string values, the object sent to Dynamo gets a specific field with all the possible values for any field. In this case, I want to use an URL that has the following structure:

.../notes?tag=Rust&tag=nodejs

and the object created by the API Gateway contains this part:

queryStringParameters: { tag: 'nodejs' },
multiValueQueryStringParameters: { tag: [ 'Rust', 'nodejs' ] },

As I'm interested in all the values for the query field, I have to access the multiValueQueryStringParameters. This works locally when I try to mock the service with a hardcoded request with this parameter, like in the code snippet I sent originally.

However, when I try to use the CLI, I don't know how to pass these multi-valued parameters. That's my question here: how do I do this?

Cheers.

@jayair
Copy link
Member

jayair commented Mar 1, 2020

I see. We internally use aws-api-gateway-client and I don't think they support that. So I'm not entirely sure how to do this.

@jayair
Copy link
Member

jayair commented Mar 1, 2020

I should add, if anybody wants to investigate, this is something we should add support for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants