Skip to content

Commit

Permalink
mulesoft-labs#421 Always use InputStream and StreamingOuput for type …
Browse files Browse the repository at this point in the history
…"any"
  • Loading branch information
Kaiser1989 committed Feb 17, 2020
1 parent bd5f74a commit 48b70cf
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ private void createParamteter(MethodSpec.Builder methodSpec, GRequest gRequest,
return;
}

if (gRequest.type().name().equals("any") && "application/octet-stream".equals(gRequest.mediaType())) {

if (gRequest.type().name().equals("any")) {
TypeName typeName = ClassName.get(InputStream.class);
methodSpec.addParameter(ParameterSpec.builder(typeName, "entity").build());
} else {
Expand Down Expand Up @@ -450,7 +449,7 @@ public ResponseClassExtension<GMethod> apply(@Nullable Collection<ResponseClassE

private TypeName createResponseParameter(GResponseType responseType, MethodSpec.Builder builder) {

if ("application/octet-stream".equals(responseType.mediaType()) && "any".equals(responseType.type().name())) {
if ("any".equals(responseType.type().name())) {

TypeName typeName = ClassName.get(StreamingOutput.class);
builder.addParameter(ParameterSpec.builder(typeName, "entity").build());
Expand Down

0 comments on commit 48b70cf

Please sign in to comment.