Yuki Takei пре 10 месеци
родитељ
комит
ae38c95391

+ 10 - 6
apps/app/src/server/models/openapi/revision.ts

@@ -3,6 +3,15 @@
  *
  *  components:
  *    schemas:
+ *      RevisionBody:
+ *        description: Revision content body
+ *        type: string
+ *        example: |
+ *          # Header
+ *
+ *          - foo
+ *          - bar
+ *
  *      Revision:
  *        description: Revision
  *        type: object
@@ -16,12 +25,7 @@
  *          author:
  *            $ref: '#/components/schemas/ObjectId'
  *          body:
- *            type: string
- *            description: content body
- *            example: |
- *              # test
- *
- *              test
+ *            $ref: '#/components/schemas/RevisionBody'
  *          format:
  *            type: string
  *            description: format

+ 18 - 16
apps/app/src/server/routes/search.ts

@@ -14,26 +14,28 @@ const logger = loggerFactory('growi:routes:search');
  *
  *   components:
  *     schemas:
+ *       ElasticsearchResultMeta:
+ *         type: object
+ *         properties:
+ *           took:
+ *             type: number
+ *             description: Time Elasticsearch took to execute a search(milliseconds)
+ *             example: 34
+ *           total:
+ *             type: number
+ *             description: Number of documents matching search criteria
+ *             example: 2
+ *           results:
+ *             type: number
+ *             description: Actual array length of search results
+ *             example: 2
+ *
  *       ElasticsearchResult:
  *         description: Elasticsearch result v1
  *         type: object
  *         properties:
  *           meta:
- *             type: object
- *             properties:
- *               took:
- *                 type: number
- *                 description: Time Elasticsearch took to execute a search(milliseconds)
- *                 example: 34
- *               total:
- *                 type: number
- *                 description: Number of documents matching search criteria
- *                 example: 2
- *               results:
- *                 type: number
- *                 description: Actual array length of search results
- *                 example: 2
- *
+ *             $ref: '#/components/schemas/ElasticsearchResultMeta'
  */
 module.exports = function(crowi: Crowi, app) {
   const ApiResponse = require('../util/apiResponse');
@@ -81,7 +83,7 @@ module.exports = function(crowi: Crowi, app) {
    *                   ok:
    *                     $ref: '#/components/schemas/V1ResponseOK'
    *                   meta:
-   *                     $ref: '#/components/schemas/ElasticsearchResult/properties/meta'
+   *                     $ref: '#/components/schemas/ElasticsearchResultMeta'
    *                   totalCount:
    *                     type: integer
    *                     description: total count of pages

+ 7 - 4
apps/app/src/server/routes/tag.js

@@ -14,9 +14,14 @@ import ApiResponse from '../util/apiResponse';
  *        description: Tags
  *        type: array
  *        items:
- *          $ref: '#/components/schemas/Tag/properties/name'
+ *          $ref: '#/components/schemas/TagName'
  *        example: ['daily', 'report', 'tips']
  *
+ *      TagName:
+ *        description: Tag name
+ *        type: string
+ *        example: daily
+ *
  *      Tag:
  *        description: Tag
  *        type: object
@@ -26,9 +31,7 @@ import ApiResponse from '../util/apiResponse';
  *            description: tag ID
  *            example: 5e2d6aede35da4004ef7e0b7
  *          name:
- *            type: string
- *            description: tag name
- *            example: daily
+ *            $ref: '#/components/schemas/TagName'
  *          count:
  *            type: number
  *            description: Count of tagged pages