fix(libdocs): asssure candidate is in mapping

It seems nearly nothing can be taken for granted ;).
It's best to just run against a big set of APIs and fix issues as they
arise though.

More flexibility means more maintenance, after all.
This commit is contained in:
Sebastian Thiel
2015-03-10 15:58:39 +01:00
parent 92d8fa76d0
commit 1e332ddb91
2 changed files with 6 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ api:
- civicinfo # no oauth2
- webmasters # no oauth2
- doubleclickbidmanager # no oauth2
- freebase # ERROR
- freebase # no oauth2
- spectrum # no oauth2
- qpxexpress # no oauth2
- discovery # no oauth2

View File

@@ -12,7 +12,11 @@
# fr == fattest resource, the fatter, the more important, right ?
fr = None
if schemas:
fr = sorted(schemas.values(), key=lambda s: (len(c.sta_map.get(s.id, [])), len(s.get('properties', []))), reverse=True)[0]
for candidate in sorted(schemas.values(), key=lambda s: (len(c.sta_map.get(s.id, [])), len(s.get('properties', []))), reverse=True):
if candidate.id in c.sta_map:
fr = candidate
break
# end for each candidate to check
%>\
# Features