softwaremill / tapir

Rapid development of self-documenting APIs

Home Page:https://tapir.softwaremill.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Improvement] add support of scala.deprecated annotation on OpenAPI generation

lgmyrek opened this issue · comments

There is already support for marking deprecated fields with: sttp.tapir.Schema.annotations.deprecated, but I THINK it would be nice to support native scala deprecated annotation.
Why duplicate annotations / manually add deprecated param to API for already marked field.

Could be configurable.

Yes, we thought about that (can't find the issue / discussion of course ;) ), but I think we arrived at the conclusion that a deprecated field / parameter in OpenAPI doesn't have to be deprecated in Scala code. You might have a field in the API's model that is deprecated (shouldn't be used by clients), but since clients are still using it, it has to be properly supported in code. Then it's not really deprecated in the code - it's still "valid" code that is actively used by clients - and it should be used as long as the API is in place.