VOOZH about

URL: https://apify.com/maximedupre/yaml-validator-converter

⇱ YAML Validator & Converter Β· Apify


Pricing

from $0.55 / 1,000 processed documents

Go to Apify Store

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Γ©

Maxime DuprΓ©

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

10 days 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

FieldWhat it does
tasksList of documents or public raw-file URLs to validate or convert.
nameOptional label you can use to match output rows back to your own batch.
inputDataPasted YAML, JSON, or TOML text for one task.
inputUrlPublic HTTP or HTTPS URL of a raw YAML, JSON, or TOML file.
operationUse validate to check syntax, or convert to also return converted content for valid documents.
outputFormatTarget format for converted documents: json, yaml, or toml.
jsonIndentNumber of spaces for converted JSON. Use 0 for compact JSON.
stopOnErrorStops the run after the first invalid document when you need fail-fast checks.
includeOriginalAdds 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 ---.

FieldDescription
taskIndex1-based position of the submitted task.
taskNameOptional task label from your input.
documentIndex1-based document number within the task.
sourceUrlPublic URL used for the task, or null for pasted content.
inputPreviewShort preview of the submitted or fetched document.
inputFormatAuto-detected format: yaml, json, toml, or unknown.
isValidWhether the document parsed successfully.
errorMessage, errorLine, errorColumn, errorContextParser-backed syntax details for invalid documents.
outputFormatConversion target for converted rows, or null for validate-only and invalid rows.
convertedContentConverted document text when conversion succeeds.
warningsNon-fatal notes, such as TOML conversion limits.
originalContentOriginal 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

  1. Open the Actor input.
  2. Add one or more items to Documents and URLs.
  3. Keep Validate syntax for syntax checks, or choose Convert valid documents.
  4. Pick the target output format when converting.
  5. 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

Made with ❀️ by Maxime Dupré

You might also like

YAML Validator & Converter

automation-lab/yaml-validator

Validate YAML, JSON, and TOML syntax. Convert between formats. Detect errors with exact line numbers. Bulk-process documents or URLs. Zero proxy, 95%+ margin.

πŸ‘ User avatar

Stas Persiianenko

2

YAML to JSON Converter

eloquent_mountain/yaml-to-json-converter

YAML to JSON Converter Seamlessly transform YAML files into JSON format using this Apify actor. Ideal for handling intricate YAML structures, it accepts inputs via URL or direct text paste. Perfect for developers and data analysts looking to integrate YAML data into JSON-based applications.

JSON To YAML Converter

zsoftware/json-to-yaml-converter

JSON to YAML Converter: This Apify Actor takes a JSON file or raw string input, transforms it into a validated YAML document, and outputs a downloadable output.yaml file. Lightweight, fast, and easy to integrate into any workflow.

TOML Validator & Converter

automation-lab/toml-validator

Validate TOML files and convert between TOML, JSON, and YAML. Paste documents or fetch from URLs. Bulk processing with exact error line numbers.

πŸ‘ User avatar

Stas Persiianenko

2

Universal Data Structure Converter

moving_beacon-owner1/my-actor-63

A production-grade Apify actor that converts between HTML, XML, CSV, YAML, and JSON formats. Supports 9+ conversion types with smart auto-detection, nested JSON flattening, HTML table scraping, batch URL processing, and full customization.

2

Document Converter

moving_beacon-owner1/my-actor-70

A tool that that converts documents between different formats. Upload files via URL and retrieve converted results from the key-value store.

3

File Converter All-in-one

tufantoksoz/file-converter

Convert files between popular formats at scale on Apify. Transform documents, spreadsheets, and images with professional-grade quality and performance. Convert word to pdf, jpeg to png and more

πŸ‘ User avatar

Tufan ToksΓΆz

12

JSON Schema Generator

automation-lab/json-schema-generator

Generate JSON Schema (draft-07) from sample JSON instantly. Auto-detects types, required fields, nullable values, and nested structures. Export as JSON or YAML.

πŸ‘ User avatar

Stas Persiianenko

2

Data Format Converter - CSV, JSON, XML Transformation

ntriqpro/data-format-converter

Convert data between common formats: CSV, JSON, and XML. Bulk transform files without manual work.