Skip to content

Commit bb5b42a

Browse files
authored
feat: Allow to specify internal structure for records in KVS (#70)
* feat: Allow to specify internal structure for records in KVS * Fix and content type
1 parent 6a24310 commit bb5b42a

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

pages/KEY_VALUE_STORE_SCHEMA.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,29 @@ like to embed to run view for the user once the monitoring is finished.
4343
}
4444
```
4545

46-
For more information on how to create a key-value store with a schema, see [DATASET_SCHEMA.json](./DATASET_SCHEMA.md)
47-
as the implementation and API will be the same.
46+
3. Some Actors store a record that has a specific structure. The structure can be specified using [JSON schema](https://json-schema.org/draft-07).
47+
Contrary to dataset schema, the record in key-value store represents output that is a single item, instead of a sequence of items. But both approaches use JSON schema to describe the structure.
48+
49+
```jsonc
50+
{
51+
"collections": {
52+
"monitoringReportData": {
53+
"name": "Monitoring report data",
54+
"description": "JSON containing the report data",
55+
"key": "report-data.json",
56+
"contentTypes": ["application/json"],
57+
"jsonSchema": {
58+
"$schema": "http://json-schema.org/draft-07/schema#",
59+
"type": "object",
60+
"properties": {
61+
"summary": { "type": "string" },
62+
"totalResults": { "type": "number" }
63+
}
64+
} // alternatively "jsonSchema": "./report-schema.json" can be used
65+
}
66+
}
67+
}
68+
```
4869

4970
## Structure
5071

0 commit comments

Comments
 (0)