sdkgen
sdkgen copied to clipboard
@deprecated flag
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"
Should it be possible to deprecate a field? Or an optional argument?
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.
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.