question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature: "Deprecated" operations, parameters, properties and types

See original GitHub issue

Story

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:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marstrcommented, Jan 22, 2018

Delegating my assignment over to the very capable @jhendrixMSFT and @vladbarosan.

1reaction
olydiscommented, Jan 22, 2018

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removed or deprecated platform features
This article describes features that have been removed, or that are planned for removal in platform updates of finance and operations apps.
Read more >
Behavior Changes, Deprecated and Desupported Features ...
Review for information about Oracle Database 19c changes, deprecations, and desupports, as well as deprecations and desupports in Oracle ...
Read more >
Deprecated features
A feature is not removed until at least two full years from the release in which that feature is deprecated. In rare cases,...
Read more >
Features Deprecated in Denodo Platform 8.0
This parameter is deprecated because in Denodo 7.0 its default value is true and there is no reason to set it to false....
Read more >
Deprecated and obsolete features - JavaScript - MDN Web Docs
Function · The caller property of functions and the arguments.callee property are deprecated and unavailable in strict mode. · Instead of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found