Skip to content

Commit

Permalink
Merge pull request #9340 from goofmint/features/swagger-admin-home
Browse files Browse the repository at this point in the history
support(jsdoc): Add Swagger doc to /_api/v3/admin-home/
  • Loading branch information
yuki-takei authored Nov 15, 2024
2 parents 03c0a0d + 3395ae8 commit 28982d0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
1 change: 1 addition & 0 deletions apps/app/bin/swagger-jsdoc/definition-apiv3.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = {
name: 'System Management API',
tags: [
'Home',
'AdminHome',
'AppSettings',
'SecuritySetting',
'MarkDownSetting',
Expand Down
40 changes: 33 additions & 7 deletions apps/app/src/server/routes/apiv3/admin-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,41 @@ const router = express.Router();
* properties:
* growiVersion:
* type: string
* description: version of growi
* description: GROWI version or '-'
* example: 7.1.0-RC.0
* nodeVersion:
* type: string
* description: version of node
* description: node version or '-'
* example: 20.2.0
* npmVersion:
* type: string
* description: version of npm
* description: npm version or '-'
* example: 9.6.6
* pnpmVersion:
* type: string
* description: version of pnpm
* description: pnpm version or '-'
* example: 9.12.3
* envVars:
* type: object
* description: environment variables
* additionalProperties:
* type: string
* example:
* "FILE_UPLOAD": "mongodb"
* "APP_SITE_URL": "http://localhost:3000"
* "ELASTICSEARCH_URI": "http://elasticsearch:9200/growi"
* "ELASTICSEARCH_REQUEST_TIMEOUT": 15000
* "ELASTICSEARCH_REJECT_UNAUTHORIZED": true
* "OGP_URI": "http://ogp:8088"
* "QUESTIONNAIRE_SERVER_ORIGIN": "http://host.docker.internal:3003"
* isV5Compatible:
* type: boolean
* description: This value is true if this GROWI is compatible v5.
* example: true
* isMaintenanceMode:
* type: boolean
* description: This value is true if this site is maintenance mode.
* example: false
* InstalledPluginsParams:
* type: object
* properties:
Expand All @@ -41,9 +66,11 @@ module.exports = (crowi) => {
*
* /admin-home/:
* get:
* tags: [Admin]
* tags: [AdminHome]
* operationId: getAdminHome
* summary: /admin-home
* security:
* - cookieAuth: []
* description: Get adminHome parameters
* responses:
* 200:
Expand All @@ -53,8 +80,7 @@ module.exports = (crowi) => {
* schema:
* properties:
* adminHomeParams:
* type: object
* description: adminHome params
* $ref: "#/components/schemas/SystemInformationParams"
*/
router.get('/', loginRequiredStrictly, adminRequired, async(req, res) => {
const adminHomeParams = {
Expand Down

0 comments on commit 28982d0

Please sign in to comment.