swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

Migrate play module

Open fehguy opened this issue 11 years ago • 33 comments

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.

fehguy avatar Mar 17 '15 23:03 fehguy

+1

seantbrady avatar Apr 02 '15 07:04 seantbrady

+1 please, if possible, take into account https://github.com/swagger-api/swagger-core/issues/900

joantune avatar Apr 02 '15 08:04 joantune

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.

jcranky avatar Apr 02 '15 16:04 jcranky

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 avatar Apr 07 '15 13:04 alpeb

@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

fehguy avatar Apr 07 '15 14:04 fehguy

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.

alpeb avatar Apr 07 '15 14:04 alpeb

I'll get that updated on the project, please track https://github.com/swagger-api/swagger-scala-module/issues/2

fehguy avatar Apr 07 '15 15:04 fehguy

ok @alpeb please take a look at the homepage for the scala module for instructions on adding it.

fehguy avatar Apr 07 '15 15:04 fehguy

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?

alpeb avatar Apr 07 '15 16:04 alpeb

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

fehguy avatar Apr 07 '15 16:04 fehguy

+1

emersonbarros avatar May 02 '15 02:05 emersonbarros

+1

kanuku avatar May 04 '15 09:05 kanuku

+1

orangefiredragon avatar May 05 '15 04:05 orangefiredragon

Any progress on this? I might be able to help out, particularly if it means resolving some of the issues @jcranky mentioned.

anovstrup avatar May 28 '15 20:05 anovstrup

+1

cdparra avatar Jul 02 '15 06:07 cdparra

+1

laguiz avatar Jul 02 '15 15:07 laguiz

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

cdparra avatar Jul 02 '15 16:07 cdparra

Juste tested matiwinnetou/swagger-play24. Working just fine.

cdparra avatar Jul 02 '15 21:07 cdparra

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.

webron avatar Jul 13 '15 11:07 webron

  • [ ] #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

webron avatar Jul 13 '15 11:07 webron