Skip to content

Commit

Permalink
updated versions, fixed serializer per #667
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Aug 30, 2014
1 parent 4cbf185 commit c5fc33d
Show file tree
Hide file tree
Showing 33 changed files with 96 additions and 105 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You need the following installed and available in your $PATH:

<li>- Apache maven 3.0.4 or greater (http://maven.apache.org/)

### To build from source (currently 1.3.8)
### To build from source (currently 1.3.9-SNAPSHOT)
```
# first time building locally
mvn -N
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>swagger-annotations</name>

Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-core/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<logger name="com.wordnik" level="ERROR"/>
<root level="ERROR">
<logger name="com.wordnik" level="error"/>
<root level="error">
<appender-ref ref="STDOUT" />
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -240,21 +240,19 @@ object SwaggerSerializers extends Serializers {
("authorizations" -> {
x.authorizations match {
case e: List[Authorization] if (e.size > 0) => {
Extraction.decompose({
var open = false
val o = ((for(at <- e) yield {
if(at.`type` == "open") {
open = true
None
}
else if(at.`type` != ""){
val out: Option[Tuple2[String, Authorization]] = Some(at.`type`, at)
out
}
else
None
}).flatten.toMap)
})
var open = false
val o = ((for(at <- e) yield {
if(at.`type` == "open") {
open = true
None
}
else if(at.`type` != "")
Some(at.`type`, at)
else
None
}).flatten.toMap)
if(o.size > 0 || open) Extraction.decompose(o)
else JNothing
}
case _ => JNothing
}
Expand Down Expand Up @@ -503,9 +501,9 @@ trait Serializers {
}) ~
("authorizations" -> {
x.authorizations match {
case e: List[Authorization] if (e.size > 0) => {
Extraction.decompose((for(at: Authorization <- e) yield {
if(at.`type` != "") Some(at.`type`, at)
case e: List[AuthorizationType] if (e.size > 0) => {
Extraction.decompose((for(at <- e) yield {
if(at.`type` != "") Some(at.getName, at)
else None
}).flatten.toMap)
}
Expand Down Expand Up @@ -563,8 +561,8 @@ trait Serializers {
("authorizations" -> {
x.authorizations match {
case e: List[AuthorizationType] if (e.size > 0) => {
Extraction.decompose((for(at: AuthorizationType <- e) yield {
if(at.`type` != "") Some(at.`type`, at)
Extraction.decompose((for(at <- e) yield {
if(at.`type` != "") Some(at.getName, at)
else None
}).flatten.toMap)
}
Expand Down Expand Up @@ -754,14 +752,13 @@ trait Serializers {
}) ~
("authorizations" -> {
x.authorizations match {
case e: List[Authorization] if (e.size > 0) => {
val out = (for(at: Authorization <- e) yield {
if(at.`type` != "") {
Some(at.`type`, at)
}
else None
}).flatten.toMap
Extraction.decompose(out)
case e: List[AuthorizationType] if (e.size > 0) => {
Extraction.decompose((for(at <- e) yield {
if(at.getName != "") {
Some(at.getName, at)
}
else None
}).flatten.toMap)
}
case _ => JNothing
}
Expand Down Expand Up @@ -944,7 +941,7 @@ trait Serializers {

class AuthorizationTypeSerializer extends CustomSerializer[AuthorizationType](formats => ({
case json =>
implicit val fmts: Formats = formats
implicit val fmts = formats
json \ "type" match {
case JString(x) if x.equalsIgnoreCase("oauth2") => {
OAuth((json \ "scopes").extractOrElse(List()),
Expand Down Expand Up @@ -986,7 +983,7 @@ trait Serializers {
}, {
case x: Authorization =>
implicit val fmts = formats
Extraction.decompose(x.scopes)
Extraction.decompose(x.scopes.filter(_.scope != ""))
}
))

Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-jaxrs-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs-utils_2.11</artifactId>
<packaging>jar</packaging>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<name>swagger-jaxrs-utils</name>
<build>
<defaultGoal>install</defaultGoal>
Expand Down
12 changes: 2 additions & 10 deletions modules/swagger-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,17 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.11</artifactId>
<packaging>jar</packaging>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<name>swagger-jaxrs</name>
<build>
<defaultGoal>install</defaultGoal>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>logback.xml</exclude>
</excludes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-jersey-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jersey-jaxrs_2.11</artifactId>
<packaging>jar</packaging>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<name>swagger-jersey-jaxrs</name>
<build>
<defaultGoal>install</defaultGoal>
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-jersey2-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jersey2-jaxrs_2.11</artifactId>
<packaging>jar</packaging>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<name>swagger-jersey2-jaxrs (Jersey 2.x support)</name>
<build>
<defaultGoal>install</defaultGoal>
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-oauth2-auth-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-oauth2-server_2.11</artifactId>
<packaging>jar</packaging>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<name>swagger-oauth2-server</name>
<build>
<defaultGoal>install</defaultGoal>
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-play2-utils/project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import PlayKeys._

object ApplicationBuild extends Build {
val appName = "swagger-play2-utils"
val appVersion = "1.3.8"
val appVersion = "1.3.9-SNAPSHOT"

scalaVersion := "2.11.1"

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

Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-play2/project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import PlayKeys._

object ApplicationBuild extends Build {
val appName = "swagger-play2"
val appVersion = "1.3.8"
val appVersion = "1.3.9-SNAPSHOT"

checksums in update := Nil

scalaVersion:= "2.11.1"

val appDependencies = Seq(
"org.slf4j" % "slf4j-api" % "1.6.4",
"com.wordnik" %% "swagger-jaxrs" % "1.3.8",
"com.wordnik" %% "swagger-jaxrs" % "1.3.9-SNAPSHOT",
"javax.ws.rs" % "jsr311-api" % "1.1.1",
"org.mockito" % "mockito-core" % "1.9.5" % "test")

Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-servlet_2.11</artifactId>
<packaging>jar</packaging>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<name>swagger-servlet</name>
<build>
<defaultGoal>install</defaultGoal>
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-utils_2.11</artifactId>
<packaging>jar</packaging>
<name>swagger-utils</name>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<defaultGoal>install</defaultGoal>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<artifactId>swagger-project_2.11</artifactId>
<packaging>pom</packaging>
<name>wordnik-swagger-project</name>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<url>https://github.com/wordnik/swagger-core</url>
<scm>
<connection>scm:git:[email protected]:wordnik/swagger-core.git</connection>
Expand Down
2 changes: 1 addition & 1 deletion samples/java-dropwizard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ To run the sample:
```
mvn package
java -jar target/swagger-java-dropwizard-sample-app_2.11-1.3.8.jar server conf/swagger-sample.yml
java -jar target/swagger-java-dropwizard-sample-app_2.11-1.3.9-SNAPSHOT.jar server conf/swagger-sample.yml
```

Expand Down
4 changes: 2 additions & 2 deletions samples/java-dropwizard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-java-dropwizard-sample-app_2.11</artifactId>
<packaging>jar</packaging>
<name>swagger-java-dropwizard-app</name>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion samples/java-grails2/grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ grails.project.dependency.resolution = {
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
compile 'com.wordnik:swagger-jaxrs_2.11:1.3.8'
compile 'com.wordnik:swagger-jaxrs_2.11:1.3.9-SNAPSHOT'
compile 'com.fasterxml.jackson.core:jackson-core:2.4.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.1'
compile 'ch.qos.logback:logback-classic:1.0.6'
Expand Down
4 changes: 2 additions & 2 deletions samples/java-jaxrs-cxf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-java-cxf-sample_2.11</artifactId>
<packaging>war</packaging>
<name>swagger-java-cxf-sample</name>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down
4 changes: 2 additions & 2 deletions samples/java-jaxrs-no-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-java-sample-app_2.11</artifactId>
<packaging>war</packaging>
<name>swagger-java-jaxrs-app</name>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions samples/java-jaxrs-subresource/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<parent>
<groupId>com.wordnik</groupId>
<artifactId>swagger-project_2.11</artifactId>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>swagger-java-subresource-sample_2.11</artifactId>
<packaging>war</packaging>
<name>swagger-java-subresource-sample</name>
<version>1.3.8</version>
<version>1.3.9-SNAPSHOT</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
Expand Down
Loading

0 comments on commit c5fc33d

Please sign in to comment.