diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15d212e..ce999a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: dotnet-version: | 3.1.x 6.0.x + 8.0.x - name: Cleaning run: dotnet clean @@ -50,7 +51,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + global-json-file: global.json - name: Cleaning run: dotnet clean diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b4fcd9..8dd4359 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,7 @@ jobs: dotnet-version: | 3.1.x 6.0.x + 8.0.x - name: Cleaning run: dotnet clean @@ -49,7 +50,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + global-json-file: global.json - name: Cleaning run: dotnet clean diff --git a/global.json b/global.json index dc98c6e..5ce8495 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.401" + "version": "8.0.100" } -} \ No newline at end of file +} diff --git a/sdk/EAVFW.Extensions.Manifest.SDK.csproj b/sdk/EAVFW.Extensions.Manifest.SDK.csproj index 528ca27..6b5df2a 100644 --- a/sdk/EAVFW.Extensions.Manifest.SDK.csproj +++ b/sdk/EAVFW.Extensions.Manifest.SDK.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net6.0 + netcoreapp3.1;net6.0;net8.0 disable disable @@ -20,7 +20,6 @@ - @@ -32,4 +31,8 @@ + + + + diff --git a/sdk/ManifestEnricher.cs b/sdk/ManifestEnricher.cs index a33b354..8451f01 100644 --- a/sdk/ManifestEnricher.cs +++ b/sdk/ManifestEnricher.cs @@ -1,7 +1,4 @@ -using DotNETDevOps.JsonFunctions; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -650,10 +647,9 @@ bool ConvertToSchemaType(JToken attrType, out JToken type) foreach (var attr in (entityValue.SelectToken("$.attributes") as JObject)?.Properties() ?? Enumerable.Empty()) { - var attrValue = attr.Value as JObject; - var attrType = attrValue.SelectToken("$.type"); - + if(!(attr.Value is JObject attrValue)) continue; + var attrType = attrValue.SelectToken("$.type"); if (!ConvertToSchemaType(attrType, out var type)) continue; @@ -722,7 +718,12 @@ JObject SetDefault(JToken obj, JObject localeEnglish) } } - var queue = new Queue(attributes.Properties().Select(c => c.Value as JObject)); + var queue = + new Queue( + attributes.Properties() + .Select(c => c.Value as JObject) + .Where(x => x != null) + ); foreach (var attribute in attributes.Properties()) { @@ -851,7 +852,7 @@ JObject SetDefault(JToken obj, JObject localeEnglish) } - foreach (var attr in attributes.Properties()) + foreach (var attr in attributes.Properties().Where(x => x.Value.Type == JTokenType.Object)) { var attributeLocaleEnglish = new JObject(new JProperty("displayName", attr.Value["displayName"])); var attributeLocale = attr.Value.SelectToken("$.locale") as JObject ?? SetDefault(attr.Value, attributeLocaleEnglish); @@ -876,4 +877,4 @@ private void SetRequiredProps(JObject entity, string key) entity["collectionSchemaName"] = schemaName.ToSchemaName(entity["pluralName"]?.ToString()); } } -} \ No newline at end of file +} diff --git a/src/EAVFramework.csproj b/src/EAVFramework.csproj index 0f92577..be1cc95 100644 --- a/src/EAVFramework.csproj +++ b/src/EAVFramework.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1;net6.0 + netcoreapp3.1;net6.0;net8.0 EAVFramework Poul Kjeldager EAVFW @@ -35,11 +35,17 @@ + + + + + +