Skip to content

Commit 5505a0f

Browse files
algolia-botFluf22
andcommitted
fix(clients): validate empty string for required string parameters (generated)
algolia/api-clients-automation#6338 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent fcd4f50 commit 5505a0f

11 files changed

Lines changed: 1094 additions & 0 deletions

algoliasearch/Clients/AbtestingClient.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,8 @@ public async Task<object> CustomDeleteAsync(
978978
if (path == null)
979979
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
980980

981+
if (string.IsNullOrWhiteSpace(path))
982+
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
981983
var requestOptions = new InternalRequestOptions(options);
982984
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
983985

@@ -1011,6 +1013,8 @@ public async Task<AlgoliaHttpResponse> CustomDeleteWithHTTPInfoAsync(
10111013
if (path == null)
10121014
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
10131015

1016+
if (string.IsNullOrWhiteSpace(path))
1017+
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
10141018
var requestOptions = new InternalRequestOptions(options);
10151019
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
10161020

@@ -1047,6 +1051,8 @@ public async Task<object> CustomGetAsync(
10471051
if (path == null)
10481052
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
10491053

1054+
if (string.IsNullOrWhiteSpace(path))
1055+
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
10501056
var requestOptions = new InternalRequestOptions(options);
10511057
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
10521058

@@ -1080,6 +1086,8 @@ public async Task<AlgoliaHttpResponse> CustomGetWithHTTPInfoAsync(
10801086
if (path == null)
10811087
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
10821088

1089+
if (string.IsNullOrWhiteSpace(path))
1090+
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
10831091
var requestOptions = new InternalRequestOptions(options);
10841092
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
10851093

@@ -1117,6 +1125,8 @@ public async Task<object> CustomPostAsync(
11171125
if (path == null)
11181126
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
11191127

1128+
if (string.IsNullOrWhiteSpace(path))
1129+
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
11201130
var requestOptions = new InternalRequestOptions(options);
11211131
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
11221132

@@ -1154,6 +1164,8 @@ public async Task<AlgoliaHttpResponse> CustomPostWithHTTPInfoAsync(
11541164
if (path == null)
11551165
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
11561166

1167+
if (string.IsNullOrWhiteSpace(path))
1168+
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
11571169
var requestOptions = new InternalRequestOptions(options);
11581170
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
11591171

@@ -1193,6 +1205,8 @@ public async Task<object> CustomPutAsync(
11931205
if (path == null)
11941206
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
11951207

1208+
if (string.IsNullOrWhiteSpace(path))
1209+
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
11961210
var requestOptions = new InternalRequestOptions(options);
11971211
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
11981212

@@ -1230,6 +1244,8 @@ public async Task<AlgoliaHttpResponse> CustomPutWithHTTPInfoAsync(
12301244
if (path == null)
12311245
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
12321246

1247+
if (string.IsNullOrWhiteSpace(path))
1248+
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
12331249
var requestOptions = new InternalRequestOptions(options);
12341250
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
12351251

algoliasearch/Clients/AbtestingV3Client.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,8 @@ public async Task<object> CustomDeleteAsync(
10891089
if (path == null)
10901090
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
10911091

1092+
if (string.IsNullOrWhiteSpace(path))
1093+
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
10921094
var requestOptions = new InternalRequestOptions(options);
10931095
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
10941096

@@ -1122,6 +1124,8 @@ public async Task<AlgoliaHttpResponse> CustomDeleteWithHTTPInfoAsync(
11221124
if (path == null)
11231125
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
11241126

1127+
if (string.IsNullOrWhiteSpace(path))
1128+
throw new ArgumentException("Parameter `path` is required when calling `CustomDelete`.");
11251129
var requestOptions = new InternalRequestOptions(options);
11261130
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
11271131

@@ -1158,6 +1162,8 @@ public async Task<object> CustomGetAsync(
11581162
if (path == null)
11591163
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
11601164

1165+
if (string.IsNullOrWhiteSpace(path))
1166+
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
11611167
var requestOptions = new InternalRequestOptions(options);
11621168
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
11631169

@@ -1191,6 +1197,8 @@ public async Task<AlgoliaHttpResponse> CustomGetWithHTTPInfoAsync(
11911197
if (path == null)
11921198
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
11931199

1200+
if (string.IsNullOrWhiteSpace(path))
1201+
throw new ArgumentException("Parameter `path` is required when calling `CustomGet`.");
11941202
var requestOptions = new InternalRequestOptions(options);
11951203
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
11961204

@@ -1228,6 +1236,8 @@ public async Task<object> CustomPostAsync(
12281236
if (path == null)
12291237
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
12301238

1239+
if (string.IsNullOrWhiteSpace(path))
1240+
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
12311241
var requestOptions = new InternalRequestOptions(options);
12321242
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
12331243

@@ -1265,6 +1275,8 @@ public async Task<AlgoliaHttpResponse> CustomPostWithHTTPInfoAsync(
12651275
if (path == null)
12661276
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
12671277

1278+
if (string.IsNullOrWhiteSpace(path))
1279+
throw new ArgumentException("Parameter `path` is required when calling `CustomPost`.");
12681280
var requestOptions = new InternalRequestOptions(options);
12691281
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
12701282

@@ -1304,6 +1316,8 @@ public async Task<object> CustomPutAsync(
13041316
if (path == null)
13051317
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
13061318

1319+
if (string.IsNullOrWhiteSpace(path))
1320+
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
13071321
var requestOptions = new InternalRequestOptions(options);
13081322
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
13091323

@@ -1341,6 +1355,8 @@ public async Task<AlgoliaHttpResponse> CustomPutWithHTTPInfoAsync(
13411355
if (path == null)
13421356
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
13431357

1358+
if (string.IsNullOrWhiteSpace(path))
1359+
throw new ArgumentException("Parameter `path` is required when calling `CustomPut`.");
13441360
var requestOptions = new InternalRequestOptions(options);
13451361
requestOptions.CustomPathParameters.Add("path", QueryStringHelper.ParameterToString(path));
13461362

0 commit comments

Comments
 (0)