Creating node via REST POST gives "leaked cache metadata" error I'm trying to create new nodes by POSTing to /entity/node?_format=json.
This is the body I'm sending:

{
    "_links": {
        "type": {
            "href": "http:\/\/my.drupal.be\/rest\/type\/node\/group_of_documents"
        }
    },
    "title": [{
        "value": "Direct test - type 682"
    }],
    "body": [{
        "value": ""
    }],
    "field_owner": [{
        "value": "Symfony"
    }],
    "field_type": [{
        "target_id": "682"
    }]
}


And, in a way, this works. Because the document gets made, and everything is filled in.

But I keep getting an error:

A fatal error occurred:
The controller result claims to be providing relevant cache metadata,
but leaked metadata was detected.
Please ensure you are not rendering content too early.
Returned object class: Drupal\rest\ResourceResponse.


If I create a node without field_type, it doesn't throw an error.

field_type is the only field that has the Reference type -> Reference views -> Reference method set to Views: Filter by an entity reference view. Does that have anything to do with it?
That's a core bug, see https://www.drupal.org/node/2626298 and https://www.drupal.org/node/2663638 (either of those two would avoid this).

The views reference thing is a good hint. Sounds something runs there that then triggers this exception. You could open an issue for that too if you can find the exact reason.