diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 7b21d760f56..e97e4c7f97d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -597,6 +597,8 @@ public class ApiClient { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object + * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. */ public T deserialize(Response response, Type returnType) throws ApiException { if (response == null || returnType == null) @@ -645,6 +647,7 @@ public class ApiClient { * @param obj The Java object * @param contentType The request Content-Type * @return The serialized string + * @throws ApiException If fail to serialize the given object */ public String serialize(Object obj, String contentType) throws ApiException { if (contentType.startsWith("application/json")) { @@ -659,6 +662,7 @@ public class ApiClient { /** * Download file from the given response. + * @throws ApiException If fail to read file content from response and write to disk */ public File downloadFileFromResponse(Response response) throws ApiException { try { @@ -722,6 +726,7 @@ public class ApiClient { * @return ApiResponse object containing response status, headers and * data, which is a Java object deserialized from response body and would be null * when returnType is null. + * @throws ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { try { @@ -736,7 +741,7 @@ public class ApiClient { /** * #see executeAsync(Call, Type, ApiCallback) */ - public void executeAsync(Call call, ApiCallback callback) throws ApiException { + public void executeAsync(Call call, ApiCallback callback) { executeAsync(call, null, callback); } @@ -767,6 +772,12 @@ public class ApiClient { }); } + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @throws ApiException If the response has a unsuccessful status code or + * fail to deserialize the response body + */ public T handleResponse(Response response, Type returnType) throws ApiException { if (response.isSuccessful()) { if (returnType == null || response.code() == 204) { @@ -800,6 +811,7 @@ public class ApiClient { * @param formParams The form parameters * @param authNames The authentications to apply * @return The HTTP call + * @throws ApiException If fail to serialize the request body object */ public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiResponse.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiResponse.mustache index 945de39da70..452f4e1e982 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiResponse.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiResponse.mustache @@ -3,15 +3,29 @@ package {{invokerPackage}}; import java.util.List; import java.util.Map; +/** + * API response returned by API call. + * + * @param T The type of data that is deserialized from response body + */ public class ApiResponse { final private int statusCode; final private Map> headers; final private T data; + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ public ApiResponse(int statusCode, Map> headers) { this(statusCode, headers, null); } + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ public ApiResponse(int statusCode, Map> headers, T data) { this.statusCode = statusCode; this.headers = headers; diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache index da145d08df2..e760f4a370e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -105,6 +105,7 @@ public class {{classname}} { * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{/allParams}}{{#returnType}} * @return {{{returnType}}}{{/returnType}} + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { {{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} @@ -116,6 +117,7 @@ public class {{classname}} { * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{/allParams}} * @return ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}null, null); @@ -129,6 +131,7 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{/allParams}} * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 8a75219bb53..d4ee79cb3ad 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -596,6 +596,8 @@ public class ApiClient { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object + * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. */ public T deserialize(Response response, Type returnType) throws ApiException { if (response == null || returnType == null) @@ -644,6 +646,7 @@ public class ApiClient { * @param obj The Java object * @param contentType The request Content-Type * @return The serialized string + * @throws ApiException If fail to serialize the given object */ public String serialize(Object obj, String contentType) throws ApiException { if (contentType.startsWith("application/json")) { @@ -658,6 +661,7 @@ public class ApiClient { /** * Download file from the given response. + * @throws ApiException If fail to read file content from response and write to disk */ public File downloadFileFromResponse(Response response) throws ApiException { try { @@ -721,6 +725,7 @@ public class ApiClient { * @return ApiResponse object containing response status, headers and * data, which is a Java object deserialized from response body and would be null * when returnType is null. + * @throws ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { try { @@ -735,7 +740,7 @@ public class ApiClient { /** * #see executeAsync(Call, Type, ApiCallback) */ - public void executeAsync(Call call, ApiCallback callback) throws ApiException { + public void executeAsync(Call call, ApiCallback callback) { executeAsync(call, null, callback); } @@ -766,6 +771,12 @@ public class ApiClient { }); } + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @throws ApiException If the response has a unsuccessful status code or + * fail to deserialize the response body + */ public T handleResponse(Response response, Type returnType) throws ApiException { if (response.isSuccessful()) { if (returnType == null || response.code() == 204) { @@ -799,6 +810,7 @@ public class ApiClient { * @param formParams The form parameters * @param authNames The authentications to apply * @return The HTTP call + * @throws ApiException If fail to serialize the request body object */ public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java index 46b52990f44..bf096d22a5c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiException.java @@ -3,7 +3,7 @@ package io.swagger.client; import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-29T00:18:08.052+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-07T12:21:33.403+08:00") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiResponse.java index fbe22e077b8..0a33f09e64e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiResponse.java @@ -3,15 +3,29 @@ package io.swagger.client; import java.util.List; import java.util.Map; +/** + * API response returned by API call. + * + * @param T The type of data that is deserialized from response body + */ public class ApiResponse { final private int statusCode; final private Map> headers; final private T data; + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ public ApiResponse(int statusCode, Map> headers) { this(statusCode, headers, null); } + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ public ApiResponse(int statusCode, Map> headers, T data) { this.statusCode = statusCode; this.headers = headers; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java index b99c939af83..e996b89ef77 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Configuration.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-29T00:18:08.052+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-07T12:21:33.403+08:00") public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java index 98f5f92e0a4..ef80752c495 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/Pair.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-29T00:18:08.052+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-07T12:21:33.403+08:00") public class Pair { private String name = ""; private String value = ""; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java index 702b8cf350c..3a105a258e4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.client; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-29T00:18:08.052+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-07T12:21:33.403+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java index e880e3f9fbf..460cd0f4c4d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java @@ -89,6 +89,7 @@ public class PetApi { * Update an existing pet * * @param body Pet object that needs to be added to the store + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void updatePet(Pet body) throws ApiException { updatePetWithHttpInfo(body); @@ -99,6 +100,7 @@ public class PetApi { * * @param body Pet object that needs to be added to the store * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { Call call = updatePetCall(body, null, null); @@ -111,6 +113,7 @@ public class PetApi { * @param body Pet object that needs to be added to the store * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call updatePetAsync(Pet body, final ApiCallback callback) throws ApiException { @@ -184,6 +187,7 @@ public class PetApi { * Add a new pet to the store * * @param body Pet object that needs to be added to the store + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void addPet(Pet body) throws ApiException { addPetWithHttpInfo(body); @@ -194,6 +198,7 @@ public class PetApi { * * @param body Pet object that needs to be added to the store * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { Call call = addPetCall(body, null, null); @@ -206,6 +211,7 @@ public class PetApi { * @param body Pet object that needs to be added to the store * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call addPetAsync(Pet body, final ApiCallback callback) throws ApiException { @@ -282,6 +288,7 @@ public class PetApi { * Multiple status values can be provided with comma seperated strings * @param status Status values that need to be considered for filter * @return List + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public List findPetsByStatus(List status) throws ApiException { ApiResponse> resp = findPetsByStatusWithHttpInfo(status); @@ -293,6 +300,7 @@ public class PetApi { * Multiple status values can be provided with comma seperated strings * @param status Status values that need to be considered for filter * @return ApiResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { Call call = findPetsByStatusCall(status, null, null); @@ -306,6 +314,7 @@ public class PetApi { * @param status Status values that need to be considered for filter * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call findPetsByStatusAsync(List status, final ApiCallback> callback) throws ApiException { @@ -383,6 +392,7 @@ public class PetApi { * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return List + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public List findPetsByTags(List tags) throws ApiException { ApiResponse> resp = findPetsByTagsWithHttpInfo(tags); @@ -394,6 +404,7 @@ public class PetApi { * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { Call call = findPetsByTagsCall(tags, null, null); @@ -407,6 +418,7 @@ public class PetApi { * @param tags Tags to filter by * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call findPetsByTagsAsync(List tags, final ApiCallback> callback) throws ApiException { @@ -488,6 +500,7 @@ public class PetApi { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched * @return Pet + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public Pet getPetById(Long petId) throws ApiException { ApiResponse resp = getPetByIdWithHttpInfo(petId); @@ -499,6 +512,7 @@ public class PetApi { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { Call call = getPetByIdCall(petId, null, null); @@ -512,6 +526,7 @@ public class PetApi { * @param petId ID of pet that needs to be fetched * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call getPetByIdAsync(Long petId, final ApiCallback callback) throws ApiException { @@ -598,6 +613,7 @@ public class PetApi { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void updatePetWithForm(String petId, String name, String status) throws ApiException { updatePetWithFormWithHttpInfo(petId, name, status); @@ -610,6 +626,7 @@ public class PetApi { * @param name Updated name of the pet * @param status Updated status of the pet * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse updatePetWithFormWithHttpInfo(String petId, String name, String status) throws ApiException { Call call = updatePetWithFormCall(petId, name, status, null, null); @@ -624,6 +641,7 @@ public class PetApi { * @param status Updated status of the pet * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call updatePetWithFormAsync(String petId, String name, String status, final ApiCallback callback) throws ApiException { @@ -706,6 +724,7 @@ public class PetApi { * * @param petId Pet id to delete * @param apiKey + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void deletePet(Long petId, String apiKey) throws ApiException { deletePetWithHttpInfo(petId, apiKey); @@ -717,6 +736,7 @@ public class PetApi { * @param petId Pet id to delete * @param apiKey * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { Call call = deletePetCall(petId, apiKey, null, null); @@ -730,6 +750,7 @@ public class PetApi { * @param apiKey * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call deletePetAsync(Long petId, String apiKey, final ApiCallback callback) throws ApiException { @@ -815,6 +836,7 @@ public class PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { uploadFileWithHttpInfo(petId, additionalMetadata, file); @@ -827,6 +849,7 @@ public class PetApi { * @param additionalMetadata Additional data to pass to server * @param file file to upload * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { Call call = uploadFileCall(petId, additionalMetadata, file, null, null); @@ -841,6 +864,7 @@ public class PetApi { * @param file file to upload * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback callback) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java index 3e06890a81c..5e6c7c48c6b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java @@ -89,6 +89,7 @@ public class StoreApi { * Returns pet inventories by status * Returns a map of status codes to quantities * @return Map + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public Map getInventory() throws ApiException { ApiResponse> resp = getInventoryWithHttpInfo(); @@ -99,6 +100,7 @@ public class StoreApi { * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { Call call = getInventoryCall(null, null); @@ -111,6 +113,7 @@ public class StoreApi { * Returns a map of status codes to quantities * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call getInventoryAsync(final ApiCallback> callback) throws ApiException { @@ -186,6 +189,7 @@ public class StoreApi { * * @param body order placed for purchasing the pet * @return Order + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public Order placeOrder(Order body) throws ApiException { ApiResponse resp = placeOrderWithHttpInfo(body); @@ -197,6 +201,7 @@ public class StoreApi { * * @param body order placed for purchasing the pet * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { Call call = placeOrderCall(body, null, null); @@ -210,6 +215,7 @@ public class StoreApi { * @param body order placed for purchasing the pet * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call placeOrderAsync(Order body, final ApiCallback callback) throws ApiException { @@ -291,6 +297,7 @@ public class StoreApi { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public Order getOrderById(String orderId) throws ApiException { ApiResponse resp = getOrderByIdWithHttpInfo(orderId); @@ -302,6 +309,7 @@ public class StoreApi { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse getOrderByIdWithHttpInfo(String orderId) throws ApiException { Call call = getOrderByIdCall(orderId, null, null); @@ -315,6 +323,7 @@ public class StoreApi { * @param orderId ID of pet that needs to be fetched * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call getOrderByIdAsync(String orderId, final ApiCallback callback) throws ApiException { @@ -395,6 +404,7 @@ public class StoreApi { * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void deleteOrder(String orderId) throws ApiException { deleteOrderWithHttpInfo(orderId); @@ -405,6 +415,7 @@ public class StoreApi { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { Call call = deleteOrderCall(orderId, null, null); @@ -417,6 +428,7 @@ public class StoreApi { * @param orderId ID of the order that needs to be deleted * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call deleteOrderAsync(String orderId, final ApiCallback callback) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java index ccb59552554..ab043bdbe3b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java @@ -89,6 +89,7 @@ public class UserApi { * Create user * This can only be done by the logged in user. * @param body Created user object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void createUser(User body) throws ApiException { createUserWithHttpInfo(body); @@ -99,6 +100,7 @@ public class UserApi { * This can only be done by the logged in user. * @param body Created user object * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse createUserWithHttpInfo(User body) throws ApiException { Call call = createUserCall(body, null, null); @@ -111,6 +113,7 @@ public class UserApi { * @param body Created user object * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call createUserAsync(User body, final ApiCallback callback) throws ApiException { @@ -184,6 +187,7 @@ public class UserApi { * Creates list of users with given input array * * @param body List of user object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void createUsersWithArrayInput(List body) throws ApiException { createUsersWithArrayInputWithHttpInfo(body); @@ -194,6 +198,7 @@ public class UserApi { * * @param body List of user object * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { Call call = createUsersWithArrayInputCall(body, null, null); @@ -206,6 +211,7 @@ public class UserApi { * @param body List of user object * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call createUsersWithArrayInputAsync(List body, final ApiCallback callback) throws ApiException { @@ -279,6 +285,7 @@ public class UserApi { * Creates list of users with given input array * * @param body List of user object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void createUsersWithListInput(List body) throws ApiException { createUsersWithListInputWithHttpInfo(body); @@ -289,6 +296,7 @@ public class UserApi { * * @param body List of user object * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { Call call = createUsersWithListInputCall(body, null, null); @@ -301,6 +309,7 @@ public class UserApi { * @param body List of user object * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call createUsersWithListInputAsync(List body, final ApiCallback callback) throws ApiException { @@ -380,6 +389,7 @@ public class UserApi { * @param username The user name for login * @param password The password for login in clear text * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public String loginUser(String username, String password) throws ApiException { ApiResponse resp = loginUserWithHttpInfo(username, password); @@ -392,6 +402,7 @@ public class UserApi { * @param username The user name for login * @param password The password for login in clear text * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { Call call = loginUserCall(username, password, null, null); @@ -406,6 +417,7 @@ public class UserApi { * @param password The password for login in clear text * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call loginUserAsync(String username, String password, final ApiCallback callback) throws ApiException { @@ -479,6 +491,7 @@ public class UserApi { /** * Logs out current logged in user session * + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void logoutUser() throws ApiException { logoutUserWithHttpInfo(); @@ -488,6 +501,7 @@ public class UserApi { * Logs out current logged in user session * * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { Call call = logoutUserCall(null, null); @@ -499,6 +513,7 @@ public class UserApi { * * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call logoutUserAsync(final ApiCallback callback) throws ApiException { @@ -579,6 +594,7 @@ public class UserApi { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public User getUserByName(String username) throws ApiException { ApiResponse resp = getUserByNameWithHttpInfo(username); @@ -590,6 +606,7 @@ public class UserApi { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { Call call = getUserByNameCall(username, null, null); @@ -603,6 +620,7 @@ public class UserApi { * @param username The name that needs to be fetched. Use user1 for testing. * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call getUserByNameAsync(String username, final ApiCallback callback) throws ApiException { @@ -684,6 +702,7 @@ public class UserApi { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void updateUser(String username, User body) throws ApiException { updateUserWithHttpInfo(username, body); @@ -695,6 +714,7 @@ public class UserApi { * @param username name that need to be deleted * @param body Updated user object * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { Call call = updateUserCall(username, body, null, null); @@ -708,6 +728,7 @@ public class UserApi { * @param body Updated user object * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call updateUserAsync(String username, User body, final ApiCallback callback) throws ApiException { @@ -787,6 +808,7 @@ public class UserApi { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void deleteUser(String username) throws ApiException { deleteUserWithHttpInfo(username); @@ -797,6 +819,7 @@ public class UserApi { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { Call call = deleteUserCall(username, null, null); @@ -809,6 +832,7 @@ public class UserApi { * @param username The name that needs to be deleted * @param callback The callback to be executed when the API call finishes * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public Call deleteUserAsync(String username, final ApiCallback callback) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java index 2110aff20d8..8439d297d45 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/ApiKeyAuth.java @@ -5,7 +5,7 @@ import io.swagger.client.Pair; import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-29T00:18:08.052+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-07T12:21:33.403+08:00") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/Authentication.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/Authentication.java index f00217c451e..6817892cce9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/Authentication.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/Authentication.java @@ -5,7 +5,7 @@ import io.swagger.client.Pair; import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-29T00:18:08.052+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-07T12:21:33.403+08:00") public interface Authentication { /** Apply authentication settings to header and query params. */ void applyToParams(List queryParams, Map headerParams); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java index b750aaa2360..d0b457bacd8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/auth/OAuth.java @@ -5,7 +5,7 @@ import io.swagger.client.Pair; import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-29T00:18:08.052+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-07T12:21:33.403+08:00") public class OAuth implements Authentication { private String accessToken; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java index bc3b80370b0..7e771866b39 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java @@ -2,8 +2,8 @@ package io.swagger.client.model; import io.swagger.client.StringUtil; import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; import java.util.*; +import io.swagger.client.model.Tag; import com.google.gson.annotations.SerializedName;