Make api.generateDiscoveryDocument more robust.
Make api.generateDiscoveryDocument more robust.

Ensure the baseUrl always ends with a '/'.

R=sgjesse@google.com, kustermann@google.com
BUG=

Review URL: https://codereview.chromium.org/936613005

dart-archive/rpc,FaisalAbid/rpc,enyo/rpc,andresaraujo/rpc