google-app-engine - GAE Cloud Endpoints API Explorer 停止工作

标签 google-app-engine go google-cloud-endpoints

API 浏览器 (localhost:8080/_ah/api/explorer) 突然停止工作。这是“goapp serve”给出的消息:

WARNING  2015-12-15 17:54:24,744 dispatcher.py:762] Skipping dispatch.yaml rules because /_ah/spi/BackendService.getApiConfigs is not a dispatchable path.
2015/12/15 17:54:24 DEBUG: SPI request body: {}
INFO     2015-12-15 17:54:24,746 module.py:787] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2619
ERROR    2015-12-15 17:54:25,706 discovery_api_proxy.py:59] Discovery API proxy failed on /_ah/api/discovery/v1/apis/generate/directory with 400.
Request: {"configs": ["{\"name\": \"test\", \"abstract\": false, \"methods\": {\"test.load_test_data\": {\"path\": \"testData\", \"response\": {\"body\": \"empty\"}, \"rosyMethod\": \"TestAPI.LoadTestData\", \"request\": {\"body\": \"empty\"}, \"httpMethod\": \"POST\"}, \"test.test\": {\"path\": \"test\", \"response\": {\"body\": \"autoTemplate(backendResponse)\", \"bodyName\": \"resource\"}, \"rosyMethod\": \"TestAPI.Test\", \"request\": {\"body\": \"empty\"}, \"httpMethod\": \"GET\"}, \"test.showdata4\": {\"path\": \"showdata4\", \"response\": {\"body\": \"autoTemplate(backendResponse)\", \"bodyName\": \"resource\"}, \"rosyMethod\": \"TestAPI.ShowData4\", \"request\": {\"body\": \"autoTemplate(backendRequest)\", \"bodyName\": \"resource\"}, \"httpMethod\": \"POST\"}, \"test.showdata\": {\"path\": \"showdata\", \"response\": {\"body\": \"autoTemplate(backendResponse)\", \"bodyName\": \"resource\"}, \"rosyMethod\": \"TestAPI.ShowData\", \"request\": {\"body\": \"empty\"}, \"httpMethod\": \"GET\"}, \"test.showdata3\": {\"path\": \"showdata3\", \"response\": {\"body\": \"autoTemplate(backendResponse)\", \"bodyName\": \"resource\"}, \"rosyMethod\": \"TestAPI.ShowData3\", \"request\": {\"body\": \"empty\"}, \"httpMethod\": \"GET\"}, \"test.showdata2\": {\"path\": \"showdata2\", \"response\": {\"body\": \"autoTemplate(backendResponse)\", \"bodyName\": \"resource\"}, \"rosyMethod\": \"TestAPI.ShowData2\", \"request\": {\"body\": \"empty\"}, \"httpMethod\": \"GET\"}}, \"descriptor\": {\"methods\": {\"TestAPI.ShowData2\": {\"response\": {\"$ref\": \"OutputResp\"}}, \"TestAPI.ShowData3\": {\"response\": {\"$ref\": \"OutputResp\"}}, \"TestAPI.ShowData4\": {\"request\": {\"$ref\": \"InputReq\"}, \"response\": {\"$ref\": \"OResp\"}}, \"TestAPI.Test\": {\"response\": {\"$ref\": \"OutputResp\"}}, \"TestAPI.LoadTestData\": {}, \"TestAPI.ShowData\": {\"response\": {\"$ref\": \"OutputResp\"}}}, \"schemas\": {\"ValueResp\": {\"type\": \"object\", \"id\": \"ValueResp\", \"properties\": {\"attrs\": {}, \"value\": {\"type\": \"string\"}}}, \"OResp\": {\"type\": \"object\", \"id\": \"OResp\", \"properties\": {\"entries\": {\"items\": {\"$ref\": \"ItemResp\"}, \"type\": \"array\"}}}, \"OutputResp\": {\"type\": \"object\", \"id\": \"OutputResp\", \"properties\": {\"text\": {\"type\": \"string\"}}}, \"InputReq\": {\"type\": \"object\", \"id\": \"InputReq\", \"properties\": {\"text\": {\"type\": \"string\"}}}, \"ItemResp\": {\"type\": \"object\", \"id\": \"ItemResp\", \"properties\": {\"values\": {\"items\": {\"$ref\": \"ValueResp\"}, \"type\": \"array\"}}}}}, \"version\": \"v1\", \"extends\": \"thirdParty.api\", \"defaultVersion\": true, \"root\": \"http://localhost:8082/_ah/api\", \"adapter\": {\"bns\": \"http://localhost:8082/_ah/spi\", \"type\": \"lily\"}, \"description\": \"test api\"}"]}
Response: {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Value"
   }
  ],
  "code": 400,
  "message": "Invalid Value"
 }
}

ERROR    2015-12-15 17:54:25,706 discovery_service.py:141] Failed to get API directory
INFO     2015-12-15 17:54:25,706 module.py:787] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 404 9

我的应用程序 (localhost:8080) 也无法运行,出现同样的问题。

最佳答案

我在服务的响应中传递了一张 map ,但它不喜欢那样。只允许 slice 和结构。

关于google-app-engine - GAE Cloud Endpoints API Explorer 停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34296456/

相关文章:

python - 当我的 Flask 应用程序在内存中部署新文件时,为什么会返回 500 服务器错误?

java - 如何通过 ResourceBundle 在资源属性中使用 UTF-8

google-app-engine - 在 Mac 上使用 App Engine 时出现问题 Java JRE

mongodb - Go mgo 包中的连接池

android - 谷歌云端点 : verifyToken: Signature length not correct

python - 使用 db.ReferenceProperty 引用 Google App Engine 中的其他表

postgresql - Golang - pgbouncer 和事务使用

docker - 如何通过golang获取容器ID

java - Google Cloud Endpoints 与 Cloud Datastore api 服务之间的比较

java - Cloud Endpoints 为作为命名参数传递的特殊字符生成 HTTP 404