swagger-api / swagger-api/swagger-ui

Array values of exploded deepObject query parameter are not URL-encoded

Open
#6,672 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Individual array values of a deepObject query parameter defined with explode = true are not URL-encoded during serialization and sent as is. For example:

prop:
      name: prop
      in: query
      schema:
        type: object
        properties:
          myKey: { type: array, items: string }
      style: deepObject
      explode: true

with prop set to

{ "myKey": ["aaa+bbb"] }

is serialized to "prop[myKey]=aaa+bbb" instead of "prop[myKey]=aaa&2bbbb" and is received on the back end as "prop[myKey]=aaa bbb".

  • Method of installation: dist assets
  • Swagger-UI version: 3.37.2
  • Swagger/OpenAPI version: OpenAPI 3.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the OpenAPI 3 deepObject example with explode=true and the array value "aaa+bbb", then trace the query-parameter serialization path used by the dist assets. Verify that the generated parameter preserves the plus sign through URL encoding and add or update coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.