Skip to content

Commit ee1a21c

Browse files
authored
Merge pull request #1149 from finos/clarify_identifier_values_should_be_strings
Identifier values should be of type string
2 parents f4a46c0 + 892ae51 commit ee1a21c

6 files changed

Lines changed: 18 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88

99
### Added
1010

11+
* Added clarification that `id` field values SHOULD always be strings to context schema definition (a restriction that can't easily be represented in the generated types). ([#1149](https://github.com/finos/FDC3/pull/1149))
12+
1113
### Changed
1214

1315
### Deprecated

docs/context/ref/Context.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ derived types may require the name object as mandatory, depending on use case.
5454

5555
### `id` (optional)
5656

57-
Context data objects may include a set of equivalent key-value pairs that can be used to help applications
58-
identify and look up the context type they receive in their own domain. The idea behind this design is that applications can provide as many equivalent identifiers to a target application as possible, e.g. an instrument may be represented by an ISIN, CUSIP or Bloomberg identifier.
57+
Context data objects may include a set of equivalent key-value pairs that can be used to help applications identify and look up the context type they receive in their own domain. The idea behind this design is that applications can provide as many equivalent identifiers to a target application as possible, e.g. an instrument may be represented by an ISIN, CUSIP or Bloomberg identifier.
5958

6059
Identifiers do not make sense for all types of data, so the `id` property is therefore optional, but some derived types may choose to require at least one identifier.
6160

61+
Identifier values SHOULD always be of type string.
62+
6263
## See Also
6364

6465
FDC3 Specifications

docs/context/spec.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ An `id` field with type `object` is defined in the base [fdc3.context](ref/Conte
110110

111111
Where an identifier is the name of an existing standard, external to FDC3, it is represented in all caps. For example: FIGI, PERMID, CUSIP, ISO-2. When an identifier is a more general concept, it is represented in all lower case. For example: ticker, name, geocode, email.
112112

113+
Identifier values SHOULD always be of type string.
114+
113115
All standard identifier names are reserved names. Applications may use their own identifiers ad hoc. For example:
114116

115117
```json

schemas/context/context.schema.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
},
2626
"id": {
2727
"type": "object",
28-
"unevaluatedProperties": {
29-
"type": "string"
30-
}
28+
"unevaluatedProperties": {"type": "string" }
3129
}
3230
},
3331
"additionalProperties": true,
@@ -52,10 +50,8 @@
5250
"id": {
5351
"type": "object",
5452
"title": "Id",
55-
"description": "Context data objects may include a set of equivalent key-value pairs that can be used to help applications identify and look up the context type they receive in their own domain. The idea behind this design is that applications can provide as many equivalent identifiers to a target application as possible, e.g. an instrument may be represented by an ISIN, CUSIP or Bloomberg identifier.\n\nIdentifiers do not make sense for all types of data, so the `id` property is therefore optional, but some derived types may choose to require at least one identifier.",
56-
"unevaluatedProperties": {
57-
"type": "string"
58-
}
53+
"description": "Context data objects may include a set of equivalent key-value pairs that can be used to help applications identify and look up the context type they receive in their own domain. The idea behind this design is that applications can provide as many equivalent identifiers to a target application as possible, e.g. an instrument may be represented by an ISIN, CUSIP or Bloomberg identifier.\n\nIdentifiers do not make sense for all types of data, so the `id` property is therefore optional, but some derived types may choose to require at least one identifier. Identifier values SHOULD always be of type string.",
54+
"unevaluatedProperties": {"type": "string" }
5955
}
6056
},
6157
"additionalProperties": true,

src/bridging/BridgingTypes.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ export interface ContextElement {
669669
*
670670
* Identifiers do not make sense for all types of data, so the `id` property is therefore
671671
* optional, but some derived types may choose to require at least one identifier.
672+
* Identifier values SHOULD always be of type string.
672673
*/
673674
id?: { [key: string]: any };
674675
/**
@@ -3102,7 +3103,7 @@ export interface PrivateChannelEventListenerAddedAgentRequestMeta {
31023103
*/
31033104
export interface PrivateChannelEventListenerAddedAgentRequestPayload {
31043105
/**
3105-
* The id of the PrivateChannel that the event listener was added to
3106+
* The id of the PrivateChannel that the event listener was added to.
31063107
*/
31073108
channelId: string;
31083109
listenerType: PrivateChannelEventListenerTypes;
@@ -3165,7 +3166,7 @@ export interface PrivateChannelEventListenerAddedBridgeRequestMeta {
31653166
*/
31663167
export interface PrivateChannelEventListenerAddedBridgeRequestPayload {
31673168
/**
3168-
* The id of the PrivateChannel that the event listener was added to
3169+
* The id of the PrivateChannel that the event listener was added to.
31693170
*/
31703171
channelId: string;
31713172
listenerType: PrivateChannelEventListenerTypes;
@@ -3213,7 +3214,7 @@ export interface PrivateChannelEventListenerRemovedAgentRequestMeta {
32133214
*/
32143215
export interface PrivateChannelEventListenerRemovedAgentRequestPayload {
32153216
/**
3216-
* The id of the PrivateChannel that the event listener was removed from
3217+
* The id of the PrivateChannel that the event listener was removed from.
32173218
*/
32183219
channelId: string;
32193220
listenerType: PrivateChannelEventListenerTypes;
@@ -3271,7 +3272,7 @@ export interface PrivateChannelEventListenerRemovedBridgeRequestMeta {
32713272
*/
32723273
export interface PrivateChannelEventListenerRemovedBridgeRequestPayload {
32733274
/**
3274-
* The id of the PrivateChannel that the event listener was removed from
3275+
* The id of the PrivateChannel that the event listener was removed from.
32753276
*/
32763277
channelId: string;
32773278
listenerType: PrivateChannelEventListenerTypes;
@@ -4178,6 +4179,7 @@ export interface Context {
41784179
*
41794180
* Identifiers do not make sense for all types of data, so the `id` property is therefore
41804181
* optional, but some derived types may choose to require at least one identifier.
4182+
* Identifier values SHOULD always be of type string.
41814183
*/
41824184
id?: { [key: string]: any };
41834185
/**

src/context/ContextTypes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export interface ContextElement {
129129
*
130130
* Identifiers do not make sense for all types of data, so the `id` property is therefore
131131
* optional, but some derived types may choose to require at least one identifier.
132+
* Identifier values SHOULD always be of type string.
132133
*/
133134
id?: { [key: string]: any };
134135
/**
@@ -946,6 +947,7 @@ export interface Context {
946947
*
947948
* Identifiers do not make sense for all types of data, so the `id` property is therefore
948949
* optional, but some derived types may choose to require at least one identifier.
950+
* Identifier values SHOULD always be of type string.
949951
*/
950952
id?: { [key: string]: any };
951953
/**

0 commit comments

Comments
 (0)