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

I think what you are describing is completely accurate, I'll try to sweep the library and make it consistent.

VictorAvelar avatar May 31 '23 19:05 VictorAvelar

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 06 '23 17:06 stale[bot]

This issue has been automatically closed because it has not had any activity after being labeled as staled.

stale[bot] avatar Jun 18 '23 16:06 stale[bot]

Closed with #327 - All list operation return a slice of pointers to the resource they list.

VictorAvelar avatar Mar 16 '24 17:03 VictorAvelar