openapi-generators / openapi-python-client

Generate modern Python clients from OpenAPI
MIT License
1.19k stars 189 forks source link

Using dictionary in query param #1064

Open siddhsql opened 3 weeks ago

siddhsql commented 3 weeks ago

Describe the bug I have an endpoint that takes in a dictionary as a query param:

- name: metadata
          in: query
          required: false
          style: deepObject
          explode: true
          schema:
            type: object
            additionalProperties:
              type: string

note this:

          style: deepObject
          explode: true

The openapi generator generates same code whether I have

          style: deepObject
          explode: true

present or not. I am using version 0.19.1.

The URL generated is like:

http://localhost:8080/foo?author=Joshua%20Bloch&publisher=Pearson%20Addison-Wesley

When

          style: deepObject
          explode: true

is present, the URL should be like:

http://localhost:8080/foo?metadata[author]=Joshua%20Bloch&metadata[publisher]=Pearson%20Addison-Wesley

refer: https://swagger.io/docs/specification/serialization/

OpenAPI Spec File see above

Desktop (please complete the following information):

Additional context Add any other context about the problem here.