/t/slug/123.json?post_number=10は5番目の投稿を取得します。 /t/slug/123.json?post_number=50は45番目の投稿を取得します、など。常に5ずれています。すべての投稿を取得したい場合はページネーションを使用しなければならず、これを考慮しないと誤ったリストになります。
これは、いくつかの前の投稿をコンテキストのために含めるために行われたと推測できます。その場合、APIではなくUIでこれを行うべきだと個人的には思います。
/t/slug/123.json?post_number=10は5番目の投稿を取得します。 /t/slug/123.json?post_number=50は45番目の投稿を取得します、など。常に5ずれています。すべての投稿を取得したい場合はページネーションを使用しなければならず、これを考慮しないと誤ったリストになります。
これは、いくつかの前の投稿をコンテキストのために含めるために行われたと推測できます。その場合、APIではなくUIでこれを行うべきだと個人的には思います。
This endpoint promises to return information including the specified post, for example:
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq .post_stream.posts[].post_number
33
34
35
36
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
As a single-page application, Discourse uses its API efficiently to minimise work. It’s not reasonable to make one API call per post; that would massively balloon the amount of back and forth between client and server.
It’s trivial to select the post you expect from the result. Same as above, getting only post 40’s cooked content:
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq -r '.post_stream.posts[] | select(.post_number == 40) | .cooked'
<p>Hi Tiago,</p>
<p>Can you please clarify it a little bit? Some screenshots, your actual code and where is your advert appear would be very helpful. Thank you <img src="https://emoji.discourse-cdn.com/twitter/slightly_smiling_face.png?v=12" title=":slightly_smiling_face:" class="emoji" alt=":slightly_smiling_face:" loading="lazy" width="20" height="20"></p>
Or, if you absolutely want to return information about only the single post you are querying, you are free to make a Data Explorer query that does only that.
OK、しかしそれはどこに文書化されていますか?
ページネーションに反対しているわけではありません。
APIドキュメントはこちらで確認できます: https://docs.discourse.org/#tag/Topics/operation/getSpecificPostsFromTopic