File tree Expand file tree Collapse file tree 3 files changed +66
-0
lines changed
src/templates/core/functions Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ function getQueryString(params: Record<string, any>): string {
7
7
value.forEach(value => {
8
8
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
9
9
});
10
+ } else if (typeof value === 'object') {
11
+ Object.entries(value).forEach(([innerKey, value]) => {
12
+ const target = `${key}[${innerKey}]`
13
+ qs.push(`${encodeURIComponent(target)}=${encodeURIComponent(String(value))}`);
14
+ });
10
15
} else {
11
16
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
12
17
}
Original file line number Diff line number Diff line change @@ -2704,6 +2704,7 @@ export { ParametersService } from './services/ParametersService';
2704
2704
export { RequestBodyService } from './services/RequestBodyService';
2705
2705
export { ResponseService } from './services/ResponseService';
2706
2706
export { SimpleService } from './services/SimpleService';
2707
+ export { StyleService } from './services/StyleService';
2707
2708
export { TypesService } from './services/TypesService';
2708
2709
export { UploadService } from './services/UploadService';
2709
2710
"
@@ -4957,6 +4958,38 @@ export class SimpleService {
4957
4958
}"
4958
4959
`;
4959
4960
4961
+ exports[`v3 should generate: ./test/generated/v3/services/StyleService.ts 1`] = `
4962
+ "/* istanbul ignore file */
4963
+ /* tslint:disable */
4964
+ /* eslint-disable */
4965
+ import { request as __request } from '../core/request';
4966
+ import { OpenAPI } from '../core/OpenAPI';
4967
+
4968
+ export class StyleService {
4969
+
4970
+ /**
4971
+ * @param parameterDeepObject This is an object parameter that is send in deepObject style
4972
+ * @throws ApiError
4973
+ */
4974
+ public static async style(
4975
+ parameterDeepObject?: {
4976
+ propOne?: string,
4977
+ propTwo?: boolean,
4978
+ },
4979
+ ): Promise<void> {
4980
+ const result = await __request({
4981
+ method: 'GET',
4982
+ path: \`/api/v\${OpenAPI.VERSION}/style\`,
4983
+ query: {
4984
+ 'parameterDeepObject': parameterDeepObject,
4985
+ },
4986
+ });
4987
+ return result.body;
4988
+ }
4989
+
4990
+ }"
4991
+ `;
4992
+
4960
4993
exports[`v3 should generate: ./test/generated/v3/services/TypesService.ts 1`] = `
4961
4994
"/* istanbul ignore file */
4962
4995
/* tslint:disable */
Original file line number Diff line number Diff line change 792
792
]
793
793
}
794
794
},
795
+ "/api/v{api-version}/style" : {
796
+ "get" : {
797
+ "tags" : [
798
+ " style"
799
+ ],
800
+ "operationId" : " Style" ,
801
+ "parameters" : [
802
+ {
803
+ "description" : " This is an object parameter that is send in deepObject style" ,
804
+ "name" : " parameterDeepObject" ,
805
+ "in" : " query" ,
806
+ "style" : " deepObject" ,
807
+ "schema" : {
808
+ "type" : " object" ,
809
+ "properties" : {
810
+ "propOne" : {
811
+ "type" : " string"
812
+ },
813
+ "propTwo" : {
814
+ "type" : " boolean"
815
+ }
816
+ }
817
+ },
818
+ "collectionFormat" : " csv"
819
+ }
820
+ ]
821
+ }
822
+ },
795
823
"/api/v{api-version}/types" : {
796
824
"get" : {
797
825
"tags" : [
You can’t perform that action at this time.
0 commit comments