-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #437 from finos/feat/update-application-schema
Update the Application schema
- Loading branch information
Showing
6 changed files
with
435 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
src/app-directory/specification/examples/application/fdc3-workbench.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
module.exports = { | ||
"appId": "fdc3-workbench", | ||
"name": "fdc3-workbench", | ||
"title": "FDC3 Workbench", | ||
"description": "Development and test tool for FDC3 desktop agents and apps", | ||
"version": "1.0.0", | ||
"tooltip": "FDC3 Workbench", | ||
"icons": [ | ||
{ | ||
"url": "http://fdc3.finos.org/toolbox/fdc3-workbench/fdc3-icon-256.png" | ||
} | ||
], | ||
"images": [ | ||
{ | ||
"url": "https://fdc3.finos.org/docs/assets/fdc3-logo.png", | ||
"tooltip": "FDC3 logo" | ||
} | ||
], | ||
"contactEmail": "fdc3@finos.org", | ||
"supportEmail": "fdc3-maintainers@finos.org", | ||
"publisher": "FDC3", | ||
"intents": [ | ||
{ | ||
"name": "ViewChart", | ||
"displayName": "View Chart", | ||
"contexts": ["fdc3.instrument"] | ||
} | ||
], | ||
"type": "browser", | ||
"details": { | ||
"url": "https://fdc3.finos.org/toolbox/fdc3-workbench/" | ||
}, | ||
"hostManifests": { | ||
"Glue42": { | ||
"type": "window", | ||
"icon": "https://fdc3.finos.org/docs/assets/fdc3-logo.png", | ||
"details": { | ||
"height": 640, | ||
"width": 560, | ||
"left": 120, | ||
"top": 120, | ||
"mode": "tab", | ||
"allowChannels": true, | ||
"loader": { | ||
"enabled": true, | ||
"hideOnLoad": true | ||
} | ||
}, | ||
"customProperties": { | ||
"folder": "FDC3 Toolbox" | ||
} | ||
}, | ||
"Finsemble": { | ||
"window": { | ||
"left": 120, | ||
"top": 120, | ||
"width": 800, | ||
"height": 750, | ||
"options": { | ||
"minWidth": 75 | ||
} | ||
}, | ||
"foreign": { | ||
"components": { | ||
"App Launcher": { | ||
"launchableByUser": true | ||
}, | ||
"Toolbar": { | ||
"iconURL": "http://fdc3.finos.org/toolbox/fdc3-workbench/fdc3-icon-256.png" | ||
}, | ||
"Window Manager": { | ||
"FSBLHeader": true, | ||
"persistWindowState": true | ||
} | ||
} | ||
}, | ||
"interop": { | ||
"autoConnect": true | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const SwaggerParser = require('@apidevtools/swagger-parser'); | ||
const { Validator } = require('jsonschema'); | ||
const assert = require('assert'); | ||
const exampleApplication = require('../examples/application/fdc3-workbench'); | ||
|
||
(async () => { | ||
try { | ||
const api = await SwaggerParser.validate('../appd.yaml'); | ||
|
||
console.log(`API name: ${api.info.title}, Version: ${api.info.version}`); | ||
|
||
const applicationSchema = api.components.schemas.Application; | ||
|
||
const v = new Validator(); | ||
|
||
const validatorResult = v.validate(exampleApplication, applicationSchema); | ||
|
||
assert(validatorResult.valid, `The example application definition does not comply with the Application schema: ${validatorResult.errors}`); | ||
|
||
console.log('Successfully validated the specification and the example application definition!'); | ||
} catch (error) { | ||
console.log(error.message || error); | ||
} | ||
})(); |
Oops, something went wrong.