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
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: