Skip to content

Commit 0bb61a8

Browse files
gecage952Lance-Drane
authored andcommitted
Add json schemas for service to service example
1 parent 16e719b commit 0bb61a8

File tree

2 files changed

+344
-0
lines changed

2 files changed

+344
-0
lines changed
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
{
2+
"asyncapi": "2.6.0",
3+
"x-intersect-version": "0.6.4",
4+
"info": {
5+
"title": "example-organization.example-facility.example-system.example-subsystem.service-one",
6+
"version": "0.0.0",
7+
"description": "Service One Capability.\n"
8+
},
9+
"defaultContentType": "application/json",
10+
"channels": {
11+
"pass_text_to_service_2": {
12+
"publish": {
13+
"message": {
14+
"schemaFormat": "application/vnd.aai.asyncapi+json;version=2.6.0",
15+
"contentType": "application/json",
16+
"traits": {
17+
"$ref": "#/components/messageTraits/commonHeaders"
18+
},
19+
"payload": {
20+
"type": "null"
21+
}
22+
},
23+
"description": "Takes in a string parameter and sends it to service 2."
24+
},
25+
"subscribe": {
26+
"message": {
27+
"schemaFormat": "application/vnd.aai.asyncapi+json;version=2.6.0",
28+
"contentType": "application/json",
29+
"traits": {
30+
"$ref": "#/components/messageTraits/commonHeaders"
31+
},
32+
"payload": {
33+
"type": "string"
34+
}
35+
},
36+
"description": "Takes in a string parameter and sends it to service 2."
37+
},
38+
"events": []
39+
}
40+
},
41+
"events": {
42+
"response_event": {
43+
"type": "string"
44+
}
45+
},
46+
"components": {
47+
"schemas": {},
48+
"messageTraits": {
49+
"commonHeaders": {
50+
"messageHeaders": {
51+
"$defs": {
52+
"IntersectDataHandler": {
53+
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
54+
"enum": [
55+
0,
56+
1
57+
],
58+
"title": "IntersectDataHandler",
59+
"type": "integer"
60+
}
61+
},
62+
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
63+
"properties": {
64+
"source": {
65+
"description": "source of the message",
66+
"pattern": "([-a-z0-9]+\\.)*[-a-z0-9]",
67+
"title": "Source",
68+
"type": "string"
69+
},
70+
"destination": {
71+
"description": "destination of the message",
72+
"pattern": "([-a-z0-9]+\\.)*[-a-z0-9]",
73+
"title": "Destination",
74+
"type": "string"
75+
},
76+
"created_at": {
77+
"description": "the UTC timestamp of message creation",
78+
"format": "date-time",
79+
"title": "Created At",
80+
"type": "string"
81+
},
82+
"sdk_version": {
83+
"description": "SemVer string of SDK's version, used to check for compatibility",
84+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
85+
"title": "Sdk Version",
86+
"type": "string"
87+
},
88+
"data_handler": {
89+
"allOf": [
90+
{
91+
"$ref": "#/components/messageTraits/commonHeaders/userspaceHeaders/$defs/IntersectDataHandler"
92+
}
93+
],
94+
"default": 0,
95+
"description": "Code signifying where data is stored."
96+
},
97+
"has_error": {
98+
"default": false,
99+
"description": "If this value is True, the payload will contain the error message (a string)",
100+
"title": "Has Error",
101+
"type": "boolean"
102+
}
103+
},
104+
"required": [
105+
"source",
106+
"destination",
107+
"created_at",
108+
"sdk_version"
109+
],
110+
"title": "UserspaceMessageHeader",
111+
"type": "object"
112+
},
113+
"eventHeaders": {
114+
"$defs": {
115+
"IntersectDataHandler": {
116+
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
117+
"enum": [
118+
0,
119+
1
120+
],
121+
"title": "IntersectDataHandler",
122+
"type": "integer"
123+
}
124+
},
125+
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
126+
"properties": {
127+
"source": {
128+
"description": "source of the message",
129+
"pattern": "([-a-z0-9]+\\.)*[-a-z0-9]",
130+
"title": "Source",
131+
"type": "string"
132+
},
133+
"created_at": {
134+
"description": "the UTC timestamp of message creation",
135+
"format": "date-time",
136+
"title": "Created At",
137+
"type": "string"
138+
},
139+
"sdk_version": {
140+
"description": "SemVer string of SDK's version, used to check for compatibility",
141+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
142+
"title": "Sdk Version",
143+
"type": "string"
144+
},
145+
"data_handler": {
146+
"allOf": [
147+
{
148+
"$ref": "#/components/messageTraits/commonHeaders/eventHeaders/$defs/IntersectDataHandler"
149+
}
150+
],
151+
"default": 0,
152+
"description": "Code signifying where data is stored."
153+
},
154+
"event_name": {
155+
"title": "Event Name",
156+
"type": "string"
157+
}
158+
},
159+
"required": [
160+
"source",
161+
"created_at",
162+
"sdk_version",
163+
"event_name"
164+
],
165+
"title": "EventMessageHeaders",
166+
"type": "object"
167+
}
168+
}
169+
}
170+
},
171+
"status": {
172+
"type": "string"
173+
}
174+
}
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
{
2+
"asyncapi": "2.6.0",
3+
"x-intersect-version": "0.6.4",
4+
"info": {
5+
"title": "example-organization.example-facility.example-system.example-subsystem.service-two",
6+
"version": "0.0.0",
7+
"description": "Service Two Capability.\n"
8+
},
9+
"defaultContentType": "application/json",
10+
"channels": {
11+
"test_service": {
12+
"publish": {
13+
"message": {
14+
"schemaFormat": "application/vnd.aai.asyncapi+json;version=2.6.0",
15+
"contentType": "application/json",
16+
"traits": {
17+
"$ref": "#/components/messageTraits/commonHeaders"
18+
},
19+
"payload": {
20+
"type": "string"
21+
}
22+
},
23+
"description": "Returns the text given along with acknowledgement."
24+
},
25+
"subscribe": {
26+
"message": {
27+
"schemaFormat": "application/vnd.aai.asyncapi+json;version=2.6.0",
28+
"contentType": "application/json",
29+
"traits": {
30+
"$ref": "#/components/messageTraits/commonHeaders"
31+
},
32+
"payload": {
33+
"type": "string"
34+
}
35+
},
36+
"description": "Returns the text given along with acknowledgement."
37+
},
38+
"events": []
39+
}
40+
},
41+
"events": {},
42+
"components": {
43+
"schemas": {},
44+
"messageTraits": {
45+
"commonHeaders": {
46+
"messageHeaders": {
47+
"$defs": {
48+
"IntersectDataHandler": {
49+
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
50+
"enum": [
51+
0,
52+
1
53+
],
54+
"title": "IntersectDataHandler",
55+
"type": "integer"
56+
}
57+
},
58+
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
59+
"properties": {
60+
"source": {
61+
"description": "source of the message",
62+
"pattern": "([-a-z0-9]+\\.)*[-a-z0-9]",
63+
"title": "Source",
64+
"type": "string"
65+
},
66+
"destination": {
67+
"description": "destination of the message",
68+
"pattern": "([-a-z0-9]+\\.)*[-a-z0-9]",
69+
"title": "Destination",
70+
"type": "string"
71+
},
72+
"created_at": {
73+
"description": "the UTC timestamp of message creation",
74+
"format": "date-time",
75+
"title": "Created At",
76+
"type": "string"
77+
},
78+
"sdk_version": {
79+
"description": "SemVer string of SDK's version, used to check for compatibility",
80+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
81+
"title": "Sdk Version",
82+
"type": "string"
83+
},
84+
"data_handler": {
85+
"allOf": [
86+
{
87+
"$ref": "#/components/messageTraits/commonHeaders/userspaceHeaders/$defs/IntersectDataHandler"
88+
}
89+
],
90+
"default": 0,
91+
"description": "Code signifying where data is stored."
92+
},
93+
"has_error": {
94+
"default": false,
95+
"description": "If this value is True, the payload will contain the error message (a string)",
96+
"title": "Has Error",
97+
"type": "boolean"
98+
}
99+
},
100+
"required": [
101+
"source",
102+
"destination",
103+
"created_at",
104+
"sdk_version"
105+
],
106+
"title": "UserspaceMessageHeader",
107+
"type": "object"
108+
},
109+
"eventHeaders": {
110+
"$defs": {
111+
"IntersectDataHandler": {
112+
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
113+
"enum": [
114+
0,
115+
1
116+
],
117+
"title": "IntersectDataHandler",
118+
"type": "integer"
119+
}
120+
},
121+
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
122+
"properties": {
123+
"source": {
124+
"description": "source of the message",
125+
"pattern": "([-a-z0-9]+\\.)*[-a-z0-9]",
126+
"title": "Source",
127+
"type": "string"
128+
},
129+
"created_at": {
130+
"description": "the UTC timestamp of message creation",
131+
"format": "date-time",
132+
"title": "Created At",
133+
"type": "string"
134+
},
135+
"sdk_version": {
136+
"description": "SemVer string of SDK's version, used to check for compatibility",
137+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
138+
"title": "Sdk Version",
139+
"type": "string"
140+
},
141+
"data_handler": {
142+
"allOf": [
143+
{
144+
"$ref": "#/components/messageTraits/commonHeaders/eventHeaders/$defs/IntersectDataHandler"
145+
}
146+
],
147+
"default": 0,
148+
"description": "Code signifying where data is stored."
149+
},
150+
"event_name": {
151+
"title": "Event Name",
152+
"type": "string"
153+
}
154+
},
155+
"required": [
156+
"source",
157+
"created_at",
158+
"sdk_version",
159+
"event_name"
160+
],
161+
"title": "EventMessageHeaders",
162+
"type": "object"
163+
}
164+
}
165+
}
166+
},
167+
"status": {
168+
"type": "string"
169+
}
170+
}

0 commit comments

Comments
 (0)