Skip to content

Commit

Permalink
Add catch-all to get_path_list for future assumption-breaking APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Deconstrained committed Jan 5, 2024
1 parent c88ecc3 commit dcdd7ff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/get_path_list/get_path_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
'/tags/{id}/'+et for et in ('users', 'teams', 'escalation_policies')
]
}
# ...And finally, if the API in question ALSO doesn't follow the classic entity
# wrapping convention (where the end of the URL is the same as the entity
# wrapper name) and for any reason the API cannot be updated to follow said
# convention, please consider adding it to the following list-of-shame in order
# to avoid generating confusing errors for the end user.
UNSUPPORTED_PATHS = []

import sys
from yaml import load, dump
Expand All @@ -51,6 +57,8 @@ def main():

print('CANONICAL_PATHS = [')
for path in public_endpoints:
if path in UNSUPPORTED_PATHS:
continue
print_paths = EXPAND_PATHS.get(path, [path])
for path in print_paths:
print(f" '{path}',")
Expand Down

0 comments on commit dcdd7ff

Please sign in to comment.