Skip to content

Commit 5929a6a

Browse files
committed
merged from develop
1 parent 369a72f commit 5929a6a

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

modules/swagger-jaxrs-utils/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<parent>
44
<groupId>com.wordnik</groupId>
55
<artifactId>swagger-project_2.10</artifactId>
6-
<version>1.2.4-SNAPSHOT</version>
6+
<version>1.3.2</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>com.wordnik</groupId>
1111
<artifactId>swagger-jaxrs-utils_2.10</artifactId>
1212
<packaging>jar</packaging>
13-
<version>1.2.4-SNAPSHOT</version>
13+
<version>1.3.2</version>
1414
<name>swagger-jaxrs-utils</name>
1515
<build>
1616
<defaultGoal>install</defaultGoal>
@@ -49,11 +49,11 @@
4949
<dependency>
5050
<groupId>com.wordnik</groupId>
5151
<artifactId>common-utils_2.10</artifactId>
52-
<version>1.1.1</version>
52+
<version>1.1.6</version>
5353
<exclusions>
5454
<exclusion>
55-
<artifactId>slf4j-log4j12</artifactId>
56-
<groupId>org.slf4j</groupId>
55+
<artifactId>slf4j-log4j12</artifactId>
56+
<groupId>org.slf4j</groupId>
5757
</exclusion>
5858
</exclusions>
5959
</dependency>

modules/swagger-jersey-jaxrs/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<parent>
44
<groupId>com.wordnik</groupId>
55
<artifactId>swagger-project_2.10</artifactId>
6-
<version>1.3.1</version>
6+
<version>1.3.2</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>com.wordnik</groupId>
1111
<artifactId>swagger-jersey-jaxrs_2.10</artifactId>
1212
<packaging>jar</packaging>
13-
<version>1.3.1</version>
13+
<version>1.3.2</version>
1414
<name>swagger-jersey-jaxrs</name>
1515
<build>
1616
<defaultGoal>install</defaultGoal>

modules/swagger-jersey-jaxrs/src/main/scala/com/wordnik/swagger/jersey/JerseyApiReader.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory
3030
import javax.ws.rs._
3131
import core.Context
3232

33-
import java.lang.reflect.{ Type, Field, Modifier, Method }
33+
import java.lang.reflect.{ ParameterizedType, Type, Field, Modifier, Method }
3434
import java.lang.annotation.Annotation
3535

3636
import com.sun.jersey.core.header.FormDataContentDisposition
@@ -102,5 +102,21 @@ class JerseyApiReader extends JaxrsApiReader {
102102
}
103103
else None
104104
}
105+
106+
def findSubresourceType(method: Method): Class[_] = {
107+
method.getGenericReturnType match {
108+
case c: Class[_] => c
109+
case pt: ParameterizedType =>
110+
val typeArguments = pt.getActualTypeArguments
111+
if (pt.getRawType.equals(classOf[Class[_]]) && typeArguments.length == 1)
112+
typeArguments(0) match {
113+
case c: Class[_] => c
114+
case _ => method.getReturnType
115+
}
116+
else
117+
method.getReturnType
118+
case _ => method.getReturnType
119+
}
120+
}
105121
}
106122

0 commit comments

Comments
 (0)