Migrate play module
Using the swagger-scala module, need to migrate play support into a new module. This is probably best done in a new artifact, and outside of swagger-core.
+1
+1 please, if possible, take into account https://github.com/swagger-api/swagger-core/issues/900
Since the integration will be reworked, it would be nice if more information like path and query params could be automatically extracted, so that we don't have to use jax-rs's PathParam and QueryParam annotations. This is information is already available in the routes file.
Also it seems models inside scala objects aren't properly supported.
I modified /samples/scala-play2/app/models/Pet.scala (using tag v.1.3.12) like this:
object Models {
@ApiModel("Pet")
case class Pet(
@(ApiModelProperty @field)(position=1, value="id")id: Long,
@(ApiModelProperty @field)(position=2)category: Category,
@(ApiModelProperty @field)(position=3)name: String,
@(ApiModelProperty @field)(position=4)photoUrls: List[String],
@(ApiModelProperty @field)(position=5)tags: List[Tag],
@(ApiModelProperty @field)(position=6)status: String
)
@ApiModel("Tag")
case class Tag (
@(ApiModelProperty @field)(position=1)id: Long,
@(ApiModelProperty @field)(position=2)name: String)
}
And the Tag model disappeared from the json in http://localhost:9000/api-docs/pet
Can someone please confirm this is indeed a bug?
@alpeb if you're looking at how this works in the 1.5.x version, you should look at the swagger-scala-module which will support scala
Are there any instructions on how to use https://github.com/swagger-api/swagger-scala-module ? All I see there is the SwaggerScalaModelConverter class.
I would love to make this work now, that's why I was trying with the v.1.3.12 tag.
I'll get that updated on the project, please track https://github.com/swagger-api/swagger-scala-module/issues/2
ok @alpeb please take a look at the homepage for the scala module for instructions on adding it.
Thanks @fehguy . I added the swagger-scala-module dependency into the pet store, but it doesn't build because it depends on swagger-play2, whose Jackson dependencies conflict with the swagger scala module. So it looks like Play support is nowhere to be found yet in 1.5?
That's what this ticket is for. Scala support is in but play support is in process. Sorry, I read your comment as a general scala question not play specific
+1
+1
+1
Any progress on this? I might be able to help out, particularly if it means resolving some of the issues @jcranky mentioned.
+1
+1
In the meantime, maybe this project can be of help. Will try it later Today and report if it works or not with play 2.4.x
Juste tested matiwinnetou/swagger-play24. Working just fine.
Since we're not going to release a new version of 1.3 (for Play or otherwise), I'll link the existing Play issues here so we can make sure those are taken care of as part of the migration.
- [ ] #944 - Swagger & java play 2 class loading problems 1.3.12
- [ ] #956 - Play Framework binders
- [ ] #827 - Feature/getresource encoding
- [ ] #1115 - Develop scala 2.11
- [ ] #1272 - Add info (metadata) in play module