Closed owenthereal closed 10 years ago
@technoweenie I need some help from you to get this going. The main problem I have is HyperFieldRelations
is called on any passed in interface, including a slice type, e.g., []Authorizations
. This causes t.NumField()
to fail for non-struct type. Any idea on how to fix it?
You're passing in a slice because the API request returns an array, correct? That's a really good point :) Definitely a bug fix for sawyer.
@technoweenie That's right. Some results expect an array
Thought about this some more and put some thoughts down here: lostisland/go-sawyer#15.
Closing this due to https://github.com/lostisland/go-sawyer/pull/14. Will reopen another one to incorporate https://github.com/lostisland/go-sawyer/pull/12
@technoweenie I tried to upgrade to the latest sawyer API and got a couple failed tests. Some of the failure due to the
interface{}
passed tohypermedia.HyperFiledRelations
is a pointer andt.NumFiled()
panics for non-struct type. I fixed it in https://github.com/lostisland/go-sawyer/pull/14.However, there're more failed tests due to passed in type is a slice, for example, the following test to get an array of
Authorizations
:Looks like
hypermedia.HyperFiledRelations
should only be called for individual hyper resource instead of being called for the passed in interface. But I would like to confirm with you first.