From 75141ff3561c22399b4b7dd34795d35f5f1307c5 Mon Sep 17 00:00:00 2001 From: Yannick Malins Date: Fri, 5 Aug 2022 11:11:46 +0200 Subject: [PATCH] review: make intent type free, rename intent+context to action --- src/context/schemas.json | 2 +- src/context/schemas/action.schema.json | 25 ++++++++++++++++ src/context/schemas/intent.schema.json | 40 ------------------------- src/context/schemas/message.schema.json | 4 +-- 4 files changed, 28 insertions(+), 43 deletions(-) create mode 100644 src/context/schemas/action.schema.json delete mode 100644 src/context/schemas/intent.schema.json diff --git a/src/context/schemas.json b/src/context/schemas.json index e4e2c2c75..b5eba4393 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -1,4 +1,5 @@ { + "Action": ["https://fdc3.finos.org/schemas/next/action.schema.json"], "Context": ["https://fdc3.finos.org/schemas/next/context.schema.json"], "Chart": ["https://fdc3.finos.org/schemas/next/chart.schema.json"], "ChatInitSettings": ["https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json"], @@ -9,7 +10,6 @@ "Email": ["https://fdc3.finos.org/schemas/next/email.schema.json"], "Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"], "InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"], - "Intent": ["https://fdc3.finos.org/schemas/next/intent.schema.json"], "Message": ["https://fdc3.finos.org/schemas/next/message.schema.json"], "Nothing": ["https://fdc3.finos.org/schemas/next/nothing.schema.json"], "Organization": ["https://fdc3.finos.org/schemas/next/organization.schema.json"], diff --git a/src/context/schemas/action.schema.json b/src/context/schemas/action.schema.json new file mode 100644 index 000000000..ec5fcf52d --- /dev/null +++ b/src/context/schemas/action.schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/action.schema.json", + "type": "object", + "title": "Action", + "properties": { + "title": { + "type": "string" + }, + "intent": { + "type": "string", + "$comment": "Should reference one of the intent types listed in 'standard intents'" + }, + "context": { + "type": "object", + "$ref": "context.schema.json#" + }, + "customConfig": { + "type": "object" + } + }, + "required": [ + "title", "context" + ] +} diff --git a/src/context/schemas/intent.schema.json b/src/context/schemas/intent.schema.json deleted file mode 100644 index ce0043694..000000000 --- a/src/context/schemas/intent.schema.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/intent.schema.json", - "type": "object", - "title": "Intent", - "properties": { - "title": { - "type": "string" - }, - "intent": { - "type": "string", - "enum": [ - "StartCall", - "StartChat", - "StartEmail", - "ViewChart", - "ViewContact", - "ViewQuote", - "ViewNews", - "ViewInstrument", - "ViewAnalysis", - "ViewHoldings", - "ViewProfile", - "ViewResearch", - "ViewInteractions", - "ViewOrders" - ] - }, - "context": { - "type": "object", - "$ref": "context.schema.json#" - }, - "customConfig": { - "type": "object" - } - }, - "required": [ - "title", "intent", "context" - ] -} diff --git a/src/context/schemas/message.schema.json b/src/context/schemas/message.schema.json index 8a4310f4e..49806b462 100644 --- a/src/context/schemas/message.schema.json +++ b/src/context/schemas/message.schema.json @@ -23,12 +23,12 @@ "type": "object", "allOf": [ { - "$ref": "intent.schema.json#" + "$ref": "action.schema.json#" } ], "properties": { "type": { - "const": "fdc3.entity.intent" + "const": "fdc3.entity.action" } }, "required": ["type"]