~
My company currently use Swagger 2 to document API.
I want to work with OpenAPI 3 but too lazy to convert (for now of course).
So step by step:
YAML
.JSON
.Only step 1 is manual, aka I write my API spec completely with my hand (no auto gen from code whatever). The others can be done with tools:
# Convert
go install github.com/mikefarah/yq/v4@latest
yq -o=json '.' ./docs/swagger.yaml > ./docs/swagger.json
# Format
bunx prettier@latest --write ./docs/swagger.yaml ./docs/swagger.json
# Render locally
bunx @redocly/cli preview-docs ./docs/swagger.json