docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

spaceDelimited option is not working

Open jerearaujo03 opened this issue 1 year ago • 2 comments

Describe the bug

The query param serialization with spaceDelimited option is not working as expected

Expected behavior

The query param values in the URL should be separated by spaces -> v2/authorize/?enrollment_amr_values=pin liveness

Current behavior

The query param values in the URL are separated by comma (',') ->v2/authorize/?enrollment_amr_values=pin,liveness

image

Steps to reproduce

  1. Define this param for a GET request
- name: enrollment_amr_values
      in: query
      description: Specifies the methods to be used for the authorization
      schema:
        $ref: '#/components/schemas/enrollment_amr_values'
      style: spaceDelimited
      explode: false
      examples:
        Pin:
          value: pin
        Liveness:
          value: liveness
        Pin and Liveness:
          value: pin liveness
      required: false

...

components:
  schemas:
    enrollment_amr_values:
      type: array
      items:
        type: string
        uniqueItems: true
        default: [pin]
        enum:
          - pin
          - liveness
  1. Go to the documentation page and select many values for the enrollment_amr_values param

image

Context

I'm working on an oauth2 provider

Your Environment

  • Version used: docusaurus-plugin-openapi-docs: 3.0.0-beta-5 @docusaurus/core: 3.1.1
  • Environment name and version: Chrome 122.0.6261.129 , node 20.11.0
  • Operating System and version: macOS 14.0

jerearaujo03 avatar Mar 19 '24 15:03 jerearaujo03

Hi @jerearaujo03, thanks for reporting this issue. I'll include it in our roadmap - the goal would be to provide complete coverage of all OpenAPI parameter serialization options as specified here: https://swagger.io/docs/specification/serialization/

sserrata avatar Jun 28 '24 18:06 sserrata

@sserrata Hi:)

I also ran into this problem, my multi-select query params are not being "exploded" as they should.

Is there an ETA on a fix for this? It currently renders many of my routes incorrect when trying to launch from the browser and/or copying a snippet.

Thanks!

hadar-co avatar Sep 02 '24 15:09 hadar-co