How to perform versioning the Restlet API using Java?

Forum for users and developers of Bullhorn's API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
Posts: 1
Joined: Mon Apr 20, 2015 1:29 am

How to perform versioning the Restlet API using Java?

Post by Geetha »


I have to do API versioning. I am using REST APIs with Restlet framework. I am confused how to implement the versioning in Java Source code.

If my API looks like this : http://localhost:8080/
Then In my source code how to map the version with appropriate functionality?
For example :
If(version == 1) {//Do Version 1 Source Code}
else If(version == 2) {//Do Version 2 Source Code}
else If(version == 3) {//Do Version 3 Source Code} ………..
If I did like this, Then why we are going for Versioning. We can implement Manually Right? And also If I have to add some 100 versions, then the code looks uglier and it becomes lengthier.
I get confused how to map in Source Code. Please Clarify my doubt.

Post Reply