Skip to content

Commit b6b5776

Browse files
committed
Add JsonExtensionData to root JSON classes
1 parent 2a7caf3 commit b6b5776

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

src/RootJson.cs

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class CommentRootJson : JsonBase
66
public CommentJson Comment { get; set; }
77
}
88

9-
public class FiltersRootJson
9+
public class FiltersRootJson : JsonBase
1010
{
1111
[JsonPropertyName("filters")]
1212
public FilterJson[] Filters { get; set; }
@@ -15,7 +15,7 @@ public class FiltersRootJson
1515
public int Total { get; set; }
1616
}
1717

18-
public class ForumsRootJson
18+
public class ForumsRootJson : JsonBase
1919
{
2020
[JsonPropertyName("forums")]
2121
public ForumJson[] Forums { get; set; }
@@ -24,47 +24,61 @@ public class ForumsRootJson
2424
public int Total { get; set; }
2525
}
2626

27-
public class GallerySearchRoot
27+
public class GallerySearchRoot : JsonBase
2828
{
2929
[JsonPropertyName("galleries")]
3030
public GalleryJson[] Galleries { get; set; }
31+
32+
[JsonPropertyName("total")]
33+
public int Total { get; set; }
3134
}
3235

33-
public class ImageRootJson
36+
public class ImageRootJson : JsonBase
3437
{
3538
[JsonPropertyName("image")]
3639
public ImageJson Image { get; set; }
40+
41+
[JsonPropertyName("interactions")]
42+
public InteractionJson[] Interactions { get; set; }
3743
}
3844

39-
public class ImageSearchRootJson
45+
public class ImageSearchRootJson : JsonBase
4046
{
4147
[JsonPropertyName("images")]
4248
public ImageJson[] Images { get; set; }
49+
4350
[JsonPropertyName("interactions")]
4451
public InteractionJson[] Interactions { get; set; }
52+
4553
[JsonPropertyName("total")]
4654
public int Total { get; set; }
4755
}
4856

49-
public class PostSearchRootJson
57+
public class PostSearchRootJson : JsonBase
5058
{
5159
[JsonPropertyName("posts")]
5260
public PostJson[] Posts { get; set; }
61+
62+
[JsonPropertyName("total")]
63+
public int Total { get; set; }
5364
}
5465

55-
public class ProfileRootJson
66+
public class ProfileRootJson : JsonBase
5667
{
5768
[JsonPropertyName("user")]
5869
public UserJson User { get; set; }
5970
}
6071

61-
public class TagSearchRootJson
72+
public class TagSearchRootJson : JsonBase
6273
{
6374
[JsonPropertyName("tags")]
6475
public TagJson[] Tags { get; set; }
76+
77+
[JsonPropertyName("total")]
78+
public int Total { get; set; }
6579
}
6680

67-
public class TopicRootJson
81+
public class TopicRootJson : JsonBase
6882
{
6983
[JsonPropertyName("topics")]
7084
public TopicJson[] Topics { get; set; }

tests/Nullforce.Api.Derpibooru.JsonModel.Tests/Integration/DeserializationTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public async void CommentRoot_GetJson_SuccessWithoutExceptions()
4444

4545
await act.Should().NotThrowAsync();
4646
commentRoot.Should().NotBeNull();
47+
commentRoot.JsonExtensionData.Should().BeNull();
4748

4849
// Property validation
4950
comment.JsonExtensionData.Should().BeNull();
@@ -78,6 +79,7 @@ public async void GallerySearchRoot_GetJson_SuccessWithoutExceptions()
7879

7980
await act.Should().NotThrowAsync();
8081
gallerySearchRoot.Should().NotBeNull();
82+
gallerySearchRoot.JsonExtensionData.Should().BeNull();
8183

8284
// Property validation
8385
gallery.JsonExtensionData.Should().BeNull();
@@ -109,6 +111,7 @@ public async void ImageRoot_GetJson_SuccessWithoutExceptions()
109111

110112
await act.Should().NotThrowAsync();
111113
imageRoot.Should().NotBeNull();
114+
imageRoot.JsonExtensionData.Should().BeNull();
112115

113116
// Property validation
114117
image.JsonExtensionData.Should().BeNull();
@@ -184,6 +187,7 @@ public async void Oembed_GetJson_SuccessWithoutExceptions()
184187

185188
await act.Should().NotThrowAsync();
186189
oembed.Should().NotBeNull();
190+
oembed.JsonExtensionData.Should().BeNull();
187191

188192
// Property validation
189193
oembed.JsonExtensionData.Should().BeNull();
@@ -220,6 +224,7 @@ public async void PostsSearchRoot_GetJson_SuccessWithoutExceptions()
220224

221225
await act.Should().NotThrowAsync();
222226
postsRoot.Should().NotBeNull();
227+
postsRoot.JsonExtensionData.Should().BeNull();
223228

224229
// Property validation
225230
post.JsonExtensionData.Should().BeNull();
@@ -253,6 +258,7 @@ public async void ProfileRootJson_GetJson_SuccessWithoutExceptions()
253258

254259
await act.Should().NotThrowAsync();
255260
profileRoot.Should().NotBeNull();
261+
profileRoot.JsonExtensionData.Should().BeNull();
256262

257263
// Property validation
258264
user.JsonExtensionData.Should().BeNull();
@@ -303,6 +309,7 @@ public async void TagSearchRoot_GetJson_SuccessWithoutExceptions()
303309

304310
await act.Should().NotThrowAsync();
305311
tagsRoot.Should().NotBeNull();
312+
tagsRoot.JsonExtensionData.Should().BeNull();
306313

307314
// Property validation
308315
tag.JsonExtensionData.Should().BeNull();

0 commit comments

Comments
 (0)