> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Format to YAML

> Converts a data object or array into a YAML formatted string.

Turns a piece of structured data, such as an object or a list, into a single YAML text string. Use this when a system or file you produce expects YAML, a plain-text format that lays out fields one per line. There is nothing to configure: hand it your data and it returns the YAML text.

This documentation describes: [Schema](/schemas/mapper/serialize-yaml)

## Sample data

This example formats one object into YAML. Each field becomes its own line, and the price keeps its number form.

Input:

```json theme={null}
{
    "product": {
        "sku": "SCARF-01",
        "name": "Wool scarf",
        "price": 24.95
    }
}
```

Output:

```json theme={null}
{
    "product": "sku: SCARF-01\nname: 'Wool scarf'\nprice: 24.95\n"
}
```

```json Configuration theme={null}
{
  "prototype": "serialize-yaml",
  "parameters": {}
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.