How do I get an article with comments using Drupal 8 REST?

As in the title. GET / node / 1 returns detail information with a "comment" field - but there are comment options. GET / comment / 1 returns comment with ids 1. So how can I get an article with a list of comments? Or just a list of comments for a specific article?

+3


source to share


1 answer


Create a new view with the following settings:



  • Provide REST export and add path.
  • Make sure Format is set to Serializer and accepted request format is set to json
  • Add filter for Content: Type (= [your format])
  • Add to Content Field: Comments
0


source







All Articles