Jelajahi Sumber

Merge pull request #9527 from goofmint/fix/doc-v3-invited

support(jsdoc): add swagger document to invited.ts
Yuki Takei 1 tahun lalu
induk
melakukan
675b6f12b2
1 mengubah file dengan 42 tambahan dan 0 penghapusan
  1. 42 0
      apps/app/src/server/routes/apiv3/invited.ts

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

@@ -18,6 +18,48 @@ module.exports = (crowi: Crowi): Router => {
   const applicationInstalled = require('../../middlewares/application-installed')(crowi);
   const router = express.Router();
 
+  /**
+   * @swagger
+   *
+   *  /invited:
+   *    post:
+   *      tags: [Users]
+   *      security:
+   *        - cookieAuth: []
+   *      operationId: activateInvitedUser
+   *      summary: /invited
+   *      description: Activate invited user
+   *      requestBody:
+   *        required: true
+   *        content:
+   *          application/json:
+   *            schema:
+   *              type: object
+   *              properties:
+   *                invitedForm:
+   *                  type: object
+   *                  properties:
+   *                    username:
+   *                      type: string
+   *                      description: The username of the invited user.
+   *                    name:
+   *                      type: string
+   *                      description: The name of the invited user.
+   *                    password:
+   *                      type: string
+   *                      description: The password for the invited user.
+   *      responses:
+   *        200:
+   *          description: User activated successfully
+   *          content:
+   *            application/json:
+   *              schema:
+   *                type: object
+   *                properties:
+   *                  redirectTo:
+   *                    type: string
+   *                    description: URL to redirect after successful activation.
+   */
   router.post('/', applicationInstalled, invitedRules(), invitedValidation, async(req: InvitedFormRequest, res: ApiV3Response) => {
     if (!req.user) {
       return res.apiv3({ redirectTo: '/login' });