Skip to content

Commit 99f62a8

Browse files
feat(api): properly produce empty request bodies (#4)
1 parent ba10691 commit 99f62a8

30 files changed

+13
-118
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 106
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-63491b1baa3dbc60caaec79becdece3854356b354909e4bb3f1ccaab80a6be20.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e2df4ddd41d8f2552c00f0f93c8b655c7bfb039bd62e654dd7ace9cdd8f9a9f.yml

account.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ func (r accountListLoginProvidersResponseJSON) RawJSON() string {
179179
}
180180

181181
type AccountGetParams struct {
182-
Body interface{} `json:"body,required"`
182+
Empty param.Field[bool] `json:"empty"`
183183
}
184184

185185
func (r AccountGetParams) MarshalJSON() (data []byte, err error) {
186-
return apijson.MarshalRoot(r.Body)
186+
return apijson.MarshalRoot(r)
187187
}
188188

189189
type AccountDeleteParams struct {

account_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import (
1313
"github.com/gitpod-io/flex-sdk-go/option"
1414
)
1515

16-
func TestAccountGet(t *testing.T) {
17-
t.Skip("skipped: tests are disabled for the time being")
16+
func TestAccountGetWithOptionalParams(t *testing.T) {
1817
baseURL := "http://localhost:4010"
1918
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2019
baseURL = envURL
@@ -27,7 +26,7 @@ func TestAccountGet(t *testing.T) {
2726
option.WithBearerToken("My Bearer Token"),
2827
)
2928
_, err := client.Accounts.Get(context.TODO(), gitpod.AccountGetParams{
30-
Body: map[string]interface{}{},
29+
Empty: gitpod.F(true),
3130
})
3231
if err != nil {
3332
var apierr *gitpod.Error
@@ -39,7 +38,6 @@ func TestAccountGet(t *testing.T) {
3938
}
4039

4140
func TestAccountDeleteWithOptionalParams(t *testing.T) {
42-
t.Skip("skipped: tests are disabled for the time being")
4341
baseURL := "http://localhost:4010"
4442
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
4543
baseURL = envURL
@@ -64,7 +62,6 @@ func TestAccountDeleteWithOptionalParams(t *testing.T) {
6462
}
6563

6664
func TestAccountGetSSOLoginURLWithOptionalParams(t *testing.T) {
67-
t.Skip("skipped: tests are disabled for the time being")
6865
baseURL := "http://localhost:4010"
6966
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
7067
baseURL = envURL
@@ -90,7 +87,6 @@ func TestAccountGetSSOLoginURLWithOptionalParams(t *testing.T) {
9087
}
9188

9289
func TestAccountListLoginProvidersWithOptionalParams(t *testing.T) {
93-
t.Skip("skipped: tests are disabled for the time being")
9490
baseURL := "http://localhost:4010"
9591
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
9692
baseURL = envURL

editor_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
)
1515

1616
func TestEditorGetWithOptionalParams(t *testing.T) {
17-
t.Skip("skipped: tests are disabled for the time being")
1817
baseURL := "http://localhost:4010"
1918
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2019
baseURL = envURL
@@ -39,7 +38,6 @@ func TestEditorGetWithOptionalParams(t *testing.T) {
3938
}
4039

4140
func TestEditorListWithOptionalParams(t *testing.T) {
42-
t.Skip("skipped: tests are disabled for the time being")
4341
baseURL := "http://localhost:4010"
4442
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
4543
baseURL = envURL
@@ -69,7 +67,6 @@ func TestEditorListWithOptionalParams(t *testing.T) {
6967
}
7068

7169
func TestEditorResolveURLWithOptionalParams(t *testing.T) {
72-
t.Skip("skipped: tests are disabled for the time being")
7370
baseURL := "http://localhost:4010"
7471
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
7572
baseURL = envURL

environment_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
)
1616

1717
func TestEnvironmentNewWithOptionalParams(t *testing.T) {
18-
t.Skip("skipped: tests are disabled for the time being")
1918
baseURL := "http://localhost:4010"
2019
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2120
baseURL = envURL
@@ -87,7 +86,6 @@ func TestEnvironmentNewWithOptionalParams(t *testing.T) {
8786
}
8887

8988
func TestEnvironmentGetWithOptionalParams(t *testing.T) {
90-
t.Skip("skipped: tests are disabled for the time being")
9189
baseURL := "http://localhost:4010"
9290
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
9391
baseURL = envURL
@@ -112,7 +110,6 @@ func TestEnvironmentGetWithOptionalParams(t *testing.T) {
112110
}
113111

114112
func TestEnvironmentUpdate(t *testing.T) {
115-
t.Skip("skipped: tests are disabled for the time being")
116113
baseURL := "http://localhost:4010"
117114
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
118115
baseURL = envURL
@@ -139,7 +136,6 @@ func TestEnvironmentUpdate(t *testing.T) {
139136
}
140137

141138
func TestEnvironmentListWithOptionalParams(t *testing.T) {
142-
t.Skip("skipped: tests are disabled for the time being")
143139
baseURL := "http://localhost:4010"
144140
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
145141
baseURL = envURL
@@ -177,7 +173,6 @@ func TestEnvironmentListWithOptionalParams(t *testing.T) {
177173
}
178174

179175
func TestEnvironmentDeleteWithOptionalParams(t *testing.T) {
180-
t.Skip("skipped: tests are disabled for the time being")
181176
baseURL := "http://localhost:4010"
182177
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
183178
baseURL = envURL
@@ -203,7 +198,6 @@ func TestEnvironmentDeleteWithOptionalParams(t *testing.T) {
203198
}
204199

205200
func TestEnvironmentNewFromProjectWithOptionalParams(t *testing.T) {
206-
t.Skip("skipped: tests are disabled for the time being")
207201
baseURL := "http://localhost:4010"
208202
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
209203
baseURL = envURL
@@ -276,7 +270,6 @@ func TestEnvironmentNewFromProjectWithOptionalParams(t *testing.T) {
276270
}
277271

278272
func TestEnvironmentNewLogsTokenWithOptionalParams(t *testing.T) {
279-
t.Skip("skipped: tests are disabled for the time being")
280273
baseURL := "http://localhost:4010"
281274
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
282275
baseURL = envURL
@@ -301,7 +294,6 @@ func TestEnvironmentNewLogsTokenWithOptionalParams(t *testing.T) {
301294
}
302295

303296
func TestEnvironmentMarkActiveWithOptionalParams(t *testing.T) {
304-
t.Skip("skipped: tests are disabled for the time being")
305297
baseURL := "http://localhost:4010"
306298
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
307299
baseURL = envURL
@@ -330,7 +322,6 @@ func TestEnvironmentMarkActiveWithOptionalParams(t *testing.T) {
330322
}
331323

332324
func TestEnvironmentStartWithOptionalParams(t *testing.T) {
333-
t.Skip("skipped: tests are disabled for the time being")
334325
baseURL := "http://localhost:4010"
335326
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
336327
baseURL = envURL
@@ -355,7 +346,6 @@ func TestEnvironmentStartWithOptionalParams(t *testing.T) {
355346
}
356347

357348
func TestEnvironmentStopWithOptionalParams(t *testing.T) {
358-
t.Skip("skipped: tests are disabled for the time being")
359349
baseURL := "http://localhost:4010"
360350
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
361351
baseURL = envURL

environmentautomation_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
)
1515

1616
func TestEnvironmentAutomationUpsertWithOptionalParams(t *testing.T) {
17-
t.Skip("skipped: tests are disabled for the time being")
1817
baseURL := "http://localhost:4010"
1918
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2019
baseURL = envURL

environmentautomationservice_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
)
1616

1717
func TestEnvironmentAutomationServiceNewWithOptionalParams(t *testing.T) {
18-
t.Skip("skipped: tests are disabled for the time being")
1918
baseURL := "http://localhost:4010"
2019
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2120
baseURL = envURL
@@ -69,7 +68,6 @@ func TestEnvironmentAutomationServiceNewWithOptionalParams(t *testing.T) {
6968
}
7069

7170
func TestEnvironmentAutomationServiceGetWithOptionalParams(t *testing.T) {
72-
t.Skip("skipped: tests are disabled for the time being")
7371
baseURL := "http://localhost:4010"
7472
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
7573
baseURL = envURL
@@ -94,7 +92,6 @@ func TestEnvironmentAutomationServiceGetWithOptionalParams(t *testing.T) {
9492
}
9593

9694
func TestEnvironmentAutomationServiceUpdateWithOptionalParams(t *testing.T) {
97-
t.Skip("skipped: tests are disabled for the time being")
9895
baseURL := "http://localhost:4010"
9996
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
10097
baseURL = envURL
@@ -130,7 +127,6 @@ func TestEnvironmentAutomationServiceUpdateWithOptionalParams(t *testing.T) {
130127
}
131128

132129
func TestEnvironmentAutomationServiceListWithOptionalParams(t *testing.T) {
133-
t.Skip("skipped: tests are disabled for the time being")
134130
baseURL := "http://localhost:4010"
135131
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
136132
baseURL = envURL
@@ -165,7 +161,6 @@ func TestEnvironmentAutomationServiceListWithOptionalParams(t *testing.T) {
165161
}
166162

167163
func TestEnvironmentAutomationServiceDeleteWithOptionalParams(t *testing.T) {
168-
t.Skip("skipped: tests are disabled for the time being")
169164
baseURL := "http://localhost:4010"
170165
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
171166
baseURL = envURL
@@ -191,7 +186,6 @@ func TestEnvironmentAutomationServiceDeleteWithOptionalParams(t *testing.T) {
191186
}
192187

193188
func TestEnvironmentAutomationServiceStartWithOptionalParams(t *testing.T) {
194-
t.Skip("skipped: tests are disabled for the time being")
195189
baseURL := "http://localhost:4010"
196190
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
197191
baseURL = envURL
@@ -216,7 +210,6 @@ func TestEnvironmentAutomationServiceStartWithOptionalParams(t *testing.T) {
216210
}
217211

218212
func TestEnvironmentAutomationServiceStopWithOptionalParams(t *testing.T) {
219-
t.Skip("skipped: tests are disabled for the time being")
220213
baseURL := "http://localhost:4010"
221214
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
222215
baseURL = envURL

environmentautomationtask_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
)
1616

1717
func TestEnvironmentAutomationTaskNewWithOptionalParams(t *testing.T) {
18-
t.Skip("skipped: tests are disabled for the time being")
1918
baseURL := "http://localhost:4010"
2019
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2120
baseURL = envURL
@@ -63,7 +62,6 @@ func TestEnvironmentAutomationTaskNewWithOptionalParams(t *testing.T) {
6362
}
6463

6564
func TestEnvironmentAutomationTaskGetWithOptionalParams(t *testing.T) {
66-
t.Skip("skipped: tests are disabled for the time being")
6765
baseURL := "http://localhost:4010"
6866
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
6967
baseURL = envURL
@@ -88,7 +86,6 @@ func TestEnvironmentAutomationTaskGetWithOptionalParams(t *testing.T) {
8886
}
8987

9088
func TestEnvironmentAutomationTaskUpdateWithOptionalParams(t *testing.T) {
91-
t.Skip("skipped: tests are disabled for the time being")
9289
baseURL := "http://localhost:4010"
9390
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
9491
baseURL = envURL
@@ -120,7 +117,6 @@ func TestEnvironmentAutomationTaskUpdateWithOptionalParams(t *testing.T) {
120117
}
121118

122119
func TestEnvironmentAutomationTaskListWithOptionalParams(t *testing.T) {
123-
t.Skip("skipped: tests are disabled for the time being")
124120
baseURL := "http://localhost:4010"
125121
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
126122
baseURL = envURL
@@ -155,7 +151,6 @@ func TestEnvironmentAutomationTaskListWithOptionalParams(t *testing.T) {
155151
}
156152

157153
func TestEnvironmentAutomationTaskDeleteWithOptionalParams(t *testing.T) {
158-
t.Skip("skipped: tests are disabled for the time being")
159154
baseURL := "http://localhost:4010"
160155
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
161156
baseURL = envURL
@@ -180,7 +175,6 @@ func TestEnvironmentAutomationTaskDeleteWithOptionalParams(t *testing.T) {
180175
}
181176

182177
func TestEnvironmentAutomationTaskStartWithOptionalParams(t *testing.T) {
183-
t.Skip("skipped: tests are disabled for the time being")
184178
baseURL := "http://localhost:4010"
185179
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
186180
baseURL = envURL

environmentautomationtaskexecution_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
)
1515

1616
func TestEnvironmentAutomationTaskExecutionGetWithOptionalParams(t *testing.T) {
17-
t.Skip("skipped: tests are disabled for the time being")
1817
baseURL := "http://localhost:4010"
1918
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2019
baseURL = envURL
@@ -39,7 +38,6 @@ func TestEnvironmentAutomationTaskExecutionGetWithOptionalParams(t *testing.T) {
3938
}
4039

4140
func TestEnvironmentAutomationTaskExecutionListWithOptionalParams(t *testing.T) {
42-
t.Skip("skipped: tests are disabled for the time being")
4341
baseURL := "http://localhost:4010"
4442
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
4543
baseURL = envURL
@@ -75,7 +73,6 @@ func TestEnvironmentAutomationTaskExecutionListWithOptionalParams(t *testing.T)
7573
}
7674

7775
func TestEnvironmentAutomationTaskExecutionStopWithOptionalParams(t *testing.T) {
78-
t.Skip("skipped: tests are disabled for the time being")
7976
baseURL := "http://localhost:4010"
8077
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
8178
baseURL = envURL

environmentclass_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
)
1515

1616
func TestEnvironmentClassListWithOptionalParams(t *testing.T) {
17-
t.Skip("skipped: tests are disabled for the time being")
1817
baseURL := "http://localhost:4010"
1918
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
2019
baseURL = envURL

0 commit comments

Comments
 (0)