Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Annotations on referenced fields not working for optionals #3288

Closed
andersbohn opened this issue Oct 31, 2023 · 0 comments · Fixed by #3327
Closed

[BUG] Annotations on referenced fields not working for optionals #3288

andersbohn opened this issue Oct 31, 2023 · 0 comments · Fixed by #3327
Assignees

Comments

@andersbohn
Copy link

Tapir 1.8.2

Scala version: 2.13

When using eg @deprecated on a field Option[T] it is not picked up in OpenApi output when referenced fields.

How to reproduce?

In EventB the @deprecated deprAName gets correctly represented in the openapi, but the optional deprOptionAName does not.

  case class EventB(
      aName: AName,
      @Schema.annotations.deprecated
      deprAName: AName,
      @Schema.annotations.deprecated
      deprOptionAName: Option[AName],
      bName: BName
  ) extends Event

sscce_undepr_option_t - Library.scala#L17

as seen in the docs.yaml # 82 :

  ...
  deprAName:
    $ref: '#/components/schemas/AName'
    deprecated: true
  deprOptionAName:
    $ref: '#/components/schemas/AName'
  ...

(produced with the included testcase EndpointsSpec)

Additional information

Related to fixed #3228 and https://softwaremill.community/t/tapir-redoc-annotations-not-working-as-expected/289/15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants