summaryrefslogtreecommitdiff
path: root/src/FundLab.Api/Program.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-21 09:27:09 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-21 09:27:09 +0800
commita5ac465ab59197a55a222d30ebd2cf26ffe80f86 (patch)
tree8ea3696897f99878545f3e7c7aa1e7249b95b81b /src/FundLab.Api/Program.fs
parent0aad89fc76aa77524625964ebad896a6bc0d3660 (diff)
downloadfund-lab-a5ac465ab59197a55a222d30ebd2cf26ffe80f86.tar.gz
Fix F# option JSON serialization in confirmation/positions API responses
Giraffe 6's default Newtonsoft serializer wrapped F# Some values as Value/IsSome/IsNone objects, breaking the confirmation and positions response contract (amounts must be exact decimal strings, absent fields null, quote object-or-null). Add OptionJsonConverter plus a shared serializer registration applied to both the Kestrel host and the in-process test fixture, and cover confirmation/positions over real HTTP including pending, conflict, cross-fund and Kestrel restart-replay regressions.
Diffstat (limited to 'src/FundLab.Api/Program.fs')
-rw-r--r--src/FundLab.Api/Program.fs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/FundLab.Api/Program.fs b/src/FundLab.Api/Program.fs
index d4f2c76..b7d0ef6 100644
--- a/src/FundLab.Api/Program.fs
+++ b/src/FundLab.Api/Program.fs
@@ -13,6 +13,7 @@ let private requiredEnvironment name =
[<EntryPoint>]
let main argv =
let builder = WebApplication.CreateBuilder(argv)
+ builder.Services |> App.addOptionFriendlyJson |> ignore
builder.Services.AddGiraffe() |> ignore
let repository = FundRepository(requiredEnvironment "FUND_LAB_DATABASE_URL")
repository.EnsureSchema()