comment out error message debug (#12056)

This commit is contained in:
William Cheng 2022-04-06 11:06:19 +08:00 committed by GitHub
parent a7e92786df
commit 66db259678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 144 additions and 108 deletions

View File

@ -326,9 +326,10 @@ end:
"{{{httpMethod}}}");
{{#responses}}
if (apiClient->response_code == {{code}}) {
printf("%s\n","{{message}}");
}
// uncomment below to debug the error response
//if (apiClient->response_code == {{code}}) {
// printf("%s\n","{{message}}");
//}
{{/responses}}
{{#returnType}}
{{#returnTypeIsPrimitive}}

View File

@ -95,9 +95,10 @@ PetAPI_addPet(apiClient_t *apiClient, pet_t * body )
localVarBodyParameters,
"POST");
if (apiClient->response_code == 405) {
printf("%s\n","Invalid input");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 405) {
// printf("%s\n","Invalid input");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -174,9 +175,10 @@ PetAPI_deletePet(apiClient_t *apiClient, long petId , char * api_key )
localVarBodyParameters,
"DELETE");
if (apiClient->response_code == 400) {
printf("%s\n","Invalid pet value");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid pet value");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -242,12 +244,14 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status )
localVarBodyParameters,
"GET");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
if (apiClient->response_code == 400) {
printf("%s\n","Invalid status value");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid status value");
//}
cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
if(!cJSON_IsArray(PetAPIlocalVarJSON)) {
return 0;//nonprimitive container
@ -324,12 +328,14 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags )
localVarBodyParameters,
"GET");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
if (apiClient->response_code == 400) {
printf("%s\n","Invalid tag value");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid tag value");
//}
cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
if(!cJSON_IsArray(PetAPIlocalVarJSON)) {
return 0;//nonprimitive container
@ -414,15 +420,18 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId )
localVarBodyParameters,
"GET");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
if (apiClient->response_code == 400) {
printf("%s\n","Invalid ID supplied");
}
if (apiClient->response_code == 404) {
printf("%s\n","Pet not found");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid ID supplied");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 404) {
// printf("%s\n","Pet not found");
//}
//nonprimitive not container
cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
pet_t *elementToReturn = pet_parseFromJSON(PetAPIlocalVarJSON);
@ -491,15 +500,18 @@ PetAPI_updatePet(apiClient_t *apiClient, pet_t * body )
localVarBodyParameters,
"PUT");
if (apiClient->response_code == 400) {
printf("%s\n","Invalid ID supplied");
}
if (apiClient->response_code == 404) {
printf("%s\n","Pet not found");
}
if (apiClient->response_code == 405) {
printf("%s\n","Validation exception");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid ID supplied");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 404) {
// printf("%s\n","Pet not found");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 405) {
// printf("%s\n","Validation exception");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -589,9 +601,10 @@ PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId , char * name , char
localVarBodyParameters,
"POST");
if (apiClient->response_code == 405) {
printf("%s\n","Invalid input");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 405) {
// printf("%s\n","Invalid input");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -696,9 +709,10 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata
localVarBodyParameters,
"POST");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
//nonprimitive not container
cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
api_response_t *elementToReturn = api_response_parseFromJSON(PetAPIlocalVarJSON);

View File

@ -53,12 +53,14 @@ StoreAPI_deleteOrder(apiClient_t *apiClient, char * orderId )
localVarBodyParameters,
"DELETE");
if (apiClient->response_code == 400) {
printf("%s\n","Invalid ID supplied");
}
if (apiClient->response_code == 404) {
printf("%s\n","Order not found");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid ID supplied");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 404) {
// printf("%s\n","Order not found");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -108,9 +110,10 @@ StoreAPI_getInventory(apiClient_t *apiClient)
localVarBodyParameters,
"GET");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
//primitive return type not simple
cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived);
cJSON *VarJSON;
@ -186,15 +189,18 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId )
localVarBodyParameters,
"GET");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
if (apiClient->response_code == 400) {
printf("%s\n","Invalid ID supplied");
}
if (apiClient->response_code == 404) {
printf("%s\n","Order not found");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid ID supplied");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 404) {
// printf("%s\n","Order not found");
//}
//nonprimitive not container
cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON);
@ -263,12 +269,14 @@ StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body )
localVarBodyParameters,
"POST");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
if (apiClient->response_code == 400) {
printf("%s\n","Invalid Order");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid Order");
//}
//nonprimitive not container
cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON);

View File

@ -52,9 +52,10 @@ UserAPI_createUser(apiClient_t *apiClient, user_t * body )
localVarBodyParameters,
"POST");
if (apiClient->response_code == 0) {
printf("%s\n","successful operation");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 0) {
// printf("%s\n","successful operation");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -134,9 +135,10 @@ UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t * body )
localVarBodyParameters,
"POST");
if (apiClient->response_code == 0) {
printf("%s\n","successful operation");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 0) {
// printf("%s\n","successful operation");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -224,9 +226,10 @@ UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t * body )
localVarBodyParameters,
"POST");
if (apiClient->response_code == 0) {
printf("%s\n","successful operation");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 0) {
// printf("%s\n","successful operation");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -297,12 +300,14 @@ UserAPI_deleteUser(apiClient_t *apiClient, char * username )
localVarBodyParameters,
"DELETE");
if (apiClient->response_code == 400) {
printf("%s\n","Invalid username supplied");
}
if (apiClient->response_code == 404) {
printf("%s\n","User not found");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid username supplied");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 404) {
// printf("%s\n","User not found");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -361,15 +366,18 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username )
localVarBodyParameters,
"GET");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
if (apiClient->response_code == 400) {
printf("%s\n","Invalid username supplied");
}
if (apiClient->response_code == 404) {
printf("%s\n","User not found");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid username supplied");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 404) {
// printf("%s\n","User not found");
//}
//nonprimitive not container
cJSON *UserAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
user_t *elementToReturn = user_parseFromJSON(UserAPIlocalVarJSON);
@ -453,12 +461,14 @@ UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password )
localVarBodyParameters,
"GET");
if (apiClient->response_code == 200) {
printf("%s\n","successful operation");
}
if (apiClient->response_code == 400) {
printf("%s\n","Invalid username/password supplied");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 200) {
// printf("%s\n","successful operation");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid username/password supplied");
//}
//primitive return type simple
char* elementToReturn = strdup((char*)apiClient->dataReceived);
@ -533,9 +543,10 @@ UserAPI_logoutUser(apiClient_t *apiClient)
localVarBodyParameters,
"GET");
if (apiClient->response_code == 0) {
printf("%s\n","successful operation");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 0) {
// printf("%s\n","successful operation");
//}
//No return type
end:
if (apiClient->dataReceived) {
@ -602,12 +613,14 @@ UserAPI_updateUser(apiClient_t *apiClient, char * username , user_t * body )
localVarBodyParameters,
"PUT");
if (apiClient->response_code == 400) {
printf("%s\n","Invalid user supplied");
}
if (apiClient->response_code == 404) {
printf("%s\n","User not found");
}
// uncomment below to debug the error response
//if (apiClient->response_code == 400) {
// printf("%s\n","Invalid user supplied");
//}
// uncomment below to debug the error response
//if (apiClient->response_code == 404) {
// printf("%s\n","User not found");
//}
//No return type
end:
if (apiClient->dataReceived) {