From 766b7fe37c3e0ff15460e78481d869cd0bacf22c Mon Sep 17 00:00:00 2001
From: Zechiax <106590288+Zechiax@users.noreply.github.com>
Date: Wed, 24 Jul 2024 22:05:03 +0200
Subject: [PATCH 1/7] target .net 8
---
src/Modrinth.Net/Modrinth.Net.csproj | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Modrinth.Net/Modrinth.Net.csproj b/src/Modrinth.Net/Modrinth.Net.csproj
index a596cfe..9801f7d 100644
--- a/src/Modrinth.Net/Modrinth.Net.csproj
+++ b/src/Modrinth.Net/Modrinth.Net.csproj
@@ -14,11 +14,12 @@
README.md
3.4.5
$(PackageVersion)
- net6.0
+ net8.0
Modrinth
git
true
false
+ 12
From 57e9692a6bc52663a44121beaa764ed170bd0807 Mon Sep 17 00:00:00 2001
From: Zechiax <106590288+Zechiax@users.noreply.github.com>
Date: Wed, 24 Jul 2024 22:08:08 +0200
Subject: [PATCH 2/7] test project target .net 8
---
test/Modrinth.Net.Test/Modrinth.Net.Test.csproj | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/Modrinth.Net.Test/Modrinth.Net.Test.csproj b/test/Modrinth.Net.Test/Modrinth.Net.Test.csproj
index b515b75..502e166 100644
--- a/test/Modrinth.Net.Test/Modrinth.Net.Test.csproj
+++ b/test/Modrinth.Net.Test/Modrinth.Net.Test.csproj
@@ -1,11 +1,13 @@
- net6.0
+ net8.0
enable
enable
false
+
+ 12
From 2544e90cb49a37a9b7431c167bc511cb7c9590bb Mon Sep 17 00:00:00 2001
From: Zechiax <106590288+Zechiax@users.noreply.github.com>
Date: Wed, 24 Jul 2024 22:10:23 +0200
Subject: [PATCH 3/7] set naming policy to kebab lowercase
---
src/Modrinth.Net/Http/Requester.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Modrinth.Net/Http/Requester.cs b/src/Modrinth.Net/Http/Requester.cs
index 744b9ab..286a873 100644
--- a/src/Modrinth.Net/Http/Requester.cs
+++ b/src/Modrinth.Net/Http/Requester.cs
@@ -19,7 +19,8 @@ public class Requester : IRequester
{
new ColorConverter(),
new JsonStringEnumConverter()
- }
+ },
+ PropertyNamingPolicy = JsonNamingPolicy.KebabCaseLower
};
///
From 075c2c4c4dff4003f250fe59d951ea8387ba272d Mon Sep 17 00:00:00 2001
From: Zechiax <106590288+Zechiax@users.noreply.github.com>
Date: Wed, 24 Jul 2024 22:22:20 +0200
Subject: [PATCH 4/7] fix notification name
---
src/Modrinth.Net/Models/Enums/NotificationType.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Modrinth.Net/Models/Enums/NotificationType.cs b/src/Modrinth.Net/Models/Enums/NotificationType.cs
index 3b7d890..b94ca04 100644
--- a/src/Modrinth.Net/Models/Enums/NotificationType.cs
+++ b/src/Modrinth.Net/Models/Enums/NotificationType.cs
@@ -20,7 +20,7 @@ public enum NotificationType
///
/// Project status update
///
- [JsonPropertyName("status_update")] StatusChange,
+ [JsonPropertyName("status_change")] StatusChange,
///
/// Moderator message
From 2b4c606a990c53d643e10784855b010d8d2e4f99 Mon Sep 17 00:00:00 2001
From: Zechiax <106590288+Zechiax@users.noreply.github.com>
Date: Wed, 24 Jul 2024 22:35:43 +0200
Subject: [PATCH 5/7] use lower snake-case naming policy for enums
---
src/Modrinth.Net/Http/Requester.cs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/Modrinth.Net/Http/Requester.cs b/src/Modrinth.Net/Http/Requester.cs
index 286a873..ba08711 100644
--- a/src/Modrinth.Net/Http/Requester.cs
+++ b/src/Modrinth.Net/Http/Requester.cs
@@ -18,9 +18,9 @@ public class Requester : IRequester
Converters =
{
new ColorConverter(),
- new JsonStringEnumConverter()
+ new JsonStringEnumConverter(namingPolicy: JsonNamingPolicy.SnakeCaseLower)
},
- PropertyNamingPolicy = JsonNamingPolicy.KebabCaseLower
+ PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower
};
///
@@ -84,8 +84,7 @@ public async Task GetJsonAsync(HttpRequestMessage request, CancellationTok
}
catch (JsonException e)
{
- throw new ModrinthApiException($"Response could not be deserialize for Path {e.Path} | URL {request.RequestUri} | Response {response.StatusCode}",
- response, innerException: e);
+ 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);
}
}
From 08796676b97db3c374861d2af9340857f71f6ca2 Mon Sep 17 00:00:00 2001
From: Zechiax <106590288+Zechiax@users.noreply.github.com>
Date: Mon, 9 Sep 2024 15:07:22 +0200
Subject: [PATCH 6/7] fix version file tests
---
README.md | 2 +-
test/Modrinth.Net.Test/ModrinthApiTests/EndpointTests.cs | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index fe0eaf7..a7e6548 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ C# Wrapper for the [Modrinth API](https://docs.modrinth.com/)
- Retry count is configurable
- No dependencies
- Fully documented
-- Support for .NET 6.0 and newer
+- Support for .NET 8.0 and newer
## Usage
diff --git a/test/Modrinth.Net.Test/ModrinthApiTests/EndpointTests.cs b/test/Modrinth.Net.Test/ModrinthApiTests/EndpointTests.cs
index 84bc0ad..296c0cd 100644
--- a/test/Modrinth.Net.Test/ModrinthApiTests/EndpointTests.cs
+++ b/test/Modrinth.Net.Test/ModrinthApiTests/EndpointTests.cs
@@ -12,12 +12,12 @@ public class EndpointTests
protected static readonly string[] ValidSha512Hashes =
{
- "bace1768e893e60574dcb1155e057a2fd0da3f3400c862a93c37dfe4d7908de1739b3b72190353f1a2a981ec18e1175d1dcf2109f0fb64ffdc73c45629a4cf55",
- "3651e6cdb1dbb46580f27386caa01c88d28e51a5feec57cc435be73be25d718da9a719798e2b887e0fde14b6eaa970f30ee7220ff1f81489acd6174840c34d06"
+ "11732c4e36c3909360a24aa42a44da89048706cf10aaafa0404d7153cbc7395ff68a130f7b497828d6932740e004416b692650c3fbcc1f32babd7cb6eb9791d8",
+ "bffb4f0b5347ddcf85ee5d12a6a771098b7bb61a3354ce4afa6bcd4ab88e438d2b05380481995eb58ec1a0404fdddd9bd27706f2782e828628fc9dd12208e501"
};
protected static readonly string[] ValidSha1Hashes =
- {"8b0a4139d9e82300b7aac82f2402ec3497991c52", "429eb439f0835e31fbbfd00234ef2daa8ecc8a87"};
+ {"43035a1c6f506285a9910bc8038d1b1b925f8dd1", "2f73c4a26c553bf0f0d2f921dd5a09ed90c515d8"};
private static readonly IConfigurationRoot Configuration =
new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
From 4ef8479e3144003b466279c62769920b79a95750 Mon Sep 17 00:00:00 2001
From: Zechiax <106590288+Zechiax@users.noreply.github.com>
Date: Mon, 9 Sep 2024 15:09:08 +0200
Subject: [PATCH 7/7] update workflow configs
---
.github/workflows/dotnet.yml | 2 +-
.github/workflows/publish.yml | 2 +-
.github/workflows/static.yml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index d5148b2..5aeeeaa 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- dotnet: [ '6.0.x', '8.0.x' ]
+ dotnet: [ '8.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 3f0f1d6..0cd5e87 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -13,7 +13,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
- dotnet-version: '6.0.x'
+ dotnet-version: '8.0.x'
# Publish
- name: publish on version change
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index 92c05ff..f023772 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -36,7 +36,7 @@ jobs:
- name: Dotnet Setup
uses: actions/setup-dotnet@v4
with:
- dotnet-version: '6.x'
+ dotnet-version: '8.x'
- run: dotnet tool update -g docfx
- run: dotnet build
- run: docfx docfx.json