Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 29 20:03
    gabfssilva opened #298
  • Nov 23 18:03
    scala-steward opened #297
  • Nov 20 02:32
    scala-steward opened #296
  • Nov 18 13:16
    terence-bigtt edited #295
  • Nov 18 13:15
    terence-bigtt commented #295
  • Nov 18 13:15
    terence-bigtt commented #295
  • Nov 18 13:15
    terence-bigtt edited #295
  • Nov 18 11:24
    terence-bigtt opened #295
  • Nov 15 12:51
    Edefritz commented #294
  • Nov 11 23:05
    francescoditrani edited #294
  • Nov 11 18:57
    francescoditrani opened #294
  • Oct 26 11:32
    kailuowang commented #208
  • Oct 26 10:42
    SoheilJafari commented #208
  • Oct 26 10:42
    SoheilJafari commented #208
  • Oct 23 18:16

    kailuowang on v0.9.1-PLAY2.7

    (compare)

  • Oct 23 18:16

    kailuowang on play2.7

    Setting version to 0.9.1-PLAY2.7 Setting version to 0.9.2-SNAPSH… (compare)

  • Oct 18 20:34

    kailuowang on play2.7

    Support for enumeratum (#290) (compare)

  • Oct 18 20:34
    kailuowang closed #290
  • Oct 18 19:13
    gabfssilva synchronize #290
  • Oct 17 06:12
    scala-steward opened #293
idanna
@idanna
*if
Kai(luo) Wang
@kailuowang
Because the playsawgger automatically parse referenced classes in your classes. So it has to have a limited scope.
idanna
@idanna
@kailuowang thanks, that did the trick !
svendjo
@svendjo
Hey guys.
Is anyone able to get play-swagger to read your Java classes and produce #definitions from them?
I've set:
swaggerDomainNameSpaces := Seq("com.something.something")
Doesn't seem to matter what I set it to, nothing gets picked up.
Kai(luo) Wang
@kailuowang
sorry , very pool support (next to zero) for java classes.
svendjo
@svendjo
Will it at least produce something basic; if I copy all my Java classes from 'com.something.something' to 'models' and run with swaggerDomainNameSpaces := Seq("models") ?
Kai(luo) Wang
@kailuowang
it can use the first constructor to generate some definitions but it won’t get the field names so it’s basically useless.
svendjo
@svendjo
OK thanks.
fabio fumarola
@fabiofumarola
Hi all I'm stucked with the github readme
I'm trying to setup the sbt plugin with play 2.6 and scala 2.11
but I cannot find the artifact on jcenter repo
Kai(luo) Wang
@kailuowang
@fabiofumarola sorry for the late response. play 2.6 on scala 2.11 is yet to be supported, what sbt version are you on?
Rohini
@rohinisb
Hi all, im trying to integrate swagger for our play app and unable to resolve the dependency. We use play 2.4 and as per github doc the dependency i'm adding is "com.iheart" % "sbt-play-swagger" % "0.6.0-PLAY2.4"
Any suggestions on what i may be missing
is there a resolver i need to add?
Kai(luo) Wang
@kailuowang
which sbt version on you on?
it only supports sbt 0.13.x
Angelos Marios Prastitis
@AngelosPrastitis
Hi all, i just added the iherartradio/play-swagger library in my Play project.
I have the following enpoint : GET /api/config core.controllers.SettingsController.index

This entpoint needs an api key to be added in the request header but i dont know how to add it.
I tryed the following:

#

apiKey :

name: x-api-key

type: string

in: header

summary: create a card

responses:

400:

description: success

#

GET /api/config core.controllers.SettingsController.index

It seems like whatever i add in the comments section does not get parsed by swagger.
What could be the issue?

Teena George
@teenageorge

Will it at least produce something basic; if I copy all my Java classes from 'com.something.something' to 'models' and run with swaggerDomainNameSpaces := Seq("models") ?

Hi, I'm working on a solution for generating java class definitions

The way I see it, there are two options:

  1. Modify the SwaggerSpecGenerator.scala class and generate a merge request.
  2. Write a Java utility (using Reflection) to generate the class definitions for each class.

I have the second option more or less ready in JSON format.
I'm an absolute newbie to Scala so I'm worried about the time I'm going to take to make it work.

I'm looking for an opinion from the community to know if using reflection is too bad an approach. Thanks in advance!

Gabriel Francisco
@gabfssilva
To send a PR, do I need to work on the master branch or the play 2.7 branch?
Kai(luo) Wang
@kailuowang
depends on if you want to feature on play 2.7.
Gabriel Francisco
@gabfssilva
yes, I do! =P I'll send another PR then.
if I want to add this feature to both master and play 2.7, the right way is to send two PRs then, right?
Kai(luo) Wang
@kailuowang
If you want it on 2.6 let’s get the PR on master reviewed and merged first. then I shall be able to merge master to 2.7
Gabriel Francisco
@gabfssilva
Do you think it's possible to support enumeratums enums? It'd be a really nice feature. The workaround today is to create a custom mapping.
Kai(luo) Wang
@kailuowang
It might be possible, if scala reflect provides a way to detect all the objects declared in the Enum object.
Gabriel Francisco
@gabfssilva
We could call Enum.values once we identify it's a Enumeratum enum. Not sure how reflection works with object values, but, I guess I can try.
Gabriel Francisco
@gabfssilva

Could be done like this:

 val x = classOf[MyNiceEnum]

  val clazz = Class.forName(x.getName + "$")
  val singleton = clazz.getField("MODULE$").get(clazz)

  if (singleton.isInstanceOf[Enum[_]]) {
    val values: Field = singleton.getClass.getDeclaredField("values")
    values.setAccessible(true)
    val list = values.get(singleton).asInstanceOf[Vector[EnumEntry]].toList
    println(list.map(_.entryName))
  }

not pretty, but, works well.

Kai(luo) Wang
@kailuowang
:+1: a PR is more than welcome. if you would, please organize this feature into a separate class.
Gabriel Francisco
@gabfssilva
I'm sending one soon. =)
Gabriel Francisco
@gabfssilva
Gabriel Francisco
@gabfssilva
Didn't see it yesterday. Any idea why the build's broken?
Kai(luo) Wang
@kailuowang
might be an environmental issue. restarted the build
Gabriel Francisco
@gabfssilva
happened again
the issue is this: Expected feature release number in range of 9 to 14, but got: 8
Gabriel Francisco
@gabfssilva
So, it seems like the issue was with oraclejdk. I changed to openjdk and the issue is gone. It's not a big deal, right? It's probably better to use openjdk instead of oraclejdk
Gabriel Francisco
@gabfssilva
Hey @kailuowang! I'm wondering if you could release a version for the 2.7 branch with the enumeratum feature. =) Thanks!
Kai(luo) Wang
@kailuowang
0.9.1-PLAY2.7 is released.
Gabriel Francisco
@gabfssilva
Thanks!
Kai(luo) Wang
@kailuowang
thank you for the contribution!
ouakrim
@Ouakrim
Hi i have a question , is it possible to override the path in the description of the API ?
#  parameters:
#    - name: body
#      schema:
#        $ref: '#/definitions/com.iheart.api.Track'
###
POST   /tracks       controller.Api.createTrack()
for example i want to expose in the Swagger-UI : v1/track instead of /tracks
Gabriel Francisco
@gabfssilva
What's the problem of adding the /v1 to your route definition?
#  parameters:
#    - name: body
#      schema:
#        $ref: '#/definitions/com.iheart.api.Track'
###
POST   /v1/tracks       controller.Api.createTrack()
Harry Laoulakos
@harrylaou
Hi , is there a way to "fix" the url and not have to pass as a query paramater? I was looking at https://github.com/swagger-api/swagger-ui/blob/94e101924b84435585896f4ea7c4092182a91f23/docs/usage/configuration.md but I am using webjars and saving a swagger-config.yml in conf folder doesn't seem to work.