We are deprecating the REST service and we want to inform the client about this. what is the best practice followed?
I can think of following options
Could you please share your ideas?
While deprecated classes, methods, and fields are still implemented, they may be removed in future implementations, so you should not use them in new code, and if possible rewrite old code not to use them.
Deprecation warnings are a common thing in our industry. They are warnings that notify us that a specific feature (e.g. a method) will be removed soon (usually in the next minor or major version) and should be replaced with something else.
Obsoleted: This API method is no longer used, but might still be backwards compatible. In the API Reference, these are indicated as follows: public int getDeviceKnoxId () This method is deprecated. Not supported: This API method will no longer work, and should be removed from apps.
Starting with J2SE 5.0, you deprecate a class, method, or field by using the @Deprecated annotation. Additionally, you can use the @deprecated Javadoc tag tell developers what to use instead. Using the annotation causes the Java compiler to generate warnings when the deprecated class, method, or field is used.
I would not change anything in the status code or in the service response to be backward compatible. I would add a "Warning" header in the response.
Warning: 299 - "Deprecated API"
You could also check this (old) response: https://softwareengineering.stackexchange.com/questions/55081/deprecate-a-web-api-best-practices
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With