File tree Expand file tree Collapse file tree 5 files changed +132
-0
lines changed
test/docfx.Tests/SerializationTests
TestData/MetadataJsonConfig Expand file tree Collapse file tree 5 files changed +132
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ private static bool IsSupported()
91
91
{
92
92
// TODO: Return `true` for types that support serialize/deserializenon with System.Text.Json.
93
93
case "Docfx.BuildJsonConfig" :
94
+ case "Docfx.MetadataJsonConfig" :
94
95
case "Docfx.MergeJsonConfig" :
95
96
96
97
case "Docfx.Build.Engine.XRefMap" :
Original file line number Diff line number Diff line change @@ -272,6 +272,9 @@ internal class MetadataJsonItemConfig
272
272
/// </summary>
273
273
internal class MetadataJsonConfig : List < MetadataJsonItemConfig >
274
274
{
275
+ // Constructor that required for System.Text.Json deserialization.
276
+ public MetadataJsonConfig ( ) { }
277
+
275
278
/// <summary>
276
279
/// Initializes a new instance of the <see cref="MetadataJsonConfig"/> class.
277
280
/// </summary>
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+ using Docfx ;
5
+ using Docfx . Common ;
6
+ using FluentAssertions ;
7
+
8
+ namespace docfx . Tests ;
9
+
10
+ public partial class JsonSerializationTest
11
+ {
12
+ [ Theory ]
13
+ [ TestData < MetadataJsonConfig > ]
14
+ public void JsonSerializationTest_MetadataJsonConfig ( string path )
15
+ {
16
+ // Arrange
17
+ var model = TestData . Load < MetadataJsonConfig > ( path ) ;
18
+
19
+ // Act/Assert
20
+ ValidateJsonRoundTrip ( model ) ;
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "src" : [
4
+ {
5
+ "files" : [
6
+ " assembly/bin/**/*.dll" ,
7
+ " project/**/*.csproj" ,
8
+ " solution/**/*.sln" ,
9
+ " csharp/**/*.cs" ,
10
+ " vb/**/*.vb"
11
+ ],
12
+ "exclude" : [
13
+ " project/Project.Core/**"
14
+ ],
15
+ "src" : " dotnet"
16
+ }
17
+ ],
18
+ "output" : " obj/api" ,
19
+ "outputFormat" : " apiPage" ,
20
+ "shouldSkipMarkup" : false ,
21
+ "references" : [
22
+ " refs/dummy.dll"
23
+ ],
24
+ "filter" : " filterConfig.yml" ,
25
+ "includePrivateMembers" : true ,
26
+ "includeExplicitInterfaceImplementations" : true ,
27
+ "globalNamespaceId" : " Global" ,
28
+ "properties" : {
29
+ "DefineConstants" : " dummy1, dummy2" ,
30
+ "TargetFrameworks" : " dummy"
31
+ },
32
+ "disableGitFeatures" : false ,
33
+ "codeSourceBasePath" : " dummy" ,
34
+ "disableDefaultFilter" : true ,
35
+ "noRestore" : true ,
36
+ "categoryLayout" : " nested" ,
37
+ "namespaceLayout" : " nested" ,
38
+ "memberLayout" : " separatePages" ,
39
+ "enumSortOrder" : " declaringOrder" ,
40
+ "allowCompilationErrors" : true
41
+ }
42
+ ]
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "src" : [
4
+ {
5
+ "files" : [
6
+ " assembly/bin/**/*.dll" ,
7
+ " project/**/*.csproj" ,
8
+ " solution/**/*.sln" ,
9
+ " csharp/**/*.cs" ,
10
+ " vb/**/*.vb"
11
+ ],
12
+ "exclude" : [
13
+ " project/Project.Core/**"
14
+ ],
15
+ "src" : " dotnet"
16
+ }
17
+ ],
18
+ "namespaceLayout" : " nested" ,
19
+ "enumSortOrder" : " declaringOrder" ,
20
+ "output" : " obj/api"
21
+ },
22
+ {
23
+ "src" : [
24
+ {
25
+ "files" : [
26
+ " assembly/bin/**/*.dll" ,
27
+ " project/**/*.csproj" ,
28
+ " solution/**/*.sln" ,
29
+ " csharp/**/*.cs" ,
30
+ " vb/**/*.vb"
31
+ ],
32
+ "exclude" : [
33
+ " project/Project.Core/**"
34
+ ],
35
+ "src" : " dotnet"
36
+ }
37
+ ],
38
+ "namespaceLayout" : " nested" ,
39
+ "enumSortOrder" : " declaringOrder" ,
40
+ "outputFormat" : " markdown" ,
41
+ "output" : " obj/md"
42
+ },
43
+ {
44
+ "src" : [
45
+ {
46
+ "files" : [
47
+ " assembly/bin/**/*.dll" ,
48
+ " project/**/*.csproj" ,
49
+ " solution/**/*.sln" ,
50
+ " csharp/**/*.cs" ,
51
+ " vb/**/*.vb"
52
+ ],
53
+ "exclude" : [
54
+ " project/Project.Core/**"
55
+ ],
56
+ "src" : " dotnet"
57
+ }
58
+ ],
59
+ "namespaceLayout" : " nested" ,
60
+ "enumSortOrder" : " declaringOrder" ,
61
+ "outputFormat" : " apiPage" ,
62
+ "output" : " obj/apipage"
63
+ }
64
+ ]
You can’t perform that action at this time.
0 commit comments