mollie-api-go icon indicating copy to clipboard operation
mollie-api-go copied to clipboard

Making List.Embedded References Consistent

Open MarcoWel opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. For some List objects you define the Embedded field as slice of pointers, for some as slice of objects. Is there a reason for this?

E.g.:

// Same for CapturesList, ChargebacksList, InvoicesList
type PaymentList struct {
	Count    int `json:"count,omitempty"`
	Embedded struct {
		Payments []Payment
	} `json:"_embedded,omitempty"`
	Links PaginationLinks `json:"_links,omitempty"`
}
// Same for SettlementList, BalanceTransactionsList
type RefundList struct {
	Count    int `json:"count,omitempty"`
	Embedded struct {
		Refunds []*Refund
	} `json:"_embedded,omitempty"`
	Links PaginationLinks `json:"_links,omitempty"`
}

Describe the solution you'd like The definition should be consistent.

MarcoWel avatar May 31 '23 18:05 MarcoWel