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

[] in query parameter name generates code that cannot be formatted #328

Open
Skyross opened this issue Mar 1, 2023 · 0 comments
Open

[] in query parameter name generates code that cannot be formatted #328

Skyross opened this issue Mar 1, 2023 · 0 comments

Comments

@Skyross
Copy link

Skyross commented Mar 1, 2023

When you have [] as prarameter name it fails to generate correct code. See this part of OpenAPI schema:

parameters:
  - in: query
    name: color[]
    schema:
      type: array
      items:
        type: string

Possible solutions:

  1. Correct schema to not use []
  2. Patch template to strip [] but handle possible name collisions like color and color[]
  3. Add some --no-code-format flag to allow generate invalid code to fix it later manually

What do you think about it?

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

No branches or pull requests

1 participant