diff --git a/SW.Bitween.Api/Resources/Subscriptions/SaveMapper.cs b/SW.Bitween.Api/Resources/Subscriptions/SaveMapper.cs index 9b043a41..bacc50e6 100644 --- a/SW.Bitween.Api/Resources/Subscriptions/SaveMapper.cs +++ b/SW.Bitween.Api/Resources/Subscriptions/SaveMapper.cs @@ -59,8 +59,8 @@ public Validate(NativeAdapterDiscoveryService nativeAdapterDiscovery, IServicePr if (mapperId.StartsWith(NativeAdapterDiscoveryService.NativePrefix, StringComparison.OrdinalIgnoreCase)) { - var properties = nativeAdapterDiscovery.GetExpectedStartupValues(mapperId); - mustProps = properties.Where(p => p.Value.EndsWith(" *")).Select(p => p.Key); + var properties = nativeAdapterDiscovery.GetStartupValues(mapperId); + mustProps = properties.Where(p => !p.Value.Optional).Select(p => p.Key); } else { diff --git a/SW.Bitween.Api/Resources/Subscriptions/Update.cs b/SW.Bitween.Api/Resources/Subscriptions/Update.cs index 12745716..6436883d 100644 --- a/SW.Bitween.Api/Resources/Subscriptions/Update.cs +++ b/SW.Bitween.Api/Resources/Subscriptions/Update.cs @@ -145,8 +145,8 @@ public Validate(BitweenDbContext dbContext, IHttpContextAccessor httpContextAcce // Check if it's a native adapter if (mapperId.StartsWith(NativeAdapterDiscoveryService.NativePrefix, StringComparison.OrdinalIgnoreCase)) { - var properties = nativeAdapterDiscovery.GetExpectedStartupValues(mapperId); - mustProps = properties.Where(p => p.Value.EndsWith(" *")).Select(p => p.Key); + var properties = nativeAdapterDiscovery.GetStartupValues(mapperId); + mustProps = properties.Where(p => !p.Value.Optional).Select(p => p.Key); } else { @@ -174,8 +174,8 @@ public Validate(BitweenDbContext dbContext, IHttpContextAccessor httpContextAcce // Check if it's a native adapter if (handlerId.StartsWith(NativeAdapterDiscoveryService.NativePrefix, StringComparison.OrdinalIgnoreCase)) { - var properties = nativeAdapterDiscovery.GetExpectedStartupValues(handlerId); - mustProps = properties.Where(p => p.Value.EndsWith(" *")).Select(p => p.Key); + var properties = nativeAdapterDiscovery.GetStartupValues(handlerId); + mustProps = properties.Where(p => !p.Value.Optional).Select(p => p.Key); } else { @@ -219,8 +219,8 @@ public Validate(BitweenDbContext dbContext, IHttpContextAccessor httpContextAcce // Check if it's a native adapter if (model.ReceiverId.StartsWith(NativeAdapterDiscoveryService.NativePrefix, StringComparison.OrdinalIgnoreCase)) { - var properties = nativeAdapterDiscovery.GetExpectedStartupValues(model.ReceiverId); - mustProps = properties.Where(p => p.Value.EndsWith(" *")).Select(p => p.Key); + var properties = nativeAdapterDiscovery.GetStartupValues(model.ReceiverId); + mustProps = properties.Where(p => !p.Value.Optional).Select(p => p.Key); } else {