You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter.
The JSON omitempty tag will not work in this case.But I think ffjson can do it by generating static MarshalJSON method with fields param and encoding partial fields to JSON string.
Wishing for your response :)
The text was updated successfully, but these errors were encountered:
I have a problem when building a RESTful API service.Some on stackoverflow have the same problem
http://stackoverflow.com/questions/17306358/golang-removing-fields-from-struct-or-hiding-them-in-json-response
The JSON
omitempty
tag will not work in this case.But I thinkffjson
can do it by generating staticMarshalJSON
method withfields
param and encoding partial fields to JSON string.Wishing for your response :)
The text was updated successfully, but these errors were encountered: