We return partial equal json many times: e.g. all the time when we send users or lists of users, we return the same json content or maybe two different variations. When something in our json-responses.go changes, it's much effort to update all concerned parts of the API.
My suggestion is: let's save all variations of the json belonging to any object we return in our API and link to it whenever it occurs in a response. Good idea? Disadvantage would be that it might be harder to read, as stuff like this will occur:
We return partial equal json many times: e.g. all the time when we send users or lists of users, we return the same json content or maybe two different variations. When something in our json-responses.go changes, it's much effort to update all concerned parts of the API. My suggestion is: let's save all variations of the json belonging to any object we return in our API and link to it whenever it occurs in a response. Good idea? Disadvantage would be that it might be harder to read, as stuff like this will occur:
when a response contains a list of users