DEV: Add missing operationIds to the api docs (#14235)

From the openapi spec:

 https://spec.openapis.org/oas/latest.html#fixed-fields-7

each endpoint needs to have an `operationId`:

> Unique string used to identify the operation. The id MUST be unique
> among all operations described in the API. The operationId value is
> case-sensitive. Tools and libraries MAY use the operationId to uniquely
> identify an operation, therefore, it is RECOMMENDED to follow common
> programming naming conventions.

Running the linter on our openapi.json file with this command:

`npx @redocly/openapi-cli lint openapi.json`

produced the following warning on all of our endpoints:

> Operation object should contain `operationId` field

This commit resolves these warnings by adding an operationId field to
each endpoint.
This commit is contained in:
Blake Erickson
2021-09-03 07:39:29 -06:00
committed by GitHub
parent 85c31c73ba
commit ee7809e8a8
14 changed files with 70 additions and 97 deletions

View File

@@ -36,6 +36,7 @@ describe 'backups' do
path '/admin/backups.json' do path '/admin/backups.json' do
get 'List backups' do get 'List backups' do
tags 'Backups' tags 'Backups'
operationId 'getBackups'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -53,6 +54,7 @@ describe 'backups' do
post 'Create backup' do post 'Create backup' do
tags 'Backups' tags 'Backups'
operationId 'createBackup'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('backups_create_request') expected_request_schema = load_spec_schema('backups_create_request')
parameter name: :params, in: :body, schema: expected_request_schema parameter name: :params, in: :body, schema: expected_request_schema
@@ -81,6 +83,7 @@ describe 'backups' do
path '/admin/backups/{filename}' do path '/admin/backups/{filename}' do
put 'Send download backup email' do put 'Send download backup email' do
tags 'Backups' tags 'Backups'
operationId 'sendDownloadBackupEmail'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
parameter name: :filename, in: :path, type: :string, required: true parameter name: :filename, in: :path, type: :string, required: true
@@ -100,6 +103,7 @@ describe 'backups' do
get 'Download backup' do get 'Download backup' do
tags 'Backups' tags 'Backups'
operationId 'downloadBackup'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
parameter name: :filename, in: :path, type: :string, required: true parameter name: :filename, in: :path, type: :string, required: true

View File

@@ -15,6 +15,7 @@ describe 'badges' do
get 'List badges' do get 'List badges' do
tags 'Badges' tags 'Badges'
operationId 'adminListBadges'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -32,6 +33,7 @@ describe 'badges' do
post 'Create badge' do post 'Create badge' do
tags 'Badges' tags 'Badges'
operationId 'createBadge'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('badge_create_request') expected_request_schema = load_spec_schema('badge_create_request')
parameter name: :params, in: :body, schema: expected_request_schema parameter name: :params, in: :body, schema: expected_request_schema
@@ -58,6 +60,7 @@ describe 'badges' do
put 'Update badge' do put 'Update badge' do
tags 'Badges' tags 'Badges'
operationId 'updateBadge'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('badge_update_request') expected_request_schema = load_spec_schema('badge_update_request')
parameter name: :id, in: :path, schema: { type: :integer } parameter name: :id, in: :path, schema: { type: :integer }
@@ -84,6 +87,7 @@ describe 'badges' do
delete 'Delete badge' do delete 'Delete badge' do
tags 'Badges' tags 'Badges'
operationId 'deleteBadge'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
parameter name: :id, in: :path, schema: { type: :integer } parameter name: :id, in: :path, schema: { type: :integer }

View File

@@ -15,6 +15,7 @@ describe 'categories' do
post 'Creates a category' do post 'Creates a category' do
tags 'Categories' tags 'Categories'
operationId 'createCategory'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('category_create_request') expected_request_schema = load_spec_schema('category_create_request')
parameter name: :params, in: :body, schema: expected_request_schema parameter name: :params, in: :body, schema: expected_request_schema
@@ -35,6 +36,7 @@ describe 'categories' do
get 'Retrieves a list of categories' do get 'Retrieves a list of categories' do
tags 'Categories' tags 'Categories'
operationId 'listCategories'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -55,6 +57,7 @@ describe 'categories' do
put 'Updates a category' do put 'Updates a category' do
tags 'Categories' tags 'Categories'
operationId 'updateCategory'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('category_create_request') expected_request_schema = load_spec_schema('category_create_request')
parameter name: :id, in: :path, schema: { type: :integer } parameter name: :id, in: :path, schema: { type: :integer }
@@ -80,6 +83,7 @@ describe 'categories' do
get 'List topics' do get 'List topics' do
tags 'Categories' tags 'Categories'
operationId 'listCategoryTopics'
produces 'application/json' produces 'application/json'
parameter name: :slug, in: :path, schema: { type: :string } parameter name: :slug, in: :path, schema: { type: :string }
parameter name: :id, in: :path, schema: { type: :integer } parameter name: :id, in: :path, schema: { type: :integer }
@@ -105,6 +109,7 @@ describe 'categories' do
get 'Show category' do get 'Show category' do
tags 'Categories' tags 'Categories'
operationId 'getCategory'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, schema: { type: :integer } parameter name: :id, in: :path, schema: { type: :integer }
expected_request_schema = nil expected_request_schema = nil

View File

@@ -13,6 +13,7 @@ describe 'groups' do
path '/admin/groups.json' do path '/admin/groups.json' do
post 'Creates a group' do post 'Creates a group' do
tags 'Groups' tags 'Groups'
operationId 'createGroup'
consumes 'application/json' consumes 'application/json'
parameter name: :group, in: :body, schema: { parameter name: :group, in: :body, schema: {
type: :object, type: :object,
@@ -78,6 +79,7 @@ describe 'groups' do
path '/admin/groups/{id}.json' do path '/admin/groups/{id}.json' do
delete 'Delete a group' do delete 'Delete a group' do
tags 'Groups' tags 'Groups'
operationId 'deleteGroup'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, type: :integer parameter name: :id, in: :path, type: :integer
expected_request_schema = nil expected_request_schema = nil
@@ -99,6 +101,7 @@ describe 'groups' do
path '/groups/{id}.json' do path '/groups/{id}.json' do
put 'Update a group' do put 'Update a group' do
tags 'Groups' tags 'Groups'
operationId 'updateGroup'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, type: :integer parameter name: :id, in: :path, type: :integer
parameter name: :group, in: :body, schema: { parameter name: :group, in: :body, schema: {
@@ -128,6 +131,7 @@ describe 'groups' do
get 'Get a group' do get 'Get a group' do
tags 'Groups' tags 'Groups'
operationId 'getGroup'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, type: :string, example: 'name', description: "Use group name instead of id" parameter name: :id, in: :path, type: :string, example: 'name', description: "Use group name instead of id"
expected_request_schema = nil expected_request_schema = nil
@@ -150,6 +154,7 @@ describe 'groups' do
path '/groups/{id}/members.json' do path '/groups/{id}/members.json' do
get 'List group members' do get 'List group members' do
tags 'Groups' tags 'Groups'
operationId 'listGroupMembers'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, type: :string, example: 'name', description: "Use group name instead of id" parameter name: :id, in: :path, type: :string, example: 'name', description: "Use group name instead of id"
expected_request_schema = nil expected_request_schema = nil
@@ -170,6 +175,7 @@ describe 'groups' do
put 'Add group members' do put 'Add group members' do
tags 'Groups' tags 'Groups'
operationId 'addGroupMembers'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, type: :integer parameter name: :id, in: :path, type: :integer
expected_request_schema = load_spec_schema('group_add_members_request') expected_request_schema = load_spec_schema('group_add_members_request')
@@ -195,6 +201,7 @@ describe 'groups' do
delete 'Remove group members' do delete 'Remove group members' do
tags 'Groups' tags 'Groups'
operationId 'removeGroupMembers'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, type: :integer parameter name: :id, in: :path, type: :integer
expected_request_schema = load_spec_schema('group_remove_members_request') expected_request_schema = load_spec_schema('group_remove_members_request')
@@ -222,6 +229,7 @@ describe 'groups' do
path '/groups.json' do path '/groups.json' do
get 'List groups' do get 'List groups' do
tags 'Groups' tags 'Groups'
operationId 'listGroups'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil

View File

@@ -9,6 +9,7 @@ describe 'invites' do
path '/invites.json' do path '/invites.json' do
post 'Create an invite' do post 'Create an invite' do
tags 'Invites' tags 'Invites'
operationId 'createInvite'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true

View File

@@ -15,6 +15,7 @@ describe 'notifications' do
get 'Get the notifications that belong to the current user' do get 'Get the notifications that belong to the current user' do
tags 'Notifications' tags 'Notifications'
operationId 'getNotifications'
produces 'application/json' produces 'application/json'
response '200', 'notifications' do response '200', 'notifications' do
@@ -60,6 +61,7 @@ describe 'notifications' do
put 'Mark notifications as read' do put 'Mark notifications as read' do
tags 'Notifications' tags 'Notifications'
operationId 'markNotificationsAsRead'
consumes 'application/json' consumes 'application/json'
parameter name: :notification, in: :body, schema: { parameter name: :notification, in: :body, schema: {
type: :object, type: :object,

View File

@@ -16,6 +16,7 @@ describe 'posts' do
get 'List latest posts across topics' do get 'List latest posts across topics' do
tags 'Posts' tags 'Posts'
operationId 'listPosts'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
produces 'application/json' produces 'application/json'
@@ -98,6 +99,7 @@ describe 'posts' do
post 'Creates a new topic, a new post, or a private message' do post 'Creates a new topic, a new post, or a private message' do
tags 'Posts', 'Topics', 'Private Messages' tags 'Posts', 'Topics', 'Private Messages'
operationId 'createTopicPostPM'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('topic_create_request') expected_request_schema = load_spec_schema('topic_create_request')
parameter name: :params, in: :body, schema: expected_request_schema parameter name: :params, in: :body, schema: expected_request_schema
@@ -121,6 +123,7 @@ describe 'posts' do
get 'Retrieve a single post' do get 'Retrieve a single post' do
tags 'Posts' tags 'Posts'
operationId 'getPost'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
parameter name: :id, in: :path, schema: { type: :string } parameter name: :id, in: :path, schema: { type: :string }
@@ -194,6 +197,7 @@ describe 'posts' do
put 'Update a single post' do put 'Update a single post' do
tags 'Posts' tags 'Posts'
operationId 'updatePost'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -292,6 +296,7 @@ describe 'posts' do
path '/posts/{id}/locked.json' do path '/posts/{id}/locked.json' do
put 'Lock a post from being edited' do put 'Lock a post from being edited' do
tags 'Posts' tags 'Posts'
operationId 'lockPost'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -324,6 +329,7 @@ describe 'posts' do
path '/post_actions.json' do path '/post_actions.json' do
post 'Like a post and other actions' do post 'Like a post and other actions' do
tags 'Posts' tags 'Posts'
operationId 'performPostAction'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true

View File

@@ -14,6 +14,7 @@ describe 'private messages' do
get 'Get a list of private messages for a user' do get 'Get a list of private messages for a user' do
tags 'Private Messages' tags 'Private Messages'
operationId 'listUserPrivateMessages'
parameter name: :username, in: :path, schema: { type: :string } parameter name: :username, in: :path, schema: { type: :string }
produces 'application/json' produces 'application/json'
@@ -123,6 +124,7 @@ describe 'private messages' do
get 'Get a list of private messages sent for a user' do get 'Get a list of private messages sent for a user' do
tags 'Private Messages' tags 'Private Messages'
operationId 'getUserSentPrivateMessages'
parameter name: :username, in: :path, schema: { type: :string } parameter name: :username, in: :path, schema: { type: :string }
produces 'application/json' produces 'application/json'

View File

@@ -13,6 +13,7 @@ describe 'groups' do
path '/search.json' do path '/search.json' do
get 'Search for a term' do get 'Search for a term' do
tags 'Search' tags 'Search'
operationId 'search'
consumes 'application/json' consumes 'application/json'
parameter( parameter(
name: :q, name: :q,

View File

@@ -17,6 +17,7 @@ describe 'tags' do
get 'Get a list of tag groups' do get 'Get a list of tag groups' do
tags 'Tags' tags 'Tags'
operationId 'listTagGroups'
produces 'application/json' produces 'application/json'
response '200', 'tags' do response '200', 'tags' do
@@ -59,6 +60,7 @@ describe 'tags' do
post 'Creates a tag group' do post 'Creates a tag group' do
tags 'Tags' tags 'Tags'
operationId 'createTagGroup'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('tag_group_create_request') expected_request_schema = load_spec_schema('tag_group_create_request')
@@ -85,6 +87,7 @@ describe 'tags' do
get 'Get a single tag group' do get 'Get a single tag group' do
tags 'Tags' tags 'Tags'
operationId 'getTagGroup'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, schema: { type: :string } parameter name: :id, in: :path, schema: { type: :string }
@@ -127,6 +130,7 @@ describe 'tags' do
put 'Update tag group' do put 'Update tag group' do
tags 'Tags' tags 'Tags'
operationId 'updateTagGroup'
consumes 'application/json' consumes 'application/json'
parameter name: :id, in: :path, schema: { type: :string } parameter name: :id, in: :path, schema: { type: :string }
parameter name: :put_body, in: :body, schema: { parameter name: :put_body, in: :body, schema: {
@@ -177,6 +181,7 @@ describe 'tags' do
get 'Get a list of tags' do get 'Get a list of tags' do
tags 'Tags' tags 'Tags'
operationId 'listTags'
produces 'application/json' produces 'application/json'
response '200', 'notifications' do response '200', 'notifications' do
@@ -215,6 +220,7 @@ describe 'tags' do
get 'Get a specific tag' do get 'Get a specific tag' do
tags 'Tags' tags 'Tags'
operationId 'getTag'
parameter name: :name, in: :path, schema: { type: :string } parameter name: :name, in: :path, schema: { type: :string }
produces 'application/json' produces 'application/json'

View File

@@ -9,6 +9,7 @@ describe 'topics' do
path '/t/{id}/posts.json' do path '/t/{id}/posts.json' do
get 'Get specific posts from a topic' do get 'Get specific posts from a topic' do
tags 'Topics' tags 'Topics'
operationId 'getSpecificPostsFromTopic'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -107,6 +108,7 @@ describe 'topics' do
path '/t/{id}.json' do path '/t/{id}.json' do
get 'Get a single topic' do get 'Get a single topic' do
tags 'Topics' tags 'Topics'
operationId 'getTopic'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -375,6 +377,7 @@ describe 'topics' do
delete 'Remove a topic' do delete 'Remove a topic' do
tags 'Topics' tags 'Topics'
operationId 'removeTopic'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -392,6 +395,7 @@ describe 'topics' do
path '/t/-/{id}.json' do path '/t/-/{id}.json' do
put 'Update a topic' do put 'Update a topic' do
tags 'Topics' tags 'Topics'
operationId 'updateTopic'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -440,6 +444,7 @@ describe 'topics' do
path '/t/{id}/invite.json' do path '/t/{id}/invite.json' do
post 'Invite to topic' do post 'Invite to topic' do
tags 'Topics', 'Invites' tags 'Topics', 'Invites'
operationId 'inviteToTopic'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -482,6 +487,7 @@ describe 'topics' do
path '/t/{id}/bookmark.json' do path '/t/{id}/bookmark.json' do
put 'Bookmark topic' do put 'Bookmark topic' do
tags 'Topics' tags 'Topics'
operationId 'bookmarkTopic'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -501,6 +507,7 @@ describe 'topics' do
path '/t/{id}/status.json' do path '/t/{id}/status.json' do
put 'Update the status of a topic' do put 'Update the status of a topic' do
tags 'Topics' tags 'Topics'
operationId 'updateTopicStatus'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -543,6 +550,7 @@ describe 'topics' do
path '/latest.json' do path '/latest.json' do
get 'Get the latest topics' do get 'Get the latest topics' do
tags 'Topics' tags 'Topics'
operationId 'listLatestTopics'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -649,106 +657,10 @@ describe 'topics' do
end end
end end
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' do path '/top.json' do
get 'Get the top topics filtered by period' do get 'Get the top topics filtered by period' do
tags 'Topics' tags 'Topics'
operationId 'listTopTopics'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -853,6 +765,7 @@ describe 'topics' do
path '/t/{id}/notifications.json' do path '/t/{id}/notifications.json' do
post 'Set notification level' do post 'Set notification level' do
tags 'Topics' tags 'Topics'
operationId 'setNotificationLevel'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -885,6 +798,7 @@ describe 'topics' do
path '/t/{id}/change-timestamp.json' do path '/t/{id}/change-timestamp.json' do
put 'Update topic timestamp' do put 'Update topic timestamp' do
tags 'Topics' tags 'Topics'
operationId 'updateTopicTimestamp'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -918,6 +832,7 @@ describe 'topics' do
path '/t/{id}/timer.json' do path '/t/{id}/timer.json' do
post 'Create topic timer' do post 'Create topic timer' do
tags 'Topics' tags 'Topics'
operationId 'createTopicTimer'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true

View File

@@ -15,6 +15,7 @@ describe 'uploads' do
path '/uploads.json' do path '/uploads.json' do
post 'Creates an upload' do post 'Creates an upload' do
tags 'Uploads' tags 'Uploads'
operationId 'createUpload'
consumes 'multipart/form-data' consumes 'multipart/form-data'
expected_request_schema = load_spec_schema('upload_create_request') expected_request_schema = load_spec_schema('upload_create_request')

View File

@@ -14,6 +14,7 @@ describe 'user_badges' do
get 'List badges for a user' do get 'List badges for a user' do
tags 'Badges', 'Users' tags 'Badges', 'Users'
operationId 'listUserBadges'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
parameter name: :username, in: :path, schema: { type: :string } parameter name: :username, in: :path, schema: { type: :string }

View File

@@ -17,6 +17,7 @@ describe 'users' do
post 'Creates a user' do post 'Creates a user' do
tags 'Users' tags 'Users'
operationId 'createUser'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -64,6 +65,7 @@ describe 'users' do
get 'Get a single user by username' do get 'Get a single user by username' do
tags 'Users' tags 'Users'
operationId 'getUser'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -83,6 +85,7 @@ describe 'users' do
get 'Get a user by external_id' do get 'Get a user by external_id' do
tags 'Users' tags 'Users'
operationId 'getUserExternalId'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -110,6 +113,7 @@ describe 'users' do
get 'Get a user by identity provider external ID' do get 'Get a user by identity provider external ID' do
tags 'Users' tags 'Users'
operationId 'getUserIdentiyProviderExternalId'
consumes 'application/json' consumes 'application/json'
parameter name: 'Api-Key', in: :header, type: :string, required: true parameter name: 'Api-Key', in: :header, type: :string, required: true
parameter name: 'Api-Username', in: :header, type: :string, required: true parameter name: 'Api-Username', in: :header, type: :string, required: true
@@ -142,6 +146,7 @@ describe 'users' do
put 'Update avatar' do put 'Update avatar' do
tags 'Users' tags 'Users'
operationId 'updateAvatar'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('user_update_avatar_request') expected_request_schema = load_spec_schema('user_update_avatar_request')
@@ -172,6 +177,7 @@ describe 'users' do
put 'Update email' do put 'Update email' do
tags 'Users' tags 'Users'
operationId 'updateEmail'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('user_update_email_request') expected_request_schema = load_spec_schema('user_update_email_request')
@@ -200,6 +206,7 @@ describe 'users' do
get 'Get a public list of users' do get 'Get a public list of users' do
tags 'Users' tags 'Users'
operationId 'listUsersPublic'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -257,6 +264,7 @@ describe 'users' do
get 'Get a user by id' do get 'Get a user by id' do
tags 'Users', 'Admin' tags 'Users', 'Admin'
operationId 'adminGetUser'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -279,6 +287,7 @@ describe 'users' do
delete 'Delete a user' do delete 'Delete a user' do
tags 'Users', 'Admin' tags 'Users', 'Admin'
operationId 'deleteUser'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('user_delete_request') expected_request_schema = load_spec_schema('user_delete_request')
@@ -311,6 +320,7 @@ describe 'users' do
path '/admin/users/{id}/suspend.json' do path '/admin/users/{id}/suspend.json' do
put 'Suspend a user' do put 'Suspend a user' do
tags 'Users', 'Admin' tags 'Users', 'Admin'
operationId 'suspendUser'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('user_suspend_request') expected_request_schema = load_spec_schema('user_suspend_request')
@@ -340,6 +350,7 @@ describe 'users' do
path '/admin/users/{id}/anonymize.json' do path '/admin/users/{id}/anonymize.json' do
put 'Anonymize a user' do put 'Anonymize a user' do
tags 'Users', 'Admin' tags 'Users', 'Admin'
operationId 'anonymizeUser'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -365,6 +376,7 @@ describe 'users' do
post 'Log a user out' do post 'Log a user out' do
tags 'Users', 'Admin' tags 'Users', 'Admin'
operationId 'logOutUser'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -401,6 +413,7 @@ describe 'users' do
post 'Refresh gravatar' do post 'Refresh gravatar' do
tags 'Users', 'Admin' tags 'Users', 'Admin'
operationId 'refreshGravatar'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -427,6 +440,7 @@ describe 'users' do
get 'Get a list of users' do get 'Get a list of users' do
tags 'Users', 'Admin' tags 'Users', 'Admin'
operationId 'adminListUsers'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -488,6 +502,7 @@ describe 'users' do
get 'Get a list of user actions' do get 'Get a list of user actions' do
tags 'Users' tags 'Users'
operationId 'listUserActions'
consumes 'application/json' consumes 'application/json'
expected_request_schema = nil expected_request_schema = nil
@@ -516,6 +531,7 @@ describe 'users' do
path '/session/forgot_password.json' do path '/session/forgot_password.json' do
post 'Send password reset email' do post 'Send password reset email' do
tags 'Users' tags 'Users'
operationId 'sendPasswordResetEmail'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('user_password_reset_request') expected_request_schema = load_spec_schema('user_password_reset_request')
parameter name: :params, in: :body, schema: expected_request_schema parameter name: :params, in: :body, schema: expected_request_schema
@@ -539,6 +555,7 @@ describe 'users' do
path '/users/password-reset/{token}.json' do path '/users/password-reset/{token}.json' do
put 'Change password' do put 'Change password' do
tags 'Users' tags 'Users'
operationId 'changePassword'
consumes 'application/json' consumes 'application/json'
expected_request_schema = load_spec_schema('user_password_change_request') expected_request_schema = load_spec_schema('user_password_change_request')
parameter name: :token, in: :path, type: :string, required: true parameter name: :token, in: :path, type: :string, required: true