Skip to content

Commit 9a66978

Browse files
committed
RegistryInitializerService: Allow AAS-REGISTRY-3.0 type for reqistry parsing, only append "/shell-descriptors" to reqistry path, if not already there
1 parent d613967 commit 9a66978

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

src/IO.Swagger.Registry.Lib.V3/Services/RegistryInitializerService.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ public async Task InitRegistry(List<AasxCredentialsEntry> cList, DateTime timest
339339
foreach (var ep in endpoints)
340340
{
341341
var type = ep?["interface"]?.GetValue<string>();
342-
if (string.Equals(type, "AAS-REGISTRY-3.1", StringComparison.OrdinalIgnoreCase))
342+
if (string.Equals(type, "AAS-REGISTRY-3.1", StringComparison.OrdinalIgnoreCase)
343+
|| string.Equals(type, "AAS-REGISTRY-3.0", StringComparison.OrdinalIgnoreCase))
343344
{
344345
var url = ep?["protocolInformation"]?["href"]?.GetValue<string>()?.Trim();
345346
if (!string.IsNullOrWhiteSpace(url) &&
@@ -503,8 +504,16 @@ public async Task InitRegistry(List<AasxCredentialsEntry> cList, DateTime timest
503504
var watch = System.Diagnostics.Stopwatch.StartNew();
504505
var aasDescriptors = new List<AssetAdministrationShellDescriptor>();
505506
string? json = null;
506-
string? accessToken = null;
507-
requestPathGetReg = $"{greg}/shell-descriptors";
507+
string? accessToken = null;
508+
if (!greg.EndsWith("/shell-descriptors"))
509+
{
510+
requestPathGetReg = $"{greg}/shell-descriptors";
511+
}
512+
else
513+
{
514+
requestPathGetReg = greg;
515+
}
516+
508517
var userPW = "";
509518
var urlEdcWrapper = "";
510519
var replace = "";
@@ -1078,7 +1087,8 @@ private void transmitDescriptor(AssetAdministrationShellDescriptor? ad, Submodel
10781087
var json = "";
10791088
if (ad != null)
10801089
{
1081-
if (!requestPath.Contains("?", StringComparison.InvariantCulture))
1090+
if (!requestPath.Contains("?", StringComparison.InvariantCulture)
1091+
&& !requestPath.EndsWith("/shell-descriptors"))
10821092
{
10831093
requestPath += "/shell-descriptors";
10841094
}

0 commit comments

Comments
 (0)