gpt4 book ai didi

node.js - swagger 文档可以自动化而不是手动输入吗?这是基于模型的

转载 作者:太空宇宙 更新时间:2023-11-04 01:51:46 25 4
gpt4 key购买 nike

swagger 文档可以自动化而不是手动输入吗?有人知道一些工具吗?或图书馆? 。基于下面的示例,而不是手动输入这些内容,是否有一种工具可以根据模型自动生成它? ,并且它环回可以做到吗?或者有人知道一些工具吗? 。并真的环回支持 swagger 文档生成吗?谢谢。

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

最佳答案

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

关于node.js - swagger 文档可以自动化而不是手动输入吗?这是基于模型的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49354959/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com