Definition
Assembly: Mintlify.Core.dll Namespace: Mintlify.Core.Converters Inheritance: System.Text.Json.Serialization.JsonConverter<object>Syntax
Summary
Handles JSON conversion for API configuration properties that can be strings, arrays, or objects.Remarks
API configurations in Mintlify (OpenAPI and AsyncAPI) can be specified as:- String: Single URL to specification file
- Array: Multiple URLs to specification files
- Object: Complex configuration with source and directory properties
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 object; otherwise, false.
Read
Reads and converts the JSON to an API configuration 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:object?
A string, List<string>, or Dictionary for API configurations.
Exceptions
Exception | Description |
---|---|
JsonException | Thrown when the JSON token type is not supported. |
Write
Writes the API configuration object to JSON.Syntax
Parameters
Name | Type | Description |
---|---|---|
writer | System.Text.Json.Utf8JsonWriter | The JSON writer. |
value | object | The value to write. |
options | System.Text.Json.JsonSerializerOptions | The serializer options. |
Exceptions
Exception | Description |
---|---|
JsonException | Thrown when the value type is not supported. |