Skip to content

Commit

Permalink
Default to camelCase use snake_case for status endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-r-elp committed Oct 5, 2024
1 parent 353998f commit a67a9c7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
using BeatTogether.Status.Api.Controllers.Enums;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace BeatTogether.Status.Api.Controllers.Models
{
public record MasterServerStatusData(
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]

public record MasterServerStatusData(
string minimumAppVersion,
AvailabilityStatus status,
long maintenanceStartTime,
Expand Down
8 changes: 6 additions & 2 deletions BeatTogether.Status.Api.Controllers/Models/RequiredMod.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
namespace BeatTogether.Status.Api.Controllers.Models
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;

namespace BeatTogether.Status.Api.Controllers.Models
{
public record RequiredMod
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public record RequiredMod
{
/// <summary>
/// BSIPA Mod ID
Expand Down
6 changes: 5 additions & 1 deletion BeatTogether.Status.Api.Controllers/Models/UserMessage.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;

namespace BeatTogether.Status.Api.Controllers.Models
{
public record UserMessage(List<LocalizedMessage> localizedMessages);
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public record UserMessage(List<LocalizedMessage> localizedMessages);
}
2 changes: 1 addition & 1 deletion BeatTogether.Status.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver
{
NamingStrategy = new SnakeCaseNamingStrategy()
NamingStrategy = new CamelCaseNamingStrategy()
};
})
)
Expand Down
10 changes: 9 additions & 1 deletion BeatTogether.Status.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
"MaxPlayers": 30,
"ServerSupportsPPModifiers": true,
"ServerSupportsPPDifficulties": true,
"ServerSupportsPPMaps": false
"ServerSupportsPPMaps": false,
"MaintenanceStartTime": 0,
"MaintenanceEndTime": 0,
"LocalizedMessages": [
{
"Language": 0,
"Message": "Going down for maintenance, check announcements channel on the BeatTogether discord for more info."
}
]
},
"Quickplay": {
"PredefinedPacks": [
Expand Down

0 comments on commit a67a9c7

Please sign in to comment.