docs.json files with full IntelliSense support.
Why Use Mintlify.Core?
Type Safety
Strongly-typed C# models for every Mintlify configuration option with compile-time validation
IntelliSense Support
Full XML documentation on every property with examples and schema references
Validation Built-In
Comprehensive validation against Mintlify schema ensures configurations will work before deployment
Multi-Platform
Targets .NET Standard 2.0, .NET 8, .NET 9, and .NET 10 for maximum compatibility
Navigation Management
Advanced DocsJsonManager for intelligent navigation merging and duplicate detection
Production Ready
Battle-tested in DotNetDocs and used by Sustainment for managing complex documentation sites
Installation
Install via NuGet Package Manager or .NET CLI:Quick Start
Create a basic Mintlify configuration programmatically:Core Components
DocsJsonConfig
The root configuration object representing the completedocs.json schema:
NavigationConfig
Defines the documentation structure with support for pages, groups, tabs, anchors, and more:Pages property is polymorphic - it can contain both string (page paths) and GroupConfig objects (nested groups):
GroupConfig
Organizes pages into collapsible sections:ColorsConfig
Theme color configuration with hex color validation:DocsJsonManager
TheDocsJsonManager class provides advanced navigation management with intelligent merging and duplicate detection:
Key Features
Load & SaveDuplicate Detection
TheDocsJsonManager maintains an internal _knownPagePaths HashSet that tracks every page path added to navigation:
Duplicate detection is case-insensitive and works across all navigation levels (root pages, grouped pages, nested groups).
DocsJsonValidator
Comprehensive validation against the Mintlify schema:Validation Rules
The validator checks: Required FieldsNamemust be setThememust be set and validColors.Primarymust be a valid hex colorNavigationmust have at least one navigation element
- Must be one of:
mint,maple,palm,willow,linden,almond,aspen
- All colors must match regex:
^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$ - Examples:
#FF0000,#F00,#419AC5
- Must contain at least one of:
pages,groups,anchors,tabs,dropdowns,languages,versions - Group names cannot be null (Mintlify will reject the config)
- Empty group names generate warnings (treated as separate ungrouped sections)
- Auth methods:
bearer,basic,key,cobo - Playground display:
interactive,simple,none - Examples defaults:
all,required
- Default mode:
system,light,dark
- Library:
fontawesome,lucide
- Indexing:
navigable,all
Example Validation Output
MintlifyConstants
Provides shared configuration for consistent JSON serialization:JsonSerializerOptions instance includes:
- Indented formatting for readable JSON output
- CamelCase property naming to match Mintlify schema
- Null value ignoring to omit optional properties
- Custom converters for polymorphic types:
NavigationJsonConverter- Handles complex navigation structuresNavigationPageListConverter- Handles mixed string/GroupConfig listsIconConverter- Supports both string and object icon formatsColorConverter- Handles color pairs and single valuesApiConfigConverter- Handles API spec configuration formats
Usage
Configuration Models Reference
Mintlify.Core includes 50+ strongly-typed models covering every Mintlify configuration option:Theme & Appearance
ColorsConfig
ColorsConfig
Theme color configurationProperties:
Primary(required): Main theme colorLight: Light mode accentDark: Dark mode accent
LogoConfig
LogoConfig
Logo configuration for light and dark modesProperties:
Light: Path to light mode logoDark: Path to dark mode logoHref: URL logo links to
FaviconConfig
FaviconConfig
Favicon paths for different modesProperties:
Light: Light mode faviconDark: Dark mode favicon
AppearanceConfig
AppearanceConfig
Appearance and color mode settingsProperties:
Default: Default mode (system,light,dark)Toggle: Show dark mode toggle
StylingConfig
StylingConfig
Custom styling and CSSProperties:
StylesheetPaths: Array of custom CSS file pathsCodeblocks: Code block styling options
Navigation Components
TabConfig
TabConfig
Top-level navigation tabsProperties:
Tab: Tab titleHref: Tab URLPages: Tab pagesGroups: Tab groupsIcon: Tab icon
AnchorConfig
AnchorConfig
Sidebar anchor linksProperties:
Anchor: Link textHref: Link URLIcon: Anchor icon
DropdownConfig
DropdownConfig
Dropdown navigation menusProperties:
Dropdown: Dropdown titleHref: Optional direct linkItems: Dropdown items
API & Integration
ApiConfig
ApiConfig
API playground and documentation settingsProperties:
Mdx: MDX API configurationPlayground: Playground display settingsExamples: Example configurationParams: Parameter settings
IntegrationsConfig
IntegrationsConfig
Analytics and third-party integrationsProperties:
GoogleAnalytics: GA tracking IDGoogleTagManager: GTM IDMixpanel: Mixpanel project tokenSegment: Segment write keyIntercom: Intercom app ID- And 10+ more integrations
SeoConfig
SeoConfig
SEO and indexing settingsProperties:
Indexing: Indexing mode (navigable,all)Sitemap: Custom sitemap URL
Advanced Features
RedirectConfig
RedirectConfig
URL redirectsProperties:
Source: Source pathDestination: Destination path
SearchConfig
SearchConfig
Search configurationProperties:
Provider: Search providerAlgoliaConfig: Algolia settings
Advanced Scenarios
Building Multi-Project Documentation
Custom Navigation Override
Programmatic Theme Configuration
Validation Pipeline
Best Practices
Always Validate
Use
DocsJsonValidator before saving configurations to catch errors early. Invalid configs will be rejected by Mintlify.Use DocsJsonManager
Leverage
DocsJsonManager for navigation operations instead of manually manipulating collections. It handles duplicate detection automatically.Preserve Templates
When using
PopulateNavigationFromPath, set preserveExisting: true to merge discovered content with template navigation.Check Known Paths
Use
IsPathKnown() before adding pages to avoid duplicates. The manager tracks all paths internally.Serialize with Constants
Always use
MintlifyConstants.JsonSerializerOptions for consistent JSON formatting and proper converter handling.Set Required Fields First
Initialize
Name, Theme, Colors.Primary, and Navigation before other properties. These are required by Mintlify.Multi-Platform Support
Mintlify.Core targets multiple .NET platforms for maximum compatibility:
All core functionality works identically across platforms, with some optimizations for modern frameworks (e.g., source-generated regex in .NET 7+).
See Also
Navigation Generation
Learn how MintlifyRenderer uses DocsJsonManager to build navigation
Mintlify Provider Overview
Complete guide to the Mintlify provider features
DocsJsonManager API
Full API reference for DocsJsonManager class
Mintlify Schema
Official Mintlify docs.json schema reference