Skip to content

Commit 1e332dd

Browse files
committed
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.
1 parent 92d8fa7 commit 1e332dd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

etc/api/shared.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ api:
1919
- civicinfo # no oauth2
2020
- webmasters # no oauth2
2121
- doubleclickbidmanager # no oauth2
22-
- freebase # ERROR
22+
- freebase # no oauth2
2323
- spectrum # no oauth2
2424
- qpxexpress # no oauth2
2525
- discovery # no oauth2

src/mako/lib/lib.mako

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
# fr == fattest resource, the fatter, the more important, right ?
1313
fr = None
1414
if schemas:
15-
fr = sorted(schemas.values(), key=lambda s: (len(c.sta_map.get(s.id, [])), len(s.get('properties', []))), reverse=True)[0]
15+
for candidate in sorted(schemas.values(), key=lambda s: (len(c.sta_map.get(s.id, [])), len(s.get('properties', []))), reverse=True):
16+
if candidate.id in c.sta_map:
17+
fr = candidate
18+
break
19+
# end for each candidate to check
1620
%>\
1721
# Features
1822

0 commit comments

Comments
 (0)