Need help with FSharp.SystemTextJson?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

Tarmil
144 Stars 20 Forks MIT License 232 Commits 20 Opened issues

Description

System.Text.Json extensions for F# types

Services available

!
?

Need anything else?

Contributors list

FSharp.SystemTextJson

Build status Nuget

This library provides support for F# types to System.Text.Json.

It adds support for the following types:

  • F# records (including struct records and anonymous records);

  • F# discriminated unions (including struct unions), with a variety of representations;

  • F# collections:

    list
    ,
    Map
    ,
    Set
    .

It provides a number of customization options, allowing a wide range of JSON serialization formats.

Documentation

FAQ

  • Does FSharp.SystemTextJson support alternative formats for unions?

Yes!

  • Does FSharp.SystemTextJson support representing
    'T option
    as either just
    'T
    or
    null
    (or an absent field)?

Yes! Starting with v0.6, this is the default behavior. To supersede it, use an explicit

JsonUnionEncoding
that does not include
UnwrapOption
.
  • Does FSharp.SystemTextJson support
    JsonPropertyNameAttribute
    and
    JsonIgnoreAttribute
    on record fields?

Yes!

  • Does FSharp.SystemTextJson support options such as
    PropertyNamingPolicy
    and
    IgnoreNullValues
    ?

Yes!

  • Can I customize the format for a specific type?

Yes!

  • Does FSharp.SystemTextJson allocate memory?

As little as possible, but unfortunately the

FSharp.Reflection
API requires some allocations. In particular, an array is allocated for as many items as the record fields or union arguments, and structs are boxed. There is work in progress to improve this.
  • Are there any benchmarks, e.g. against Newtonsoft.Json?

Yes!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.