Getting the Tapir annotations of fields

Hello.

I am trying to get the Tapir annotations (e.g @description) of the fields of a case class in order to use apply them to another schema. For example, I would like to be able to get the description of each field for this definition:

case class Foo(
  @description("A bar") bar: Bar,
  @description("A baz") baz: Baz
)

I found StaticAnnotations and StaticAnnotationMacros#derived in the docs but it seems to only get the annotations of the case class and not of its fields. Is there a way out of the box to achieve what I am trying to do?

Check out Tapir’s internal SchemaAnnotationsMacro:
Scala 2: tapir/core/src/main/scala-2/sttp/tapir/internal/SchemaAnnotationsMacro.scala at 82efa3903050a2992fd13ba32d547d1409d2f819 · softwaremill/tapir · GitHub
Scala 3: tapir/core/src/main/scala-3/sttp/tapir/internal/SchemaAnnotationsMacro.scala at 82efa3903050a2992fd13ba32d547d1409d2f819 · softwaremill/tapir · GitHub