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

Deprecated fields #1719

Open
liamg opened this issue Dec 13, 2023 · 1 comment
Open

Deprecated fields #1719

liamg opened this issue Dec 13, 2023 · 1 comment

Comments

@liamg
Copy link

liamg commented Dec 13, 2023

Is your feature request related to a problem? Please describe.
I want to mark a field of one of my API models as deprecated, for future removal.

Something like:

type MyModel struct {
  A string `json:"a"`
  B string `json:"b"`
  C string `json:"c" deprecated:"Please use 'MyModel.other' instead"`
  Other string `json:"other"`
} // @MyModel

Describe the solution you'd like
See above! A way of getting the field swagger deprecated parameter set to true, and ideally some kind of deprecation message stored somewhere - perhaps on the field description?

Describe alternatives you've considered
Adding a custom message to the field description, but this doesn't set the deprecated field property.

Additional context
n/a

Happy to PR this in if it's a desirable feature!

@sdghchj
Copy link
Member

sdghchj commented Dec 18, 2023

PR welcome

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

No branches or pull requests

2 participants