Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.62 KB

File metadata and controls

53 lines (35 loc) · 1.62 KB

How to Validate an ODPS YAML File

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.


1. Validate YAML Syntax

Before ODPS-specific validation, ensure the file is valid YAML:

Online Tools

Command Line Tool

Use yq to test:

yq eval myfile.yaml > /dev/null && echo "Valid YAML"

More info on yq: StackOverflow


2. Validate Against ODPS Schema

To confirm that your YAML follows ODPS rules:

Use the Schema URL

Make sure your YAML includes:

schema: https://opendataproducts.org/v3.1/schema/odps.yaml

Or for ODPS v4:

schema: https://opendataproducts.org/v4.0/schema/odps.yaml

Validation Tools

  • 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).

Tips

  • Follow the ODPS Dev Page for the latest schema definitions and best practices.
  • Modular YAML? Validate each referenced file separately if needed.

BACK TO INDEX