mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Feature: Add support for template language DotLiquid #150
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 @StefH on GitHub (Oct 18, 2018).
Originally assigned to: @StefH on GitHub.
@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?
@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.
@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
@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.
@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?
@StefH commented on GitHub (Jan 13, 2021):
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):
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 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
@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? :)
@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?
@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 :)
@StefH commented on GitHub (Jan 15, 2021):
I noticed these differences:
{{request.PathSegments.[0]}}does not work@StefH commented on GitHub (Jan 19, 2021):
Code is merged to maaster and a new NuGet will be released.
Further fixes like
Will be maybe taken up in another PR