Add true/false to auto-htmx converter (#59)
- This will allow backups to be restored, converting the value as part of the restoration
This commit is contained in:
@@ -15,7 +15,10 @@ module Json =
|
||||
override _.WriteJson(writer: JsonWriter, value: AutoHtmxType, _: JsonSerializer) =
|
||||
writer.WriteValue(string value)
|
||||
override _.ReadJson(reader: JsonReader, _: Type, _: AutoHtmxType, _: bool, _: JsonSerializer) =
|
||||
(string >> AutoHtmxType.Parse) reader.Value
|
||||
// Backups prior to v3 will still have true/false for this field
|
||||
match reader.TokenType with
|
||||
| JsonToken.Boolean -> if reader.Value :?> bool then AutoHtmx else NoAutoHtmx
|
||||
| _ -> (string >> AutoHtmxType.Parse) reader.Value
|
||||
|
||||
/// <summary>Converter for the <see cref="CategoryId" /> type</summary>
|
||||
type CategoryIdConverter() =
|
||||
|
||||
Reference in New Issue
Block a user