mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Can I build mappings with code and save them to JSON-file without starting server #475
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 @Eshva on GitHub (Dec 21, 2022).
Originally assigned to: @StefH on GitHub.
I want prepare mappings with code, save them as JSON-files and use them latter as static mappings. Currently I've found such a way to do it:
It works but I have to start a server. Can I do it without starting a server somehow?
@StefH commented on GitHub (Dec 22, 2022):
@Eshva
Can you try preview
1.5.13-ci-16878? (https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)Use it like:
@StefH commented on GitHub (Dec 23, 2022):
https://github.com/WireMock-Net/WireMock.Net/pull/869
@StefH commented on GitHub (Dec 31, 2022):
@Eshva Did you have time to test that preview version?
@Eshva commented on GitHub (Jan 2, 2023):
Sorry for late response. Not yet. New year time, I was busy, but now we have long holydays so I will test it. I will be back soon with review.
@Eshva commented on GitHub (Jan 3, 2023):
I've tasted it with a test:
The result doesn't contain the request specification, it's empty.
@StefH commented on GitHub (Jan 4, 2023):
@Eshva
Thank you for testing.
This is very strange behavior: the json you see is not the MappingModel json but the internal json.
Can you please retry preview version
1.5.13-ci-16899?@StefH commented on GitHub (Jan 4, 2023):
See also my unit test : https://github.com/WireMock-Net/WireMock.Net/blob/mappng-builder/test/WireMock.Net.Tests/MappingBuilderTests.cs#L59
Which returns:
@Eshva commented on GitHub (Jan 5, 2023):
With
1.5.13-ci-16899version it works as required. Before I used1.5.13-ci-16878version as you suggested.Thank you!
@StefH commented on GitHub (Jan 6, 2023):
@Eshva Thanks for testing. I'll merge this change to main branch.