I am making a request with a custom filter that includes the "comment_count"
field of the question type. My custom filter is !RtdMEtslKF6Z()NqpDUFZ58R6twu-.4V48gn0furqA*7_BL1
.
However, when I'm querying the question having an ID of 14585943, which has no comments (at this date), the field "comment_count
isn't returned by the API.
It should be returned, even if there are no comments, because the documentation doesn't specify that this field "may be absent".
I tested this with the even simpler filter !.UE46pK5nV.kgRss
, which includes no fields, except .items
, question.comment_count
and question.title
. The comment count still isn't returned (when the title is correctly returned).
A couple of notes that I gathered:
"comment_count"
is correctly returned (with the correct count) by both filters above if there are comments on the question."comment_count"
is always correctly returned if the filter used consists of the default filter, added withquestion.comment_count
. In this request, the result has"comment_count":0
for questions without comments.
As such, it appears that the problem only happens when there are no comments and specific fields aren't included in the filter. (I am not sure which specific fields -- I tried to isolate to a single field but wasn't successful).