A related resource connects to a target through a reference without necessarily being nested beneath it. Its relationship creates design questions when the target is copied or moved. section 17.3.3
Message review reports
A chat API can model an inappropriate-message report as MessageReviewReport. Its messageId references a Message, although the report is not necessarily a child of that Message or its ChatRoom. Copying a Message raises whether its reports should also be duplicated; moving it raises whether those references must be updated. section 17.3.3
Account for these consequences when designing copy and move behavior:
- Preserve referential integrity during moves by updating references so they do not point to an invalid resource. section 17.3.3
- Choose explicitly whether copying a target also copies related resources; there is no single correct policy for every scenario. section 17.3.3
- Consider indirect operations, because copying or moving a parent can cascade to the target without a direct request against it. section 17.3.3
Listing 17.4 A MessageReviewReport resource that references a Message resource
interface MessageReviewReport {
id: string;
messageId: string; #1
reason: string;
}
Inspect the compact resource shape showing a reference from MessageReviewReport to Message. section 17.3.3
