Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JAVA][Client] New object instead of null for empty POST request #98

Merged
merged 8 commits into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class {{classname}} {
@Deprecated
{{/isDeprecated}}
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class {{classname}} {
@Deprecated
{{/isDeprecated}}
public com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};

// create path and map variables
String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class {{classname}} {
@Deprecated
{{/isDeprecated}}
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class {{classname}} {
{{/externalDocs}}
*/
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException {
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'number' is set
if (number == null) {
Expand Down Expand Up @@ -492,7 +492,7 @@ public void testEnumParameters(List<String> enumHeaderStringArray, String enumHe
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testEnumParametersWithHttpInfo(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// create path and map variables
String localVarPath = "/fake";
Expand Down Expand Up @@ -603,7 +603,7 @@ public void testJsonFormData(String param, String param2) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'param' is set
if (param == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down Expand Up @@ -163,7 +163,7 @@ public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'status' is set
if (status == null) {
Expand Down Expand Up @@ -220,7 +220,7 @@ public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
*/
@Deprecated
public ApiResponse<List<Pet>> findPetsByTagsWithHttpInfo(List<String> tags) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'tags' is set
if (tags == null) {
Expand Down Expand Up @@ -273,7 +273,7 @@ public Pet getPetById(Long petId) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down Expand Up @@ -380,7 +380,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down Expand Up @@ -441,7 +441,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f
* @throws ApiException if fails to make API call
*/
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void deleteOrder(String orderId) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'orderId' is set
if (orderId == null) {
Expand Down Expand Up @@ -104,7 +104,7 @@ public Map<String, Integer> getInventory() throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// create path and map variables
String localVarPath = "/store/inventory";
Expand Down Expand Up @@ -151,7 +151,7 @@ public Order getOrderById(Long orderId) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Order> getOrderByIdWithHttpInfo(Long orderId) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'orderId' is set
if (orderId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void deleteUser(String username) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> deleteUserWithHttpInfo(String username) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'username' is set
if (username == null) {
Expand Down Expand Up @@ -259,7 +259,7 @@ public User getUserByName(String username) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'username' is set
if (username == null) {
Expand Down Expand Up @@ -314,7 +314,7 @@ public String loginUser(String username, String password) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<String> loginUserWithHttpInfo(String username, String password) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'username' is set
if (username == null) {
Expand Down Expand Up @@ -370,7 +370,7 @@ public void logoutUser() throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> logoutUserWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// create path and map variables
String localVarPath = "/user/logout";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'number' is set
if (number == null) {
Expand Down Expand Up @@ -492,7 +492,7 @@ public void testEnumParameters(List<String> enumHeaderStringArray, String enumHe
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testEnumParametersWithHttpInfo(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// create path and map variables
String localVarPath = "/fake";
Expand Down Expand Up @@ -603,7 +603,7 @@ public void testJsonFormData(String param, String param2) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'param' is set
if (param == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down Expand Up @@ -163,7 +163,7 @@ public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'status' is set
if (status == null) {
Expand Down Expand Up @@ -220,7 +220,7 @@ public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
*/
@Deprecated
public ApiResponse<List<Pet>> findPetsByTagsWithHttpInfo(List<String> tags) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'tags' is set
if (tags == null) {
Expand Down Expand Up @@ -273,7 +273,7 @@ public Pet getPetById(Long petId) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down Expand Up @@ -380,7 +380,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down Expand Up @@ -441,7 +441,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f
* @throws ApiException if fails to make API call
*/
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'petId' is set
if (petId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void deleteOrder(String orderId) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'orderId' is set
if (orderId == null) {
Expand Down Expand Up @@ -104,7 +104,7 @@ public Map<String, Integer> getInventory() throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// create path and map variables
String localVarPath = "/store/inventory";
Expand Down Expand Up @@ -151,7 +151,7 @@ public Order getOrderById(Long orderId) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Order> getOrderByIdWithHttpInfo(Long orderId) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'orderId' is set
if (orderId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void deleteUser(String username) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> deleteUserWithHttpInfo(String username) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'username' is set
if (username == null) {
Expand Down Expand Up @@ -259,7 +259,7 @@ public User getUserByName(String username) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'username' is set
if (username == null) {
Expand Down Expand Up @@ -314,7 +314,7 @@ public String loginUser(String username, String password) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<String> loginUserWithHttpInfo(String username, String password) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'username' is set
if (username == null) {
Expand Down Expand Up @@ -370,7 +370,7 @@ public void logoutUser() throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> logoutUserWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// create path and map variables
String localVarPath = "/user/logout";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'number' is set
if (number == null) {
Expand Down Expand Up @@ -492,7 +492,7 @@ public void testEnumParameters(List<String> enumHeaderStringArray, String enumHe
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testEnumParametersWithHttpInfo(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// create path and map variables
String localVarPath = "/fake";
Expand Down Expand Up @@ -603,7 +603,7 @@ public void testJsonFormData(String param, String param2) throws ApiException {
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = new Object();

// verify the required parameter 'param' is set
if (param == null) {
Expand Down
Loading