Skip to content

Commit

Permalink
Update fake API to contain sample with binary body (#9610)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhnroyal committed May 29, 2021
1 parent 1b6fd2d commit f7b93eb
Show file tree
Hide file tree
Showing 46 changed files with 1,844 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions samples/client/petstore/csharp/OpenAPIClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
77 changes: 76 additions & 1 deletion samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Loading

0 comments on commit f7b93eb

Please sign in to comment.