WIP on adding htmax option (#59)

This commit is contained in:
2026-07-05 17:54:36 -04:00
parent 7c588662d2
commit 9d2277ab32
10 changed files with 81 additions and 15 deletions
+10 -1
View File
@@ -9,6 +9,14 @@ module Json =
open Newtonsoft.Json
/// <summary>Converter for the <see cref="AutoHtmxType" /> type</summary>
type AutoHtmxTypeConverter() =
inherit JsonConverter<AutoHtmxType>()
override _.WriteJson(writer: JsonWriter, value: AutoHtmxType, _: JsonSerializer) =
writer.WriteValue(string value)
override _.ReadJson(reader: JsonReader, _: Type, _: AutoHtmxType, _: bool, _: JsonSerializer) =
(string >> AutoHtmxType.Parse) reader.Value
/// <summary>Converter for the <see cref="CategoryId" /> type</summary>
type CategoryIdConverter() =
inherit JsonConverter<CategoryId>()
@@ -160,7 +168,8 @@ module Json =
/// <summary>Configure a serializer to use these converters (and other settings)</summary>
let configure (ser: JsonSerializer) =
// Our converters
[ CategoryIdConverter() :> JsonConverter
[ AutoHtmxTypeConverter() :> JsonConverter
CategoryIdConverter()
CommentIdConverter()
CommentStatusConverter()
CustomFeedIdConverter()