GAE Cloud Endpoints API Explorer停止工作 [英] GAE Cloud Endpoints API Explorer stopped working

查看:132
本文介绍了GAE Cloud Endpoints API Explorer停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然间,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请求正文:{}
INFO 2015-12-15 17:54:24,746 module.py:787] default:POST / _ah / spi / BackendService.getApiConfigs HTTP / 1.1200 2619
ERROR 2015-12-15 17:54:25,706 discovery_api_proxy.py:59]发现API代理在/ _ah / api / discovery / v1 / apis / generate /目录为400.
请求:{configs:[{\name \:\test \,\abstract\:false,\methods\ :{\test.load_test_data \:{\path \:\testData \,\response \:{\body \:\空\\,\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.s howdata3 \:{\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 \:{\ty pe \:\object \,\id \:\OutputResp \,\properties \:{\text \:{\ type \:\string \}}},\InputReq \:{\type \:\object \,\id \:\\ \\Input \ \,\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:无效值
}
],
code:400,
消息:无效值
}
}

错误2015-12-15 17:54:25,706 discovery_service.py:141]无法获取API目录
INFO 2015-12-15 17:54:25,706 module.py:787] default:GET / _ah / api / discovery / v1 / apis HTTP / 1.1404 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.

解决方案

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

这篇关于GAE Cloud Endpoints API Explorer停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆