diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
index 431dd54b031..05b9fd5f542 100644
--- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
@@ -1008,7 +1008,7 @@ paths:
tags:
- fake
description: >-
- For this test, the body for this request much reference a schema named
+ For this test, the body for this request must reference a schema named
`File`.
operationId: testBodyWithFileSchema
responses:
@@ -1020,6 +1020,25 @@ paths:
schema:
$ref: '#/components/schemas/FileSchemaTestClass'
required: true
+ /fake/body-with-binary:
+ put:
+ tags:
+ - fake
+ description: >-
+ For this test, the body has to be a binary file.
+ operationId: testBodyWithBinary
+ responses:
+ '200':
+ description: Success
+ requestBody:
+ content:
+ image/png:
+ schema:
+ type: string
+ nullable: true
+ format: binary
+ description: image to upload
+ required: true
/fake/test-query-paramters:
put:
tags:
diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md
index f33c01b2a43..0174c279b8d 100644
--- a/samples/client/petstore/csharp/OpenAPIClient/README.md
+++ b/samples/client/petstore/csharp/OpenAPIClient/README.md
@@ -114,6 +114,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**FakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
+*FakeApi* | [**TestBodyWithBinary**](docs/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md
index 64474672ca8..b821e3f31c1 100644
--- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md
+++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md
@@ -11,6 +11,7 @@ Method | HTTP request | Description
[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[**FakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
+[**TestBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
[**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
@@ -546,13 +547,87 @@ No authorization required
[[Back to README]](../README.md)
+## TestBodyWithBinary
+
+> void TestBodyWithBinary (System.IO.Stream body)
+
+
+
+For this test, the body has to be a binary file.
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class TestBodyWithBinaryExample
+ {
+ public static void Main()
+ {
+ Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
+ var apiInstance = new FakeApi(Configuration.Default);
+ var body = BINARY_DATA_HERE; // System.IO.Stream | image to upload
+
+ try
+ {
+ apiInstance.TestBodyWithBinary(body);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling FakeApi.TestBodyWithBinary: " + e.Message );
+ Debug.Print("Status Code: "+ e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **System.IO.Stream**| image to upload |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: image/png
+- **Accept**: Not defined
+
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Success | - |
+
+[[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)
+
+
## TestBodyWithFileSchema
> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass)
-For this test, the body for this request much reference a schema named `File`.
+For this test, the body for this request must reference a schema named `File`.
### Example
diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs
index 6161aa33d32..c01c18e2f8c 100644
--- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs
+++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs
@@ -178,7 +178,28 @@ namespace Org.OpenAPITools.Api
///
///
///
- /// For this test, the body for this request much reference a schema named `File`.
+ /// For this test, the body has to be a binary file.
+ ///
+ /// Thrown when fails to make API call
+ /// image to upload
+ ///
+ void TestBodyWithBinary (System.IO.Stream body);
+
+ ///
+ ///
+ ///
+ ///
+ /// For this test, the body has to be a binary file.
+ ///
+ /// Thrown when fails to make API call
+ /// image to upload
+ /// ApiResponse of Object(void)
+ ApiResponse