When one pulls up the endpoint “wp-json/wp/v2/posts” we get a key called “featured_media” but it returns an integer value.
Can’t we rewrite this to give a proper URL to the featured image? or even add another key that has attached images as URLs.
This will prevent the extra queries one has to return the image URLs or even install bloated plugins to get this information.
I know the endpoint already has so much information one rarely needs thus the growth of tech like GraphQL but we could also consider Author name & description to the individual posts.
This is voice is for decoupling ClassicPress to modern apps or front-ends.
I still hold the view that instead of serving media IDs only, we could serve the image URLs like we do for post content, title etc. It is the one inconsistency currently on the API for me.
Pros
Data URL for images straight off the bat.
Removes extra use of plugins to make custom endpoints for data in the post.