@platformatic/client
Advanced tools
Comparing version 0.42.0 to 0.42.1
@@ -127,3 +127,3 @@ 'use strict' | ||
for (const param of queryParams) { | ||
if (param.type === 'array') { | ||
if (isArrayQueryParam(param)) { | ||
args.query[param.name].forEach((p) => query.append(param.name, p)) | ||
@@ -146,3 +146,3 @@ } else { | ||
if (body[param.name] !== undefined) { | ||
if (param.type === 'array') { | ||
if (isArrayQueryParam(param)) { | ||
body[param.name].forEach((p) => query.append(param.name, p)) | ||
@@ -266,5 +266,6 @@ } else { | ||
// function handleQueryParameters(urlSearchParamObject, parameter) { | ||
function isArrayQueryParam ({ schema }) { | ||
return schema?.type === 'array' || schema?.anyOf?.some(({ type }) => type === 'array') | ||
} | ||
// } | ||
// TODO: For some unknown reason c8 is not picking up the coverage for this function | ||
@@ -271,0 +272,0 @@ async function graphql (url, log, headers, query, variables, openTelemetry, telemetryContext) { |
{ | ||
"name": "@platformatic/client", | ||
"version": "0.42.0", | ||
"version": "0.42.1", | ||
"description": "A client for all platformatic backends", | ||
@@ -26,3 +26,3 @@ "main": "index.js", | ||
"typescript": "^5.1.3", | ||
"@platformatic/telemetry": "0.42.0" | ||
"@platformatic/telemetry": "0.42.1" | ||
}, | ||
@@ -29,0 +29,0 @@ "dependencies": { |
@@ -13,7 +13,28 @@ { | ||
{ | ||
"name": "ids", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"in": "query", | ||
"type": "array", | ||
"items": "string" | ||
"name": "ids" | ||
}, | ||
{ | ||
"schema": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
} | ||
] | ||
}, | ||
"in": "query", | ||
"name": "stringArrayUnion" | ||
} | ||
@@ -24,2 +45,3 @@ ], | ||
"200": { | ||
"description": "This field is required", | ||
"content": { | ||
@@ -26,0 +48,0 @@ "application/json": { |
@@ -8,5 +8,6 @@ /// <reference types="@platformatic/service" /> | ||
isArray: Array.isArray(req.query.ids), | ||
ids: req.query.ids | ||
ids: req.query.ids, | ||
stringArrayUnion: req.query.stringArrayUnion | ||
} | ||
}) | ||
} |
@@ -656,3 +656,4 @@ 'use strict' | ||
query: { | ||
ids: ['id1', 'id2'] | ||
ids: ['id1', 'id2'], | ||
stringArrayUnion: ['foo', 'bar', 'baz'] | ||
} | ||
@@ -662,2 +663,3 @@ }) | ||
match(result.ids, ['id1', 'id2']) | ||
match(result.stringArrayUnion, ['foo', 'bar', 'baz']) | ||
} | ||
@@ -673,6 +675,8 @@ { | ||
const result = await client.getQuery({ | ||
ids: ['id1', 'id2'] | ||
ids: ['id1', 'id2'], | ||
stringArrayUnion: ['foo', 'bar', 'baz'] | ||
}) | ||
same(result.isArray, true) | ||
match(result.ids, ['id1', 'id2']) | ||
match(result.stringArrayUnion, ['foo', 'bar', 'baz']) | ||
} | ||
@@ -679,0 +683,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155341
5639