エラー: ApiConfigurationError:互換性のない複数のクラスを含むサービスエコー、バージョンv2の実装を試みています。マルチクラスAPIの実装方法の例については、docstring for api()を参照してください。Google Cloud Endpoints V2のマルチクラスAPIエラーApp Engine標準
コード:バージョン= 'V2' が追加される(EchoApi2)
エラーコード:
import logging
import endpoints
from protorpc import message_types
from protorpc import messages
from protorpc import remote
class EchoRequest(messages.Message):
content = messages.StringField(1)
class EchoResponse(messages.Message):
content = messages.StringField(1)
ECHO_RESOURCE = endpoints.ResourceContainer(
EchoRequest, n=messages.IntegerField(2, default=1))
@endpoints.api(name='echo', version='v1',description='description')
class EchoApi(remote.Service):
@endpoints.method(
# This method takes a ResourceContainer defined above.
ECHO_RESOURCE,
# This method returns an Echo message.
EchoResponse,
path='echo',
http_method='POST',
name='echo')
def echo(self, request):
logging.info("echo1"+ str(request.content))
output_content = ' '.join([request.content] * request.n)
return EchoResponse(content=output_content)
@endpoints.api(name='echo', version='v2', description='description2')
class EchoApi2(remote.Service):
@endpoints.method(
# This method takes a ResourceContainer defined above.
ECHO_RESOURCE,
# This method returns an Echo message.
EchoResponse,
path='echo',
http_method='POST',
name='echo')
def echo(self, request):
logging.info("echo2" + str(request.content))
output_content = ' '.join([request.content] * request.n)
return EchoResponse(content=output_content)
api = endpoints.api_server([EchoApi, EchoApi2])
GOOD場合にのみ次の場合、バージョン= V1 ''(EchoApi)
ERROR :ApiConfigurationError:互換性のない複数のクラスを持つバージョンv2のサービスエコーを実装しようとしています。マルチクラスAPIの実装方法の例については、docstring for api()を参照してください。
ありがとうございます。