You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/querying.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,3 +46,33 @@ With this request, the toolkit will:
46
46
- Sort the results with the newest published books first.
47
47
- Return the first 10 results.
48
48
- Include related author and reviews data in the response.
49
+
50
+
## Missing Attributes in JSON:API Responses
51
+
52
+
When using our JSON:API implementation, you might notice that certain properties—such as `CompanyTenantId`—are not included in the API responses. This is because the default attribute mapping logic intentionally excludes any property that ends with "`Id`" (other than the primary `Id`).
53
+
54
+
### Default Behavior and Rationale
55
+
56
+
This behavior is deliberate and conforms to JSON:API best practices:
57
+
-**Separation of Identity and Attributes:** The primary identifier is kept separate from the resource’s attributes. The `"id"` field uniquely identifies a resource, while attributes describe its state.
58
+
-**Avoiding Redundancy:** By not duplicating identifier values as attributes, the response remains clean and unambiguous.
59
+
-**Clarifying Relationships:** Properties ending in "`Id`" often indicate foreign keys or relational links. Excluding them from attributes discourages treating these as simple data values.
60
+
61
+
### How to Circumvent the Default Behavior
62
+
63
+
If your design requires that additional identifier fields be exposed as attributes—because they carry significant, non-relational context—you can override the default exclusion by using the `[IncludeAsAttribute]` attribute. For example:
0 commit comments