Skip to content

Commit 509e3f2

Browse files
kryzthovSimon Zeltser
authored and
Simon Zeltser
committed
Fix AppEngine Endpoints example. (GoogleCloudPlatform#1480)
- Add missing annotation parameter to require API key. - Tiny code fix. Signed-off-by: Christophe Taton <christophe.taton@gmail.com>
1 parent a366fb0 commit 509e3f2

File tree

1 file changed

+4
-2
lines changed
  • appengine/standard/endpoints-frameworks-v2/echo

1 file changed

+4
-2
lines changed

appengine/standard/endpoints-frameworks-v2/echo/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ def echo_path_parameter(self, request):
7474
EchoResponse,
7575
path='echo/getApiKey',
7676
http_method='GET',
77-
name='echo_api_key')
77+
name='echo_api_key',
78+
api_key_required=True)
7879
def echo_api_key(self, request):
79-
return EchoResponse(content=request.get_unrecognized_field_info('key'))
80+
key, key_type = request.get_unrecognized_field_info('key')
81+
return EchoResponse(content=key)
8082

8183
@endpoints.method(
8284
# This method takes an empty request body.

0 commit comments

Comments
 (0)