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

OpenAPI 3.x.y support: add support for simple style for array and object encoding #3759

Closed
char0n opened this issue Jan 2, 2025 · 1 comment

Comments

@char0n
Copy link
Member

char0n commented Jan 2, 2025

OpenAPI 3.1.0 added support for the array and object type for simple style values. This change is specific to Parameter Object. OpenAPI 3.0 also aligned with this in 3.0.4 release.

OpenAPI 3.0.x
image

OpenAPI 3.1.0
image

The goal of this issue is to add support for pipeDelimited style into encodeObject OpenAPI 3.1.0 variant of the function.

@char0n char0n changed the title OpenAPI 3.x.y support: add support for simple style for array and object encoding OpenAPI 3.x.y support: add support for simple style for array and object encoding Jan 2, 2025
@glowcloud
Copy link
Contributor

We already support simple style for objects and arrays in OpenAPI 3.0.x.

We have test coverage for all of the cases:

The results of Try it out for each of the cases:

  • header - array with explode: false
curl -X 'POST' \ 'https://editor-next.swagger.io/header' \ -H 'accept: */*' \ -H 'arrayHeader: 1,2,3' \ -d ''
  • header - array with explode: true
curl -X 'POST' \ 'https://editor-next.swagger.io/headerExplode' \ -H 'accept: */*' \ -H 'arrayHeaderExplode: 1,2,3' \ -d ''
  • header - object with explode: false
curl -X 'POST' \ 'https://editor-next.swagger.io/header' \ -H 'accept: */*' \ -H 'objectHeader: a,string,b,string' \ -d ''
  • header - object with explode: true
curl -X 'POST' \ 'https://editor-next.swagger.io/headerExplode' \ -H 'accept: */*' \ -H 'objectHeaderExplode: a=string,b=string' \ -d ''
  • path - array with explode: false
curl -X 'POST' \ 'https://editor-next.swagger.io/1,2,3' \ -H 'accept: */*' \ -d ''
  • path - array with explode: true
curl -X 'POST' \ 'https://editor-next.swagger.io/1,2,3' \ -H 'accept: */*' \ -d ''
  • path - object with explode: false
curl -X 'POST' \ 'https://editor-next.swagger.io/a,string,b,string' \ -H 'accept: */*' \ -d ''
  • path - object with explode: true
curl -X 'POST' \ 'https://editor-next.swagger.io/a=string,b=string' \ -H 'accept: */*' \ -d ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants