Unable to correctly capture ID

Hi,
I need to capture a system generated ID. I have this in my script
.check(jsonPath("$.id").ofType[Long].saveAs("id"))

The issue is in the output logs I can see the application is returning a random generated ID (i.e. 1234567890) however the value captured and saved in my variable is a random negative number (i.e. -2716304759).

Please let me know of your thoughts. Thanks!

Seems like a conversion/cast error to me. Have you tried not casting it?

This works in my project. Try grabbing it as a string and seeing if it looks right in the session variables output. Maybe you are grabbing the wrong thing?

.check(jsonPath("$..data.project").saveAs("projectId")))


I've also tried that option of not specifying a dataType but to no avail. I ended up using another assertion form in my script. So instead of using jsonPath I used regEx. That approach worked as expected for me.

BTW, thanks for replying.