Skip to content

Commit 51ab6ec

Browse files
authored
Merge pull request #1034 from InteropIO/1033-correct-appd-schema-error
Correct issue in appd details field's schema, error in example and improve test
2 parents 23f9a8e + 01f9c6d commit 51ab6ec

7 files changed

Lines changed: 362 additions & 143 deletions

File tree

src/app-directory/specification/appd.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ components:
542542
The type specific launch details of the application. These details are intended to be
543543
vendor-agnostic and MAY be duplicated or overridden by details provided in the hostManifests
544544
object for a specific host.
545-
oneOf:
545+
anyOf:
546546
- $ref: '#/components/schemas/WebAppDetails'
547547
- $ref: '#/components/schemas/NativeAppDetails'
548548
- $ref: '#/components/schemas/CitrixAppDetails'
@@ -1209,8 +1209,8 @@ components:
12091209
screenshots:
12101210
- src: https://fdc3.finos.org/docs/assets/fdc3-logo.png,
12111211
label: FDC3 logo
1212-
contactEmail: fdc3@finos.org,
1213-
supportEmail: fdc3-maintainers@finos.org,
1212+
contactEmail: fdc3@finos.org
1213+
supportEmail: fdc3-maintainers@finos.org
12141214
publisher: FDC3,
12151215
type: web
12161216
details:

src/app-directory/specification/examples/application/fdc3-workbench.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,28 @@
33
"name": "fdc3-workbench",
44
"title": "FDC3 Workbench",
55
"description": "Development and test tool for FDC3 desktop agents and apps",
6+
"categories": [
7+
"developer tools",
8+
"training"
9+
],
610
"version": "1.0.0",
711
"tooltip": "FDC3 Workbench",
12+
"lang": "en-US",
813
"icons": [
914
{
1015
"src": "http://fdc3.finos.org/toolbox/fdc3-workbench/fdc3-icon-256.png"
1116
}
1217
],
13-
"images": [
18+
"screenshots": [
1419
{
15-
"url": "https://fdc3.finos.org/docs/assets/fdc3-logo.png",
16-
"tooltip": "FDC3 logo"
20+
"src": "https://fdc3.finos.org/docs/assets/fdc3-logo.png",
21+
"label": "FDC3 logo"
1722
}
1823
],
1924
"contactEmail": "fdc3@finos.org",
2025
"supportEmail": "fdc3-maintainers@finos.org",
21-
"publisher": "FDC3",
22-
"intents": [
23-
{
24-
"name": "ViewChart",
25-
"displayName": "View Chart",
26-
"contexts": [
27-
"fdc3.instrument"
28-
]
29-
}
30-
],
31-
"type": "browser",
26+
"publisher": "FDC3,",
27+
"type": "web",
3228
"details": {
3329
"url": "https://fdc3.finos.org/toolbox/fdc3-workbench/"
3430
},
@@ -81,5 +77,11 @@
8177
}
8278
},
8379
"Web App Manifest": "https://example.com/fdc3-workbench.json"
80+
},
81+
"localizedVersions": {
82+
"fr-FR": {
83+
"title": "FDC3 Table de travail",
84+
"description": "Outil de développement et de test pour les desktop agents et applications FDC3"
85+
}
8486
}
8587
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"appId": "my-application",
3+
"name": "my-application",
4+
"title": "My Application",
5+
"description": "An example application that uses FDC3 and fully describes itself in an AppD record.",
6+
"categories": [
7+
"market data",
8+
"research",
9+
"news"
10+
],
11+
"version": "1.0.0",
12+
"tooltip": "My example application definition",
13+
"lang": "en-US",
14+
"icons": [
15+
{
16+
"src": "http://example.domain.com/assets/my-app-icon.png",
17+
"size": "256x256",
18+
"type": "image/png"
19+
}
20+
],
21+
"screenshots": [
22+
{
23+
"src": "http://example.domain.com/assets/my-app-screenshot-1.png",
24+
"label": "The first screenshot of my example app",
25+
"type": "image/png",
26+
"size": "800x600"
27+
},
28+
{
29+
"src": "http://example.domain.com/assets/my-app-screenshot-2.png",
30+
"label": "The second screenshot of my example app",
31+
"type": "image/png",
32+
"size": "800x600"
33+
}
34+
],
35+
"contactEmail": "fdc3@finos.org",
36+
"supportEmail": "fdc3-maintainers@finos.org",
37+
"moreInfo": "http://example.domain.com/",
38+
"publisher": "Example App, Inc.",
39+
"type": "web",
40+
"details": {
41+
"url": "http://example.domain.com/app.html"
42+
},
43+
"hostManifests": {
44+
"Finsemble": {
45+
"window": {
46+
"left": 120,
47+
"top": 120,
48+
"width": 600,
49+
"height": 800,
50+
"options": {
51+
"minWidth": 75
52+
}
53+
},
54+
"foreign": {
55+
"components": {
56+
"App Launcher": {
57+
"launchableByUser": true
58+
},
59+
"Window Manager": {
60+
"FSBLHeader": true,
61+
"persistWindowState": true
62+
}
63+
}
64+
},
65+
"interop": {
66+
"autoConnect": true
67+
}
68+
},
69+
"Glue42": {
70+
"type": "window",
71+
"details": {
72+
"height": 800,
73+
"width": 600,
74+
"left": 120,
75+
"top": 120,
76+
"mode": "tab",
77+
"allowChannels": true,
78+
"loader": {
79+
"enabled": true,
80+
"hideOnLoad": true
81+
}
82+
},
83+
"customProperties": {
84+
"folder": "FDC3 Toolbox"
85+
}
86+
},
87+
"Web App Manifest": "http://example.domain.com/my-app.json"
88+
},
89+
"interop": {
90+
"intents": {
91+
"listensFor": {
92+
"ViewChart": {
93+
"displayName": "View Chart",
94+
"contexts": [
95+
"fdc3.instrument"
96+
]
97+
},
98+
"myApp.GetPrice": {
99+
"displayName": "Get Price",
100+
"contexts": [
101+
"fdc3.instrument"
102+
],
103+
"resultType": "myApp.quote"
104+
}
105+
},
106+
"raises": {
107+
"ViewOrders": [
108+
"fdc3.instrument",
109+
"fdc3.organization"
110+
],
111+
"StartEmail": [
112+
"fdc3.email"
113+
]
114+
}
115+
},
116+
"userChannels": {
117+
"broadcasts": [
118+
"fdc3.instrument",
119+
"fdc3.organization"
120+
],
121+
"listensFor": [
122+
"fdc3.instrument",
123+
"fdc3.organization"
124+
]
125+
},
126+
"appChannels": [
127+
{
128+
"id": "myApp.quotes,",
129+
"description": "Used to share a stream of quotes for currently displayed instrument and may be used to change the currently displayed symbol,",
130+
"broadcasts": [
131+
"myApp.quote"
132+
],
133+
"listensFor": [
134+
"fdc3.instrument"
135+
]
136+
}
137+
]
138+
},
139+
"localizedVersions": {
140+
"fr-FR": {
141+
"title": "Mon application,",
142+
"description": "Un exemple d'application qui utilise FDC3 et se décrit entièrement dans un enregistrement AppD."
143+
}
144+
}
145+
}

src/app-directory/specification/test/index.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
const SwaggerParser = require('@apidevtools/swagger-parser');
22
const { Validator } = require('jsonschema');
33
const assert = require('assert');
4-
const exampleApplication = require('../examples/application/fdc3-workbench.json');
4+
const exampleApplication1 = require('../examples/application/myApplication.json');
5+
const exampleApplication2 = require('../examples/application/fdc3-workbench.json');
56

67
(async () => {
78
try {
@@ -11,16 +12,30 @@ const exampleApplication = require('../examples/application/fdc3-workbench.json'
1112

1213
const applicationSchema = api.components.schemas.Application;
1314

15+
console.log("Setting up the validator...");
1416
const v = new Validator();
1517

16-
const validatorResult = v.validate(exampleApplication, applicationSchema);
18+
19+
console.log("\nValidating the first example: myApplication.json");
20+
const validatorResult1 = v.validate(exampleApplication1, applicationSchema);
1721

1822
assert(
19-
validatorResult.valid,
20-
`The example application definition does not comply with the Application schema: ${validatorResult.errors}`
23+
validatorResult1.valid,
24+
`The example application definition does not comply with the Application schema: ${validatorResult1.errors}`
2125
);
2226

23-
console.log('Successfully validated the specification and the example application definition!');
27+
console.log('Successfully validated the specification and the first example application definition!');
28+
29+
console.log("\nValidating the second example: fdc3-workbench.json");
30+
const validatorResult2 = v.validate(exampleApplication2, applicationSchema);
31+
32+
assert(
33+
validatorResult2.valid,
34+
`The example application definition does not comply with the Application schema: ${validatorResult2.errors}`
35+
);
36+
37+
console.log('Successfully validated the specification and the second example application definition!');
38+
2439
} catch (error) {
2540
console.log(error.message || error);
2641
}

0 commit comments

Comments
 (0)