https://linen.dev logo
#help
Title
n

Nodir Musaev

06/04/2023, 7:18 PM
Hello Can someone help me to make integer from string in a response? Like this:
Copy code
"year": "{{now format='yyyy' type='NUMERIC'}}",
"month": "{{now format='M' type='NUMERIC'}}",
"day": "{{now format='d' type='NUMERIC'}}",
"hour": "{{now format='h' type='NUMERIC'}}",
But this doesn’t work. Main idea is that I generate components(year, month, day…) from date with formats and then I want to make it to integer types to decode it, because backend sends this fields in integer type. Or maybe someone can suggest another way to mock response like that?
1
o

Oleg Nenashev

06/05/2023, 11:30 AM
As long as you use quotes, it will inject strings as JSON spec expects. Not sure removing them is going to help though, I don't have an opportunity to test it right now. We'll try to do it tonight when I'm at the hotel
n

Nodir Musaev

06/06/2023, 8:32 PM
It works without quotes. Thanks
o

Oleg Nenashev

06/07/2023, 10:48 AM
You're welcome!