mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 22:37:07 +00:00
* 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:
@@ -9,6 +9,7 @@ import javax.ws.rs.core.GenericType;
|
||||
|
||||
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;
|
||||
@@ -348,6 +349,44 @@ public class BodyApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
* Test string enum response body
|
||||
* Test string enum response body
|
||||
* @param body String enum (optional)
|
||||
* @return a {@code StringEnumRef}
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public StringEnumRef testEchoBodyStringEnum(String body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/echo/body/string_enum".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>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
GenericType<StringEnumRef> localVarReturnType = new GenericType<StringEnumRef>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
* Test empty json (request body)
|
||||
* Test empty json (request body)
|
||||
|
||||
Reference in New Issue
Block a user