Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically marshalling specific fields support? #150

Open
imjustfly opened this issue Sep 9, 2015 · 0 comments
Open

Dynamically marshalling specific fields support? #150

imjustfly opened this issue Sep 9, 2015 · 0 comments

Comments

@imjustfly
Copy link

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

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant