api-gateway-mapping-template icon indicating copy to clipboard operation
api-gateway-mapping-template copied to clipboard

String matches does not work

Open jprivillaso opened this issue 4 years ago • 0 comments

Hello!

First of all, thanks for the lib. It's really useful. However, I can't make this template work

#if( $limit != '' && $limit.matches('^\d$'))
{ "ok": 1 }
#else
{ "ok": 2 }
#end

The payload is

{
  "limit": "3"
}

Isn't the matches function a built-in method? I'd love to help to implement this workaround if you instruct me how to do it.

Thanks

jprivillaso avatar Apr 08 '21 19:04 jprivillaso