Feature: "Deprecated" operations, parameters, properties and types
See original GitHub issueStory
Howdy fellow generator owners! One of our next milestones in providing awesomeness to our customers is a good deprecation story; so RPs have a way to at least warn about removing stuff, ideally long before they do so - AutoRest core also has a new mechanism to create dummy/forwarding properties/types/operations in order to factor out wire breaking changes entirely, but let’s start somewhere.
Your Task
First and foremost: Reference autorest.common >= 2.3.39 and autorest.modeler >= 2.3.47
In your generators, you’ll find a property Deprecated
and DeprecationMessage
on ModelType
, Property
, Parameter
and Method
. If your language has a native notion of deprecation, use it, otherwise do the best you can (e.g. prominent display of the DeprecationMessage
in the inline docs). You are guaranteed that Deprecated == true
exactly if DeprecationMessage != null
, i.e. there is a deprecation message exactly if an entity is deprecated - use that message and do not come up with your own messages! If the messages I give your generator suck, I’d be happy to adjust them.
Related: https://github.com/Azure/autorest/issues/1285
Testing
Here is a everything-covering test Swagger. You generate correct code if:
- all things having “no” in their name are not marked as deprecated in your code
- all things having “yes” in their name are deprecated in your code
- all things having “custom” in their name are deprecated in your code, but with a custom message saying something about “2005”
- all things having “replace” in their name are deprecated in your code, but with a message pointing people towards the “no” entity
PLEASE track your progress below
C#
- methods
- types
- properties
- parameters
Go
- methods
- types
- properties
- parameters
Java
- methods
- types
- properties
- parameters
NodeJS
- methods
- types
- properties
- parameters
PHP
- methods
- types
- properties
- parameters
Python
- methods
- types
- properties
- parameters
Ruby
- methods
- types
- properties
- parameters
TypeScript
- methods
- types
- properties
- parameters
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
Delegating my assignment over to the very capable @jhendrixMSFT and @vladbarosan.
@lmazuel confirm 🙂 Method deprecation was already part of AutoRest since I’m here, just wanna make sure every language supports it - together with the new stuff