mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
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:
@ -15,6 +15,7 @@ describe 'notifications' do
|
||||
|
||||
get 'Get the notifications that belong to the current user' do
|
||||
tags 'Notifications'
|
||||
operationId 'getNotifications'
|
||||
|
||||
produces 'application/json'
|
||||
response '200', 'notifications' do
|
||||
@ -60,6 +61,7 @@ describe 'notifications' do
|
||||
|
||||
put 'Mark notifications as read' do
|
||||
tags 'Notifications'
|
||||
operationId 'markNotificationsAsRead'
|
||||
consumes 'application/json'
|
||||
parameter name: :notification, in: :body, schema: {
|
||||
type: :object,
|
||||
|
Reference in New Issue
Block a user