Back

Compose static validator

Developer tools

Loading

Loading tool

The tool is loaded only when you open it.

All processing for this tool happens in your browser. Your input is not sent to a server.

About this tool

Paste a single Compose YAML document and choose Validate YAML to run a bounded, local check. The tool combines a pinned official schema with selected service-reference, dependency and port checks. Each diagnostic includes a line, column and sanitized path. The JSON report excludes source YAML, scalar values and custom names. Editing the input or changing language clears the previous result. Schema acceptance is only one part of the report and never certifies that a deployment will run.

Common uses

  • Catch a misspelled property, incorrect value type or missing required field before reviewing a Compose configuration.
  • Find undeclared service references, dependency cycles or obvious port problems in a self-contained Compose document.
  • Share a diagnostic report without copying the original YAML or its values; review the remaining structure and locations before sharing.

How to use it

  1. 1.Paste one Compose YAML document or load the synthetic sample. Review the visible input for secrets and keep it within the displayed parser limits.
  2. 2.Choose Validate YAML. Read errors and warnings together with the schema and completion status; unresolved features can leave the check incomplete.
  3. 3.Edit the original YAML and validate again. Copy the JSON report or download compose-diagnostics.json; check runtime behavior separately with your own trusted Compose installation.

Worked static-validation examples

Declared services and a static port

services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
    depends_on:
      - cache
  cache:
    image: redis:7-alpine
{
  "schemaValid": true,
  "complete": true,
  "codes": []
}

The summary shows schemaValid and complete as true with no diagnostic codes. This synthetic web/cache configuration passes the supported static checks; no images are pulled and no containers are started.

A port list written as a scalar

services:
  web:
    image: nginx:alpine
    ports: "8080:80"
{
  "schemaValid": false,
  "complete": true,
  "codes": [
    "schema"
  ]
}

ports must have the structure required by the schema. A scalar string fails the schema check. The diagnostic points to the field without echoing its value.

Reference to an undeclared service

services:
  web:
    image: nginx:alpine
    depends_on:
      - missing-service
{
  "schemaValid": true,
  "complete": true,
  "codes": [
    "reference"
  ]
}

The YAML matches the schema but refers to a service that is not declared. The reference diagnostic is an error, so schemaValid true must not be treated as success.

Unresolved image interpolation

services:
  web:
    image: "nginx:${TAG}"
{
  "schemaValid": false,
  "complete": false,
  "codes": [
    "interpolation"
  ]
}

The image contains a variable expression. The checker neither substitutes a host value nor guesses it. It reports interpolation, leaves complete false and does not establish schema validity.

Common validation mistakes

  • Assuming schema acceptance proves a runnable deployment: review all diagnostics and runtime requirements.
  • Writing ports as one scalar instead of a sequence, or misspelling a property: check the schema diagnostic at its line and column.
  • Referencing a service or resource absent from this document: fix the declaration or review unresolved include/extends files yourself.
  • Expecting ${VARIABLE} or .env to resolve automatically: this tool never reads the host environment or files.
  • Sharing the source input instead of the diagnostic report: the textarea still contains original values and may contain credentials.

Limits and notes

  • Input is capped at 100,000 characters, 64 nesting levels, 20,000 parsed/expanded nodes, 1,000 entries per mapping/sequence, 100 aliases and 100 diagnostics. YAML anchors and merge keys are supported within these limits; cyclic aliases, duplicate keys, custom tags, multi-document streams and unsupported non-JSON values are rejected. Reaching a limit leaves validation incomplete.
  • The bundled official Compose Specification schema is pinned to commit 914ec15d1fa498969c0df5c1d672306db3256089, checked on 2026-10-06, using JSON Schema 2020-12. A successful schema check only concerns this snapshot. Your installed Compose implementation or version may not support every field.
  • Variable expressions remain unresolved, including expressions with defaults. The tool never reads host environment variables or .env files. include and extends are not loaded or merged, and external files or URLs are never fetched. These features prevent a complete result; interpolation also prevents schema validity from being established.
  • Semantic checks cover selected declared service/resource references, dependency cycles, static port syntax/ranges and possible host-port overlap. They do not reproduce all Compose rules, profile selection, project merging or runtime scheduling. Unsupported newer semantic areas such as jobs, models and pre-start behavior are reported without execution. Schema-valid can still have semantic errors. No result verifies image availability, build contexts, file existence, credentials, permissions, platform support, live port use or successful deployment. Host-port overlap is a potential conflict, not evidence that a port is occupied.
  • Input is processed in the current browser tab without upload or history storage. The original textarea remains visible. Reports omit source text, scalar values and custom names, but retain known field names, positions and issue types; they are not fully anonymous. Clipboard contents and saved files remain outside the page’s control.

Frequently asked questions

Does schema-valid mean my Compose project will start?

No. Schema matching checks structure and types against the pinned snapshot. Separate static diagnostics can still identify a broken reference or port. Images, files, runtime permissions and the host environment are outside this tool, so deployment must be checked separately.

What happens to ${VARIABLE}, include and extends?

Variable expressions are preserved and reported as unresolved. No environment or .env values are read. Included files and extended service definitions are never loaded or executed. The report marks the check incomplete rather than inventing the missing configuration.

Why does the diagnostic path hide my service name?

Service names, custom keys and scalar values can contain private information. Reports retain only recognized field names and structural positions. Use the line and column to find the original field; diagnostics on aliases may point to the containing field rather than the anchor definition.

Does the JSON report contain my YAML?

No. The report contains status flags, the pinned schema reference and located diagnostics with translated explanations. Source YAML and values are excluded. Configuration structure and problem types can still be sensitive, so review the report before sharing.

Related tools