Feature: Add support for template language DotLiquid #150

Closed
opened 2025-12-29 14:23:44 +01:00 by adam · 13 comments
Owner

Originally created by @StefH on GitHub (Oct 18, 2018).

Originally assigned to: @StefH on GitHub.

Originally created by @StefH on GitHub (Oct 18, 2018). Originally assigned to: @StefH on GitHub.
adam added the feature label 2025-12-29 14:23:44 +01:00
adam closed this issue 2025-12-29 14:23:44 +01:00
Author
Owner

@n1l commented on GitHub (Jan 12, 2021):

Hi I wish ti help you to implement the feature.
Can you please describe the motivation. Why do you want to implement the feature. How do you want to use liquid markup language?

@n1l commented on GitHub (Jan 12, 2021): Hi I wish ti help you to implement the feature. Can you please describe the motivation. Why do you want to implement the feature. How do you want to use liquid markup language?
Author
Owner

@StefH commented on GitHub (Jan 12, 2021):

Currently I support Handlebars.Net as response templating language (https://github.com/WireMock-Net/WireMock.Net/wiki/Response-Templating).

However, It would also be a nice option to support DotLiquid as templating engine.

@StefH commented on GitHub (Jan 12, 2021): Currently I support Handlebars.Net as response templating language (https://github.com/WireMock-Net/WireMock.Net/wiki/Response-Templating). However, It would also be a nice option to support DotLiquid as templating engine.
Author
Owner

@n1l commented on GitHub (Jan 12, 2021):

@StefH is DotLiquid critical? from my point of view it's not stable. There is another library called scriban. What do you think?

https://github.com/scriban/scriban

@n1l commented on GitHub (Jan 12, 2021): @StefH is DotLiquid critical? from my point of view it's not stable. There is another library called scriban. What do you think? https://github.com/scriban/scriban
Author
Owner

@StefH commented on GitHub (Jan 12, 2021):

My idea to support DotLiquid was that I think that also Microsoft used this for generating (help) pages.

But I see that scriban supports both, so that would be a good solution.

However the code from WireMock.Net does not support other transformation engines yet, so that needs to be reworked first.

@StefH commented on GitHub (Jan 12, 2021): My idea to support DotLiquid was that I think that also Microsoft used this for generating (help) pages. But I see that scriban supports both, so that would be a good solution. However the code from WireMock.Net does not support other transformation engines yet, so that needs to be reworked first.
Author
Owner

@n1l commented on GitHub (Jan 13, 2021):

@StefH Can you please provide any links about microsoft used DotLiquid?

About other transformations engines, what do you mean exactly? And what should be reworked from your perspective?

@n1l commented on GitHub (Jan 13, 2021): @StefH Can you please provide any links about microsoft used DotLiquid? About other transformations engines, what do you mean exactly? And what should be reworked from your perspective?
Author
Owner

@StefH commented on GitHub (Jan 13, 2021):

  1. I can't find the link / reference from Microsoft anymore.
  2. The current code can only support 1 transformation engine (https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Transformers/ResponseMessageTransformer.cs)
    So some changes need to be done to support also scriban. And remain backward compatible (so that the default transformation will be done by handlebars)
@StefH commented on GitHub (Jan 13, 2021): 1. I can't find the link / reference from Microsoft anymore. 2. The current code can only support 1 transformation engine (https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Transformers/ResponseMessageTransformer.cs) So some changes need to be done to support also **scriban**. And remain backward compatible (so that the default transformation will be done by handlebars)
Author
Owner

@StefH commented on GitHub (Jan 13, 2021):

Scriban does only support .netstandard 2.0 and net5.0
https://www.nuget.org/packages/Scriban/

So that's difficult to use in WireMock.Net

@StefH commented on GitHub (Jan 13, 2021): Scriban does only support .netstandard 2.0 and net5.0 https://www.nuget.org/packages/Scriban/ So that's difficult to use in WireMock.Net
Author
Owner

@StefH commented on GitHub (Jan 14, 2021):

@n1l
Older version from Scriban do support older frameworks, so that's good.

I've update the code to also support Sciban

See this MyGet preview:
WireMock.1.4.1-ci-14471

@StefH commented on GitHub (Jan 14, 2021): @n1l Older version from Scriban do support older frameworks, so that's good. I've update the code to also support Sciban See this MyGet preview: WireMock.1.4.1-ci-14471
Author
Owner

@n1l commented on GitHub (Jan 15, 2021):

Did you finish the code? I was going to help you, but as I can see you did it alone? :)

@n1l commented on GitHub (Jan 15, 2021): Did you finish the code? I was going to help you, but as I can see you did it alone? :)
Author
Owner

@StefH commented on GitHub (Jan 15, 2021):

Correct, I think I've the code change in place.

However, the syntax from Sciban does differ in some parts from Handlebars.Net , so I could not get all unit tests working.

Maybe you can take a look there?

@StefH commented on GitHub (Jan 15, 2021): Correct, I think I've the code change in place. However, the syntax from Sciban does differ in some parts from Handlebars.Net , so I could not get all unit tests working. Maybe you can take a look there?
Author
Owner

@n1l commented on GitHub (Jan 15, 2021):

It would be easier to me to start from the white paper not to fix the code you have written. So probably it's all yours now untill I have time to do it my way :)

@n1l commented on GitHub (Jan 15, 2021): It would be easier to me to start from the white paper not to fix the code you have written. So probably it's all yours now untill I have time to do it my way :)
Author
Owner

@StefH commented on GitHub (Jan 15, 2021):

I noticed these differences:

  • DOT notation for accessing this {{request.PathSegments.[0]}} does not work
  • WireMockList is not supported by Scriban
@StefH commented on GitHub (Jan 15, 2021): I noticed these differences: - DOT notation for accessing this `{{request.PathSegments.[0]}}` does not work - WireMockList is not supported by Scriban
Author
Owner

@StefH commented on GitHub (Jan 19, 2021):

Code is merged to maaster and a new NuGet will be released.

Further fixes like

  • DOT notation for accessing this {{request.PathSegments.[0]}} does not work
  • WireMockList is not supported by Scriban

Will be maybe taken up in another PR

@StefH commented on GitHub (Jan 19, 2021): Code is merged to maaster and a new NuGet will be released. Further fixes like - DOT notation for accessing this {{request.PathSegments.[0]}} does not work - WireMockList is not supported by Scriban Will be maybe taken up in another PR
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#150