Skip to content
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 @@ -60,7 +60,7 @@ public class MethodReader {
this.bean = bean;
this.element = element;
this.actualExecutable = actualExecutable;
this.actualParams = (actualExecutable == null) ? null : actualExecutable.getParameterTypes();
this.actualParams = actualExecutable == null ? null : actualExecutable.getParameterTypes();
this.isVoid = element.getReturnType().getKind() == TypeKind.VOID;
this.methodRoles = Util.findRoles(element);
this.producesAnnotation =
Expand Down Expand Up @@ -327,7 +327,7 @@ void read() {
}
// non-path parameters default to form or query parameters based on the
// existence of @Form annotation on the method
final ParamType defaultParamType = (formMarker) ? ParamType.FORMPARAM : ParamType.QUERYPARAM;
final ParamType defaultParamType = formMarker ? ParamType.FORMPARAM : ParamType.QUERYPARAM;

final List<? extends VariableElement> parameters = element.getParameters();
for (int i = 0; i < parameters.size(); i++) {
Expand All @@ -342,6 +342,15 @@ void read() {
final UType type = Util.parse(typeMirror.toString());
final MethodParam param = new MethodParam(p, type, rawType, defaultParamType, formMarker);
params.add(param);

if (CoreWebMethod.GET.equals(webMethod)
&& param.isBody()
&& !"java.util.Map".equals(param.utype().mainType())
&& !"ClientPlatformAdapter"
.equals(ProcessingContext.platform().getClass().getSimpleName())) {
logError(p, "Missing @BeanParam annotation");
}

param.addImports(bean);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ String mapTest(Map<String, List<String>> strings) {
return strings.toString();
}

@Get("/inputStream")
@Post("/inputStream")
@Consumes("application/bson")
String stream(InputStream stream) {
return stream.toString();
}

@Get("/byteArray")
@Post("/byteArray")
String bytes(byte[] array) {
return array.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ String enumQueryImplied(String s, @QueryParam ServerType type) {
}

@InstrumentServerContext
@Get(value = "/inputStream")
@Post(value = "/inputStream")
InputStream stream(InputStream stream) throws Exception {
return stream;
}
Expand Down