Skip to content

Commit

Permalink
finos#119: Add JSON schema definitions for previously agreed FDC3 con…
Browse files Browse the repository at this point in the history
…text types
  • Loading branch information
rikoe committed Sep 11, 2019
1 parent c8165c0 commit 1dc3f8d
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/context/Context.ts

This file was deleted.

18 changes: 18 additions & 0 deletions src/context/schemas/contact.schema
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/1.0/contact.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["fdc3.contact"] },
"id": {
"type": "object",
"properties": {
"email": { "type": "string" },
"twitter": { "type": "string" },
"phone": { "type": "string" }
}
}
},
"required": ["id"]
}
14 changes: 14 additions & 0 deletions src/context/schemas/contactList.schema
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/1.0/contactList.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["fdc3.contactList"] },
"contacts": {
"type": "array",
"items": { "$ref": "contact.schema#/" }
}
},
"required": ["contacts"]
}
14 changes: 14 additions & 0 deletions src/context/schemas/context.schema
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/1.0/context.schema",
"type": "object",
"properties": {
"type": { "type": "string" },
"name": { "type": "string" },
"id": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"required": ["type"]
}
17 changes: 17 additions & 0 deletions src/context/schemas/country.schema
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/1.0/country.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["fdc3.country"] },
"id": {
"type": "object",
"properties": {
"ISOALPHA2": { "type": "string" },
"ISOALPHA3": { "type": "string" }
}
}
},
"required": ["id", "name"]
}
24 changes: 24 additions & 0 deletions src/context/schemas/instrument.schema
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/1.0/instrument.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["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 src/context/schemas/instrumentList.schema
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/1.0/instrumentList.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["fdc3.instrumentList"] },
"instruments": {
"type": "array",
"items": { "$ref": "instrument.schema#/" }
}
},
"required": ["instruments"]
}
18 changes: 18 additions & 0 deletions src/context/schemas/organization.schema
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/1.0/organization.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["fdc3.organization"] },
"id": {
"type": "object",
"properties": {
"LEI": { "type": "string" },
"PERMID": { "type": "string" },
"FDSID": { "type": "string" }
}
}
},
"required": ["id","name"]
}
14 changes: 14 additions & 0 deletions src/context/schemas/portfolio.schema
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/1.0/portfolio.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["fdc3.portfolio"] },
"positions": {
"type": "array",
"items": { "$ref": "position.schema#/" }
}
},
"required": ["positions"]
}
12 changes: 12 additions & 0 deletions src/context/schemas/position.schema
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/1.0/position.schema",
"type": "object",
"allOf": [{ "$ref": "context.schema#/" }],
"properties": {
"type": { "enum": ["fdc3.position"] },
"instrument": { "$ref": "instrument.schema#/" },
"holding": { "type": "number", "minimum": 0 }
},
"required": ["instrument", "holding"]
}

0 comments on commit 1dc3f8d

Please sign in to comment.