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

Incorrect parameter serializiation #1016

Closed
bezin opened this issue Aug 15, 2019 · 2 comments
Closed

Incorrect parameter serializiation #1016

bezin opened this issue Aug 15, 2019 · 2 comments

Comments

@bezin
Copy link

bezin commented Aug 15, 2019

Hi there,

I currently use the redoc-cli to generate an API spec. I have an parameter id, that takes an array of UUIDs.

The spec part:

    parameters:
        - name: id
          in: query
          schema: 
            type: array
            style: form
            explode: true
            maxItems: 50
            items:
              type: string
              format: uuid
            example: 
              - '08759264-10b4-49eb-9d44-bef8080e7922'
              - '08759264-20a4-49eb-9d44-bef8080e7922'
              - '08759264-30a5-49eb-9d44-bef8080e7922'

In the HTML output, the example still appears as comma separated values, rather than several chained id parameters.

190815_120854_EventDB General API Spec 0 2 1

Any idea on what could possibly cause this?

Cheers

@AlessandroGreco71
Copy link

I have the same issue.
Using: <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>

Started noticing this not too long ago.

@TheM1984
Copy link

TheM1984 commented Aug 23, 2019

According to https://swagger.io/docs/specification/serialization/ your desired formatting should be default.

Workaround: you have the style and explode settings on the wrong level. It should be the parameter level not the schema level.

parameters:
    - name: id
      in: query
      style: form
      explode: true
      schema: 
        type: array
        maxItems: 50
        items:
          type: string
          format: uuid
        example: 
          - '08759264-10b4-49eb-9d44-bef8080e7922'
          - '08759264-20a4-49eb-9d44-bef8080e7922'
          - '08759264-30a5-49eb-9d44-bef8080e7922'

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

3 participants