Unable to create resources when terraform is initialized at the root directory

Unable to create synthetic tests when terraform is initialized from root directory, I using code from GitHub - niaid/terraform-datadog-synthetics-test: Terraform Module for Setting up Datadog Synthetics Test(s).

If terraform is initialized at subfolders we cannot have the for loop to read values from file, because of below error

Error: Module is incompatible with count, for_each, and depends_on

│ on canvas_feedback_tests.tf line 34, in module “datadog_synthetics_test_canvas”:
│ 34: for_each = jsondecode(var.json_results)

│ The module at module.datadog_synthetics_test_canvas is a legacy module which contains its own local provider configurations, and so calls to it may not use the count, for_each, or depends_on arguments.

│ If you also control the module “./…”, consider updating this module to instead expect provider configurations to be passed by its caller.

Kindly suggest to read from swagger.json file to get all GET calls as for-each loop and create synthetic tests. Not sure how to resolve issue