Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Encode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ module Encode =
FSharpType.GetRecordFields(t, allowAccessToPrivateRepresentation=true)
|> Array.map (fun fi ->
let targetKey = Util.Casing.convert caseStrategy fi.Name
let encoder = autoEncoder extra caseStrategy skipNullField fi.PropertyType
fun (source: obj) (target: JObject) ->
let value = FSharpValue.GetRecordField(source, fi)
if not skipNullField || (skipNullField && not (isNull value)) then // Discard null fields
let encoder = autoEncoder extra caseStrategy skipNullField (value.GetType())
target.[targetKey] <- encoder.Encode value
target)
boxEncoder(fun (source: obj) ->
Expand Down