cancel
Showing results for 
Search instead for 
Did you mean: 

Scala enumerations

Visitor

Scala enumerations

Is the standard way for scala enumerations to work with swagger is to manually specify allowableValues? 

@ApiModelProperty(dataType = "string", allowableValues = "apple,orange")

 

See this example enumeration:

object Fruit extends Enumeration {
type Fruit = Value

val Static = Value("apple")
val Fabric = Value("orange")
}

 

case class Entree(meat: Meat,
@ApiModelProperty(dataType = "string", allowableValues = "apple,orange") fruit: Fruit.Fruit
)

 

New Here?
Join us and watch the welcome video:
Announcements