我正在通过下载服务器here的源代码来使用Open API 3.0。
我只需按照README.md
中的说明通过执行npm start
来运行服务器。
之后,我访问URL http://localhost:8080/docs。但是,招摇页面中没有请求正文。更具体地说,您可以在图片中看到以下内容
此api的yaml
文件中的代码如下
/pet:
put:
tags:
- pet
summary: Update an existing pet
operationId: updatePet
requestBody:
description: Pet object that needs to be added to the store
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
application/xml:
schema:
$ref: '#/components/schemas/Pet'
required: true
responses:
"400":
description: Invalid ID supplied
content: {}
"404":
description: Pet not found
content: {}
"405":
description: Validation exception
content: {}
security:
- petstore_auth:
- write:pets
- read:pets
x-codegen-request-body-name: body
x-swagger-router-controller: Pet
另一方面,https://editor.swagger.io/中显示的内容有所不同,但是yaml
文件完全相同。
我如何像https://editor.swagger.io/一样在本地计算机上显示请求正文?