Questions tagged [json-view]
85 questions
0
votes
1 answer
Json-View not working for reactive types (Spring Web mvc, with reactive type support)
Have a problem with JsonView support for reactive types in spring web mvc application. Spring 5 supports reactive types with ReactiveTypeHandler + taskExecutor configuration in WebMvcConfig. The data is returning, but the JsonView is ignored and all…

Oleksandr Abasov
- 311
- 3
- 12
0
votes
1 answer
How To Enable JsonView With Micronaut
I've got the latest version of Micronaut as of this question (1.1.0) and see that support for the @JsonView jackson annotation has been added. However, when I add it to my controller and enable it in my application.yml, I do not see the annotation…

Aaron
- 896
- 3
- 11
- 22
0
votes
1 answer
@JsonView not propagated to ("nested") custom serializer
In the unit test below there are two beans: beanA and beanB, where beanA contains a reference to beanB.
When serializing the beans providing a JSON View with custom serializers the custom serializer of beanB does not know about the provided JSON…

bgraves
- 788
- 1
- 11
- 23
0
votes
1 answer
Accessing controller params in json views in Grails
A controller using json views will call the json view corresponding to the controller method called when rendering domains.
I want however to pass the controller params to the json view in addition to the domains, to customize the way a domain is…

Heschoon
- 2,915
- 9
- 26
- 55
0
votes
1 answer
How to use JsonView in a StdSerializer Jackson
I create a serializer which extend StdSerializer to transform a list of objects into many objects in json.
From
List myList = new LinkedList();
public class MyParentObject{ private String nameOfObject; }
to
{
…

Goofyrocks
- 153
- 1
- 9
0
votes
1 answer
grails v3.3.3, json views 1.2.7 : getting stack overflow when doing a deep rendering of parent object
getting a stack overflow when deep rendering a domain object with json views.
I have created a Customer domain object and Sites domain object, where Customer hasMany sites.
i have created two customers and one site in bootsrap and assigned the…

WILLIAM WOODMAN
- 1,185
- 5
- 19
- 36
0
votes
0 answers
My index.gson, show.gson are getting ignored with Grails 3.3.3 using JsonViews 1.2.7
I am struggling with getting JSON API, and rendering of json for domain classes. I am using Grails v3.3.3 and JsonViews 1.2.7
If I expose a domain class by using @Resource annotation this automatically generates a controller and 'default' json…

WILLIAM WOODMAN
- 1,185
- 5
- 19
- 36
0
votes
2 answers
How to get Json Api rendering to work with json views in Grails v3.3.3
I have a simple problem and documentation is not helping me resolve it.
I have created a Grails v3.3.3 demo project - and created a simple domain class called JsonApiBook, with 'name' attribute like this
package ttrestapi
import…

WILLIAM WOODMAN
- 1,185
- 5
- 19
- 36
0
votes
1 answer
How do I have Multiple JsonView inheritance
I have a scenario in Java SpringBoot 1.5.7 where I have multiple classes and I want to be able to Apply different JsonViews to each through inheritance like.
ClassA{
@JsonView({SummaryView.class})
public String name;
…

Santa Teclado
- 186
- 10
0
votes
1 answer
Can you suggest any online JSON Grid Viewer or table viewer?
I looked over many online JSON Viewer, but none of them are really good, in terms of showing JSON arrays in table format. Please suggest if you know.

Kaushal B
- 53
- 7
0
votes
1 answer
How to use Grails JSON view without defining internal templates?
I've a domain class:
class Business {
String name
String description
}
I have the following JSON templates :
index.gson: to generate the JSON for the list of objects
_business.gson: to generate JSON for Business object
index.gson
import…

user3426603
- 617
- 2
- 9
- 26
0
votes
1 answer
Conditional expressions depending on JsonView in Spring
I'm building an API and I've built my resource class to use JsonViews to filter certain fields depending on the request that the api receives. I've got that working properly, but now, I'm trying to pursue some performance upgrades in which certain…

orangeandgrey
- 81
- 2
- 8
0
votes
1 answer
In JSON views, how do I flatten an object out as a single string?
In my grails 3 app (I'm using grails 3.2.4), I have an object type which I want to be serialized as a string, for any Domain object that uses it:
class MyDomain1 {
CustomId id
}
class MyDomain2 {
CustomId id
}
I want to create a view that…

RMorrisey
- 7,637
- 9
- 53
- 71
0
votes
1 answer
How do I create a grails 3 plugin which exposes a JSON view?
In my custom Grails plugin, how can I set up a JSON view for a non-domain class and get client apps to use it by default?
I have a view file in the plugin:
/views/com/mycompany/myplugin/myclass/_myClass.gson
When I do grails install, I can see that…

RMorrisey
- 7,637
- 9
- 53
- 71
0
votes
1 answer
Get null property when trying to use JSON views on rest Controller just extending from RestfulController
I'm trying out JSON views, not on top of domain class using @Resource, but by creating a RestfulController and trying to render that using JSON views. I've added all the relevant dependencies in build config.
I have a domain Post class like this…

WILLIAM WOODMAN
- 1,185
- 5
- 19
- 36