mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
openapi: Correctly encode object and array parameters.
The current description of object and array parameters in zulip.yaml is wrong and renders incorrect requests on using OpenAPI tools such as SwaggerIO, etc. Fix it by encoding it correctly and changing tests accordingly. Fixes #14380.
This commit is contained in:
@@ -46,7 +46,10 @@ def patch_openapi_example_values(entry: str, params: List[Dict[str, Any]],
|
||||
for param in params:
|
||||
param_name = param["name"]
|
||||
if param_name in realm_example_values:
|
||||
param["example"] = realm_example_values[param_name]
|
||||
if 'content' in param:
|
||||
param['content']['application/json']['example'] = realm_example_values[param_name]
|
||||
else:
|
||||
param["example"] = realm_example_values[param_name]
|
||||
|
||||
if request_body is not None:
|
||||
properties = request_body["content"]["multipart/form-data"]["schema"]["properties"]
|
||||
|
||||
Reference in New Issue
Block a user