Commit b27c2659 authored by Matthieu Lamalle's avatar Matthieu Lamalle

Change on controller for api description

parent 047f2680
...@@ -8,7 +8,7 @@ from autobahn.wamp.exception import ApplicationError ...@@ -8,7 +8,7 @@ from autobahn.wamp.exception import ApplicationError
from zephir.controller import ZephirCommonController, run from zephir.controller import ZephirCommonController, run
from zephir.http import register from zephir.http import register
from zephir.message import list_messages, get_message, get_messages from zephir.message import list_messages, get_message
from apibridge import get_messages from apibridge import get_messages
from zephir.i18n import _ from zephir.i18n import _
...@@ -30,6 +30,10 @@ class ApiBridgeCtrl(ZephirCommonController): ...@@ -30,6 +30,10 @@ class ApiBridgeCtrl(ZephirCommonController):
raise Exception('unknown message pattern {}'.format(uri)) raise Exception('unknown message pattern {}'.format(uri))
register(uri, http_type='post', parameters_type='json', add_uri_in_response=True, allow_kwargs=True)(func) register(uri, http_type='post', parameters_type='json', add_uri_in_response=True, allow_kwargs=True)(func)
return super().__new__(cls) return super().__new__(cls)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.needs, self.responses, self.tiramisu = get_messages()
async def http_to_rpc(self, request, uri, **kwargs): async def http_to_rpc(self, request, uri, **kwargs):
ret = await self.call(uri, **kwargs) ret = await self.call(uri, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment