[java][native] Add tests for oneOf form parameters (#16487)

* add tests for oneOf form parameters

* update samples
This commit is contained in:
William Cheng
2023-09-03 16:15:54 +08:00
committed by GitHub
parent 69c3f567ce
commit ebc9bcda44
23 changed files with 1601 additions and 0 deletions

View File

@@ -62,6 +62,27 @@ paths:
- form
x-content-type: application/x-www-form-urlencoded
x-accepts: text/plain
/form/oneof:
post:
description: Test form parameter(s) for oneOf schema
operationId: test/form/oneof
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/test_form_oneof_request'
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test form parameter(s) for oneOf schema
tags:
- form
x-content-type: application/x-www-form-urlencoded
x-accepts: text/plain
/header/integer/boolean/string:
get:
description: Test header parameter(s)
@@ -667,6 +688,26 @@ components:
string_form:
type: string
type: object
test_form_oneof_request_oneOf:
properties:
form1:
type: string
form2:
type: integer
type: object
test_form_oneof_request_oneOf_1:
properties:
form3:
type: string
form4:
type: boolean
type: object
test_form_oneof_request:
oneOf:
- $ref: '#/components/schemas/test_form_oneof_request_oneOf'
- $ref: '#/components/schemas/test_form_oneof_request_oneOf_1'
- $ref: '#/components/schemas/Tag'
type: object
test_query_style_form_explode_true_array_string_query_object_parameter:
properties:
values:

View File

@@ -47,4 +47,43 @@ public interface FormApi extends ApiClient.Api {
ApiResponse<String> testFormIntegerBooleanStringWithHttpInfo(@Param("integer_form") Integer integerForm, @Param("boolean_form") Boolean booleanForm, @Param("string_form") String stringForm);
/**
* Test form parameter(s) for oneOf schema
* Test form parameter(s) for oneOf schema
* @param form1 (optional)
* @param form2 (optional)
* @param form3 (optional)
* @param form4 (optional)
* @param id (optional)
* @param name (optional)
* @return String
*/
@RequestLine("POST /form/oneof")
@Headers({
"Content-Type: application/x-www-form-urlencoded",
"Accept: text/plain",
})
String testFormOneof(@Param("form1") String form1, @Param("form2") Integer form2, @Param("form3") String form3, @Param("form4") Boolean form4, @Param("id") Long id, @Param("name") String name);
/**
* Test form parameter(s) for oneOf schema
* Similar to <code>testFormOneof</code> but it also returns the http response headers .
* Test form parameter(s) for oneOf schema
* @param form1 (optional)
* @param form2 (optional)
* @param form3 (optional)
* @param form4 (optional)
* @param id (optional)
* @param name (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /form/oneof")
@Headers({
"Content-Type: application/x-www-form-urlencoded",
"Accept: text/plain",
})
ApiResponse<String> testFormOneofWithHttpInfo(@Param("form1") String form1, @Param("form2") Integer form2, @Param("form3") String form3, @Param("form4") Boolean form4, @Param("id") Long id, @Param("name") String name);
}