Getting data from another json file

Hello everyone :slight_smile:
Im newbie with using Yarg, so i got a question.

In sample project, yarg getting data from Data.json file in resources.

@GetMapping(value = "/generate/*")
    public void generateDocument(HttpServletResponse response)
            throws IOException {

        ReportBuilder reportBuilder = new ReportBuilder();
        ReportTemplateBuilder reportTemplateBuilder = new ReportTemplateBuilder()

        BandBuilder bandBuilder = new BandBuilder();
        String json = FileUtils.readFileToString(new File("./src/main/resources/Data.json"));
        ReportBand main ="Main")
                .query("Main", "parameter=param1 $.main", "json")
        Report report =;

        Reporting reporting = new Reporting();
        reporting.setFormatterFactory((ReportFormatterFactory) new DefaultFormatterFactory());
                new DefaultLoaderFactory().setJsonDataLoader(new JsonDataLoader()));
                new RunParams(report).param("param1", json),


I’d like to change that to getting data from another json file. In my project, im able to put some data by form into json, also get it on path “localhost:8080/all.json”.

Does anyone know how to do this?


You need to change this line to address to your file
String json = FileUtils.readFileToString(new File("./src/main/resources/Data.json"));

And then you should change the annotation
@GetMapping(value = "/generate/*") to @GetMapping(value = "/all.json").