From 9a26e80e3e3cf044ed880908c0605ee549394f4e Mon Sep 17 00:00:00 2001 From: Stepan Grankin Date: Tue, 11 Jun 2024 10:59:45 +0300 Subject: [PATCH] used preregistered JsonSerializerOptions with JsonSerializerDefaults.Web to serialize answer at camelCase naming policy --- Dodo1000Bot.Messengers.Telegram/TelegramController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dodo1000Bot.Messengers.Telegram/TelegramController.cs b/Dodo1000Bot.Messengers.Telegram/TelegramController.cs index b4c4be4..3f31fe3 100644 --- a/Dodo1000Bot.Messengers.Telegram/TelegramController.cs +++ b/Dodo1000Bot.Messengers.Telegram/TelegramController.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System.Text.Json; +using System.Threading.Tasks; using Dodo1000Bot.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -10,10 +11,11 @@ public class TelegramController : MessengerController { private readonly ITelegramService _telegramService; - public TelegramController(ILogger log, ITelegramService telegramService, TelegramConfiguration configuration) + public TelegramController(ILogger log, ITelegramService telegramService, TelegramConfiguration configuration, JsonSerializerOptions jsonOptions) : base(log, telegramService, configuration) { _telegramService = telegramService; + SerializerSettings = jsonOptions; } [HttpGet("TestTelegramApi")]