Use partial sync
Partial Sync enables callers to specify only the portions of the structure that matter. The system then populates only the requested child types, maintains the full structure (skeleton remains intact), and preserves empty arrays for omitted types to prevent downstream errors.
Partial Sync applies recursive filtering, which means the filter is applied at every level of the hierarchy, not just at the top level.
AllowContextType
AllowContextType is an array of string identifiers that tells the system which child types to populate.
Example:
AllowContextType = ["Header", "LineItems"]| AllowContextType | Behavior |
|---|---|
| [] (empty) | No filtering, full object returned |
| Contains valid types | Only specified types are populated |
| Missing required types | Error if required by business rule |
| Contains invalid types | Ignored, object still returned with empty children |
| Parent matches, child doesn’t | Child remains empty, structure preserved |
Scenarios
- No Filtering
If
AllowContextTypeis empty:- All child types are fully populated.
- Output matches legacy behavior This scenario serves as the baseline.
- Header Only (or Any Valid Subset)
If
AllowContextTypecontains only some child types:Example:AllowContextType = ["Header", "LineItems"]- Only Header and LineItems are populated
- Other child arrays (for example, RAM, RelatedParties) exist but stay empty
- Structure remains intact, no missing arrays
- Invalid or unrecognized types
If the array contains a mix like:
AllowContextType = ["Header", "XYZ"]- System does not crash
- Only Header is populated
- Other child areas remain empty
- Filtering gracefully falls back
- Recursive filteringFiltering applies recursively:
- Parent can be included
- Sub-children are evaluated independently
- If a parent is allowed but a sub-child type isn’t, that sub-child stays empty
- Empty arrays are explicitly preserved to maintain consistency
- Mandatory context rules
Header required:
For scenarios involving header data:- Header must be present in
AllowContextType - If not, the system throws a validation error:
Cannot process without header in AllowContextTypeLineItems required for no Header:
If the use case excludes header entirely:- LineItems is mandatory
- Missing it produces:
Cannot process without line items in AllowContextType
- Header must be present in