For the complete documentation index, see llms.txt. This page is also available as Markdown.

YAML parse transform action

Use case

An API has returned a YAML formatted string and you would like to convert it to a JSON object.

Overview

Parses a YAML string and returns the resulting data structure in JSON.

Parameters

Parameter
Description
Required

YAML Input

The YAML string to parse.

This transform is utilizing the yaml_parse filter, which will only work with one document.

If your YAML string contains multiple documents you should process them individually.

Usage

Example: Parse a YAML string

YAML input:

version: 2.1

# Define the jobs we want to run for this project
jobs:
  build:
    docker:
      - image: cimg/base:2023.03
    steps:
      - checkout
      - run: echo "this is the build job"
  test:
    docker:
      - image: cimg/base:2023.03
    steps:
      - checkout
      - run: echo "this is the test job"

# Orchestrate our job run sequence
workflows:
  build_and_test:
    jobs:
      - build
      - test

Results output

Last updated

Was this helpful?