Merge pull request #588 from wing328/csharp_response_warning

Eliminated warning related to response in CSharp API files
This commit is contained in:
Tony Tam 2015-04-04 21:00:31 -07:00
commit a57588caa1
4 changed files with 1092 additions and 1033 deletions

View File

@ -75,16 +75,28 @@
try {
if (typeof({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}) == typeof(byte[])) {
{{#returnType}}
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return {{#returnType}}((object)response) as {{{returnType}}}{{/returnType}};
return ((object)response) as {{{returnType}}};
{{/returnType}}
{{^returnType}}
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
{{/returnType}}
} else {
{{#returnType}}
var response = apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, headerParams, formParams);
if (response != null){
return {{#returnType}}({{{returnType}}}) ApiInvoker.deserialize(response, typeof({{{returnType}}})){{/returnType}};
return ({{{returnType}}}) ApiInvoker.deserialize(response, typeof({{{returnType}}}));
}
else {
return {{#returnType}}null{{/returnType}};
return null;
}
{{/returnType}}
{{^returnType}}
apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, headerParams, formParams);
return;
{{/returnType}}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {

View File

@ -3,11 +3,6 @@
using io.swagger.client;
using io.swagger.Model;
namespace io.swagger.Api {
public class PetApi {
@ -60,16 +55,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, Body, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, Body, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -107,16 +103,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -158,9 +155,13 @@
try {
if (typeof(List<Pet>) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as List<Pet>;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if (response != null){
return (List<Pet>) ApiInvoker.deserialize(response, typeof(List<Pet>));
@ -168,6 +169,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -209,9 +212,13 @@
try {
if (typeof(List<Pet>) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as List<Pet>;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if (response != null){
return (List<Pet>) ApiInvoker.deserialize(response, typeof(List<Pet>));
@ -219,6 +226,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -256,9 +265,13 @@
try {
if (typeof(Pet) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as Pet;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if (response != null){
return (Pet) ApiInvoker.deserialize(response, typeof(Pet));
@ -266,6 +279,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -321,16 +336,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -370,16 +386,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -435,16 +452,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {

View File

@ -3,10 +3,6 @@
using io.swagger.client;
using io.swagger.Model;
namespace io.swagger.Api {
public class StoreApi {
@ -58,9 +54,13 @@
try {
if (typeof(Dictionary<String, int?>) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as Dictionary<String, int?>;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if (response != null){
return (Dictionary<String, int?>) ApiInvoker.deserialize(response, typeof(Dictionary<String, int?>));
@ -68,6 +68,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -105,9 +107,13 @@
try {
if (typeof(Order) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as Order;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
if (response != null){
return (Order) ApiInvoker.deserialize(response, typeof(Order));
@ -115,6 +121,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -152,9 +160,13 @@
try {
if (typeof(Order) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as Order;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if (response != null){
return (Order) ApiInvoker.deserialize(response, typeof(Order));
@ -162,6 +174,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -199,16 +213,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {

View File

@ -3,10 +3,6 @@
using io.swagger.client;
using io.swagger.Model;
namespace io.swagger.Api {
public class UserApi {
@ -59,16 +55,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -106,16 +103,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -153,16 +151,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, Body, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -209,9 +208,13 @@
try {
if (typeof(string) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as string;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if (response != null){
return (string) ApiInvoker.deserialize(response, typeof(string));
@ -219,6 +222,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -255,16 +260,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -302,9 +308,13 @@
try {
if (typeof(User) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return ((object)response) as User;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
if (response != null){
return (User) ApiInvoker.deserialize(response, typeof(User));
@ -312,6 +322,8 @@
else {
return null;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -350,16 +362,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, Body, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, Body, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {
@ -397,16 +410,17 @@
try {
if (typeof(void) == typeof(byte[])) {
var response = apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
apiInvoker.invokeBinaryAPI(basePath, path, "GET", queryParams, null, headerParams, formParams);
return;
} else {
var response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, formParams);
if(response != null){
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, formParams);
return;
}
else {
return ;
}
}
} catch (ApiException ex) {
if(ex.ErrorCode == 404) {