Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Support traits #48

Open
aggenebbisj opened this issue Feb 15, 2018 · 1 comment
Open

Support traits #48

aggenebbisj opened this issue Feb 15, 2018 · 1 comment

Comments

@aggenebbisj
Copy link

aggenebbisj commented Feb 15, 2018

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.

@dwickern
Copy link
Contributor

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants