我们一直坚持使用Google Cloud Endpoints。根据Google Calendar API资源管理器(https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.update),应该可以在Google API资源管理器中使用java.util.Map,如下所示,共享' &属性的属性':
然而,当我们使用地图时,它只是显示为“空”'在API资源管理器中,我们无法像在Calendar API中那样添加条目:
这是该字段的代码:
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,请参见屏幕截图:
使用注释并扩展GenericJson,但没有任何帮助。
有没有人知道为什么地图没有出现在API资源管理器中?不使用本地开发服务器,也不在GAE上部署。使用常规POST请求或Javascript客户端库调用该方法,它可以正常工作。
谢谢!