[Python] Add echo_api test object serialization for multipart requests (#18176)

* [python] echo add test object serialization for multipart requests

* [echo api] update samples

* [echo api] update samples
This commit is contained in:
ふぁ
2024-03-23 22:40:10 +09:00
committed by GitHub
parent 420e49f258
commit 5e9546451c
137 changed files with 7427 additions and 0 deletions

View File

@@ -131,6 +131,33 @@ paths:
text/plain:
schema:
type: string
/form/object/multipart:
post:
tags:
- form
summary: Test form parameter(s) for multipart schema
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
type: object
required:
- marker
properties:
marker:
type: object
properties:
name:
type: string
responses:
'200':
description: Successful operation
content:
text/plain:
schema:
type: string
# header parameter tests
/header/integer/boolean/string/enums:
get:

View File

@@ -18,6 +18,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -54,6 +55,7 @@ src/Org.OpenAPITools/Model/Pet.cs
src/Org.OpenAPITools/Model/Query.cs
src/Org.OpenAPITools/Model/StringEnumRef.cs
src/Org.OpenAPITools/Model/Tag.cs
src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs
src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs
src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs
src/Org.OpenAPITools/Org.OpenAPITools.csproj

View File

@@ -130,6 +130,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**TestEchoBodyStringEnum**](docs/BodyApi.md#testechobodystringenum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**TestEchoBodyTagResponseString**](docs/BodyApi.md#testechobodytagresponsestring) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**TestFormIntegerBooleanString**](docs/FormApi.md#testformintegerbooleanstring) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**TestFormObjectMultipart**](docs/FormApi.md#testformobjectmultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**TestFormOneof**](docs/FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**TestHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -157,6 +158,7 @@ Class | Method | HTTP request | Description
- [Model.Query](docs/Query.md)
- [Model.StringEnumRef](docs/StringEnumRef.md)
- [Model.Tag](docs/Tag.md)
- [Model.TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [Model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [Model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -96,6 +96,25 @@ paths:
summary: Test form parameter(s) for oneOf schema
tags:
- form
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -870,6 +889,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**TestFormIntegerBooleanString**](FormApi.md#testformintegerbooleanstring) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**TestFormObjectMultipart**](FormApi.md#testformobjectmultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**TestFormOneof**](FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
<a id="testformintegerbooleanstring"></a>
@@ -95,6 +96,97 @@ No authorization required
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
[[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)
<a id="testformobjectmultipart"></a>
# **TestFormObjectMultipart**
> string TestFormObjectMultipart (TestFormObjectMultipartRequestMarker marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class TestFormObjectMultipartExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://localhost:3000";
var apiInstance = new FormApi(config);
var marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker |
try
{
// Test form parameter(s) for multipart schema
string result = apiInstance.TestFormObjectMultipart(marker);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FormApi.TestFormObjectMultipart: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the TestFormObjectMultipartWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Test form parameter(s) for multipart schema
ApiResponse<string> response = apiInstance.TestFormObjectMultipartWithHttpInfo(marker);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FormApi.TestFormObjectMultipartWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md) | | |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|

View File

@@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.TestFormObjectMultipartRequestMarker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [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)

View File

@@ -0,0 +1,67 @@
/*
* Echo Server API
*
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing TestFormObjectMultipartRequestMarker
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class TestFormObjectMultipartRequestMarkerTests : IDisposable
{
// TODO uncomment below to declare an instance variable for TestFormObjectMultipartRequestMarker
//private TestFormObjectMultipartRequestMarker instance;
public TestFormObjectMultipartRequestMarkerTests()
{
// TODO uncomment below to create an instance of TestFormObjectMultipartRequestMarker
//instance = new TestFormObjectMultipartRequestMarker();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of TestFormObjectMultipartRequestMarker
/// </summary>
[Fact]
public void TestFormObjectMultipartRequestMarkerInstanceTest()
{
// TODO uncomment below to test "IsType" TestFormObjectMultipartRequestMarker
//Assert.IsType<TestFormObjectMultipartRequestMarker>(instance);
}
/// <summary>
/// Test the property 'Name'
/// </summary>
[Fact]
public void NameTest()
{
// TODO unit test for the property 'Name'
}
}
}

View File

@@ -16,6 +16,7 @@ using System.Linq;
using System.Net;
using System.Net.Mime;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Org.OpenAPITools.Api
{
@@ -54,6 +55,29 @@ namespace Org.OpenAPITools.Api
/// <returns>ApiResponse of string</returns>
ApiResponse<string> TestFormIntegerBooleanStringWithHttpInfo(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0);
/// <summary>
/// Test form parameter(s) for multipart schema
/// </summary>
/// <remarks>
/// Test form parameter(s) for multipart schema
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
string TestFormObjectMultipart(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0);
/// <summary>
/// Test form parameter(s) for multipart schema
/// </summary>
/// <remarks>
/// Test form parameter(s) for multipart schema
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> TestFormObjectMultipartWithHttpInfo(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0);
/// <summary>
/// Test form parameter(s) for oneOf schema
/// </summary>
/// <remarks>
@@ -125,6 +149,31 @@ namespace Org.OpenAPITools.Api
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> TestFormIntegerBooleanStringWithHttpInfoAsync(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Test form parameter(s) for multipart schema
/// </summary>
/// <remarks>
/// Test form parameter(s) for multipart schema
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> TestFormObjectMultipartAsync(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Test form parameter(s) for multipart schema
/// </summary>
/// <remarks>
/// Test form parameter(s) for multipart schema
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> TestFormObjectMultipartWithHttpInfoAsync(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Test form parameter(s) for oneOf schema
/// </summary>
/// <remarks>
@@ -443,6 +492,152 @@ namespace Org.OpenAPITools.Api
return localVarResponse;
}
/// <summary>
/// Test form parameter(s) for multipart schema Test form parameter(s) for multipart schema
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
public string TestFormObjectMultipart(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = TestFormObjectMultipartWithHttpInfo(marker);
return localVarResponse.Data;
}
/// <summary>
/// Test form parameter(s) for multipart schema Test form parameter(s) for multipart schema
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> TestFormObjectMultipartWithHttpInfo(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0)
{
// verify the required parameter 'marker' is set
if (marker == null)
{
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'marker' when calling FormApi->TestFormObjectMultipart");
}
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
"multipart/form-data"
};
// to determine the Accept header
string[] _accepts = new string[] {
"text/plain"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.FormParameters.Add("marker", Org.OpenAPITools.Client.ClientUtils.Serialize(marker)); // form parameter
localVarRequestOptions.Operation = "FormApi.TestFormObjectMultipart";
localVarRequestOptions.OperationIndex = operationIndex;
// make the HTTP request
var localVarResponse = this.Client.Post<string>("/form/object/multipart", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("TestFormObjectMultipart", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Test form parameter(s) for multipart schema Test form parameter(s) for multipart schema
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> TestFormObjectMultipartAsync(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await TestFormObjectMultipartWithHttpInfoAsync(marker, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
/// <summary>
/// Test form parameter(s) for multipart schema Test form parameter(s) for multipart schema
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="marker"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> TestFormObjectMultipartWithHttpInfoAsync(TestFormObjectMultipartRequestMarker marker, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// verify the required parameter 'marker' is set
if (marker == null)
{
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'marker' when calling FormApi->TestFormObjectMultipart");
}
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
"multipart/form-data"
};
// to determine the Accept header
string[] _accepts = new string[] {
"text/plain"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.FormParameters.Add("marker", Org.OpenAPITools.Client.ClientUtils.Serialize(marker)); // form parameter
localVarRequestOptions.Operation = "FormApi.TestFormObjectMultipart";
localVarRequestOptions.OperationIndex = operationIndex;
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.PostAsync<string>("/form/object/multipart", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("TestFormObjectMultipart", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Test form parameter(s) for oneOf schema Test form parameter(s) for oneOf schema
/// </summary>

View File

@@ -0,0 +1,129 @@
/*
* Echo Server API
*
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// TestFormObjectMultipartRequestMarker
/// </summary>
[DataContract(Name = "test_form_object_multipart_request_marker")]
public partial class TestFormObjectMultipartRequestMarker : IEquatable<TestFormObjectMultipartRequestMarker>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="TestFormObjectMultipartRequestMarker" /> class.
/// </summary>
/// <param name="name">name.</param>
public TestFormObjectMultipartRequestMarker(string name = default(string))
{
this.Name = name;
}
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class TestFormObjectMultipartRequestMarker {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as TestFormObjectMultipartRequestMarker);
}
/// <summary>
/// Returns true if TestFormObjectMultipartRequestMarker instances are equal
/// </summary>
/// <param name="input">Instance of TestFormObjectMultipartRequestMarker to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(TestFormObjectMultipartRequestMarker input)
{
if (input == null)
{
return false;
}
return
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Name != null)
{
hashCode = (hashCode * 59) + this.Name.GetHashCode();
}
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@@ -25,6 +25,7 @@ docs/Query.md
docs/QueryAPI.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -39,6 +40,7 @@ model_pet.go
model_query.go
model_string_enum_ref.go
model_tag.go
model_test_form_object_multipart_request_marker.go
model_test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.go
model_test_query_style_form_explode_true_array_string_query_object_parameter.go
response.go

View File

@@ -91,6 +91,7 @@ Class | Method | HTTP request | Description
*BodyAPI* | [**TestEchoBodyStringEnum**](docs/BodyAPI.md#testechobodystringenum) | **Post** /echo/body/string_enum | Test string enum response body
*BodyAPI* | [**TestEchoBodyTagResponseString**](docs/BodyAPI.md#testechobodytagresponsestring) | **Post** /echo/body/Tag/response_string | Test empty json (request body)
*FormAPI* | [**TestFormIntegerBooleanString**](docs/FormAPI.md#testformintegerbooleanstring) | **Post** /form/integer/boolean/string | Test form parameter(s)
*FormAPI* | [**TestFormObjectMultipart**](docs/FormAPI.md#testformobjectmultipart) | **Post** /form/object/multipart | Test form parameter(s) for multipart schema
*FormAPI* | [**TestFormOneof**](docs/FormAPI.md#testformoneof) | **Post** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderAPI* | [**TestHeaderIntegerBooleanStringEnums**](docs/HeaderAPI.md#testheaderintegerbooleanstringenums) | **Get** /header/integer/boolean/string/enums | Test header parameter(s)
*PathAPI* | [**TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathAPI.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **Get** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -117,6 +118,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -96,6 +96,25 @@ paths:
summary: Test form parameter(s) for oneOf schema
tags:
- form
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -870,6 +889,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -149,6 +149,115 @@ func (a *FormAPIService) TestFormIntegerBooleanStringExecute(r ApiTestFormIntege
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiTestFormObjectMultipartRequest struct {
ctx context.Context
ApiService *FormAPIService
marker *TestFormObjectMultipartRequestMarker
}
func (r ApiTestFormObjectMultipartRequest) Marker(marker TestFormObjectMultipartRequestMarker) ApiTestFormObjectMultipartRequest {
r.marker = &marker
return r
}
func (r ApiTestFormObjectMultipartRequest) Execute() (string, *http.Response, error) {
return r.ApiService.TestFormObjectMultipartExecute(r)
}
/*
TestFormObjectMultipart Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiTestFormObjectMultipartRequest
*/
func (a *FormAPIService) TestFormObjectMultipart(ctx context.Context) ApiTestFormObjectMultipartRequest {
return ApiTestFormObjectMultipartRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return string
func (a *FormAPIService) TestFormObjectMultipartExecute(r ApiTestFormObjectMultipartRequest) (string, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue string
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FormAPIService.TestFormObjectMultipart")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/form/object/multipart"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.marker == nil {
return localVarReturnValue, nil, reportError("marker is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"multipart/form-data"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"text/plain"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
parameterAddToHeaderOrQuery(localVarFormParams, "marker", r.marker, "")
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiTestFormOneofRequest struct {
ctx context.Context
ApiService *FormAPIService

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**TestFormIntegerBooleanString**](FormAPI.md#TestFormIntegerBooleanString) | **Post** /form/integer/boolean/string | Test form parameter(s)
[**TestFormObjectMultipart**](FormAPI.md#TestFormObjectMultipart) | **Post** /form/object/multipart | Test form parameter(s) for multipart schema
[**TestFormOneof**](FormAPI.md#TestFormOneof) | **Post** /form/oneof | Test form parameter(s) for oneOf schema
@@ -79,6 +80,72 @@ No authorization required
[[Back to README]](../README.md)
## TestFormObjectMultipart
> string TestFormObjectMultipart(ctx).Marker(marker).Execute()
Test form parameter(s) for multipart schema
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
marker := *openapiclient.NewTestFormObjectMultipartRequestMarker() // TestFormObjectMultipartRequestMarker |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FormAPI.TestFormObjectMultipart(context.Background()).Marker(marker).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormObjectMultipart``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TestFormObjectMultipart`: string
fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormObjectMultipart`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiTestFormObjectMultipartRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md) | |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
[[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)
## TestFormOneof
> string TestFormOneof(ctx).Form1(form1).Form2(form2).Form3(form3).Form4(form4).Id(id).Name(name).Execute()

View File

@@ -0,0 +1,56 @@
# TestFormObjectMultipartRequestMarker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | Pointer to **string** | | [optional]
## Methods
### NewTestFormObjectMultipartRequestMarker
`func NewTestFormObjectMultipartRequestMarker() *TestFormObjectMultipartRequestMarker`
NewTestFormObjectMultipartRequestMarker instantiates a new TestFormObjectMultipartRequestMarker object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewTestFormObjectMultipartRequestMarkerWithDefaults
`func NewTestFormObjectMultipartRequestMarkerWithDefaults() *TestFormObjectMultipartRequestMarker`
NewTestFormObjectMultipartRequestMarkerWithDefaults instantiates a new TestFormObjectMultipartRequestMarker object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetName
`func (o *TestFormObjectMultipartRequestMarker) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *TestFormObjectMultipartRequestMarker) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *TestFormObjectMultipartRequestMarker) SetName(v string)`
SetName sets Name field to given value.
### HasName
`func (o *TestFormObjectMultipartRequestMarker) HasName() bool`
HasName returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,127 @@
/*
Echo Server API
Echo Server API
API version: 0.1.0
Contact: team@openapitools.org
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the TestFormObjectMultipartRequestMarker type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TestFormObjectMultipartRequestMarker{}
// TestFormObjectMultipartRequestMarker struct for TestFormObjectMultipartRequestMarker
type TestFormObjectMultipartRequestMarker struct {
Name *string `json:"name,omitempty"`
}
// NewTestFormObjectMultipartRequestMarker instantiates a new TestFormObjectMultipartRequestMarker object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTestFormObjectMultipartRequestMarker() *TestFormObjectMultipartRequestMarker {
this := TestFormObjectMultipartRequestMarker{}
return &this
}
// NewTestFormObjectMultipartRequestMarkerWithDefaults instantiates a new TestFormObjectMultipartRequestMarker object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTestFormObjectMultipartRequestMarkerWithDefaults() *TestFormObjectMultipartRequestMarker {
this := TestFormObjectMultipartRequestMarker{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *TestFormObjectMultipartRequestMarker) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TestFormObjectMultipartRequestMarker) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *TestFormObjectMultipartRequestMarker) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *TestFormObjectMultipartRequestMarker) SetName(v string) {
o.Name = &v
}
func (o TestFormObjectMultipartRequestMarker) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TestFormObjectMultipartRequestMarker) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
return toSerialize, nil
}
type NullableTestFormObjectMultipartRequestMarker struct {
value *TestFormObjectMultipartRequestMarker
isSet bool
}
func (v NullableTestFormObjectMultipartRequestMarker) Get() *TestFormObjectMultipartRequestMarker {
return v.value
}
func (v *NullableTestFormObjectMultipartRequestMarker) Set(val *TestFormObjectMultipartRequestMarker) {
v.value = val
v.isSet = true
}
func (v NullableTestFormObjectMultipartRequestMarker) IsSet() bool {
return v.isSet
}
func (v *NullableTestFormObjectMultipartRequestMarker) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTestFormObjectMultipartRequestMarker(val *TestFormObjectMultipartRequestMarker) *NullableTestFormObjectMultipartRequestMarker {
return &NullableTestFormObjectMultipartRequestMarker{value: val, isSet: true}
}
func (v NullableTestFormObjectMultipartRequestMarker) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTestFormObjectMultipartRequestMarker) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -20,6 +20,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -60,5 +61,6 @@ src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Query.java
src/main/java/org/openapitools/client/model/StringEnumRef.java
src/main/java/org/openapitools/client/model/Tag.java
src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java

View File

@@ -125,6 +125,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**testEchoBodyStringEnum**](docs/BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**testFormObjectMultipart**](docs/FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**testFormOneof**](docs/FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -151,6 +152,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -104,6 +104,28 @@ paths:
x-content-type: application/x-www-form-urlencoded
x-accepts:
- text/plain
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
x-content-type: multipart/form-data
x-accepts:
- text/plain
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -933,6 +955,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
@@ -79,6 +80,72 @@ No authorization required
| **200** | Successful operation | - |
## testFormObjectMultipart
> String testFormObjectMultipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FormApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
FormApi apiInstance = new FormApi(defaultClient);
TestFormObjectMultipartRequestMarker marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker |
try {
String result = apiInstance.testFormObjectMultipart(marker);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FormApi#testFormObjectMultipart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| | |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testFormOneof
> String testFormOneof(form1, form2, form3, form4, id, name)

View File

@@ -0,0 +1,13 @@
# TestFormObjectMultipartRequestMarker
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |

View File

@@ -20,6 +20,7 @@ import org.openapitools.client.BaseApi;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.model.TestFormObjectMultipartRequestMarker;
import java.util.ArrayList;
@@ -119,6 +120,82 @@ if (stringForm != null)
);
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return String
* @throws ApiException if fails to make API call
*/
public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker) throws ApiException {
return this.testFormObjectMultipart(marker, Collections.emptyMap());
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @param additionalHeaders additionalHeaders for this call
* @return String
* @throws ApiException if fails to make API call
*/
public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker, Map<String, String> additionalHeaders) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'marker' is set
if (marker == null) {
throw new ApiException(400, "Missing the required parameter 'marker' when calling testFormObjectMultipart");
}
// create path and map variables
String localVarPath = "/form/object/multipart";
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarHeaderParams.putAll(additionalHeaders);
if (marker != null)
localVarFormParams.put("marker", marker);
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
return apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(),
localVarPostBody,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType
);
}
/**
* Test form parameter(s) for oneOf schema
* Test form parameter(s) for oneOf schema

View File

@@ -0,0 +1,152 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;
/**
* TestFormObjectMultipartRequestMarker
*/
@JsonPropertyOrder({
TestFormObjectMultipartRequestMarker.JSON_PROPERTY_NAME
})
@JsonTypeName("test_form_object_multipart_request_marker")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
public class TestFormObjectMultipartRequestMarker {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public TestFormObjectMultipartRequestMarker() {
}
public TestFormObjectMultipartRequestMarker name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestFormObjectMultipartRequestMarker testFormObjectMultipartRequestMarker = (TestFormObjectMultipartRequestMarker) o;
return Objects.equals(this.name, testFormObjectMultipartRequestMarker.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestFormObjectMultipartRequestMarker {\n");
sb.append(" name: ").append(toIndentedString(name)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `name` to the URL query string
if (getName() != null) {
try {
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
return joiner.toString();
}
}

View File

@@ -0,0 +1,47 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
public class TestFormObjectMultipartRequestMarkerTest {
private final TestFormObjectMultipartRequestMarker model = new TestFormObjectMultipartRequestMarker();
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
@Test
public void testTestFormObjectMultipartRequestMarker() {
// TODO: test TestFormObjectMultipartRequestMarker
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
}

View File

@@ -38,5 +38,6 @@ src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Query.java
src/main/java/org/openapitools/client/model/StringEnumRef.java
src/main/java/org/openapitools/client/model/Tag.java
src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java

View File

@@ -104,6 +104,28 @@ paths:
x-content-type: application/x-www-form-urlencoded
x-accepts:
- text/plain
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
x-content-type: multipart/form-data
x-accepts:
- text/plain
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -933,6 +955,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.EncodingUtils;
import org.openapitools.client.model.ApiResponse;
import org.openapitools.client.model.TestFormObjectMultipartRequestMarker;
import java.util.ArrayList;
import java.util.HashMap;
@@ -48,6 +49,35 @@ public interface FormApi extends ApiClient.Api {
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return String
*/
@RequestLine("POST /form/object/multipart")
@Headers({
"Content-Type: multipart/form-data",
"Accept: text/plain",
})
String testFormObjectMultipart(@Param("marker") TestFormObjectMultipartRequestMarker marker);
/**
* Test form parameter(s) for multipart schema
* Similar to <code>testFormObjectMultipart</code> but it also returns the http response headers .
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /form/object/multipart")
@Headers({
"Content-Type: multipart/form-data",
"Accept: text/plain",
})
ApiResponse<String> testFormObjectMultipartWithHttpInfo(@Param("marker") TestFormObjectMultipartRequestMarker marker);
/**
* Test form parameter(s) for oneOf schema
* Test form parameter(s) for oneOf schema

View File

@@ -0,0 +1,97 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 java.io.IOException;
/**
* TestFormObjectMultipartRequestMarker
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
public class TestFormObjectMultipartRequestMarker {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public TestFormObjectMultipartRequestMarker() {
}
public TestFormObjectMultipartRequestMarker name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestFormObjectMultipartRequestMarker testFormObjectMultipartRequestMarker = (TestFormObjectMultipartRequestMarker) o;
return Objects.equals(this.name, testFormObjectMultipartRequestMarker.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestFormObjectMultipartRequestMarker {\n");
sb.append(" name: ").append(toIndentedString(name)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,46 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 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 java.io.IOException;
import org.junit.jupiter.api.Test;
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
class TestFormObjectMultipartRequestMarkerTest {
private final TestFormObjectMultipartRequestMarker model = new TestFormObjectMultipartRequestMarker();
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
@Test
void testTestFormObjectMultipartRequestMarker() {
// TODO: test TestFormObjectMultipartRequestMarker
}
/**
* Test the property 'name'
*/
@Test
void nameTest() {
// TODO: test name
}
}

View File

@@ -20,6 +20,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -56,5 +57,6 @@ src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Query.java
src/main/java/org/openapitools/client/model/StringEnumRef.java
src/main/java/org/openapitools/client/model/Tag.java
src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java

View File

@@ -132,6 +132,8 @@ Class | Method | HTTP request | Description
*BodyApi* | [**testEchoBodyTagResponseStringWithHttpInfo**](docs/BodyApi.md#testEchoBodyTagResponseStringWithHttpInfo) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**testFormIntegerBooleanStringWithHttpInfo**](docs/FormApi.md#testFormIntegerBooleanStringWithHttpInfo) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**testFormObjectMultipart**](docs/FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**testFormObjectMultipartWithHttpInfo**](docs/FormApi.md#testFormObjectMultipartWithHttpInfo) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**testFormOneof**](docs/FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*FormApi* | [**testFormOneofWithHttpInfo**](docs/FormApi.md#testFormOneofWithHttpInfo) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
@@ -171,6 +173,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -104,6 +104,28 @@ paths:
x-content-type: application/x-www-form-urlencoded
x-accepts:
- text/plain
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
x-content-type: multipart/form-data
x-accepts:
- text/plain
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -933,6 +955,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -6,6 +6,8 @@ All URIs are relative to *http://localhost:3000*
|------------- | ------------- | -------------|
| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**testFormIntegerBooleanStringWithHttpInfo**](FormApi.md#testFormIntegerBooleanStringWithHttpInfo) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**testFormObjectMultipartWithHttpInfo**](FormApi.md#testFormObjectMultipartWithHttpInfo) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
| [**testFormOneofWithHttpInfo**](FormApi.md#testFormOneofWithHttpInfo) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
@@ -153,6 +155,140 @@ No authorization required
| **200** | Successful operation | - |
## testFormObjectMultipart
> String testFormObjectMultipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FormApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
FormApi apiInstance = new FormApi(defaultClient);
TestFormObjectMultipartRequestMarker marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker |
try {
String result = apiInstance.testFormObjectMultipart(marker);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FormApi#testFormObjectMultipart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| | |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testFormObjectMultipartWithHttpInfo
> ApiResponse<String> testFormObjectMultipart testFormObjectMultipartWithHttpInfo(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FormApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
FormApi apiInstance = new FormApi(defaultClient);
TestFormObjectMultipartRequestMarker marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker |
try {
ApiResponse<String> response = apiInstance.testFormObjectMultipartWithHttpInfo(marker);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling FormApi#testFormObjectMultipart");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| | |
### Return type
ApiResponse<**String**>
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testFormOneof
> String testFormOneof(form1, form2, form3, form4, id, name)

View File

@@ -0,0 +1,13 @@
# TestFormObjectMultipartRequestMarker
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |

View File

@@ -17,6 +17,7 @@ import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Pair;
import org.openapitools.client.model.TestFormObjectMultipartRequestMarker;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -185,6 +186,117 @@ public class FormApi {
}
return localVarRequestBuilder;
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return String
* @throws ApiException if fails to make API call
*/
public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker) throws ApiException {
ApiResponse<String> localVarResponse = testFormObjectMultipartWithHttpInfo(marker);
return localVarResponse.getData();
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return ApiResponse&lt;String&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<String> testFormObjectMultipartWithHttpInfo(TestFormObjectMultipartRequestMarker marker) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = testFormObjectMultipartRequestBuilder(marker);
try {
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("testFormObjectMultipart", localVarResponse);
}
// for plain text response
if (localVarResponse.headers().map().containsKey("Content-Type") &&
"text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0).split(";")[0].trim())) {
java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A");
String responseBodyText = s.hasNext() ? s.next() : "";
return new ApiResponse<String>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
responseBodyText
);
} else {
throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse);
}
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
private HttpRequest.Builder testFormObjectMultipartRequestBuilder(TestFormObjectMultipartRequestMarker marker) throws ApiException {
// verify the required parameter 'marker' is set
if (marker == null) {
throw new ApiException(400, "Missing the required parameter 'marker' when calling testFormObjectMultipart");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/form/object/multipart";
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "text/plain");
MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create();
boolean hasFiles = false;
multiPartBuilder.addTextBody("marker", marker.toString());
HttpEntity entity = multiPartBuilder.build();
HttpRequest.BodyPublisher formDataPublisher;
if (hasFiles) {
Pipe pipe;
try {
pipe = Pipe.open();
} catch (IOException e) {
throw new RuntimeException(e);
}
new Thread(() -> {
try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) {
entity.writeTo(outputStream);
} catch (IOException e) {
e.printStackTrace();
}
}).start();
formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source()));
} else {
ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream();
try {
entity.writeTo(formOutputStream);
} catch (IOException e) {
throw new RuntimeException(e);
}
formDataPublisher = HttpRequest.BodyPublishers
.ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()));
}
localVarRequestBuilder
.header("Content-Type", entity.getContentType().getValue())
.method("POST", formDataPublisher);
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Test form parameter(s) for oneOf schema
* Test form parameter(s) for oneOf schema

View File

@@ -0,0 +1,150 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* TestFormObjectMultipartRequestMarker
*/
@JsonPropertyOrder({
TestFormObjectMultipartRequestMarker.JSON_PROPERTY_NAME
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
public class TestFormObjectMultipartRequestMarker {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public TestFormObjectMultipartRequestMarker() {
}
public TestFormObjectMultipartRequestMarker name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
/**
* Return true if this test_form_object_multipart_request_marker object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestFormObjectMultipartRequestMarker testFormObjectMultipartRequestMarker = (TestFormObjectMultipartRequestMarker) o;
return Objects.equals(this.name, testFormObjectMultipartRequestMarker.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestFormObjectMultipartRequestMarker {\n");
sb.append(" name: ").append(toIndentedString(name)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `name` to the URL query string
if (getName() != null) {
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}

View File

@@ -0,0 +1,48 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
public class TestFormObjectMultipartRequestMarkerTest {
private final TestFormObjectMultipartRequestMarker model = new TestFormObjectMultipartRequestMarker();
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
@Test
public void testTestFormObjectMultipartRequestMarker() {
// TODO: test TestFormObjectMultipartRequestMarker
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
}

View File

@@ -20,6 +20,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -64,5 +65,6 @@ src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Query.java
src/main/java/org/openapitools/client/model/StringEnumRef.java
src/main/java/org/openapitools/client/model/Tag.java
src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java

View File

@@ -132,6 +132,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**testEchoBodyStringEnum**](docs/BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**testFormObjectMultipart**](docs/FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**testFormOneof**](docs/FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -158,6 +159,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -104,6 +104,28 @@ paths:
x-content-type: application/x-www-form-urlencoded
x-accepts:
- text/plain
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
x-content-type: multipart/form-data
x-accepts:
- text/plain
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -933,6 +955,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
@@ -74,6 +75,68 @@ No authorization required
|-------------|-------------|------------------|
| **200** | Successful operation | - |
<a id="testFormObjectMultipart"></a>
# **testFormObjectMultipart**
> String testFormObjectMultipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FormApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
FormApi apiInstance = new FormApi(defaultClient);
TestFormObjectMultipartRequestMarker marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker |
try {
String result = apiInstance.testFormObjectMultipart(marker);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FormApi#testFormObjectMultipart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| | |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
<a id="testFormOneof"></a>
# **testFormOneof**
> String testFormOneof(form1, form2, form3, form4, id, name)

View File

@@ -0,0 +1,13 @@
# TestFormObjectMultipartRequestMarker
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |

View File

@@ -107,6 +107,7 @@ public class JSON {
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NumberPropertiesOnly.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TestFormObjectMultipartRequestMarker.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.CustomTypeAdapterFactory());
gson = gsonBuilder.create();

View File

@@ -27,6 +27,7 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import org.openapitools.client.model.TestFormObjectMultipartRequestMarker;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -209,6 +210,133 @@ public class FormApi {
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testFormObjectMultipart
* @param marker (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testFormObjectMultipartCall(TestFormObjectMultipartRequestMarker marker, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/form/object/multipart";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (marker != null) {
localVarFormParams.put("marker", marker);
}
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testFormObjectMultipartValidateBeforeCall(TestFormObjectMultipartRequestMarker marker, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'marker' is set
if (marker == null) {
throw new ApiException("Missing the required parameter 'marker' when calling testFormObjectMultipart(Async)");
}
return testFormObjectMultipartCall(marker, _callback);
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
</table>
*/
public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker) throws ApiException {
ApiResponse<String> localVarResp = testFormObjectMultipartWithHttpInfo(marker);
return localVarResp.getData();
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return ApiResponse&lt;String&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> testFormObjectMultipartWithHttpInfo(TestFormObjectMultipartRequestMarker marker) throws ApiException {
okhttp3.Call localVarCall = testFormObjectMultipartValidateBeforeCall(marker, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test form parameter(s) for multipart schema (asynchronously)
* Test form parameter(s) for multipart schema
* @param marker (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
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testFormObjectMultipartAsync(TestFormObjectMultipartRequestMarker marker, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = testFormObjectMultipartValidateBeforeCall(marker, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testFormOneof
* @param form1 (optional)

View File

@@ -0,0 +1,206 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 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 java.io.IOException;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openapitools.client.JSON;
/**
* TestFormObjectMultipartRequestMarker
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
public class TestFormObjectMultipartRequestMarker {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public TestFormObjectMultipartRequestMarker() {
}
public TestFormObjectMultipartRequestMarker name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestFormObjectMultipartRequestMarker testFormObjectMultipartRequestMarker = (TestFormObjectMultipartRequestMarker) o;
return Objects.equals(this.name, testFormObjectMultipartRequestMarker.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestFormObjectMultipartRequestMarker {\n");
sb.append(" name: ").append(toIndentedString(name)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to TestFormObjectMultipartRequestMarker
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!TestFormObjectMultipartRequestMarker.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TestFormObjectMultipartRequestMarker is not found in the empty JSON string", TestFormObjectMultipartRequestMarker.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!TestFormObjectMultipartRequestMarker.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestFormObjectMultipartRequestMarker` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TestFormObjectMultipartRequestMarker.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TestFormObjectMultipartRequestMarker' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TestFormObjectMultipartRequestMarker> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TestFormObjectMultipartRequestMarker.class));
return (TypeAdapter<T>) new TypeAdapter<TestFormObjectMultipartRequestMarker>() {
@Override
public void write(JsonWriter out, TestFormObjectMultipartRequestMarker value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TestFormObjectMultipartRequestMarker read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of TestFormObjectMultipartRequestMarker given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestFormObjectMultipartRequestMarker
* @throws IOException if the JSON string is invalid with respect to TestFormObjectMultipartRequestMarker
*/
public static TestFormObjectMultipartRequestMarker fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TestFormObjectMultipartRequestMarker.class);
}
/**
* Convert an instance of TestFormObjectMultipartRequestMarker to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}

View File

@@ -0,0 +1,48 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 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 java.io.IOException;
import java.util.Arrays;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
public class TestFormObjectMultipartRequestMarkerTest {
private final TestFormObjectMultipartRequestMarker model = new TestFormObjectMultipartRequestMarker();
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
@Test
public void testTestFormObjectMultipartRequestMarker() {
// TODO: test TestFormObjectMultipartRequestMarker
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
}

View File

@@ -20,6 +20,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -60,5 +61,6 @@ src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Query.java
src/main/java/org/openapitools/client/model/StringEnumRef.java
src/main/java/org/openapitools/client/model/Tag.java
src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java

View File

@@ -132,6 +132,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**testEchoBodyStringEnum**](docs/BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**testFormObjectMultipart**](docs/FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**testFormOneof**](docs/FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -158,6 +159,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -104,6 +104,28 @@ paths:
x-content-type: application/x-www-form-urlencoded
x-accepts:
- text/plain
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
x-content-type: multipart/form-data
x-accepts:
- text/plain
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -933,6 +955,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
@@ -79,6 +80,72 @@ No authorization required
| **200** | Successful operation | - |
## testFormObjectMultipart
> String testFormObjectMultipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FormApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
FormApi apiInstance = new FormApi(defaultClient);
TestFormObjectMultipartRequestMarker marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker |
try {
String result = apiInstance.testFormObjectMultipart(marker);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FormApi#testFormObjectMultipart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| | |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testFormOneof
> String testFormOneof(form1, form2, form3, form4, id, name)

View File

@@ -0,0 +1,13 @@
# TestFormObjectMultipartRequestMarker
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |

View File

@@ -7,6 +7,7 @@ import org.openapitools.client.Pair;
import javax.ws.rs.core.GenericType;
import org.openapitools.client.model.TestFormObjectMultipartRequestMarker;
import java.util.ArrayList;
import java.util.HashMap;
@@ -80,6 +81,51 @@ if (stringForm != null)
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* @param marker (required)
* @return a {@code String}
* @throws ApiException if fails to make API call
*/
public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'marker' is set
if (marker == null) {
throw new ApiException(400, "Missing the required parameter 'marker' when calling testFormObjectMultipart");
}
// create path and map variables
String localVarPath = "/form/object/multipart".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (marker != null)
localVarFormParams.put("marker", marker);
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<String> localVarReturnType = new GenericType<String>() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Test form parameter(s) for oneOf schema
* Test form parameter(s) for oneOf schema
* @param form1 (optional)

View File

@@ -0,0 +1,104 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* TestFormObjectMultipartRequestMarker
*/
@JsonPropertyOrder({
TestFormObjectMultipartRequestMarker.JSON_PROPERTY_NAME
})
@JsonTypeName("test_form_object_multipart_request_marker")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
public class TestFormObjectMultipartRequestMarker {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public TestFormObjectMultipartRequestMarker() {
}
public TestFormObjectMultipartRequestMarker name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestFormObjectMultipartRequestMarker testFormObjectMultipartRequestMarker = (TestFormObjectMultipartRequestMarker) o;
return Objects.equals(this.name, testFormObjectMultipartRequestMarker.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestFormObjectMultipartRequestMarker {\n");
sb.append(" name: ").append(toIndentedString(name)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,47 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
public class TestFormObjectMultipartRequestMarkerTest {
private final TestFormObjectMultipartRequestMarker model = new TestFormObjectMultipartRequestMarker();
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
@Test
public void testTestFormObjectMultipartRequestMarker() {
// TODO: test TestFormObjectMultipartRequestMarker
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
}

View File

@@ -20,6 +20,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -56,5 +57,6 @@ src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Query.java
src/main/java/org/openapitools/client/model/StringEnumRef.java
src/main/java/org/openapitools/client/model/Tag.java
src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java

View File

@@ -132,6 +132,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**testEchoBodyStringEnum**](docs/BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**testFormObjectMultipart**](docs/FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**testFormOneof**](docs/FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -158,6 +159,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -104,6 +104,28 @@ paths:
x-content-type: application/x-www-form-urlencoded
x-accepts:
- text/plain
/form/object/multipart:
post:
description: Test form parameter(s) for multipart schema
operationId: test/form/object/multipart
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/test_form_object_multipart_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for multipart schema
tags:
- form
x-content-type: multipart/form-data
x-accepts:
- text/plain
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
@@ -933,6 +955,18 @@ components:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_form_object_multipart_request_marker:
properties:
name:
type: string
type: object
test_form_object_multipart_request:
properties:
marker:
$ref: '#/components/schemas/test_form_object_multipart_request_marker'
required:
- marker
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
@@ -79,6 +80,72 @@ No authorization required
| **200** | Successful operation | - |
## testFormObjectMultipart
> String testFormObjectMultipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.FormApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
FormApi apiInstance = new FormApi(defaultClient);
TestFormObjectMultipartRequestMarker marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker |
try {
String result = apiInstance.testFormObjectMultipart(marker);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FormApi#testFormObjectMultipart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| | |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testFormOneof
> String testFormOneof(form1, form2, form3, form4, id, name)

View File

@@ -0,0 +1,13 @@
# TestFormObjectMultipartRequestMarker
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |

View File

@@ -3,6 +3,7 @@ package org.openapitools.client.api;
import org.openapitools.client.ApiClient;
import org.openapitools.client.BaseApi;
import org.openapitools.client.model.TestFormObjectMultipartRequestMarker;
import java.util.Collections;
import java.util.HashMap;
@@ -90,6 +91,57 @@ public class FormApi extends BaseApi {
ParameterizedTypeReference<String> localReturnType = new ParameterizedTypeReference<String>() {};
return apiClient.invokeAPI("/form/integer/boolean/string", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* <p><b>200</b> - Successful operation
* @param marker (required)
* @return String
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker) throws RestClientException {
return testFormObjectMultipartWithHttpInfo(marker).getBody();
}
/**
* Test form parameter(s) for multipart schema
* Test form parameter(s) for multipart schema
* <p><b>200</b> - Successful operation
* @param marker (required)
* @return ResponseEntity&lt;String&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ResponseEntity<String> testFormObjectMultipartWithHttpInfo(TestFormObjectMultipartRequestMarker marker) throws RestClientException {
Object localVarPostBody = null;
// verify the required parameter 'marker' is set
if (marker == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'marker' when calling testFormObjectMultipart");
}
final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders localVarHeaderParams = new HttpHeaders();
final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();
final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();
if (marker != null)
localVarFormParams.add("marker", marker);
final String[] localVarAccepts = {
"text/plain"
};
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
};
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
ParameterizedTypeReference<String> localReturnType = new ParameterizedTypeReference<String>() {};
return apiClient.invokeAPI("/form/object/multipart", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}
/**
* Test form parameter(s) for oneOf schema
* Test form parameter(s) for oneOf schema

View File

@@ -0,0 +1,104 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* TestFormObjectMultipartRequestMarker
*/
@JsonPropertyOrder({
TestFormObjectMultipartRequestMarker.JSON_PROPERTY_NAME
})
@JsonTypeName("test_form_object_multipart_request_marker")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
public class TestFormObjectMultipartRequestMarker {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public TestFormObjectMultipartRequestMarker() {
}
public TestFormObjectMultipartRequestMarker name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestFormObjectMultipartRequestMarker testFormObjectMultipartRequestMarker = (TestFormObjectMultipartRequestMarker) o;
return Objects.equals(this.name, testFormObjectMultipartRequestMarker.name);
}
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestFormObjectMultipartRequestMarker {\n");
sb.append(" name: ").append(toIndentedString(name)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,47 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* 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 com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
public class TestFormObjectMultipartRequestMarkerTest {
private final TestFormObjectMultipartRequestMarker model = new TestFormObjectMultipartRequestMarker();
/**
* Model tests for TestFormObjectMultipartRequestMarker
*/
@Test
public void testTestFormObjectMultipartRequestMarker() {
// TODO: test TestFormObjectMultipartRequestMarker
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
}

View File

@@ -19,6 +19,7 @@ docs/Model/Pet.md
docs/Model/Query.md
docs/Model/StringEnumRef.md
docs/Model/Tag.md
docs/Model/TestFormObjectMultipartRequestMarker.md
docs/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -42,6 +43,7 @@ src/Model/Pet.php
src/Model/Query.php
src/Model/StringEnumRef.php
src/Model/Tag.php
src/Model/TestFormObjectMultipartRequestMarker.php
src/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.php
src/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.php
src/ObjectSerializer.php

View File

@@ -89,6 +89,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**testEchoBodyStringEnum**](docs/Api/BodyApi.md#testechobodystringenum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**testEchoBodyTagResponseString**](docs/Api/BodyApi.md#testechobodytagresponsestring) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**testFormIntegerBooleanString**](docs/Api/FormApi.md#testformintegerbooleanstring) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**testFormObjectMultipart**](docs/Api/FormApi.md#testformobjectmultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**testFormOneof**](docs/Api/FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/Api/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/Api/PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -114,6 +115,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Model/Query.md)
- [StringEnumRef](docs/Model/StringEnumRef.md)
- [Tag](docs/Model/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/Model/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -5,6 +5,7 @@ All URIs are relative to http://localhost:3000, except if the operation defines
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**testFormIntegerBooleanString()**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
| [**testFormObjectMultipart()**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
| [**testFormOneof()**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
@@ -68,6 +69,62 @@ No authorization required
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `testFormObjectMultipart()`
```php
testFormObjectMultipart($marker): string
```
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\FormApi(
// 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()
);
$marker = new \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker(); // \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker
try {
$result = $apiInstance->testFormObjectMultipart($marker);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FormApi->testFormObjectMultipart: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **marker** | [**\OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker**](../Model/TestFormObjectMultipartRequestMarker.md)| | |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: `multipart/form-data`
- **Accept**: `text/plain`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `testFormOneof()`
```php

View File

@@ -0,0 +1,9 @@
# # TestFormObjectMultipartRequestMarker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | | [optional]
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

View File

@@ -75,6 +75,9 @@ class FormApi
'testFormIntegerBooleanString' => [
'application/x-www-form-urlencoded',
],
'testFormObjectMultipart' => [
'multipart/form-data',
],
'testFormOneof' => [
'application/x-www-form-urlencoded',
],
@@ -468,6 +471,324 @@ class FormApi
);
}
/**
* Operation testFormObjectMultipart
*
* Test form parameter(s) for multipart schema
*
* @param \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker marker (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testFormObjectMultipart'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return string
*/
public function testFormObjectMultipart(
\OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): string
{
list($response) = $this->testFormObjectMultipartWithHttpInfo($marker, $contentType);
return $response;
}
/**
* Operation testFormObjectMultipartWithHttpInfo
*
* Test form parameter(s) for multipart schema
*
* @param \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testFormObjectMultipart'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testFormObjectMultipartWithHttpInfo(
\OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): array
{
$request = $this->testFormObjectMultipartRequest($marker, $contentType);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
switch($statusCode) {
case 200:
if ('string' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('string' !== 'string') {
try {
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
} catch (\JsonException $exception) {
throw new ApiException(
sprintf(
'Error JSON decoding server response (%s)',
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$content
);
}
}
}
return [
ObjectSerializer::deserialize($content, 'string', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = 'string';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
try {
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
} catch (\JsonException $exception) {
throw new ApiException(
sprintf(
'Error JSON decoding server response (%s)',
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$content
);
}
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'string',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
}
/**
* Operation testFormObjectMultipartAsync
*
* Test form parameter(s) for multipart schema
*
* @param \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testFormObjectMultipart'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function testFormObjectMultipartAsync(
\OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): PromiseInterface
{
return $this->testFormObjectMultipartAsyncWithHttpInfo($marker, $contentType)
->then(
function ($response) {
return $response[0];
}
);
}
/**
* Operation testFormObjectMultipartAsyncWithHttpInfo
*
* Test form parameter(s) for multipart schema
*
* @param \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testFormObjectMultipart'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return PromiseInterface
*/
public function testFormObjectMultipartAsyncWithHttpInfo(
$marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): PromiseInterface
{
$returnType = 'string';
$request = $this->testFormObjectMultipartRequest($marker, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$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(),
(string) $response->getBody()
);
}
);
}
/**
* Create request for operation 'testFormObjectMultipart'
*
* @param \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testFormObjectMultipart'] to see the possible values for this operation
*
* @throws InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormObjectMultipartRequest(
$marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): Request
{
// verify the required parameter 'marker' is set
if ($marker === null || (is_array($marker) && count($marker) === 0)) {
throw new InvalidArgumentException(
'Missing the required parameter $marker when calling testFormObjectMultipart'
);
}
$resourcePath = '/form/object/multipart';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// form params
if ($marker !== null) {
$formParams['marker'] = ObjectSerializer::toFormValue($marker);
}
$headers = $this->headerSelector->selectHeaders(
['text/plain', ],
$contentType,
$multipart
);
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$operationHost = $this->config->getHost();
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
/**
* Operation testFormOneof
*

View File

@@ -0,0 +1,408 @@
<?php
/**
* TestFormObjectMultipartRequestMarker
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Echo Server API
*
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.5.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 JsonSerializable;
use InvalidArgumentException;
use ReturnTypeWillChange;
use OpenAPI\Client\ObjectSerializer;
/**
* TestFormObjectMultipartRequestMarker Class Doc Comment
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements ArrayAccess<string, mixed>
*/
class TestFormObjectMultipartRequestMarker implements ModelInterface, ArrayAccess, JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static string $openAPIModelName = 'test_form_object_multipart_request_marker';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var array<string, string>
*/
protected static array $openAPITypes = [
'name' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var array<string, string|null>
*/
protected static array $openAPIFormats = [
'name' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var array<string, bool>
*/
protected static array $openAPINullables = [
'name' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var array<string, bool>
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPITypes(): array
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array<string, string>
*/
public static function openAPIFormats(): array
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array<string, bool>
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return array<string, bool>
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param array<string, bool> $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var array<string, string>
*/
protected static array $attributeMap = [
'name' => 'name'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var array<string, string>
*/
protected static array $setters = [
'name' => 'setName'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var array<string, string>
*/
protected static array $getters = [
'name' => 'getName'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array<string, string>
*/
public static function attributeMap(): array
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array<string, string>
*/
public static function setters(): array
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array<string, string>
*/
public static function getters(): array
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName(): string
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var array
*/
protected array $container = [];
/**
* Constructor
*
* @param array $data Associated array of property values initializing the model
*/
public function __construct(array $data = null)
{
$this->setIfExists('name', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return string[] invalid properties with reasons
*/
public function listInvalidProperties(): array
{
$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(): bool
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets name
*
* @return string|null
*/
public function getName(): ?string
{
return $this->container['name'];
}
/**
* Sets name
*
* @param string|null $name name
*
* @return $this
*/
public function setName(?string $name): static
{
if (is_null($name)) {
throw new InvalidArgumentException('non-nullable name cannot be null');
}
$this->container['name'] = $name;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[ReturnTypeWillChange]
public function offsetGet(mixed $offset): mixed
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet(mixed $offset, mixed $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset(mixed $offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[ReturnTypeWillChange]
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}

View File

@@ -0,0 +1,89 @@
<?php
/**
* TestFormObjectMultipartRequestMarkerTest
*
* PHP version 8.1
*
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* Echo Server API
*
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.5.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\Test\Model;
use PHPUnit\Framework\TestCase;
/**
* TestFormObjectMultipartRequestMarkerTest Class Doc Comment
*
* @description TestFormObjectMultipartRequestMarker
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class TestFormObjectMultipartRequestMarkerTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "TestFormObjectMultipartRequestMarker"
*/
public function testTestFormObjectMultipartRequestMarker()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
/**
* Test attribute "name"
*/
public function testPropertyName()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
}
}

View File

@@ -16,6 +16,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
src/PSOpenAPITools/Api/AuthApi.ps1
@@ -34,6 +35,7 @@ src/PSOpenAPITools/Model/Pet.ps1
src/PSOpenAPITools/Model/Query.ps1
src/PSOpenAPITools/Model/StringEnumRef.ps1
src/PSOpenAPITools/Model/Tag.ps1
src/PSOpenAPITools/Model/TestFormObjectMultipartRequestMarker.ps1
src/PSOpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.ps1
src/PSOpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.ps1
src/PSOpenAPITools/PSOpenAPITools.psm1

View File

@@ -65,6 +65,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**Test-EchoBodyAllOfPet**](docs/BodyApi.md#Test-EchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s)
*BodyApi* | [**Test-EchoBodyStringEnum**](docs/BodyApi.md#Test-EchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body
*FormApi* | [**Test-FormIntegerBooleanString**](docs/FormApi.md#Test-FormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**Test-FormObjectMultipart**](docs/FormApi.md#Test-FormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**Test-FormOneof**](docs/FormApi.md#Test-FormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**Test-HeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#Test-HeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**Test-sPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#Test-sPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -91,6 +92,7 @@ Class | Method | HTTP request | Description
- [PSOpenAPITools\Model.Query](docs/Query.md)
- [PSOpenAPITools\Model.StringEnumRef](docs/StringEnumRef.md)
- [PSOpenAPITools\Model.Tag](docs/Tag.md)
- [PSOpenAPITools\Model.TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [PSOpenAPITools\Model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [PSOpenAPITools\Model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**Test-FormIntegerBooleanString**](FormApi.md#Test-FormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s)
[**Test-FormObjectMultipart**](FormApi.md#Test-FormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
[**Test-FormOneof**](FormApi.md#Test-FormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
@@ -57,6 +58,49 @@ 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)
<a id="Test-FormObjectMultipart"></a>
# **Test-FormObjectMultipart**
> String Test-FormObjectMultipart<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-Marker] <PSCustomObject><br>
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```powershell
$TestFormObjectMultipartRequestMarker = Initialize-TestFormObjectMultipartRequestMarker -Name "MyName" # TestFormObjectMultipartRequestMarker |
# Test form parameter(s) for multipart schema
try {
$Result = Test-FormObjectMultipart -Marker $Marker
} catch {
Write-Host ("Exception occurred when calling Test-FormObjectMultipart: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**Marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
[[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)
<a id="Test-FormOneof"></a>
# **Test-FormOneof**
> String Test-FormOneof<br>

View File

@@ -0,0 +1,21 @@
# TestFormObjectMultipartRequestMarker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **String** | | [optional]
## Examples
- Prepare the resource
```powershell
$TestFormObjectMultipartRequestMarker = Initialize-PSOpenAPIToolsTestFormObjectMultipartRequestMarker -Name null
```
- Convert the resource to JSON
```powershell
$TestFormObjectMultipartRequestMarker | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -105,6 +105,83 @@ function Test-FormIntegerBooleanString {
<#
.SYNOPSIS
Test form parameter(s) for multipart schema
.DESCRIPTION
No description available.
.PARAMETER Marker
No description available.
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
String
#>
function Test-FormObjectMultipart {
[CmdletBinding()]
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject]
${Marker},
[Switch]
$WithHttpInfo
)
Process {
'Calling method: Test-FormObjectMultipart' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$LocalVarAccepts = @()
$LocalVarContentTypes = @()
$LocalVarQueryParameters = @{}
$LocalVarHeaderParameters = @{}
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter = $null
$Configuration = Get-Configuration
# HTTP header 'Accept' (if needed)
$LocalVarAccepts = @('text/plain')
# HTTP header 'Content-Type'
$LocalVarContentTypes = @('multipart/form-data')
$LocalVarUri = '/form/object/multipart'
if (!$Marker) {
throw "Error! The required parameter `Marker` missing when calling test_form_object_multipart."
}
$LocalVarFormParameters['marker'] = $Marker
$LocalVarResult = Invoke-ApiClient -Method 'POST' `
-Uri $LocalVarUri `
-Accepts $LocalVarAccepts `
-ContentTypes $LocalVarContentTypes `
-Body $LocalVarBodyParameter `
-HeaderParameters $LocalVarHeaderParameters `
-QueryParameters $LocalVarQueryParameters `
-FormParameters $LocalVarFormParameters `
-CookieParameters $LocalVarCookieParameters `
-ReturnType "String" `
-IsBodyNullable $false
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
<#
.SYNOPSIS
Test form parameter(s) for oneOf schema
.DESCRIPTION

View File

@@ -0,0 +1,98 @@
#
# Echo Server API
# Echo Server API
# Version: 0.1.0
# Contact: team@openapitools.org
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
<#
.SYNOPSIS
No summary available.
.DESCRIPTION
No description available.
.PARAMETER Name
No description available.
.OUTPUTS
TestFormObjectMultipartRequestMarker<PSCustomObject>
#>
function Initialize-TestFormObjectMultipartRequestMarker {
[CmdletBinding()]
Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
[String]
${Name}
)
Process {
'Creating PSCustomObject: PSOpenAPITools => TestFormObjectMultipartRequestMarker' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
"name" = ${Name}
}
return $PSO
}
}
<#
.SYNOPSIS
Convert from JSON to TestFormObjectMultipartRequestMarker<PSCustomObject>
.DESCRIPTION
Convert from JSON to TestFormObjectMultipartRequestMarker<PSCustomObject>
.PARAMETER Json
Json object
.OUTPUTS
TestFormObjectMultipartRequestMarker<PSCustomObject>
#>
function ConvertFrom-JsonToTestFormObjectMultipartRequestMarker {
Param(
[AllowEmptyString()]
[string]$Json
)
Process {
'Converting JSON to PSCustomObject: PSOpenAPITools => TestFormObjectMultipartRequestMarker' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$JsonParameters = ConvertFrom-Json -InputObject $Json
# check if Json contains properties not defined in TestFormObjectMultipartRequestMarker
$AllProperties = ("name")
foreach ($name in $JsonParameters.PsObject.Properties.Name) {
if (!($AllProperties.Contains($name))) {
throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
}
}
if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found
$Name = $null
} else {
$Name = $JsonParameters.PSobject.Properties["name"].value
}
$PSO = [PSCustomObject]@{
"name" = ${Name}
}
return $PSO
}
}

View File

@@ -0,0 +1,18 @@
#
# Echo Server API
# Echo Server API
# Version: 0.1.0
# Contact: team@openapitools.org
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
Describe -tag 'PSOpenAPITools' -name 'TestFormObjectMultipartRequestMarker' {
Context 'TestFormObjectMultipartRequestMarker' {
It 'Initialize-TestFormObjectMultipartRequestMarker' {
# a simple test to create an object
#$NewObject = Initialize-TestFormObjectMultipartRequestMarker -Name "TEST_VALUE"
#$NewObject | Should -BeOfType TestFormObjectMultipartRequestMarker
#$NewObject.property | Should -Be 0
}
}
}

View File

@@ -18,6 +18,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -43,6 +44,7 @@ openapi_client/models/pet.py
openapi_client/models/query.py
openapi_client/models/string_enum_ref.py
openapi_client/models/tag.py
openapi_client/models/test_form_object_multipart_request_marker.py
openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py
openapi_client/py.typed

View File

@@ -107,6 +107,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**test_echo_body_string_enum**](docs/BodyApi.md#test_echo_body_string_enum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**test_echo_body_tag_response_string**](docs/BodyApi.md#test_echo_body_tag_response_string) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**test_form_integer_boolean_string**](docs/FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**test_form_object_multipart**](docs/FormApi.md#test_form_object_multipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**test_form_oneof**](docs/FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**test_header_integer_boolean_string_enums**](docs/HeaderApi.md#test_header_integer_boolean_string_enums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**](docs/PathApi.md#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -133,6 +134,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**test_form_integer_boolean_string**](FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
[**test_form_object_multipart**](FormApi.md#test_form_object_multipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
[**test_form_oneof**](FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
@@ -79,6 +80,74 @@ 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)
# **test_form_object_multipart**
> str test_form_object_multipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```python
import openapi_client
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost:3000"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.FormApi(api_client)
marker = openapi_client.TestFormObjectMultipartRequestMarker() # TestFormObjectMultipartRequestMarker |
try:
# Test form parameter(s) for multipart schema
api_response = api_instance.test_form_object_multipart(marker)
print("The response of FormApi->test_form_object_multipart:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FormApi->test_form_object_multipart: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| |
### Return type
**str**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[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)
# **test_form_oneof**
> str test_form_oneof(form1=form1, form2=form2, form3=form3, form4=form4, id=id, name=name)

View File

@@ -0,0 +1,29 @@
# TestFormObjectMultipartRequestMarker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
# TODO update the JSON string below
json = "{}"
# create an instance of TestFormObjectMultipartRequestMarker from a JSON string
test_form_object_multipart_request_marker_instance = TestFormObjectMultipartRequestMarker.from_json(json)
# print the JSON string representation of the object
print(TestFormObjectMultipartRequestMarker.to_json())
# convert the object into a dict
test_form_object_multipart_request_marker_dict = test_form_object_multipart_request_marker_instance.to_dict()
# create an instance of TestFormObjectMultipartRequestMarker from a dict
test_form_object_multipart_request_marker_form_dict = test_form_object_multipart_request_marker.from_dict(test_form_object_multipart_request_marker_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,5 +46,6 @@ from openapi_client.models.pet import Pet
from openapi_client.models.query import Query
from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.models.tag import Tag
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter

View File

@@ -19,6 +19,7 @@ from typing_extensions import Annotated
from pydantic import StrictBool, StrictInt, StrictStr
from typing import Optional
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.api_client import ApiClient, RequestSerialized
from openapi_client.api_response import ApiResponse
@@ -338,6 +339,276 @@ class FormApi:
@validate_call
def test_form_object_multipart(
self,
marker: TestFormObjectMultipartRequestMarker,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> str:
"""Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._test_form_object_multipart_serialize(
marker=marker,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def test_form_object_multipart_with_http_info(
self,
marker: TestFormObjectMultipartRequestMarker,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[str]:
"""Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._test_form_object_multipart_serialize(
marker=marker,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def test_form_object_multipart_without_preload_content(
self,
marker: TestFormObjectMultipartRequestMarker,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._test_form_object_multipart_serialize(
marker=marker,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _test_form_object_multipart_serialize(
self,
marker,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes]] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
if marker is not None:
_form_params.append(('marker', marker))
# process the body parameter
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
[
'text/plain'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'multipart/form-data'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
]
return self.api_client.param_serialize(
method='POST',
resource_path='/form/object/multipart',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def test_form_oneof(
self,

View File

@@ -24,5 +24,6 @@ from openapi_client.models.pet import Pet
from openapi_client.models.query import Query
from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.models.tag import Tag
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter

View File

@@ -0,0 +1,93 @@
# coding: utf-8
"""
Echo Server API
Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class TestFormObjectMultipartRequestMarker(BaseModel):
"""
TestFormObjectMultipartRequestMarker
""" # noqa: E501
name: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["name"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TestFormObjectMultipartRequestMarker from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TestFormObjectMultipartRequestMarker from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in TestFormObjectMultipartRequestMarker) in the input: " + _key)
_obj = cls.model_validate({
"name": obj.get("name")
})
return _obj

View File

@@ -0,0 +1,52 @@
# coding: utf-8
"""
Echo Server API
Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import unittest
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
class TestTestFormObjectMultipartRequestMarker(unittest.TestCase):
"""TestFormObjectMultipartRequestMarker unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional) -> TestFormObjectMultipartRequestMarker:
"""Test TestFormObjectMultipartRequestMarker
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestFormObjectMultipartRequestMarker`
"""
model = TestFormObjectMultipartRequestMarker()
if include_optional:
return TestFormObjectMultipartRequestMarker(
name = ''
)
else:
return TestFormObjectMultipartRequestMarker(
)
"""
def testTestFormObjectMultipartRequestMarker(self):
"""Test TestFormObjectMultipartRequestMarker"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@@ -18,6 +18,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -43,6 +44,7 @@ openapi_client/models/pet.py
openapi_client/models/query.py
openapi_client/models/string_enum_ref.py
openapi_client/models/tag.py
openapi_client/models/test_form_object_multipart_request_marker.py
openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py
openapi_client/py.typed

View File

@@ -108,6 +108,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**test_echo_body_string_enum**](docs/BodyApi.md#test_echo_body_string_enum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**test_echo_body_tag_response_string**](docs/BodyApi.md#test_echo_body_tag_response_string) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**test_form_integer_boolean_string**](docs/FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**test_form_object_multipart**](docs/FormApi.md#test_form_object_multipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**test_form_oneof**](docs/FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**test_header_integer_boolean_string_enums**](docs/HeaderApi.md#test_header_integer_boolean_string_enums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**](docs/PathApi.md#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -134,6 +135,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**test_form_integer_boolean_string**](FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
[**test_form_object_multipart**](FormApi.md#test_form_object_multipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
[**test_form_oneof**](FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
@@ -78,6 +79,73 @@ 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)
# **test_form_object_multipart**
> str test_form_object_multipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```python
import time
import os
import openapi_client
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost:3000"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.FormApi(api_client)
marker = openapi_client.TestFormObjectMultipartRequestMarker() # TestFormObjectMultipartRequestMarker |
try:
# Test form parameter(s) for multipart schema
api_response = api_instance.test_form_object_multipart(marker)
print("The response of FormApi->test_form_object_multipart:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FormApi->test_form_object_multipart: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| |
### Return type
**str**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[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)
# **test_form_oneof**
> str test_form_oneof(form1=form1, form2=form2, form3=form3, form4=form4, id=id, name=name)

View File

@@ -0,0 +1,28 @@
# TestFormObjectMultipartRequestMarker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
# TODO update the JSON string below
json = "{}"
# create an instance of TestFormObjectMultipartRequestMarker from a JSON string
test_form_object_multipart_request_marker_instance = TestFormObjectMultipartRequestMarker.from_json(json)
# print the JSON string representation of the object
print TestFormObjectMultipartRequestMarker.to_json()
# convert the object into a dict
test_form_object_multipart_request_marker_dict = test_form_object_multipart_request_marker_instance.to_dict()
# create an instance of TestFormObjectMultipartRequestMarker from a dict
test_form_object_multipart_request_marker_form_dict = test_form_object_multipart_request_marker.from_dict(test_form_object_multipart_request_marker_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,5 +46,6 @@ from openapi_client.models.pet import Pet
from openapi_client.models.query import Query
from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.models.tag import Tag
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter

View File

@@ -23,6 +23,7 @@ from pydantic import StrictBool, StrictInt, StrictStr
from typing import Optional
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.api_client import ApiClient
from openapi_client.api_response import ApiResponse
@@ -207,6 +208,153 @@ class FormApi:
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))
@validate_arguments
def test_form_object_multipart(self, marker : TestFormObjectMultipartRequestMarker, **kwargs) -> str: # noqa: E501
"""Test form parameter(s) for multipart schema # noqa: E501
Test form parameter(s) for multipart schema # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_form_object_multipart(marker, async_req=True)
>>> result = thread.get()
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _request_timeout: timeout setting for this request.
If one number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: str
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
message = "Error! Please call the test_form_object_multipart_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
raise ValueError(message)
return self.test_form_object_multipart_with_http_info(marker, **kwargs) # noqa: E501
@validate_arguments
def test_form_object_multipart_with_http_info(self, marker : TestFormObjectMultipartRequestMarker, **kwargs) -> ApiResponse: # noqa: E501
"""Test form parameter(s) for multipart schema # noqa: E501
Test form parameter(s) for multipart schema # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.test_form_object_multipart_with_http_info(marker, async_req=True)
>>> result = thread.get()
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the ApiResponse.data will
be set to none and raw_data will store the
HTTP response body without reading/decoding.
Default is True.
:type _preload_content: bool, optional
:param _return_http_data_only: response data instead of ApiResponse
object with status code, headers, etc
:type _return_http_data_only: bool, optional
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the authentication
in the spec for a single request.
:type _request_auth: dict, optional
:type _content_type: string, optional: force content-type for the request
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
"""
_params = locals()
_all_params = [
'marker'
]
_all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout',
'_request_auth',
'_content_type',
'_headers'
]
)
# validate the arguments
for _key, _val in _params['kwargs'].items():
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method test_form_object_multipart" % _key
)
_params[_key] = _val
del _params['kwargs']
_collection_formats = {}
# process the path parameters
_path_params = {}
# process the query parameters
_query_params = []
# process the header parameters
_header_params = dict(_params.get('_headers', {}))
# process the form parameters
_form_params = []
_files = {}
if _params['marker'] is not None:
_form_params.append(('marker', _params['marker']))
# process the body parameter
_body_params = None
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
['text/plain']) # noqa: E501
# set the HTTP header `Content-Type`
_content_types_list = _params.get('_content_type',
self.api_client.select_header_content_type(
['multipart/form-data']))
if _content_types_list:
_header_params['Content-Type'] = _content_types_list
# authentication setting
_auth_settings = [] # noqa: E501
_response_types_map = {
'200': "str",
}
return self.api_client.call_api(
'/form/object/multipart', 'POST',
_path_params,
_query_params,
_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
response_types_map=_response_types_map,
auth_settings=_auth_settings,
async_req=_params.get('async_req'),
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
_preload_content=_params.get('_preload_content', True),
_request_timeout=_params.get('_request_timeout'),
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))
@validate_arguments
def test_form_oneof(self, form1 : Optional[StrictStr] = None, form2 : Optional[StrictInt] = None, form3 : Optional[StrictStr] = None, form4 : Optional[StrictBool] = None, id : Optional[StrictInt] = None, name : Optional[StrictStr] = None, **kwargs) -> str: # noqa: E501
"""Test form parameter(s) for oneOf schema # noqa: E501

View File

@@ -24,5 +24,6 @@ from openapi_client.models.pet import Pet
from openapi_client.models.query import Query
from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.models.tag import Tag
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter

View File

@@ -0,0 +1,72 @@
# coding: utf-8
"""
Echo Server API
Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import BaseModel, StrictStr
class TestFormObjectMultipartRequestMarker(BaseModel):
"""
TestFormObjectMultipartRequestMarker
"""
name: Optional[StrictStr] = None
__properties = ["name"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.dict(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> TestFormObjectMultipartRequestMarker:
"""Create an instance of TestFormObjectMultipartRequestMarker from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
},
exclude_none=True)
return _dict
@classmethod
def from_dict(cls, obj: dict) -> TestFormObjectMultipartRequestMarker:
"""Create an instance of TestFormObjectMultipartRequestMarker from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return TestFormObjectMultipartRequestMarker.parse_obj(obj)
_obj = TestFormObjectMultipartRequestMarker.parse_obj({
"name": obj.get("name")
})
return _obj

View File

@@ -0,0 +1,53 @@
# coding: utf-8
"""
Echo Server API
Echo Server API
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import unittest
import datetime
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker # noqa: E501
class TestTestFormObjectMultipartRequestMarker(unittest.TestCase):
"""TestFormObjectMultipartRequestMarker unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional) -> TestFormObjectMultipartRequestMarker:
"""Test TestFormObjectMultipartRequestMarker
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `TestFormObjectMultipartRequestMarker`
"""
model = TestFormObjectMultipartRequestMarker() # noqa: E501
if include_optional:
return TestFormObjectMultipartRequestMarker(
name = ''
)
else:
return TestFormObjectMultipartRequestMarker(
)
"""
def testTestFormObjectMultipartRequestMarker(self):
"""Test TestFormObjectMultipartRequestMarker"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@@ -18,6 +18,7 @@ docs/Query.md
docs/QueryApi.md
docs/StringEnumRef.md
docs/Tag.md
docs/TestFormObjectMultipartRequestMarker.md
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
git_push.sh
@@ -43,6 +44,7 @@ openapi_client/models/pet.py
openapi_client/models/query.py
openapi_client/models/string_enum_ref.py
openapi_client/models/tag.py
openapi_client/models/test_form_object_multipart_request_marker.py
openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py
openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py
openapi_client/py.typed

View File

@@ -107,6 +107,7 @@ Class | Method | HTTP request | Description
*BodyApi* | [**test_echo_body_string_enum**](docs/BodyApi.md#test_echo_body_string_enum) | **POST** /echo/body/string_enum | Test string enum response body
*BodyApi* | [**test_echo_body_tag_response_string**](docs/BodyApi.md#test_echo_body_tag_response_string) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
*FormApi* | [**test_form_integer_boolean_string**](docs/FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
*FormApi* | [**test_form_object_multipart**](docs/FormApi.md#test_form_object_multipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**test_form_oneof**](docs/FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**test_header_integer_boolean_string_enums**](docs/HeaderApi.md#test_header_integer_boolean_string_enums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**](docs/PathApi.md#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
@@ -133,6 +134,7 @@ Class | Method | HTTP request | Description
- [Query](docs/Query.md)
- [StringEnumRef](docs/StringEnumRef.md)
- [Tag](docs/Tag.md)
- [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md)
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)

View File

@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**test_form_integer_boolean_string**](FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
[**test_form_object_multipart**](FormApi.md#test_form_object_multipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
[**test_form_oneof**](FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
@@ -79,6 +80,74 @@ 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)
# **test_form_object_multipart**
> str test_form_object_multipart(marker)
Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
### Example
```python
import openapi_client
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost:3000"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.FormApi(api_client)
marker = openapi_client.TestFormObjectMultipartRequestMarker() # TestFormObjectMultipartRequestMarker |
try:
# Test form parameter(s) for multipart schema
api_response = api_instance.test_form_object_multipart(marker)
print("The response of FormApi->test_form_object_multipart:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FormApi->test_form_object_multipart: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| |
### Return type
**str**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[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)
# **test_form_oneof**
> str test_form_oneof(form1=form1, form2=form2, form3=form3, form4=form4, id=id, name=name)

View File

@@ -0,0 +1,29 @@
# TestFormObjectMultipartRequestMarker
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
# TODO update the JSON string below
json = "{}"
# create an instance of TestFormObjectMultipartRequestMarker from a JSON string
test_form_object_multipart_request_marker_instance = TestFormObjectMultipartRequestMarker.from_json(json)
# print the JSON string representation of the object
print(TestFormObjectMultipartRequestMarker.to_json())
# convert the object into a dict
test_form_object_multipart_request_marker_dict = test_form_object_multipart_request_marker_instance.to_dict()
# create an instance of TestFormObjectMultipartRequestMarker from a dict
test_form_object_multipart_request_marker_form_dict = test_form_object_multipart_request_marker.from_dict(test_form_object_multipart_request_marker_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,5 +46,6 @@ from openapi_client.models.pet import Pet
from openapi_client.models.query import Query
from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.models.tag import Tag
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter

View File

@@ -19,6 +19,7 @@ from typing_extensions import Annotated
from pydantic import StrictBool, StrictInt, StrictStr
from typing import Optional
from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
from openapi_client.api_client import ApiClient, RequestSerialized
from openapi_client.api_response import ApiResponse
@@ -338,6 +339,276 @@ class FormApi:
@validate_call
def test_form_object_multipart(
self,
marker: TestFormObjectMultipartRequestMarker,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> str:
"""Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._test_form_object_multipart_serialize(
marker=marker,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def test_form_object_multipart_with_http_info(
self,
marker: TestFormObjectMultipartRequestMarker,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[str]:
"""Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._test_form_object_multipart_serialize(
marker=marker,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def test_form_object_multipart_without_preload_content(
self,
marker: TestFormObjectMultipartRequestMarker,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Test form parameter(s) for multipart schema
Test form parameter(s) for multipart schema
:param marker: (required)
:type marker: TestFormObjectMultipartRequestMarker
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._test_form_object_multipart_serialize(
marker=marker,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _test_form_object_multipart_serialize(
self,
marker,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes]] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
if marker is not None:
_form_params.append(('marker', marker))
# process the body parameter
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
[
'text/plain'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'multipart/form-data'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
]
return self.api_client.param_serialize(
method='POST',
resource_path='/form/object/multipart',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def test_form_oneof(
self,

Some files were not shown because too many files have changed in this diff Show More