ObjectStack enforces strict naming conventions to ensure consistency and machine readability.
| Context | Convention | Pattern | Example |
|---|---|---|---|
Object name |
snake_case |
/^[a-z_][a-z0-9_]*$/ |
project_task |
| Field keys | snake_case |
/^[a-z_][a-z0-9_]*$/ |
first_name, due_date |
| Schema property keys (TS config) | camelCase |
Standard JS | maxLength, referenceFilters |
Option value |
lowercase machine ID | lowercase | in_progress |
Option label |
Any case | — | "In Progress" |
export default ObjectSchema.create({
name: 'ProjectTask', // ❌ PascalCase not allowed
fields: { /* ... */ }
});export default ObjectSchema.create({
name: 'project_task', // ✅ snake_case
fields: { /* ... */ }
});fields: {
firstName: { type: 'text' }, // ❌ camelCase not allowed
'Due-Date': { type: 'datetime' }, // ❌ kebab-case not allowed
Status: { type: 'select' }, // ❌ PascalCase not allowed
}fields: {
first_name: { type: 'text' }, // ✅ snake_case
due_date: { type: 'datetime' }, // ✅ snake_case
status: { type: 'select' }, // ✅ snake_case
}{
type: 'text',
max_length: 255, // ❌ snake_case not allowed for TS config
reference_filters: {}, // ❌ snake_case not allowed for TS config
}{
type: 'text',
maxLength: 255, // ✅ camelCase for TS config
referenceFilters: {}, // ✅ camelCase for TS config
}options: [
{ label: 'In Progress', value: 'In Progress' }, // ❌ space/caps in value
{ label: 'Done', value: 'Done' }, // ❌ uppercase in value
]options: [
{ label: 'In Progress', value: 'in_progress' }, // ✅ lowercase, snake_case
{ label: 'Done', value: 'done' }, // ✅ lowercase
]- Never use
camelCaseorPascalCasefor object names or field keys - Always use
camelCasefor TypeScript configuration property keys - Option values must be lowercase machine identifiers (use snake_case for multi-word)
- Option labels can use any case for display purposes
- Machine names are immutable — changing them requires data migration
- snake_case for data: Database-friendly, SQL-compatible, cross-platform consistency
- camelCase for config: TypeScript/JavaScript convention for object properties
- Lowercase option values: Case-sensitive database comparisons, URL-safe, API-friendly