我选

我选

办公所需全收藏

首页/工具/YAML 转换器

YAML 转换器

在 YAML、JSON 和 XML 格式之间转换数据

工具说明

YAML 转换器是一个多功能工具,可帮助您在 YAML、JSON 和 XML 格式之间相互转换数据。 无论您是需要将配置文件从一种格式转换为另一种,还是处理不同 API 返回的数据格式, 此工具都能快速准确地完成转换工作,支持复杂的嵌套结构和数组。

YAML转换器

YAML 输入

JSON 输出

转换选项

示例数据

示例 YAML

person:
  name: John Doe
  age: 30
  email: john@example.com
  address:
    street: 123 Main St
    city: New York
    country: USA
  phoneNumbers:
    - type: home
      number: 555-1234
    - type: work
      number: 555-5678

示例 JSON

{
  "person": {
    "name": "John Doe",
    "age": 30,
    "email": "john@example.com",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "country": "USA"
    },
    "phoneNumbers": [
      {
        "type": "home",
        "number": "555-1234"
      },
      {
        "type": "work",
        "number": "555-5678"
      }
    ]
  }
}

示例 XML

<?xml version="1.0" encoding="UTF-8"?>
<person>
  <name>John Doe</name>
  <age>30</age>
  <email>john@example.com</email>
  <address>
    <street>123 Main St</street>
    <city>New York</city>
    <country>USA</country>
  </address>
  <phoneNumbers>
    <phone>
      <type>home</type>
      <number>555-1234</number>
    </phone>
    <phone>
      <type>work</type>
      <number>555-5678</number>
    </phone>
  </phoneNumbers>
</person>

相关工具

XML JSON 转换器

在 XML 和 JSON 格式之间转换数据

查看工具

JSON 转 Go Struct

将 JSON 数据转换为 Go 语言结构体

查看工具

JSON 转 Python

将 JSON 数据转换为 Python 类或字典

查看工具

© 2024 传统工具 | YAML 转换器