Problem/Motivation
When returning a list of entities that are not the same, or a list of nodes with different content-types, if the "include" parameters is used, it checks for the first entity if this field can be included and if not possible, it raises an error with message:
title: "Bad Request",
status: "400",
detail: "`field_brighcove_video` is not a valid relationship field name. Possible values: node_type, uid, field_author, field_content, field_entity, field_main_publication_channel, field_other_publication_channel, field_section, field_series, field_source, field_team, field_teaser, field_topics, field_topic_entity.",
An example of module that uses JSON:API Resources is JSON:API Search API, which makes a lot of sense to return node within different content types.
Steps to reproduce
Try getting multiple type of data in a single JSON API with include parameters having fields that are not common between different entity types you are trying to fetch.
Proposed resolution
My suggestion is to receive the resource identifier as part of include path and check that before include it, something like ?include=node--video.field_brighcove_video.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet