1

My method names get translated from some_method to apiname.resource.somemethod and gapi.client.apiname.resource.somemethod. Example:

@endpoints.method(messages.VoidMessage, messages.VoidMessage,
name='resource.some_method', path='resource/some_method' )
def resource_some_method(self, request):
    pass    

I've also tested by naming a method with a few underscores in between.

Can this be stopped?

12345
  • 565
  • 7
  • 12

1 Answers1

1

No. Google's API Infrastructure has strict naming guidelines and these are "enforced" by the SDK code. When deploying your application, your API definition is translated into an API configuration file which is sent of to Google's API Infrastructure to spin up a Discovery-based API of your very own.

Before creating this API config, these names are parsed by the endpoints.message_parser library (called from endpoints.api_config) to make sure your names adhere to the specification. In particular:

split_name = re.split(r'[^0-9a-zA-Z]', name)
normalized = ''.join(
    part[0].upper() + part[1:] for part in split_name if part)

You are free to circumvent this code and generate your own API configuration, but the API deployment will fail as those names will be rejected by Google's API Infrastructure when you deploy.

bossylobster
  • 9,993
  • 1
  • 42
  • 61