concept reference in category microservice

appears as: reference, references, reference
API Design Patterns

This is an excerpt from Manning's book API Design Patterns.

While it's possible that the unique identifier used can convey the type and purpose of the resource being referenced, it's a much safer option to use the name of the field to convey both of these aspects. For example, if we have a Book resource that refers to an Author resource, we should name the field storing the reference as authorId to convey that it's the unique identifier of an Author resource, shown below in Listing 9.X.

Listing 9.X Redefining the Book and Author resources to use values rather than references.
interface Book {
  id: string;
  title: string;
  author: Author;  // #A
}
 
interface Author {
  id: string;
  name: string;
}