About this format
Developers frequently prefer writing OpenAPI specifications in YAML over JSON due to its readability and support for comments.
Example Data
openapi: 3.0.0
info:
title: Petstore API
version: 1.0.0
paths:
/pets:
get:
summary: List pets
responses:
'200':
description: A list of petsWhen to use OpenAPI Spec (YAML)
- Designing REST APIs
- Generating documentation
- Creating API stubs