forked from loafle/openapi-generator-original
[Golang][client] fix for schema definition name file
(#433)
* fix schema/definition name as 'file' * update samples * Trigger CI due to previous Shippable race condition * add fix with toModelName(openAPIType) * update tests for file schema/definition name * Update 3.0 test spec * update samples * update samples for jaxrs-cxf * Trigger CI due to previous Shippable race condition * add back explode
This commit is contained in:
parent
036570d93d
commit
0bffdf2463
@ -265,6 +265,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
// Not using the supertype invocation, because we want to UpperCamelize
|
||||
// the type.
|
||||
String openAPIType = getSchemaType(p);
|
||||
String ref = p.get$ref();
|
||||
if(ref != null && !ref.isEmpty()) {
|
||||
String tryRefV2 = "#/definitions/" + openAPIType;
|
||||
String tryRefV3 = "#/components/schemas/" + openAPIType;
|
||||
if(ref.equals(tryRefV2) || ref.equals(tryRefV3)) {
|
||||
return toModelName(openAPIType);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeMapping.containsKey(openAPIType)) {
|
||||
return typeMapping.get(openAPIType);
|
||||
}
|
||||
@ -283,8 +292,12 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
@Override
|
||||
public String getSchemaType(Schema p) {
|
||||
String openAPIType = super.getSchemaType(p);
|
||||
String ref = p.get$ref();
|
||||
String type = null;
|
||||
if (typeMapping.containsKey(openAPIType)) {
|
||||
|
||||
if(ref != null && !ref.isEmpty()) {
|
||||
type = openAPIType;
|
||||
} else if (typeMapping.containsKey(openAPIType)) {
|
||||
type = typeMapping.get(openAPIType);
|
||||
if (languageSpecificPrimitives.contains(type))
|
||||
return (type);
|
||||
|
@ -254,6 +254,22 @@ public class GoModelTest {
|
||||
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1);
|
||||
}
|
||||
|
||||
@Test(description = "convert file type and file schema models")
|
||||
public void filePropertyTest() {
|
||||
final DefaultCodegen codegen = new GoClientCodegen();
|
||||
final Schema model1 = new Schema().type("file");
|
||||
Assert.assertEquals(codegen.getSchemaType(model1), "*os.File");
|
||||
Assert.assertEquals(codegen.getTypeDeclaration(model1), "*os.File");
|
||||
|
||||
final Schema model2 = new Schema().$ref("#/definitions/File");
|
||||
Assert.assertEquals(codegen.getSchemaType(model2), "File");
|
||||
Assert.assertEquals(codegen.getTypeDeclaration(model2), "File");
|
||||
|
||||
final Schema model3 = new Schema().$ref("#/components/schemas/File");
|
||||
Assert.assertEquals(codegen.getSchemaType(model3), "File");
|
||||
Assert.assertEquals(codegen.getTypeDeclaration(model3), "File");
|
||||
}
|
||||
|
||||
@DataProvider(name = "modelNames")
|
||||
public static Object[][] primeNumbers() {
|
||||
return new Object[][] {
|
||||
|
@ -947,6 +947,23 @@ paths:
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/Client'
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
tags:
|
||||
- fake
|
||||
description: 'For this test, the body for this request much reference a schema named `File`.'
|
||||
operationId: testBodyWithFileSchema
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/FileSchemaTestClass'
|
||||
consumes:
|
||||
- application/json
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'/fake/{petId}/uploadImageWithRequiredFile':
|
||||
post:
|
||||
tags:
|
||||
@ -1474,7 +1491,7 @@ definitions:
|
||||
# - Cat
|
||||
# - Dog
|
||||
OuterEnum:
|
||||
type: "string"
|
||||
type: string
|
||||
enum:
|
||||
- "placed"
|
||||
- "approved"
|
||||
@ -1498,3 +1515,19 @@ definitions:
|
||||
StringBooleanMap:
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
FileSchemaTestClass:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
$ref: "#/definitions/File"
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/File"
|
||||
File:
|
||||
type: object
|
||||
desription: 'Must be named `File` for test.'
|
||||
properties:
|
||||
sourceURI:
|
||||
description: 'Test capitalization'
|
||||
type: string
|
||||
|
@ -912,6 +912,23 @@ paths:
|
||||
$ref: '#/components/schemas/Client'
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Client'
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
tags:
|
||||
- fake
|
||||
description: >-
|
||||
For this test, the body for this request much reference a schema named
|
||||
`File`.
|
||||
operationId: testBodyWithFileSchema
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FileSchemaTestClass'
|
||||
required: true
|
||||
'/fake/{petId}/uploadImageWithRequiredFile':
|
||||
post:
|
||||
tags:
|
||||
@ -1375,6 +1392,12 @@ components:
|
||||
enum:
|
||||
- UPPER
|
||||
- lower
|
||||
direct_map:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
indirect_map:
|
||||
$ref: '#/components/schemas/StringBooleanMap'
|
||||
ArrayTest:
|
||||
type: object
|
||||
properties:
|
||||
@ -1453,6 +1476,25 @@ components:
|
||||
OuterBoolean:
|
||||
type: boolean
|
||||
x-codegen-body-parameter-name: boolean_post_body
|
||||
StringBooleanMap:
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
FileSchemaTestClass:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
$ref: '#/components/schemas/File'
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/File'
|
||||
File:
|
||||
type: object
|
||||
description: Must be named `File` for test.
|
||||
properties:
|
||||
sourceURI:
|
||||
description: Test capitalization
|
||||
type: string
|
||||
_special_model.name_:
|
||||
properties:
|
||||
'$special[property.name]':
|
||||
|
29
samples/client/petstore/go/fake_api_test.go
Normal file
29
samples/client/petstore/go/fake_api_test.go
Normal file
@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
sw "./go-petstore"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// TestPutBodyWithFileSchema ensures a model with the name 'File'
|
||||
// gets converted properly to the petstore.File struct vs. *os.File
|
||||
// as specified in typeMapping for 'File'.
|
||||
func TestPutBodyWithFileSchema(t *testing.T) {
|
||||
return // early return to test compilation
|
||||
|
||||
schema := sw.FileSchemaTestClass{
|
||||
File: sw.File{SourceURI: "https://example.com/image.png"},
|
||||
Files: []sw.File{{SourceURI: "https://example.com/image.png"}}}
|
||||
|
||||
r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Error while adding pet")
|
||||
t.Log(err)
|
||||
}
|
||||
if r.StatusCode != 200 {
|
||||
t.Log(r)
|
||||
}
|
||||
}
|
@ -35,6 +35,7 @@ Class | Method | HTTP request | Description
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite |
|
||||
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number |
|
||||
*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string |
|
||||
*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
|
||||
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -83,6 +84,8 @@ Class | Method | HTTP request | Description
|
||||
- [EnumArrays](docs/EnumArrays.md)
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [File](docs/File.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [FormatTest](docs/FormatTest.md)
|
||||
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [List](docs/List.md)
|
||||
|
@ -973,6 +973,22 @@ paths:
|
||||
summary: To test special tags
|
||||
tags:
|
||||
- $another-fake?
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
description: For this test, the body for this request much reference a schema named `File`.
|
||||
operationId: testBodyWithFileSchema
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FileSchemaTestClass'
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: Success
|
||||
tags:
|
||||
- fake
|
||||
/fake/{petId}/uploadImageWithRequiredFile:
|
||||
post:
|
||||
operationId: uploadFileWithRequiredFile
|
||||
@ -1413,6 +1429,21 @@ components:
|
||||
OuterBoolean:
|
||||
type: boolean
|
||||
x-codegen-body-parameter-name: boolean_post_body
|
||||
FileSchemaTestClass:
|
||||
example:
|
||||
file:
|
||||
sourceURI: sourceURI
|
||||
files:
|
||||
- sourceURI: sourceURI
|
||||
- sourceURI: sourceURI
|
||||
properties:
|
||||
file:
|
||||
$ref: '#/components/schemas/File'
|
||||
files:
|
||||
items:
|
||||
$ref: '#/components/schemas/File'
|
||||
type: array
|
||||
type: object
|
||||
Animal:
|
||||
discriminator:
|
||||
propertyName: className
|
||||
@ -1475,6 +1506,14 @@ components:
|
||||
items:
|
||||
$ref: '#/components/schemas/Animal'
|
||||
type: array
|
||||
File:
|
||||
example:
|
||||
sourceURI: sourceURI
|
||||
properties:
|
||||
sourceURI:
|
||||
description: Test capitalization
|
||||
type: string
|
||||
type: object
|
||||
Pet:
|
||||
example:
|
||||
photoUrls:
|
||||
|
@ -414,6 +414,73 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param fileSchemaTestClass
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||
if localVarHttpContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
if localVarHttpHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &fileSchemaTestClass
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHttpResponse, err := a.client.callAPI(r)
|
||||
if err != nil || localVarHttpResponse == nil {
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite |
|
||||
[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number |
|
||||
[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string |
|
||||
[**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
|
||||
[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -38,7 +39,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
**bool**
|
||||
[**bool**](boolean.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@ -108,7 +109,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
**float32**
|
||||
[**float32**](number.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@ -156,6 +157,34 @@ No authorization required
|
||||
|
||||
[[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**
|
||||
> TestBodyWithFileSchema(ctx, fileSchemaTestClass)
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **TestBodyWithQueryParams**
|
||||
> TestBodyWithQueryParams(ctx, query, user)
|
||||
|
||||
|
10
samples/client/petstore/go/go-petstore/docs/File.md
Normal file
10
samples/client/petstore/go/go-petstore/docs/File.md
Normal file
@ -0,0 +1,10 @@
|
||||
# File
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**SourceURI** | **string** | Test capitalization | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**File** | [**File**](File.md) | | [optional]
|
||||
**Files** | [**[]File**](File.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
15
samples/client/petstore/go/go-petstore/model_file.go
Normal file
15
samples/client/petstore/go/go-petstore/model_file.go
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type File struct {
|
||||
// Test capitalization
|
||||
SourceURI string `json:"sourceURI,omitempty"`
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type FileSchemaTestClass struct {
|
||||
File File `json:"file,omitempty"`
|
||||
Files []File `json:"files,omitempty"`
|
||||
}
|
@ -6,6 +6,7 @@ import org.openapitools.client.EncodingUtils;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -73,6 +74,18 @@ public interface FakeApi extends ApiClient.Api {
|
||||
})
|
||||
String fakeOuterStringSerialize(String body);
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
*/
|
||||
@RequestLine("PUT /fake/body-with-file-schema")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: application/json",
|
||||
})
|
||||
void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -366,6 +367,90 @@ public class FakeApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* <p><b>200</b> - Success
|
||||
* @param fileSchemaTestClass The fileSchemaTestClass parameter
|
||||
* @throws IOException if an error occurs while attempting to invoke the API
|
||||
**/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws IOException {
|
||||
testBodyWithFileSchemaForHttpResponse(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* <p><b>200</b> - Success
|
||||
* @param fileSchemaTestClass The fileSchemaTestClass parameter
|
||||
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
|
||||
* @throws IOException if an error occurs while attempting to invoke the API
|
||||
**/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass, Map<String, Object> params) throws IOException {
|
||||
testBodyWithFileSchemaForHttpResponse(fileSchemaTestClass, params);
|
||||
}
|
||||
|
||||
public HttpResponse testBodyWithFileSchemaForHttpResponse(FileSchemaTestClass fileSchemaTestClass) throws IOException {
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema");
|
||||
|
||||
String url = uriBuilder.build().toString();
|
||||
GenericUrl genericUrl = new GenericUrl(url);
|
||||
|
||||
HttpContent content = apiClient.new JacksonJsonHttpContent(fileSchemaTestClass);
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
|
||||
}
|
||||
|
||||
public HttpResponse testBodyWithFileSchemaForHttpResponse(java.io.InputStream fileSchemaTestClass, String mediaType) throws IOException {
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema");
|
||||
|
||||
String url = uriBuilder.build().toString();
|
||||
GenericUrl genericUrl = new GenericUrl(url);
|
||||
|
||||
HttpContent content = fileSchemaTestClass == null ?
|
||||
apiClient.new JacksonJsonHttpContent(null) :
|
||||
new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, fileSchemaTestClass);
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
|
||||
}
|
||||
|
||||
public HttpResponse testBodyWithFileSchemaForHttpResponse(FileSchemaTestClass fileSchemaTestClass, Map<String, Object> params) throws IOException {
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema");
|
||||
|
||||
// Copy the params argument if present, to allow passing in immutable maps
|
||||
Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
|
||||
|
||||
for (Map.Entry<String, Object> entry: allParams.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
|
||||
if (key != null && value != null) {
|
||||
if (value instanceof Collection) {
|
||||
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
|
||||
} else if (value instanceof Object[]) {
|
||||
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
|
||||
} else {
|
||||
uriBuilder = uriBuilder.queryParam(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String url = uriBuilder.build().toString();
|
||||
GenericUrl genericUrl = new GenericUrl(url);
|
||||
|
||||
HttpContent content = apiClient.new JacksonJsonHttpContent(fileSchemaTestClass);
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p><b>200</b> - Success
|
||||
* @param query The query parameter
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -23,6 +23,7 @@ import org.openapitools.client.Pair;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -202,6 +203,47 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -11,6 +11,7 @@ import javax.ws.rs.core.GenericType;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -229,6 +230,57 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,123 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return ObjectUtils.equals(this.file, fileSchemaTestClass.file) &&
|
||||
ObjectUtils.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.hashCodeMulti(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -11,6 +11,7 @@ import javax.ws.rs.core.GenericType;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -229,6 +230,57 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -11,6 +11,7 @@ import javax.ws.rs.core.GenericType;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -229,6 +230,57 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -30,6 +30,7 @@ import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -528,6 +529,124 @@ public class FakeApi {
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithFileSchema
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
||||
@Override
|
||||
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
||||
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.build();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private com.squareup.okhttp.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)");
|
||||
}
|
||||
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
return call;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null, null);
|
||||
return apiClient.execute(call);
|
||||
}
|
||||
|
||||
/**
|
||||
* (asynchronously)
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback<Void> callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
apiClient.executeAsync(call, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithQueryParams
|
||||
* @param query (required)
|
||||
|
@ -0,0 +1,156 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Parcel;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass implements Parcelable {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeValue(file);
|
||||
out.writeValue(files);
|
||||
}
|
||||
|
||||
FileSchemaTestClass(Parcel in) {
|
||||
file = (java.io.File)in.readValue(java.io.File.class.getClassLoader());
|
||||
files = (List<java.io.File>)in.readValue(java.io.File.class.getClassLoader());
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<FileSchemaTestClass> CREATOR = new Parcelable.Creator<FileSchemaTestClass>() {
|
||||
public FileSchemaTestClass createFromParcel(Parcel in) {
|
||||
return new FileSchemaTestClass(in);
|
||||
}
|
||||
public FileSchemaTestClass[] newArray(int size) {
|
||||
return new FileSchemaTestClass[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -30,6 +30,7 @@ import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -528,6 +529,124 @@ public class FakeApi {
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithFileSchema
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
||||
@Override
|
||||
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
||||
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.build();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private com.squareup.okhttp.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)");
|
||||
}
|
||||
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
return call;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null, null);
|
||||
return apiClient.execute(call);
|
||||
}
|
||||
|
||||
/**
|
||||
* (asynchronously)
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback<Void> callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
apiClient.executeAsync(call, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithQueryParams
|
||||
* @param query (required)
|
||||
|
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -180,6 +181,48 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testBodyWithFileSchema()
|
||||
.body(fileSchemaTestClass).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -69,6 +70,10 @@ public class FakeApi {
|
||||
return new FakeOuterStringSerializeOper(reqSpec);
|
||||
}
|
||||
|
||||
public TestBodyWithFileSchemaOper testBodyWithFileSchema() {
|
||||
return new TestBodyWithFileSchemaOper(reqSpec);
|
||||
}
|
||||
|
||||
public TestBodyWithQueryParamsOper testBodyWithQueryParams() {
|
||||
return new TestBodyWithQueryParamsOper(reqSpec);
|
||||
}
|
||||
@ -415,6 +420,73 @@ public class FakeApi {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
*
|
||||
* @see #body (required)
|
||||
*/
|
||||
public class TestBodyWithFileSchemaOper {
|
||||
|
||||
public static final String REQ_URI = "/fake/body-with-file-schema";
|
||||
|
||||
private RequestSpecBuilder reqSpec;
|
||||
|
||||
private ResponseSpecBuilder respSpec;
|
||||
|
||||
public TestBodyWithFileSchemaOper() {
|
||||
this.reqSpec = new RequestSpecBuilder();
|
||||
reqSpec.setContentType("application/json");
|
||||
reqSpec.setAccept("application/json");
|
||||
this.respSpec = new ResponseSpecBuilder();
|
||||
}
|
||||
|
||||
public TestBodyWithFileSchemaOper(RequestSpecBuilder reqSpec) {
|
||||
this.reqSpec = reqSpec;
|
||||
reqSpec.setContentType("application/json");
|
||||
reqSpec.setAccept("application/json");
|
||||
this.respSpec = new ResponseSpecBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /fake/body-with-file-schema
|
||||
* @param handler handler
|
||||
* @param <T> type
|
||||
* @return type
|
||||
*/
|
||||
public <T> T execute(Function<Response, T> handler) {
|
||||
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PUT, REQ_URI));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileSchemaTestClass (FileSchemaTestClass) (required)
|
||||
* @return operation
|
||||
*/
|
||||
public TestBodyWithFileSchemaOper body(FileSchemaTestClass fileSchemaTestClass) {
|
||||
reqSpec.setBody(fileSchemaTestClass);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customise request specification
|
||||
* @param consumer consumer
|
||||
* @return operation
|
||||
*/
|
||||
public TestBodyWithFileSchemaOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||
consumer.accept(reqSpec);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customise response specification
|
||||
* @param consumer consumer
|
||||
* @return operation
|
||||
*/
|
||||
public TestBodyWithFileSchemaOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||
consumer.accept(respSpec);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -10,6 +10,7 @@ import javax.ws.rs.core.GenericType;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -184,6 +185,46 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -167,6 +168,39 @@ public class FakeApi {
|
||||
ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* <p><b>200</b> - Success
|
||||
* @param fileSchemaTestClass The fileSchemaTestClass parameter
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws RestClientException {
|
||||
Object postBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] accepts = { };
|
||||
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String[] contentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.*;
|
||||
import javax.xml.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
@XmlRootElement(name = "FileSchemaTestClass")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@JacksonXmlRootElement(localName = "FileSchemaTestClass")
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
@JacksonXmlProperty(localName = "file")
|
||||
@XmlElement(name = "file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
// Is a container wrapped=false
|
||||
// items.name=files items.baseName=files items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=java.io.File
|
||||
@XmlElement(name = "files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -167,6 +168,39 @@ public class FakeApi {
|
||||
ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* <p><b>200</b> - Success
|
||||
* @param fileSchemaTestClass The fileSchemaTestClass parameter
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws RestClientException {
|
||||
Object postBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] accepts = { };
|
||||
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
|
||||
final String[] contentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import org.joda.time.DateTime;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
import org.openapitools.client.model.User;
|
||||
@ -116,6 +117,30 @@ public interface FakeApi {
|
||||
void fakeOuterStringSerialize(
|
||||
@retrofit.http.Body String body, Callback<String> cb
|
||||
);
|
||||
/**
|
||||
*
|
||||
* Sync method
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return Void
|
||||
*/
|
||||
|
||||
@PUT("/fake/body-with-file-schema")
|
||||
Void testBodyWithFileSchema(
|
||||
@retrofit.http.Body FileSchemaTestClass fileSchemaTestClass
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* Async method
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param cb callback method
|
||||
*/
|
||||
|
||||
@PUT("/fake/body-with-file-schema")
|
||||
void testBodyWithFileSchema(
|
||||
@retrofit.http.Body FileSchemaTestClass fileSchemaTestClass, Callback<Void> cb
|
||||
);
|
||||
/**
|
||||
*
|
||||
* Sync method
|
||||
|
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@ import okhttp3.MultipartBody;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -72,6 +73,20 @@ public interface FakeApi {
|
||||
@retrofit2.http.Body String body
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return Call<Void>
|
||||
*/
|
||||
@Headers({
|
||||
"Content-Type:application/json"
|
||||
})
|
||||
@PUT("fake/body-with-file-schema")
|
||||
F.Promise<Response<Void>> testBodyWithFileSchema(
|
||||
@retrofit2.http.Body FileSchemaTestClass fileSchemaTestClass
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@ import okhttp3.MultipartBody;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -72,6 +73,20 @@ public interface FakeApi {
|
||||
@retrofit2.http.Body String body
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return Call<Void>
|
||||
*/
|
||||
@Headers({
|
||||
"Content-Type:application/json"
|
||||
})
|
||||
@PUT("fake/body-with-file-schema")
|
||||
CompletionStage<Response<Void>> testBodyWithFileSchema(
|
||||
@retrofit2.http.Body FileSchemaTestClass fileSchemaTestClass
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -12,6 +12,7 @@ import okhttp3.MultipartBody;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -67,6 +68,20 @@ public interface FakeApi {
|
||||
@retrofit2.http.Body String body
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return Call<Void>
|
||||
*/
|
||||
@Headers({
|
||||
"Content-Type:application/json"
|
||||
})
|
||||
@PUT("fake/body-with-file-schema")
|
||||
Call<Void> testBodyWithFileSchema(
|
||||
@retrofit2.http.Body FileSchemaTestClass fileSchemaTestClass
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -12,6 +12,7 @@ import okhttp3.MultipartBody;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -67,6 +68,20 @@ public interface FakeApi {
|
||||
@retrofit2.http.Body String body
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return Observable<Void>
|
||||
*/
|
||||
@Headers({
|
||||
"Content-Type:application/json"
|
||||
})
|
||||
@PUT("fake/body-with-file-schema")
|
||||
Observable<Void> testBodyWithFileSchema(
|
||||
@retrofit2.http.Body FileSchemaTestClass fileSchemaTestClass
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ import okhttp3.MultipartBody;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -68,6 +69,20 @@ public interface FakeApi {
|
||||
@retrofit2.http.Body String body
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return Completable
|
||||
*/
|
||||
@Headers({
|
||||
"Content-Type:application/json"
|
||||
})
|
||||
@PUT("fake/body-with-file-schema")
|
||||
Completable testBodyWithFileSchema(
|
||||
@retrofit2.http.Body FileSchemaTestClass fileSchemaTestClass
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -3,6 +3,7 @@ package org.openapitools.client.api;
|
||||
import io.vertx.core.file.AsyncFile;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -23,6 +24,8 @@ public interface FakeApi {
|
||||
|
||||
void fakeOuterStringSerialize(String body, Handler<AsyncResult<String>> handler);
|
||||
|
||||
void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass, Handler<AsyncResult<Void>> handler);
|
||||
|
||||
void testBodyWithQueryParams(String query, User user, Handler<AsyncResult<Void>> handler);
|
||||
|
||||
void testClientModel(Client client, Handler<AsyncResult<Client>> handler);
|
||||
|
@ -3,6 +3,7 @@ package org.openapitools.client.api;
|
||||
import io.vertx.core.file.AsyncFile;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -155,6 +156,40 @@ public class FakeApiImpl implements FakeApi {
|
||||
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param resultHandler Asynchronous result handler
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass, Handler<AsyncResult<Void>> resultHandler) {
|
||||
Object localVarBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"));
|
||||
return;
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
|
||||
// header params
|
||||
MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap();
|
||||
|
||||
// form params
|
||||
// TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client)
|
||||
Map<String, Object> localVarFormParams = new HashMap<>();
|
||||
|
||||
String[] localVarAccepts = { };
|
||||
String[] localVarContentTypes = { "application/json" };
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -3,6 +3,7 @@ package org.openapitools.client.api.rxjava;
|
||||
import io.vertx.core.file.AsyncFile;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@ -111,6 +112,27 @@ public class FakeApi {
|
||||
delegate.fakeOuterStringSerialize(body, fut);
|
||||
}));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param resultHandler Asynchronous result handler
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass, Handler<AsyncResult<Void>> resultHandler) {
|
||||
delegate.testBodyWithFileSchema(fileSchemaTestClass, resultHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return Asynchronous result handler (RxJava Single)
|
||||
*/
|
||||
public Single<Void> rxTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) {
|
||||
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
|
||||
delegate.testBodyWithFileSchema(fileSchemaTestClass, fut);
|
||||
}));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -84,6 +84,7 @@ Class | Method | HTTP request | Description
|
||||
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
*FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
|
||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/Api/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
|
||||
*FakeApi* | [**testBodyWithFileSchema**](docs/Api/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
|
||||
*FakeApi* | [**testBodyWithQueryParams**](docs/Api/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
|
||||
*FakeApi* | [**testClientModel**](docs/Api/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
|
||||
*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -132,6 +133,8 @@ Class | Method | HTTP request | Description
|
||||
- [EnumArrays](docs/Model/EnumArrays.md)
|
||||
- [EnumClass](docs/Model/EnumClass.md)
|
||||
- [EnumTest](docs/Model/EnumTest.md)
|
||||
- [File](docs/Model/File.md)
|
||||
- [FileSchemaTestClass](docs/Model/FileSchemaTestClass.md)
|
||||
- [FormatTest](docs/Model/FormatTest.md)
|
||||
- [HasOnlyReadOnly](docs/Model/HasOnlyReadOnly.md)
|
||||
- [MapTest](docs/Model/MapTest.md)
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**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
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -212,6 +213,54 @@ No authorization required
|
||||
|
||||
[[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**
|
||||
> testBodyWithFileSchema($file_schema_test_class)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\FakeApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$file_schema_test_class = new \OpenAPI\Client\Model\FileSchemaTestClass(); // \OpenAPI\Client\Model\FileSchemaTestClass |
|
||||
|
||||
try {
|
||||
$apiInstance->testBodyWithFileSchema($file_schema_test_class);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling FakeApi->testBodyWithFileSchema: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**file_schema_test_class** | [**\OpenAPI\Client\Model\FileSchemaTestClass**](../Model/FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams($query, $user)
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
# File
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**source_uri** | **string** | Test capitalization | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**\OpenAPI\Client\Model\File**](File.md) | | [optional]
|
||||
**files** | [**\OpenAPI\Client\Model\File[]**](File.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -1151,6 +1151,221 @@ class FakeApi
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testBodyWithFileSchema
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class file_schema_test_class (required)
|
||||
*
|
||||
* @throws \OpenAPI\Client\ApiException on non-2xx response
|
||||
* @throws \InvalidArgumentException
|
||||
* @return void
|
||||
*/
|
||||
public function testBodyWithFileSchema($file_schema_test_class)
|
||||
{
|
||||
$this->testBodyWithFileSchemaWithHttpInfo($file_schema_test_class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testBodyWithFileSchemaWithHttpInfo
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required)
|
||||
*
|
||||
* @throws \OpenAPI\Client\ApiException on non-2xx response
|
||||
* @throws \InvalidArgumentException
|
||||
* @return array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
*/
|
||||
public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class)
|
||||
{
|
||||
$request = $this->testBodyWithFileSchemaRequest($file_schema_test_class);
|
||||
|
||||
try {
|
||||
$options = $this->createHttpClientOption();
|
||||
try {
|
||||
$response = $this->client->send($request, $options);
|
||||
} catch (RequestException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
$e->getCode(),
|
||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
|
||||
);
|
||||
}
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$response->getBody()
|
||||
);
|
||||
}
|
||||
|
||||
return [null, $statusCode, $response->getHeaders()];
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testBodyWithFileSchemaAsync
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required)
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||
*/
|
||||
public function testBodyWithFileSchemaAsync($file_schema_test_class)
|
||||
{
|
||||
return $this->testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class)
|
||||
->then(
|
||||
function ($response) {
|
||||
return $response[0];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testBodyWithFileSchemaAsyncWithHttpInfo
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required)
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||
*/
|
||||
public function testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class)
|
||||
{
|
||||
$returnType = '';
|
||||
$request = $this->testBodyWithFileSchemaRequest($file_schema_test_class);
|
||||
|
||||
return $this->client
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
return [null, $response->getStatusCode(), $response->getHeaders()];
|
||||
},
|
||||
function ($exception) {
|
||||
$response = $exception->getResponse();
|
||||
$statusCode = $response->getStatusCode();
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$exception->getRequest()->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$response->getBody()
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create request for operation 'testBodyWithFileSchema'
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required)
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Psr7\Request
|
||||
*/
|
||||
protected function testBodyWithFileSchemaRequest($file_schema_test_class)
|
||||
{
|
||||
// verify the required parameter 'file_schema_test_class' is set
|
||||
if ($file_schema_test_class === null || (is_array($file_schema_test_class) && count($file_schema_test_class) === 0)) {
|
||||
throw new \InvalidArgumentException(
|
||||
'Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema'
|
||||
);
|
||||
}
|
||||
|
||||
$resourcePath = '/fake/body-with-file-schema';
|
||||
$formParams = [];
|
||||
$queryParams = [];
|
||||
$headerParams = [];
|
||||
$httpBody = '';
|
||||
$multipart = false;
|
||||
|
||||
|
||||
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
if (isset($file_schema_test_class)) {
|
||||
$_tempBody = $file_schema_test_class;
|
||||
}
|
||||
|
||||
if ($multipart) {
|
||||
$headers = $this->headerSelector->selectHeadersForMultipart(
|
||||
[]
|
||||
);
|
||||
} else {
|
||||
$headers = $this->headerSelector->selectHeaders(
|
||||
[],
|
||||
['application/json']
|
||||
);
|
||||
}
|
||||
|
||||
// for model (json/xml)
|
||||
if (isset($_tempBody)) {
|
||||
// $_tempBody is the method argument, if present
|
||||
$httpBody = $_tempBody;
|
||||
// \stdClass has no __toString(), so we should encode it manually
|
||||
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
|
||||
$httpBody = \GuzzleHttp\json_encode($httpBody);
|
||||
}
|
||||
} elseif (count($formParams) > 0) {
|
||||
if ($multipart) {
|
||||
$multipartContents = [];
|
||||
foreach ($formParams as $formParamName => $formParamValue) {
|
||||
$multipartContents[] = [
|
||||
'name' => $formParamName,
|
||||
'contents' => $formParamValue
|
||||
];
|
||||
}
|
||||
// for HTTP post (form)
|
||||
$httpBody = new MultipartStream($multipartContents);
|
||||
|
||||
} elseif ($headers['Content-Type'] === 'application/json') {
|
||||
$httpBody = \GuzzleHttp\json_encode($formParams);
|
||||
|
||||
} else {
|
||||
// for HTTP post (form)
|
||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$defaultHeaders = [];
|
||||
if ($this->config->getUserAgent()) {
|
||||
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
||||
}
|
||||
|
||||
$headers = array_merge(
|
||||
$defaultHeaders,
|
||||
$headerParams,
|
||||
$headers
|
||||
);
|
||||
|
||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
||||
return new Request(
|
||||
'PUT',
|
||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||
$headers,
|
||||
$httpBody
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testBodyWithQueryParams
|
||||
*
|
||||
|
297
samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php
Normal file
297
samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php
Normal file
@ -0,0 +1,297 @@
|
||||
<?php
|
||||
/**
|
||||
* File
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.1.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* File Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class File implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'File';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'source_uri' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'source_uri' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'source_uri' => 'sourceURI'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'source_uri' => 'setSourceUri'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'source_uri' => 'getSourceUri'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['source_uri'] = isset($data['source_uri']) ? $data['source_uri'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets source_uri
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSourceUri()
|
||||
{
|
||||
return $this->container['source_uri'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets source_uri
|
||||
*
|
||||
* @param string|null $source_uri Test capitalization
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSourceUri($source_uri)
|
||||
{
|
||||
$this->container['source_uri'] = $source_uri;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,327 @@
|
||||
<?php
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.1.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class FileSchemaTestClass implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'FileSchemaTestClass';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'file' => '\OpenAPI\Client\Model\File',
|
||||
'files' => '\OpenAPI\Client\Model\File[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'file' => null,
|
||||
'files' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'file' => 'file',
|
||||
'files' => 'files'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'file' => 'setFile',
|
||||
'files' => 'setFiles'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'file' => 'getFile',
|
||||
'files' => 'getFiles'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['file'] = isset($data['file']) ? $data['file'] : null;
|
||||
$this->container['files'] = isset($data['files']) ? $data['files'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets file
|
||||
*
|
||||
* @return \OpenAPI\Client\Model\File|null
|
||||
*/
|
||||
public function getFile()
|
||||
{
|
||||
return $this->container['file'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets file
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\File|null $file file
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFile($file)
|
||||
{
|
||||
$this->container['file'] = $file;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets files
|
||||
*
|
||||
* @return \OpenAPI\Client\Model\File[]|null
|
||||
*/
|
||||
public function getFiles()
|
||||
{
|
||||
return $this->container['files'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets files
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\File[]|null $files files
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFiles($files)
|
||||
{
|
||||
$this->container['files'] = $files;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,6 +111,16 @@ class FakeApiTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testBodyWithFileSchema
|
||||
*
|
||||
* .
|
||||
*
|
||||
*/
|
||||
public function testTestBodyWithFileSchema()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testBodyWithQueryParams
|
||||
*
|
||||
|
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* FileSchemaTestClassTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.1.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClassTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description FileSchemaTestClass
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class FileSchemaTestClassTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "FileSchemaTestClass"
|
||||
*/
|
||||
public function testFileSchemaTestClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "file"
|
||||
*/
|
||||
public function testPropertyFile()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "files"
|
||||
*/
|
||||
public function testPropertyFiles()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* FileTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.1.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client;
|
||||
|
||||
/**
|
||||
* FileTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description File
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class FileTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "File"
|
||||
*/
|
||||
public function testFile()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "source_uri"
|
||||
*/
|
||||
public function testPropertySourceUri()
|
||||
{
|
||||
}
|
||||
}
|
@ -78,6 +78,7 @@ Class | Method | HTTP request | Description
|
||||
*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
|
||||
*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
|
||||
*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
|
||||
*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||
*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
|
||||
*Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
|
||||
*Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -126,6 +127,8 @@ Class | Method | HTTP request | Description
|
||||
- [Petstore::EnumArrays](docs/EnumArrays.md)
|
||||
- [Petstore::EnumClass](docs/EnumClass.md)
|
||||
- [Petstore::EnumTest](docs/EnumTest.md)
|
||||
- [Petstore::File](docs/File.md)
|
||||
- [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [Petstore::FormatTest](docs/FormatTest.md)
|
||||
- [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [Petstore::List](docs/List.md)
|
||||
|
@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
|
||||
[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
|
||||
[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
|
||||
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
|
||||
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
|
||||
[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@ -200,6 +201,49 @@ No authorization required
|
||||
|
||||
|
||||
|
||||
# **test_body_with_file_schema**
|
||||
> test_body_with_file_schema(file_schema_test_class)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
|
||||
api_instance = Petstore::FakeApi.new
|
||||
file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass |
|
||||
|
||||
begin
|
||||
api_instance.test_body_with_file_schema(file_schema_test_class)
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
nil (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
|
||||
# **test_body_with_query_params**
|
||||
> test_body_with_query_params(query, user)
|
||||
|
||||
|
8
samples/client/petstore/ruby/docs/File.md
Normal file
8
samples/client/petstore/ruby/docs/File.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Petstore::File
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**source_uri** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user