Добавлен парсинг EnumMember
All checks were successful
Release / pack-and-publish (release) Successful in 32s
All checks were successful
Release / pack-and-publish (release) Successful in 32s
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using YandexMusic.API.Extensions;
|
||||
using YandexMusic.API.Models.Landing.Entity.Entities;
|
||||
|
||||
namespace YandexMusic.API.Models.Landing.Entity;
|
||||
@@ -26,7 +27,8 @@ public class YLandingEntityConverter : JsonConverter<List<YLandingEntity>>
|
||||
|
||||
var typeProp = root.GetProperty("type");
|
||||
var typeStr = typeProp.GetString();
|
||||
if (!Enum.TryParse<YLandingEntityType>(typeStr, true, out var entityType))
|
||||
|
||||
if (!EnumHelper.TryEnumFromMemberValue<YLandingEntityType>(typeStr, true, out var entityType))
|
||||
throw new JsonException($"Неизвестный тип сущности: {typeStr}");
|
||||
|
||||
YLandingEntity? entity = null;
|
||||
|
||||
Reference in New Issue
Block a user