Skip to content

Commit 8c01437

Browse files
authored
[Java RESTEasy client] updating test to use the Java RESTEasy echo api client (#17367) (#17470)
* updating test to use the Java RESTEasy echo api client (#17367) * regenerated samples * set source and target to 1.8 to fix workflow failure, adapted parser
1 parent a67e07e commit 8c01437

275 files changed

Lines changed: 8273 additions & 18971 deletions

File tree

Some content is hidden

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

bin/configs/java-resteasy-echo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generatorName: java
22
outputDir: samples/client/petstore/java/resteasy-echo
3-
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-echo.yaml
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
44
templateDir: modules/openapi-generator/src/main/resources/Java
55
additionalProperties:
66
artifactId: petstore-resteasy-echo

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,30 @@ paths:
513513
schema:
514514
type: string
515515
format: binary
516+
# Single binary in multipart mime test
517+
/body/application/octetstream/single_binary:
518+
post:
519+
tags:
520+
- body
521+
summary: Test single binary in multipart mime
522+
description: Test single binary in multipart mime
523+
operationId: test/body/multipart/formdata/single_binary
524+
requestBody:
525+
content:
526+
multipart/form-data:
527+
schema:
528+
type: object
529+
properties:
530+
my-file:
531+
type: string
532+
format: binary
533+
responses:
534+
'200':
535+
description: Successful operation
536+
content:
537+
text/plain:
538+
schema:
539+
type: string
516540
# Array of binary in multipart mime tests
517541
/body/application/octetstream/array_of_binary:
518542
post:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Class | Method | HTTP request | Description
121121
*BodyApi* | [**TestBinaryGif**](docs/BodyApi.md#testbinarygif) | **POST** /binary/gif | Test binary (gif) response body
122122
*BodyApi* | [**TestBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testbodyapplicationoctetstreambinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
123123
*BodyApi* | [**TestBodyMultipartFormdataArrayOfBinary**](docs/BodyApi.md#testbodymultipartformdataarrayofbinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime
124+
*BodyApi* | [**TestBodyMultipartFormdataSingleBinary**](docs/BodyApi.md#testbodymultipartformdatasinglebinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime
124125
*BodyApi* | [**TestEchoBodyAllOfPet**](docs/BodyApi.md#testechobodyallofpet) | **POST** /echo/body/allOf/Pet | Test body parameter(s)
125126
*BodyApi* | [**TestEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testechobodyfreeformobjectresponsestring) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
126127
*BodyApi* | [**TestEchoBodyPet**](docs/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s)

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,25 @@ paths:
486486
summary: Test binary (gif) response body
487487
tags:
488488
- body
489+
/body/application/octetstream/single_binary:
490+
post:
491+
description: Test single binary in multipart mime
492+
operationId: test/body/multipart/formdata/single_binary
493+
requestBody:
494+
content:
495+
multipart/form-data:
496+
schema:
497+
$ref: '#/components/schemas/test_body_multipart_formdata_single_binary_request'
498+
responses:
499+
"200":
500+
content:
501+
text/plain:
502+
schema:
503+
type: string
504+
description: Successful operation
505+
summary: Test single binary in multipart mime
506+
tags:
507+
- body
489508
/body/application/octetstream/array_of_binary:
490509
post:
491510
description: Test array of binary in multipart mime
@@ -794,6 +813,12 @@ components:
794813
allOf:
795814
- $ref: '#/components/schemas/Bird'
796815
- $ref: '#/components/schemas/Category'
816+
test_body_multipart_formdata_single_binary_request:
817+
properties:
818+
my-file:
819+
format: binary
820+
type: string
821+
type: object
797822
test_body_multipart_formdata_array_of_binary_request:
798823
properties:
799824
files:

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

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All URIs are relative to *http://localhost:3000*
77
| [**TestBinaryGif**](BodyApi.md#testbinarygif) | **POST** /binary/gif | Test binary (gif) response body |
88
| [**TestBodyApplicationOctetstreamBinary**](BodyApi.md#testbodyapplicationoctetstreambinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
99
| [**TestBodyMultipartFormdataArrayOfBinary**](BodyApi.md#testbodymultipartformdataarrayofbinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime |
10+
| [**TestBodyMultipartFormdataSingleBinary**](BodyApi.md#testbodymultipartformdatasinglebinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime |
1011
| [**TestEchoBodyAllOfPet**](BodyApi.md#testechobodyallofpet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) |
1112
| [**TestEchoBodyFreeFormObjectResponseString**](BodyApi.md#testechobodyfreeformobjectresponsestring) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
1213
| [**TestEchoBodyPet**](BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) |
@@ -274,6 +275,97 @@ No authorization required
274275
- **Accept**: text/plain
275276

276277

278+
### HTTP response details
279+
| Status code | Description | Response headers |
280+
|-------------|-------------|------------------|
281+
| **200** | Successful operation | - |
282+
283+
[[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)
284+
285+
<a id="testbodymultipartformdatasinglebinary"></a>
286+
# **TestBodyMultipartFormdataSingleBinary**
287+
> string TestBodyMultipartFormdataSingleBinary (System.IO.Stream? myFile = null)
288+
289+
Test single binary in multipart mime
290+
291+
Test single binary in multipart mime
292+
293+
### Example
294+
```csharp
295+
using System.Collections.Generic;
296+
using System.Diagnostics;
297+
using Org.OpenAPITools.Api;
298+
using Org.OpenAPITools.Client;
299+
using Org.OpenAPITools.Model;
300+
301+
namespace Example
302+
{
303+
public class TestBodyMultipartFormdataSingleBinaryExample
304+
{
305+
public static void Main()
306+
{
307+
Configuration config = new Configuration();
308+
config.BasePath = "http://localhost:3000";
309+
var apiInstance = new BodyApi(config);
310+
var myFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream? | (optional)
311+
312+
try
313+
{
314+
// Test single binary in multipart mime
315+
string result = apiInstance.TestBodyMultipartFormdataSingleBinary(myFile);
316+
Debug.WriteLine(result);
317+
}
318+
catch (ApiException e)
319+
{
320+
Debug.Print("Exception when calling BodyApi.TestBodyMultipartFormdataSingleBinary: " + e.Message);
321+
Debug.Print("Status Code: " + e.ErrorCode);
322+
Debug.Print(e.StackTrace);
323+
}
324+
}
325+
}
326+
}
327+
```
328+
329+
#### Using the TestBodyMultipartFormdataSingleBinaryWithHttpInfo variant
330+
This returns an ApiResponse object which contains the response data, status code and headers.
331+
332+
```csharp
333+
try
334+
{
335+
// Test single binary in multipart mime
336+
ApiResponse<string> response = apiInstance.TestBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile);
337+
Debug.Write("Status Code: " + response.StatusCode);
338+
Debug.Write("Response Headers: " + response.Headers);
339+
Debug.Write("Response Body: " + response.Data);
340+
}
341+
catch (ApiException e)
342+
{
343+
Debug.Print("Exception when calling BodyApi.TestBodyMultipartFormdataSingleBinaryWithHttpInfo: " + e.Message);
344+
Debug.Print("Status Code: " + e.ErrorCode);
345+
Debug.Print(e.StackTrace);
346+
}
347+
```
348+
349+
### Parameters
350+
351+
| Name | Type | Description | Notes |
352+
|------|------|-------------|-------|
353+
| **myFile** | **System.IO.Stream?****System.IO.Stream?** | | [optional] |
354+
355+
### Return type
356+
357+
**string**
358+
359+
### Authorization
360+
361+
No authorization required
362+
363+
### HTTP request headers
364+
365+
- **Content-Type**: multipart/form-data
366+
- **Accept**: text/plain
367+
368+
277369
### HTTP response details
278370
| Status code | Description | Response headers |
279371
|-------------|-------------|------------------|

0 commit comments

Comments
 (0)