可以自动调整文档而不是手动输入?这是基于模型

时间:2018-03-19 02:26:21

标签: node.js swagger

可以自动调整文档而不是手动输入吗?有谁知道一些工具?还是图书馆? 。根据下面的示例,而不是手动输入那些可以根据模型自动生成它的工具? ,环回可以做到吗?还是有人知道一些工具? 。并且真正的环回支持swagger docs生成。谢谢。

swagger: '2.0'
info:
  version: 1.0.0
  title: customcat
basePath: /api
host: 127.0.0.1:3333
consumes:
  - application/json
  - application/x-www-form-urlencoded
  - application/xml
  - text/xml
produces:
  - application/json
  - application/xml
  - text/xml
  - application/javascript
  - text/javascript
paths:
  /notes:
    post:
      tags:
        - note
      summary: Create a new instance of the model and persist it into the data source.
      operationId: note.create
      parameters:
        - name: data
          in: body
          description: Model instance data
          required: false
          schema:
            $ref: '#/definitions/note'
      responses:
        '200':
          description: Request was successful
          schema:
            $ref: '#/definitions/note'
      deprecated: false
    put:
      tags:
        - note
      summary: >-
        Update an existing model instance or insert a new one into the data
        source.
      operationId: note.upsert
      parameters:
        - name: data
          in: body
          description: Model instance data
          required: false
          schema:
            $ref: '#/definitions/note'
      responses:
        '200':
          description: Request was successful
          schema:
            $ref: '#/definitions/note'
      deprecated: false
    get:
      tags:
        - note
      summary: Find all instances of the model matched by filter from the data source.
      operationId: note.find
      parameters:
        - name: filter
          in: query
          description: 'Filter defining fields, where, include, order, offset, and limit'
          required: false
          type: string
          format: JSON
      responses:
        '200':
          description: Request was successful
          schema:
            type: array
            items:
              $ref: '#/definitions/note'
      deprecated: false

1 个答案:

答案 0 :(得分:0)

有一个在线可视化API构建器,请尝试:https://apibldr.com。 它将为您提供构建它的直观方式,而无需编写代码。