How to use brackets '[ ]' in Random String List HandleBar ? #520

Closed
opened 2025-12-29 15:25:51 +01:00 by adam · 2 comments
Owner

Originally created by @pouyaSobhanipour on GitHub (Jun 19, 2023).

Originally assigned to: @StefH on GitHub.

Hello

i want to use "{{Random Type=\"StringList\" Values=[\"a\", \"b\", \"c\"]}}" to receive a random response from mock server each time i do a request.

instead of a,b or c i want to use the following string : "{\'errors\':[{\'detail\':\'Conditions must be seen\'}]}"

it seems that when we have closed [] or {} wiremock does not responde .
how should i by pass this issue ?

Thanks

Originally created by @pouyaSobhanipour on GitHub (Jun 19, 2023). Originally assigned to: @StefH on GitHub. Hello i want to use `"{{Random Type=\"StringList\" Values=[\"a\", \"b\", \"c\"]}}"` to receive a random response from mock server each time i do a request. instead of a,b or c i want to use the following string : `"{\'errors\':[{\'detail\':\'Conditions must be seen\'}]}"` it seems that when we have closed [] or {} wiremock does not responde . how should i by pass this issue ? Thanks
adam added the question label 2025-12-29 15:25:51 +01:00
adam closed this issue 2025-12-29 15:25:51 +01:00
Author
Owner

@StefH commented on GitHub (Jun 23, 2023):

This is probably possible, however I do not know the answer.

Best is to take a approach where you use a switch statement.

See
https://stackoverflow.com/a/53398537/255966

@StefH commented on GitHub (Jun 23, 2023): This is probably possible, however I do not know the answer. Best is to take a approach where you use a switch statement. See https://stackoverflow.com/a/53398537/255966
Author
Owner

@pouyaSobhanipour commented on GitHub (Jun 30, 2023):

hello

but i need to use a mock list. the solution you have provided uses completely another approach.
isn't there any way to use the Random handle bar to by pass this problem ?

Thanks

@pouyaSobhanipour commented on GitHub (Jun 30, 2023): hello but i need to use a mock list. the solution you have provided uses completely another approach. isn't there any way to use the Random handle bar to by pass this problem ? Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#520