sdkgen icon indicating copy to clipboard operation
sdkgen copied to clipboard

@deprecated flag

Open dygufa opened this issue 7 years ago • 3 comments

Problem: the need to mark methods as deprecated in order to enforce warning on the clients.

Implementation:

@deprecated($message)
get plansWithPrice()

get fullPlans()

If message is set the client will show it otherwise the message will be: "The method getPlansWithPrice is deprecated"

dygufa avatar Feb 16 '18 14:02 dygufa

Should it be possible to deprecate a field? Or an optional argument?

lbguilherme avatar Feb 17 '18 12:02 lbguilherme

It seems reasonable, but how the deprecation would be communicated to the targets?

Maybe the deprecation could be informed via documentation, but while JSDoc offers support for documenting function parameters, I don't think it supports object fields. Another option would be to deliver class instances instead of plain JS objects, so that the getter of deprecated fields could warn the developer about it, when not on production mode.

I think Swift and JVM support should be easier.

vhfmag avatar Feb 17 '18 14:02 vhfmag

I agree that we should have the deprecated flag for fields as well. It could be implemented on the web by using getters and setters.

dygufa avatar Feb 20 '18 22:02 dygufa