How we can remove it by overriding that properties ?
Solved! Go to Solution.
@pratikshah : How are you trying to access json for your component/page?
I am assuming you are just changing the extension to '.json'. Please correct me if that is not the case. With this, it will give all the properties that exists for your content such as jcr:lastModifiedBy. And this way of accessing content as json should not be allowed and would not work when you access it from dispatcher as all such json requests would be blocked.
If you have a sling model, then you should be doing sling model exporter. It will only return the properties which are defined as part of your component and has a getter method/field in your model. Please refer- https://medium.com/@toimrank/aem-sling-model-exporter-90dc872835b9
AEM documentation for the same- https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/develo...
thanks.
@pratikshah : How are you trying to access json for your component/page?
I am assuming you are just changing the extension to '.json'. Please correct me if that is not the case. With this, it will give all the properties that exists for your content such as jcr:lastModifiedBy. And this way of accessing content as json should not be allowed and would not work when you access it from dispatcher as all such json requests would be blocked.
If you have a sling model, then you should be doing sling model exporter. It will only return the properties which are defined as part of your component and has a getter method/field in your model. Please refer- https://medium.com/@toimrank/aem-sling-model-exporter-90dc872835b9
AEM documentation for the same- https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/develo...
thanks.
Hi @pratikshah
Is there an exporter your sling model is extending, like ComponentExporter or ContainerExporter or some custom exporter? If your model is extending from some other model, it is possible that parent model must be exporting it. If this is the case, you can override the method and add @JsonIgnore annotation to exclude it from export.
hey @Lokesh_Vajrala yes using the jackson exporter but that lastModifiedBy is not there in component right so how to remove it should I full in sling model class.
@pratikshah Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
hey @kautuk_sahni still havent found any correct answer still searching for it.
Views
Replies
Total Likes
@pratikshah This can not be achieved through OOTB approach. please write custom exporter to have required keys.