Skip to content

Commit f155758

Browse files
committed
add version field to diagram
Signed-off-by: Teo Koon Peng <[email protected]>
1 parent 7f7df68 commit f155758

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

diagram.schema.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"type": "object",
55
"required": [
66
"ops",
7-
"start"
7+
"start",
8+
"version"
89
],
910
"properties": {
1011
"ops": {
@@ -20,6 +21,13 @@
2021
"$ref": "#/definitions/NextOperation"
2122
}
2223
]
24+
},
25+
"version": {
26+
"description": "Version of the diagram, should always be `1`.",
27+
"type": "integer",
28+
"format": "uint32",
29+
"maximum": 1.0,
30+
"minimum": 1.0
2331
}
2432
},
2533
"definitions": {

src/diagram.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ type DiagramScope<Streams = ()> = Scope<DiagramStart, DiagramTerminate, Streams>
271271
#[derive(JsonSchema, Serialize, Deserialize)]
272272
#[serde(rename_all = "snake_case")]
273273
pub struct Diagram {
274+
/// Version of the diagram, should always be `1`.
275+
#[schemars(range(min = 1, max = 1))]
276+
version: u32,
277+
274278
/// Signifies the start of a workflow.
275279
start: NextOperation,
276280

0 commit comments

Comments
 (0)