We have developed a sling exporter for our Page component which exports all the data for the child components as well (using the ContainerExporter
method getExportedItems
). I don't want to include some components in the data, so, for that I have mentioned @JsonIgnoreType
on the model class of the component which is under a parsys/responsivegrid under my page's jcr:content
. But still, the component's data is getting included. How can I skip a component completely? Is there any annotation available which I can add to my class?
Asked
Active
Viewed 655 times
1

ankur_rajput
- 145
- 2
- 11
-
From Jackson perspective, we can put it in below way: Let's say we have a `Map
`. `ComponentExporter` is an interface which has 2 implementations: 1.) `Component1`. 2.) `Component2`. `Component1` class has the `@JsonIgnoreType` annotation at the class level. Now if we serialize this map, it is not excluding the Component1 object. How can we do that? – ankur_rajput Jun 11 '20 at 18:05 -
can you provide more details about your component sling model , what are the annotations used? – raju muddana Jun 14 '20 at 04:28
-
Please add some code... That might get you some answers in the end. – Oliver Gebert Jun 17 '20 at 07:03
-
@rajumuddana, It is exactly similar to the core Page component. @Model( adaptables = {SlingHttpServletRequest.class}, adapters = {Page.class, ContainerExporter.class}, resourceType = {"core/wcm/components/page/v2/page"} ) @Exporter( name = "jackson", extensions = {"json"} ) public class PageImpl implements ContainerExporter – ankur_rajput Jul 04 '20 at 20:23