Google Cloud Endpoints未在API资源管理器中显示地图

时间:2015-08-17 12:34:42

标签: java google-app-engine google-calendar-api google-cloud-endpoints

我们一直坚持使用Google Cloud Endpoints。根据Google Calendar API资源管理器(https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.update),应该可以在Google API资源管理器中使用java.util.Map,如下所示,共享' &属性的属性':

enter image description here

然而,当我们使用地图时,它只是显示为“空”'在API资源管理器中,我们无法像在Calendar API中那样添加条目:

enter image description here

这是该字段的代码:

private java.util.Map<String, String>  impactedCustomersPrivate;

public Map<String, String> getImpactedCustomersPrivate() {
    return impactedCustomersPrivate;
}

public void setImpactedCustomersPrivate(Map<String, String> impactedCustomersPrivate) {
    this.impactedCustomersPrivate = impactedCustomersPrivate;
}

类中的所有其他字段,如字符串,长整数,甚至是List,都在API Explorer中按预期工作。此外,从Javascript客户端调用带有完整Map的方法是有效的,所以问题实际上只是从API浏览器中看不到Map。

我一直在查看Calendar API Java客户端(https://developers.google.com/api-client-library/java/apis/calendar/v3/java)中的源代码,他们使用Map for ExtendedProperties,请参见屏幕截图:

enter image description here

使用注释并扩展GenericJson,但没有任何帮助。

有没有人知道为什么地图没有出现在API资源管理器中?不使用本地开发服务器,也不在GAE上部署。使用常规POST请求或Javascript客户端库调用该方法,它可以正常工作。

谢谢!

1 个答案:

答案 0 :(得分:0)

事实上,似乎Google上游的云端点的内部部分是谷歌选择不共享的。与此同时,您可能/可能没有发现您仍然可以输入任意JSON数据,只是没有花哨的UI。

将鼠标悬停在有效负载框中显示的缺口上,点击“自由格式编辑器”:

这可以让你输入任何你该死的JSON。这是希望Google有一天可以共享他们用于UI的任何代码(以及覆盖API资源管理器中的小图标的方法)。 enter image description here