Skip to content
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
2 changes: 1 addition & 1 deletion build/data/versions.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
specification: "6.3.0"
specification: "6.4.0"
protocol: 6
15 changes: 7 additions & 8 deletions specifications/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -1545,12 +1545,12 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info
- `(OD1)` An `ObjectData` represents a value in an object on a channel
- `(OD2)` The attributes available in an `ObjectData` are listed below. Of the value fields - `boolean`, `bytes`, `number`, `string` and `json` - at most one must be set at a time:
- `(OD2a)` `objectId` string - a reference to another object
- `(OD2b)` `encoding` string - may be set by the client library to indicate that value in `string` field have an encoding
- `(OD2b)` This clause has been deleted as of specification version 6.4.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to bump spec version to 6.4.0 as well in build/data/versions.yaml - this will go out with LO REST APO spec changes

- `(OD2c)` `boolean` boolean - a primitive boolean leaf value in the object graph
- `(OD2d)` `bytes` binary \| string - a primitive binary leaf value in the object graph. It is sent to and received from the server as a Base64-encoded string when using the JSON protocol
- `(OD2e)` `number` number - a primitive number leaf value in the object graph
- `(OD2f)` `string` string - a primitive string leaf value in the object graph
- `(OD2g)` `json` JsonObject \| JsonArray - a primitive JSON leaf value (an object or array) in the object graph. It is sent to and received from the server as a JSON-encoded string when using the JSON protocol
- `(OD2g)` `json` JsonObject \| JsonArray - a primitive JSON leaf value (an object or array) in the object graph. It is sent to and received from the server as a JSON-encoded string, with both the JSON and MessagePack protocols
- `(OD3)` The size of the `ObjectData` is calculated as follows:
- `(OD3a)` The size is the sum of the sizes of the `boolean`, `bytes`, `number`, `string`, and `json` properties
- `(OD3b)` If set, the size of a `boolean` property is 1
Expand All @@ -1561,27 +1561,27 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info
- `(OD3f)` The size of a `null` or omitted property is zero
- `(OD4)` `ObjectData` encoding:
- `(OD4a)` Payloads must be booleans, binary, numbers, strings, or JSON-encodable objects or arrays. Any other data type must not be permitted and result in an error with code 40013
- `(OD4b)` `ObjectData.encoding` must be left unset unless specified otherwise by the payload encoding procedure in [OD4c](#OD4c) and [OD4d](#OD4d)
- `(OD4b)` This clause has been deleted as of specification version 6.4.0.
- `(OD4c)` When the MessagePack protocol is used:
- `(OD4c1)` A boolean payload is encoded as a MessagePack boolean type, and the result is set on the `ObjectData.boolean` attribute
- `(OD4c2)` A binary payload is encoded as a MessagePack binary type, and the result is set on the `ObjectData.bytes` attribute
- `(OD4c3)` A number payload is encoded as a MessagePack float64 type, and the result is set on the `ObjectData.number` attribute
- `(OD4c4)` A string payload is encoded as a MessagePack string type, and the result is set on the `ObjectData.string` attribute
- `(OD4c5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, encoded as a MessagePack string type, and the result is set on the `ObjectData.string` attribute. The `ObjectData.encoding` attribute is then set to "json"
- `(OD4c5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, encoded as a MessagePack string type, and the result is set on the `ObjectData.json` attribute
- `(OD4d)` When the JSON protocol is used:
- `(OD4d1)` A boolean payload is represented as a JSON boolean and set on the `ObjectData.boolean` attribute
- `(OD4d2)` A binary payload is Base64-encoded and represented as a JSON string; the result is set on the `ObjectData.bytes` attribute
- `(OD4d3)` A number payload is represented as a JSON number and set on the `ObjectData.number` attribute
- `(OD4d4)` A string payload is represented as a JSON string and set on the `ObjectData.string` attribute
- `(OD4d5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, represented as a JSON string and the result is set on the `ObjectData.string` attribute. The `ObjectData.encoding` attribute is then set to "json"
- `(OD4d5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, represented as a JSON string and the result is set on the `ObjectData.json` attribute
- `(OD5)` `ObjectData` decoding:
- `(OD5a)` When the MessagePack protocol is used:
- `(OD5a1)` The payloads in `ObjectData.boolean`, `ObjectData.bytes`, `ObjectData.number`, and `ObjectData.string` are decoded as their corresponding MessagePack types
- `(OD5a2)` If `ObjectData.encoding` is set to "json", the `ObjectData.string` content is decoded by parsing the string as JSON
- `(OD5a2)` The `ObjectData.json` payload is decoded as a MessagePack string type, and the result is parsed as JSON
- `(OD5b)` When the JSON protocol is used:
- `(OD5b1)` The payloads in `ObjectData.boolean`, `ObjectData.number`, and `ObjectData.string` are decoded as their corresponding JSON types
- `(OD5b2)` The `ObjectData.bytes` payload is Base64-decoded into a binary value
- `(OD5b3)` If `ObjectData.encoding` is set to "json", the `ObjectData.string` content is decoded by parsing the string as JSON
- `(OD5b3)` The `ObjectData.json` payload is decoded as a JSON string, and the result is parsed as JSON

#### Annotation

Expand Down Expand Up @@ -2664,7 +2664,6 @@ Each type, method, and attribute is labelled with the name of one or more clause

class ObjectData // OD*, internal
objectId: String? // OD2a
encoding: String? // OD2b
boolean: Boolean? // OD2c
bytes: Binary? | String? // OD2d
number: Number? // OD2e
Expand Down
2 changes: 1 addition & 1 deletion specifications/objects-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Objects feature enables clients to store shared data as "objects" on a channel.
- `(RSO9a)` `RestLiveMap` ([RSO14](#RSO14)), returned when the response body has a `map` field per [RSO2g1](#RSO2g1)
- `(RSO9b)` `RestLiveCounter` ([RSO15](#RSO15)), returned when the response body has a `counter` field per [RSO2g2](#RSO2g2)
- `(RSO9c)` A decoded [`ObjectData`](../features#OD1) leaf, returned when the response is a typed leaf value per [RSO2g3](#RSO2g3). The library must return an `ObjectData` instance with:
- `(RSO9c1)` The [`objectId`](../features#OD2a) and [`encoding`](../features#OD2b) fields unset. (If the response carried an object reference, the result would instead be a `RestLiveMap` ([RSO9a](#RSO9a)), `RestLiveCounter` ([RSO9b](#RSO9b)), or unrecognized-object fallback ([RSO9d](#RSO9d)).)
- `(RSO9c1)` The [`objectId`](../features#OD2a) field unset. (If the response carried an object reference, the result would instead be a `RestLiveMap` ([RSO9a](#RSO9a)), `RestLiveCounter` ([RSO9b](#RSO9b)), or unrecognized-object fallback ([RSO9d](#RSO9d)).)
- `(RSO9c2)` Values decoded per [OD5](../features#OD5): in particular, `bytes` holds a native `Binary` value rather than a Base64-encoded string, and any JSON-encoded payload appears as the parsed `JsonObject` or `JsonArray` rather than as a JSON-encoded string
- `(RSO9d)` For object types unrecognized by the library, an object containing at minimum `{ objectId: String }`, with additional fields passed through unmodified per [RSF1](../features#RSF1)
- `(RSO10)` `RestObjectPublishResult` is the return type of [`RestObject#publish`](#RSO3). Its attributes are:
Expand Down
Loading