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

add x-delimiter for style/explode customization #64

Open
karenetheridge opened this issue Oct 4, 2023 · 3 comments
Open

add x-delimiter for style/explode customization #64

karenetheridge opened this issue Oct 4, 2023 · 3 comments

Comments

@karenetheridge
Copy link
Owner

I would like to do this:

components:
  headers:
    Surrogate-Key:
      description: see https://docs.fastly.com/en/guides/working-with-surrogate-keys
      style: simple  # default
      explode: false # default
      x-delimiter: ' '
      schema:
        type: array
        items:
          type: string
          pattern: ^myapp-

..because this header is formatted as space-separated strings, rather than comma-separated.

@karenetheridge
Copy link
Owner Author

karenetheridge commented Oct 4, 2023

I would suggest that the delimiter be expressed as a regular expression, rather than a string, for maximum flexibility.

This also naturally leads to us deriving the default values for various parameter types:

  • for path, delimiter defaults to , (when style=simple)
  • for header, delimiter defaults to \s*,\s* (where style=simple)
  • for query, delimiter defaults to & (when style=form)
  • for cookie, delimiter defaults to \s*;\s* (when style=form)

@karenetheridge
Copy link
Owner Author

note: do not trust https://swagger.io/docs/specification/serialization/#query - there are typos here!

@karenetheridge
Copy link
Owner Author

This is done in version 0.049.

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