@@ -75,24 +75,7 @@ class JerseyApiReader extends JaxrsApiReader {
75
75
case _ => None
76
76
}
77
77
// look for method-level annotated properties
78
- val parentParams : List [Parameter ] = (for (field <- getAllFields(cls))
79
- yield {
80
- // only process fields with @ApiParam, @QueryParam, @HeaderParam, @PathParam
81
- if (field.getAnnotation(classOf [QueryParam ]) != null || field.getAnnotation(classOf [HeaderParam ]) != null ||
82
- field.getAnnotation(classOf [HeaderParam ]) != null || field.getAnnotation(classOf [PathParam ]) != null ||
83
- field.getAnnotation(classOf [ApiParam ]) != null ) {
84
- val param = new MutableParameter
85
- param.dataType = field.getType.getName
86
- Option (field.getAnnotation(classOf [ApiParam ])) match {
87
- case Some (annotation) => toAllowableValues(annotation.allowableValues)
88
- case _ =>
89
- }
90
- val annotations = field.getAnnotations
91
- processParamAnnotations(param, annotations)
92
- }
93
- else None
94
- }
95
- ).flatten.toList
78
+ val parentParams : List [Parameter ] = getAllParamsFromFields(cls)
96
79
97
80
for (method <- cls.getMethods) {
98
81
val returnType = findSubresourceType(method)
@@ -153,7 +136,7 @@ class JerseyApiReader extends JaxrsApiReader {
153
136
else None
154
137
}
155
138
156
- def processParamAnnotations (mutable : MutableParameter , paramAnnotations : Array [Annotation ]): Option [Parameter ] = {
139
+ def processParamAnnotations (mutable : MutableParameter , paramAnnotations : Array [Annotation ]): List [Parameter ] = {
157
140
var shouldIgnore = false
158
141
for (pa <- paramAnnotations) {
159
142
pa match {
@@ -198,6 +181,10 @@ class JerseyApiReader extends JaxrsApiReader {
198
181
}
199
182
}
200
183
}
184
+ case e : BeanParam => {
185
+ val cls = SwaggerContext .loadClass(mutable.dataType)
186
+ return getAllParamsFromFields(cls)
187
+ }
201
188
case e : Context => shouldIgnore = true
202
189
case _ =>
203
190
}
@@ -207,9 +194,9 @@ class JerseyApiReader extends JaxrsApiReader {
207
194
mutable.paramType = TYPE_BODY
208
195
mutable.name = TYPE_BODY
209
196
}
210
- Some (mutable.asParameter)
197
+ List (mutable.asParameter)
211
198
}
212
- else None
199
+ else List .empty
213
200
}
214
201
def findSubresourceType (method : Method ): Class [_] = {
215
202
method.getGenericReturnType match {
0 commit comments