fix json naming issue

This commit is contained in:
natan
2024-04-26 09:41:48 +02:00
parent 8625f14744
commit a937e8712e
5 changed files with 14 additions and 19 deletions
@@ -39,15 +39,11 @@ namespace Duplicati.Server.Serialization
{
JsonSettings = new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy()
},
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
Converters = new JsonConverter[]
{
new DayOfWeekConcerter(),
new StringEnumConverter { NamingStrategy = new CamelCaseNamingStrategy() },
new StringEnumConverter(),
new SerializableStatusCreator(),
new SettingsCreator(),
new FilterCreator(),
@@ -203,16 +203,16 @@ backupApp.service('ServerStatus', function ($rootScope, $timeout, AppService, Ap
function handleServerState(response) {
var oldEventId = state.lastEventId;
var anychanged =
notifyIfChanged(response.data, 'lastEventID', 'lastEventId') |
notifyIfChanged(response.data, 'lastDataUpdateID', 'lastDataUpdateId') |
notifyIfChanged(response.data, 'lastNotificationUpdateID', 'lastNotificationUpdateId') |
notifyIfChanged(response.data, 'activeTask', 'activeTask') |
notifyIfChanged(response.data, 'programState', 'programState') |
notifyIfChanged(response.data, 'estimatedPauseEnd', 'estimatedPauseEnd') |
notifyIfChanged(response.data, 'updaterState', 'updaterState') |
notifyIfChanged(response.data, 'updateDownloadLink', 'updateDownloadLink') |
notifyIfChanged(response.data, 'updatedVersion', 'updatedVersion') |
notifyIfChanged(response.data, 'updateDownloadProgress', 'updateDownloadProgress');
notifyIfChanged(response.data, 'LastEventID', 'lastEventId') |
notifyIfChanged(response.data, 'LastDataUpdateID', 'lastDataUpdateId') |
notifyIfChanged(response.data, 'LastNotificationUpdateID', 'lastNotificationUpdateId') |
notifyIfChanged(response.data, 'ActiveTask', 'activeTask') |
notifyIfChanged(response.data, 'ProgramState', 'programState') |
notifyIfChanged(response.data, 'EstimatedPauseEnd', 'estimatedPauseEnd') |
notifyIfChanged(response.data, 'UpdaterState', 'updaterState') |
notifyIfChanged(response.data, 'UpdateDownloadLink', 'updateDownloadLink') |
notifyIfChanged(response.data, 'UpdatedVersion', 'updatedVersion') |
notifyIfChanged(response.data, 'UpdateDownloadProgress', 'updateDownloadProgress');
if (!angular.equals(state.proposedSchedule, response.data.ProposedSchedule)) {
@@ -125,7 +125,7 @@ backupApp.service('SystemInfo', function($rootScope, $timeout, $cookies, AppServ
if (reload !== true) {
uiLanguage = $cookies.get('ui-locale');
if ((uiLanguage || '').trim().length == 0) {
gettextCatalog.setCurrentLanguage(state.browserLocale.code.replace("-", "_"));
gettextCatalog.setCurrentLanguage(state.BrowserLocale.Code.replace("-", "_"));
} else {
gettextCatalog.setCurrentLanguage(uiLanguage.replace("-", "_"));
}
@@ -21,8 +21,8 @@ public class DuplicatiWebserver
builder.Host.UseRESTHandlers();
builder.Services.ConfigureHttpJsonOptions(opt =>
{
opt.SerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
opt.SerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));
opt.SerializerOptions.PropertyNamingPolicy = null;
opt.SerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
builder.Services.AddControllers()
// This app gets launched by a different assembly, so we need to tell it to look in this one
@@ -1,4 +1,3 @@
using Duplicati.Library.AutoUpdater;
using Duplicati.Library.IO;
using Duplicati.Library.RestAPI;
using Duplicati.Library.RestAPI.Abstractions;