문제

In Python I'm creating backend for my Android app. My code is too big so I broke it to 2 files with functions and one with shared classes (shared_classes.py) which inherit from messages.Message.

When I generate client library, all classes get prefixed with name of the python file I stored them in (they look like: SharedClassesExampleName.java).

Is it possible to force endpointscfg.py to stop generating library with prefixed python classes?

도움이 되었습니까?

해결책 2

As described on this page (in step no. 4)

The "package=" line is used by the underlying ProtoRpc when creating names for the ProtoRPC messages you create. This package name will show up as a prefix to your message class names in the discovery doc and client libraries.

So you if you encounter this problem just add package=' ' (empty value) and your classes will not be prefixed.

다른 팁

customize the API method name with

@endpoints.method(name='subject.action')

and API class with

name = "appname"

your API will be accessible at

gapi.client.appname.subject.action()

check details at https://developers.google.com/appengine/docs/python/endpoints/getstarted/backend/write_api

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top