> ## 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.

# Parse from YAML

> Converts YAML data into JSON.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Reads a piece of YAML text and turns it into structured data you can map field by field. Use this when a value arrives as a YAML document, such as a configuration block or a feed from a system that exports YAML, and you want to work with its keys and values as ordinary fields instead of one long string. Each YAML key becomes a field, and nested or list structures come through as nested data.

If the incoming text is in a character set other than UTF-8, you can turn on the encoding option to have it converted first.

This documentation describes: [Schema](/schemas/deserializer/yaml)

## Fields

<FormField property="encodeInput" label="Input data is not UTF-8 encoded">
  Turn this on when the incoming text is in a character set other than UTF-8, so accented and special characters come through correctly. It is off by default. Turning it on reveals the encoding and conversion options below.
</FormField>

<FormField property="encodingFrom" label="Encoding">
  The character set the incoming text is currently in. Choose from UTF-16, ISO-8859-1, or Windows-1252. Only shown when the encoding option above is on.
</FormField>

<FormField property="modifier" label="Conversion behaviour">
  How to handle characters that cannot be converted to UTF-8: leave it as NONE to fail on an unconvertible character, IGNORE to drop it, or TRANSLIT to replace it with the closest available character. Only shown when the encoding option is on.
</FormField>

## Sample data

This parser takes no settings of its own. It reads the YAML text and returns the structured data it describes.

Input:

```json theme={null}
{
    "payload": "id: 1001\ncustomer: Acme\ntotal: 49.95\n"
}
```

Output:

```json theme={null}
{
    "payload": {
        "id": 1001,
        "customer": "Acme",
        "total": 49.95
    }
}
```

Each YAML key becomes a field, and number-like values come back as numbers.

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