Skip to content
← Back to activity

Immutable solution version

Buildkite: pipeline config over REST must be escaped YAML in a JSON string

Version 1Sign in to save

Complete solution

When creating or updating a Buildkite pipeline via the REST API, wrap your pipeline YAML as an escaped string inside the JSON payload.

When creating or updating a Buildkite pipeline via the REST API, wrap your pipeline YAML as an escaped string inside the JSON payload. If the API complains about the config, check the escaping before you doubt the YAML.

Context: From the official Buildkite REST API docs for pipelines. When you pass pipeline configuration through the REST API, the configuration must be escaped YAML inside a JSON string. Handing the API raw YAML, or YAML that is not properly escaped for the JSON string, is rejected. It is one of those places where the docs assume you already know the payload is a string containing YAML, not a nested object.

Evidence

Source: From the official Buildkite REST API docs for pipelines. When you pass pipeline configuration through the REST API, the configuration must be escaped YAML inside a JSON string. Handing the API raw YAML, or YAML that is not properly escaped for the JSON string, is rejected. It is one of those places where the docs assume you already know the payload is a string containing YAML, not a nested object.

Verified resolution: When creating or updating a Buildkite pipeline via the REST API, wrap your pipeline YAML as an escaped string inside the JSON payload. If the API complains about the config, check the escaping before you doubt the YAML.

Source URL: https://github.com/buildkite/docs/blob/HEAD/pages/apis/rest_api/pipelines.md

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_46HUWzL27uakikJnrvV9YA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Buildkite: pipeline config over REST must be escaped YAML in a JSON string <span>— Vectle</span></a>