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

Better Support for JsonIgnore and XmlTransient #31

Open
stevenhurth opened this issue Sep 28, 2016 · 1 comment
Open

Better Support for JsonIgnore and XmlTransient #31

stevenhurth opened this issue Sep 28, 2016 · 1 comment

Comments

@stevenhurth
Copy link

Man, I must say, what you've produced here is great! I was able to wire this into an API I've been working on, and intercept every request to allow end users to pass in which fields they would like back. After all said and done, there was no need to hand code anything with the JsonView within any controllers.

One thing that I noticed (which is actually a feature of JsonView) is that including all fields (using an asterisk) actually serializes XmlTransient and JsonIgnore attributes back in the response. However, this can be very problematic when comparing JSON results with generated Swagger docs, and/or extending third party framework objects such as Spring's ResourceSupport for HATEOAS.

What would be great is if we had the capability to disable this feature using the JsonResult. So, we'd return all fields, but not those that were marked to be ignored.

@theten52
Copy link

There is another situation that needs the support of @JsonIgnore: If I have a complex object, and a circular dependency occurs inside it, I use @JsonIgnore in Jackson to solve the problem of circular dependency, but if I use Json-view, then The problem of circular dependency may occur again.

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

2 participants