Skip to content

Commit

Permalink
finos#128 - copy schemas as static website files as part of build
Browse files Browse the repository at this point in the history
- Copy to schemas/next folder with npm command
- Make part of website pre-publish script during build
- Update links in context schema spec to point to published schemas
  • Loading branch information
rikoe committed Feb 13, 2020
1 parent 0795fb0 commit ffef5a2
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ script:
- git config --global user.name "${GH_NAME}"
- git config --global user.email "${GH_EMAIL}"
- echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
- cd website && yarn install && yarn run redoc-appd && GIT_USER="${GH_NAME}" yarn run publish-gh-pages
- cd website && yarn install && GIT_USER="${GH_NAME}" yarn run publish-gh-pages
16 changes: 8 additions & 8 deletions docs/context/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,34 @@ The following are standard FDC3 context types.
- __fdc3.contact__
- A person contact that can be engaged with through email, calling, messaging, CMS, etc.
- [Financial Objects Specification](https://fo.finos.org/docs/objects/contact)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/contact.schema)
- [schema](/schemas/next/contact.schema.json)
- __fd3.contactList__
- A collection of contacts.
- [Financial Objects Specification](https://fo.finos.org/docs/objects/contactlist)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/contactList.schema)
- [schema](/schemas/next/contactList.schema.json)
- __fdc3.country__
- A standard country entity.
- [Financial Objects Specification](https://fo.finos.org/docs/objects/country)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/country.schema)
- [schema](/schemas/next/country.schema.json)
- __fdc3.instrument__
- A financial instrument from any asset class.
- [Financial Objects Specification](https://fo.finos.org/docs/objects/instrument)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/instrument.schema)
- [schema](/schemas/next/instrument.schema.json)
- __fdc3.instrumentList__
- A collection of instruments.
- [Financial Objects Specification](https://fo.finos.org/docs/objects/instrumentList)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/instrumentList.schema)
- [schema](/schemas/next/instrumentList.schema.json)
- __fdd3.organization__
- A standard organization entity.
- [Financial Objects Specification](https://fo.finos.org/docs/objects/organization)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/organization.schema)
- [schema](/schemas/next/organization.schema.json)
- __fdc3.portfolio__
- A collection of positions.
- [Financial Objects Specification](https://fo.finos.org/docs/objects/portfolio)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/portfolio.schema)
- [schema](/schemas/next/portfolio.schema.json)
- __fdc3.position__
- [Financial Objects Specification](https://fo.finos.org/docs/objects/position)
- [schema](https://github.com/finos/FDC3/blob/master/src/context/schemas/position.schema)
- [schema](/schemas/next/position.schema.json)

__Note:__ The below examples show how the base context data interface can be used to define specific context data objects. It is not the purpose of the specification at this stage to define standard representations for objects. It establishes the framework in which such definitions could be created.

Expand Down
6 changes: 5 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
"scripts": {
"examples": "docusaurus-examples",
"start": "docusaurus-start",
"prebuild": "yarn run redoc-appd && yarn run copy-schemas",
"build": "docusaurus-build",
"prepublish-gh-pages": "yarn run redoc-appd && yarn run copy-schemas",
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version",
"redoc-appd": "redoc-cli bundle --output pages/appd-spec.html ../src/app-directory/specification/appd.yaml"
"redoc-appd": "redoc-cli bundle --output pages/appd-spec.html ../src/app-directory/specification/appd.yaml",
"copy-schemas": "copyfiles -f ../src/context/schemas/*.schema.json static/schemas/next"
},
"devDependencies": {
"copyfiles": "2.2.0",
"docusaurus": "1.12.0",
"redoc-cli": "0.8.5"
},
Expand Down
17 changes: 17 additions & 0 deletions website/static/schemas/next/contact.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/contact.schema.json",
"type": "object",
"allOf": [{ "$ref": "context.schema.json#/" }],
"properties": {
"type": { "const": "fdc3.contact" },
"id": {
"type": "object",
"properties": {
"email": { "type": "string" },
"FDS_ID": { "type": "string" }
}
}
},
"required": ["id"]
}
14 changes: 14 additions & 0 deletions website/static/schemas/next/contactList.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/contactList.schema.json",
"type": "object",
"allOf": [{ "$ref": "context.schema.json#/" }],
"properties": {
"type": { "const": "fdc3.contactList" },
"contacts": {
"type": "array",
"items": { "$ref": "contact.schema#/" }
}
},
"required": ["contacts"]
}
14 changes: 14 additions & 0 deletions website/static/schemas/next/context.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/context.schema.json",
"type": "object",
"properties": {
"type": { "type": "string" },
"name": { "type": "string" },
"id": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"required": ["type"]
}
17 changes: 17 additions & 0 deletions website/static/schemas/next/country.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/country.schema.json",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "const": "fdc3.country" },
"id": {
"type": "object",
"properties": {
"ISOALPHA2": { "type": "string" },
"ISOALPHA3": { "type": "string" }
}
}
},
"required": ["id"]
}
24 changes: 24 additions & 0 deletions website/static/schemas/next/instrument.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/instrument.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "const": "fdc3.instrument" },
"id": {
"type": "object",
"properties": {
"BBG": { "type": "string" },
"CUSIP": { "type": "string" },
"FDS_ID": { "type": "string" },
"FIGI": { "type": "string" },
"ISIN": { "type": "string" },
"PERMID": { "type": "string" },
"RIC": { "type": "string" },
"SEDOL": { "type": "string" },
"ticker": { "type": "string" }
}
}
},
"required": ["id"]
}
14 changes: 14 additions & 0 deletions website/static/schemas/next/instrumentList.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/instrumentList.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "const": "fdc3.instrumentList" },
"instruments": {
"type": "array",
"items": { "$ref": "instrument.schema#/" }
}
},
"required": ["instruments"]
}
18 changes: 18 additions & 0 deletions website/static/schemas/next/organization.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/organization.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "const": "fdc3.organization" },
"id": {
"type": "object",
"properties": {
"LEI": { "type": "string" },
"PERMID": { "type": "string" },
"FDS_ID": { "type": "string" }
}
}
},
"required": ["id"]
}
14 changes: 14 additions & 0 deletions website/static/schemas/next/portfolio.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/portfolio.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "const": "fdc3.portfolio" },
"positions": {
"type": "array",
"items": { "$ref": "position.schema#/" }
}
},
"required": ["positions"]
}
12 changes: 12 additions & 0 deletions website/static/schemas/next/position.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/position.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "const": "fdc3.position" },
"instrument": { "$ref": "instrument.schema#/" },
"holding": { "type": "number", "minimum": 0 }
},
"required": ["instrument"]
}
41 changes: 38 additions & 3 deletions website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,18 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=

copyfiles@2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.2.0.tgz#d9fc6c06f299337fb7eeb7ea5887e9d7188d9d47"
integrity sha512-iJbHJI+8OKqsq+4JF0rqgRkZzo++jqO6Wf4FUU1JM41cJF6JcY5968XyF4tm3Kkm7ZOMrqlljdm8N9oyY5raGw==
dependencies:
glob "^7.0.5"
minimatch "^3.0.3"
mkdirp "^0.5.1"
noms "0.0.0"
through2 "^2.0.1"
yargs "^13.2.4"

core-js-compat@^3.1.1:
version "3.4.7"
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.4.7.tgz#39f8080b1d92a524d6d90505c42b9c5c1eb90611"
Expand Down Expand Up @@ -4186,6 +4198,11 @@ is2@2.0.1:
ip-regex "^2.1.0"
is-url "^1.2.2"

isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=

isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
Expand Down Expand Up @@ -4879,7 +4896,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=

minimatch@3.0.4, minimatch@^3.0.4, minimatch@~3.0.2:
minimatch@3.0.4, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
Expand Down Expand Up @@ -5085,6 +5102,14 @@ node-releases@^1.1.29, node-releases@^1.1.41:
dependencies:
semver "^6.3.0"

noms@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859"
integrity sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=
dependencies:
inherits "^2.0.1"
readable-stream "~1.0.31"

nopt@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
Expand Down Expand Up @@ -6343,6 +6368,16 @@ readable-stream@^3.1.1:
string_decoder "^1.1.1"
util-deprecate "^1.0.1"

readable-stream@~1.0.31:
version "1.0.34"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "0.0.1"
string_decoder "~0.10.x"

readdirp@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525"
Expand Down Expand Up @@ -7165,7 +7200,7 @@ string.prototype.trimright@^2.1.0:
define-properties "^1.1.3"
function-bind "^1.1.1"

string_decoder@0.10:
string_decoder@0.10, string_decoder@~0.10.x:
version "0.10.31"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=
Expand Down Expand Up @@ -7398,7 +7433,7 @@ text-table@0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=

through2@^2.0.0:
through2@^2.0.0, through2@^2.0.1:
version "2.0.5"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"
integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==
Expand Down

0 comments on commit ffef5a2

Please sign in to comment.