Skip to content

Commit d19a8c2

Browse files
committed
updated versions, fixed serializer per #667
1 parent e77198f commit d19a8c2

File tree

39 files changed

+142
-119
lines changed

39 files changed

+142
-119
lines changed

modules/swagger-annotations/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<parent>
44
<groupId>com.wordnik</groupId>
55
<artifactId>swagger-project_2.10</artifactId>
6-
<version>1.3.8-SNAPSHOT</version>
6+
<version>1.3.9-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>com.wordnik</groupId>
1111
<artifactId>swagger-annotations</artifactId>
12-
<version>1.3.8</version>
12+
<version>1.3.9-SNAPSHOT</version>
1313
<packaging>bundle</packaging>
1414
<name>swagger-annotations</name>
1515

modules/swagger-core/pom.xml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,18 @@
22
<parent>
33
<groupId>com.wordnik</groupId>
44
<artifactId>swagger-project_2.10</artifactId>
5-
<version>1.3.8</version>
5+
<version>1.3.9-SNAPSHOT</version>
66
<relativePath>../..</relativePath>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<groupId>com.wordnik</groupId>
1010
<artifactId>swagger-core_2.10</artifactId>
1111
<packaging>jar</packaging>
1212
<name>swagger-core</name>
13-
<version>1.3.8</version>
13+
<version>1.3.9-SNAPSHOT</version>
1414
<build>
1515
<sourceDirectory>src/main/java</sourceDirectory>
1616
<defaultGoal>install</defaultGoal>
17-
<resources>
18-
<resource>
19-
<directory>src/main/resources</directory>
20-
<excludes>
21-
<exclude>logback.xml</exclude>
22-
</excludes>
23-
</resource>
24-
</resources>
2517
<testResources>
2618
<testResource>
2719
<directory>src/test/resources</directory>

modules/swagger-core/src/main/resources/logback.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
66
</layout>
77
</appender>
8-
<logger name="com.wordnik" level="ERROR"/>
9-
<root level="ERROR">
8+
<logger name="com.wordnik" level="error"/>
9+
<root level="error">
1010
<appender-ref ref="STDOUT" />
1111
</root>
1212
</configuration>

modules/swagger-core/src/main/scala/com/wordnik/swagger/model/SwaggerSerializers.scala

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -240,21 +240,19 @@ object SwaggerSerializers extends Serializers {
240240
("authorizations" -> {
241241
x.authorizations match {
242242
case e: List[Authorization] if (e.size > 0) => {
243-
Extraction.decompose({
244-
var open = false
245-
val o = ((for(at <- e) yield {
246-
if(at.`type` == "open") {
247-
open = true
248-
None
249-
}
250-
else if(at.`type` != ""){
251-
val out: Option[Tuple2[String, Authorization]] = Some(at.`type`, at)
252-
out
253-
}
254-
else
255-
None
256-
}).flatten.toMap)
257-
})
243+
var open = false
244+
val o = ((for(at <- e) yield {
245+
if(at.`type` == "open") {
246+
open = true
247+
None
248+
}
249+
else if(at.`type` != "")
250+
Some(at.`type`, at)
251+
else
252+
None
253+
}).flatten.toMap)
254+
if(o.size > 0 || open) Extraction.decompose(o)
255+
else JNothing
258256
}
259257
case _ => JNothing
260258
}
@@ -503,9 +501,9 @@ trait Serializers {
503501
}) ~
504502
("authorizations" -> {
505503
x.authorizations match {
506-
case e: List[Authorization] if (e.size > 0) => {
507-
Extraction.decompose((for(at: Authorization <- e) yield {
508-
if(at.`type` != "") Some(at.`type`, at)
504+
case e: List[AuthorizationType] if (e.size > 0) => {
505+
Extraction.decompose((for(at <- e) yield {
506+
if(at.`type` != "") Some(at.getName, at)
509507
else None
510508
}).flatten.toMap)
511509
}
@@ -563,8 +561,8 @@ trait Serializers {
563561
("authorizations" -> {
564562
x.authorizations match {
565563
case e: List[AuthorizationType] if (e.size > 0) => {
566-
Extraction.decompose((for(at: AuthorizationType <- e) yield {
567-
if(at.`type` != "") Some(at.`type`, at)
564+
Extraction.decompose((for(at <- e) yield {
565+
if(at.`type` != "") Some(at.getName, at)
568566
else None
569567
}).flatten.toMap)
570568
}
@@ -754,14 +752,13 @@ trait Serializers {
754752
}) ~
755753
("authorizations" -> {
756754
x.authorizations match {
757-
case e: List[Authorization] if (e.size > 0) => {
758-
val out = (for(at: Authorization <- e) yield {
759-
if(at.`type` != "") {
760-
Some(at.`type`, at)
761-
}
762-
else None
763-
}).flatten.toMap
764-
Extraction.decompose(out)
755+
case e: List[AuthorizationType] if (e.size > 0) => {
756+
Extraction.decompose((for(at <- e) yield {
757+
if(at.getName != "") {
758+
Some(at.getName, at)
759+
}
760+
else None
761+
}).flatten.toMap)
765762
}
766763
case _ => JNothing
767764
}
@@ -944,7 +941,7 @@ trait Serializers {
944941

945942
class AuthorizationTypeSerializer extends CustomSerializer[AuthorizationType](formats => ({
946943
case json =>
947-
implicit val fmts: Formats = formats
944+
implicit val fmts = formats
948945
json \ "type" match {
949946
case JString(x) if x.equalsIgnoreCase("oauth2") => {
950947
OAuth((json \ "scopes").extractOrElse(List()),
@@ -986,7 +983,7 @@ trait Serializers {
986983
}, {
987984
case x: Authorization =>
988985
implicit val fmts = formats
989-
Extraction.decompose(x.scopes)
986+
Extraction.decompose(x.scopes.filter(_.scope != ""))
990987
}
991988
))
992989

modules/swagger-jaxrs-utils/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.8</version>
6+
<version>1.3.9-SNAPSHOT</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.3.8</version>
13+
<version>1.3.9-SNAPSHOT</version>
1414
<name>swagger-jaxrs-utils</name>
1515
<build>
1616
<defaultGoal>install</defaultGoal>

modules/swagger-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.8</version>
6+
<version>1.3.9-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>com.wordnik</groupId>
1111
<artifactId>swagger-jaxrs_2.10</artifactId>
1212
<packaging>jar</packaging>
13-
<version>1.3.8</version>
13+
<version>1.3.9-SNAPSHOT</version>
1414
<name>swagger-jaxrs</name>
1515
<build>
1616
<defaultGoal>install</defaultGoal>

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.8</version>
6+
<version>1.3.9-SNAPSHOT</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.8</version>
13+
<version>1.3.9-SNAPSHOT</version>
1414
<name>swagger-jersey-jaxrs</name>
1515
<build>
1616
<defaultGoal>install</defaultGoal>

modules/swagger-jersey2-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.8</version>
6+
<version>1.3.9-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>com.wordnik</groupId>
1111
<artifactId>swagger-jersey2-jaxrs_2.10</artifactId>
1212
<packaging>jar</packaging>
13-
<version>1.3.8</version>
13+
<version>1.3.9-SNAPSHOT</version>
1414
<name>swagger-jersey2-jaxrs (Jersey 2.x support)</name>
1515
<build>
1616
<defaultGoal>install</defaultGoal>

modules/swagger-oauth2-auth-server/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.8</version>
6+
<version>1.3.9-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>com.wordnik</groupId>
1111
<artifactId>swagger-oauth2-server_2.10</artifactId>
1212
<packaging>jar</packaging>
13-
<version>1.3.8</version>
13+
<version>1.3.9-SNAPSHOT</version>
1414
<name>swagger-oauth2-server</name>
1515
<build>
1616
<defaultGoal>install</defaultGoal>

modules/swagger-play2-utils/project/Build.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import PlayKeys._
66

77
object ApplicationBuild extends Build {
88
val appName = "swagger-play2-utils"
9-
val appVersion = "1.3.8-SNAPSHOT"
9+
val appVersion = "1.3.9-SNAPSHOT"
1010

1111
scalaVersion := "2.10.3"
1212

1313
val appDependencies: Seq[sbt.ModuleID] = Seq(
1414
"org.slf4j" % "slf4j-api" % "1.6.4",
15-
"com.wordnik" %% "swagger-core" % "1.3.8",
15+
"com.wordnik" %% "swagger-core" % "1.3.9-SNAPSHOT",
1616
"com.wordnik" %% "common-utils" % "1.3.0",
1717
"javax.ws.rs" % "jsr311-api" % "1.1.1")
1818

0 commit comments

Comments
 (0)