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

1255 Make fdc3.fileAttachment an independent type #1261

Merged
merged 4 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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#"
Yannick-Malins marked this conversation as resolved.
Show resolved Hide resolved
},
{
"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