Reputation: 2429
I suspect this is caused by the following bug in Endpoints (if valid) but I'm also sure there's a workaround somewhere.
Steps to reproduce:
Frustrated with the above, I decided to start completely from scratch on a new app ID. I still see no API in the API Explorer and get a 404 on the URL in step 7 above!
Here's my endpoint class:
@Api(name = "ditto", version = "v1")
public class CategoryEndpoint extends BaseEndpoint {
@SuppressWarnings("unused")
private static final Logger log = Logger.getLogger(CategoryEndpoint.class.getName());
@ApiMethod(name = "category.list")
public WireCategory list() {
Category root = categoryDao.getRoot();
WireCategory wireRootCategory = new WireCategory(root);
return wireRootCategory;
}
}
And here's the generated .api file:
{
"extends" : "thirdParty.api",
"abstract" : false,
"root" : "https://1.eliot-dev-uk-ditto-do.appspot.com/_ah/api",
"name" : "ditto",
"version" : "v1",
"defaultVersion" : false,
"adapter" : {
"bns" : "https://1.eliot-dev-uk-ditto-do.appspot.com/_ah/spi",
"deadline" : 10.0,
"type" : "lily"
},
"auth" : {
"allowCookieAuth" : false
},
"frontendLimits" : {
"unregisteredUserQps" : -1,
"unregisteredQps" : -1,
"unregisteredDaily" : -1,
"rules" : [ ]
},
"cacheControl" : {
"type" : "no-cache",
"maxAge" : 0
},
"methods" : {
"ditto.category.list" : {
"path" : "list",
"httpMethod" : "GET",
"scopes" : [ ],
"audiences" : [ ],
"clientIds" : [ ],
"rosyMethod" : "ditto.api.CategoryEndpoint.list",
"request" : {
"body" : "empty"
},
"response" : {
"body" : "autoTemplate(backendResponse)"
}
}
},
"descriptor" : {
"schemas" : {
"WireCategory" : {
"id" : "WireCategory",
"type" : "object",
"properties" : {
"webSafePath" : {
"type" : "string"
},
"prettyPath" : {
"type" : "string"
},
"children" : {
"type" : "array",
"items" : {
"$ref" : "WireCategory"
}
},
"path" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"name" : {
"type" : "string"
},
"id" : {
"type" : "string",
"format" : "int64"
}
}
}
},
"methods" : {
"ditto.api.CategoryEndpoint.list" : {
"response" : {
"$ref" : "WireCategory"
}
}
}
}
}
This URL gives me a 404 where I expect to see my API JSON:
https://eliot-dev-uk-ditto-do.appspot.com/_ah/api/discovery/v1/apis/ditto/v1
This is killing me!
EDIT:
Here's a diff I just spotted between the .api file generated by App Engine 1.7.5 and 1.7.6. Not sure why the URLs have changed.
ditto-v1.api from 1.7.6:
{
"extends" : "thirdParty.api",
"abstract" : false,
"root" : "https://1.eliot-dev-uk-ditto-do.appspot.com/_ah/api",
"name" : "ditto",
"version" : "v1",
"defaultVersion" : false,
"adapter" : {
"bns" : "https://1.eliot-dev-uk-ditto-do.appspot.com/_ah/spi",
"deadline" : 10.0,
"type" : "lily"
}
...
ditto-v1.api from 1.7.5:
{
"extends" : "thirdParty.api",
"abstract" : false,
"root" : "https://eliot-dev-uk-ditto-do.appspot.com/_ah/api",
"name" : "ditto",
"version" : "v1",
"defaultVersion" : false,
"adapter" : {
"bns" : "http://eliot-dev-uk-ditto-do.appspot.com/_ah/spi",
"deadline" : 10.0,
"type" : "lily"
}
...
Upvotes: 4
Views: 3360
Reputation: 18741
As you already pointed out, it was due to an weird issue in SDK 1.7.6, which adds that 1.
at the beginning of the endpoint root url in the .api files...
I've tried the new SDK 1.7.7 and it seems to be solved...
Upvotes: 2