Allow WithMappings to support scanning SubDirectories when building a WireMockContainer #613

Closed
opened 2025-12-29 08:30:59 +01:00 by adam · 4 comments
Owner

Originally created by @Xor-el on GitHub (Jul 19, 2024).

Originally assigned to: @StefH on GitHub.

First of all, I must thank you for this amazing project.
Now to my question, when using static mappings, is there an overload that allows us indicate that we want to include sub directories in our scan?
please see the code below for an example of what I mean.

   private const string PATH_TO_MAPPINGS = @"my/path/toMappings";

    private readonly WireMockContainer _api = new WireMockContainerBuilder()
        .WithAutoRemove(autoRemove: true)
        .WithMappings(PATH_TO_MAPPINGS, includeSubDirectories: true) // additional flag
        .WithCleanUp(cleanUp: true)
        .Build();
        
    public async Task StartAsync() => await _api.StartAsync();

If such functionality does not exist, I think it would be nice to have.

Originally created by @Xor-el on GitHub (Jul 19, 2024). Originally assigned to: @StefH on GitHub. First of all, I must thank you for this amazing project. Now to my question, when using static mappings, is there an overload that allows us indicate that we want to include sub directories in our scan? please see the code below for an example of what I mean. ```csharp private const string PATH_TO_MAPPINGS = @"my/path/toMappings"; private readonly WireMockContainer _api = new WireMockContainerBuilder() .WithAutoRemove(autoRemove: true) .WithMappings(PATH_TO_MAPPINGS, includeSubDirectories: true) // additional flag .WithCleanUp(cleanUp: true) .Build(); public async Task StartAsync() => await _api.StartAsync(); ``` If such functionality does not exist, I think it would be nice to have.
adam added the feature label 2025-12-29 08:30:59 +01:00
adam closed this issue 2025-12-29 08:30:59 +01:00
Author
Owner

@StefH commented on GitHub (Jul 19, 2024):

@Xor-el
It's not yet supported I think using this command.
However you maybe can use this for now:

.WithWatchStaticMappings(true)
@StefH commented on GitHub (Jul 19, 2024): @Xor-el It's not yet supported I think using this command. However you maybe can use this for now: ```c# .WithWatchStaticMappings(true) ```
Author
Owner

@Xor-el commented on GitHub (Jul 19, 2024):

Thanks for the quick response @StefH
Can confirm that your suggested approach works.
will use the workaround for now, very much appreciated.

maybe we can leave this issue open for now as a reminder if you plan to implement this later.

@Xor-el commented on GitHub (Jul 19, 2024): Thanks for the quick response @StefH Can confirm that your suggested approach works. will use the workaround for now, very much appreciated. maybe we can leave this issue open for now as a reminder if you plan to implement this later.
Author
Owner

@StefH commented on GitHub (Jul 20, 2024):

Will be solved in next release.

https://github.com/WireMock-Net/WireMock.Net/pull/1141

@StefH commented on GitHub (Jul 20, 2024): Will be solved in next release. https://github.com/WireMock-Net/WireMock.Net/pull/1141
Author
Owner

@Xor-el commented on GitHub (Jul 20, 2024):

Thanks for your quick action @StefH

@Xor-el commented on GitHub (Jul 20, 2024): Thanks for your quick action @StefH
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#613