Hi guys, I am creating a component with variables and an array, but the array creation is not working,
generates in the database but does not generate in the template, does not generate in json.
I have 2 projects, I tested it on the other one and it worked, but not on this project, I got
I got the complete component and it still hasn't generated the information in json.
I'm using Angular to do mapTo and that's it.


import com.adobe.cq.export.json.ComponentExporter;
import com.adobe.cq.export.json.ExporterConstants;
import lombok.Getter;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Exporter;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@Getter
@Model(
adaptables = { SlingHttpServletRequest.class, Resource.class },
adapters = { CardsContainer.class, ComponentExporter.class },
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
resourceType = CardDustReviews.RESOURCE_TYPE
)
@Exporter(
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
extensions = ExporterConstants.SLING_MODEL_EXTENSION
)
public class CardDustReviews implements CardsContainer {
protected static final String RESOURCE_TYPE = "projeto/components/reviews";
private static final Logger LOGGER = LoggerFactory.getLogger(CardDustReviews.class);
@ValueMapValue
private String dust;
@ChildResource
private List<CardDust> cards;
@Override
public List<CardDust> getCards() {
if (cards == null) {
LOGGER.warn("Could not locate any card. Returning an empty list.");
return Collections.emptyList();
}
return new ArrayList<CardDust>(cards);
}
@Override
public String getExportedType() {
return CardDustReviews.RESOURCE_TYPE;
}
}
CardsContainer
import com.adobe.cq.export.json.ComponentExporter;
import java.util.Collection;
public interface CardsContainer extends ComponentExporter {
String getDust();
Collection<? extends Card> getCards();
}
CardDust
import lombok.Getter;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
@Getter
@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
adapters = Card.class)
public class CardDust implements Card {
@ValueMapValue
private String title;
}
public interface Card {
String getTitle();
}