A platform for community discussion. Free, open, simple.
DEV: Add missing operationIds to the api docs (#14235)
Blake Ericksonee7809e8a805
diff --git a/spec/requests/api/backups_spec.rb b/spec/requests/api/backups_spec.rbindex 9b5249274ff..27317a41f11 100644--- a/spec/requests/api/backups_spec.rb+++ b/spec/requests/api/backups_spec.rb@@ -36,6 +36,7 @@ describe 'backups' dopath '/admin/backups.json' doget 'List backups' dotags 'Backups'+ operationId 'getBackups'consumes 'application/json'expected_request_schema = nil@@ -53,6 +54,7 @@ describe 'backups' dopost 'Create backup' dotags 'Backups'+ operationId 'createBackup'consumes 'application/json'expected_request_schema = load_spec_schema('backups_create_request')parameter name: :params, in: :body, schema: expected_request_schema@@ -81,6 +83,7 @@ describe 'backups' dopath '/admin/backups/{filename}' doput 'Send download backup email' dotags 'Backups'+ operationId 'sendDownloadBackupEmail'consumes 'application/json'expected_request_schema = nilparameter name: :filename, in: :path, type: :string, required: true@@ -100,6 +103,7 @@ describe 'backups' doget 'Download backup' dotags 'Backups'+ operationId 'downloadBackup'consumes 'application/json'expected_request_schema = nilparameter name: :filename, in: :path, type: :string, required: truediff --git a/spec/requests/api/badges_spec.rb b/spec/requests/api/badges_spec.rbindex 92a8ad518b8..4a891a18444 100644--- a/spec/requests/api/badges_spec.rb+++ b/spec/requests/api/badges_spec.rb@@ -15,6 +15,7 @@ describe 'badges' doget 'List badges' dotags 'Badges'+ operationId 'adminListBadges'consumes 'application/json'expected_request_schema = nil@@ -32,6 +33,7 @@ describe 'badges' dopost 'Create badge' dotags 'Badges'+ operationId 'createBadge'consumes 'application/json'expected_request_schema = load_spec_schema('badge_create_request')parameter name: :params, in: :body, schema: expected_request_schema@@ -58,6 +60,7 @@ describe 'badges' doput 'Update badge' dotags 'Badges'+ operationId 'updateBadge'consumes 'application/json'expected_request_schema = load_spec_schema('badge_update_request')parameter name: :id, in: :path, schema: { type: :integer }@@ -84,6 +87,7 @@ describe 'badges' dodelete 'Delete badge' dotags 'Badges'+ operationId 'deleteBadge'consumes 'application/json'expected_request_schema = nilparameter name: :id, in: :path, schema: { type: :integer }diff --git a/spec/requests/api/categories_spec.rb b/spec/requests/api/categories_spec.rbindex e1311125cb7..2d34f2544ed 100644--- a/spec/requests/api/categories_spec.rb+++ b/spec/requests/api/categories_spec.rb@@ -15,6 +15,7 @@ describe 'categories' dopost 'Creates a category' dotags 'Categories'+ operationId 'createCategory'consumes 'application/json'expected_request_schema = load_spec_schema('category_create_request')parameter name: :params, in: :body, schema: expected_request_schema@@ -35,6 +36,7 @@ describe 'categories' doget 'Retrieves a list of categories' dotags 'Categories'+ operationId 'listCategories'consumes 'application/json'expected_request_schema = nil@@ -55,6 +57,7 @@ describe 'categories' doput 'Updates a category' dotags 'Categories'+ operationId 'updateCategory'consumes 'application/json'expected_request_schema = load_spec_schema('category_create_request')parameter name: :id, in: :path, schema: { type: :integer }@@ -80,6 +83,7 @@ describe 'categories' doget 'List topics' dotags 'Categories'+ operationId 'listCategoryTopics'produces 'application/json'parameter name: :slug, in: :path, schema: { type: :string }parameter name: :id, in: :path, schema: { type: :integer }@@ -105,6 +109,7 @@ describe 'categories' doget 'Show category' dotags 'Categories'+ operationId 'getCategory'consumes 'application/json'parameter name: :id, in: :path, schema: { type: :integer }expected_request_schema = nildiff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rbindex 3973ec9fd06..4662e89eec7 100644--- a/spec/requests/api/groups_spec.rb+++ b/spec/requests/api/groups_spec.rb@@ -13,6 +13,7 @@ describe 'groups' dopath '/admin/groups.json' dopost 'Creates a group' dotags 'Groups'+ operationId 'createGroup'consumes 'application/json'parameter name: :group, in: :body, schema: {type: :object,@@ -78,6 +79,7 @@ describe 'groups' dopath '/admin/groups/{id}.json' dodelete 'Delete a group' dotags 'Groups'+ operationId 'deleteGroup'consumes 'application/json'parameter name: :id, in: :path, type: :integerexpected_request_schema = nil@@ -99,6 +101,7 @@ describe 'groups' dopath '/groups/{id}.json' doput 'Update a group' dotags 'Groups'+ operationId 'updateGroup'consumes 'application/json'parameter name: :id, in: :path, type: :integerparameter name: :group, in: :body, schema: {@@ -128,6 +131,7 @@ describe 'groups' doget 'Get a group' dotags 'Groups'+ operationId 'getGroup'consumes 'application/json'parameter name: :id, in: :path, type: :string, example: 'name', description: "Use group name instead of id"expected_request_schema = nil@@ -150,6 +154,7 @@ describe 'groups' dopath '/groups/{id}/members.json' doget 'List group members' dotags 'Groups'+ operationId 'listGroupMembers'consumes 'application/json'parameter name: :id, in: :path, type: :string, example: 'name', description: "Use group name instead of id"expected_request_schema = nil@@ -170,6 +175,7 @@ describe 'groups' doput 'Add group members' dotags 'Groups'+ operationId 'addGroupMembers'consumes 'application/json'parameter name: :id, in: :path, type: :integerexpected_request_schema = load_spec_schema('group_add_members_request')@@ -195,6 +201,7 @@ describe 'groups' dodelete 'Remove group members' dotags 'Groups'+ operationId 'removeGroupMembers'consumes 'application/json'parameter name: :id, in: :path, type: :integerexpected_request_schema = load_spec_schema('group_remove_members_request')@@ -222,6 +229,7 @@ describe 'groups' dopath '/groups.json' doget 'List groups' dotags 'Groups'+ operationId 'listGroups'consumes 'application/json'expected_request_schema = nildiff --git a/spec/requests/api/invites_spec.rb b/spec/requests/api/invites_spec.rbindex 1ed7d22470e..3e7d1e4768e 100644--- a/spec/requests/api/invites_spec.rb+++ b/spec/requests/api/invites_spec.rb@@ -9,6 +9,7 @@ describe 'invites' dopath '/invites.json' dopost 'Create an invite' dotags 'Invites'+ operationId 'createInvite'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: truediff --git a/spec/requests/api/notifications_spec.rb b/spec/requests/api/notifications_spec.rbindex 4100b49954f..efde83fa5c6 100644--- a/spec/requests/api/notifications_spec.rb+++ b/spec/requests/api/notifications_spec.rb@@ -15,6 +15,7 @@ describe 'notifications' doget 'Get the notifications that belong to the current user' dotags 'Notifications'+ operationId 'getNotifications'produces 'application/json'response '200', 'notifications' do@@ -60,6 +61,7 @@ describe 'notifications' doput 'Mark notifications as read' dotags 'Notifications'+ operationId 'markNotificationsAsRead'consumes 'application/json'parameter name: :notification, in: :body, schema: {type: :object,diff --git a/spec/requests/api/posts_spec.rb b/spec/requests/api/posts_spec.rbindex 2b14260dade..0456643e339 100644--- a/spec/requests/api/posts_spec.rb+++ b/spec/requests/api/posts_spec.rb@@ -16,6 +16,7 @@ describe 'posts' doget 'List latest posts across topics' dotags 'Posts'+ operationId 'listPosts'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: trueproduces 'application/json'@@ -98,6 +99,7 @@ describe 'posts' dopost 'Creates a new topic, a new post, or a private message' dotags 'Posts', 'Topics', 'Private Messages'+ operationId 'createTopicPostPM'consumes 'application/json'expected_request_schema = load_spec_schema('topic_create_request')parameter name: :params, in: :body, schema: expected_request_schema@@ -121,6 +123,7 @@ describe 'posts' doget 'Retrieve a single post' dotags 'Posts'+ operationId 'getPost'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: trueparameter name: :id, in: :path, schema: { type: :string }@@ -194,6 +197,7 @@ describe 'posts' doput 'Update a single post' dotags 'Posts'+ operationId 'updatePost'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -292,6 +296,7 @@ describe 'posts' dopath '/posts/{id}/locked.json' doput 'Lock a post from being edited' dotags 'Posts'+ operationId 'lockPost'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -324,6 +329,7 @@ describe 'posts' dopath '/post_actions.json' dopost 'Like a post and other actions' dotags 'Posts'+ operationId 'performPostAction'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: truediff --git a/spec/requests/api/private_messages_spec.rb b/spec/requests/api/private_messages_spec.rbindex 1e3f9a8c7af..23582f7d14e 100644--- a/spec/requests/api/private_messages_spec.rb+++ b/spec/requests/api/private_messages_spec.rb@@ -14,6 +14,7 @@ describe 'private messages' doget 'Get a list of private messages for a user' dotags 'Private Messages'+ operationId 'listUserPrivateMessages'parameter name: :username, in: :path, schema: { type: :string }produces 'application/json'@@ -123,6 +124,7 @@ describe 'private messages' doget 'Get a list of private messages sent for a user' dotags 'Private Messages'+ operationId 'getUserSentPrivateMessages'parameter name: :username, in: :path, schema: { type: :string }produces 'application/json'diff --git a/spec/requests/api/search_spec.rb b/spec/requests/api/search_spec.rbindex 5245e39308a..dc9f63fc769 100644--- a/spec/requests/api/search_spec.rb+++ b/spec/requests/api/search_spec.rb@@ -13,6 +13,7 @@ describe 'groups' dopath '/search.json' doget 'Search for a term' dotags 'Search'+ operationId 'search'consumes 'application/json'parameter(name: :q,diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rbindex 4bbfd7f5df0..cbb0cad7287 100644--- a/spec/requests/api/tags_spec.rb+++ b/spec/requests/api/tags_spec.rb@@ -17,6 +17,7 @@ describe 'tags' doget 'Get a list of tag groups' dotags 'Tags'+ operationId 'listTagGroups'produces 'application/json'response '200', 'tags' do@@ -59,6 +60,7 @@ describe 'tags' dopost 'Creates a tag group' dotags 'Tags'+ operationId 'createTagGroup'consumes 'application/json'expected_request_schema = load_spec_schema('tag_group_create_request')@@ -85,6 +87,7 @@ describe 'tags' doget 'Get a single tag group' dotags 'Tags'+ operationId 'getTagGroup'consumes 'application/json'parameter name: :id, in: :path, schema: { type: :string }@@ -127,6 +130,7 @@ describe 'tags' doput 'Update tag group' dotags 'Tags'+ operationId 'updateTagGroup'consumes 'application/json'parameter name: :id, in: :path, schema: { type: :string }parameter name: :put_body, in: :body, schema: {@@ -177,6 +181,7 @@ describe 'tags' doget 'Get a list of tags' dotags 'Tags'+ operationId 'listTags'produces 'application/json'response '200', 'notifications' do@@ -215,6 +220,7 @@ describe 'tags' doget 'Get a specific tag' dotags 'Tags'+ operationId 'getTag'parameter name: :name, in: :path, schema: { type: :string }produces 'application/json'diff --git a/spec/requests/api/topics_spec.rb b/spec/requests/api/topics_spec.rbindex a2c2eec8f22..5e3d5639899 100644--- a/spec/requests/api/topics_spec.rb+++ b/spec/requests/api/topics_spec.rb@@ -9,6 +9,7 @@ describe 'topics' dopath '/t/{id}/posts.json' doget 'Get specific posts from a topic' dotags 'Topics'+ operationId 'getSpecificPostsFromTopic'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -107,6 +108,7 @@ describe 'topics' dopath '/t/{id}.json' doget 'Get a single topic' dotags 'Topics'+ operationId 'getTopic'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -375,6 +377,7 @@ describe 'topics' dodelete 'Remove a topic' dotags 'Topics'+ operationId 'removeTopic'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -392,6 +395,7 @@ describe 'topics' dopath '/t/-/{id}.json' doput 'Update a topic' dotags 'Topics'+ operationId 'updateTopic'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -440,6 +444,7 @@ describe 'topics' dopath '/t/{id}/invite.json' dopost 'Invite to topic' dotags 'Topics', 'Invites'+ operationId 'inviteToTopic'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -482,6 +487,7 @@ describe 'topics' dopath '/t/{id}/bookmark.json' doput 'Bookmark topic' dotags 'Topics'+ operationId 'bookmarkTopic'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -501,6 +507,7 @@ describe 'topics' dopath '/t/{id}/status.json' doput 'Update the status of a topic' dotags 'Topics'+ operationId 'updateTopicStatus'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -543,6 +550,7 @@ describe 'topics' dopath '/latest.json' doget 'Get the latest topics' dotags 'Topics'+ operationId 'listLatestTopics'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -649,106 +657,10 @@ describe 'topics' doendend- path '/top.json' do- get 'Get the top topics' do- tags 'Topics'- consumes 'application/json'- parameter name: 'Api-Key', in: :header, type: :string, required: true- parameter name: 'Api-Username', in: :header, type: :string, required: true-- produces 'application/json'- response '200', 'topic updated' do- schema type: :object, properties: {- users: {- type: :array,- items: {- type: :object,- properties: {- id: { type: :integer },- username: { type: :string },- name: { type: :string },- avatar_template: { type: :string },- }- },- },- primary_groups: {- type: :array,- items: {- },- },- topic_list: {- type: :object,- properties: {- can_create_topic: { type: :boolean },- draft: { type: [:string, :null] },- draft_key: { type: :string },- draft_sequence: { type: :integer },- for_period: { type: :string },- per_page: { type: :integer },- topics: {- type: :array,- items: {- type: :object,- properties: {- id: { type: :integer },- title: { type: :string },- fancy_title: { type: :string },- slug: { type: :string },- posts_count: { type: :integer },- reply_count: { type: :integer },- highest_post_number: { type: :integer },- image_url: { type: [:string, :null] },- created_at: { type: :string },- last_posted_at: { type: :string },- bumped: { type: :boolean },- bumped_at: { type: :string },- archetype: { type: :string },- unseen: { type: :boolean },- last_read_post_number: { type: :integer },- unread_posts: { type: :integer },- pinned: { type: :boolean },- unpinned: { type: :boolean },- visible: { type: :boolean },- closed: { type: :boolean },- archived: { type: :boolean },- notification_level: { type: :integer },- bookmarked: { type: :boolean },- liked: { type: :boolean },- views: { type: :integer },- like_count: { type: :integer },- has_summary: { type: :boolean },- last_poster_username: { type: :string },- category_id: { type: :integer },- op_like_count: { type: :integer },- pinned_globally: { type: :boolean },- featured_link: { type: [:string, :null] },- posters: {- type: :array,- items: {- type: :object,- properties: {- extras: { type: [:string, :null] },- description: { type: :string },- user_id: { type: :integer },- primary_group_id: { type: [:string, :null] },- }- },- },- }- },- },- }- },- }-- run_test!- end- end- end-path '/top.json' doget 'Get the top topics filtered by period' dotags 'Topics'+ operationId 'listTopTopics'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -853,6 +765,7 @@ describe 'topics' dopath '/t/{id}/notifications.json' dopost 'Set notification level' dotags 'Topics'+ operationId 'setNotificationLevel'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -885,6 +798,7 @@ describe 'topics' dopath '/t/{id}/change-timestamp.json' doput 'Update topic timestamp' dotags 'Topics'+ operationId 'updateTopicTimestamp'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -918,6 +832,7 @@ describe 'topics' dopath '/t/{id}/timer.json' dopost 'Create topic timer' dotags 'Topics'+ operationId 'createTopicTimer'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: truediff --git a/spec/requests/api/uploads_spec.rb b/spec/requests/api/uploads_spec.rbindex af21fa91dc5..17307b4129f 100644--- a/spec/requests/api/uploads_spec.rb+++ b/spec/requests/api/uploads_spec.rb@@ -15,6 +15,7 @@ describe 'uploads' dopath '/uploads.json' dopost 'Creates an upload' dotags 'Uploads'+ operationId 'createUpload'consumes 'multipart/form-data'expected_request_schema = load_spec_schema('upload_create_request')diff --git a/spec/requests/api/user_badges_spec.rb b/spec/requests/api/user_badges_spec.rbindex 62ef031c9c3..aca25c2793f 100644--- a/spec/requests/api/user_badges_spec.rb+++ b/spec/requests/api/user_badges_spec.rb@@ -14,6 +14,7 @@ describe 'user_badges' doget 'List badges for a user' dotags 'Badges', 'Users'+ operationId 'listUserBadges'consumes 'application/json'expected_request_schema = nilparameter name: :username, in: :path, schema: { type: :string }diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rbindex f3a001acdee..7d2bc6dcdd7 100644--- a/spec/requests/api/users_spec.rb+++ b/spec/requests/api/users_spec.rb@@ -17,6 +17,7 @@ describe 'users' dopost 'Creates a user' dotags 'Users'+ operationId 'createUser'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -64,6 +65,7 @@ describe 'users' doget 'Get a single user by username' dotags 'Users'+ operationId 'getUser'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -83,6 +85,7 @@ describe 'users' doget 'Get a user by external_id' dotags 'Users'+ operationId 'getUserExternalId'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -110,6 +113,7 @@ describe 'users' doget 'Get a user by identity provider external ID' dotags 'Users'+ operationId 'getUserIdentiyProviderExternalId'consumes 'application/json'parameter name: 'Api-Key', in: :header, type: :string, required: trueparameter name: 'Api-Username', in: :header, type: :string, required: true@@ -142,6 +146,7 @@ describe 'users' doput 'Update avatar' dotags 'Users'+ operationId 'updateAvatar'consumes 'application/json'expected_request_schema = load_spec_schema('user_update_avatar_request')@@ -172,6 +177,7 @@ describe 'users' doput 'Update email' dotags 'Users'+ operationId 'updateEmail'consumes 'application/json'expected_request_schema = load_spec_schema('user_update_email_request')@@ -200,6 +206,7 @@ describe 'users' doget 'Get a public list of users' dotags 'Users'+ operationId 'listUsersPublic'consumes 'application/json'expected_request_schema = nil@@ -257,6 +264,7 @@ describe 'users' doget 'Get a user by id' dotags 'Users', 'Admin'+ operationId 'adminGetUser'consumes 'application/json'expected_request_schema = nil@@ -279,6 +287,7 @@ describe 'users' dodelete 'Delete a user' dotags 'Users', 'Admin'+ operationId 'deleteUser'consumes 'application/json'expected_request_schema = load_spec_schema('user_delete_request')@@ -311,6 +320,7 @@ describe 'users' dopath '/admin/users/{id}/suspend.json' doput 'Suspend a user' dotags 'Users', 'Admin'+ operationId 'suspendUser'consumes 'application/json'expected_request_schema = load_spec_schema('user_suspend_request')@@ -340,6 +350,7 @@ describe 'users' dopath '/admin/users/{id}/anonymize.json' doput 'Anonymize a user' dotags 'Users', 'Admin'+ operationId 'anonymizeUser'consumes 'application/json'expected_request_schema = nil@@ -365,6 +376,7 @@ describe 'users' dopost 'Log a user out' dotags 'Users', 'Admin'+ operationId 'logOutUser'consumes 'application/json'expected_request_schema = nil@@ -401,6 +413,7 @@ describe 'users' dopost 'Refresh gravatar' dotags 'Users', 'Admin'+ operationId 'refreshGravatar'consumes 'application/json'expected_request_schema = nil@@ -427,6 +440,7 @@ describe 'users' doget 'Get a list of users' dotags 'Users', 'Admin'+ operationId 'adminListUsers'consumes 'application/json'expected_request_schema = nil@@ -488,6 +502,7 @@ describe 'users' doget 'Get a list of user actions' dotags 'Users'+ operationId 'listUserActions'consumes 'application/json'expected_request_schema = nil@@ -516,6 +531,7 @@ describe 'users' dopath '/session/forgot_password.json' dopost 'Send password reset email' dotags 'Users'+ operationId 'sendPasswordResetEmail'consumes 'application/json'expected_request_schema = load_spec_schema('user_password_reset_request')parameter name: :params, in: :body, schema: expected_request_schema@@ -539,6 +555,7 @@ describe 'users' dopath '/users/password-reset/{token}.json' doput 'Change password' dotags 'Users'+ operationId 'changePassword'consumes 'application/json'expected_request_schema = load_spec_schema('user_password_change_request')parameter name: :token, in: :path, type: :string, required: true