Forum Discussion

rnrn1234's avatar
rnrn1234
Visitor
4 years ago

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
)

 

No RepliesBe the first to reply