Renu
Renu

Reputation: 313

karate - how to validate that param is string and having max length

In karate, how to check if in the response, name field is string type and having max length upto 35. I know how to validate, string, but don't know how to check the length at same time.

name: '#string',

Upvotes: 4

Views: 2186

Answers (1)

Babu Sekaran
Babu Sekaran

Reputation: 4239

you are pretty close,

"#string? _.length <= 35"

_ means self in expressions

refer 'self' validation expressions

Upvotes: 3

Related Questions