Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I use my side-project KyivStationWalk as a set of my opinionated takes on software architecture. No wonder I use F# here. One of the types I use in this project to describe my domain is the subway station branch. There are 3 branches in Kyiv named by their traditional colors.
By default Giraffe, the framework which I use as a web server, uses Newtonsoft.Json to serialize results to JSON. However, for discriminated union, it generates quite a lot of JSON so I've switched to System.Text.Json which is built into newer versions of .Net Core. In combination with FSharp.SystemTextJson package allows serializing discriminated unions more gracefully. All we need is to decorate Branch type with JsonFSharpConverter(JsonUnionEncoding.BareFieldlessTags) attribute.
Related posts
- Confusion in learning Giraffe's HttpHandler
- Is it possible to run C# asp.net core MVC and f# giraffe in a single solution
- Giraffe.GoodRead, Giraffe.QueryReader, Giraffe.JsonTherapy and Fable.Remoting.Giraffe Releases 🦒🔷🚀
- Writing high performance F# code
- Show HN: F# web server in 3-4 lines of code