diff --git a/RELEASES.md b/RELEASES.md index f37150f..28588f4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -204,4 +204,12 @@ Based on: - OpenAPI Doc 1.0 https://prod.speakeasyapi.dev/v1/apis/Structure/version/1.0.0/schema/download - Speakeasy CLI 1.31.1 (2.27.0) https://github.com/speakeasy-api/speakeasy ### Releases -- [NPM v0.10.0] https://www.npmjs.com/package/structure-ac/v/0.10.0 - . \ No newline at end of file +- [NPM v0.10.0] https://www.npmjs.com/package/structure-ac/v/0.10.0 - . + +## 2023-05-16 00:36:22 +### Changes +Based on: +- OpenAPI Doc 1.0 https://prod.speakeasyapi.dev/v1/apis/Structure/version/1.0.0/schema/download +- Speakeasy CLI 1.32.0 (2.28.0) https://github.com/speakeasy-api/speakeasy +### Releases +- [NPM v0.11.0] https://www.npmjs.com/package/structure-ac/v/0.11.0 - . \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index 4723b58..36556eb 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,14 +2,14 @@ configVersion: 1.0.0 management: docChecksum: e0bf2d205ca94a0d32bd91d6ea558d5b docVersion: "1.0" - speakeasyVersion: 1.31.1 - generationVersion: 2.27.0 + speakeasyVersion: 1.32.0 + generationVersion: 2.28.0 generation: - telemetryEnabled: false sdkClassName: structure singleTagPerOp: false + telemetryEnabled: false typescript: - version: 0.10.0 + version: 0.11.0 author: structure maxMethodParams: 0 packageName: structure-ac diff --git a/package-lock.json b/package-lock.json index 5758255..590aa58 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "structure-ac", - "version": "0.10.0", + "version": "0.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "structure-ac", - "version": "0.10.0", + "version": "0.11.0", "dependencies": { "axios": "^1.1.3", "class-transformer": "^0.5.1", diff --git a/package.json b/package.json index 16db140..66159ff 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "structure-ac", - "version": "0.10.0", + "version": "0.11.0", "author": "structure", "scripts": { "prepare": "tsc --build" diff --git a/src/internal/utils/queryparams.ts b/src/internal/utils/queryparams.ts index 204f3d7..cd39120 100755 --- a/src/internal/utils/queryparams.ts +++ b/src/internal/utils/queryparams.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import {ParamDecorator, parseParamDecorator, populateFromGlobals, valToString} from "./utils"; +import {ParamDecorator, parseParamDecorator, populateFromGlobals, shouldQueryParamSerialize, valToString} from "./utils"; import {requestMetadataKey} from "./requestbody"; @@ -102,7 +102,7 @@ function noExplodeSerializer(params: Record, delimiter = ","): stri const query: string[] = []; Object.entries(Object.assign({}, params)).forEach(([key, value]) => { - if (!value) return; + if (!shouldQueryParamSerialize(value)) return; if (value !== Object(value)) query.push(`${key}=${encodeURIComponent(valToString(value))}`); else if (Array.isArray(value)) { @@ -141,7 +141,7 @@ function formSerializerExplode(params: Record): string { const query: string[] = []; Object.entries(Object.assign({}, params)).forEach(([key, value]) => { - if (!value) return; + if (!shouldQueryParamSerialize(value)) return; if (value !== Object(value)) query.push(`${key}=${encodeURIComponent(value)}`); else if (Array.isArray(value)) { @@ -184,7 +184,7 @@ function deepObjectSerializer(params: Record): string { const query: string[] = []; Object.entries(Object.assign({}, params)).forEach(([key, value]) => { - if (!value) return; + if (!shouldQueryParamSerialize(value)) return; if (value !== Object(value)) query.push(`${key}=${encodeURIComponent(value)}`); else if (Array.isArray(value)) { diff --git a/src/internal/utils/utils.ts b/src/internal/utils/utils.ts index 7d76b6c..4388e25 100755 --- a/src/internal/utils/utils.ts +++ b/src/internal/utils/utils.ts @@ -4,11 +4,11 @@ import "reflect-metadata"; -import { getSimplePathParams, ppMetadataKey } from "./pathparams"; +import {getSimplePathParams, ppMetadataKey} from "./pathparams"; -import { plainToInstance } from "class-transformer"; -import { RFCDate } from "../../sdk/types"; -import { requestMetadataKey } from "./requestbody"; +import {plainToInstance} from "class-transformer"; +import {RFCDate} from "../../sdk/types"; +import {requestMetadataKey} from "./requestbody"; export const SerializationMethodToContentType: Record = { json: "application/json", @@ -396,3 +396,7 @@ export function valToString(value: any): string { return value.toString(); } + +export function shouldQueryParamSerialize(value: any): boolean { + return !(value === undefined || value === null || value === "") +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 3c95322..a00361d 100755 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -59,8 +59,8 @@ export class Structure { public _securityClient: AxiosInstance; public _serverURL: string; private _language = "typescript"; - private _sdkVersion = "0.10.0"; - private _genVersion = "2.27.0"; + private _sdkVersion = "0.11.0"; + private _genVersion = "2.28.0"; private _globals: any; constructor(props?: SDKProps) {