Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix Json Capitalisation #166

Merged
merged 1 commit into from
Mar 21, 2024
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 src/Domain/Entities/LeaderboardUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

public class LeaderboardUser
{
public string Name { get; set; } = null!;
public string Email { get; set; } = null!;
public required string Name { get; set; }
public required string Email { get; set; }

public int LastMonth { get; set; }
public int LastYear { get; set; }
Expand Down
4 changes: 4 additions & 0 deletions src/WebAPI/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public static IServiceCollection AddWebApi(
services.AddHttpContextAccessor();
services.AddScoped<ICurrentUserService, CurrentUserService>();

services.ConfigureHttpJsonOptions(options =>
{
options.SerializerOptions.PropertyNamingPolicy = null; // Override camelCase with PascalCase
});
services.AddSingleton<SignalRHubFilter>();

services.AddSignalR(options => options.AddFilter<SignalRHubFilter>());
Expand Down
2 changes: 1 addition & 1 deletion src/WebAPI/Routes/LeaderboardRoutes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class LeaderboardRoutes
{
public static void MapLeaderboardRoutes(this WebApplication app)
{
var routeGroup = app.MapGroup("").WithTags("Leaderboard");
var routeGroup = app.MapGroup("leaderboard").WithTags("Leaderboard");

routeGroup
.MapGet(
Expand Down
10 changes: 10 additions & 0 deletions src/WebUI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"(Watch)": {
"commandName": "Executable",
"executablePath": "dotnet",
"workingDirectory": "$(ProjectDir)",
"commandLineArgs": "watch run",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_WATCH_RESTART_ON_RUDE_EDIT": "true"
}
}
}
}
4 changes: 2 additions & 2 deletions src/WebUI/RulesGptApiClients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings()

var urlBuilder_ = new System.Text.StringBuilder();

// Operation Path: "getLeaderboardStats"
urlBuilder_.Append("getLeaderboardStats");
// Operation Path: "leaderboard/getLeaderboardStats"
urlBuilder_.Append("leaderboard/getLeaderboardStats");

PrepareRequest(client_, request_, urlBuilder_);

Expand Down
Loading