Skip to content

Commit

Permalink
Merge pull request #1261 from Yannick-Malins/Issue-1255
Browse files Browse the repository at this point in the history
1255 Make fdc3.fileAttachment an independent type
  • Loading branch information
kriswest authored Nov 2, 2024
2 parents 18f960e + 92ecb7a commit 7e5d89c
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 134 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

* Spin off fileAttachment into its own schema, and correct related examples ([1255](https://github.com/finos/FDC3/issues/1255))
* 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))
* Removed the `version` field from `IntentResolution` as there are no version fields for intents in the FDC3 API definitions and hence the field has no purpose. ([#1170](https://github.com/finos/FDC3/pull/1170))

Expand Down
53 changes: 53 additions & 0 deletions schemas/context/fileAttachment.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/context/fileAttachment.schema.json",
"type": "object",
"title": "File Attachment",
"description": "A File attachment encoded in the form of a data URI. Can be added to a Message.",
"allOf": [
{
"type": "object",
"properties": {
"type": {
"const": "fdc3.fileAttachment"
},
"data": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "File name",
"description": "The name of the attached file"
},
"dataUri": {
"type": "string",
"format": "uri",
"title": "",
"description": "A data URI encoding the content of the file to be attached"
}
},
"required": [
"name",
"dataUri"
]
}
},
"required": [
"type",
"data"
]
},
{
"$ref": "context.schema.json#/definitions/BaseContext"
}
],
"examples": [
{
"type": "fdc3.fileAttachment",
"data": {
"name": "myImage.png",
"dataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII"
}
}
]
}
35 changes: 2 additions & 33 deletions schemas/context/message.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,12 @@
"title": "Message entities",
"description": "A map of string IDs to entities that should be attached to the message, such as an action to perform, a file attachment, or other FDC3 context object.",
"additionalProperties": {
"anyOf": [
"oneOf": [
{
"$ref": "action.schema.json#"
},
{
"type": "object",
"title": "File attachment",
"description": "A File attachment encoded in the form of a data URI",
"properties": {
"type": {
"const": "fdc3.entity.fileAttachment"
},
"data": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "File name",
"description": "The name of the attached file"
},
"dataUri": {
"type": "string",
"format": "uri",
"title": "",
"description": "A data URI encoding the content of the file to be attached"
}
},
"required": [
"name",
"dataUri"
]
}
},
"required": [
"type",
"data"
]
"$ref": "fileAttachment.schema.json#"
}
]
}
Expand Down
Loading

0 comments on commit 7e5d89c

Please sign in to comment.