chore(manually_added): Add support for adding unlisted APIs

The photoslibrary API is not listed however is still available.
This adds a method of manually adding APIs to the shared.yaml and adds the photoslibary API info.

Fixes #198
This commit is contained in:
Guy Taylor
2018-09-27 16:40:40 +01:00
parent 4ba9dbd03c
commit 4603769ca6
2 changed files with 12 additions and 0 deletions

View File

@@ -29,6 +29,10 @@ api:
- slides
# invalid code generation - syntax error
- poly
manually_added:
- name: photoslibrary
version: v1
discovery_rest_url: https://photoslibrary.googleapis.com/$discovery/rest?version=v1
terms:
# how to actually do something with the API
action: doit

View File

@@ -22,6 +22,14 @@
discovery_url = 'https://www.googleapis.com/discovery/v1/'
apis = json.loads(urllib2.urlopen(discovery_url + "apis").read())
for manualy_api in api.get('manually_added', list()):
apis['items'].append({
'name': manualy_api['name'],
'version': manualy_api['version'],
'discoveryRestUrl': manualy_api['discovery_rest_url']
})
json_api_targets = []
suffix = make.target_suffix