格式化与代码
OpenAPI 3.1 YAML ⇄ JSON
Convert OpenAPI specs between YAML and JSON.
Runs in your browser
OpenAPI YAML · source
lines: 42chars: 924size: 924 B
JSON · result
lines: 79chars: 1576size: 1.5 KB
live
编辑注
Understanding · Same spec, two file formats — pick by audience.
本深度章节目前仅有英文版本。上方的转换工具支持您的语言;长篇说明文章尚未翻译。
常见问题
Quick answers.
›Does this tool support OpenAPI 3.1?
Yes. It supports OpenAPI 3.1, 3.0, and Swagger 2.0 definitions. The tool converts the underlying structure without altering the specification version.
›Will my API documentation be kept private?
Yes. The conversion happens entirely in your browser using JavaScript. No document data is sent to our servers or stored externally.
›What happens to YAML comments during conversion?
JSON does not support comments, so any comments in your YAML source will be stripped when converting to JSON. They are preserved if you are simply formatting YAML.
›Is the output validated against the OpenAPI schema?
The tool checks for valid `YAML` and `JSON` syntax during the conversion process. For full schema-level validation, we recommend using a dedicated OpenAPI linter.
大家也在搜索
相关工具
More in this room.
- OpenAPI / Swagger 验证器根据规范规则验证 OpenAPI 3 规范。
- OpenAPI → TypeScript Axios 客户端从任何 OpenAPI 规范生成类型化的 Axios 客户端。
- OpenAPI → React Query Hooks为每个端点自动生成 useQuery + useMutation hook。
- OpenAPI → Postman Collection从任何 OpenAPI 规范生成 Postman v2.1 collection。
- GraphQL SDL ⇄ TypeScript 类型遍历 schema,发出类型化接口,然后反向操作。
- JSON Schema → Zod / Valibot / ArkType从一个 JSON Schema 中生成三种运行时验证器。