| @objectstack/spec | major |
|---|
Breaking Change: Strict Validation Enabled by Default
defineStack() now validates configurations by default to enforce naming conventions and catch errors early.
What Changed:
defineStack()now defaults tostrict: true(wasstrict: false)- Field names are now validated to ensure snake_case format
- Object names, field types, and all schema definitions are validated
Migration Guide:
If you have existing code that violates naming conventions:
// Before (would silently accept invalid names):
defineStack({
manifest: {...},
objects: [{
name: 'my_object',
fields: {
firstName: { type: 'text' } // ❌ Invalid: camelCase
}
}]
});
// After (will throw validation error):
// Error: Field names must be lowercase snake_case
// Fix: Use snake_case
defineStack({
manifest: {...},
objects: [{
name: 'my_object',
fields: {
first_name: { type: 'text' } // ✅ Valid: snake_case
}
}]
});Temporary Workaround:
If you need to temporarily disable validation while fixing your code:
defineStack(config, { strict: false }); // Bypass validationWhy This Change:
- Catches Errors Early: Invalid field names caught during development, not runtime
- Enforces Conventions: Ensures consistent snake_case naming across all projects
- Prevents AI Hallucinations: AI-generated objects must follow proper conventions
- Database Compatibility: snake_case prevents case-sensitivity issues in queries
Impact:
- Projects with properly named fields (snake_case): ✅ No changes needed
- Projects with camelCase/PascalCase fields:
⚠️ Must update field names or usestrict: false