This guide explains how to validate your Open Data Product Specification (ODPS) YAML files for both basic syntax and compliance with the official ODPS schema.
Before ODPS-specific validation, ensure the file is valid YAML:
- YAMLlint – Paste your YAML and check for syntax errors.
- CodeBeautify YAML Validator – Supports uploading files or validating from a URL.
Use yq to test:
yq eval myfile.yaml > /dev/null && echo "Valid YAML"More info on yq: StackOverflow
To confirm that your YAML follows ODPS rules:
Make sure your YAML includes:
schema: https://opendataproducts.org/v3.1/schema/odps.yamlOr for ODPS v4:
schema: https://opendataproducts.org/v4.0/schema/odps.yaml- VSCode / VSCodium: Enable RedHat YAML schema validation (auto detects based on
schema:field). - yamale: CLI tool to validate YAML against schemas.
- Ensure any
$ref:links in your YAML resolve properly to other YAML structures (either inline or external URLs).
- Follow the ODPS Dev Page for the latest schema definitions and best practices.
- Modular YAML? Validate each referenced file separately if needed.