BottleneckStudio / WordJar

📖 Open-source dictionary API.
https://word-jar.herokuapp.com/
1 stars 0 forks source link

Restructure response object #15

Open kenkoii opened 6 years ago

kenkoii commented 6 years ago

I think we can improve the current response object. Let's talk about it.

rbo13 commented 6 years ago

Okay noted @kenkoii. Thanks 👍

kenkoii commented 6 years ago

unsay possible values sa status aside sa "ok" @whaangbuu ?

kenkoii commented 6 years ago

image

Ang data: { result: {

this part is nested pud. Which is weird. dpat ang data : { actual word object }, wala nay result. What do you think?

rbo13 commented 6 years ago

Sakto ka @kenkoii 👍, nested gyud ang return. Dapat wla na ang result, murag from gin man sguro na, ako na e check nya.

Regarding sa unsay possible values sa status aside sa "ok", arbitrary pman na migo :) wla pod ko kibaw, for now kana ra ako gi butang together with error message if ever sayop sya

kenkoii commented 6 years ago

so siguro status "error" sah? para mao ipangvalidate sa muconsume sa API

rbo13 commented 6 years ago

Yes @kenkoii 👍 pwede ra.

Kana nalng ato e figure out ang dested object from data then naa pa gyud result. Ako sad e check ning sa gin na side ug ngano mo create ug lain na object @kenkoii

kenkoii commented 6 years ago

image

changing our commons function(OutputDataAsJSON) parameter gin.H param to a generic interface{} will and passing result directly from the calling method will fix it. Although I'm not sure if it's the best way.