Building a Target Schema
Learn how to create effective target schemas for your data transformations
The quickest way to get started with flat, tabular data is to upload a sample CSV file with your desired output format. Lume will automatically generate a target schema for you! For nested or complex data structures, we recommend building your schema manually using this guide.
If you prefer to build your schema manually or need to customize an existing one, this guide will walk you through the process.
Schema Basics
Target schemas in Lume use JSON Schema format to define your desired output structure. Each field requires:
- A field name
- One or more data types
- A clear description of the field’s business meaning and context
Write clear, specific descriptions that explain your business’s unique requirements and context. For example, specify if “revenue” means monthly recurring revenue, annual revenue, or revenue before returns. Learn more about writing effective descriptions in our Creating Field Descriptions guide.
Field Types
Common JSON Schema types include:
string
: Text datanumber
: Numeric valuesinteger
: Whole numbersboolean
: True/false valuesarray
: Lists of valuesobject
: Nested structuresnull
: Missing or undefined values
Data Classification with Enums
Use enums to classify data into specific categories:
Validation Rules
JSON Schema provides several validation options:
Complete Example
Here’s a complete target schema example:
Best Practices
- Clear Descriptions: Write clear, specific descriptions that explain the business meaning of each field
- Appropriate Types: Use the most specific type(s) possible for each field
- Validation Rules: Add validation rules where appropriate to ensure data quality
- Required Fields: Mark essential fields as required in the schema
- Consistent Naming: Use consistent field naming conventions throughout your schema
Remember: Focus on describing what each field means, not how to transform it. Lume handles the transformation logic automatically!
Advanced Schema Structures
Nested Objects
Your schema can include nested objects to represent complex data structures:
Arrays
Use arrays to represent lists of values or objects:
Database-Based Schemas
Your schema can mirror database tables and relationships:
Field names cannot contain periods (.) as this is a protected character in Lume. Use underscores or camelCase instead:
- ❌
user.first.name
- ✅
user_first_name
- ✅
userFirstName