# Type Mismatch Error - Found String | Gatling version 2.2.5

**URL:** <https://community.gatling.io/t/type-mismatch-error-found-string-gatling-version-2-2-5/3799>\
**Category:** Gatling (Open-Source)\
**Created:** [June 30, 2017, 7:09am UTC](https://community.gatling.io/t/type-mismatch-error-found-string-gatling-version-2-2-5/3799 "2017-06-30T07:09:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunil\_Jacob](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Sunil\_Jacob](https://community.gatling.io/u/Sunil_Jacob)\
**Post date:** [June 30, 2017, 7:09am UTC](https://community.gatling.io/t/type-mismatch-error-found-string-gatling-version-2-2-5/3799/1 "2017-06-30T07:09:51Z")

</div>

Hi

i am using the below code for testing POST request to my API. I user feeder file as JSON for the same

class vertexapistep02 extends Simulation {

object getMultiLine {

val feederJson = jsonFile(“test.json”)  
val headers\_10 = Map(“Content-Type” → “”“application/json”"")  
val multi = exec(http(“PostMultiline”)  
.post("/tax\_rates/v1/quotations")  
**.body(ElFileBody(feederJson)).asJSON**  
)

}

val httpConf = http  
.baseURL(“[https://test.core.machine](https://test.core.machine)”)  
.acceptHeader(“application/json, _/_”)  
.acceptCharsetHeader(“UTF-8”)  
.doNotTrackHeader(“1”)  
.acceptLanguageHeader(“en-US,en;q=0.5”)  
.acceptEncodingHeader(“gzip, deflate”)  
.userAgentHeader(“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0”)

//Setting up scenarios

val users = scenario(“MobilePOS”).exec(getMultiLine.multi)

//Simluations

setUp(  
users.inject(rampUsers(10) over (10 seconds))  
).protocols(httpConf)  
}

I get the below error at the highlighted portion in the code:

type mismatch;

found : io.gatling.core.feeder.RecordSeqFeederBuilder[Any]

required: io.gatling.core.session.Expression[String]

(which expands to) io.gatling.core.session.Session =\> io.gatling.commons.validation.Validation[String]

12:21:38.198 [ERROR] i.g.c.ZincCompiler$ - .body(ElFileBody(feederJson)).asJSON

My questions are :

1. Is it not possible to use RawFileBody or ELFileBody method when using json feeder?

Since i have a long JSON file, i would not prefer to use **StringBody** method ?

Any help appreciated.

Thanks,  
Sunil

---

<div class="post-metadata">

**Author:** ![Sunil\_Jacob](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Sunil\_Jacob](https://community.gatling.io/u/Sunil_Jacob)\
**Post date:** [June 30, 2017, 7:29am UTC](https://community.gatling.io/t/type-mismatch-error-found-string-gatling-version-2-2-5/3799/2 "2017-06-30T07:29:15Z")

</div>

Update:

I have modified the code at the “.body” method and it seems ran into a different error as below:

Exception in thread “main” java.lang.IllegalArgumentException: Root element of JSON feeder file isn’t an array

Even though the error is self-explanatory, the root element of my JSON is not an array. Is there a way to use my JSON file?

Thanks,  
Sunil
