Quellcode durchsuchen

support(jsdoc): add swagger document to installer.ts

Atsushi Nakatsugawa vor 1 Jahr
Ursprung
Commit
33936c883f

+ 1 - 0
apps/app/bin/swagger-jsdoc/definition-apiv3.js

@@ -81,6 +81,7 @@ module.exports = {
         'UserGroups',
         'UserGroups',
         'Users Management',
         'Users Management',
         'FullTextSearch Management',
         'FullTextSearch Management',
+        'Install',
       ],
       ],
     },
     },
     {
     {

+ 42 - 0
apps/app/src/server/routes/apiv3/installer.ts

@@ -29,6 +29,48 @@ module.exports = (crowi: Crowi): Router => {
 
 
   const minPasswordLength = configManager.getConfig('crowi', 'app:minPasswordLength');
   const minPasswordLength = configManager.getConfig('crowi', 'app:minPasswordLength');
 
 
+  /**
+   * @swagger
+   *
+   *  /installer:
+   *    post:
+   *      tags: [Install]
+   *      security: []
+   *      operationId: Install
+   *      summary: /installer
+   *      description: Install GROWI
+   *      requestBody:
+   *        required: true
+   *        content:
+   *          application/json:
+   *            schema:
+   *              type: object
+   *              properties:
+   *                registerForm:
+   *                  type: object
+   *                  properties:
+   *                    name:
+   *                      type: string
+   *                    username:
+   *                      type: string
+   *                    email:
+   *                      type: string
+   *                    password:
+   *                      type: string
+   *                    app:globalLang:
+   *                      type: string
+   *                      default: en_US
+   *      responses:
+   *        200:
+   *          description: import settings params
+   *          content:
+   *            application/json:
+   *              schema:
+   *                properties:
+   *                  message:
+   *                    type: string
+   *                    example: Installation completed (Logged in as an admin user)
+   */
   // eslint-disable-next-line max-len
   // eslint-disable-next-line max-len
   router.post('/', registerRules(minPasswordLength), registerValidation, addActivity, async(req: FormRequest, res: ApiV3Response) => {
   router.post('/', registerRules(minPasswordLength), registerValidation, addActivity, async(req: FormRequest, res: ApiV3Response) => {
     const appService = crowi.appService;
     const appService = crowi.appService;