I've create a simple API with Google Cloud Endpoints. Now, I want to create a new version for this API.
I have the following classes:
@Api(name = "helloworld",
version = "v1")
public class HelloWorldApi {
@ApiMethod(name = "sayHello", path = "/sayHello", httpMethod = "get")
public HelloWorld SayHello(){
return new HelloWorld("Hello World v1");
}
}
and
@Api(name = "helloworld",
version = "v2")
public class HelloWorldApiV2 {
@ApiMethod(name = "sayHello", path = "/sayHello", httpMethod = "get")
public HelloWorld SayHello(){
return new HelloWorld("Hello World v2");
}
}
I then deploy and go to [myapplication].appspot.com/_ah/api/explorer. Here, I can see both versions in "All Versions" with "v2" as the default.
The problem is that it doesn't matter which one I use. They both return either "Hello World v1" or "Hello World v2" randomly.
What am I doing wrong?