forked from loafle/openapi-generator-original
[python-nextgen] fix empty dict in body parameter (#15336)
* add more tests for python-nextgen * update samples * add fix for empty dict body * update samples
This commit is contained in:
@@ -349,6 +349,46 @@ paths:
|
||||
- body
|
||||
x-content-type: application/json
|
||||
x-accepts: text/plain
|
||||
/echo/body/Tag/response_string:
|
||||
post:
|
||||
description: Test empty json (request body)
|
||||
operationId: test/echo/body/Tag/response_string
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Tag'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test empty json (request body)
|
||||
tags:
|
||||
- body
|
||||
x-content-type: application/json
|
||||
x-accepts: text/plain
|
||||
/echo/body/FreeFormObject/response_string:
|
||||
post:
|
||||
description: Test free form object
|
||||
operationId: test/echo/body/FreeFormObject/response_string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
description: Free form object
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test free form object
|
||||
tags:
|
||||
- body
|
||||
x-content-type: application/json
|
||||
x-accepts: text/plain
|
||||
/binary/gif:
|
||||
post:
|
||||
description: Test binary (gif) response body
|
||||
@@ -373,6 +413,12 @@ components:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: Pet object that needs to be added to the store
|
||||
Tag:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Tag'
|
||||
description: Tag object
|
||||
schemas:
|
||||
Category:
|
||||
example:
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.Tag;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -42,6 +43,35 @@ public interface BodyApi extends ApiClient.Api {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test free form object
|
||||
* Test free form object
|
||||
* @param body Free form object (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /echo/body/FreeFormObject/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testEchoBodyFreeFormObjectResponseString(Object body);
|
||||
|
||||
/**
|
||||
* Test free form object
|
||||
* Similar to <code>testEchoBodyFreeFormObjectResponseString</code> but it also returns the http response headers .
|
||||
* Test free form object
|
||||
* @param body Free form object (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("POST /echo/body/FreeFormObject/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testEchoBodyFreeFormObjectResponseStringWithHttpInfo(Object body);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
@@ -99,4 +129,33 @@ public interface BodyApi extends ApiClient.Api {
|
||||
ApiResponse<String> testEchoBodyPetResponseStringWithHttpInfo(Pet pet);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test empty json (request body)
|
||||
* Test empty json (request body)
|
||||
* @param tag Tag object (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /echo/body/Tag/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testEchoBodyTagResponseString(Tag tag);
|
||||
|
||||
/**
|
||||
* Test empty json (request body)
|
||||
* Similar to <code>testEchoBodyTagResponseString</code> but it also returns the http response headers .
|
||||
* Test empty json (request body)
|
||||
* @param tag Tag object (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("POST /echo/body/Tag/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testEchoBodyTagResponseStringWithHttpInfo(Tag tag);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user