Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Generate JSON response of an AEM Page

Avatar

Level 2

Hi Team,

We need to do customization out of box JSON response of an AEM Page.
http://localhost:4502/content/wknd/language-masters/en/magazine/jcr:content.-1.tidy.infinity.json

kotireddy4b1_0-1620404142260.png

 

How to can achieve the above JSON format by using a custom service?

 

bsloki.   Jörg_Hoh   Sham_HC 

 

@arunpatidar26  

 

Thanks
Kotireddy

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
4 Replies

Avatar

Level 3

Hey!  I think what you're looking for is the Sling Model Exporter. With it, you can define a Sling Model with the properties you want to expose, that is then available by browsing to your-page.model.json.

Avatar

Correct answer by
Community Advisor
 

Hi @kotireddy4b1 ,

 

I have explained this here. Hope it helps.

Code - https://github.com/riteshmittal/slingexporterusecase

Avatar

Community Advisor

Hi, what sort of customization you want to do.

I would suggest a proxy servlet approach to filter out model.json response using custom servlet.



Arun Patidar