Expands nested object references based on expand[] query parameters.
Stripe allows expanding related objects in responses. Instead of returning just an ID, the full object is returned.
Examples
# Without expansion
%Subscription{customer: "cus_123"}
# With expand[]=customer
%Subscription{customer: %Customer{id: "cus_123", email: "..."}}
# Nested expansion: expand[]=customer.default_source
%Subscription{
customer: %Customer{
id: "cus_123",
default_source: %Card{id: "card_123", last4: "4242"}
}
}Usage
# In resource handlers
expand_params = parse_expand_params(conn.query_params)
hydrated = PaperTiger.Hydrator.hydrate(subscription, expand_params)
Summary
Functions
Fetches a resource by ID from the appropriate store.
Hydrates a resource by expanding specified fields. ...
Functions
Fetches a resource by ID from the appropriate store.
Automatically determines the correct store based on the ID prefix.
Hydrates a resource by expanding specified fields. ...