mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
How to append request body properties for response templating? #565
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @felipetofoli on GitHub (Jan 10, 2024).
Hi @StefH ! I hope this message finds you well! 😃
Question
-> How to append request body properties for response templating?
Context
I am trying to append two values received in the request, but I receive the following error when trying to append them:
500 Internal server error
Mapping
My objective is to be able to get the value according to the
valueGotFromDictresponse property (concatenate 2 request body properties to generate the key that I will search for in a dictionary, but I am not able to resolve the "Append" part at the moment.Request example
I wasn't able to find examples in the docs or the internet, so could you please help me?
Please let me know if you need any information.
Thanks!
@StefH commented on GitHub (Jan 10, 2024):
Maybe, you can try:
@StefH commented on GitHub (Jan 25, 2024):
@felipetofoli
Did you try my suggestion?
@StefH commented on GitHub (Feb 13, 2024):
@felipetofoli
Did you have time to try my suggestion?
@felipetofoli commented on GitHub (Feb 16, 2024):
Hello @StefH !
I am sorry for this late reply. I didn't see the notification for this thread.
It didn't work. I had to write a custom handlebar to achieve my intentions, unfortunately.
I started debugging the project (weeks ago), and if I recall correctly, it seemed that the context was not loaded when executing the Append handlebar function... Unfortunately, it was weeks ago, and I don't have (or remember) more details to provide... 😢
@StefH commented on GitHub (Feb 16, 2024):
OK. If you got it working thats good.
Append and Concat are included. See:
https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/String#append