-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
How to submit mappings for multiple request, responses #240
Comments
This is not yet supported, but this looks like a good idea. I'll investigate and keep you informed on the progress. |
@StefH Also, how can I pre-load the mappings by using .json file? I don't have __admin/mappings path in my project as I am using WireMock.Net nuget package. I also want to know how I can read and create stubs from the pre-loaded json file. |
The json files here are just the same as the body you normally post to the http://localhost:5001/__admin/mappings URL. When you have posted a few mappings to the server, you can execute a POST request https://github.com/WireMock-Net/WireMock.Net/wiki/Admin-API-Reference#post-__adminmappingssave And if needed, you are allowed to rename the files as you like. |
@StefH - Can you please help me understand how to post the mappings to the server? I am doing a post @ http://localhost:5001/__admin/mappings/mystub_get.json but it is responding with I am not putting any request body while posting the mappings to the server. Do I have to? How? I am not getting what I am doing wrong. |
Ignore my comment. I figured out. I needed to set property in my .csproj to copy the .json files into my bin folder. Works now! :) |
Cool. |
New NuGet version 1.0.6 will be released in some time which implements posting multiple mappings as an array. |
@StefH - I tested NuGet version 1.0.6 for multiple mappings. It works fine when I POST an array to http://localhost:5001/__admin/mappings. But, if I have the array in an .json file kept under |
I forgot to implement that array logic, I 'll create a new NuGet in some time. Just watch this issue. |
If you have time, you can test NuGet version |
@StefH |
@arpymastro Did youhave time to test this ? |
New NuGet will be released shortly. |
I have a .net core console app which launches a mock server(using WireMock.StandAlone and WireMock.Net nuget package) within a console app as -
Now I want to create stub mappings for my multiple request, responses and so I'm posting json data to http://localhost:5001/__admin/mappings -
But it is showing - System.InvalidCastException Unable to cast object of type Newtonsoft.Json.Linq.JArray to type Newtonsoft.Json.Linq.JObject.
If I try to create mapping for one request, response it creates successfully.
The text was updated successfully, but these errors were encountered: