Is there a way show Java Endpoint @ApiMethod descriptions into the Api Explorer?

57 views
Skip to first unread message

Marc-Andre Bruneau

unread,
Feb 23, 2016, 12:28:23 AM2/23/16
to Google App Engine, Martin Guay
Hi,

Is there a way to have Google Cloud Endpoint generate APIs along with descriptions for each exposed @ApiMethod or each field, and have those explosed in the api-explorer, exactly like Google does for every single of their APIs. 

There are no attribute "description" allowed with the ApiMethod annotation.. Although, when I look at the Google discovery files of each Google APIs, via the API Discovery Service (discovery.apis.getRest), they contain attributes that I can't seem to be able to generate automatically. Almost like if the only way for me to generate @ApiMethod descriptions into the api-explorer is to manually edit the discovery document, post-build...

Has anybody experienced this issue / limitation?

Any guidance will be helpful.

Thanks

----------------

This is an snippet of the calendar v3 discovery document containing the fields that I can't generate automatically using the standard Annotations.. It seems that Google is able to document members of their object model and explose those descriptions into the Api Explorer too... Not just ApiMethods.

"AclRule": {
"id": "AclRule",
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "ETag of the resource."
},
"id": {
"type": "string",
"description": "Identifier of the ACL rule."
},
"kind": {
"type": "string",
"description": "Type of the resource (\"calendar#aclRule\").",
"default": "calendar#aclRule"
},
"role": {
"type": "string",
"description": "The role assigned to the scope. Possible values are: \n- \"none\" - Provides no access. \n- \"freeBusyReader\" - Provides read access to free/busy information. \n- \"reader\" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. \n- \"writer\" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. \n- \"owner\" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs.",
"annotations": {
"required": [
"calendar.acl.insert"
]
}
},

...

"insert": {
"id": "calendar.calendarList.insert",
"path": "users/me/calendarList",
"httpMethod": "POST",
"description": "Adds an entry to the user's calendar list.",
"parameters": {
"colorRgbFormat": {
"type": "boolean",
"description": "Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False.",
"location": "query"
}
},

....
calendar-api.jpg
calendar-api-fields.jpg

Nicholas (Google Cloud Support)

unread,
Feb 23, 2016, 3:04:29 PM2/23/16
to Google App Engine, mar...@booxi.com
Thank you for posting. Such annotations for Endpoints methods are not currently supported. This however, is not the first time this feature is requested. I would strongly suggest starring the related Endpoints feature request Issue 9184: Endpoints, support more annotations to augment this feature request's visibility and priority.

The workaround you describe is likely the only viable solution for you at the moment.
Reply all
Reply to author
Forward
0 new messages