Конвертируйте YAML в JSON формат
Tool guide
The other direction: the config is written with indentation, but you need an object — for an API call, for a fixture, for code that only speaks JSON. Paste the manifest, playbook or settings file into the YAML Input box (its placeholder shows name: John / age: 30) and press Convert. There is a second benefit: if the YAML is malformed you get no object at all, which is the fastest way to catch a broken indent. Everything runs in the browser. See also: turn JSON settings into a YAML config, format the resulting JSON and spot errors, export a list from the config to CSV.
That is YAML itself: unquoted yes, no, on, off, true and false are booleans. If you actually want the string "yes" — a country code, a survey answer — quote it in the source: field: "yes". It then arrives in JSON as a string.
Yes. js-yaml resolves anchors during parsing, so the JSON carries the expanded value and the alias disappears — JSON has no way to express one. Block scalars written with | or > become plain strings with \n line breaks, and merge keys behave the same way.
Only a single document is parsed. A --- separator makes the parser stop, because JSON has no concept of a document stream. Split the file and run each section on its own, which is the usual approach with multi-part Kubernetes manifests.
Three causes cover most cases: a tab character instead of spaces, a missing space after a colon, and a nested key that drifted out of alignment. Paste the document in growing chunks; the section where the output disappears holds the error.
A bare 2026-09-06 parses into a Date and serialises to an ISO string with a time part and a trailing Z. Quote the value in the YAML if you need the literal text to survive unchanged.
Lines starting with # are dropped, because JSON has nowhere to keep them. Worth remembering when you convert a config for migration: the notes explaining each setting have to be preserved separately.
Before: apiVersion: v1 kind: Service metadata: name: web labels: tier: front
After: { "apiVersion": "v1", "kind": "Service", "metadata": { "name": "web", "labels": { "tier": "front" } } } Before: env: - DEBUG - TZ retries: 3 enabled: yes
After: { "env": ["DEBUG", "TZ"], "retries": 3, "enabled": true } Your rating and feedback help decide what to improve next.