swift-openapi-generator icon indicating copy to clipboard operation
swift-openapi-generator copied to clipboard

Feature "Unexploded query params" is not supported.

Open barnard-b opened this issue 2 years ago • 2 comments

Using an Open API file that has a parameter with explode: false results in a warning of

Feature "Unexploded query params" is not supported, skipping [context: foundIn=Operations.launcher_list.Input.Query (#/paths/2.2.0/launcher/GET/query)/launcher_config__ids]

false values appear to be listed as unsupported in the documentation. image

  /launcher/:
    get:
      operationId: launcher_list
      parameters:
        - in: query
          name: launcher_config__ids
          schema:
            type: array
            items:
              type: integer
          description: Comma-separated launcher config IDs.
          explode: false
          style: form
      responses:
        "200":
          description: A success response with a greeting.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Greeting"

I am open to creating a PR, but this is my first time using Open API and would need guidance.

barnard-b avatar Jun 08 '23 15:06 barnard-b

Hi @barnard-b, thanks for reporting this! Indeed, explode: false isn't supported yet. The issue https://github.com/apple/swift-openapi-generator/issues/18 covers both explode: false and other styles, but we can keep this issue to only track adding support for explode: false.

We would definitely appreciate a PR! To learn more about contributing, check out these docs: https://swiftpackageindex.com/apple/swift-openapi-generator/0.1.0/documentation/swift-openapi-generator/contributing-to-swift-openapi-generator

And if you have any questions, don't hesitate to tag me here 🙂

czechboy0 avatar Jun 08 '23 15:06 czechboy0

Note that https://github.com/apple/swift-openapi-generator/pull/48 will be landing in a few hours, and it affects the code you'd be looking into, so I suggest you wait for it to land first. I can give you some pointers later.

In the meantime, it would be useful to write up, here in a comment, examples of the cases you'd like to add support for, and how it'd change the generated code. That's usually a good first step.

czechboy0 avatar Jun 08 '23 15:06 czechboy0

This will be released shortly in 0.1.8.

czechboy0 avatar Aug 08 '23 08:08 czechboy0