Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add support for template language DotLiquid #214

Closed
StefH opened this issue Oct 18, 2018 · 13 comments
Closed

Feature: Add support for template language DotLiquid #214

StefH opened this issue Oct 18, 2018 · 13 comments
Assignees
Labels

Comments

@StefH
Copy link
Collaborator

StefH commented Oct 18, 2018

No description provided.

@StefH StefH self-assigned this Oct 18, 2018
@StefH StefH added the feature label May 18, 2020
@n1l
Copy link

n1l commented 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
Copy link
Collaborator Author

StefH commented 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
Copy link

n1l commented 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
Copy link
Collaborator Author

StefH commented 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
Copy link

n1l commented 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
Copy link
Collaborator Author

StefH commented 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
Copy link
Collaborator Author

StefH commented 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
Copy link
Collaborator Author

StefH commented 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
Copy link

n1l commented Jan 15, 2021

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

@StefH
Copy link
Collaborator Author

StefH commented 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
Copy link

n1l commented 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
Copy link
Collaborator Author

StefH commented 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
Copy link
Collaborator Author

StefH commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants