How can I reliably identify foreign key fields and related objects with the REST API metadata
Summary:
I'm trying to reliably identify foreign-key fields and lookup fields from the REST 'describe' object metadata.
Content (required):
It appears I can find FCL and DCL fields with the "controlType" attribute in the metadata, but I'm not confident about the reliability of that because it describes the presentation of the field, not necessarily the data the field represents.
The more promising option appears to be the lov.childRef in the metadata, where a value starting with "FK_LOVVA_..." represents DCL, and a value starting with "LOVVA_..." seems to indicate FCL. That also isn't particularly satisfying because it involves parsing into a name that does not seem to be a canonical way of differentiating the type of field (relationship, DCL, or FCL). It also appears that FK_LOVVA and LOVVA_ are only used for AppComposer custom relationships, not for native relationships.