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

fix jsdoc for openapi components

Yuki Takei 6 лет назад
Родитель
Сommit
6c0402c4d6
1 измененных файлов с 21 добавлено и 21 удалено
  1. 21 21
      src/server/routes/apiv3/export.js

+ 21 - 21
src/server/routes/apiv3/export.js

@@ -14,26 +14,26 @@ const router = express.Router();
  */
  */
 
 
 /**
 /**
- * FIXME: get rid of linting errors
- * @//swagger
+ * @swagger
  *
  *
- *  definitions:
- *    ExportStatus:
- *      type: object
- *      properties:
- *        zipFileStats:
- *          type: array
- *          items:
- *            type: object
- *            description: the property of each file
- *        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
+ *  components:
+ *    schemas:
+ *      ExportStatus:
+ *        type: object
+ *        properties:
+ *          zipFileStats:
+ *            type: array
+ *            items:
+ *              type: object
+ *              description: the property of each file
+ *          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
  */
  */
 
 
 module.exports = (crowi) => {
 module.exports = (crowi) => {
@@ -70,7 +70,7 @@ module.exports = (crowi) => {
    *              schema:
    *              schema:
    *                properties:
    *                properties:
    *                  status:
    *                  status:
-   *                    $ref: 'ExportStatus'
+   *                    $ref: '#/components/schemas/ExportStatus'
    */
    */
   router.get('/status', accessTokenParser, loginRequired, adminRequired, async(req, res) => {
   router.get('/status', accessTokenParser, loginRequired, adminRequired, async(req, res) => {
     const status = await exportService.getStatus();
     const status = await exportService.getStatus();
@@ -97,7 +97,7 @@ module.exports = (crowi) => {
    *              schema:
    *              schema:
    *                properties:
    *                properties:
    *                  status:
    *                  status:
-   *                    $ref: 'ExportStatus'
+   *                    $ref: '#/components/schemas/ExportStatus'
    */
    */
   router.post('/', accessTokenParser, loginRequired, adminRequired, csrf, async(req, res) => {
   router.post('/', accessTokenParser, loginRequired, adminRequired, csrf, async(req, res) => {
     // TODO: add express validator
     // TODO: add express validator