Exporting Component values as JSON | Community
Skip to main content
Level 2
September 21, 2023
Solved

Exporting Component values as JSON

  • September 21, 2023
  • 4 replies
  • 1275 views

We tried to export component values using @Model(adaptables = Resource.class, resourceType = {
"/components/content/carousel" }, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, cache = false)
@3484101(name = "jackson", extensions = "json", options = {
@ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "true")}) to a JSON format, however we are able to see the JSON values in author and publisher instances, but on dispatcher URL when we try to access this JSON, it is giving us the content as html format.

How to access this JSON values from dispatcher URL as JSON format.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jagadeesh_Prakash

@harinivr  how are you accessing the URL in author and publisher. Is it as part of selector?

 

If yes then use below filter rules to allow model json 

/0101 { /type "allow" /extension "json" /selectors "model" /path "/content/*" }

4 replies

Ankur_Khare
Community Advisor
Community Advisor
September 21, 2023

Hi,

I would suggest to refer one of the core component it would be working with dispatcher as well and follow the similar steps.

 

Regards

Ankur

Jagadeesh_Prakash
Community Advisor
Jagadeesh_PrakashCommunity AdvisorAccepted solution
Community Advisor
September 21, 2023

@harinivr  how are you accessing the URL in author and publisher. Is it as part of selector?

 

If yes then use below filter rules to allow model json 

/0101 { /type "allow" /extension "json" /selectors "model" /path "/content/*" }
Preetpal_Bindra
Community Advisor
Community Advisor
September 21, 2023

Hello @harinivr ,

Would you have URL examples that you could possibly share and/or screenshots from your test? You can mask out sensitive info.

Also, when you at it, can you also share the screenshot of the network request from the browser's dev tools?

 

thanks,

Preetpal

kautuk_sahni
Community Manager
Community Manager
September 26, 2023

@harinivr 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.

Kautuk Sahni