Skip to content

Commit 26f958d

Browse files
committed
feat(schemas)!: Use eipId to properly identify child elements
1 parent 6ba9789 commit 26f958d

15 files changed

+104
-50
lines changed

schemas/model/json/attributeType.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://github.com/codice/keip-canvas/schemas/v0.3.0/attributeType.schema.json",
3+
"$id": "https://github.com/codice/keip-canvas/schemas/v0.4.0/attributeType.schema.json",
44
"title": "AttributeType",
55
"description": "The attribute's value type (attribute keys are always strings)",
66
"oneOf": [

schemas/model/json/connectionType.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://github.com/codice/keip-canvas/schemas/v0.3.0/connectionType.schema.json",
3+
"$id": "https://github.com/codice/keip-canvas/schemas/v0.4.0/connectionType.schema.json",
44
"title": "ConnectionType",
55
"description": "Defines a connection pattern for an EIP component",
66
"type": "string",

schemas/model/json/eipComponentDef.schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://github.com/codice/keip-canvas/schemas/v0.3.0/eipComponentDef.schema.json",
3+
"$id": "https://github.com/codice/keip-canvas/schemas/v0.4.0/eipComponentDef.schema.json",
44
"title": "EipComponentDefinition",
55
"description": "Defines the collection of EIP components available for use",
66
"type": "object",
@@ -87,8 +87,8 @@
8787
"description": "The base schema for all EIP Elements (e.g. EipComponent, EipChildElement)",
8888
"type": "object",
8989
"properties": {
90-
"name": {
91-
"type": "string"
90+
"eipId": {
91+
"$ref": "eipId.schema.json"
9292
},
9393
"description": {
9494
"type": "string"
@@ -104,7 +104,7 @@
104104
}
105105
},
106106
"required": [
107-
"name"
107+
"eipId"
108108
]
109109
},
110110
"EipChildGroup": {

schemas/model/json/eipFlow.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://github.com/codice/keip-canvas/schemas/v0.3.0/eipFlow.schema.json",
3+
"$id": "https://github.com/codice/keip-canvas/schemas/v0.4.0/eipFlow.schema.json",
44
"title": "EipFlow",
55
"description": "A representation of an EIP flow diagram as a collection of nodes and their corresponding edges",
66
"type": "object",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/codice/keip-canvas/schemas/v0.4.0/eipId.schema.json",
4+
"title": "EipId",
5+
"description": "A combination of fields uniquely identifying a component in an 'EipComponentDefinition'",
6+
"type": "object",
7+
"properties": {
8+
"namespace": {
9+
"type": "string"
10+
},
11+
"name": {
12+
"type": "string"
13+
}
14+
},
15+
"required": [
16+
"namespace",
17+
"name"
18+
]
19+
}

schemas/model/json/eipNode.schema.json

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://github.com/codice/keip-canvas/schemas/v0.3.0/eipNode.schema.json",
3+
"$id": "https://github.com/codice/keip-canvas/schemas/v0.4.0/eipNode.schema.json",
44
"title": "EipNode",
55
"description": "An instance of an 'EipComponent' as a node in the flow diagram",
66
"type": "object",
@@ -15,7 +15,7 @@
1515
"type": "string"
1616
},
1717
"eipId": {
18-
"$ref": "#/$defs/EipId"
18+
"$ref": "eipId.schema.json"
1919
},
2020
"label": {
2121
"type": "string"
@@ -41,22 +41,6 @@
4141
},
4242
"additionalProperties": false,
4343
"$defs": {
44-
"EipId": {
45-
"description": "A combination of fields uniquely identifying a component in an 'EipComponentDefinition'",
46-
"type": "object",
47-
"properties": {
48-
"namespace": {
49-
"type": "string"
50-
},
51-
"name": {
52-
"type": "string"
53-
}
54-
},
55-
"required": [
56-
"namespace",
57-
"name"
58-
]
59-
},
6044
"Attributes": {
6145
"description": "A map of EIP attributes belonging to the node",
6246
"type": "object",
@@ -68,8 +52,8 @@
6852
"description": "An instance of an 'EipChildElement'. Can recursively contain more child nodes as well as attributes of its own.",
6953
"type": "object",
7054
"properties": {
71-
"name": {
72-
"type": "string"
55+
"eipId": {
56+
"$ref": "eipId.schema.json"
7357
},
7458
"attributes": {
7559
"$ref": "#/$defs/Attributes"
@@ -82,7 +66,7 @@
8266
}
8367
},
8468
"required": [
85-
"name"
69+
"eipId"
8670
],
8771
"additionalProperties": false
8872
}

schemas/model/json/eipRole.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://github.com/codice/keip-canvas/schemas/v0.3.0/eipRole.schema.json",
3+
"$id": "https://github.com/codice/keip-canvas/schemas/v0.4.0/eipRole.schema.json",
44
"title": "EipRole",
55
"description": "Describes the expected general behavior of an EIP component",
66
"type": "string",

schemas/model/json/examples/sampleEipComponentDef.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
{
44
"role": "endpoint",
55
"connectionType": "sink",
6-
"name": "outbound-channel-adapter",
6+
"eipId": {
7+
"namespace": "http",
8+
"name": "outbound-channel-adapter"
9+
},
710
"attributes": [
811
{
912
"name": "url",
@@ -30,7 +33,10 @@
3033
"occurrence": {
3134
"min": 0
3235
},
33-
"name": "poller",
36+
"eipId": {
37+
"namespace": "integration",
38+
"name": "poller"
39+
},
3440
"attributes": [
3541
{
3642
"name": "fixed-rate",
@@ -47,7 +53,10 @@
4753
"min": 0,
4854
"max": -1
4955
},
50-
"name": "transactional",
56+
"eipId": {
57+
"namespace": "integration",
58+
"name": "transactional"
59+
},
5160
"description": "Run each poll task in a transaction.",
5261
"attributes": [
5362
{
@@ -70,7 +79,10 @@
7079
{
7180
"role": "endpoint",
7281
"connectionType": "passthru",
73-
"name": "file-to-string-transformer",
82+
"eipId": {
83+
"namespace": "file",
84+
"name": "file-to-string-transformer"
85+
},
7486
"attributes": [
7587
{
7688
"name": "input-channel",

schemas/model/json/examples/sampleEipFlow.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@
1515
},
1616
"children": [
1717
{
18-
"name": "poller",
18+
"eipId": {
19+
"namespace": "integration",
20+
"name": "poller"
21+
},
1922
"attributes": {
2023
"fixed-rate": 5000
2124
},
2225
"children": [
2326
{
24-
"name": "advice-chain",
27+
"eipId": {
28+
"namespace": "integration",
29+
"name": "advice-chain"
30+
},
2531
"attributes": {
2632
"synchronization-factory": "defaultSyncFactory"
2733
}
@@ -70,7 +76,10 @@
7076
"connectionType": "passthru",
7177
"children": [
7278
{
73-
"name": "expression",
79+
"eipId": {
80+
"namespace": "integration",
81+
"name": "expression"
82+
},
7483
"attributes": {
7584
"key": "prepend",
7685
"source": "prepexExp"

schemas/model/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parent>
1212

1313
<artifactId>model</artifactId>
14-
<version>0.3.0</version>
14+
<version>0.4.0</version>
1515

1616
<build>
1717
<plugins>

0 commit comments

Comments
 (0)