swagger-scala-module
swagger-scala-module copied to clipboard
Support traits
Traits do not seem to be picked up automatically.
If I have the following:
sealed trait Foo(x: Int)
case class Bar(x: Int) extends Foo
the generated Swagger definition is:
Foo: {
type: "object"
}
I would expect the property x
to be there as well.
I think it needs to be a "java bean" getter, e.g.
@ApiModel(value = "foo")
trait Foo {
@ApiModelProperty(value = "x", dataType = "integer", required = true, readOnly = true)
def getX: Int
}
You might also make use of @scala.annotation.meta.beanGetter
(btw your code is not valid scala, unless you're using dotty or something)