Coder Social home page Coder Social logo

reform-api-standards's Introduction

Deprecation of APIs or API endpoints

Build Status

Added an annotation named @APIDeprecated for classes and methods that add warning headers to the responses generated by the API.

A typical usage would be to add the @APIDeprecated annotation to a method as in the following example.

    @RequestMapping("/deprecated")
    @APIDeprecated(name = "Deprecated Endpoint",
            date = "01/06/2018",
            link = "https://example.org/docs/api/deprecated/",
            note = "Just a note, upgrade your client code!!!")
    public String deprecated() {
        return "Greetings from deprecated Class Controller!";
    }

The annotation has the attributes that are used for forming a Warning header.

  • name for friendly name of the endpoint,
  • expireDate for the date which the endpoint will cease to serve,
  • docLink for the details of documentation regarding the API updates
  • note for optional notes to the clients

A sample of the Warning header is as follows:

warning →The UserProfileEndpoint is deprecated and will be removed by 20/09/2017. Please see https://example.org/docs/api/deprecated/ for details. Just note that

It is possible to add the @APIDeprecated annotation on top of a @Controller class to deprecate all the endpoints served by that @Controller at once.

@RestController
@APIDeprecated(name = "Deprecated API set",
        expireDate = "30/09/2018",
        docLink = "https://example.org/docs/api/deprecated/",
        note = "Just a note, upgrade your client code!!!")
public class DeprecatedClassController {

    @RequestMapping("/depclass")
    public String deprecated() {
        return "Greetings from deprecated Class Controller!";
    }

}

reform-api-standards's People

Contributors

calinmarina avatar jasonpaige avatar jenkins-reform-hmcts avatar karoljastrzebski avatar rkondratowicz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.