How to Map Json File (saved in resource) to Json Response coming via Get request.

Hi I am pretty new to gatling and I have been trying hard to accomplish this simple scenario but I am not able to complete this i dont know how this is done using scala in gatling, I have saved some response in .json file and then i want to just validate those response to a json response.

“id”: 512,


this is how my response looks like but this is in array.

object Products {

val jsonFetchProductIDs = ElFileBody(“fetch-products-id.json”)
val fetchProductIds: HttpRequestBuilder = http(“Fetch product ids”).get(“endpoint”)

val products = http(“Products”)

class ProductsTest extends Simulation {

val productIdInfo = exec(
.check(, jsonPath("$.id").ofType[Map[String,Any]].findAll.saveAs(“productsID”))
val productIdResult = exec(session => {
val id = session.get(“id”).asOption[String]
foreach("${productsID}", “id”) {
exec(session => {
val idMap = session(“id”).as[Map[String, Any]]
val allId = idMap(" allId")
session.set(“allId”, allId)

val getproductidscenario1 = scenario(“Products ID”)