Browse Source

Merge pull request #522 from provokateurin/fix/dynamite-query-parameter-arrays

fix(dynamite): Fix query parameter arrays
pull/523/head
Kate 1 year ago committed by GitHub
parent
commit
c33a194cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/dynamite/dynamite/lib/src/openapi_builder.dart

4
packages/dynamite/dynamite/lib/src/openapi_builder.dart

@ -466,8 +466,6 @@ class OpenAPIBuilder implements Builder {
final value = result.encode(
_toDartName(parameter.name),
onlyChildren: result is TypeResultList && parameter.in_ == 'query',
// Objects inside the query always have to be interpreted in some way
mimeType: 'application/json',
);
if (defaultValueCode != null && parameter.in_ == 'query') {
code.write('if (${_toDartName(parameter.name)} != $defaultValueCode) {');
@ -480,7 +478,7 @@ class OpenAPIBuilder implements Builder {
break;
case 'query':
code.write(
"queryParameters['${parameter.name}${result is TypeResultList ? '[]' : ''}'] = $value;",
"queryParameters['${parameter.name}'] = $value;",
);
break;
case 'header':

Loading…
Cancel
Save