this post was submitted on 03 Jul 2023
-1 points (0.0% liked)

Lemmy Support

4651 readers
9 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

I can fetch the comments for a post using the API using:

comment/list?post_id=

and that works fine but I have a question about how to determine what comment is a reply to another/ determining the comment nesting/threading.

From what I can tell the only thing tying any two comments together is the comment.path prop.

Is that correct?

That prop seems to be in a format where each nested comment has the root parent path number followed by . then their unique number. And each subsequent comment is another number sequence after that and so on.

Example:

root comment:

{ 
     "comment": {
          "path": 12345
     }
}

child comment 1:

{ 
     "comment": {
          "path": 12345.327928
     }
}

Is this correct?

Can someone who has used this API explain how this works? There are no doc comments in the docs for the http client so I'm just winging it here.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here