[Python] deserialize enum json response (fix #17789) (#17791)

* deserialize enum json response (python)

* adapt python samples: adding enum deserialization

* add echo test for enum json response deserialization (python)

* update samples
This commit is contained in:
Jonathan
2024-02-08 03:52:43 +01:00
committed by GitHub
parent c71eb5dfe8
commit f323a3e788
65 changed files with 3572 additions and 0 deletions

View File

@@ -547,6 +547,28 @@ paths:
- body
x-content-type: application/json
x-accepts: text/plain
/echo/body/string_enum:
post:
description: Test string enum response body
operationId: test/echo/body/string_enum
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StringEnumRef'
description: String enum
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/StringEnumRef'
description: Successful operation
summary: Test string enum response body
tags:
- body
x-content-type: application/json
x-accepts: application/json
/binary/gif:
post:
description: Test binary (gif) response body

View File

@@ -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.StringEnumRef;
import org.openapitools.client.model.Tag;
import java.util.ArrayList;
@@ -246,6 +247,35 @@ public interface BodyApi extends ApiClient.Api {
/**
* Test string enum response body
* Test string enum response body
* @param body String enum (optional)
* @return StringEnumRef
*/
@RequestLine("POST /echo/body/string_enum")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
StringEnumRef testEchoBodyStringEnum(String body);
/**
* Test string enum response body
* Similar to <code>testEchoBodyStringEnum</code> but it also returns the http response headers .
* Test string enum response body
* @param body String enum (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /echo/body/string_enum")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
ApiResponse<StringEnumRef> testEchoBodyStringEnumWithHttpInfo(String body);
/**
* Test empty json (request body)
* Test empty json (request body)