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

Nadia Debogori

08/28/2023, 1:12 PM
Hi, I am using wiremock standalone, and in a scenario there is a need to path state of a response (which i can do with
transformerParameters
option) with the same randomly generated UUID. I can generate it in a response body with
{{ randomValue type='UUID' }}
, but I am struggling to create a way to send it into two different responses. May be there is a way, how I can create a variable for the whole scenario and use it?
Will {{#assign}}{{/assign}} notation work for mappings files?
o

Oleg Nenashev

08/28/2023, 1:51 PM
Hi. Sorry for the slight response delay, it's a bank holiday in the UK and parenting time for me. Will respond in 2 hours or so
👍 1
n

Nadia Debogori

08/28/2023, 1:52 PM
Do not worry, any time will be perfect!
👍 1
t

Tom

08/28/2023, 2:05 PM
Hi @Nadia Debogori there isn’t an OOTB way to store values for use across multiple stubs/responses at the moment. You can obviously pre-generate a UUID then hard-code it into your stubs or you could build an extension to handle this for you. You might find that this extension helps with your use case: https://github.com/wiremock/wiremock-extension-state It’s still under development and only works with the very latest 3.0 beta, but its purpose is to store and retrieve state between requests so might do the trick.
n

Nadia Debogori

08/28/2023, 2:07 PM
Thanks, @Tom, I’ll read and hope that it’ll help
👍 1