Documentation Index
Fetch the complete documentation index at: https://dotnetdocs.com/llms.txt
Use this file to discover all available pages before exploring further.
Definition
Assembly: Mintlify.Core.dll
Namespace: Mintlify.Core.Converters
Inheritance: System.Text.Json.Serialization.JsonConverter<Mintlify.Core.Models.PrimaryNavigationConfig>
Syntax
Mintlify.Core.Converters.PrimaryNavigationConverter
Summary
Handles JSON conversion for primary navigation properties that can be different types of objects.
Primary navigation in Mintlify NavbarConfig can be specified as:
- Object: Button configuration with type, label, and href properties
- Object: GitHub configuration with type and href properties
Constructors
.ctor
Syntax
public PrimaryNavigationConverter()
Methods
CanConvert Override
Determines whether the specified type can be converted by this converter.
Syntax
public override bool CanConvert(System.Type typeToConvert)
Parameters
| Name | Type | Description |
|---|
typeToConvert | System.Type | The type to convert. |
Returns
Type: bool
True if the type is PrimaryNavigationConfig; otherwise, false.
Read Override
Reads and converts the JSON to a PrimaryNavigationConfig object.
Syntax
public override Mintlify.Core.Models.PrimaryNavigationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
Parameters
| Name | Type | Description |
|---|
reader | System.Text.Json.Utf8JsonReader | The JSON reader. |
typeToConvert | System.Type | The type to convert to. |
options | System.Text.Json.JsonSerializerOptions | The serializer options. |
Returns
Type: Mintlify.Core.Models.PrimaryNavigationConfig?
A PrimaryNavigationConfig object.
Exceptions
| Exception | Description |
|---|
JsonException | Thrown when the JSON token type is not supported. |
Write Override
Writes the PrimaryNavigationConfig object to JSON.
Syntax
public override void Write(System.Text.Json.Utf8JsonWriter writer, Mintlify.Core.Models.PrimaryNavigationConfig value, System.Text.Json.JsonSerializerOptions options)
Parameters
| Name | Type | Description |
|---|
writer | System.Text.Json.Utf8JsonWriter | The JSON writer. |
value | Mintlify.Core.Models.PrimaryNavigationConfig | The PrimaryNavigationConfig value to write. |
options | System.Text.Json.JsonSerializerOptions | The serializer options. |