Skip to content

Commit 958b09e

Browse files
authored
query as list (#44)
1 parent 470866d commit 958b09e

2 files changed

Lines changed: 91 additions & 14 deletions

File tree

.github/workflows/runTests.yaml

Lines changed: 83 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ jobs:
3131
useComplexSwagger: ${{ github.event.inputs.useComplexSwagger }}
3232
- run: npm run test:typescript-axios
3333

34+
- uses: actions/upload-artifact@v4
35+
if: always()
36+
with:
37+
name: test-typescript-axios
38+
path: test*
39+
retention-days: 1
40+
if-no-files-found: error
41+
overwrite: true
42+
3443
test-typescript-models:
3544
name: Test Typescript Models
3645
runs-on: ubuntu-latest
@@ -44,6 +53,15 @@ jobs:
4453
useComplexSwagger: ${{ github.event.inputs.useComplexSwagger }}
4554
- run: npm run test:typescript-models
4655

56+
- uses: actions/upload-artifact@v4
57+
if: always()
58+
with:
59+
name: test-typescript-models
60+
path: test*
61+
retention-days: 1
62+
if-no-files-found: error
63+
overwrite: true
64+
4765
test-typescript-reactquery:
4866
name: Test Typescript ReactQuery
4967
runs-on: ubuntu-latest
@@ -56,7 +74,16 @@ jobs:
5674
with:
5775
useComplexSwagger: ${{ github.event.inputs.useComplexSwagger }}
5876
- run: npm run test:typescript-react-query
59-
77+
78+
- uses: actions/upload-artifact@v4
79+
if: always()
80+
with:
81+
name: test-typescript-reactquery
82+
path: test*
83+
retention-days: 1
84+
if-no-files-found: error
85+
overwrite: true
86+
6087
test-csharp:
6188
name: Test C#
6289
runs-on: ubuntu-latest
@@ -74,23 +101,39 @@ jobs:
74101

75102
- run: npm run test:csharp
76103

104+
- uses: actions/upload-artifact@v4
105+
if: always()
106+
with:
107+
name: test-csharp
108+
path: test*
109+
retention-days: 1
110+
if-no-files-found: error
111+
overwrite: true
112+
77113
test-csharp-nullable-false:
78114
name: Test C# nullable false
79115
runs-on: ubuntu-latest
80116
steps:
81-
- name: Checkout code
82-
uses: actions/checkout@v4
83-
84-
- name: Prepare Environment
85-
uses: ./.github/actions/prepare-env
86-
with:
87-
useComplexSwagger: ${{ github.event.inputs.useComplexSwagger }}
88-
89-
- name: Install .NET
90-
uses: actions/setup-dotnet@v3
91-
92-
- run: npm run test:csharp2
117+
- name: Checkout code
118+
uses: actions/checkout@v4
119+
- name: Prepare Environment
120+
uses: ./.github/actions/prepare-env
121+
with:
122+
useComplexSwagger: ${{ github.event.inputs.useComplexSwagger }}
123+
- name: Install .NET
124+
uses: actions/setup-dotnet@v3
93125

126+
- run: npm run test:csharp2
127+
128+
- uses: actions/upload-artifact@v4
129+
if: always()
130+
with:
131+
name: test-csharp-nullable-false
132+
path: test*
133+
retention-days: 1
134+
if-no-files-found: error
135+
overwrite: true
136+
94137
test-python:
95138
name: Test Python
96139
runs-on: ubuntu-latest
@@ -108,6 +151,15 @@ jobs:
108151

109152
- run: pip install pylint requests
110153
- run: npm run test:python
154+
155+
- uses: actions/upload-artifact@v4
156+
if: always()
157+
with:
158+
name: test-python
159+
path: test*
160+
retention-days: 1
161+
if-no-files-found: error
162+
overwrite: true
111163

112164
test-go:
113165
name: Test Go
@@ -121,6 +173,15 @@ jobs:
121173
with:
122174
useComplexSwagger: ${{ github.event.inputs.useComplexSwagger }}
123175
- run: npm run test:go
176+
177+
- uses: actions/upload-artifact@v4
178+
if: always()
179+
with:
180+
name: test-go
181+
path: test*
182+
retention-days: 1
183+
if-no-files-found: error
184+
overwrite: true
124185

125186
test-go-server:
126187
name: Test Go Server
@@ -134,3 +195,12 @@ jobs:
134195
with:
135196
useComplexSwagger: ${{ github.event.inputs.useComplexSwagger }}
136197
- run: npm run test:go-server
198+
199+
- uses: actions/upload-artifact@v4
200+
if: always()
201+
with:
202+
name: test-go-server
203+
path: test*
204+
retention-days: 1
205+
if-no-files-found: error
206+
overwrite: true

src/generators/client/CSharpClientGenerator.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ ${controllerPropsCtor}
8686
url = url.replace('{' + pathParam.name + '}', `{p${capitalize(pathParam.name)}}`);
8787
}
8888
const haveQueryParams = controllerPath.queryParams.length > 0;
89-
url += !haveQueryParams ? '' : '?' + controllerPath.queryParams.map(x => `${x.name}={q${capitalize(x.name)}}`).join('&');
89+
url += !haveQueryParams
90+
? ''
91+
: '?' + controllerPath.queryParams.map(x => {
92+
if (this.getPropDesc(x.schema!).includes('[]')) {
93+
return `{string.Join("&", q${capitalize(x.name)}.Select(x => $"${x.name}={x}"))}`;
94+
}
95+
return `${x.name}={q${capitalize(x.name)}}`;
96+
}).join('&');
9097
const queryParams = haveQueryParams
9198
? controllerPath.queryParams
9299
.map(

0 commit comments

Comments
 (0)