Schema Purpose
The JSON schema serves several critical functions:- Validation: Ensures all color entries meet required standards before being added to the collection
- Consistency: Maintains uniform structure across all protocol definitions
- Quality Control: Catches errors early in the contribution process through automated CI checks
- Documentation: Provides a clear contract for what constitutes a valid color palette entry
Basic Structure
Each protocol in the color palette follows this basic structure:Key Components
Protocol Name
The top-level key identifying the protocol, chain, or token. Must be unique across the entire collection.
Hex Color
The primary brand color in hexadecimal format. Must be exactly 6 characters (RGB) following the
# symbol.Aliases
An array of alternative names and variations used to match protocol names in Dune queries.
Schema Validation
All entries are automatically validated against the JSON schema during the contribution process.
Multiple Protocol Examples
Here are several real examples from the color palettes collection:Schema Compliance
All contributions must pass JSON schema validation before being accepted into the collection. The automated CI pipeline runs these validations on every pull request.
What Gets Validated
- Protocol name format and character restrictions
- Hex color code format (must be exactly 6 hexadecimal characters)
- Aliases array structure and content
- Required fields presence
- No additional properties beyond the defined schema
- Unique aliases across all protocols (checked separately)
Schema Benefits
Automated Quality Assurance
Automated Quality Assurance
The schema enables automated validation in the CI pipeline, catching formatting errors, invalid color codes, and missing required fields before they reach the main branch.
Clear Contribution Guidelines
Clear Contribution Guidelines
Contributors have a clear specification to follow, reducing errors and speeding up the review process.
Reliable Data Structure
Reliable Data Structure
Applications consuming the color palette data can rely on a consistent structure, simplifying parsing and implementation.
Future-Proof Design
Future-Proof Design
The schema uses JSON Schema Draft 7, a widely supported standard that allows for future extensions while maintaining backward compatibility.
Next Steps
Schema Structure
Explore detailed property definitions and patterns
Validation Rules
Learn about validation requirements and JSON schema