January 2019
Intermediate to advanced
378 pages
11h 35m
English
The major and minor version changes can be a part of the URI, for example, to represent v1 or v2 of the API the URI can be http://localhost:9090/v1/investors or http://localhost:9090/v2/investors, respectively.
The code implementation of the URI path versioning within our investor service examples is shown in the following code snippet:
@GetMapping({"/v1/investors","/v1.1/investors","/v2/investors"}) public List<Investor> fetchAllInvestors() { return investorService.fetchAllInvestors(); }
The output of this code is as follows:

The preceding screenshot shows the Postman execution of the URI path-versioning example. ...
Read now
Unlock full access