Skip to content

Commit 447ceb6

Browse files
authored
Merge pull request #130 from Zechiax/net8-upgrade
.NET 8 upgrade, fix unit tests
2 parents 826da41 + 4ef8479 commit 447ceb6

File tree

9 files changed

+17
-14
lines changed

9 files changed

+17
-14
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
dotnet: [ '6.0.x', '8.0.x' ]
16+
dotnet: [ '8.0.x' ]
1717
steps:
1818
- uses: actions/checkout@v4
1919
- name: Setup .NET

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup dotnet
1414
uses: actions/setup-dotnet@v4
1515
with:
16-
dotnet-version: '6.0.x'
16+
dotnet-version: '8.0.x'
1717

1818
# Publish
1919
- name: publish on version change

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Dotnet Setup
3737
uses: actions/setup-dotnet@v4
3838
with:
39-
dotnet-version: '6.x'
39+
dotnet-version: '8.x'
4040
- run: dotnet tool update -g docfx
4141
- run: dotnet build
4242
- run: docfx docfx.json

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ C# Wrapper for the [Modrinth API](https://docs.modrinth.com/)
1717
- Retry count is configurable
1818
- No dependencies
1919
- Fully documented
20-
- Support for .NET 6.0 and newer
20+
- Support for .NET 8.0 and newer
2121

2222
## Usage
2323

src/Modrinth.Net/Http/Requester.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ public class Requester : IRequester
1818
Converters =
1919
{
2020
new ColorConverter(),
21-
new JsonStringEnumConverter()
22-
}
21+
new JsonStringEnumConverter(namingPolicy: JsonNamingPolicy.SnakeCaseLower)
22+
},
23+
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower
2324
};
2425

2526
/// <summary>
@@ -83,8 +84,7 @@ public async Task<T> GetJsonAsync<T>(HttpRequestMessage request, CancellationTok
8384
}
8485
catch (JsonException e)
8586
{
86-
throw new ModrinthApiException($"Response could not be deserialize for Path {e.Path} | URL {request.RequestUri} | Response {response.StatusCode}",
87-
response, innerException: e);
87+
throw new ModrinthApiException($"Response could not be deserialize for Path {e.Path} | URL {request.RequestUri} | Response {response.StatusCode} | Data {await response.Content.ReadAsStringAsync(cancellationToken)}", response, innerException: e);
8888
}
8989
}
9090

src/Modrinth.Net/Models/Enums/NotificationType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public enum NotificationType
2020
/// <summary>
2121
/// Project status update
2222
/// </summary>
23-
[JsonPropertyName("status_update")] StatusChange,
23+
[JsonPropertyName("status_change")] StatusChange,
2424

2525
/// <summary>
2626
/// Moderator message

src/Modrinth.Net/Modrinth.Net.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
1515
<PackageVersion>3.4.5</PackageVersion>
1616
<Version>$(PackageVersion)</Version>
17-
<TargetFramework>net6.0</TargetFramework>
17+
<TargetFramework>net8.0</TargetFramework>
1818
<RootNamespace>Modrinth</RootNamespace>
1919
<RepositoryType>git</RepositoryType>
2020
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2121
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
22+
<LangVersion>12</LangVersion>
2223
</PropertyGroup>
2324

2425
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">

test/Modrinth.Net.Test/Modrinth.Net.Test.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

88
<IsPackable>false</IsPackable>
9+
10+
<LangVersion>12</LangVersion>
911
</PropertyGroup>
1012

1113
<ItemGroup>

test/Modrinth.Net.Test/ModrinthApiTests/EndpointTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ public class EndpointTests
1212

1313
protected static readonly string[] ValidSha512Hashes =
1414
{
15-
"bace1768e893e60574dcb1155e057a2fd0da3f3400c862a93c37dfe4d7908de1739b3b72190353f1a2a981ec18e1175d1dcf2109f0fb64ffdc73c45629a4cf55",
16-
"3651e6cdb1dbb46580f27386caa01c88d28e51a5feec57cc435be73be25d718da9a719798e2b887e0fde14b6eaa970f30ee7220ff1f81489acd6174840c34d06"
15+
"11732c4e36c3909360a24aa42a44da89048706cf10aaafa0404d7153cbc7395ff68a130f7b497828d6932740e004416b692650c3fbcc1f32babd7cb6eb9791d8",
16+
"bffb4f0b5347ddcf85ee5d12a6a771098b7bb61a3354ce4afa6bcd4ab88e438d2b05380481995eb58ec1a0404fdddd9bd27706f2782e828628fc9dd12208e501"
1717
};
1818

1919
protected static readonly string[] ValidSha1Hashes =
20-
{"8b0a4139d9e82300b7aac82f2402ec3497991c52", "429eb439f0835e31fbbfd00234ef2daa8ecc8a87"};
20+
{"43035a1c6f506285a9910bc8038d1b1b925f8dd1", "2f73c4a26c553bf0f0d2f921dd5a09ed90c515d8"};
2121

2222
private static readonly IConfigurationRoot Configuration =
2323
new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

0 commit comments

Comments
 (0)