Learn Api Versioning in Spring Rest
Go Back to Course Outline Repositories https://github.com/terawarehouse/terawarehouse-catalog https://github.com/terawarehouse/tera...
https://www.czetsuyatech.com/2019/08/spring-rest-api-versioning.html
Repositories
- https://github.com/terawarehouse/terawarehouse-catalog
- https://github.com/terawarehouse/terawarehouse-react
- By URL
- By params
- By headers
- By produces or Accept header
In my previous company, we keep backward compatibility of the API to 3 major releases and that spell disaster without the proper planning and migration of data and models. In our example, we have a complete name save as a string, but in version 2 we created a Name model that contains firstName and lastName.
To demonstrate some examples.
[open DealerVersionController class]
Now let’s start testing them. Open the file:
src/test/resources/TerawarehouseCatalog.postman_collection in Postman and play with the tests inside the versioning folder.
Post a Comment