Forum Discussion

Kanaan's avatar
Occasional Visitor
5 years ago

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
No RepliesBe the first to reply