Yuki Takei 1 tahun lalu
induk
melakukan
02fa1d06c2

+ 12 - 9
apps/app/src/server/routes/apiv3/export.js

@@ -30,7 +30,8 @@ const router = express.Router();
  *          isExporting:
  *            type: boolean
  *          progressList:
- *            type: [array, null]
+ *            type: array
+ *            nullable: true
  *            items:
  *              type: string
  *      ExportZipFileStat:
@@ -107,14 +108,16 @@ const router = express.Router();
  *          collectionName:
  *            type: string
  *          meta:
- *           progressList:
- *             type: array
- *             items:
- *               type: object
- *               description: progress data for each exporting collections
- *           isExporting:
- *             type: boolean
- *             description: whether the current exporting job exists or not
+ *            type: object
+ *            properties:
+ *              progressList:
+ *                type: array
+ *                items:
+ *                  type: object
+ *                  description: progress data for each exporting collections
+ *              isExporting:
+ *                type: boolean
+ *                description: whether the current exporting job exists or not
  */
 /** @param {import('~/server/crowi').default} crowi Crowi instance */
 module.exports = (crowi) => {

+ 13 - 8
apps/app/src/server/routes/apiv3/personal-setting.js

@@ -276,9 +276,11 @@ module.exports = (crowi) => {
    *          required: true
    *          content:
    *            application/json:
-   *              properties:
-   *                isGravatarEnabled:
-   *                  type: boolean
+   *              schema:
+   *                type: object
+   *                properties:
+   *                  isGravatarEnabled:
+   *                    type: boolean
    *        responses:
    *          200:
    *            description: succeded to update user image type
@@ -354,11 +356,13 @@ module.exports = (crowi) => {
    *          required: true
    *          content:
    *            application/json:
-   *              properties:
-   *                oldPassword:
-   *                  type: string
-   *                newPassword:
-   *                  type: string
+   *              schema:
+   *                type: object
+   *                properties:
+   *                  oldPassword:
+   *                    type: string
+   *                  newPassword:
+   *                    type: string
    *        responses:
    *          200:
    *            description: user password
@@ -446,6 +450,7 @@ module.exports = (crowi) => {
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
    *                  username:
    *                    type: string

+ 1 - 1
apps/app/src/server/routes/apiv3/security-settings/index.js

@@ -274,7 +274,7 @@ const validator = {
  *            description: certificate for saml
  *          samlEnvVarCert:
  *            type: string
- *            desription: certificate for saml
+ *            description: certificate for saml
  *          samlAttrMapId:
  *            type: string
  *            description: attribute mapping id for saml

+ 55 - 47
apps/app/src/server/routes/apiv3/slack-integration-settings.js

@@ -170,32 +170,34 @@ module.exports = (crowi) => {
    *            description: Succeeded to get info.
    *            content:
    *              application/json:
-   *                properties:
-   *                  currentBotType:
-   *                    type: string
-   *                  settings:
-   *                    type: object
-   *                    properties:
-   *                      slackSigningSecretEnvVars:
-   *                        type: string
-   *                      slackBotTokenEnvVars:
-   *                        type: string
-   *                      slackSigningSecret:
-   *                        type: string
-   *                      slackBotToken:
-   *                        type: string
-   *                      commandPermission:
-   *                        type: object
-   *                      eventActionsPermission:
-   *                        type: object
-   *                      proxyServerUri:
-   *                        type: string
-   *                  connectionStatuses:
-   *                    type: object
-   *                  errorMsg:
-   *                    type: string
-   *                  errorCode:
-   *                    type: string
+   *                schema:
+   *                  type: object
+   *                  properties:
+   *                    currentBotType:
+   *                      type: string
+   *                    settings:
+   *                      type: object
+   *                      properties:
+   *                        slackSigningSecretEnvVars:
+   *                          type: string
+   *                        slackBotTokenEnvVars:
+   *                          type: string
+   *                        slackSigningSecret:
+   *                          type: string
+   *                        slackBotToken:
+   *                          type: string
+   *                        commandPermission:
+   *                          type: object
+   *                        eventActionsPermission:
+   *                          type: object
+   *                        proxyServerUri:
+   *                          type: string
+   *                    connectionStatuses:
+   *                      type: object
+   *                    errorMsg:
+   *                      type: string
+   *                    errorCode:
+   *                      type: string
    */
   router.get('/', accessTokenParser, loginRequiredStrictly, adminRequired, async(req, res) => {
 
@@ -399,6 +401,7 @@ module.exports = (crowi) => {
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
    *                  slackSigningSecret:
    *                    type: string
@@ -451,6 +454,7 @@ module.exports = (crowi) => {
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
    *                  commandPermission:
    *                    type: object
@@ -506,19 +510,21 @@ module.exports = (crowi) => {
    *            description: Succeeded to create slack app integration
    *            content:
    *              application/json:
-   *                properties:
-   *                  tokenGtoP:
-   *                    type: string
-   *                  tokenPtoG:
-   *                    type: string
-   *                  permissionsForBroadcastUseCommands:
-   *                    type: object
-   *                  permissionsForSingleUseCommands:
-   *                    type: object
-   *                  permissionsForSlackEvents:
-   *                    type: object
-   *                  isPrimary:
-   *                    type: boolean
+   *                schema:
+   *                  type: object
+   *                  properties:
+   *                    tokenGtoP:
+   *                      type: string
+   *                    tokenPtoG:
+   *                      type: string
+   *                    permissionsForBroadcastUseCommands:
+   *                      type: object
+   *                    permissionsForSingleUseCommands:
+   *                      type: object
+   *                    permissionsForSlackEvents:
+   *                      type: object
+   *                    isPrimary:
+   *                      type: boolean
    */
   router.post('/slack-app-integrations', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
     const SlackAppIntegrationRecordsNum = await SlackAppIntegration.countDocuments();
@@ -560,7 +566,7 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /slack-integration-settings/slack-app-integrations/:id:
+   *    /slack-integration-settings/slack-app-integrations/{id}:
    *      delete:
    *        tags: [SlackIntegrationSettings (with proxy)]
    *        security:
@@ -579,9 +585,11 @@ module.exports = (crowi) => {
    *            description: Succeeded to delete access tokens for slack
    *            content:
    *              application/json:
-   *                properties:
-   *                  response:
-   *                    type: object
+   *                schema:
+   *                  type: object
+   *                  properties:
+   *                    response:
+   *                      type: object
    */
   router.delete('/slack-app-integrations/:id', loginRequiredStrictly, adminRequired, validator.deleteIntegration, apiV3FormValidator, addActivity,
     async(req, res) => {
@@ -657,7 +665,7 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /slack-integration-settings/slack-app-integrations/:id/makeprimary:
+   *    /slack-integration-settings/slack-app-integrations/{id}/makeprimary:
    *      put:
    *        tags: [SlackIntegrationSettings (with proxy)]
    *        security:
@@ -712,7 +720,7 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /slack-integration-settings/slack-app-integrations/:id/regenerate-tokens:
+   *    /slack-integration-settings/slack-app-integrations/{id}/regenerate-tokens:
    *      put:
    *        tags: [SlackIntegrationSettings (with proxy)]
    *        security:
@@ -757,7 +765,7 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /slack-integration-settings/slack-app-integrations/:id/permissions:
+   *    /slack-integration-settings/slack-app-integrations/{id}/permissions:
    *      put:
    *        tags: [SlackIntegrationSettings (with proxy)]
    *        security:
@@ -840,7 +848,7 @@ module.exports = (crowi) => {
   /**
    * @swagger
    *
-   *    /slack-integration-settings/slack-app-integrations/:id/relation-test:
+   *    /slack-integration-settings/slack-app-integrations/{id}/relation-test:
    *      post:
    *        tags: [SlackIntegrationSettings (with proxy)]
    *        security:

+ 21 - 13
apps/app/src/server/routes/apiv3/slack-integration.js

@@ -320,9 +320,11 @@ module.exports = (crowi) => {
    *     responses:
    *       200:
    *         description: OK
-   *         schema:
-   *           type: string
-   *           example: "No text."
+   *         content:
+   *           application/json:
+   *             schema:
+   *               type: string
+   *               example: "No text."
    */
   router.post('/commands', addSigningSecretToReq, verifySlackRequest, checkCommandsPermission, async(req, res) => {
     const { body } = req;
@@ -365,11 +367,13 @@ module.exports = (crowi) => {
    *     responses:
    *       200:
    *         description: OK
-   *         schema:
-   *           type: object
-   *           properties:
-   *             challenge:
-   *               type: string
+   *         content:
+   *           application/json:
+   *             schema:
+   *               type: object
+   *               properties:
+   *                 challenge:
+   *                   type: string
    */
   router.post('/proxied/verify', verifyAccessTokenFromProxy, async(req, res) => {
     const { body } = req;
@@ -400,9 +404,11 @@ module.exports = (crowi) => {
    *     responses:
    *       200:
    *         description: OK
-   *         schema:
-   *           type: string
-   *           example: "No text."
+   *         content:
+   *           application/json:
+   *             schema:
+   *               type: string
+   *               example: "No text."
    */
   router.post('/proxied/commands', verifyAccessTokenFromProxy, checkCommandsPermission, async(req, res) => {
     const { body } = req;
@@ -554,8 +560,10 @@ module.exports = (crowi) => {
    *     responses:
    *       200:
    *         description: OK
-   *         schema:
-   *           type: object
+   *         content:
+   *           application/json:
+   *             schema:
+   *               type: object
    */
   router.post('/events', verifyUrlMiddleware, addSigningSecretToReq, verifySlackRequest, async(req, res) => {
     const { event } = req.body;