mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
removed 404 handling
This commit is contained in:
parent
8b98a92805
commit
ddb1d6e0d3
@ -11,6 +11,7 @@ import java.util.*;
|
||||
{{/imports}}
|
||||
|
||||
import com.sun.jersey.multipart.FormDataMultiPart;
|
||||
import com.sun.jersey.multipart.file.FileDataBodyPart;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
@ -77,7 +78,8 @@ public class {{classname}} {
|
||||
mp.field("{{baseName}}", ApiInvoker.parameterToString({{paramName}}), MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
{{/notFile}}{{#isFile}}
|
||||
hasFields = true;
|
||||
mp.field("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
mp.field("{{baseName}}", file.getName());
|
||||
mp.bodyPart(new FileDataBodyPart("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE));
|
||||
{{/isFile}}{{/formParams}}
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
@ -96,12 +98,7 @@ public class {{classname}} {
|
||||
return {{#returnType}}null{{/returnType}};
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return {{#returnType}} null{{/returnType}};
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
{{/operation}}
|
||||
|
Loading…
Reference in New Issue
Block a user