単一トピックの API エンドポイントには `image_url` を含めるべき

When you fetch a list of all topics with a certain tag (e.g. https://meta.discourse.org/tags/ui.json), each topic contains an image_url field. If you fetch, however, only one topic (e.g. https://meta.discourse.org/t/37245.json) it does not contain an image_url field. This is kind of inconsistent and it would help me a lot if it was available. Can you maybe add it?

My workaround for the time being is:

response.image_url = (response.post_stream.posts[0].cooked
  .match(/src=\"(.+?)\"/) || [])[1]
「いいね!」 3

I’ve just come across this post looking for the same thing.

Does anyone know if there’s a way of adding this (e.g. with a plugin)?

「いいね!」 1

I created a commit that adds the image_url to the topic serializer:

「いいね!」 5

Brilliant! Thanks @blake! :+1:

「いいね!」 1

/search.json?q=loreal&image_url=true を使用できますか?

トピックを検索した際に返す JSON 結果に image_url を表示したいと考えています。