docs: Make upload-custom-emoji use curl example system.

This commit is contained in:
Vishnu Ks
2019-10-16 11:06:31 +00:00
committed by Tim Abbott
parent 438c4b2935
commit 9ac77a8734
4 changed files with 9 additions and 5 deletions

View File

@@ -188,6 +188,11 @@ def generate_curl_example(endpoint: str, method: str,
curl_argument=True)
lines.append(example_value)
if "requestBody" in openapi_entry:
properties = openapi_entry["requestBody"]["content"]["multipart/form-data"]["schema"]["properties"]
for key, property in properties.items():
lines.append(' -F "{}=@{}"'.format(key, property["example"]))
for i in range(1, len(lines)-1):
lines[i] = lines[i] + " \\"