|
1 | | -using Newtonsoft.Json; |
| 1 | +using System.Text.Json.Serialization; |
2 | 2 |
|
3 | 3 | namespace AniWorldReminder_API.Models |
4 | 4 | { |
5 | 5 | // Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse); |
6 | 6 | public class CoverImage |
7 | 7 | { |
8 | | - [JsonProperty("large")] |
| 8 | + [JsonPropertyName("large")] |
9 | 9 | public string? Large { get; set; } |
10 | 10 |
|
11 | | - [JsonProperty("medium")] |
| 11 | + [JsonPropertyName("medium")] |
12 | 12 | public string? Medium { get; set; } |
13 | 13 |
|
14 | | - [JsonProperty("color")] |
| 14 | + [JsonPropertyName("color")] |
15 | 15 | public string? Color { get; set; } |
16 | 16 | } |
17 | 17 |
|
18 | 18 | public class Data |
19 | 19 | { |
20 | | - [JsonProperty("Page")] |
| 20 | + [JsonPropertyName("Page")] |
21 | 21 | public Page? Page { get; set; } |
22 | 22 | } |
23 | 23 |
|
24 | 24 | public class EndDate |
25 | 25 | { |
26 | | - [JsonProperty("year")] |
| 26 | + [JsonPropertyName("year")] |
27 | 27 | public int? Year { get; set; } |
28 | 28 |
|
29 | | - [JsonProperty("month")] |
| 29 | + [JsonPropertyName("month")] |
30 | 30 | public int? Month { get; set; } |
31 | 31 |
|
32 | | - [JsonProperty("day")] |
| 32 | + [JsonPropertyName("day")] |
33 | 33 | public int? Day { get; set; } |
34 | 34 | } |
35 | 35 |
|
36 | 36 | public class Medium |
37 | 37 | { |
38 | | - [JsonProperty("id")] |
| 38 | + [JsonPropertyName("id")] |
39 | 39 | public int? Id { get; set; } |
40 | 40 |
|
41 | | - [JsonProperty("title")] |
| 41 | + [JsonPropertyName("title")] |
42 | 42 | public Title? Title { get; set; } |
43 | 43 |
|
44 | | - [JsonProperty("coverImage")] |
| 44 | + [JsonPropertyName("coverImage")] |
45 | 45 | public CoverImage? CoverImage { get; set; } |
46 | 46 |
|
47 | | - [JsonProperty("startDate")] |
| 47 | + [JsonPropertyName("startDate")] |
48 | 48 | public StartDate? StartDate { get; set; } |
49 | 49 |
|
50 | | - [JsonProperty("endDate")] |
| 50 | + [JsonPropertyName("endDate")] |
51 | 51 | public EndDate? EndDate { get; set; } |
52 | 52 |
|
53 | | - [JsonProperty("season")] |
| 53 | + [JsonPropertyName("season")] |
54 | 54 | public string? Season { get; set; } |
55 | 55 |
|
56 | | - [JsonProperty("seasonYear")] |
| 56 | + [JsonPropertyName("seasonYear")] |
57 | 57 | public int? SeasonYear { get; set; } |
58 | 58 |
|
59 | | - [JsonProperty("description")] |
| 59 | + [JsonPropertyName("description")] |
60 | 60 | public string? Description { get; set; } |
61 | 61 |
|
62 | | - [JsonProperty("type")] |
| 62 | + [JsonPropertyName("type")] |
63 | 63 | public string? Type { get; set; } |
64 | 64 |
|
65 | | - [JsonProperty("format")] |
| 65 | + [JsonPropertyName("format")] |
66 | 66 | public string? Format { get; set; } |
67 | 67 |
|
68 | | - [JsonProperty("status")] |
| 68 | + [JsonPropertyName("status")] |
69 | 69 | public string? Status { get; set; } |
70 | 70 |
|
71 | | - [JsonProperty("episodes")] |
| 71 | + [JsonPropertyName("episodes")] |
72 | 72 | public int? Episodes { get; set; } |
73 | 73 |
|
74 | | - [JsonProperty("duration")] |
| 74 | + [JsonPropertyName("duration")] |
75 | 75 | public int? Duration { get; set; } |
76 | 76 |
|
77 | | - [JsonProperty("genres")] |
| 77 | + [JsonPropertyName("genres")] |
78 | 78 | public List<string>? Genres { get; set; } |
79 | 79 |
|
80 | | - [JsonProperty("isAdult")] |
| 80 | + [JsonPropertyName("isAdult")] |
81 | 81 | public bool? IsAdult { get; set; } |
82 | 82 |
|
83 | | - [JsonProperty("averageScore")] |
| 83 | + [JsonPropertyName("averageScore")] |
84 | 84 | public decimal? AverageScore { get; set; } |
85 | 85 |
|
86 | | - [JsonProperty("nextAiringEpisode")] |
| 86 | + [JsonPropertyName("nextAiringEpisode")] |
87 | 87 | public object? NextAiringEpisode { get; set; } |
88 | 88 | } |
89 | 89 |
|
90 | 90 | public class Page |
91 | 91 | { |
92 | | - [JsonProperty("pageInfo")] |
| 92 | + [JsonPropertyName("pageInfo")] |
93 | 93 | public PageInfo? PageInfo { get; set; } |
94 | 94 |
|
95 | | - [JsonProperty("media")] |
| 95 | + [JsonPropertyName("media")] |
96 | 96 | public List<Medium>? Media { get; set; } |
97 | 97 | } |
98 | 98 |
|
99 | 99 | public class PageInfo |
100 | 100 | { |
101 | | - [JsonProperty("total")] |
| 101 | + [JsonPropertyName("total")] |
102 | 102 | public int? Total { get; set; } |
103 | 103 |
|
104 | | - [JsonProperty("perPage")] |
| 104 | + [JsonPropertyName("perPage")] |
105 | 105 | public int? PerPage { get; set; } |
106 | 106 |
|
107 | | - [JsonProperty("currentPage")] |
| 107 | + [JsonPropertyName("currentPage")] |
108 | 108 | public int? CurrentPage { get; set; } |
109 | 109 |
|
110 | | - [JsonProperty("lastPage")] |
| 110 | + [JsonPropertyName("lastPage")] |
111 | 111 | public int? LastPage { get; set; } |
112 | 112 |
|
113 | | - [JsonProperty("hasNextPage")] |
| 113 | + [JsonPropertyName("hasNextPage")] |
114 | 114 | public bool? HasNextPage { get; set; } |
115 | 115 | } |
116 | 116 |
|
117 | 117 | public class AniListSearchMediaResponseModel |
118 | 118 | { |
119 | | - [JsonProperty("data")] |
| 119 | + [JsonPropertyName("data")] |
120 | 120 | public Data? Data { get; set; } |
121 | 121 | } |
122 | 122 |
|
123 | 123 | public class StartDate |
124 | 124 | { |
125 | | - [JsonProperty("year")] |
| 125 | + [JsonPropertyName("year")] |
126 | 126 | public int? Year { get; set; } |
127 | 127 |
|
128 | | - [JsonProperty("month")] |
| 128 | + [JsonPropertyName("month")] |
129 | 129 | public int? Month { get; set; } |
130 | 130 |
|
131 | | - [JsonProperty("day")] |
| 131 | + [JsonPropertyName("day")] |
132 | 132 | public int? Day { get; set; } |
133 | 133 | } |
134 | 134 |
|
135 | 135 | public class Title |
136 | 136 | { |
137 | | - [JsonProperty("english")] |
| 137 | + [JsonPropertyName("english")] |
138 | 138 | public string? English { get; set; } |
139 | 139 |
|
140 | | - [JsonProperty("userPreferred")] |
| 140 | + [JsonPropertyName("userPreferred")] |
141 | 141 | public string? UserPreferred { get; set; } |
142 | 142 | } |
143 | 143 |
|
|
0 commit comments