From 99c7f6e934fa1463c148eb6ad2a74fc4db9a210b Mon Sep 17 00:00:00 2001 From: Ross Donaldson Date: Sun, 25 Apr 2021 14:24:15 -0400 Subject: [PATCH 01/14] Update off net461 kinda everywhere This commit is one possible solution to #96. Here, I'm simply dropping support for net461 entirely, in favor of targeting `netstandard`. While I was doing this, I bumped the `netstandard` version to 2.1, but this could easily be an addition instead of a replacement. Similarly, I noted that the `global.json` specified SDK version 3.0, but with a roll-forward directive for newest minor version. Accordingly, I bumped to the newest SDK 3.1 release. These changes meant I could remove the `mono` block from the Fleece solution, so I did. These changes reach all through Fleece, and prompted the replacement of `net461` with `netstandard2.1` (mostly in documentation) or `netcoreapp3.1` (mostly in tests) in many places. While I was doing this, I cleaned whitespace and indentation, and added a missing XML specifier to an fsproj file. On my machine, the build and all tests are passing. --- Directory.Build.props | 1 - docsrc/content/codec.fsx | 4 ++-- docsrc/content/combinators.fsx | 4 ++-- docsrc/content/comparison-with-json-net.fsx | 5 ++--- docsrc/content/giraffe.fsx | 6 +++--- docsrc/content/suave.fsx | 7 ++++--- docsrc/content/to-json-and-of-json.fsx | 7 ++++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 059eb893..fc666dce 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,7 +15,6 @@ $(VersionPrefix) $(VersionPrefix).0 $(VersionPrefix).0 - diff --git a/docsrc/content/codec.fsx b/docsrc/content/codec.fsx index 3b6e17c2..358b07ff 100644 --- a/docsrc/content/codec.fsx +++ b/docsrc/content/codec.fsx @@ -1,9 +1,9 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "nuget: FSharpPlus" -#r "nuget: System.Json" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" open Fleece.SystemJson open Fleece.SystemJson.Operators diff --git a/docsrc/content/combinators.fsx b/docsrc/content/combinators.fsx index 3a2edfb6..66aa8f9b 100644 --- a/docsrc/content/combinators.fsx +++ b/docsrc/content/combinators.fsx @@ -1,9 +1,9 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "nuget: FSharpPlus" -#r "nuget: System.Json" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" open Fleece.SystemJson diff --git a/docsrc/content/comparison-with-json-net.fsx b/docsrc/content/comparison-with-json-net.fsx index dab5d25a..af81cea5 100644 --- a/docsrc/content/comparison-with-json-net.fsx +++ b/docsrc/content/comparison-with-json-net.fsx @@ -1,10 +1,9 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r @"nuget: Newtonsoft.Json" -#r "nuget: FSharpPlus, 1.1.7" -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" +#r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/Newtonsoft.Json.dll" #r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/Fleece.NewtonsoftJson.dll" +#r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/FSharpPlus.dll" open System open Newtonsoft.Json diff --git a/docsrc/content/giraffe.fsx b/docsrc/content/giraffe.fsx index 52dc4299..00787886 100644 --- a/docsrc/content/giraffe.fsx +++ b/docsrc/content/giraffe.fsx @@ -1,10 +1,10 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "nuget: FSharpPlus" -#r "nuget: System.Json" -#r "nuget: TaskBuilder.fs,2.1.0" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" +#r @"../../packages/docs/TaskBuilder.fs/lib/net46/TaskBuilder.fs.dll" module Giraffe= open System.Threading.Tasks diff --git a/docsrc/content/suave.fsx b/docsrc/content/suave.fsx index 7b646ecf..b20bcbba 100644 --- a/docsrc/content/suave.fsx +++ b/docsrc/content/suave.fsx @@ -1,10 +1,11 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "nuget: FSharpPlus, 1.1.7" -#r "nuget: System.Json" -#r "nuget: Suave,2.5.6" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" +#r @"../../packages/docs/Suave/lib/netstandard2.1/Suave.dll" + (** ## Suave diff --git a/docsrc/content/to-json-and-of-json.fsx b/docsrc/content/to-json-and-of-json.fsx index 9a831c0e..92e69b2f 100644 --- a/docsrc/content/to-json-and-of-json.fsx +++ b/docsrc/content/to-json-and-of-json.fsx @@ -1,16 +1,17 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "nuget: FSharpPlus, 1.1.7" -#r "nuget: System.Json" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" open System.Json open Fleece.SystemJson open Fleece.SystemJson.Operators #if FSHARPDATA -#r "nuget: FSharp.Data" +#r @"../../src/Fleece.FSharpData/bin/Release/netstandard2.1/FSharp.Data.dll" #r @"../../src/Fleece.FSharpData/bin/Release/netstandard2.1/Fleece.FSharpData.dll" +#r @"../../src/Fleece.FSharpData/bin/Release/netstandard2.1/FSharpPlus.dll" open FSharp.Data open Fleece.FSharpData From 8b403b1f9393fcf09e6c3b78fb91f27316df7082 Mon Sep 17 00:00:00 2001 From: Ross Donaldson Date: Sun, 17 Jan 2021 16:05:30 -0800 Subject: [PATCH 02/14] Hrm. Let's try the Chet Husk Reference Assemblies trick again. --- src/Fleece.FSharpData/Fleece.FSharpData.fsproj | 4 ++++ src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj | 4 ++++ src/Fleece.SystemJson/Fleece.SystemJson.fsproj | 4 ++++ src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/Fleece.FSharpData/Fleece.FSharpData.fsproj b/src/Fleece.FSharpData/Fleece.FSharpData.fsproj index 73814754..f2412b28 100644 --- a/src/Fleece.FSharpData/Fleece.FSharpData.fsproj +++ b/src/Fleece.FSharpData/Fleece.FSharpData.fsproj @@ -16,5 +16,9 @@ + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj b/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj index 776de7ce..e6266595 100644 --- a/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj +++ b/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj @@ -16,5 +16,9 @@ + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Fleece.SystemJson/Fleece.SystemJson.fsproj b/src/Fleece.SystemJson/Fleece.SystemJson.fsproj index 7799ed5f..5c1e0bfb 100644 --- a/src/Fleece.SystemJson/Fleece.SystemJson.fsproj +++ b/src/Fleece.SystemJson/Fleece.SystemJson.fsproj @@ -16,5 +16,9 @@ + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj b/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj index 3181f61e..2f337e7b 100644 --- a/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj +++ b/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj @@ -16,5 +16,9 @@ + + all + runtime; build; native; contentfiles; analyzers + From a1863788f8fd553e64be56b693ae96f2903d8fd3 Mon Sep 17 00:00:00 2001 From: Ross Donaldson Date: Sat, 23 Jan 2021 11:55:26 -0800 Subject: [PATCH 03/14] Propose a few documentation enhancements This commit: - Expands the Codec section for DUs to cover non-data-bearing DUs and DUs with type-tags. - Adds a new `further-techniques` doc to cover cases like fields that are required in JSON but not in an F# data model. - Updates the index. - Updates the global.json to SDK version 5.0 to allow F#5 scripting syntax. - Closes #98 --- docsrc/content/codec.fsx | 80 +++++++++++++++++++++++++-- docsrc/content/further-techniques.fsx | 64 +++++++++++++++++++++ docsrc/content/index.md | 3 +- 3 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 docsrc/content/further-techniques.fsx diff --git a/docsrc/content/codec.fsx b/docsrc/content/codec.fsx index 358b07ff..1157434a 100644 --- a/docsrc/content/codec.fsx +++ b/docsrc/content/codec.fsx @@ -1,9 +1,9 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" +#r "nuget: System.Json" +#r "nuget: Fleece.SystemJson" +#r "nuget: FSharpPlus" open Fleece.SystemJson open Fleece.SystemJson.Operators @@ -60,6 +60,12 @@ type PersonF = { |> jfieldWith jsonValueCodec "children" (fun x -> x.children) (** +Both approaches build a codec from the same pieces: + +- A constructor function that builds a new record from deserialized pieces +- A sequence of field specifications with `jfield/jfieldOpt` or `jreq/jot`. + These specs take a field name and a function for getting that fields value from a record instance. + Discriminated unions can be modeled with alternatives: *) @@ -92,7 +98,73 @@ type ShapeC = (** What's happening here is that we're getting a Codec to/from a Json Object (not neccesarily a JsonValue) which Fleece is able to take it and fill the gap by composing it with a codec from JsonObject to/from JsonValue. -We can also do that by hand, we can manipulate codecs by using functions in the Codec module. Here's an example: +For DUs that carry no data, a function is still necessary: +*) + +type CompassDirection = + | North + | East + | South + | West + with + static member JsonObjCodec = + jchoice + [ + (fun () -> North) jreq "north" (function North -> Some () | _ -> None) + (fun () -> South) jreq "south" (function South -> Some () | _ -> None) + (fun () -> East) jreq "east" (function East -> Some () | _ -> None) + (fun () -> West) jreq "west" (function West -> Some () | _ -> None) + ] + + +(** +A common way to represent algebraic data types in JSON is to use a type tag. +For example: +**) + +let someShapes = """ +[ + { + "type": "rectangle", + "width": 8.8, + "length": 12.0 + }, + { + "type": "circle", + "radius": "37.8" + }, + { + "type": "prism", + "width": [10.0, 23.0], + "height": 9.10 + } +] +""" + +open FSharpPlus.Operators + +type ShapeD = + | Rectangle of width : float * length : float + | Circle of radius : float + | Prism of width : float * float * height : float + with + static member JsonObjCodec = + jchoice + [ + Rectangle jreq "type" (function Rectangle (_) -> Some "rectangle" | _ -> None) + <*> jreq "width" (function Rectangle(w, _) -> Some w | _ -> None) + <*> jreq "length" (function Rectangle(_, l) -> Some l | _ -> None) + + Circle jreq "type" (function Circle (_) -> Some "circle" | _ -> None) + <*> jreq "radius" (function Circle (r) -> Some r | _ -> None) + + Prism jreq "type" (function Prism (_) -> Some "prism" | _ -> None) + <*> jreq "width" (function Prism (x, y, _) -> Some (x, y) | _ -> None) + <*> jreq "height" (function Prism (_, _, h) -> Some h | _ -> None) + ] + +(** +We can manipulate codecs by using functions in the Codec module. Here's an example: *) open System.Text let pf : PersonF= {name = ("John", "Doe"); age = None; children = [{name = ("Johnny", "Doe"); age = Some 21; children = []}]} diff --git a/docsrc/content/further-techniques.fsx b/docsrc/content/further-techniques.fsx new file mode 100644 index 00000000..135df0f3 --- /dev/null +++ b/docsrc/content/further-techniques.fsx @@ -0,0 +1,64 @@ +(*** hide ***) +// This block of code is omitted in the generated HTML documentation. Use +// it to define helpers that you do not want to show in the documentation. +#r "nuget: System.Json" +#r "nuget: Fleece.SystemJson" +#r "nuget: FSharpPlus" + +open Fleece.SystemJson +open Fleece.SystemJson.Operators + +(** +Sometimes, the JSON required by a given situation will contain fields that do not need to be present in the F# data model. +For example, the JSON-RPC 2.0 specification requires every request/response object to carry the field `jsonrpc` with value `"2.0"`. +In a codebase that only uses JSON-RPC 2.0, why capture this field on a record? + +When writing `ToJson` and `OfJson` methods for this data, handling the required field is fairly natural: +*) + +type Request = + { Method: string + MethodParams: Map} + static member ToJson (r: Request) = + jobj [ + "method" .= r.Method + "params" .= r.MethodParams + "jsonrpc" .= "2.0" + ] + static member OfJson json = + match json with + | JObject o -> + let method = o .@ "method" + let methodParams = o .@ "params" + // We require the "jsonrpc" field to be present + let jsonrpc = o .@ "jsonrpc" + match method, methodParams, jsonrpc with + | Decode.Success m, Decode.Success p, Decode.Success "2.0" -> // We enforce the value of the field + // ...but do not use it in the final object + Decode.Success { + Method = m + MethodParams = p + } + | x -> Error <| Uncategorized (sprintf "Error parsing person: %A" x) + | x -> Decode.Fail.objExpected x + +(** +The can also be modeled with Codecs: +*) + +type Response = + { Result: string option + Error: string option } + static member JsonObjCodec = + fun r e _ -> { Result = r; Error = e } + |> withFields + |> jfieldOpt "result" (fun r -> r.Result) + |> jfieldOpt "error" (fun r -> r.Error) + |> jfield "jsonrpc" (fun _ -> "2.0") + +(** +There are three parts to this. +First, the constructor is given an unused third parameter, which will receive the field required on the JSON object. +Second, the `"jsonrpc"` field is required using `jfield`; its getter always returns `"2.0"` +Finally: the fields must be in the correct order -- that is, the field specs must follow the order of the arguments in the constructor. +*) diff --git a/docsrc/content/index.md b/docsrc/content/index.md index 0ccbe428..7d0eeb1d 100644 --- a/docsrc/content/index.md +++ b/docsrc/content/index.md @@ -1,7 +1,7 @@ Fleece ====== -Fleece is a library intended to help with parsing and crafting specific Json without having to write data transfer objects in order to get the expected +Fleece is a library intended to help with parsing and crafting specific JSON without having to write data transfer objects in order to get the expected representation. ### Introduction @@ -11,6 +11,7 @@ You can get an overview of the important part of the library by reading the foll - [ToJson and OfJson](./to-json-and-of-json.html) are the basic building blocks - [Codec](./codec.html) let's you combine both ToJson and OfJson in one declaration - [Combinators](./combinators.html) lets you have more control + - [Further Techniques](./further-techniques.html) describes ways of solving various JSON-wrangling problems ### Integration with Web frameworks From 867fc72e3910317dafc9476308c8a4668f8849c8 Mon Sep 17 00:00:00 2001 From: Ross Donaldson Date: Sun, 25 Apr 2021 14:31:06 -0400 Subject: [PATCH 04/14] These were somehow re-introduced during rebase, which is incorrect. --- src/Fleece.FSharpData/Fleece.FSharpData.fsproj | 4 ---- src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj | 4 ---- src/Fleece.SystemJson/Fleece.SystemJson.fsproj | 4 ---- src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj | 4 ---- 4 files changed, 16 deletions(-) diff --git a/src/Fleece.FSharpData/Fleece.FSharpData.fsproj b/src/Fleece.FSharpData/Fleece.FSharpData.fsproj index f2412b28..73814754 100644 --- a/src/Fleece.FSharpData/Fleece.FSharpData.fsproj +++ b/src/Fleece.FSharpData/Fleece.FSharpData.fsproj @@ -16,9 +16,5 @@ - - all - runtime; build; native; contentfiles; analyzers - diff --git a/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj b/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj index e6266595..776de7ce 100644 --- a/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj +++ b/src/Fleece.NewtonsoftJson/Fleece.NewtonsoftJson.fsproj @@ -16,9 +16,5 @@ - - all - runtime; build; native; contentfiles; analyzers - diff --git a/src/Fleece.SystemJson/Fleece.SystemJson.fsproj b/src/Fleece.SystemJson/Fleece.SystemJson.fsproj index 5c1e0bfb..7799ed5f 100644 --- a/src/Fleece.SystemJson/Fleece.SystemJson.fsproj +++ b/src/Fleece.SystemJson/Fleece.SystemJson.fsproj @@ -16,9 +16,5 @@ - - all - runtime; build; native; contentfiles; analyzers - diff --git a/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj b/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj index 2f337e7b..3181f61e 100644 --- a/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj +++ b/src/Fleece.SystemTextJson/Fleece.SystemTextJson.fsproj @@ -16,9 +16,5 @@ - - all - runtime; build; native; contentfiles; analyzers - From 057a7041f86114274e0cc5939dac3a8eb8dff01d Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 25 Jul 2021 19:38:58 +0200 Subject: [PATCH 05/14] Minor changes + build docs --- .github/workflows/dotnetcore.yml | 18 +++++++++++++++++- docsrc/content/codec.fsx | 16 +++++++++++----- docsrc/content/combinators.fsx | 9 +++++++-- docsrc/content/comparison-with-json-net.fsx | 10 ++++++++-- docsrc/content/further-techniques.fsx | 7 ++++--- docsrc/content/giraffe.fsx | 7 +++---- docsrc/tool/manually_build_docs.sh | 7 +++---- 7 files changed, 53 insertions(+), 21 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 7c91e7c5..f3a7c377 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.405 + dotnet-version: 5.0.301 - name: Install dependencies run: dotnet restore - name: Build @@ -29,3 +29,19 @@ jobs: run: dotnet run --no-build -p ./test/Tests.NewtonsoftJson/Tests.NewtonsoftJson.fsproj -c Release -f netcoreapp3.1 - name: Test SystemTextJson run: dotnet run --no-build -p ./test/Tests.SystemTextJson/Tests.SystemTextJson.fsproj -c Release -f netcoreapp3.1 + docs: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.301 + - name: Install dependencies + run: dotnet restore + - name: Build + run: dotnet build -c Release + - name: Render Docs + run: dotnet run --project ./docsrc/tool diff --git a/docsrc/content/codec.fsx b/docsrc/content/codec.fsx index 1157434a..24ee8b21 100644 --- a/docsrc/content/codec.fsx +++ b/docsrc/content/codec.fsx @@ -1,18 +1,24 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "nuget: System.Json" -#r "nuget: Fleece.SystemJson" -#r "nuget: FSharpPlus" - +#r "nuget: System.Json, 4.7.1" +#r "nuget: FSharpPlus, 1.2.1" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open Fleece.SystemJson open Fleece.SystemJson.Operators + (** + ## CODEC -For types that deserialize to Json Objets, typically (but not limited to) records, you can alternatively use codecs and have a single method which maps between fields and values. +```f# +#r "nuget: Fleece.SystemJson" +open Fleece.SystemJson +open Fleece.SystemJson.Operators +``` +For types that deserialize to Json Objets, typically (but not limited to) records, you can alternatively use codecs and have a single method which maps between fields and values. *) type Person = { diff --git a/docsrc/content/combinators.fsx b/docsrc/content/combinators.fsx index 66aa8f9b..beab053c 100644 --- a/docsrc/content/combinators.fsx +++ b/docsrc/content/combinators.fsx @@ -1,13 +1,18 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" +#r "nuget: System.Json, 4.7.1" +#r "nuget: FSharpPlus, 1.1.1" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" open Fleece.SystemJson (** +```f# +#r "nuget: Fleece.SystemJson" +open Fleece.SystemJson +``` + ## Combinators So far we've seen how Fleece is capable of encoding/decoding by deriving automatically a codec from static members in the type. diff --git a/docsrc/content/comparison-with-json-net.fsx b/docsrc/content/comparison-with-json-net.fsx index af81cea5..fb3ed953 100644 --- a/docsrc/content/comparison-with-json-net.fsx +++ b/docsrc/content/comparison-with-json-net.fsx @@ -1,9 +1,15 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/Newtonsoft.Json.dll" +#r "nuget: Newtonsoft.Json, 10.0.2" +#r "nuget: FSharpPlus, 1.1.1" #r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/Fleece.NewtonsoftJson.dll" -#r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/FSharpPlus.dll" + +(** +```f# +#r "nuget: Fleece.NewtonsoftJson" +``` +*) open System open Newtonsoft.Json diff --git a/docsrc/content/further-techniques.fsx b/docsrc/content/further-techniques.fsx index 135df0f3..36671a14 100644 --- a/docsrc/content/further-techniques.fsx +++ b/docsrc/content/further-techniques.fsx @@ -1,9 +1,9 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r "nuget: System.Json" -#r "nuget: Fleece.SystemJson" -#r "nuget: FSharpPlus" +#r "nuget: System.Json, 4.7.1" +#r "nuget: FSharpPlus, 1.1.1" +#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open Fleece.SystemJson open Fleece.SystemJson.Operators @@ -14,6 +14,7 @@ For example, the JSON-RPC 2.0 specification requires every request/response obje In a codebase that only uses JSON-RPC 2.0, why capture this field on a record? When writing `ToJson` and `OfJson` methods for this data, handling the required field is fairly natural: + *) type Request = diff --git a/docsrc/content/giraffe.fsx b/docsrc/content/giraffe.fsx index 00787886..14190a5a 100644 --- a/docsrc/content/giraffe.fsx +++ b/docsrc/content/giraffe.fsx @@ -1,11 +1,10 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" +#r "nuget: System.Json, 4.7.1" +#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: TaskBuilder.fs" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" -#r @"../../packages/docs/TaskBuilder.fs/lib/net46/TaskBuilder.fs.dll" - module Giraffe= open System.Threading.Tasks open System.IO diff --git a/docsrc/tool/manually_build_docs.sh b/docsrc/tool/manually_build_docs.sh index 807c0966..1b0b3077 100755 --- a/docsrc/tool/manually_build_docs.sh +++ b/docsrc/tool/manually_build_docs.sh @@ -4,14 +4,13 @@ cd ../../ # Restore dotnet tool restore -#./docsrc/tool/download_nugets.sh # Build -# dotnet build -c Release dotnet restore #msbuild /t:Build /p:Configuration=Debug -dotnet build +dotnet build -c Release # Gen docs -dotnet run --project ./docsrc/tool ReleaseDocs +dotnet run --project ./docsrc/tool +# In order to release, append "ReleaseDocs" when running the command # dotnet fsdocs "build" "--input" "docsrc/content/" "--output" "/Users/mathieu/src/fs/Fleece/docsrc/tool/../../docs" "--sourcerepo" "https://github.com/fsprojects/Fleece/tree/master" "--parameters" "root" "/Fleece/" "project-name" "Fleece" "project-author" "Mauricio Scheffer,Lev Gorodinski,Oskar Gewalli, Gustavo P. Leon" "project-summary" "Fleece is a JSON mapper for F#. It simplifies mapping from a Json library's JsonValue onto your types, and mapping from your types onto JsonValue." "project-github" "https://github.com/fsprojects/Fleece" "project-nuget" "http://nuget.org/packages/Fleece" \ No newline at end of file From d525ff94b6f283385286868ea9c29a888fcf7ec5 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 25 Jul 2021 19:48:22 +0200 Subject: [PATCH 06/14] #r nuget --- docsrc/content/giraffe.fsx | 2 +- docsrc/content/suave.fsx | 7 +++---- docsrc/content/to-json-and-of-json.fsx | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docsrc/content/giraffe.fsx b/docsrc/content/giraffe.fsx index 14190a5a..62ca0eaa 100644 --- a/docsrc/content/giraffe.fsx +++ b/docsrc/content/giraffe.fsx @@ -3,7 +3,7 @@ // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" #r "nuget: FSharpPlus, 1.1.1" -#r "nuget: TaskBuilder.fs" +#r "nuget: TaskBuilder.fs, 2.1.0" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" module Giraffe= open System.Threading.Tasks diff --git a/docsrc/content/suave.fsx b/docsrc/content/suave.fsx index b20bcbba..13839417 100644 --- a/docsrc/content/suave.fsx +++ b/docsrc/content/suave.fsx @@ -1,11 +1,10 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" +#r "nuget: System.Json, 4.7.1" +#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: Suave, 2.5.6" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" -#r @"../../packages/docs/Suave/lib/netstandard2.1/Suave.dll" - (** ## Suave diff --git a/docsrc/content/to-json-and-of-json.fsx b/docsrc/content/to-json-and-of-json.fsx index 92e69b2f..ff1fa4a5 100644 --- a/docsrc/content/to-json-and-of-json.fsx +++ b/docsrc/content/to-json-and-of-json.fsx @@ -1,17 +1,16 @@ (*** hide ***) // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/System.Json.dll" +#r "nuget: System.Json, 4.7.1" +#r "nuget: FSharpPlus, 1.1.1" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" -#r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/FSharpPlus.dll" open System.Json open Fleece.SystemJson open Fleece.SystemJson.Operators #if FSHARPDATA -#r @"../../src/Fleece.FSharpData/bin/Release/netstandard2.1/FSharp.Data.dll" +#r "nuget: FSharp.Data, 3.0.0" #r @"../../src/Fleece.FSharpData/bin/Release/netstandard2.1/Fleece.FSharpData.dll" -#r @"../../src/Fleece.FSharpData/bin/Release/netstandard2.1/FSharpPlus.dll" open FSharp.Data open Fleece.FSharpData From 51d27a7f8e3e1c2a1573601d9c7ff8203f962aa2 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 25 Jul 2021 20:01:05 +0200 Subject: [PATCH 07/14] +old netcore --- .github/workflows/dotnetcore.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index f3a7c377..9a00c596 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -17,6 +17,10 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 5.0.301 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.405 - name: Install dependencies run: dotnet restore - name: Build @@ -38,7 +42,11 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.301 + dotnet-version: 2.2.402 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.301 - name: Install dependencies run: dotnet restore - name: Build From 397c6c6ee8012f8635a319a87fc0e0b1b3d3de65 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 25 Jul 2021 20:06:38 +0200 Subject: [PATCH 08/14] +netcore 3 --- .github/workflows/dotnetcore.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 9a00c596..3cf48c81 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -13,11 +13,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup .NET Core + - name: Setup .NET Core 5 uses: actions/setup-dotnet@v1 with: dotnet-version: 5.0.301 - - name: Setup .NET Core + - name: Setup .NET Core 3 uses: actions/setup-dotnet@v1 with: dotnet-version: 3.1.405 @@ -39,14 +39,18 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup .NET Core + - name: Setup .NET Core 5 uses: actions/setup-dotnet@v1 with: - dotnet-version: 2.2.402 - - name: Setup .NET Core + dotnet-version: 5.0.301 + - name: Setup .NET Core 3 uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.301 + dotnet-version: 3.1.405 + - name: Setup .NET Core 2 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.2.402 - name: Install dependencies run: dotnet restore - name: Build From 573e6612550ab4a1de96bdf8474b5dc0d03ea109 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 25 Jul 2021 20:15:17 +0200 Subject: [PATCH 09/14] +dotnet tool restore --- .github/workflows/dotnetcore.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 3cf48c81..385992b5 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -51,6 +51,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 2.2.402 + - name: Restore dotnet tools + run: dotnet tool restore - name: Install dependencies run: dotnet restore - name: Build From 0783198aacb56032e358a4f706f376a426d4eb16 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Tue, 27 Jul 2021 20:36:02 +0200 Subject: [PATCH 10/14] +Compile doc src --- .github/workflows/dotnetcore.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 385992b5..77f42a90 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -57,5 +57,7 @@ jobs: run: dotnet restore - name: Build run: dotnet build -c Release + - name: Build Doc src + run: dotnet build -c Release ./docsrc/docs - name: Render Docs run: dotnet run --project ./docsrc/tool From a1a55a42f3c2010e2177c9fef35064cd63f4b34c Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Tue, 27 Jul 2021 20:40:04 +0200 Subject: [PATCH 11/14] Use monad.strict --- docsrc/content/comparison-with-json-net.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsrc/content/comparison-with-json-net.fsx b/docsrc/content/comparison-with-json-net.fsx index fb3ed953..6ccc6098 100644 --- a/docsrc/content/comparison-with-json-net.fsx +++ b/docsrc/content/comparison-with-json-net.fsx @@ -60,7 +60,7 @@ with static member OfJson (json:Linq.JToken) = match json with | JObject o -> - monad { + monad.strict { match! o .@ "type" with | "Bike" -> return Bike | "Car" -> From f992f55b9ce7566257685b2e44456439e7bec3b1 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Wed, 28 Jul 2021 20:16:47 +0200 Subject: [PATCH 12/14] jreqValue --- docsrc/content/codec.fsx | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/docsrc/content/codec.fsx b/docsrc/content/codec.fsx index 24ee8b21..b91333d7 100644 --- a/docsrc/content/codec.fsx +++ b/docsrc/content/codec.fsx @@ -137,7 +137,7 @@ let someShapes = """ }, { "type": "circle", - "radius": "37.8" + "radius": 37.8 }, { "type": "prism", @@ -147,6 +147,7 @@ let someShapes = """ ] """ +open FSharpPlus open FSharpPlus.Operators type ShapeD = @@ -155,20 +156,42 @@ type ShapeD = | Prism of width : float * float * height : float with static member JsonObjCodec = + /// Derives a concrete field codec for a required field and value + let inline jreqValue prop value codec = + let matchPropValue o = + match IReadOnlyDictionary.tryGetValue prop o with + | Some a when (ofJson a) = Ok value -> Ok o + | Some a -> Decode.Fail.invalidValue a value + | None -> Decode.Fail.propertyNotFound prop o + Codec.ofConcrete codec + |> Codec.compose ( + matchPropValue, + fun encoded -> + if encoded.Count=0 then encoded // we have not encoded anything so no need to add property and value + else IReadOnlyDictionary.union (Dict.toIReadOnlyDictionary (dict [prop, toJson value])) encoded + ) + |> Codec.toConcrete + + jchoice [ - Rectangle jreq "type" (function Rectangle (_) -> Some "rectangle" | _ -> None) - <*> jreq "width" (function Rectangle(w, _) -> Some w | _ -> None) + fun w l -> Rectangle (w,l) + jreq "width" (function Rectangle(w, _) -> Some w | _ -> None) <*> jreq "length" (function Rectangle(_, l) -> Some l | _ -> None) + |> jreqValue "type" "rectangle" - Circle jreq "type" (function Circle (_) -> Some "circle" | _ -> None) - <*> jreq "radius" (function Circle (r) -> Some r | _ -> None) + Circle + jreq "radius" (function Circle (r) -> Some r | _ -> None) + |> jreqValue "type" "circle" - Prism jreq "type" (function Prism (_) -> Some "prism" | _ -> None) - <*> jreq "width" (function Prism (x, y, _) -> Some (x, y) | _ -> None) + fun (w,w2) h -> Prism (w,w2,h) + jreq "width" (function Prism (x, y, _) -> Some (x, y) | _ -> None) <*> jreq "height" (function Prism (_, _, h) -> Some h | _ -> None) + |> jreqValue "type" "prism" ] +let parsedShapedD = parseJson someShapes + (** We can manipulate codecs by using functions in the Codec module. Here's an example: *) From 65a59cf94d9f039aa7b65e797bad4459acd0375e Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sat, 6 Nov 2021 09:43:33 +0100 Subject: [PATCH 13/14] F#+ version in docs --- docsrc/content/combinators.fsx | 2 +- docsrc/content/comparison-with-json-net.fsx | 2 +- docsrc/content/further-techniques.fsx | 2 +- docsrc/content/giraffe.fsx | 2 +- docsrc/content/suave.fsx | 2 +- docsrc/content/to-json-and-of-json.fsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docsrc/content/combinators.fsx b/docsrc/content/combinators.fsx index beab053c..aaedf7f4 100644 --- a/docsrc/content/combinators.fsx +++ b/docsrc/content/combinators.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: FSharpPlus, 1.2.1" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open Fleece.SystemJson diff --git a/docsrc/content/comparison-with-json-net.fsx b/docsrc/content/comparison-with-json-net.fsx index 6ccc6098..065b6931 100644 --- a/docsrc/content/comparison-with-json-net.fsx +++ b/docsrc/content/comparison-with-json-net.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: Newtonsoft.Json, 10.0.2" -#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: FSharpPlus, 1.2.1" #r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/Fleece.NewtonsoftJson.dll" (** diff --git a/docsrc/content/further-techniques.fsx b/docsrc/content/further-techniques.fsx index 36671a14..ef26a486 100644 --- a/docsrc/content/further-techniques.fsx +++ b/docsrc/content/further-techniques.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: FSharpPlus, 1.2.1" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open Fleece.SystemJson diff --git a/docsrc/content/giraffe.fsx b/docsrc/content/giraffe.fsx index 62ca0eaa..8ad8dd22 100644 --- a/docsrc/content/giraffe.fsx +++ b/docsrc/content/giraffe.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: FSharpPlus, 1.2.1" #r "nuget: TaskBuilder.fs, 2.1.0" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" module Giraffe= diff --git a/docsrc/content/suave.fsx b/docsrc/content/suave.fsx index 13839417..86798479 100644 --- a/docsrc/content/suave.fsx +++ b/docsrc/content/suave.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: FSharpPlus, 1.2.1" #r "nuget: Suave, 2.5.6" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" diff --git a/docsrc/content/to-json-and-of-json.fsx b/docsrc/content/to-json-and-of-json.fsx index ff1fa4a5..01106c1b 100644 --- a/docsrc/content/to-json-and-of-json.fsx +++ b/docsrc/content/to-json-and-of-json.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.1.1" +#r "nuget: FSharpPlus, 1.2.1" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open System.Json From 998ad14b894822efa68a54df1091322266358d75 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sat, 6 Nov 2021 10:08:33 +0100 Subject: [PATCH 14/14] Fixes after codereview --- docsrc/content/codec.fsx | 2 +- docsrc/content/combinators.fsx | 2 +- docsrc/content/comparison-with-json-net.fsx | 2 +- docsrc/content/further-techniques.fsx | 4 ++-- docsrc/content/giraffe.fsx | 2 +- docsrc/content/suave.fsx | 2 +- docsrc/content/to-json-and-of-json.fsx | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docsrc/content/codec.fsx b/docsrc/content/codec.fsx index b91333d7..f8bd21d5 100644 --- a/docsrc/content/codec.fsx +++ b/docsrc/content/codec.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.2.1" +#r "nuget: FSharpPlus, 1.2.2" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open Fleece.SystemJson open Fleece.SystemJson.Operators diff --git a/docsrc/content/combinators.fsx b/docsrc/content/combinators.fsx index aaedf7f4..2460d711 100644 --- a/docsrc/content/combinators.fsx +++ b/docsrc/content/combinators.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.2.1" +#r "nuget: FSharpPlus, 1.2.2" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open Fleece.SystemJson diff --git a/docsrc/content/comparison-with-json-net.fsx b/docsrc/content/comparison-with-json-net.fsx index 065b6931..3886aa84 100644 --- a/docsrc/content/comparison-with-json-net.fsx +++ b/docsrc/content/comparison-with-json-net.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: Newtonsoft.Json, 10.0.2" -#r "nuget: FSharpPlus, 1.2.1" +#r "nuget: FSharpPlus, 1.2.2" #r @"../../src/Fleece.NewtonsoftJson/bin/Release/netstandard2.1/Fleece.NewtonsoftJson.dll" (** diff --git a/docsrc/content/further-techniques.fsx b/docsrc/content/further-techniques.fsx index ef26a486..a7fc3e3a 100644 --- a/docsrc/content/further-techniques.fsx +++ b/docsrc/content/further-techniques.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.2.1" +#r "nuget: FSharpPlus, 1.2.2" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open Fleece.SystemJson @@ -44,7 +44,7 @@ type Request = | x -> Decode.Fail.objExpected x (** -The can also be modeled with Codecs: +This can also be modeled with Codecs: *) type Response = diff --git a/docsrc/content/giraffe.fsx b/docsrc/content/giraffe.fsx index 8ad8dd22..a5b19edd 100644 --- a/docsrc/content/giraffe.fsx +++ b/docsrc/content/giraffe.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.2.1" +#r "nuget: FSharpPlus, 1.2.2" #r "nuget: TaskBuilder.fs, 2.1.0" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" module Giraffe= diff --git a/docsrc/content/suave.fsx b/docsrc/content/suave.fsx index 86798479..73cf3c1e 100644 --- a/docsrc/content/suave.fsx +++ b/docsrc/content/suave.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.2.1" +#r "nuget: FSharpPlus, 1.2.2" #r "nuget: Suave, 2.5.6" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" diff --git a/docsrc/content/to-json-and-of-json.fsx b/docsrc/content/to-json-and-of-json.fsx index 01106c1b..7e665f80 100644 --- a/docsrc/content/to-json-and-of-json.fsx +++ b/docsrc/content/to-json-and-of-json.fsx @@ -2,7 +2,7 @@ // This block of code is omitted in the generated HTML documentation. Use // it to define helpers that you do not want to show in the documentation. #r "nuget: System.Json, 4.7.1" -#r "nuget: FSharpPlus, 1.2.1" +#r "nuget: FSharpPlus, 1.2.2" #r @"../../src/Fleece.SystemJson/bin/Release/netstandard2.1/Fleece.SystemJson.dll" open System.Json