From dd4c26cb00edad8d33a9af9da385c55332b37c61 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Sun, 28 Sep 2014 15:40:08 -0400 Subject: [PATCH] Only operations with nicknames can be added to the swagger doc --- endpoints/api/discovery.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/endpoints/api/discovery.py b/endpoints/api/discovery.py index 1995c6b42..c3525639f 100644 --- a/endpoints/api/discovery.py +++ b/endpoints/api/discovery.py @@ -125,7 +125,11 @@ def swagger_route_data(include_internal=False, compact=False): new_operation['requires_fresh_login'] = True if not internal or (internal and include_internal): - operations.append(new_operation) + # Swagger requires valid nicknames on all operations. + if new_operation.get('nickname'): + operations.append(new_operation) + else: + logger.debug('Operation missing nickname: %s' % method) swagger_path = PARAM_REGEX.sub(r'{\2}', rule.rule) new_resource = {