Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine the varying schemas for ImplementationMetadata #1177

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

* Added missing `desktopAgent` field to ImplementationMetadata objects returned for all agents connect to a DesktopAgent bridge in Connection Step 6 connectAgentsUpdate messages and refined the schema used to collect this info in step 3 handshake. ([#1177](https://github.com/finos/FDC3/pull/1177))

## [FDC3 Standard 2.1](https://github.com/finos/FDC3/compare/v2.0..v2.1) - 2023-09-13

### Added
Expand Down
47 changes: 37 additions & 10 deletions schemas/api/api.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@
],
"type": "string"
},
"ImplementationMetadata": {
"BaseImplementationMetadata": {
"description": "Metadata relating to the FDC3 Desktop Agent implementation and its provider.",
"title": "ImplementationMetadata",
"title": "BaseImplementationMetadata",
"type": "object",
"properties": {
"fdc3Version": {
Expand Down Expand Up @@ -405,21 +405,48 @@
"UserChannelMembershipAPIs"
],
"title": "optionalFeatures"
},
"appMetadata": {
"$ref": "#/definitions/AppMetadata",
"description": "The calling application instance's own metadata, according to the Desktop Agent (MUST include at least the `appId` and `instanceId`).",
"title": "appMetadata"
}
},
"additionalProperties": false,
"required": [
"appMetadata",
"fdc3Version",
"optionalFeatures",
"provider"
]
},
"ImplementationMetadata": {
"description": "Includes Metadata for the current application.",
"title": "ImplementationMetadata",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/BaseImplementationMetadata"
},
{
"type": "object",
"properties": {
"appMetadata": {
"$ref": "#/definitions/AppMetadata",
"description": "The calling application instance's own metadata, according to the Desktop Agent (MUST include at least the `appId` and `instanceId`).",
"title": "appMetadata"
}
}
}
],
"properties": {
"fdc3Version": true,
"provider": true,
"providerVersion": true,
"optionalFeatures": true,
"appMetadata": true
},
"required": [
"fdc3Version",
"optionalFeatures",
"provider",
"appMetadata"
],
"additionalProperties": false
},
"IntentResolution": {
"description": "IntentResolution provides a standard format for data returned upon resolving an intent.\n\n```javascript\n//resolve a \"Chain\" type intent\nlet resolution = await agent.raiseIntent(\"intentName\", context);\n\n//resolve a \"Client-Service\" type intent with a data response or a Channel\nlet resolution = await agent.raiseIntent(\"intentName\", context);\ntry {\n\t const result = await resolution.getResult();\n if (result && result.broadcast) {\n console.log(`${resolution.source} returned a channel with id ${result.id}`);\n } else if (result){\n console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`);\n } else {\n console.error(`${resolution.source} didn't return data`\n }\n} catch(error) {\n console.error(`${resolution.source} returned an error: ${error}`);\n}\n\n// Use metadata about the resolving app instance to target a further intent\nawait agent.raiseIntent(\"intentName\", context, resolution.source);\n```",
"title": "IntentResolution",
Expand Down Expand Up @@ -448,4 +475,4 @@
]
}
}
}
}
58 changes: 0 additions & 58 deletions schemas/api/baseImplementationMetadata.schema.json

This file was deleted.

56 changes: 50 additions & 6 deletions schemas/bridging/common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,21 @@
},
"ErrorMessages": {
"oneOf": [
{ "$ref": "../api/api.schema.json#/definitions/ChannelError" },
{ "$ref": "../api/api.schema.json#/definitions/OpenError" },
{ "$ref": "../api/api.schema.json#/definitions/ResolveError" },
{ "$ref": "../api/api.schema.json#/definitions/ResultError" },
{ "$ref": "../api/api.schema.json#/definitions/BridgingError" }
{
"$ref": "../api/api.schema.json#/definitions/ChannelError"
},
{
"$ref": "../api/api.schema.json#/definitions/OpenError"
},
{
"$ref": "../api/api.schema.json#/definitions/ResolveError"
},
{
"$ref": "../api/api.schema.json#/definitions/ResultError"
},
{
"$ref": "../api/api.schema.json#/definitions/BridgingError"
}
]
},
"BridgeResponseErrorDetails": {
Expand All @@ -120,6 +130,40 @@
"onUnsubscribe",
"onDisconnect"
]
},
"DesktopAgentImplementationMetadata": {
"description": "Includes the name assigned to the Desktop Agent by the Bridge.",
"title": "DesktopAgentImplementationMetadata",
"type": "object",
"allOf": [
{
"$ref": "../api/api.schema.json#/definitions/BaseImplementationMetadata"
},
{
"type": "object",
"properties": {
"desktopAgent": {
"description": "Used in Desktop Agent Bridging to attribute or target a message to a\nparticular Desktop Agent.",
kriswest marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"title": "desktopAgent"
}
}
}
],
"properties": {
"fdc3Version": true,
"provider": true,
"providerVersion": true,
"optionalFeatures": true,
"desktopAgent": true
},
"required": [
"fdc3Version",
"optionalFeatures",
"provider",
"desktopAgent"
],
"additionalProperties": false
}
}
}
}
46 changes: 37 additions & 9 deletions schemas/bridging/connectionStep3Handshake.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"$defs": {
"ConnectionStep3HandshakeBase": {
"type":"object",
"type": "object",
"title": "ConnectionStep3Handshake",
"description": "Handshake message sent by the Desktop Agent to the Bridge (including requested name, channel state and authentication data)",
"properties": {
Expand All @@ -26,9 +26,26 @@
"type": "object",
"properties": {
"implementationMetadata": {
"title": "Desktop Agent ImplementationMetadata",
"title": "Connecting Agent ImplementationMetadata",
"description": "Desktop Agent ImplementationMetadata trying to connect to the bridge.",
"$ref": "../api/baseImplementationMetadata.schema.json"
"type": "object",
"allOf": [
{
"$ref": "../api/api.schema.json#/definitions/BaseImplementationMetadata"
}
],
"properties": {
"fdc3Version": true,
"provider": true,
"providerVersion": true,
"optionalFeatures": true
},
"required": [
"fdc3Version",
"optionalFeatures",
"provider"
],
"additionalProperties": false
},
"requestedName": {
"title": "Requested name",
Expand All @@ -42,9 +59,9 @@
"additionalProperties": {
"title": "Channel ",
"type": "array",
"items": {
"$ref": "../context/context.schema.json"
}
"items": {
"$ref": "../context/context.schema.json"
}
}
},
"authToken": {
Expand All @@ -53,7 +70,11 @@
}
},
"additionalProperties": false,
"required": ["implementationMetadata", "requestedName", "channelsState"]
"required": [
"implementationMetadata",
"requestedName",
"channelsState"
]
},
"meta": {
"title": "Connection Step 3 Metadata",
Expand All @@ -67,10 +88,17 @@
}
},
"additionalProperties": false,
"required": ["requestUuid", "timestamp"]
"required": [
"requestUuid",
"timestamp"
]
}
},
"required": ["type", "payload", "meta"],
"required": [
"type",
"payload",
"meta"
],
"additionalProperties": false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"type": "array",
"description": "Desktop Agent Bridge implementation metadata of all connected agents.",
"items": {
"$ref": "../api/baseImplementationMetadata.schema.json"
"$ref": "common.schema.json#/$defs/DesktopAgentImplementationMetadata"
}
},
"channelsState": {
Expand Down
Loading
Loading