Skip to content

Commit

Permalink
docs: update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Sep 17, 2024
1 parent a8e1454 commit 5555862
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 32 deletions.
83 changes: 51 additions & 32 deletions src/docs/module.doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ paths:
type: string
enum:
- hivemind
- violationDetection
community:
type: string
format: objectId
responses:
"201":
'201':
description: Module created successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/Module"
"400":
$ref: '#/components/schemas/Module'
'400':
description: Bad Request
$ref: "#/components/responses/BadRequest"
"401":
$ref: '#/components/responses/BadRequest'
'401':
description: Unauthorized
$ref: "#/components/responses/Unauthorized"
$ref: '#/components/responses/Unauthorized'

get:
tags:
- Module
Expand All @@ -48,12 +49,13 @@ paths:
type: string
enum:
- hivemind
- violationDetection
- in: query
name: community
schema:
type: string
format: objectId
description:
description:
required: true
- in: query
name: sortBy
Expand All @@ -75,7 +77,7 @@ paths:
default: 1
description: Page number
responses:
"200":
'200':
description: OK
content:
application/json:
Expand All @@ -85,7 +87,7 @@ paths:
results:
type: array
items:
$ref: "#/components/schemas/Module"
$ref: '#/components/schemas/Module'
page:
type: integer
example: 1
Expand All @@ -98,9 +100,9 @@ paths:
totalResults:
type: integer
example: 1
"401":
'401':
description: Unauthorized
$ref: "#/components/responses/Unauthorized"
$ref: '#/components/responses/Unauthorized'

/api/v1/modules/{moduleId}:
get:
Expand All @@ -117,18 +119,18 @@ paths:
schema:
type: string
responses:
"200":
'200':
description: Module details retrieved successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/Module"
"401":
$ref: '#/components/schemas/Module'
'401':
description: Unauthorized
$ref: "#/components/responses/Unauthorized"
"404":
$ref: '#/components/responses/Unauthorized'
'404':
description: NotFound
$ref: "#/components/responses/NotFound"
$ref: '#/components/responses/NotFound'

patch:
tags:
Expand Down Expand Up @@ -165,7 +167,7 @@ paths:
name:
type: string
description: Name of the platform.
enum: ['discord', 'google','github','notion','mediaWiki']
enum: ['discord', 'google', 'github', 'notion', 'mediaWiki', 'discourse']
metadata:
type: object
description: Metadata specific to the module and platform. Varies depending on the platform name and module name.
Expand All @@ -174,7 +176,7 @@ paths:
properties:
answering:
type: object
required: ["selectedChannels"]
required: ['selectedChannels']
properties:
selectedChannels:
type: array
Expand All @@ -183,7 +185,7 @@ paths:
description: Channels selected for answering queries.
learning:
type: object
required: ["selectedChannels", "fromDate"]
required: ['selectedChannels', 'fromDate']
properties:
selectedChannels:
type: array
Expand Down Expand Up @@ -232,20 +234,37 @@ paths:
items:
type: string
description: Metadata for the hivemind module on MediaWiki.
- type: object
properties:
selectedEmails:
type: array
items:
type: string
fromDate:
type: string
format: date.
toDate:
type: string
format: date.
selectedResources:
type: array
items:
type: integer
description: Metadata for the violation detection module on Discourse.
minProperties: 1
responses:
"200":
'200':
description: Module updated successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/Module"
"401":
$ref: '#/components/schemas/Module'
'401':
description: Unauthorized
$ref: "#/components/responses/Unauthorized"
"404":
$ref: '#/components/responses/Unauthorized'
'404':
description: NotFound
$ref: "#/components/responses/NotFound"
$ref: '#/components/responses/NotFound'

delete:
tags:
Expand All @@ -261,11 +280,11 @@ paths:
schema:
type: string
responses:
"204":
'204':
description: Module deleted successfully.
"401":
'401':
description: Unauthorized
$ref: "#/components/responses/Unauthorized"
"404":
$ref: '#/components/responses/Unauthorized'
'404':
description: NotFound
$ref: "#/components/responses/NotFound"
$ref: '#/components/responses/NotFound'
16 changes: 16 additions & 0 deletions src/docs/platform.doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ paths:
- github
- notion
- mediaWiki
- discourse
description: Name of the platform to create. Must be one of the supported platforms.
community:
type: string
Expand Down Expand Up @@ -170,6 +171,21 @@ paths:
type: string
default: /w/api.php
description: Metadata for MediaWiki.
- type: object
required: [id, period, analyzerStartedAt, resources]
properties:
id:
type: string
example: gov.optimism.io
period:
type: date
analyzerStartedAt:
type: date
resources:
type: array
items:
type: integer
description: Metadata for Discourse.
responses:
'201':
description: Platform created successfully.
Expand Down

0 comments on commit 5555862

Please sign in to comment.