https://linen.dev logo
Title
m

Muthukkumar Ponnusamy

05/06/2023, 6:21 AM
Hi, I'm trying to generate response(status and body) based on a condition like below. if True the status will be 200 with "hello is present" as body or else if the condition fails. It fails with Cannot deserialize value of type
int
from String "XXXXXXX": not a valid
int
value "status": "{{#if (equals request.body 'hello')}}200{{else}}404{/if}}", "body": "{{#if (equals response.status 200)}}hello is present{{else}}hello is not present{/if}}"
b

Bas Dijkstra

05/06/2023, 10:29 AM
Wouldn't creating two separate responders be an option? One for the 'if' case, another for the 'else' case? Keep it simple 🙂
m

Muthukkumar Ponnusamy

05/08/2023, 1:23 PM
It is. My bad I was thinking too complex. I'm from Infrastructure side and my new role gave me a chance to work on development side. Seems like my mind doesn't look for simple logical options instead tries to figure out why a this logic doesn't work and how to fix it. 😞 . Thank you for pointing it.
b

Bas Dijkstra

05/08/2023, 1:30 PM
No worries, that’s what we’re here for!
m

Muthukkumar Ponnusamy

05/09/2023, 2:18 PM
Thank you.