cancel
Showing results for 
Search instead for 
Did you mean: 

Why do Scala models have fields of type Option?

Highlighted
Occasional Visitor

Why do Scala models have fields of type Option?

I generated a Scala client for the pet store example. Why are all the model fields of type Option?

 

case class Pet (
  id: Option[Long] = None,
  category: Option[Category] = None,
  name: String,
  photoUrls: Seq[String],
  tags: Option[Seq[Tag]] = None,
  /* pet status in the store */
  status: Option[PetEnums.Status] = None
) extends ApiModel
Tags (1)
New Here?
Join us and watch the welcome video: