YAML Validator & Converter
Pricing
from $0.55 / 1,000 processed documents
YAML Validator & Converter
Validate YAML, JSON, and TOML documents or public raw-file URLs. Convert valid files between formats, split YAML streams, and export syntax errors, line context, and converted content.
Pricing
from $0.55 / 1,000 processed documents
Rating
0.0
(0)
Developer
Maxime Dupré
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
20 hours ago
Last modified
Categories
Share
✅ YAML Validator & Converter for config files
YAML Validator & Converter checks YAML, JSON, and TOML documents from pasted text or public raw-file URLs. Use it to validate config files, convert valid documents between formats, split multi-document YAML streams, and export clean rows with syntax errors, line context, converted content, and source details.
It is built for developers, automation teams, data teams, and anyone who needs repeatable config checks in Apify. You can run one document for a quick syntax check, or send a batch of pasted files and public URLs through the Apify API, schedules, webhooks, or exports.
The Actor auto-detects each input format. You do not need to label every task as YAML, JSON, or TOML before running it. Invalid syntax is saved as a normal output row with isValid: false, so batch runs can show every failure instead of hiding broken files.
🔍 What this Actor does
- Validates YAML, JSON, and TOML syntax.
- Converts valid documents to JSON, YAML, or TOML when the target format can represent the data.
- Accepts pasted document text, public raw-file URLs, or both in one batch.
- Auto-detects input format for mixed YAML, JSON, and TOML tasks.
- Splits YAML streams with
---document markers into separate output rows. - Reports parser errors with message, line, column, and nearby context when available.
- Keeps invalid documents in the dataset as validation results.
- Lets you stop after the first invalid document for strict automation gates.
- Can include the original submitted or fetched content when you need an audit trail.
This Actor checks syntax and converts structure. It does not validate Kubernetes, Docker Compose, Helm, Ansible, Cargo, or app-specific schemas. It also does not repair invalid documents or access private URLs. For private files, fetch them in your own environment and paste the content into inputData.
📥 Input
Add tasks in tasks. Each task can have a name, pasted inputData, a public HTTP or HTTPS inputUrl, or both. If both inputData and inputUrl are present, the pasted content is used for that task.
{"tasks": [{"name": "inline-yaml","inputData": "name: John Doe\nage: 30\nroles:\n - admin\n - editor"},{"name": "public-package-json","inputUrl": "https://raw.githubusercontent.com/apify/crawlee/master/package.json"}],"operation": "convert","outputFormat": "json","jsonIndent": 2,"stopOnError": false,"includeOriginal": false}
🧾 Input fields
| Field | What it does |
|---|---|
tasks | List of documents or public raw-file URLs to validate or convert. |
name | Optional label you can use to match output rows back to your own batch. |
inputData | Pasted YAML, JSON, or TOML text for one task. |
inputUrl | Public HTTP or HTTPS URL of a raw YAML, JSON, or TOML file. |
operation | Use validate to check syntax, or convert to also return converted content for valid documents. |
outputFormat | Target format for converted documents: json, yaml, or toml. |
jsonIndent | Number of spaces for converted JSON. Use 0 for compact JSON. |
stopOnError | Stops the run after the first invalid document when you need fail-fast checks. |
includeOriginal | Adds original document text to each output row for audit trails. |
📤 Output
Each dataset row represents one processed logical document. A single YAML stream can create more than one row when it contains multiple documents separated by ---.
| Field | Description |
|---|---|
taskIndex | 1-based position of the submitted task. |
taskName | Optional task label from your input. |
documentIndex | 1-based document number within the task. |
sourceUrl | Public URL used for the task, or null for pasted content. |
inputPreview | Short preview of the submitted or fetched document. |
inputFormat | Auto-detected format: yaml, json, toml, or unknown. |
isValid | Whether the document parsed successfully. |
errorMessage, errorLine, errorColumn, errorContext | Parser-backed syntax details for invalid documents. |
outputFormat | Conversion target for converted rows, or null for validate-only and invalid rows. |
convertedContent | Converted document text when conversion succeeds. |
warnings | Non-fatal notes, such as TOML conversion limits. |
originalContent | Original document text when includeOriginal is enabled. |
🧪 Output example
{"taskIndex": 1,"taskName": "inline-yaml","documentIndex": 1,"sourceUrl": null,"inputPreview": "name: John Doe age: 30 roles: - admin - editor","inputFormat": "yaml","isValid": true,"errorMessage": null,"errorLine": null,"errorColumn": null,"errorContext": null,"outputFormat": "json","convertedContent": "{\n \"name\": \"John Doe\",\n \"age\": 30,\n \"roles\": [\n \"admin\",\n \"editor\"\n ]\n}","warnings": [],"originalContent": null}
Invalid documents are still output rows:
{"taskIndex": 2,"taskName": "broken-yaml","documentIndex": 1,"sourceUrl": null,"inputPreview": "name: [John age: 30","inputFormat": "yaml","isValid": false,"errorMessage": "Flow sequence in block collection must be sufficiently indented and end with a ]","errorLine": 2,"errorColumn": 1,"errorContext": "1 | name: [John\n2 | age: 30","outputFormat": null,"convertedContent": null,"warnings": ["Input could not be parsed as JSON, TOML, or YAML."],"originalContent": null}
🚀 How to run it
- Open the Actor input.
- Add one or more items to Documents and URLs.
- Keep Validate syntax for syntax checks, or choose Convert valid documents.
- Pick the target output format when converting.
- Run the Actor and open the dataset.
You can export results as JSON, CSV, Excel, XML, RSS, or HTML. You can also call the Actor from the Apify API, schedule repeat checks, use webhooks, or connect the dataset to another integration.
🔄 YAML, JSON, and TOML conversion notes
JSON output can represent objects, arrays, strings, numbers, booleans, and null values. YAML output can represent the parsed structure in YAML text. TOML output needs a top-level object, so arrays or scalar documents may validate successfully but return a warning instead of invented TOML.
The Actor does not expose a manual input-format selector. Mixed batches are expected: JSON-shaped input is parsed as JSON, TOML-shaped input is parsed as TOML, and remaining documents are parsed as YAML. If syntax is invalid, the row reports the parser-backed error details that are available.
💳 Pricing
This Actor uses pay-per-event pricing. You are charged once for each logical document that is processed and saved to the dataset. A YAML stream with multiple --- document parts counts as multiple processed documents because each part gets its own output row.
URL fetch failures, empty tasks, malformed task objects, and other inputs that cannot be processed as documents are not saved as dataset rows and are not charged as processed documents.
⚠️ Limits and caveats
- Public URLs must point to raw text files that the Actor can fetch.
- Private files, intranet URLs, and authenticated URLs are not supported through
inputUrl. - The Actor validates syntax and structure, not app-specific schema rules.
- Invalid syntax rows may not always include both line and column if the parser cannot provide them.
- TOML cannot represent every JSON or YAML value, especially when the top-level value is not an object.
❓ FAQ
Can this validate Kubernetes YAML?
It can validate YAML syntax in Kubernetes manifests, including multi-document streams. It does not check Kubernetes resource schemas, required fields, cluster versions, or policy rules.
Can I process private config files?
Yes, if you paste the file content into inputData. The Actor does not log in to private repositories or fetch authenticated URLs.
Can I convert JSON to YAML or TOML to JSON?
Yes. Set operation to convert and choose outputFormat. Conversion returns content only when the parsed value can be represented in the target format.
What happens when one document is invalid?
By default, the Actor saves an invalid output row and continues with the rest of the batch. Set stopOnError to true when you want the run to stop after the first invalid document.
📝 Changelog
- 0.0: Initial release.
🆘 Support
For issues, questions, or feature requests, file a ticket and I'll fix or implement it in less than 24h 🫡
🔗 Other actors
- XML JSON Converter ↗ - Convert XML to JSON or JSON to XML from pasted data and public URLs.
- URL to BibTeX Converter ↗ - Turn article, DOI, PubMed, arXiv, and web page URLs into BibTeX citations.
- Unicode Text Inspector ↗ - Find hidden Unicode, zero-width spaces, bidi controls, and homoglyph issues in text.
- Robots.txt Generator ↗ - Generate deployable robots.txt files for SEO, crawler control, and AI bot blocking.
- SSL Certificate Checker ↗ - Check public HTTPS certificates, expiry, trust, hostname match, and TLS evidence.
Made with ❤️ by Maxime Dupré