Skip to content

Releases: Tarmil/FSharp.SystemTextJson

Version 0.8

31 Jan 10:18
Compare
Choose a tag to compare
  • #30: Unwrap 'T voption with JsonUnionEncoding.UnwrapOption. Thanks @johlrich!

  • #32: Add JsonUnionEncoding.UnwrapSingleFieldCases, which encodes the field of single-field cases as x instead of [x]. Include it in JsonUnionEncoding.FSharpLuLike.

  • #33: Fix "read too much or not enough" when parsing a list of unions with JsonUnionEncoding.UnwrapFieldlessTags.

  • #36: BREAKING CHANGE: During deserialization, throw an exception when a field of a record or union has value null, unless the type of this field is option, voption, or a union with UseNullAsTrueValue. Thanks @drhumlen!

    New option allowNullFields disables this behavior.

  • #38: Add more consistent names for options:

    • BareFieldlessTags becomes UnwrapFieldlessTags;
    • SuccintOption becomes UnwrapOption;
    • EraseSingleCaseUnions becomes UnwrapSingleCaseUnions.

    The previous names are marked Obsolete.

Version 0.7

23 Nov 17:15
Compare
Choose a tag to compare
  • #3: Add support for PropertyNamingPolicy on record and union fields.
  • #22: Add support for DictionaryKeyPolicy for Map<string, 'T>.
  • #27: Add unionTagNamingPolicy option to JsonFSharpConverter and JsonFSharpConverterAttribute to customize the naming policy for union tag names.
  • #26: Add JsonUnionEncoding.EraseSingleCaseUnions, which encodes single-case single-field unions the same as the value in the field.
    BREAKING CHANGE: This is now the default option.
  • #5: Add support for PropertyNameCaseInsensitive on record and union fields.
    Add unionTagCaseInsensitive option to JsonFSharpConverter and JsonFSharpConverterAttribute to customize the case sensitivity for union tag names.

Version 0.6

23 Nov 16:54
Compare
Choose a tag to compare
  • #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.

Verson 0.5

02 Oct 09:33
Compare
Choose a tag to compare

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.

Version 0.4

02 Oct 09:36
Compare
Choose a tag to compare

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.

Version 0.3

02 Oct 09:42
Compare
Choose a tag to compare

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.

Version 0.2

02 Oct 09:43
Compare
Choose a tag to compare

New features

  • #1 Record fields now honor JsonPropertyNameAttribute.
  • #2 Record fields now honor JsonIgnoreAttribute.

Version 0.1

02 Oct 09:44
Compare
Choose a tag to compare

Initial release.

  • Serialize and deserialize F# unions and struct unions.
  • Serialize and deserialize F# records, struct records and anonymous records.