mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-05 13:46:10 +00:00
[java][native] Add tests for oneOf form parameters (#16487)
* add tests for oneOf form parameters * update samples
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user