Изменить ответ JSON-RPC - PullRequest
0 голосов
/ 17 мая 2018

Я использую ODOO 11.0, как вернуть простой объект JSON без дополнительных параметров JSON-RPC

Вот мой код контроллера odoo:

@http.route('/userappoint/webhook_test/',type='json', auth='public',method=['POST'], csrf=False,website=True)
def webhook_test(self,**kw):

    response = {
        'speech'        : 'hello my name is shubham',
        'displayText'   : 'hello testing',
        'source'        : 'webhook'
    }
    return response

И я получаю такой результат:

{
"result": {
             "displayText": "hello testing",
             "source": "webhook",
             "speech": "hello my name is shubham"
          },
"id": "6eaced3e-6b0d-4518-9710-de91eaf16dd9",
"jsonrpc": "2.0"
}

Но мне нужно это:

{
"speech": "hello my name is shubham",
"displayText": "hello testing",
"source": "webhook" 
}

Любая помощь, чтобы указать мне в правильном направлении?Спасибо

...