Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up .NET 7
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7'
dotnet-version: '9'
- name: Build
run: docker build --target build .
- name: Test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up .NET 7
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7'
dotnet-version: '9'
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
- name: Build
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /source

# copy csproj and restore as distinct layers
Expand All @@ -10,12 +10,12 @@ RUN dotnet restore
# copy everything else and build app
COPY ./ ./
WORKDIR /source
RUN dotnet build -c release -o /out/package --no-restore
RUN dotnet build -c release --no-restore

FROM build as test
FROM build AS test
RUN dotnet test

FROM build as pack-and-push
FROM build AS pack-and-push
WORKDIR /source

ARG PackageVersion
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Dmitry Khmara
Copyright (c) 2025 Dmytro Khmara

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## Installation

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

## License

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

StrEnum is licensed under the [MIT license](LICENSE.txt).
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static class JsonSerializerOptionsExtensions
/// Configure System.Text.Json to serialize and deserialize string enums.
/// </summary>
/// <param name="options"></param>
/// <param name="noMemberFoundBehavior">Specifies whether to thrown an exception or use a null value for members that cannot be parsed.</param>
/// <param name="noMemberFoundBehavior">Specifies whether to throw an exception or use a null value for members that cannot be parsed.</param>
/// <returns></returns>
public static JsonSerializerOptions UseStringEnums(this JsonSerializerOptions options, NoMemberFoundBehavior noMemberFoundBehavior = NoMemberFoundBehavior.ThrowException)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="[4.6.0,8.0.0)" />
<PackageReference Include="System.Text.Json" Version="[4.6.0,10.0.0)" />
<PackageReference Include="StrEnum" Version="[2.0.0,3.0.0)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="StrEnum" Version="2.0.0" />
<PackageReference Include="System.Text.Json" Version="6.0.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="FluentAssertions" Version="8.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="StrEnum" Version="2.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down