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 have no effect on Option types #1920

Closed
chessman opened this issue Mar 5, 2022 · 0 comments · Fixed by #2026
Closed

[BUG] Annotations have no effect on Option types #1920

chessman opened this issue Mar 5, 2022 · 0 comments · Fixed by #2026
Assignees
Milestone

Comments

@chessman
Copy link

chessman commented Mar 5, 2022

Tapir version: 0.20.1

Scala version: 2.12.15

Describe the bug

Annotations have no effect on Option types.

How to reproduce?

  case class A(s: String)
  case class Input(
    @encodedExample(A("a").asJson)
    @default(A("a"), Some("a"))
    a: Option[A]
  )

It generates schema without default and example fields:

components:
  schemas:
    A:
      required:
      - s
      type: object
      properties:
        s:
          type: string

Additional information

It doesn't work for case classes but works for Option[String].

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

Successfully merging a pull request may close this issue.

3 participants