Просмотр исходного кода

Merge pull request #10243 from weseek/fix/170293-swagger-jsdoc

fix: Swagger for growi-sdk-typescript
Shun Miyazawa 7 месяцев назад
Родитель
Сommit
ff90f972d1

+ 17 - 11
apps/app/src/server/routes/apiv3/page/index.ts

@@ -341,8 +341,16 @@ module.exports = (crowi) => {
    *                  userRelatedGrantUserGroupIds:
    *                    type: array
    *                    items:
-   *                      type: string
-   *                      description: UserGroup ID
+   *                      type: object
+   *                      properties:
+   *                        type:
+   *                          type: string
+   *                          description: Group type
+   *                          example: 'UserGroup'
+   *                        item:
+   *                          type: string
+   *                          description: UserGroup ID
+   *                          example: '5ae5fccfc5577b0004dbd8ab'
    *                  overwriteScopesOfDescendants:
    *                    type: boolean
    *                    description: Determine whether the scopes of descendants should be overwritten
@@ -368,14 +376,12 @@ module.exports = (crowi) => {
    *            content:
    *              application/json:
    *                schema:
+   *                  type: object
    *                  properties:
-   *                    data:
-   *                      type: object
-   *                      properties:
-   *                        page:
-   *                          $ref: '#/components/schemas/Page'
-   *                        revision:
-   *                          $ref: '#/components/schemas/Revision'
+   *                    page:
+   *                      $ref: '#/components/schemas/Page'
+   *                    revision:
+   *                      $ref: '#/components/schemas/Revision'
    *          403:
    *            $ref: '#/components/responses/Forbidden'
    *          500:
@@ -1083,7 +1089,7 @@ module.exports = (crowi) => {
 
   /**
    * @swagger
-   *   /{pageId}/publish:
+   *   /page/{pageId}/publish:
    *     put:
    *       tags: [Page]
    *       summary: Publish page
@@ -1107,7 +1113,7 @@ module.exports = (crowi) => {
 
   /**
    * @swagger
-   *   /{pageId}/unpublish:
+   *   /page/{pageId}/unpublish:
    *     put:
    *       tags: [Page]
    *       summary: Unpublish page

+ 16 - 17
apps/app/src/server/routes/apiv3/share-links.js

@@ -185,23 +185,22 @@ module.exports = (crowi) => {
    *        security:
    *          - cookieAuth: []
    *        description: Create new share link
-   *        parameters:
-   *          - name: relatedPage
-   *            in: query
-   *            required: true
-   *            description: page id of share link
-   *            schema:
-   *              type: string
-   *          - name: expiredAt
-   *            in: query
-   *            description: expiration date of share link
-   *            schema:
-   *              type: string
-   *          - name: description
-   *            in: query
-   *            description: description of share link
-   *            schema:
-   *              type: string
+   *        requestBody:
+   *          content:
+   *            application/json:
+   *              schema:
+   *                required:
+   *                  - relatedPage
+   *                properties:
+   *                  relatedPage:
+   *                    description: page id of share link
+   *                    type: string
+   *                  expiredAt:
+   *                    description: expiration date of share link
+   *                    type: string
+   *                  description:
+   *                    description: description of share link
+   *                    type: string
    *        responses:
    *          200:
    *            description: Succeeded to create one share link

+ 2 - 2
apps/app/src/server/routes/apiv3/users.js

@@ -1,5 +1,6 @@
 import path from 'path';
 
+import { SCOPE } from '@growi/core/dist/interfaces';
 import { ErrorV3 } from '@growi/core/dist/models';
 import { serializeUserSecurely } from '@growi/core/dist/models/serializers';
 import { userHomepagePath } from '@growi/core/dist/utils/page-path-utils';
@@ -11,7 +12,6 @@ import { isEmail } from 'validator';
 import ExternalUserGroupRelation from '~/features/external-user-group/server/models/external-user-group-relation';
 import { deleteUserAiAssistant } from '~/features/openai/server/services/delete-ai-assistant';
 import { SupportedAction } from '~/interfaces/activity';
-import { SCOPE } from '@growi/core/dist/interfaces';
 import { accessTokenParser } from '~/server/middlewares/access-token-parser';
 import Activity from '~/server/models/activity';
 import ExternalAccount from '~/server/models/external-account';
@@ -371,7 +371,7 @@ module.exports = (crowi) => {
    * @swagger
    *
    *  paths:
-   *    /{id}/recent:
+   *    /users/{id}/recent:
    *      get:
    *        tags: [Users]
    *        summary: /usersIdReacent