Skip to content

Query parameters: Conversion of array items does not work if parameter name ends with "[]" #369

@ahx

Description

@ahx

This is related to #253

Given you have a parameter definition like this, where the name ends with a "[]", because that is a standard you've agreed on.

parameters:
  - name: ids[]
    description: IDs of the things to get
    in: query
    schema:
      type: array
      items:
        type: integer

Expected behavior:
For a request like GET /things?ids[]=1&ids=[]=2, I would expect committee to convert the array items to integers as described in the API description.

Current behavior:
Array items do not get converted to integers, but remain strings.

I guess this is mostly due to Rack's default handling of "xx[]" parameters, as it handles those as an "xx" array by default, so this might be tricky.

Do you plan to support this? If so I would be happy to help.

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