Commit 6d005ba5 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Titouan Soulard

erp5_api_style: Improve url of schemas in api hyperschema

* use get Input Schema of JSON form
* get schema url uses absolute url.
parent fd4a3654
...@@ -8,7 +8,7 @@ data = { ...@@ -8,7 +8,7 @@ data = {
def generateActionInputSchemaUrl(url): def generateActionInputSchemaUrl(url):
_, script = url.rsplit('/', 1) _, script = url.rsplit('/', 1)
return base_url + script + "/getTextContent" return base_url + script + "/getInputJSONSchema"
def populateLinks(jio_type, url, action_list): def populateLinks(jio_type, url, action_list):
result_list = [] result_list = []
...@@ -26,7 +26,7 @@ def populateLinks(jio_type, url, action_list): ...@@ -26,7 +26,7 @@ def populateLinks(jio_type, url, action_list):
data["links"] = data["links"] + [{ data["links"] = data["links"] + [{
"jio_type": "get", "jio_type": "get",
"href": "get/", "href": "get/",
"targetSchema": "get-request-schema.json", "targetSchema": base_url + "get-request-schema.json",
"title": "Get Document", "title": "Get Document",
"method": "POST", "method": "POST",
"curl-example": 'curl -u user:password %s -H "Content-Type: application/json" --data @input.json' % (base_url + "get/",) "curl-example": 'curl -u user:password %s -H "Content-Type: application/json" --data @input.json' % (base_url + "get/",)
......
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