Skip to content

Commit b90956d

Browse files
erlichmenJon Wayne Parrott
authored andcommitted
fix echo_api_key (GoogleCloudPlatform#678)
echo_api_key was not implemented correctly (looks like a cut and paste bug). I discover this when trying to follow the instructions[1] on how to implement cloud endpoints on AppEngine standard. and the following command failed: python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com with: endpoints.api_exceptions.ApiConfigurationError: POST path "echo" used multiple times, in classes EchoApi and EchoApi [1] https://cloud.google.com/endpoints/docs/frameworks/python/quickstart-frameworks-python
1 parent 0b83984 commit b90956d

File tree

1 file changed

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

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,15 @@ def echo_path_parameter(self, request):
6969

7070
@endpoints.method(
7171
# This method takes a ResourceContainer defined above.
72-
ECHO_RESOURCE,
72+
message_types.VoidMessage,
7373
# This method returns an Echo message.
7474
EchoResponse,
75-
path='echo',
76-
http_method='POST',
75+
path='echo/getApiKey',
76+
http_method='GET',
7777
name='echo_api_key',
7878
api_key_required=True)
7979
def echo_api_key(self, request):
80-
output_content = ' '.join([request.content] * request.n)
81-
return EchoResponse(content=output_content)
80+
return EchoResponse(content=request.get_unrecognized_field_info('key'))
8281

8382
@endpoints.method(
8483
# This method takes an empty request body.

0 commit comments

Comments
 (0)