1

I have a model for response in Scala:

case class ModelDto(
...
map: Map[UUID, AnotherDto]
...
)

How can I document this using annotations @Schema or @ArraySchema or smth like that?

Have no yml file and all fields describing using only Schema|ArraySchema like this:

case class ModelDto(
@Schema(description = "field description", required = true, `type` = "string", example = "field example")
  field: String
)
mononax
  • 11
  • 1

1 Answers1

0

The easiest way would be to do something like this:

case class ModelDto(
...
@Schema(implementation=classOf[YourTypeMap])
map: Map[UUID, AnotherDto]
...
)

class YourTypeMap extends java.util.HashMap[UUID, AnotherDto] {}
Alex
  • 7,460
  • 2
  • 40
  • 51