common.utils
Common utility functions.
- inject_ids_into_records(body: Dict | Any) Dict[str, Any][source]
Ensures every record in ‘data’ has an ‘_id’ field. If missing, a UUID is assigned.
- Parameters:
body – A Pydantic model containing a ‘data’ key with a list of records.
- Returns:
A dictionary version of the body with ‘_id’ injected where missing.