-
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.
- Loading branch information
1 parent
0f240e8
commit 4ae6e31
Showing
5 changed files
with
388 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
38 changes: 38 additions & 0 deletions
38
src/app-directory/specification/examples/application/fdc3-tradingview-chart-orig.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,38 @@ | ||
module.exports = { | ||
appId: 'fdc3-tradingview-chart-orig', | ||
name: 'FDC3 TradingView Chart (orig)', | ||
type: 'browser', | ||
details: { | ||
url: 'https://appd.kolbito.com/demos/tradingview-chart/index.html' | ||
}, | ||
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 Orig' | ||
} | ||
} | ||
}, | ||
intents: [ | ||
{ | ||
name: 'fdc3.ViewChart', | ||
displayName: 'View Chart', | ||
contexts: [ | ||
'fdc3.instrument' | ||
] | ||
} | ||
] | ||
}; |
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,25 @@ | ||
const SwaggerParser = require('@apidevtools/swagger-parser'); | ||
const { Validator } = require('jsonschema'); | ||
const assert = require('assert'); | ||
const exampleApplication = require('../examples/application/fdc3-tradingview-chart-orig'); | ||
|
||
(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 example application definition!'); | ||
} | ||
catch (error) { | ||
console.log(error.message || error); | ||
} | ||
})(); |
Oops, something went wrong.