Commit 62e94f42 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

erp5_api_style: Get actions links are now generated as the other actions

parent fd66fef5
...@@ -23,17 +23,12 @@ def populateLinks(jio_type, url, action_list): ...@@ -23,17 +23,12 @@ def populateLinks(jio_type, url, action_list):
"curl-example": 'curl -u user:password %s -H "Content-Type: application/json" --data @input.json' % (base_url + url,) "curl-example": 'curl -u user:password %s -H "Content-Type: application/json" --data @input.json' % (base_url + url,)
}) })
return result_list return result_list
data["links"] = data["links"] + [{
"jio_type": "get", data["links"] = data["links"] + populateLinks("get", "get/", context.ERP5Site_getAllActionListForAPIGet())
"href": "get/",
"targetSchema": base_url + "get-request-schema.json",
"title": "Get Document",
"method": "POST",
"curl-example": 'curl -u user:password %s -H "Content-Type: application/json" --data @input.json' % (base_url + "get/",)
}]
data["links"] = data["links"] + populateLinks("post", "post/", context.ERP5Site_getAllActionListForAPIPost()) data["links"] = data["links"] + populateLinks("post", "post/", context.ERP5Site_getAllActionListForAPIPost())
data["links"] = data["links"] + populateLinks("put", "put/", context.ERP5Site_getAllActionListForAPIPut()) data["links"] = data["links"] + populateLinks("put", "put/", context.ERP5Site_getAllActionListForAPIPut())
data["links"] = data["links"] + populateLinks("allDocs", "allDocs/", context.ERP5Site_getAllActionListForAPIAllDocs()) data["links"] = data["links"] + populateLinks("allDocs", "allDocs/", context.ERP5Site_getAllActionListForAPIAllDocs())
import json import json
return json.dumps( return json.dumps(
data, data,
......
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