meilisearch-go icon indicating copy to clipboard operation
meilisearch-go copied to clipboard

Replace all `map[string]interface{}` by the type created for this purpose `Unknow`

Open alallema opened this issue 2 years ago • 5 comments

An "unknown" type is available in the type list but it has not been used or very little in this SDK. It could be great and cleaner to replace all the map[string]interface{} with Unknow

// Unknown is unknown json type
type Unknown map[string]interface{}

alallema avatar Jul 06 '22 13:07 alallema

I can work on this issue, but it shows Version dependency

shadowshot-x avatar Oct 06 '22 11:10 shadowshot-x

Hi @shadowshot-x, Please, go for it I edit the issue it was a old comment 😃

alallema avatar Oct 06 '22 11:10 alallema

Awesome. Thank you @alallema

shadowshot-x avatar Oct 08 '22 14:10 shadowshot-x

Hi @alallema, should a PR closing this issue change the types of the public APIs too or should changes be limited to internal uses of map[string]interface{}?

i.e. should something like GetRawIndex return meilisearch.Unknown instead of map[string]interface{}?

I imagine those might be considered breaking changes?

a11rew avatar Oct 30 '22 11:10 a11rew

Hi @a11rew, Thanks for the question, indeed I was just thinking of changing the internal type only to avoid breaking and not forcing people to use our specific type.

alallema avatar Nov 07 '22 07:11 alallema