Skip to content

Commit d0b90f3

Browse files
Add support for System.Text.Json v9. (#6)
1 parent 4052571 commit d0b90f3

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3
15-
- name: Set up .NET 7
15+
- name: Set up .NET
1616
uses: actions/setup-dotnet@v3
1717
with:
18-
dotnet-version: '7'
18+
dotnet-version: '9'
1919
- name: Build
2020
run: docker build --target build .
2121
- name: Test

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
steps:
99
- name: Checkout
1010
uses: actions/checkout@v3
11-
- name: Set up .NET 7
11+
- name: Set up .NET
1212
uses: actions/setup-dotnet@v3
1313
with:
14-
dotnet-version: '7'
14+
dotnet-version: '9'
1515
- name: Set VERSION variable from tag
1616
run: echo "VERSION=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
1717
- name: Build

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
22
WORKDIR /source
33

44
# copy csproj and restore as distinct layers
@@ -10,12 +10,12 @@ RUN dotnet restore
1010
# copy everything else and build app
1111
COPY ./ ./
1212
WORKDIR /source
13-
RUN dotnet build -c release -o /out/package --no-restore
13+
RUN dotnet build -c release --no-restore
1414

15-
FROM build as test
15+
FROM build AS test
1616
RUN dotnet test
1717

18-
FROM build as pack-and-push
18+
FROM build AS pack-and-push
1919
WORKDIR /source
2020

2121
ARG PackageVersion

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Dmitry Khmara
3+
Copyright (c) 2025 Dmytro Khmara
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Allows for [StrEnum](https://github.com/StrEnum/StrEnum/) string enum JSON serialization and deserialization with System.Text.Json.
44

5-
The package targets .NET Standard 2.0 and can be used with System.Text.Json 4.6.0-7.\*.
5+
The package targets .NET Standard 2.0 and can be used with System.Text.Json 4.6.0-9.\*.
66

77
## Installation
88

@@ -66,6 +66,6 @@ new { Name = "Cape Town Cycle Tour", Sport = Sport.RoadCycling };
6666

6767
## License
6868

69-
Copyright © 2022 [Dmitry Khmara](https://dmitrykhmara.com).
69+
Copyright © 2025 [Dmytro Khmara](https://dmytrokhmara.com).
7070

7171
StrEnum is licensed under the [MIT license](LICENSE.txt).

src/StrEnum.System.Text.Json/JsonSerializerOptionsExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class JsonSerializerOptionsExtensions
99
/// Configure System.Text.Json to serialize and deserialize string enums.
1010
/// </summary>
1111
/// <param name="options"></param>
12-
/// <param name="noMemberFoundBehavior">Specifies whether to thrown an exception or use a null value for members that cannot be parsed.</param>
12+
/// <param name="noMemberFoundBehavior">Specifies whether to throw an exception or use a null value for members that cannot be parsed.</param>
1313
/// <returns></returns>
1414
public static JsonSerializerOptions UseStringEnums(this JsonSerializerOptions options, NoMemberFoundBehavior noMemberFoundBehavior = NoMemberFoundBehavior.ThrowException)
1515
{

src/StrEnum.System.Text.Json/StrEnum.System.Text.Json.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="System.Text.Json" Version="[4.6.0,8.0.0)" />
21+
<PackageReference Include="System.Text.Json" Version="[4.6.0,10.0.0)" />
2222
<PackageReference Include="StrEnum" Version="[2.0.0,3.0.0)" />
2323
</ItemGroup>
2424

test/StrEnum.System.Text.Json.IntegrationTests/StrEnum.System.Text.Json.IntegrationTests.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66

77
<IsPackable>false</IsPackable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="FluentAssertions" Version="6.6.0" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
13-
<PackageReference Include="StrEnum" Version="2.0.0" />
14-
<PackageReference Include="System.Text.Json" Version="6.0.4" />
15-
<PackageReference Include="xunit" Version="2.4.1" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
11+
<PackageReference Include="FluentAssertions" Version="8.4.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
13+
<PackageReference Include="StrEnum" Version="2.0.2" />
14+
<PackageReference Include="System.Text.Json" Version="8.0.5" />
15+
<PackageReference Include="xunit" Version="2.9.3" />
16+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
<PrivateAssets>all</PrivateAssets>
1919
</PackageReference>
20-
<PackageReference Include="coverlet.collector" Version="3.1.0">
20+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
<PrivateAssets>all</PrivateAssets>
2323
</PackageReference>

0 commit comments

Comments
 (0)