type Report struct {
SysrptID
Name string
Description string
FileName string
RptType string
}
so this is my first ‘micro service’ in go and for a get I am returning json that represents the above struct.
In most cases I return most of the struct and I know I can keep JSON from including fields I may not need. My question is if I need some responses just to show the name and the SysrptID, what is the best way to do that?
My service is restful; should I create a new route just for this like /ids instead of reports, or I guess I could put an id type in the existing struct. I am using the gorilla web toolkit if that matters. Just looking for ideas, since this is kind of new to me.
so my thinking is instead of showing everything and letting the client deal with all if it, I might wand a way to show an id and a name and then if the client wants details; they pass the id. is it a good idea?