mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
openapi: Get parameters from requestBody too.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
a67d1b57b9
commit
5cac872e4b
@@ -336,10 +336,10 @@ def generate_curl_example(
|
||||
)
|
||||
lines.append(example_value)
|
||||
|
||||
if "requestBody" in operation_entry:
|
||||
properties = operation_entry["requestBody"]["content"]["multipart/form-data"]["schema"][
|
||||
"properties"
|
||||
]
|
||||
if "requestBody" in operation_entry and "multipart/form-data" in (
|
||||
content := operation_entry["requestBody"]["content"]
|
||||
):
|
||||
properties = content["multipart/form-data"]["schema"]["properties"]
|
||||
for key, property in properties.items():
|
||||
lines.append(" -F " + shlex.quote("{}=@{}".format(key, property["example"])))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user