Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. MetaYaml

MetaYaml

MITPHP

A PHP schema validator for JSON, YAML, and XML files that can generate documentation and XSD files.

GitHubGitHub
103 stars21 forks0 contributors

What is MetaYaml?

MetaYaml is a schema validation library for PHP that validates data structures defined in JSON, YAML, or XML against a unified schema. It enables developers to define complex data structures with type checking, required fields, patterns, and enumerations, ensuring data integrity across different file formats.

Target Audience

PHP developers working with multi-format data (JSON, YAML, XML) who need consistent validation, such as those building configuration systems, API data validators, or data import/export pipelines.

Value Proposition

Developers choose MetaYaml for its format-agnostic validation, allowing a single schema to validate JSON, YAML, and XML data, plus features like automatic documentation generation and experimental XSD generation for XML.

Overview

A powerful schema validator!

Use Cases

Best For

  • Validating configuration files across JSON, YAML, and XML formats with a single schema definition.
  • Generating human-readable documentation from schema descriptions for team or API reference.
  • Creating XML Schema Definitions (XSD) from MetaYaml schemas for XML validation in other contexts.
  • Defining complex, reusable data structures with partial schemas to reduce duplication.
  • Enforcing strict type checking and validation rules (required fields, patterns, enums) in PHP applications.
  • Building extensible validation systems with custom loaders for additional data formats.

Not Ideal For

  • Projects requiring client-side or real-time validation in JavaScript, as MetaYaml is a server-side PHP library.
  • Systems heavily dependent on XML namespaces or advanced XML features, since MetaYaml explicitly does not support namespaces.
  • Applications needing ultra-fast validation with minimal latency, due to performance overhead where schema validation can take up to a second for complex schemas.
  • Teams using modern PHP frameworks with built-in validation (e.g., Laravel or Symfony Validator) for single-format data, if multi-format support isn't a priority.

Pros & Cons

Pros

Multi-Format Validation

Validates JSON, YAML, and XML data against a unified schema, with loaders for each format, enabling consistent validation across different file types as shown in the basic usage examples.

Rich Schema Definition

Supports diverse node types like text, number, array, prototype, and choice, with attributes for required, not_empty, and strict validation, allowing complex data structure definitions.

Documentation and XSD Generation

Automatically generates human-readable documentation from schema descriptions and provides experimental XSD generation for XML, useful for team reference or external validation contexts.

Extensible Architecture

Includes loaders for common formats and allows writing custom loaders via the LoaderInterface, making it adaptable to additional data sources.

Cons

Limited XML Support

XML validation enforces specific conventions, lacks namespace support, and XSD generation is experimental with limitations like unsupported choice nodes and prototype validation issues.

Performance Overhead

Schema validation can be slow, taking up to a second for complex schemas as noted in the README, which may hinder real-time or high-throughput applications.

External Dependencies

Requires the Symfony Yaml component for YAML loading, adding an extra dependency that might complicate setup in minimal environments.

Frequently Asked Questions

Quick Stats

Stars103
Forks21
Contributors0
Open Issues5
Last commit7 years ago
CreatedSince 2012

Tags

#yaml#php-library#schema#schema-validation#xml#data-validation#json#documentation-generator

Built With

C
Composer
P
PHP
a
atoum

Included in

PHP32.5k
Auto-fetched 16 hours ago

Related Projects

Respect ValidationRespect Validation

The most awesome validation engine ever created for PHP

Stars6,032
Forks773
Last commit21 hours ago
LibPhoneNumber for PHPLibPhoneNumber for PHP

PHP version of Google's phone number handling library

Stars5,044
Forks480
Last commit7 days ago
JSON SchemaJSON Schema

JSON Schema for PHP

Stars3,630
Forks369
Last commit3 days ago
HTML PurifierHTML Purifier

Standards compliant HTML filter written in PHP

Stars3,354
Forks357
Last commit9 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub