Skip to content

Conversation

@kaschula
Copy link

@kaschula kaschula commented Oct 14, 2025

Description

This PR does the following:

  • Deprecate the old Live Objects APIS
  • Add Open API specifications for the three new endpoints
  • Update the Usage documentation to reflect the new endpoints

Checklist

@kaschula kaschula marked this pull request as draft October 14, 2025 14:34
@coderabbitai
Copy link

coderabbitai bot commented Oct 14, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pub-2563-update-live-objects-rest-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kaschula
Copy link
Author

Hi @mschristensen Do you mind having a look at OpenAPI specification for the new endpoints. One thing I wanted to get your thoughts on was the examples for /channels/{channelId}/object/{objectId} endpoint. They currently are the same as the /channels/{channelId}/object endpoint. The difference between these endpoints is a bit nuanced and hard to get across using examples as the endpoints are pretty much the same. I thought maybe I would use the usage docs to describe the difference.

I could write slightly different examples with different data just to make it more interesting to read.

Also I have used the deprecated flag provided by the OpenAPI spec which strikes out the previous endpoints in the menu.

Screenshot 2025-10-14 at 15 39 16

@kaschula
Copy link
Author

Hi @mschristensen, I have pushed up the usage docs changes as well

@kaschula kaschula marked this pull request as ready for review October 17, 2025 09:31
</Code>

This request is billed per object ID returned - each object ID counts as one billable message.
#### Get the entire object with metatdata <a id="fetching-object"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### Get the entire object with metatdata <a id="fetching-object"/>
#### Get the entire object with metadata <a id="fetching-object"/>

`GET main.realtime.ably.net/channels/<channelName>/objects`

Fetch a flat list of objects on the channel:
The following request returns the entrie object tree.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The following request returns the entrie object tree.
The following request returns the entire channel object.

Note we should not refer to the "tree" any more, just the channel object

Copy link
Author

Choose a reason for hiding this comment

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

Thanks I have removed all instances of "object tree"

</Code>

The response includes the IDs of the objects on the channel:
This endpoint by default returns the compact representation of the object tree.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This endpoint by default returns the compact representation of the object tree.
This endpoint returns the compact representation of the object tree by default.

#### Including values <a id="fetching-objects-list-values"/>

To include values of the objects in the response, set the `values=true` query parameter:
By providing the `compact=false` query param the response will contain the full object representation including the
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
By providing the `compact=false` query param the response will contain the full object representation including the
You can optionally include additional object [metadata](/docs/liveobjects/concepts/objects#metadata) in the response by specifying the `compact=false` query option:

</Code>

#### Including metadata <a id="fetching-objects-list-metadata"/>
Both these requests are billed per object returned.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Both these requests are billed per object returned.
Each instance of an [object type](/docs/liveobjects/concepts/objects#object-types) included is the response is counted as one billable message.

I think this statement should also appear at the end of the "Get the entire object" section (so that a reader of that specific section has all the information they need, i.e. we do not hide information relating to one section in the content for other sections)

-d '{
"operation": "COUNTER_INC",
"path": "votes.up",
"path": "poll.votes.up",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have we added poll here? Do we need to update the text above?

Copy link
Author

Choose a reason for hiding this comment

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

I had changed the structure of the example app from

{
  "votes": {
    "up": 5,
    "down": 10
  }
}

to

  {
    "poll": {
      "name": "First Poll"
      "votes": {
        "down": 10,
        "up": 5,
      }
    }
  }

I can't remember why I did this. I think I will revert the docs to reference the original structure.

</Code>

When you create a new object it is important that the new object is assigned to the object tree so that it is [reachable](/docs/liveobjects/concepts/objects#reachability) from the root object.
When you create a new object it is important that the new object is assigned to the object tree so that it is [reachable](/docs/liveobjects/concepts/object#reachability) from the root object.
Copy link
Contributor

Choose a reason for hiding this comment

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

When you create a new object it is important that the new object instance is assigned to the channel object so that it is reachable.

```
</Code>

Note in this example if the key `title` didn't exist it would have been created and set by this operation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this mentioned? This isn't a case of e.g. creating a counter object and assigning it to a key via a COUNTER_CREATE with a path field. This is a regular map set, so I'm not sure what this comment is for.

Copy link
Author

Choose a reason for hiding this comment

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

Your right its not needed. I think I was trying to convey that map sets are idempotent.

schema:
type: string
example: "my-channel"
- name: compacted
Copy link
Contributor

Choose a reason for hiding this comment

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

The query argument is compact, not compacted

Copy link
Contributor

Choose a reason for hiding this comment

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

Some of the new endpoints contain descriptions and references to e.g. query options that are not valid in the new endpoints:

Image

Copy link
Author

Choose a reason for hiding this comment

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

When looking into this I realised I can't reuse the original definitions of LiveMap and LiveCounter because they contain the MetaData. I have created a second version of these types so that we preserve the old ones for the deprecated API docs.

See in this fixup 30f0e02e1ae1b9737f5c7607b492abbe14ee1f5f which has the new types added.

@kaschula kaschula force-pushed the pub-2563-update-live-objects-rest-docs branch from 30f0e02 to 401914e Compare November 3, 2025 15:14
Depricate all the current LiveObjects endpoints.

Add three new specification endpoints:
1. /channels/{channelId}/object            POST: publish live objects operations
2. /channels/{channelId}/object            GET : get an object
2. /channels/{channelId}/object/{objectId} GET : get an object by ID
The LiveObjects API usage docs have been updated to reference the new
endpoints.
@kaschula kaschula force-pushed the pub-2563-update-live-objects-rest-docs branch from 401914e to 6162fd0 Compare November 3, 2025 15:16
To include values of the objects in the response, set the `values=true` query parameter:
#### Get the entire object with metadata <a id="fetching-object"/>

You can optionally include additional object [metadata](/docs/liveobjects/concepts/objects#metadata) in the response by specifying the `compact=false` query option:
Copy link
Author

Choose a reason for hiding this comment

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

@mschristensen I was just checking all the anchor tags work and realised that this metadata link shows information about Tomestones and Timeserials but we don't actually return any of these any more. The only metadata return now is the semantic type of a map and the object ID. Should I remove the Tomestones and Timeserials information from this page? https://ably.com/docs/liveobjects/concepts/objects#metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants