mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-17 15:54:36 +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:
@@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient;
|
||||
|
||||
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.Collections;
|
||||
@@ -398,6 +399,49 @@ public class BodyApi {
|
||||
ParameterizedTypeReference<String> localReturnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI("/echo/body/Pet/response_string", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
|
||||
}
|
||||
/**
|
||||
* Test string enum response body
|
||||
* Test string enum response body
|
||||
* <p><b>200</b> - Successful operation
|
||||
* @param body String enum (optional)
|
||||
* @return StringEnumRef
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public StringEnumRef testEchoBodyStringEnum(String body) throws RestClientException {
|
||||
return testEchoBodyStringEnumWithHttpInfo(body).getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test string enum response body
|
||||
* Test string enum response body
|
||||
* <p><b>200</b> - Successful operation
|
||||
* @param body String enum (optional)
|
||||
* @return ResponseEntity<StringEnumRef>
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseEntity<StringEnumRef> testEchoBodyStringEnumWithHttpInfo(String body) throws RestClientException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
|
||||
final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders localVarHeaderParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<StringEnumRef> localReturnType = new ParameterizedTypeReference<StringEnumRef>() {};
|
||||
return apiClient.invokeAPI("/echo/body/string_enum", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
|
||||
}
|
||||
/**
|
||||
* Test empty json (request body)
|
||||
* Test empty json (request body)
|
||||
|
||||
Reference in New Issue
Block a user