Skip to content

Commit 2d19408

Browse files
committed
ci: regenerated with OpenAPI Doc 0.1.0, Speakeay CLI 0.14.2
1 parent 07f63d4 commit 2d19408

File tree

7 files changed

+218
-38
lines changed

7 files changed

+218
-38
lines changed

gen.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
management:
2-
openapi-checksum: 46093b002f359f8049d6b8210be2bc73
2+
openapi-checksum: eb72fa251c1471dd090eb0b974395d58
33
openapi-version: 0.1.0
4-
speakeasy-version: 0.13.6
4+
speakeasy-version: 0.14.2
55
telemetryenabled: null
66
typescript:
77
author: Speakeasy
88
packagename: '@speakeasy-api/speakeasy-client-sdk-typescript'
9-
version: 0.3.3
9+
version: 0.4.0

package-lock.json

Lines changed: 151 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@speakeasy-api/speakeasy-client-sdk-typescript",
3-
"version": "0.3.3",
3+
"version": "0.4.0",
44
"author": "Speakeasy",
55
"scripts": {
66
"lint:fix": "tsc --noemit && eslint \"./src\" --ext .ts,.tsx --fix",

src/internal/utils/pathparams.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { parseParamDecorator } from "./utils";
2+
13
export const ppMetadataKey = "pathParam";
24

35
export function getSimplePathParams(
@@ -20,10 +22,26 @@ export function getSimplePathParams(
2022
pathParams.set(paramName, ppVals.join(","));
2123
} else if (paramValue instanceof Object) {
2224
Object.getOwnPropertyNames(paramValue).forEach((paramName: string) => {
25+
const ppAnn: string = Reflect.getMetadata(
26+
ppMetadataKey,
27+
paramValue,
28+
paramName
29+
);
30+
if (ppAnn == null) return;
31+
const ppDecorator: ParamDecorator = parseParamDecorator(
32+
ppAnn,
33+
paramName,
34+
"simple",
35+
explode
36+
);
37+
if (ppDecorator == null) return;
38+
2339
const paramFieldValue = paramValue[paramName];
40+
2441
if (isEmpty(paramFieldValue)) return;
25-
else if (explode) ppVals.push(`${paramName}=${paramFieldValue}`);
26-
else ppVals.push(`${paramName},${paramFieldValue}`);
42+
else if (explode)
43+
ppVals.push(`${ppDecorator.ParamName}=${paramFieldValue}`);
44+
else ppVals.push(`${ppDecorator.ParamName},${paramFieldValue}`);
2745
});
2846
pathParams.set(paramName, ppVals.join(","));
2947
} else {

src/internal/utils/queryparams.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function getQueryParamSerializer(
99
queryParams: any
1010
): ParamsSerializerOptions {
1111
let paramsSerializer: ParamsSerializerOptions = {
12-
encode: formSerializerExplode,
12+
serialize: formSerializerExplode,
1313
};
1414
if (queryParams == null) return paramsSerializer;
1515
const fieldNames: string[] = Object.getOwnPropertyNames(queryParams);
@@ -19,7 +19,7 @@ export function getQueryParamSerializer(
1919
queryParams,
2020
fname
2121
);
22-
if (qpAnn == null) return { encode: (params: unknown) => "" };
22+
if (qpAnn == null) return { serialize: (params: any) => "" };
2323
const qpDecorator: ParamDecorator = parseParamDecorator(
2424
qpAnn,
2525
fname,
@@ -29,27 +29,27 @@ export function getQueryParamSerializer(
2929
if (qpDecorator == null) return;
3030
if (qpDecorator.Serialization === "json")
3131
paramsSerializer = {
32-
encode: (params: unknown) => {
32+
serialize: (params: any) => {
3333
return JSON.stringify(params);
3434
},
3535
};
3636
else {
3737
switch (qpDecorator.Style) {
3838
case "deepObject":
3939
paramsSerializer = {
40-
encode: (params: unknown) => {
40+
encode: (params: any) => {
4141
return qs.stringify(params, { arrayFormat: "repeat" });
4242
},
4343
};
4444
break;
4545
case "form":
4646
if (qpDecorator.Explode) {
4747
paramsSerializer = {
48-
encode: formSerializerExplode,
48+
serialize: formSerializerExplode,
4949
};
5050
} else {
5151
paramsSerializer = {
52-
encode: formSerializer,
52+
serialize: formSerializer,
5353
};
5454
}
5555
break;
@@ -62,7 +62,7 @@ export function getQueryParamSerializer(
6262
return paramsSerializer;
6363
}
6464

65-
function formSerializer(params: unknown): string {
65+
function formSerializer(params: any): string {
6666
const query: string[] = [];
6767
Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
6868
if (value !== Object(value)) query.push(`${key}=${value}`);
@@ -79,7 +79,7 @@ function formSerializer(params: unknown): string {
7979
return query.join("&");
8080
}
8181

82-
function formSerializerExplode(params: unknown): string {
82+
function formSerializerExplode(params: any): string {
8383
const query: string[] = [];
8484
Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
8585
if (value !== Object(value)) query.push(`${key}=${value}`);

0 commit comments

Comments
 (0)