Google Cloud endpoints not displaying a map in the API

We are stuck with Google Cloud Endpoints. According to the Google Calendar API explorer ( https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.update ), you should use java.util.Map in the Google API Explorer, as shown below for the "extendedProperties" generic property:

enter image description here

However, when we use Map, it simply appears as “empty” in the API browser, and we cannot add entries to it, as we can in the calendar API:

enter image description here

This is the code for this field:

private java.util.Map<String, String> impactedCustomersPrivate; public Map<String, String> getImpactedCustomersPrivate() { return impactedCustomersPrivate; } public void setImpactedCustomersPrivate(Map<String, String> impactedCustomersPrivate) { this.impactedCustomersPrivate = impactedCustomersPrivate; } 

All other fields of the class, such as strings, long and even lists, work in the API Explorer. In addition, the method with the full map is called from the Javascript client, so the problem is that the map is not visible in the API Explorer.

I studied the source code from the Java client of the Calendar API ( https://developers.google.com/api-client-library/java/apis/calendar/v3/java ) and they use the map for ExtendedProperties, see screenshot:

enter image description here

Plays with annotations and extends GenericJson, but nothing helps.

Does anyone know why the Map does not appear in the API browser? The local dev server does not work and is not deployed to GAE. Calling a method with a regular POST request or Javascript client library works.

Thanks!

+4
source share
1 answer

Indeed, it seems that there are inside parts of Cloud Endpoints upstream that Google does not want to share. However, you may / may not have discovered that you can still enter arbitrary JSON data, just without a fantastic interface.

Just hover over the caption that appears when you are in the payload field and click on “Freeform Editor”:

This allows you to enter any JSON you are damn good, please. Here, to hope that Google will use any code that they use for their interface someday (along with the ability to override small icons in the API browser). enter image description here

0
source

All Articles