Skip to content

Commit

Permalink
Change explode array param test
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Cha <[email protected]>
  • Loading branch information
Alan-Cha committed May 13, 2020
1 parent 7c2573c commit d462801
Show file tree
Hide file tree
Showing 15 changed files with 1,544 additions and 9,934 deletions.
10,883 changes: 1,207 additions & 9,676 deletions packages/openapi-to-graphql-cli/package-lock.json

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion packages/openapi-to-graphql/lib/oas_3_tools.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/openapi-to-graphql/lib/oas_3_tools.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion packages/openapi-to-graphql/lib/resolver_builder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/openapi-to-graphql/lib/resolver_builder.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/openapi-to-graphql/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions packages/openapi-to-graphql/src/oas_3_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,19 +422,18 @@ export function instantiatePathAndGetQuery(

// Query parameters
case 'query':
//
// Spec-compliant query string serialization:
// http://spec.openapis.org/oas/v3.0.3#style-examples
//
// Whenever the query string value is an array, we check if it
// should be `exploded`. In this case, we don't serialize anything.
// Otherwise, the array will be joined in comma-separated fashion.
//
//
/**
* Spec-compliant query string serialization:
* http:pec.openapis.org/oas/v3.0.3#style-examples
*
* Whenever the query string value is an array, we check if it
* should be `exploded`. In this case, we don't serialize anything.
* Otherwise, the array will be joined in comma-separated fashion.
*/
const arg = args[sanitizedParamName]
const shouldBeCommaSeparated = Array.isArray(arg) && !param.explode

query[param.name] = shouldBeCommaSeparated ? arg.join(",") : arg
query[param.name] = shouldBeCommaSeparated ? arg.join(',') : arg
break

// Header parameters
Expand Down
Loading

0 comments on commit d462801

Please sign in to comment.