Definition
Assembly: Mintlify.Core.dll Namespace: Mintlify.Core.Converters Inheritance: System.Text.Json.Serialization.JsonConverter<Mintlify.Core.Models.ServerConfig>Syntax
Summary
Handles JSON conversion for server configuration properties that can be strings or arrays.Remarks
Server configurations in Mintlify can be specified as:- String: Single server URL
- Array: Multiple server URLs
Constructors
.ctor
Syntax
Methods
CanConvert
Determines whether the specified type can be converted by this converter.Syntax
Parameters
Name | Type | Description |
---|---|---|
typeToConvert | System.Type | The type to convert. |
Returns
Type:bool
True if the type is ServerConfig; otherwise, false.
Read
Reads and converts the JSON to a ServerConfig object.Syntax
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.ServerConfig?
A ServerConfig for all supported server configuration formats.
Exceptions
Exception | Description |
---|---|
JsonException | Thrown when the JSON token type is not supported. |
Write
Writes the ServerConfig object to JSON.Syntax
Parameters
Name | Type | Description |
---|---|---|
writer | System.Text.Json.Utf8JsonWriter | The JSON writer. |
value | Mintlify.Core.Models.ServerConfig? | The ServerConfig value to write. |
options | System.Text.Json.JsonSerializerOptions | The serializer options. |