Skip to content

Commit 650f568

Browse files
Makes apiSpecsFolderPath in MinimalPermissionsPlugin relative to devproxyrc.json. Closes #1020 (#1022)
1 parent 0ce3b7c commit 650f568

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dev-proxy-plugins/RequestLogs/MinimalPermissionsPlugin.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,22 @@ public class MinimalPermissionsPlugin(IPluginEvents pluginEvents, IProxyContext
3838
private readonly MinimalPermissionsPluginConfiguration _configuration = new();
3939
private Dictionary<string, OpenApiDocument>? _apiSpecsByUrl;
4040
public override string Name => nameof(MinimalPermissionsPlugin);
41+
private IProxyConfiguration? _proxyConfiguration;
4142

4243
public override async Task RegisterAsync()
4344
{
4445
await base.RegisterAsync();
4546

4647
ConfigSection?.Bind(_configuration);
48+
_proxyConfiguration = Context.Configuration;
4749

4850
if (string.IsNullOrWhiteSpace(_configuration.ApiSpecsFolderPath))
4951
{
5052
throw new InvalidOperationException("ApiSpecsFolderPath is required.");
5153
}
54+
_configuration.ApiSpecsFolderPath = Path.GetFullPath(
55+
ProxyUtils.ReplacePathTokens(_configuration.ApiSpecsFolderPath),
56+
Path.GetDirectoryName(_proxyConfiguration?.ConfigFile ?? string.Empty) ?? string.Empty);
5257
if (!Path.Exists(_configuration.ApiSpecsFolderPath))
5358
{
5459
throw new InvalidOperationException($"ApiSpecsFolderPath '{_configuration.ApiSpecsFolderPath}' does not exist.");

0 commit comments

Comments
 (0)