mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 01:56:16 +00:00
Update fake API to contain sample with binary body (#9610)
This commit is contained in:
@@ -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
|
||||
@@ -338,13 +339,57 @@ No authorization required
|
||||
- **Accept**: */*
|
||||
|
||||
|
||||
## testBodyWithBinary
|
||||
|
||||
> testBodyWithBinary(body)
|
||||
|
||||
|
||||
|
||||
For this test, the body has to be a binary file.
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let body = "/path/to/file"; // File | image to upload
|
||||
apiInstance.testBodyWithBinary(body).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **File**| image to upload |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: image/png
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
## testBodyWithFileSchema
|
||||
|
||||
> testBodyWithFileSchema(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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user