And another unexpected behaviour: ```data class Te...
# http4k
r
And another unexpected behaviour:
Copy code
data class Test(val name: Int)
you declare in meta :
Copy code
receiving(Body.auto<Test>().toLens() to Test(3))
you call in a curl with
-d "{\"name\":5}"
it passes (it’s ok is just for reference of a correct call) but you call also with a bad keyname ex:
-d "{\"ne\":5}"
the call is valid. if name is a String this works as expected, fails if the key is spelled bad. I don’t use that value so don’t know if the created object would be valid. I’ll try to make a full test tomorrow evening too late for that right now.
d
This is down to the Jackson configuration for failing on unexpected keys.
You should get a 400 for the second case. Regardless it’s all in Jackson’s hands here - we’re just delegating to it to unmarshall
👍 1