Message Boards

Api Versioning in Liferay

Pankaj Kumar, modified 4 Years ago.

Api Versioning in Liferay

Regular Member Posts: 101 Join Date: 7/27/14 Recent Posts
Hi All,Does Liferay support Api versioning  as we are using Lifeary 6.2
Thanks,Pankaj Semwal
thumbnail
Christoph Rabel, modified 4 Years ago.

RE: Api Versioning in Liferay

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
Can you be a bit more specific here?

If you are talking about "rest api versioning", well, with 6.2 you are more or less out of luck. You probably can implement some workarounds, if you have only minor changes, but each time, you execute Service Builder, the old interface is just replaced with the new one.
Pankaj Kumar, modified 4 Years ago.

RE: Api Versioning in Liferay

Regular Member Posts: 101 Join Date: 7/27/14 Recent Posts
Yes are are creating rest webservice in Liferay 6.2 and these services are being consumed in Mobile App .Let say we have one service showEmployee() and further if we made change in these service then we want our client part should  not break.
thumbnail
Christoph Rabel, modified 4 Years ago.

RE: Api Versioning in Liferay

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
In 6.2 you are more or less out of luck.
There are really ugly hacks I could think of to solve your problem, but IMHO your best option is to just add new functions and document them. If you have just a few functions, you could add a showEmployee_v2() method, as ugly as it is, and work with that.
Of course, this will only work for simpler, only additive changes, but in 6.2 your options are limited.