I have a custom post type with a parent post, and code to fetch this post in Javascript via a GET
request, all is working very well. The API endpoints I'm using are those provided by core when show_in_rest
is set to true on registration.
However, I want a little more information about the parent post than its ID, and I don't want to make a second request to fetch it, so how might I extend the response from the REST API to include that information? Or any other arbitrary information for that matter.
In particular it would be great to include the title and URL, but a full post object would be good too. Note that I do not want to create a custom endpoint from scratch, but extend the existing core endpoint