-
Notifications
You must be signed in to change notification settings - Fork 271
explode
defaults to true
for query parameters
#7148
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
base: main
Are you sure you want to change the base?
Conversation
0e10183
to
5c43899
Compare
@microsoft-github-policy-service agree |
packages/openapi3/src/openapi.ts
Outdated
@@ -1544,7 +1544,7 @@ function createOAPIEmitter( | |||
|
|||
if (httpProperty.options.explode !== true) { | |||
// For query parameters(style: form) the default is explode: true https://spec.openapis.org/oas/v3.0.2#fixed-fields-9 | |||
attributes.explode = false; | |||
attributes.explode = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ogugu9 thanks for the contribution,
can you clarify a bit more why this is needed. That pr you linked exactly fixed this issue where the explode value in openapi3 didn't match what we had in the typespec.
The value of explode should always be seens as the same it just happens that we have different defaults so we need to reflect that.
Can you show an example of your issue in the playground https://typespec.io/playground
From #4167, the default value of
explode
in the query parameter has becomefalse
.However, according to the OpenAPI v3 specification, the default value of
explode
in the query parameter istrue
.Actually, the code comment says that
For query parameters(style: form) the default is explode: true
as opposed to the implementation.typespec/packages/openapi3/src/openapi.ts
Lines 1545 to 1548 in f5fbe0a
Therefore, I changed the default value of
explode
totrue
in this PR.