Skip to content

Commit d0187ab

Browse files
authored
Add tests for query parameters (array of integer/string) (#17686)
* add tests for query parameters in python client * update other samples * update samples
1 parent dccb147 commit d0187ab

File tree

69 files changed

+7538
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+7538
-3
lines changed

modules/openapi-generator/src/test/resources/3_0/echo_api.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,52 @@ paths:
307307
text/plain:
308308
schema:
309309
type: string
310+
/query/style_form/explode_false/array_integer:
311+
get:
312+
tags:
313+
- query
314+
summary: Test query parameter(s)
315+
description: Test query parameter(s)
316+
operationId: test/query/style_form/explode_false/array_integer
317+
parameters:
318+
- in: query
319+
name: query_object
320+
style: form #default
321+
explode: false
322+
schema:
323+
type: array
324+
items:
325+
type: integer
326+
responses:
327+
'200':
328+
description: Successful operation
329+
content:
330+
text/plain:
331+
schema:
332+
type: string
333+
/query/style_form/explode_false/array_string:
334+
get:
335+
tags:
336+
- query
337+
summary: Test query parameter(s)
338+
description: Test query parameter(s)
339+
operationId: test/query/style_form/explode_false/array_string
340+
parameters:
341+
- in: query
342+
name: query_object
343+
style: form #default
344+
explode: false
345+
schema:
346+
type: array
347+
items:
348+
type: string
349+
responses:
350+
'200':
351+
description: Successful operation
352+
content:
353+
text/plain:
354+
schema:
355+
type: string
310356
/query/style_form/explode_true/object:
311357
get:
312358
tags:

samples/client/echo_api/csharp-restsharp/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ Class | Method | HTTP request | Description
136136
*QueryApi* | [**TestQueryIntegerBooleanString**](docs/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s)
137137
*QueryApi* | [**TestQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testquerystyledeepobjectexplodetrueobject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
138138
*QueryApi* | [**TestQueryStyleDeepObjectExplodeTrueObjectAllOf**](docs/QueryApi.md#testquerystyledeepobjectexplodetrueobjectallof) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
139+
*QueryApi* | [**TestQueryStyleFormExplodeFalseArrayInteger**](docs/QueryApi.md#testquerystyleformexplodefalsearrayinteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s)
140+
*QueryApi* | [**TestQueryStyleFormExplodeFalseArrayString**](docs/QueryApi.md#testquerystyleformexplodefalsearraystring) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s)
139141
*QueryApi* | [**TestQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
140142
*QueryApi* | [**TestQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
141143
*QueryApi* | [**TestQueryStyleFormExplodeTrueObjectAllOf**](docs/QueryApi.md#testquerystyleformexplodetrueobjectallof) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)

samples/client/echo_api/csharp-restsharp/api/openapi.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,54 @@ paths:
279279
summary: Test query parameter(s)
280280
tags:
281281
- query
282+
/query/style_form/explode_false/array_integer:
283+
get:
284+
description: Test query parameter(s)
285+
operationId: test/query/style_form/explode_false/array_integer
286+
parameters:
287+
- explode: false
288+
in: query
289+
name: query_object
290+
required: false
291+
schema:
292+
items:
293+
type: integer
294+
type: array
295+
style: form
296+
responses:
297+
"200":
298+
content:
299+
text/plain:
300+
schema:
301+
type: string
302+
description: Successful operation
303+
summary: Test query parameter(s)
304+
tags:
305+
- query
306+
/query/style_form/explode_false/array_string:
307+
get:
308+
description: Test query parameter(s)
309+
operationId: test/query/style_form/explode_false/array_string
310+
parameters:
311+
- explode: false
312+
in: query
313+
name: query_object
314+
required: false
315+
schema:
316+
items:
317+
type: string
318+
type: array
319+
style: form
320+
responses:
321+
"200":
322+
content:
323+
text/plain:
324+
schema:
325+
type: string
326+
description: Successful operation
327+
summary: Test query parameter(s)
328+
tags:
329+
- query
282330
/query/style_form/explode_true/object:
283331
get:
284332
description: Test query parameter(s)

samples/client/echo_api/csharp-restsharp/docs/QueryApi.md

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ All URIs are relative to *http://localhost:3000*
99
| [**TestQueryIntegerBooleanString**](QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) |
1010
| [**TestQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testquerystyledeepobjectexplodetrueobject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) |
1111
| [**TestQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testquerystyledeepobjectexplodetrueobjectallof) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
12+
| [**TestQueryStyleFormExplodeFalseArrayInteger**](QueryApi.md#testquerystyleformexplodefalsearrayinteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s) |
13+
| [**TestQueryStyleFormExplodeFalseArrayString**](QueryApi.md#testquerystyleformexplodefalsearraystring) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s) |
1214
| [**TestQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
1315
| [**TestQueryStyleFormExplodeTrueObject**](QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
1416
| [**TestQueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#testquerystyleformexplodetrueobjectallof) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
@@ -471,6 +473,188 @@ No authorization required
471473
- **Accept**: text/plain
472474

473475

476+
### HTTP response details
477+
| Status code | Description | Response headers |
478+
|-------------|-------------|------------------|
479+
| **200** | Successful operation | - |
480+
481+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
482+
483+
<a id="testquerystyleformexplodefalsearrayinteger"></a>
484+
# **TestQueryStyleFormExplodeFalseArrayInteger**
485+
> string TestQueryStyleFormExplodeFalseArrayInteger (List<int>? queryObject = null)
486+
487+
Test query parameter(s)
488+
489+
Test query parameter(s)
490+
491+
### Example
492+
```csharp
493+
using System.Collections.Generic;
494+
using System.Diagnostics;
495+
using Org.OpenAPITools.Api;
496+
using Org.OpenAPITools.Client;
497+
using Org.OpenAPITools.Model;
498+
499+
namespace Example
500+
{
501+
public class TestQueryStyleFormExplodeFalseArrayIntegerExample
502+
{
503+
public static void Main()
504+
{
505+
Configuration config = new Configuration();
506+
config.BasePath = "http://localhost:3000";
507+
var apiInstance = new QueryApi(config);
508+
var queryObject = new List<int>?(); // List<int>? | (optional)
509+
510+
try
511+
{
512+
// Test query parameter(s)
513+
string result = apiInstance.TestQueryStyleFormExplodeFalseArrayInteger(queryObject);
514+
Debug.WriteLine(result);
515+
}
516+
catch (ApiException e)
517+
{
518+
Debug.Print("Exception when calling QueryApi.TestQueryStyleFormExplodeFalseArrayInteger: " + e.Message);
519+
Debug.Print("Status Code: " + e.ErrorCode);
520+
Debug.Print(e.StackTrace);
521+
}
522+
}
523+
}
524+
}
525+
```
526+
527+
#### Using the TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo variant
528+
This returns an ApiResponse object which contains the response data, status code and headers.
529+
530+
```csharp
531+
try
532+
{
533+
// Test query parameter(s)
534+
ApiResponse<string> response = apiInstance.TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(queryObject);
535+
Debug.Write("Status Code: " + response.StatusCode);
536+
Debug.Write("Response Headers: " + response.Headers);
537+
Debug.Write("Response Body: " + response.Data);
538+
}
539+
catch (ApiException e)
540+
{
541+
Debug.Print("Exception when calling QueryApi.TestQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo: " + e.Message);
542+
Debug.Print("Status Code: " + e.ErrorCode);
543+
Debug.Print(e.StackTrace);
544+
}
545+
```
546+
547+
### Parameters
548+
549+
| Name | Type | Description | Notes |
550+
|------|------|-------------|-------|
551+
| **queryObject** | [**List&lt;int&gt;?**](int.md) | | [optional] |
552+
553+
### Return type
554+
555+
**string**
556+
557+
### Authorization
558+
559+
No authorization required
560+
561+
### HTTP request headers
562+
563+
- **Content-Type**: Not defined
564+
- **Accept**: text/plain
565+
566+
567+
### HTTP response details
568+
| Status code | Description | Response headers |
569+
|-------------|-------------|------------------|
570+
| **200** | Successful operation | - |
571+
572+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
573+
574+
<a id="testquerystyleformexplodefalsearraystring"></a>
575+
# **TestQueryStyleFormExplodeFalseArrayString**
576+
> string TestQueryStyleFormExplodeFalseArrayString (List<string>? queryObject = null)
577+
578+
Test query parameter(s)
579+
580+
Test query parameter(s)
581+
582+
### Example
583+
```csharp
584+
using System.Collections.Generic;
585+
using System.Diagnostics;
586+
using Org.OpenAPITools.Api;
587+
using Org.OpenAPITools.Client;
588+
using Org.OpenAPITools.Model;
589+
590+
namespace Example
591+
{
592+
public class TestQueryStyleFormExplodeFalseArrayStringExample
593+
{
594+
public static void Main()
595+
{
596+
Configuration config = new Configuration();
597+
config.BasePath = "http://localhost:3000";
598+
var apiInstance = new QueryApi(config);
599+
var queryObject = new List<string>?(); // List<string>? | (optional)
600+
601+
try
602+
{
603+
// Test query parameter(s)
604+
string result = apiInstance.TestQueryStyleFormExplodeFalseArrayString(queryObject);
605+
Debug.WriteLine(result);
606+
}
607+
catch (ApiException e)
608+
{
609+
Debug.Print("Exception when calling QueryApi.TestQueryStyleFormExplodeFalseArrayString: " + e.Message);
610+
Debug.Print("Status Code: " + e.ErrorCode);
611+
Debug.Print(e.StackTrace);
612+
}
613+
}
614+
}
615+
}
616+
```
617+
618+
#### Using the TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo variant
619+
This returns an ApiResponse object which contains the response data, status code and headers.
620+
621+
```csharp
622+
try
623+
{
624+
// Test query parameter(s)
625+
ApiResponse<string> response = apiInstance.TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo(queryObject);
626+
Debug.Write("Status Code: " + response.StatusCode);
627+
Debug.Write("Response Headers: " + response.Headers);
628+
Debug.Write("Response Body: " + response.Data);
629+
}
630+
catch (ApiException e)
631+
{
632+
Debug.Print("Exception when calling QueryApi.TestQueryStyleFormExplodeFalseArrayStringWithHttpInfo: " + e.Message);
633+
Debug.Print("Status Code: " + e.ErrorCode);
634+
Debug.Print(e.StackTrace);
635+
}
636+
```
637+
638+
### Parameters
639+
640+
| Name | Type | Description | Notes |
641+
|------|------|-------------|-------|
642+
| **queryObject** | [**List&lt;string&gt;?**](string.md) | | [optional] |
643+
644+
### Return type
645+
646+
**string**
647+
648+
### Authorization
649+
650+
No authorization required
651+
652+
### HTTP request headers
653+
654+
- **Content-Type**: Not defined
655+
- **Accept**: text/plain
656+
657+
474658
### HTTP response details
475659
| Status code | Description | Response headers |
476660
|-------------|-------------|------------------|

0 commit comments

Comments
 (0)