Fixed the parameter expansion logic
Really as long as a parameter is not annotated we should treat it as a model attribute. So we just exclude RequestPart and RequestBody annotations
(1749)
@@ -26,7 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestPart;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.service.Parameter;
import springfox.documentation.service.ResolvedMethodParameter;
@@ -141,7 +142,8 @@ public class OperationParameterReader implements OperationBuilderPlugin {
}
private boolean shouldExpand(final ResolvedMethodParameter parameter, ResolvedType resolvedParamType) {
- return (!parameter.hasParameterAnnotations() || parameter.hasParameterAnnotation(ModelAttribute.class))
+ return !parameter.hasParameterAnnotation(RequestBody.class)
+ && !parameter.hasParameterAnnotation(RequestPart.class)
&& !isBaseType(typeNameFor(resolvedParamType.getErasedType()))
&& !resolvedParamType.getErasedType().isEnum()
&& !isContainerType(resolvedParamType)
