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

Cannot pass dynamic query parameters in GET request #441

Closed
sabbiu opened this issue Nov 5, 2020 · 2 comments
Closed

Cannot pass dynamic query parameters in GET request #441

sabbiu opened this issue Nov 5, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@sabbiu
Copy link

sabbiu commented Nov 5, 2020

Describe the bug
After adding a parameter that is supposed do allow dynamic query parameters, it gives error.

The idea of dynamic query parameters is taken from here (stack-overflow)

Query Example:

/pets:
    get:
      description: |
        Returns all pets
      operationId: findPets
      parameters:
        - name: params
          in: query
          required: false
          schema:
            type: object
            # If the parameter values are of specific type, e.g. string:
            # additionalProperties:
            #   type: string
            # If the parameter values can be of different types
            # (e.g. string, number, boolean, ...)
            additionalProperties: true

          # `style: form` and `explode: true` is the default serialization method
          # for query parameters, so these keywords can be omitted
          style: form
          explode: true
      responses:
        '200':
          description: pet response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Pet'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

Executing a query, returns

{"message":"Cannot convert undefined or null to object"}

To Reproduce

  • Clone this repository
  • run npm install
  • run npm start
  • run curl http://localhost:3000/v1/pets\?type\=dog\&limit\=10\&test\=query

Expected behavior
It must allow all the query strings

@sabbiu sabbiu changed the title Dynamic query parameters in GET request Cannot pass dynamic query parameters in GET request Nov 5, 2020
@cdimascio cdimascio added the bug Something isn't working label Nov 5, 2020
@cdimascio
Copy link
Owner

cdimascio commented Nov 6, 2020

@sabbiu thanks for the issue. really appreciate the repo with repro steps.
this is fixed in v4.4.1

@sabbiu

This comment has been minimized.

ex1st pushed a commit to ex1st/express-openapi-validator that referenced this issue Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants