Skip to content

Commit a20994d

Browse files
committed
fix for #607
1 parent d19a8c2 commit a20994d

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ trait Serializers {
502502
("authorizations" -> {
503503
x.authorizations match {
504504
case e: List[AuthorizationType] if (e.size > 0) => {
505-
Extraction.decompose((for(at <- e) yield {
505+
Extraction.decompose((for(at: AuthorizationType <- e) yield {
506506
if(at.`type` != "") Some(at.getName, at)
507507
else None
508508
}).flatten.toMap)
@@ -753,7 +753,7 @@ trait Serializers {
753753
("authorizations" -> {
754754
x.authorizations match {
755755
case e: List[AuthorizationType] if (e.size > 0) => {
756-
Extraction.decompose((for(at <- e) yield {
756+
Extraction.decompose((for(at: AuthorizationType <- e) yield {
757757
if(at.getName != "") {
758758
Some(at.getName, at)
759759
}

modules/swagger-play2/app/controllers/ApiHelpController.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ class SwaggerBaseApiController extends Controller {
145145
ref =>
146146
Logger("swagger").debug("reference: %s".format(ref.toString))
147147
}
148-
ResourceListing(ConfigFactory.config.getApiVersion,
148+
ResourceListing(
149+
ConfigFactory.config.getApiVersion,
149150
ConfigFactory.config.getSwaggerVersion,
150151
references,
151-
List(),
152+
ConfigFactory.config.authorizations,
152153
ConfigFactory.config.info
153154
)
154155
}

samples/scala-play2/app/Global.scala

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ import com.wordnik.swagger.model._
55

66

77
object Global extends GlobalSettings {
8+
val info = ApiInfo(
9+
title = "Swagger Sample App",
10+
description = """This is a sample server Petstore server. You can find out more about Swagger
11+
at <a href="http://swagger.wordnik.com">http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger. For this sample,
12+
you can use the api key "special-key" to test the authorization filters""",
13+
termsOfServiceUrl = "http://helloreverb.com/terms/",
14+
contact = "apiteam@wordnik.com",
15+
license = "Apache 2.0",
16+
licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.html")
17+
818
val oauth = OAuth(
919
List(
1020
AuthorizationScope("write:pets", "Modify pets in your account"),
@@ -24,16 +34,5 @@ object Global extends GlobalSettings {
2434
)
2535
))
2636
ConfigFactory.config.authorizations = List(oauth)
27-
28-
val info = ApiInfo(
29-
title = "Swagger Sample App",
30-
description = """This is a sample server Petstore server. You can find out more about Swagger
31-
at <a href="http://swagger.wordnik.com">http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger. For this sample,
32-
you can use the api key "special-key" to test the authorization filters""",
33-
termsOfServiceUrl = "http://helloreverb.com/terms/",
34-
contact = "apiteam@wordnik.com",
35-
license = "Apache 2.0",
36-
licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.html")
37-
3837
ConfigFactory.config.info = Some(info)
3938
}

0 commit comments

Comments
 (0)