Definition

Assembly: Mintlify.Core.dll Namespace: Mintlify.Core.Converters Inheritance: System.Text.Json.Serialization.JsonConverter<System.Collections.Generic.List<object>>

Syntax

Mintlify.Core.Converters.NavigationPageListConverter

Summary

Handles JSON conversion for lists of navigation page items that can be either strings or GroupConfig objects.

Remarks

This converter uses a static NavigationPageConverter instance for efficient conversion of all items in the list without creating new converter instances for each item.

Constructors

.ctor

Syntax

public NavigationPageListConverter()

Methods

Read

Reads and converts the JSON array to a list of navigation page objects.

Syntax

public override System.Collections.Generic.List<object> Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)

Parameters

NameTypeDescription
readerSystem.Text.Json.Utf8JsonReaderThe JSON reader.
typeToConvertSystem.TypeThe type to convert to.
optionsSystem.Text.Json.JsonSerializerOptionsThe serializer options.

Returns

Type: System.Collections.Generic.List<object> A list containing string and GroupConfig objects.

Exceptions

ExceptionDescription
JsonExceptionThrown when the JSON token is not a StartArray.

Write

Writes the list of navigation page objects to JSON array.

Syntax

public override void Write(System.Text.Json.Utf8JsonWriter writer, System.Collections.Generic.List<object> value, System.Text.Json.JsonSerializerOptions options)

Parameters

NameTypeDescription
writerSystem.Text.Json.Utf8JsonWriterThe JSON writer.
valueSystem.Collections.Generic.List<object>The list of navigation page objects to write.
optionsSystem.Text.Json.JsonSerializerOptionsThe serializer options.