Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7973
Closed
Open
Issue created Nov 18, 2020 by Administrator@rootContributor3 of 6 checklist items completed3/6 checklist items

[BUG] [typescript-axios] Query parameters do not support `explode: true, style: form`

Created by: dantman

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

OpenAPI supports parameters defined with the following.

name: color
in: query
style: form
explode: true

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#style-values

Parameters defined like this and given an array output query strings like color=blue&color=black&color=brown.

However currently a typescript-axios client made by openapi-generator would instead output color=blue%2Cblack%2Cbrown.

openapi-generator version
$ openapi-generator version
5.0.0-beta2
OpenAPI declaration file content or url
parameters:
- name: color
  in: query
  style: form
  explode: true
  schema:
    type: array
    item:
      type: array
        - in: query
          name: Balance.Currency
          style: form
          explode: true
          schema:
            type: string
Generation Details
openapi-generator generate -i openapi.yaml -g typescript-axios -c config.yaml
Suggest a fix

I think that apiInner.mustache needs to be updated to include handling for this type of collection format.

https://github.com/OpenAPITools/openapi-generator/blob/78611b3e387128b5f768865e4dfa8b4736ba571c/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache#L107-L138

Assignee
Assign to
Time tracking