I am playing around with Open API 3.0 by downloading the source code for server, here.
- Access the link
- Choose Generate Server on menu bar
- Choose nodejs-server
I simply follow the instruction in README.md
to run the server by executing npm start
.
After that, I access the URL http://localhost:8080/docs. However, there is no Request body in the swagger page. More specifically, you can see in the picture as following
The code in yaml
file for this api as following
/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
On the other hand, the things showed in https://editor.swagger.io/ are somehow different, but yaml
file is exactly the same.
How can I make the swagger on my local machine show Request body as in https://editor.swagger.io/?