Developer tool
Composer.json Validator
Validate composer.json structure and common mistakes without running composer install.
How it works
What it does
The Composer.json Validator parses and structurally validates a pasted composer.json. It checks JSON validity and common Composer schema/shape problems so you can catch typos before CI. It intentionally does not resolve the full dependency graph online.
When to use it
- Reviewing a pull request that edits package constraints
- Teaching newcomers why a trailing comma or wrong type fails installs
- Sanity-checking autoload/psr-4 blocks before a release
How input is processed safely
Analysis is text/JSON only. The handler never runs composer install, update, or require, never downloads packages, and never executes package scripts. That keeps the tool safe on a multi-site server.
Examples
- Invalid JSON due to commentary or trailing commas
- Malformed
requireversion strings - Empty package name / incorrect license field types
Common mistakes
- Expecting Packagist resolution conflicts to appear without a solver run
- Pasting
composer.lockinto a json validator and misunderstanding results - Assuming platform checks replace the dedicated platform checker tool
Structural validation catches broken JSON and many schema mistakes early, which is ideal for pull requests and teaching. It will not replace composer update --dry-run for dependency conflict discovery, and it will not execute package scripts—by design.
Pay special attention to autoload, config.platform, and require.php fields when preparing deployments. A valid document can still describe an environment your servers cannot satisfy; pair this tool with the platform checker for extension/PHP constraints.
For monorepos or path repositories, validation still helps, but runtime path existence is your responsibility. Keep private tokens out of the JSON you paste here.
Practical tips
- Keep inputs small and representative; huge pastes slow feedback and raise risk of accidental secret disclosure.
- After using Composer.json Validator, verify the result in your own environment (correct SAPI, correct host, correct project root).
- Cross-link findings to ZendStudio.net PHP error guides and IDE setup pages when the next step is configuration rather than code edits.
- Prefer repeatable project tooling (CI, Composer scripts, IDE inspections) for repo-wide enforcement; this page is for interactive problem-solving.
Privacy note
composer.json can reference private repository URLs. Redact tokens embedded in URLs; use auth.json locally instead of pasting credentials.
Run in browser
AJAX processing only. No remote PHP execution sandbox. Results are not indexed.
Safety notes
- Submitted tool contents are not written to analytics or search logs.
- This site never evaluates arbitrary PHP from the browser.
- Generated configs are starting points—validate on a staging host before production.