diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6bdcd78..8f4756c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,10 +14,12 @@ jobs:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- - name: Setup .Net 7.0.x
+ - name: Setup .Net
uses: actions/setup-dotnet@v3
with:
- dotnet-version: '7.0.x'
+ dotnet-version: |
+ 7.0.x
+ 8.0.x
- uses: actions/checkout@v4
- name: Restore
run: dotnet restore --nologo
@@ -32,10 +34,10 @@ jobs:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- uses: actions/checkout@v4
- - name: Setup .Net 7.0.x
+ - name: Setup .Net 8.0.x
uses: actions/setup-dotnet@v3
with:
- dotnet-version: '7.0.x'
+ dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore --nologo
- name: .Net Format
diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml
index 878f311..d701298 100644
--- a/.github/workflows/nightly-release.yml
+++ b/.github/workflows/nightly-release.yml
@@ -11,10 +11,12 @@ jobs:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- - name: Setup .Net 7.0.x
+ - name: Setup .Net
uses: actions/setup-dotnet@v3
with:
- dotnet-version: '7.0.x'
+ dotnet-version: |
+ 7.0.x
+ 8.0.x
- uses: actions/checkout@v4
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml
index c07dd67..cbc4fb9 100644
--- a/.github/workflows/pr-build.yml
+++ b/.github/workflows/pr-build.yml
@@ -14,10 +14,12 @@ jobs:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- - name: Setup .Net 7.0.x
+ - name: Setup .Net
uses: actions/setup-dotnet@v3
with:
- dotnet-version: '7.0.x'
+ dotnet-version: |
+ 7.0.x
+ 8.0.x
- uses: actions/checkout@v4
- name: Restore
run: dotnet restore --nologo
@@ -32,10 +34,10 @@ jobs:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- uses: actions/checkout@v4
- - name: Setup .Net 7.0.x
+ - name: Setup .Net 8.0.x
uses: actions/setup-dotnet@v3
with:
- dotnet-version: '7.0.x'
+ dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore --nologo
- name: .Net Format
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a6f9299..1575c6f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -13,10 +13,12 @@ jobs:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- - name: Setup .Net 7.0.x
+ - name: Setup .Net
uses: actions/setup-dotnet@v3
with:
- dotnet-version: '7.0.x'
+ dotnet-version: |
+ 7.0.x
+ 8.0.x
- uses: actions/checkout@v4
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
diff --git a/README.md b/README.md
index 383315b..8d012a6 100644
--- a/README.md
+++ b/README.md
@@ -113,6 +113,10 @@ public partial class MyJsonSerializerContext : JsonSerializerContext
// register generated converters to options
UsePolymorphicConverters(s_defaultOptions.Converters);
UseEnumConverters(s_defaultOptions.Converters);
+
+#if NET8_0_OR_GREATER
+ Default = new MyJsonSerializerContext(new System.Text.Json.JsonSerializerOptions(s_defaultOptions));
+#endif
}
}
```
diff --git a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests.csproj b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests.csproj
index 004ddb2..b1ca404 100644
--- a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests.csproj
+++ b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests.csproj
@@ -1,8 +1,8 @@
- net7.0
- 11.0
+ net7.0;net8.0
+ 12.0
enable
Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.Tests
false
@@ -12,7 +12,7 @@
-
+
all
diff --git a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.csproj b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.csproj
index ff3a678..85104ae 100644
--- a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.csproj
+++ b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.csproj
@@ -1,8 +1,8 @@
- net7.0
- 11.0
+ net7.0;net8.0
+ 12.0
enable
Aviationexam.GeneratedJsonConverters.SourceGenerator.Target
false
@@ -25,8 +25,12 @@
-
+
+
+
+
+
diff --git a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/MyJsonSerializerContext.cs b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/MyJsonSerializerContext.cs
index 59a5ba2..f3b64f5 100644
--- a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/MyJsonSerializerContext.cs
+++ b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Target/MyJsonSerializerContext.cs
@@ -2,6 +2,9 @@
using Aviationexam.GeneratedJsonConverters.SourceGenerator.Target.ContractWithCustomDelimiter;
using System.Collections.Generic;
using System.Text.Json.Serialization;
+#if NET8_0_OR_GREATER
+using System.Text.Json;
+#endif
namespace Aviationexam.GeneratedJsonConverters.SourceGenerator.Target;
@@ -31,5 +34,9 @@ static MyJsonSerializerContext()
{
UsePolymorphicConverters(s_defaultOptions.Converters);
UseEnumConverters(s_defaultOptions.Converters);
+
+#if NET8_0_OR_GREATER
+ Default = new MyJsonSerializerContext(new JsonSerializerOptions(s_defaultOptions));
+#endif
}
}
diff --git a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests.csproj b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests.csproj
index c1df225..e6b34de 100644
--- a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests.csproj
+++ b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests/Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests.csproj
@@ -1,8 +1,8 @@
- net7.0
- 11.0
+ net7.0;net8.0
+ 12.0
enable
Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests
false
@@ -17,7 +17,7 @@
-
+
diff --git a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator/Aviationexam.GeneratedJsonConverters.SourceGenerator.csproj b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator/Aviationexam.GeneratedJsonConverters.SourceGenerator.csproj
index 776aeba..616ff98 100644
--- a/src/Aviationexam.GeneratedJsonConverters.SourceGenerator/Aviationexam.GeneratedJsonConverters.SourceGenerator.csproj
+++ b/src/Aviationexam.GeneratedJsonConverters.SourceGenerator/Aviationexam.GeneratedJsonConverters.SourceGenerator.csproj
@@ -2,7 +2,7 @@
netstandard2.0
- 11.0
+ 12.0
enable
Aviationexam.GeneratedJsonConverters.SourceGenerator
true
@@ -31,7 +31,7 @@
-
+