-
Notifications
You must be signed in to change notification settings - Fork 38
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
Scripting doesn't work for file template #58
Comments
It's a good use case. Originally, the intent of that feature was to provide raw content, like images, binary stuff. Maybe we could add some flag to indicate that the file should be parsed as script: {
"request": {
"route": "login",
"method": "GET"
},
"response": {
"headers": {
"Content-Type": "text/html; charset=UTF-8"
},
"status": "OK",
"file": {
"path": "Mocks/login.html",
"containsScript": true
}
}
} Obviously I would keep the "file": "path" as an alternate syntax backward compatible. What do you think? |
Previously, I thought scripting works for every template. I think that's good option. |
Maybe the script engine can use razor extension (cshtml) to determine if it should run it or not. |
Hi @natenho, Any plan to implement this? It would be a nice feature. It is easiest to have XML responses for example in an external file. wiremock.org for example, divides the mocks folder (by default |
I prefer not having any folder convention for the sake of simplicity, what if we add a logic to "do not consider dependent files as mocks"?? i.e. if a given file is referenced inside another mock, it should not be considered as a mock itself |
Great, I wasn't considering the |
Describe the bug
When sending response from external file (f.e. html file) containing script, the script is not evaluated
To Reproduce
Using these mocks:
and
And this's html file
Expected behavior
The script is evaluated
Screenshots
The text was updated successfully, but these errors were encountered: