You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spec/metadata-standard.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,26 @@ rules:
98
98
compare_to: start_date
99
99
```
100
100
101
+
#### Initial Data
102
+
**Purpose**: Define seed data or default records to be loaded on startup.
103
+
104
+
**What you define**:
105
+
- Target object
106
+
- List of records to insert (auto-created if validation passes)
107
+
108
+
**Example**:
109
+
```yaml
110
+
# initial.data.yml
111
+
object: User
112
+
records:
113
+
- name: Administrator
114
+
email: admin@company.com
115
+
role: admin
116
+
- name: Guest
117
+
email: guest@company.com
118
+
role: read_only
119
+
```
120
+
101
121
### 2. Business Logic Layer
102
122
103
123
#### [Hooks (Triggers)](./hook.md)
@@ -425,6 +445,35 @@ src/
425
445
2. Deploy to ObjectOS runtime
426
446
3. Monitor and iterate
427
447
448
+
## Metadata API & File Structure
449
+
450
+
ObjectQL provides a universal loader and generic API for all metadata types.
451
+
452
+
### File Naming Convention
453
+
Metadata files are automatically loaded based on their extension. The `name` property in the file is used as the ID, or it is inferred from the filename (e.g. `my-list.view.yml` -> `my-list`).
454
+
455
+
| Type | Extension |
456
+
|---|---|
457
+
| Object |`*.object.yml`|
458
+
| View |`*.view.yml`|
459
+
| Form |`*.form.yml`|
460
+
| Menu |`*.menu.yml`|
461
+
| Report |`*.report.yml`|
462
+
| Workflow |`*.workflow.yml`|
463
+
| Permission |`*.permission.yml`|
464
+
| Validation |`*.validation.yml`|
465
+
| Initial Data |`*.data.yml`|
466
+
467
+
### Generic Metadata API
468
+
All metadata types can be queried via the REST API:
469
+
470
+
-`GET /api/metadata/:type`
471
+
- List all entries for a specific type (e.g. `/api/metadata/view`)
472
+
-`GET /api/metadata/:type/:id`
473
+
- Get the JSON content of a specific entry (e.g. `/api/metadata/view/task_list`)
474
+
-`POST /api/metadata/:type/:id`
475
+
- Update metadata content (if supported by storage)
0 commit comments