JSON:API Exporter

Avatar

Avatar
Validate 1
Level 2
SundarNarayanan
Level 2

Likes

4 likes

Total Posts

7 posts

Correct reply

1 solution
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
SundarNarayanan
Level 2

Likes

4 likes

Total Posts

7 posts

Correct reply

1 solution
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 3
Boost 1
View profile
SundarNarayanan
Level 2

14-07-2020

Hi,

I would like to know if there are any open source JSON:API sling exporters available in AEM to export the content to SPA 

in JSON:API format(https://jsonapi.org/) , if it is not available i am looking forward to any available solutions which is available

I could see similar offering is available in drupal (https://www.drupal.org/project/jsonapi)

 

Thanks

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

14-07-2020

Apache Sling provides a Jackson JSON exporter to satisfy common cases of exporting Sling Models as JSON objects for consumption by SPAs.
 

 

import com.fasterxml.jackson

 

You can utilise the AEM WCM Core V2 Page Component for page creation, where when you include the selector of "model" and extension of "json", you will get a JSON representation of the page. There's no magic happening with the WCM Core V2 Page Component. It simply returns a JSON representation of all the components that exist on the page, formatted. Each component, however, must have a 1 to 1 relationship with a Sling Model, and the sling model must be programmatically configured with the Jackson JSON exporter. 
 
AEM WCM Core V2 Components are all implemented with Sling Models and Jackson Exporters, so if you would like to test this feature, you can simply create a new page using the WCM Core V2 Page Component, next you can start constructing the page with the WCM Core V2 Components. Next, visit the webpage via /content/my-site/page.model.json, and you will get a JSON representation of the entire page, ready for consumption by SPAs.
 
A good article here is:
 

Answers (0)