You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the application, which will monitor all files in that folder
Update myResponseBodyFile.json
Result: Unhandled exception occurs
System.ArgumentNullException
HResult=0x80004003
Message=Value cannot be null.
Source=WireMock.Net
StackTrace:
at WireMock.Validation.Check.NotNull[T](T value, String parameterName) in D:\data\inetpub\WireMock.Net\src\WireMock.Net\Validation\Check.cs:line 44
at WireMock.Server.FluentMockServer.DeserializeAndAddOrUpdateMapping(MappingModel mappingModel, Nullable`1 guid, String path) in D:\data\inetpub\WireMock.Net\src\WireMock.Net\Server\FluentMockServer.Admin.cs:line 415
at WireMock.Server.FluentMockServer.ReadStaticMappingAndAddOrUpdate(String path) in D:\data\inetpub\WireMock.Net\src\WireMock.Net\Server\FluentMockServer.Admin.cs:line 202
at WireMock.Server.FluentMockServer.<WatchStaticMappings>b__12_1(Object sender, FileSystemEventArgs args) in D:\data\inetpub\WireMock.Net\src\WireMock.Net\Server\FluentMockServer.Admin.cs:line 164
at WireMock.Util.EnhancedFileSystemWatcher.OnChanged(FileSystemEventArgs e) in D:\data\inetpub\WireMock.Net\src\WireMock.Net\Util\EnhancedFileSystemWatcher.cs:line 128
at WireMock.Util.EnhancedFileSystemWatcher.OnChanged(Object sender, FileSystemEventArgs e) in D:\data\inetpub\WireMock.Net\src\WireMock.Net\Util\EnhancedFileSystemWatcher.cs:line 224
at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(WatcherChangeTypes changeType, String name)
at System.IO.FileSystemWatcher.ParseEventBufferAndNotifyForEach(Byte[] buffer)
at System.IO.FileSystemWatcher.ReadDirectoryChangesCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
It breaks because the .json file only contains the Body of the response, while the deserializer is expecting both a Request: {} and Response: {} element
This feels like a bug because I want to have my request .json and responseBody .json stored close together on my file system. Is there another approach to store them differently which is compatible with the file watchers. I do want (during development) want to be able to watch both.
The text was updated successfully, but these errors were encountered:
If you want to use BodyAsFile, you could just try to use a file with another extension, like .response. That kind of files will not be read or watched.
Note that you probably need to set caching to false, (BodyAsFileIsCached = false) for that specific mapping.
ReadStaticMappings(myMappingsFolder)
to import request matchers from static.json
filesWatchStaticMappings(myMappingsFolder)
BodyAsFile
myResponseBodyFile.json
Result: Unhandled exception occurs
It breaks because the
.json
file only contains the Body of the response, while the deserializer is expecting both aRequest: {}
andResponse: {}
elementThis feels like a bug because I want to have my request .json and responseBody .json stored close together on my file system. Is there another approach to store them differently which is compatible with the file watchers. I do want (during development) want to be able to watch both.
The text was updated successfully, but these errors were encountered: