Respectful REST APIs – ‘Sunset’ and ‘Deprecation’ HTTP Headers

by | Sep 24, 2021 | Voxxed Days Romania 2021

Horațiu Dan is a Software Craftsman and R&D Software Engineer with 15+ years of experience in software development and in telecommunications industry, striving to improve every day while trying to help the others improve as well.

The talk aims to describe how a service provider can leverage the newly adopted ‘Sunset’ and ‘Deprecation’ HTTP headers while implementing RESTful web services.

The purpose is to come closer to the clients interacting with the exposed services and provide them with more pieces of information that makes the interaction more intuitive in case of the following technical situations:

– Temporary Resources Handling

– Resources Retention

– Resources Deprecation

Currently, the most common REST API implementations are those conforming to Level 2 (according to the Richardson Maturity Model) which most of the times fully solve the required business problems and thus are enough. A Level 3 one on the other hand, allows a service provider making a better promise to its customers, if for certain business use cases additional pieces of information (hints) are provided. If leveraged, these might make the contract between the two go even smoother. This talk describes how such hints can be transmitted to clients via the optional but useful ‘Sunset’ and ‘Deprecation’ HTTP Headers.

The solution implemented to exemplify the above scenarios uses the following: Java 11, Spring Boot, Spring HATEOAS, Apache Maven.