openapi: Auto render parameter descriptions.

This commit modifies the templates to
auto-generate general descriptions of
parameters directly from the newly
added field of x-parameter-description
as a part of the goal of a common template.
This commit is contained in:
Suyash Vardhan Mathur 2021-06-22 00:50:51 +05:30 committed by Tim Abbott
parent 35ba5b8d6f
commit cc2aa41fae
60 changed files with 120 additions and 0 deletions

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/playgrounds:post} {generate_api_arguments_table|zulip.yaml|/realm/playgrounds:post}
{generate_parameter_description(/realm/playgrounds:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/playgrounds:post} {generate_return_values_table|zulip.yaml|/realm/playgrounds:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/filters:post} {generate_api_arguments_table|zulip.yaml|/realm/filters:post}
{generate_parameter_description(/realm/filters:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/filters:post} {generate_return_values_table|zulip.yaml|/realm/filters:post}

View File

@ -22,6 +22,8 @@
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}/reactions:post} {generate_api_arguments_table|zulip.yaml|/messages/{message_id}/reactions:post}
{generate_parameter_description(/messages/{message_id}/reactions:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/streams/{stream_id}:delete} {generate_api_arguments_table|zulip.yaml|/streams/{stream_id}:delete}
{generate_parameter_description(/streams/{stream_id}:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/messages/matches_narrow:get} {generate_api_arguments_table|zulip.yaml|/messages/matches_narrow:get}
{generate_parameter_description(/messages/matches_narrow:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/messages/matches_narrow:get} {generate_return_values_table|zulip.yaml|/messages/matches_narrow:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/profile_fields:post} {generate_api_arguments_table|zulip.yaml|/realm/profile_fields:post}
{generate_parameter_description(/realm/profile_fields:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/profile_fields:post} {generate_return_values_table|zulip.yaml|/realm/profile_fields:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/user_groups/create:post} {generate_api_arguments_table|zulip.yaml|/user_groups/create:post}
{generate_parameter_description(/user_groups/create:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users:post} {generate_api_arguments_table|zulip.yaml|/users:post}
{generate_parameter_description(/users:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users:post} {generate_return_values_table|zulip.yaml|/users:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me:delete} {generate_api_arguments_table|zulip.yaml|/users/me:delete}
{generate_parameter_description(/users/me:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/{user_id}:delete} {generate_api_arguments_table|zulip.yaml|/users/{user_id}:delete}
{generate_parameter_description(/users/{user_id}:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:delete} {generate_api_arguments_table|zulip.yaml|/messages/{message_id}:delete}
{generate_parameter_description(/messages/{message_id}:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/events:delete} {generate_api_arguments_table|zulip.yaml|/events:delete}
{generate_parameter_description(/events:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -15,6 +15,8 @@
{generate_api_arguments_table|zulip.yaml|/dev_fetch_api_key:post} {generate_api_arguments_table|zulip.yaml|/dev_fetch_api_key:post}
{generate_parameter_description(/dev_fetch_api_key:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/dev_fetch_api_key:post} {generate_return_values_table|zulip.yaml|/dev_fetch_api_key:post}

View File

@ -15,6 +15,8 @@
{generate_api_arguments_table|zulip.yaml|/fetch_api_key:post} {generate_api_arguments_table|zulip.yaml|/fetch_api_key:post}
{generate_parameter_description(/fetch_api_key:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/fetch_api_key:post} {generate_return_values_table|zulip.yaml|/fetch_api_key:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/attachments:get} {generate_api_arguments_table|zulip.yaml|/attachments:get}
{generate_parameter_description(/attachments:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/attachments:get} {generate_return_values_table|zulip.yaml|/attachments:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/emoji:get} {generate_api_arguments_table|zulip.yaml|/realm/emoji:get}
{generate_parameter_description(/realm/emoji:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/emoji:get} {generate_return_values_table|zulip.yaml|/realm/emoji:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/profile_fields:get} {generate_api_arguments_table|zulip.yaml|/realm/profile_fields:get}
{generate_parameter_description(/realm/profile_fields:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/profile_fields:get} {generate_return_values_table|zulip.yaml|/realm/profile_fields:get}

View File

@ -45,6 +45,7 @@ even if you haven't registered a queue by explicitly requesting the
`{{ api_url}}/v1/register` endpoint, you could pass the parameters for `{{ api_url}}/v1/register` endpoint, you could pass the parameters for
[the `{{ api_url}}/v1/register` endpoint](/api/register-queue) to this [the `{{ api_url}}/v1/register` endpoint](/api/register-queue) to this
endpoint and a queue would be registered in the absence of a `queue_id`. endpoint and a queue would be registered in the absence of a `queue_id`.
{generate_parameter_description(/events:get)}
## Response ## Response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/linkifiers:get} {generate_api_arguments_table|zulip.yaml|/realm/linkifiers:get}
{generate_parameter_description(/realm/linkifiers:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/linkifiers:get} {generate_return_values_table|zulip.yaml|/realm/linkifiers:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}/history:get} {generate_api_arguments_table|zulip.yaml|/messages/{message_id}/history:get}
{generate_parameter_description(/messages/{message_id}/history:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/messages/{message_id}/history:get} {generate_return_values_table|zulip.yaml|/messages/{message_id}/history:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/messages:get} {generate_api_arguments_table|zulip.yaml|/messages:get}
{generate_parameter_description(/messages:get)}
## Response ## Response
When a request is successful, this endpoint returns a dictionary When a request is successful, this endpoint returns a dictionary

View File

@ -21,6 +21,8 @@
This endpoint takes no parameters. This endpoint takes no parameters.
{generate_parameter_description(/users/me:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users/me:get} {generate_return_values_table|zulip.yaml|/users/me:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:get} {generate_api_arguments_table|zulip.yaml|/messages/{message_id}:get}
{generate_parameter_description(/messages/{message_id}:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/messages/{message_id}:get} {generate_return_values_table|zulip.yaml|/messages/{message_id}:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/server_settings:get} {generate_api_arguments_table|zulip.yaml|/server_settings:get}
{generate_parameter_description(/server_settings:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/server_settings:get} {generate_return_values_table|zulip.yaml|/server_settings:get}

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/get_stream_id:get} {generate_api_arguments_table|zulip.yaml|/get_stream_id:get}
{generate_parameter_description(/get_stream_id:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/get_stream_id:get} {generate_return_values_table|zulip.yaml|/get_stream_id:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me/{stream_id}/topics:get} {generate_api_arguments_table|zulip.yaml|/users/me/{stream_id}/topics:get}
{generate_parameter_description(/users/me/{stream_id}/topics:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users/me/{stream_id}/topics:get} {generate_return_values_table|zulip.yaml|/users/me/{stream_id}/topics:get}

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/streams:get} {generate_api_arguments_table|zulip.yaml|/streams:get}
{generate_parameter_description(/streams:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/streams:get} {generate_return_values_table|zulip.yaml|/streams:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/{user_id}/subscriptions/{stream_id}:get} {generate_api_arguments_table|zulip.yaml|/users/{user_id}/subscriptions/{stream_id}:get}
{generate_parameter_description(/users/{user_id}/subscriptions/{stream_id}:get)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions:get} {generate_api_arguments_table|zulip.yaml|/users/me/subscriptions:get}
{generate_parameter_description(/users/me/subscriptions:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users/me/subscriptions:get} {generate_return_values_table|zulip.yaml|/users/me/subscriptions:get}

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/users/{email}:get} {generate_api_arguments_table|zulip.yaml|/users/{email}:get}
{generate_parameter_description(/users/{email}:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml}|/users/{email}:get} {generate_return_values_table|zulip.yaml}|/users/{email}:get}

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/user_groups:get} {generate_api_arguments_table|zulip.yaml|/user_groups:get}
{generate_parameter_description(/user_groups:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/user_groups:get} {generate_return_values_table|zulip.yaml|/user_groups:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/{user_id_or_email}/presence:get} {generate_api_arguments_table|zulip.yaml|/users/{user_id_or_email}/presence:get}
{generate_parameter_description(/users/{user_id_or_email}/presence:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users/{user_id_or_email}/presence:get} {generate_return_values_table|zulip.yaml|/users/{user_id_or_email}/presence:get}

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/users/{user_id}:get} {generate_api_arguments_table|zulip.yaml|/users/{user_id}:get}
{generate_parameter_description(/users/{user_id}:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml}|/users/{user_id}:get} {generate_return_values_table|zulip.yaml}|/users/{user_id}:get}

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/users:get} {generate_api_arguments_table|zulip.yaml|/users:get}
{generate_parameter_description(/users:get)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users:get} {generate_return_values_table|zulip.yaml|/users:get}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/mark_all_as_read:post} {generate_api_arguments_table|zulip.yaml|/mark_all_as_read:post}
{generate_parameter_description(/mark_all_as_read:post)}
## Response ## Response
#### Example response #### Example response
@ -54,6 +56,8 @@
{generate_api_arguments_table|zulip.yaml|/mark_stream_as_read:post} {generate_api_arguments_table|zulip.yaml|/mark_stream_as_read:post}
{generate_parameter_description(/mark_all_as_read:post)}
## Response ## Response
#### Example response #### Example response
@ -88,6 +92,8 @@
{generate_api_arguments_table|zulip.yaml|/mark_topic_as_read:post} {generate_api_arguments_table|zulip.yaml|/mark_topic_as_read:post}
{generate_parameter_description(/mark_all_as_read:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions/muted_topics:patch} {generate_api_arguments_table|zulip.yaml|/users/me/subscriptions/muted_topics:patch}
{generate_parameter_description(/users/me/subscriptions/muted_topics:patch)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me/muted_users/{muted_user_id}:post} {generate_api_arguments_table|zulip.yaml|/users/me/muted_users/{muted_user_id}:post}
{generate_parameter_description(/users/me/muted_users/{muted_user_id}:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/{user_id}/reactivate:post} {generate_api_arguments_table|zulip.yaml|/users/{user_id}/reactivate:post}
{generate_parameter_description(/users/{user_id}/reactivate:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/playgrounds/{playground_id}:delete} {generate_api_arguments_table|zulip.yaml|/realm/playgrounds/{playground_id}:delete}
{generate_parameter_description(/realm/playgrounds/{playground_id}:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/filters/{filter_id}:delete} {generate_api_arguments_table|zulip.yaml|/realm/filters/{filter_id}:delete}
{generate_parameter_description(/realm/filters/{filter_id}:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -23,6 +23,8 @@
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}/reactions:delete} {generate_api_arguments_table|zulip.yaml|/messages/{message_id}/reactions:delete}
{generate_parameter_description(/messages/{message_id}/reactions:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}:delete} {generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}:delete}
{generate_parameter_description(/user_groups/{user_group_id}:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/messages/render:post} {generate_api_arguments_table|zulip.yaml|/messages/render:post}
{generate_parameter_description(/messages/render:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/messages/render:post} {generate_return_values_table|zulip.yaml|/messages/render:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/profile_fields:patch} {generate_api_arguments_table|zulip.yaml|/realm/profile_fields:patch}
{generate_parameter_description(/realm/profile_fields:patch)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/profile_fields:patch} {generate_return_values_table|zulip.yaml|/realm/profile_fields:patch}

View File

@ -67,6 +67,8 @@ file.
{generate_api_arguments_table|zulip.yaml|/messages:post} {generate_api_arguments_table|zulip.yaml|/messages:post}
{generate_parameter_description(/messages:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/messages:post} {generate_return_values_table|zulip.yaml|/messages:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/typing:post} {generate_api_arguments_table|zulip.yaml|/typing:post}
{generate_parameter_description(/typing:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions:post} {generate_api_arguments_table|zulip.yaml|/users/me/subscriptions:post}
{generate_parameter_description(/users/me/subscriptions:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users/me/subscriptions:post} {generate_return_values_table|zulip.yaml|/users/me/subscriptions:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me/muted_users/{muted_user_id}:delete} {generate_api_arguments_table|zulip.yaml|/users/me/muted_users/{muted_user_id}:delete}
{generate_parameter_description(/users/me/muted_users/{muted_user_id}:delete)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/settings/display:patch} {generate_api_arguments_table|zulip.yaml|/settings/display:patch}
{generate_parameter_description(/settings/display:patch)}
## Response ## Response
#### Return values #### Return values

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/realm/filters/{filter_id}:patch} {generate_api_arguments_table|zulip.yaml|/realm/filters/{filter_id}:patch}
{generate_parameter_description(/realm/filters/{filter_id}:patch)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/realm/filters/{filter_id}:patch} {generate_return_values_table|zulip.yaml|/realm/filters/{filter_id}:patch}

View File

@ -93,6 +93,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
{generate_parameter_description(/messages/flags:post)}
## Response ## Response

View File

@ -30,6 +30,8 @@ You only have permission to edit a message if:
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:patch} {generate_api_arguments_table|zulip.yaml|/messages/{message_id}:patch}
{generate_parameter_description(/messages/{message_id}:patch)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/settings/notifications:patch} {generate_api_arguments_table|zulip.yaml|/settings/notifications:patch}
{generate_parameter_description(/settings/notifications:patch)}
## Response ## Response
#### Return values #### Return values

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/streams/{stream_id}:patch} {generate_api_arguments_table|zulip.yaml|/streams/{stream_id}:patch}
{generate_parameter_description(/streams/{stream_id}:patch)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions/properties:post} {generate_api_arguments_table|zulip.yaml|/users/me/subscriptions/properties:post}
{generate_parameter_description(/users/me/subscriptions/properties:post)}
## Response ## Response
{generate_return_values_table|zulip.yaml|/users/me/subscriptions/properties:post} {generate_return_values_table|zulip.yaml|/users/me/subscriptions/properties:post}

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}/members:post} {generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}/members:post}
{generate_parameter_description(/user_groups/{user_group_id}/members:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}:patch} {generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}:patch}
{generate_parameter_description(/user_groups/{user_group_id}:patch)}
## Response ## Response
#### Example response #### Example response

View File

@ -21,6 +21,8 @@
{generate_api_arguments_table|zulip.yaml|/users/{user_id}:patch} {generate_api_arguments_table|zulip.yaml|/users/{user_id}:patch}
{generate_parameter_description(/users/{user_id}:patch)}
## Response ## Response
#### Example response #### Example response

View File

@ -39,6 +39,7 @@ in the [server's settings][1]. `MAX_EMOJI_FILE_SIZE_MIB` defaults
to 5MB. to 5MB.
[1]: https://zulip.readthedocs.io/en/latest/subsystems/settings.html#server-settings [1]: https://zulip.readthedocs.io/en/latest/subsystems/settings.html#server-settings
{generate_parameter_description(/realm/emoji/{emoji_name}:post)}
## Response ## Response
#### Example response #### Example response

View File

@ -31,6 +31,7 @@ in the [server's settings][1]. `MAX_FILE_UPLOAD_SIZE` defaults
to 25MB. to 25MB.
[1]: https://zulip.readthedocs.io/en/latest/subsystems/settings.html#server-settings [1]: https://zulip.readthedocs.io/en/latest/subsystems/settings.html#server-settings
{generate_parameter_description(/user_uploads:post)}
## Response ## Response