I have an Android-Application project and an AppEngine-BackEnd project which serves as the back-end for the android app. I use Google Plugin to generate client libraries for the android client from the appengine project.
The AppEngine-BackEnd defines an endpoint 'AppEndPoint'. I've published the first version of the android app and appengine app.
Now I want to make some modifications to the endpoint eventually changing the API version to 'v2'.
What I did
In AppEngine project I duplicated the existing AppEndPoint class and renamed it to AppEndPointV2 and made required modifications to the new class. Also annotated the new class with version="v2". When I deployed the app could see both v1 and v2 versions available in the API explorer as expected.
Now when I generate the client libraries with the Google Plugin (Eclipse) for the android app it exports both v1 and v2 and it generates error "The type Appendpoint is already defined"
I expect only v2 to be present in the newly exported client library. So from this I feel there's something wrong in my approach. I searched a lot over the web and StackOverflow. But couldn't get the exact way to do this. Mainly searching was a bit difficult because the keywords 'endpoint', 'api', 'version' etc are very generic.
What I want
- My existing (already published client app) should still be able to access v1 of the API.
- The new app should be using v2
So I would like to know
- What is the recommended way to maintain different versions of an endpoint API. How the classes are to be written. Is duplicating the endpoint class on each version of the API and making changes to it the recommended way?
- How I can tell the plugin that I want only v2 of the endpoint to be exported to the endpoint client library?
Note : I'm using AppEngine-JAVA and eclipse is the IDE