openapi: Standardize URL format to use {var_name} syntax.

The previous code for the validator test was fairly messy due to
checking for both formats of the openapi url, one with
<variable_name> and the other with {variable_name}. To eliminate
this, we have standardized the format and restricted it to
{variable_name} as per the official format at:
https://swagger.io/docs/specification/describing-parameters.
This commit is contained in:
Hemanth V. Alluri
2019-07-11 16:15:26 +05:30
committed by Tim Abbott
parent fe59c31e85
commit ffd2bccd4e
12 changed files with 47 additions and 47 deletions

View File

@@ -191,29 +191,29 @@ class OpenAPIArgumentsTest(ZulipTestCase):
'/users/me/android_gcm_reg_id',
'/users/me/apns_device_token',
# Regex based urls
'/realm/domains/<domain>',
'/realm/filters/<filter_id>',
'/realm/profile_fields/<field_id>',
'/users/<user_id>/reactivate',
'/users/<user_id>',
'/bots/<bot_id>/api_key/regenerate',
'/bots/<bot_id>',
'/invites/<prereg_id>',
'/invites/<prereg_id>/resend',
'/invites/multiuse/<invite_id>',
'/realm/domains/{domain}',
'/realm/filters/{filter_id}',
'/realm/profile_fields/{field_id}',
'/users/{user_id}/reactivate',
'/users/{user_id}',
'/bots/{bot_id}/api_key/regenerate',
'/bots/{bot_id}',
'/invites/{prereg_id}',
'/invites/{prereg_id}/resend',
'/invites/multiuse/{invite_id}',
'/messages/{message_id}',
'/messages/{message_id}/history',
'/users/me/subscriptions/{stream_id}',
'/messages/<message_id>/reactions',
'/messages/<message_id>/emoji_reactions/<emoji_name>',
'/attachments/<attachment_id>',
'/user_groups/<user_group_id>/members',
'/messages/{message_id}/reactions',
'/messages/{message_id}/emoji_reactions/{emoji_name}',
'/attachments/{attachment_id}',
'/user_groups/{user_group_id}/members',
'/users/me/{stream_id}/topics',
'/streams/<stream_id>/members',
'/streams/{stream_id}/members',
'/streams/{stream_id}',
'/streams/<stream_id>/delete_topic',
'/default_stream_groups/<group_id>',
'/default_stream_groups/<group_id>/streams',
'/streams/{stream_id}/delete_topic',
'/default_stream_groups/{group_id}',
'/default_stream_groups/{group_id}/streams',
# Regex with an unnamed capturing group.
'/users/(?!me/)(?P<email>[^/]*)/presence',
# Actually '/user_groups/<user_group_id>' in urls.py but fails the reverse mapping