Table of Contents

Namespace Cloudflare.NET.Core.Json

Classes

BooleanOrStringConverter

Custom JSON converter for boolean values that can also be represented as strings.

Cloudflare's v2 audit logs API returns the action result as a string ("success"/"failure") while the v1 API returns it as a boolean. This converter handles both formats.

CloudflareDateTimeConverter

Custom JSON converter for DateTime that handles Cloudflare's non-standard date formats.

Cloudflare APIs return dates in various formats that differ from ISO 8601:

  • "2025-12-07 05:59:36.458083+00" - Space instead of 'T', short timezone offset
  • "2025-12-07T05:59:36Z" - Standard ISO 8601
  • "2025-12-07T05:59:36+00:00" - ISO 8601 with full timezone
CloudflareDateTimeNullableConverter

Custom JSON converter for nullable DateTime that handles Cloudflare's non-standard date formats.

ExtensibleEnumConverterFactory

A JSON converter factory that automatically creates converters for any type implementing IExtensibleEnum<TSelf>.

Register this factory with Converters to enable automatic serialization of all extensible enum types without individual converter attributes.

ExtensibleEnumConverter<T>

A JSON converter for extensible enum types that implement IExtensibleEnum<TSelf>.

This converter serializes extensible enums as their underlying string value and deserializes JSON strings back into the appropriate extensible enum type.

JsonStringEnumMemberConverter

A JsonConverterFactory that creates a converter to properly handle enums decorated with EnumMemberAttribute. This allows for serialization and deserialization based on the attribute's value rather than the enum member's name.

Interfaces

IExtensibleEnum<TSelf>

Defines the contract for an extensible enum type that wraps a string value.

Extensible enums provide strong typing and IntelliSense for known values while allowing custom values to be specified when the API adds new options that the SDK doesn't yet know about.