FSharp.SystemTextJson

System.Text.Json extensions for F# types

MIT License

Stars
329
Committers
18

Bot releases are visible (Hide)

FSharp.SystemTextJson - Version 0.6

Published by Tarmil almost 5 years ago

  • #4: Add support for standard option IgnoreNullValues on record and union fields.
  • #13: Add support for JsonPropertyNameAttribute on union cases to set the tag name to use for this case.
  • #16: Add JsonUnionEncoding.SuccintOption, which encodes Some x the same as x.
    BREAKING CHANGE: This is now the default option.
  • Add unionTagName and unionFieldsName option to customize the "Case" and "Fields" tags for unions.
  • Add JsonUnionEncoding.FSharpLuLike, which is equivalent to ExternalTag ||| BareFieldlessTags ||| SuccintOption.
FSharp.SystemTextJson - Version 0.1

Published by Tarmil about 5 years ago

Initial release.

  • Serialize and deserialize F# unions and struct unions.
  • Serialize and deserialize F# records, struct records and anonymous records.
FSharp.SystemTextJson - Version 0.2

Published by Tarmil about 5 years ago

New features

  • #1 Record fields now honor JsonPropertyNameAttribute.
  • #2 Record fields now honor JsonIgnoreAttribute.
FSharp.SystemTextJson - Version 0.3

Published by Tarmil about 5 years ago

Improvements

  • #9 The information about whether a type is a record or a union is now cached.
  • #12 The package now targets .NET Standard 2.0 and can therefore also be used on .NET Framework.
FSharp.SystemTextJson - Version 0.4

Published by Tarmil about 5 years ago

New features

  • #6 Add different encodings for F# unions.
    • JsonFSharpConverter and JsonFSharpConverterAttribute now take JsonUnionEncoding as optional argument.
    • Unions are encoded depending on the JsonUnionEncoding as detailed in the documentation.
FSharp.SystemTextJson - Verson 0.5

Published by Tarmil about 5 years ago

New features

  • #17 Add encoding of collections:
    • 'T list encoded as JSON array.
    • Set<'T> encoded as JSON array.
    • Map<string, 'T> encoded as JSON object with map keys as field names.
    • Map<'K, 'V> when 'K is not string encoded as JSON array whose elements are [key,value] JSON arrays.
    • Tuples and struct tuples encoded as JSON array.