Really strange error

For some reason, .queryParam is giving me an error. Ever seen anything like this before?

`
17:40:47.545 [ERROR] i.g.a.ZincCompiler$ - :21: type mismatch;
found : String(“startDate”)
required: io.gatling.core.session.Session => io.gatling.core.validation.Validation[String]
17:40:47.549 [ERROR] i.g.a.ZincCompiler$ - .queryParam( “startDate”, startDate )

17:40:47.550 [ERROR] i.g.a.ZincCompiler$ - ^

`

Now, context may be needed, so here it is:

`
object TheService {

val path = Config.Endpoint.Services.url

def range(
desc: String = null,
startDate: String = “”,
endDate: String = “”,
rangeCode: String = “”,
rangeTimeUnit: String = “”,
originName: String = “”
) =
RTDE.GET(
desc = if ( desc == null ) “service.range.get” else desc,
url = path + “/range”
)
.queryParam( “startDate”, startDate )
.queryParam( “endDate”, endDate )
.queryParam( “rangeCode”, rangeCode )
.queryParam( “rangeTimeUnit”, rangeTimeUnit )
.queryParam( “originName”, originName )


}

`

For reference

`
object RTDE {

object GET {
def apply( desc: String, url: String ) =
RESTful.GET( desc, url )
.queryParam( “access_token”, $(ACCESS_TOKEN) )
}

}
`

And:

`
object RESTful {

object GET {
def apply( desc: String, url: String ) =
http( desc )
.get( url )
.headers( Headers.get )
}

}

`

queryParams takes an Expression[String], which is an alias for Session => Validation[String].
But Gatling provides automatics conversions from String to Expression[String], as long as you import io.gatling.core.Predef._

Just add the import and the compilation error will go away :slight_smile:

Cheers,

Pierre

I had a sneaking suspicion that it was an import thing. Thanks!