Skip to content

Commit ccacad1

Browse files
robertmclawsclaude
andcommitted
Add AOT support, ThemePairConfig base class, and comprehensive tests
Consolidate 6 independent Light/Dark theme pair classes (ColorConfig, ColorPairConfig, ColorsConfig, BackgroundImageConfig, LogoConfig, FaviconConfig) under a shared ThemePairConfig base class for consistency. Add AOT-compatible JSON serialization for .NET 8+ via source-generated MintlifyJsonContext, wire it into MintlifyConstants, mark the assembly as trimmable/AOT-compatible, remove reflection from NavigationPageConverter, and suppress expected IL2026/IL3050 warnings in converters that operate within the serialization pipeline. Add 111 new tests covering ThemePairConfig, inheritance verification, new config model serialization, and AOT round-trip correctness. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 648d18b commit ccacad1

152 files changed

Lines changed: 5154 additions & 233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/CloudNimble.DotNetDocs.Docs/api-reference/Mintlify/Core/MintlifyConstants.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ This instance is configured with:
4747
- CamelCase property naming to match Mintlify schema
4848
- Null value ignoring to omit optional properties
4949
- Polymorphic JSON converters for complex object types
50+
- Source-generated type info resolver on .NET 8+ for AOT compatibility
5051

src/CloudNimble.DotNetDocs.Docs/api-reference/Mintlify/Core/Models/ApiConfig.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,24 @@ When true, API requests from the playground are routed through Mintlify's
185185
is superseded by Playground.Proxy but kept for backward compatibility.
186186
Defaults to true when not specified.
187187

188+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Url
189+
190+
Gets or sets the base URL display mode for API endpoints.
191+
192+
#### Syntax
193+
194+
```csharp
195+
public string Url { get; set; }
196+
```
197+
198+
#### Property Value
199+
200+
Type: `string?`
201+
202+
#### Remarks
203+
204+
Controls how the base URL is displayed in API documentation.
205+
188206
## Methods
189207

190208
### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

src/CloudNimble.DotNetDocs.Docs/api-reference/Mintlify/Core/Models/ApiExamplesConfig.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,27 @@ public Object()
5050

5151
## Properties
5252

53+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Autogenerate
54+
55+
Gets or sets whether to automatically generate code samples for API endpoints.
56+
57+
#### Syntax
58+
59+
```csharp
60+
public System.Nullable<bool> Autogenerate { get; set; }
61+
```
62+
63+
#### Property Value
64+
65+
Type: `System.Nullable<bool>?`
66+
67+
#### Remarks
68+
69+
When set to true (default), code samples are automatically generated for endpoints
70+
from API specifications. When set to false, only manually-written code samples
71+
(from x-codeSamples in OpenAPI specifications or RequestExample components in MDX)
72+
appear in the API playground.
73+
5374
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Defaults
5475

5576
Gets or sets whether to show optional parameters in API examples.

src/CloudNimble.DotNetDocs.Docs/api-reference/Mintlify/Core/Models/BackgroundImageConfig.mdx

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: BackgroundImageConfig
33
description: "Represents a background image configuration in Mintlify."
44
icon: file-brackets-curly
5-
keywords: ['BackgroundImageConfig', 'Mintlify.Core.Models.BackgroundImageConfig', 'Mintlify.Core.Models', 'class', 'System.Object']
5+
keywords: ['BackgroundImageConfig', 'Mintlify.Core.Models.BackgroundImageConfig', 'Mintlify.Core.Models', 'class', 'Mintlify.Core.Models.ThemePairConfig']
66
---
77

88
## Definition
@@ -11,7 +11,7 @@ keywords: ['BackgroundImageConfig', 'Mintlify.Core.Models.BackgroundImageConfig'
1111

1212
**Namespace:** Mintlify.Core.Models
1313

14-
**Inheritance:** System.Object
14+
**Inheritance:** Mintlify.Core.Models.ThemePairConfig
1515

1616
## Syntax
1717

@@ -40,6 +40,16 @@ public BackgroundImageConfig()
4040

4141
### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>
4242

43+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
44+
45+
#### Syntax
46+
47+
```csharp
48+
public ThemePairConfig()
49+
```
50+
51+
### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>
52+
4353
<Note>Inherited from `object`</Note>
4454

4555
#### Syntax
@@ -50,44 +60,38 @@ public Object()
5060

5161
## Properties
5262

53-
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Dark
63+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Dark <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
64+
65+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
5466

55-
Gets or sets the background image for dark mode.
67+
Gets or sets the value for dark mode.
5668

5769
#### Syntax
5870

5971
```csharp
60-
public string Dark { get; set; }
72+
public virtual string Dark { get; set; }
6173
```
6274

6375
#### Property Value
6476

6577
Type: `string?`
6678

67-
#### Remarks
68-
69-
Can be an absolute URL or relative path to an image file.
70-
Used when the theme switches to dark mode.
79+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Light <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
7180

72-
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Light
81+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
7382

74-
Gets or sets the background image for light mode.
83+
Gets or sets the value for light mode.
7584

7685
#### Syntax
7786

7887
```csharp
79-
public string Light { get; set; }
88+
public virtual string Light { get; set; }
8089
```
8190

8291
#### Property Value
8392

8493
Type: `string?`
8594

86-
#### Remarks
87-
88-
Can be an absolute URL or relative path to an image file.
89-
Used when the theme is in light mode.
90-
9195
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Url
9296

9397
Gets or sets the single image URL when not using theme-specific images.
@@ -228,6 +232,23 @@ public override string ToString()
228232
Type: `string`
229233
The URL, light image, dark image, or empty string.
230234

235+
### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="blue">Override</Badge>
236+
237+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
238+
239+
Returns the string representation of the theme pair configuration.
240+
241+
#### Syntax
242+
243+
```csharp
244+
public override string ToString()
245+
```
246+
247+
#### Returns
248+
249+
Type: `string`
250+
The light value, dark value, or empty string.
251+
231252
### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
232253

233254
<Note>Inherited from `object`</Note>

src/CloudNimble.DotNetDocs.Docs/api-reference/Mintlify/Core/Models/ColorConfig.mdx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ColorConfig
33
description: "Represents a color configuration for Mintlify. Can be a simple hex color string or a complex color pair configuration with light and dark modes."
44
icon: file-brackets-curly
5-
keywords: ['ColorConfig', 'Mintlify.Core.Models.ColorConfig', 'Mintlify.Core.Models', 'class', 'System.Object']
5+
keywords: ['ColorConfig', 'Mintlify.Core.Models.ColorConfig', 'Mintlify.Core.Models', 'class', 'Mintlify.Core.Models.ThemePairConfig']
66
---
77

88
## Definition
@@ -11,7 +11,7 @@ keywords: ['ColorConfig', 'Mintlify.Core.Models.ColorConfig', 'Mintlify.Core.Mod
1111

1212
**Namespace:** Mintlify.Core.Models
1313

14-
**Inheritance:** System.Object
14+
**Inheritance:** Mintlify.Core.Models.ThemePairConfig
1515

1616
## Syntax
1717

@@ -71,6 +71,16 @@ public ColorConfig(string light, string dark)
7171

7272
### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>
7373

74+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
75+
76+
#### Syntax
77+
78+
```csharp
79+
public ThemePairConfig()
80+
```
81+
82+
### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>
83+
7484
<Note>Inherited from `object`</Note>
7585

7686
#### Syntax
@@ -81,28 +91,32 @@ public Object()
8191

8292
## Properties
8393

84-
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Dark
94+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Dark <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
95+
96+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
8597

86-
Gets or sets the color in hex format to use in dark mode.
98+
Gets or sets the value for dark mode.
8799

88100
#### Syntax
89101

90102
```csharp
91-
public string Dark { get; set; }
103+
public virtual string Dark { get; set; }
92104
```
93105

94106
#### Property Value
95107

96108
Type: `string?`
97109

98-
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Light
110+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Light <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
99111

100-
Gets or sets the color in hex format to use in light mode.
112+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
113+
114+
Gets or sets the value for light mode.
101115

102116
#### Syntax
103117

104118
```csharp
105-
public string Light { get; set; }
119+
public virtual string Light { get; set; }
106120
```
107121

108122
#### Property Value
@@ -217,7 +231,9 @@ Type: `bool`
217231

218232
### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="blue">Override</Badge>
219233

220-
Returns the string representation of the color configuration.
234+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
235+
236+
Returns the string representation of the theme pair configuration.
221237

222238
#### Syntax
223239

@@ -228,7 +244,7 @@ public override string ToString()
228244
#### Returns
229245

230246
Type: `string`
231-
The light color, dark color, or empty string.
247+
The light value, dark value, or empty string.
232248

233249
### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
234250

src/CloudNimble.DotNetDocs.Docs/api-reference/Mintlify/Core/Models/ColorPairConfig.mdx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ColorPairConfig
33
description: "Represents a color pair configuration for light and dark modes."
44
icon: file-brackets-curly
5-
keywords: ['ColorPairConfig', 'Mintlify.Core.Models.ColorPairConfig', 'Mintlify.Core.Models', 'class', 'System.Object']
5+
keywords: ['ColorPairConfig', 'Mintlify.Core.Models.ColorPairConfig', 'Mintlify.Core.Models', 'class', 'Mintlify.Core.Models.ThemePairConfig']
66
---
77

88
## Definition
@@ -11,7 +11,7 @@ keywords: ['ColorPairConfig', 'Mintlify.Core.Models.ColorPairConfig', 'Mintlify.
1111

1212
**Namespace:** Mintlify.Core.Models
1313

14-
**Inheritance:** System.Object
14+
**Inheritance:** Mintlify.Core.Models.ThemePairConfig
1515

1616
## Syntax
1717

@@ -35,6 +35,16 @@ public ColorPairConfig()
3535

3636
### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>
3737

38+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
39+
40+
#### Syntax
41+
42+
```csharp
43+
public ThemePairConfig()
44+
```
45+
46+
### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>
47+
3848
<Note>Inherited from `object`</Note>
3949

4050
#### Syntax
@@ -45,28 +55,32 @@ public Object()
4555

4656
## Properties
4757

48-
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Dark
58+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Dark <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
59+
60+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
4961

50-
Gets or sets the color in hex format to use in dark mode.
62+
Gets or sets the value for dark mode.
5163

5264
#### Syntax
5365

5466
```csharp
55-
public string Dark { get; set; }
67+
public virtual string Dark { get; set; }
5668
```
5769

5870
#### Property Value
5971

6072
Type: `string?`
6173

62-
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Light
74+
### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Light <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
6375

64-
Gets or sets the color in hex format to use in light mode.
76+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
77+
78+
Gets or sets the value for light mode.
6579

6680
#### Syntax
6781

6882
```csharp
69-
public string Light { get; set; }
83+
public virtual string Light { get; set; }
7084
```
7185

7286
#### Property Value
@@ -181,7 +195,9 @@ Type: `bool`
181195

182196
### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="blue">Override</Badge>
183197

184-
Returns the string representation of the color pair configuration.
198+
<Note>Inherited from `Mintlify.Core.Models.ThemePairConfig`</Note>
199+
200+
Returns the string representation of the theme pair configuration.
185201

186202
#### Syntax
187203

@@ -192,7 +208,7 @@ public override string ToString()
192208
#### Returns
193209

194210
Type: `string`
195-
The light color, dark color, or empty string.
211+
The light value, dark value, or empty string.
196212

197213
### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>
198214

0 commit comments

Comments
 (0)