GAE Cloud Endpoints API Explorer停止工作了。

huangapple go评论72阅读模式
英文:

GAE Cloud Endpoints API Explorer stopped working

问题

莫名其妙地,API浏览器(localhost:8080/_ah/api/explorer)停止工作了。这是"goapp serve"给出的消息:

警告  2015-12-15 17:54:24,744 dispatcher.py:762] 跳过dispatch.yaml规则,因为/_ah/spi/BackendService.getApiConfigs不是可分派的路径。
2015/12/15 17:54:24 DEBUG: SPI请求体: {}
信息     2015-12-15 17:54:24,746 module.py:787] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2619
错误    2015-12-15 17:54:25,706 discovery_api_proxy.py:59] 在/_ah/api/discovery/v1/apis/generate/directory上的发现API代理失败,返回400。
请求: {"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\"}"]}
响应: {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Value"
   }
  ],
  "code": 400,
  "message": "Invalid Value"
 }
}

错误    2015-12-15 17:54:25,706 discovery_service.py:141] 获取API目录失败
信息     2015-12-15 17:54:25,706 module.py:787] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 404 9

我的应用程序(localhost:8080)也无法工作,出现相同的问题。

英文:

Out of the blue, the API explorer (localhost:8080/_ah/api/explorer) stopped working. This is the message 'goapp serve' gives:

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

My app (localhost:8080) does not work either, with the same problem.

答案1

得分: 1

我在服务的响应中传递了一个映射(map),但它不喜欢那样做。只允许使用切片(slices)和结构体(structs)。

英文:

I was passing a map in the response of a service, and it did not like that. Only slices and structs are allowed.

答案2

得分: 0

API端点的名称不能包含大写字母。更改名称应该可以解决这个问题。

英文:

Name of the api endpoint cannot contain Upper Case letters. Changing the name should resolve the issue.

huangapple
  • 本文由 发表于 2015年12月16日 02:11:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/34296456.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定