Your are looking at version 1 of Thoth.Json and Thoth.Json.Net.
-
Please consider upgrading your project to a newest version.
-
-
-
-## Decoder
-
-Turn JSON values into F# values.
-
-By using a Decoder instead of Fable `ofJson` function, you will be guaranteed that the JSON structure is correct.
-This is especially useful if you use Fable without sharing your domain with the server.
-
-*This module is inspired by [Json.Decode from Elm](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode)
-and [elm-decode-pipeline](http://package.elm-lang.org/packages/NoRedInk/elm-decode-pipeline/latest).*
-
-As so, to complete this documentation, you can also take a look at the [Elm documentation](https://guide.elm-lang.org/interop/json.html).
-
-### What is a Decoder ?
-
-Here is the signature of a `Decoder`:
-
-```fsharp
-type Decoder<'T> = obj -> Result<'T, DecoderError>
-```
-
-This is taking an "untyped" value and checking if it has the expected structure. If the structure is correct,
-then you get an `Ok` result, otherwise an `Error` explaining why the decoder failed.
-
-### Primitives decoders
-
-- `string : Decoder`
-- `int : Decoder`
-- `float : Decoder`
-- `bool : Decoder`
-
-```fsharp
-open Thoth.Json.Decode
-
-> decodeString string "\"maxime\""
-val it : Result = Ok "maxime"
-
-> decodeString int "25"
-val it : Result = Ok 25
-
-> decodeString bool "true"
-val it : Result = Ok true
-
-> decodeString float "true"
-val it : Result = Err "Expecting a float but instead got: true"
-```
-
-With these primitives decoders we can handle the basic JSON values.
-
-### Collections
-
-There are special decoders for the following collections.
-
-- `list : Decoder<'value> -> Decoder<'value list>`
-- `array : Decoder<'value> -> Decoder<'value array>`
-
-```fsharp
-open Thoth.Json.Decode
-
-> decodeString (array int) "[1, 2, 3]"
-val it : Result = Ok [|1, 2, 3|]
-
-> decodeString (list string) """["Maxime", "Alfonso", "Vesper"]"""
-val it : Result = Ok ["Maxime", "Alfonso", "Vesper"]
-```
-
-### Decoding Objects
-
-In order to decode objects, you can use:
-
-- `field : string -> Decoder<'value> -> Decoder<'value>`
- - Decode a JSON object, requiring a particular field.
-- `at : string list -> Decoder<'value> -> Decoder<'value>`
- - Decode a JSON object, requiring certain path.
-
-```fsharp
-open Thoth.Json.Decode
-
-> decodeString (field "x" int) """{"x": 10, "y": 21}"""
-val it : Result = Ok 10
-
-> decodeString (field "y" int) """{"x": 10, "y": 21}"""
-val it : Result = Ok 21
-```
-
-**Important:**
-
-These two decoders only take into account the field or path. The object can have other fields/paths with other content.
-
-#### Map functions
-
-To get data from several fields and convert them into a record you will need to use the `map` functions
-like `map2`, `map3`, ..., `map8`.
-
-```fsharp
-open Thoth.Json.Decode
-
-type Point =
- { X : int
- Y : int }
-
- static member Decoder : Decoder =
- map2 (fun x y ->
- { X = x
- Y = y } : Point)
- (field "x" int)
- (field "y" int)
-
-> decodeString Point.Decoder """{"x": 10, "y": 21}"""
-val it : Result = Ok { X = 10; Y = 21 }
-```
-
-#### Pipeline decode style
-
-When working with a larger object or if you prefer to use the `(|>)` operator, you can use the pipeline helpers.
-
-```fsharp
-open Thoth.Json.Decode
-
-type Point =
- { X : int
- Y : int }
-
- static member Decoder =
- decode
- (fun x y ->
- { X = x
- Y = y } : Point)
- |> required "x" int
- |> required "y" int
-
-> decodeString Point.Decoder """{"x": 10, "y": 21}"""
-val it : Result = Ok { X = 10; Y = 21 }
-```
-
-## Encoder
-
-Module for turning F# values into JSON values.
-
-*This module is inspired by [Json.Encode from Elm](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Encode).*
-
-### How to use it ?
-
-```fsharp
- open Thoth.Json.Encode
-
- let person =
- object
- [ "firstname", string "maxime"
- "surname", string "mangel"
- "age", int 25
- "address", object
- [ "street", string "main street"
- "city", string "Bordeaux" ]
- ]
-
- let compact = encode 0 person
- // {"firstname":"maxime","surname":"mangel","age":25,"address":{"street":"main street","city":"Bordeaux"}}
-
- let readable = encode 4 person
- // {
- // "firstname": "maxime",
- // "surname": "mangel",
- // "age": 25,
- // "address": {
- // "street": "main street",
- // "city": "Bordeaux"
- // }
- // }
-```
-
-## .Net & NetCore support
-
-You can share your decoders and encoders **between your client and server**.
-
-In order to use Thoth.Json API on .Net or NetCore you need to use the `Thoth.Json.Net` package.
-
-### Code sample
-
-```fsharp
-// By adding this condition, you can share your code between your client and server
-##if FABLE_COMPILER
-open Thoth.Json
-##else
-open Thoth.Json.Net
-##endif
-
-type User =
- { Id : int
- Name : string
- Email : string
- Followers : int }
-
- static member Decoder =
- Decode.decode
- (fun id email name followers ->
- { Id = id
- Name = name
- Email = email
- Followers = followers })
- |> Decode.required "id" Decode.int
- |> Decode.required "email" Decode.string
- |> Decode.optional "name" Decode.string ""
- |> Decode.hardcoded 0
-
- static member Encoder (user : User) =
- Encode.object
- [ "id", Encode.int user.Id
- "name", Encode.string user.Name
- "email", Encode.string user.Email
- "followers", Encode.int user.Followers
- ]
-```
diff --git a/docs/legacy/v2.md b/docs/legacy/v2.md
deleted file mode 100644
index 5570a3a..0000000
--- a/docs/legacy/v2.md
+++ /dev/null
@@ -1,359 +0,0 @@
----
-title: Thoth.Json
----
-
-[[toc]]
-
-:::warning
-Your are looking at **version 2** of Thoth.Json and Thoth.Json.Net.
-
-Please consider upgrading your project to a newest version.
-:::
-
-
-
-Version 2 of Thoth.Json and Thoth.Json.Net only support Fable 2.
-
-
-
-## Decoder
-
-Turn JSON values into F# values.
-
-By using a Decoder, you will be guaranteed that the JSON structure is correct.
-This is especially useful if you use Fable without sharing your domain with the server.
-
-*This module is inspired by [Json.Decode from Elm](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode)
-and [elm-decode-pipeline](http://package.elm-lang.org/packages/NoRedInk/elm-decode-pipeline/latest).*
-
-As so, to complete this documentation, you can also take a look at the [Elm documentation](https://guide.elm-lang.org/interop/json.html).
-
-### What is a Decoder ?
-
-Here is the signature of a `Decoder`:
-
-```fsharp
-type Decoder<'T> = string -> obj -> Result<'T, DecoderError>
-```
-
-This is taking two arguments:
-
-- the traveled path
-- an "untyped" value and checking if it has the expected structure.
-
-If the structure is correct, then you get an `Ok` result, otherwise an `Error` explaining why and where the decoder failed.
-
-Example of error:
-
-```fsharp
-Error at: `$.user.firstname`
-Expecting an object with path `user.firstname` but instead got:
-{
- "user": {
- "name": "maxime",
- "age": 25
- }
-}
-Node `firstname` is unknown.
-```
-
-The path generated is a valid `JSONPath`, so you can use tools like [JSONPath Online Evaluator](http://jsonpath.com/) to explore your JSON.
-
-### Primitives decoders
-
-- `string : Decoder`
-- `guid : Decoder`
-- `int : Decoder`
-- `int64 : Decoder`
-- `uint64 : Decoder`
-- `bigint : Decoder`
-- `bool : Decoder`
-- `float : Decoder`
-- `decimal : Decoder`
-- `datetime : Decoder`
-- `datetimeOffset : Decoder`
-
-```fsharp
-open Thoth.Json
-
-> Decode.fromString Decode.string "\"maxime\""
-val it : Result = Ok "maxime"
-
-> Decode.fromString Decode.int "25"
-val it : Result = Ok 25
-
-> Decode.fromString Decode.bool "true"
-val it : Result = Ok true
-
-> Decode.fromString Decode.float "true"
-val it : Result = Error "Error at: `$$`\n Expecting a float but instead got: true"
-```
-
-With these primitives decoders we can handle the basic JSON values.
-
-### Collections
-
-There are special decoders for the following collections.
-
-- `list : Decoder<'value> -> Decoder<'value list>`
-- `array : Decoder<'value> -> Decoder<'value array>`
-- `index : -> int -> Decoder<'value> -> Decoder<'value>`
-
-```fsharp
-open Thoth.Json
-
-> Decode.fromString (array int) "[1, 2, 3]"
-val it : Result = Ok [|1, 2, 3|]
-
-> Decode.fromString (list string) """["Maxime", "Alfonso", "Vesper"]"""
-val it : Result = Ok ["Maxime", "Alfonso", "Vesper"]
-
-> Decode.fromString (Decode.index 1 Decode.string) """["maxime", "alfonso", "steffen"]"""
-val it : Result = Ok("alfonso")
-```
-
-### Decoding Objects
-
-In order to decode objects, you can use:
-
-- `field : string -> Decoder<'value> -> Decoder<'value>`
- - Decode a JSON object, requiring a particular field.
-- `at : string list -> Decoder<'value> -> Decoder<'value>`
- - Decode a JSON object, requiring certain path.
-
-```fsharp
-open Thoth.Json
-
-> Decode.fromString (field "x" int) """{"x": 10, "y": 21}"""
-val it : Result = Ok 10
-
-> Decode.fromString (field "y" int) """{"x": 10, "y": 21}"""
-val it : Result = Ok 21
-```
-
-**Important:**
-
-These two decoders only take into account the provided field or path. The object can have other fields/paths with other content.
-
-#### Map functions
-
-To get data from several fields and convert them into a record you will need to use the `map` functions
-like `map2`, `map3`, ..., `map8`.
-
-```fsharp
-open Thoth.Json
-
-type Point =
- { X : int
- Y : int }
-
- static member Decoder : Decode.Decoder =
- Decode.map2 (fun x y ->
- { X = x
- Y = y } : Point)
- (Decode.field "x" Decode.int)
- (Decode.field "y" Decode.int)
-
-> Decode.fromString Point.Decoder """{"x": 10, "y": 21}"""
-val it : Result = Ok { X = 10; Y = 21 }
-```
-
-#### Object builder style
-
-When working with a larger object, you can use the object builder helper.
-
-```fsharp
-open Thoth.Json
-
-type User =
- { Id : int
- Name : string
- Email : string
- Followers : int }
-
- static member Decoder : Decode.Decoder =
- Decode.object
- (fun get ->
- { Id = get.Required.Field "id" Decode.int
- Name = get.Optional.Field "name" Decode.string
- |> Option.defaultValue ""
- Email = get.Required.Field "email" Decode.string
- Followers = 0 }
- )
-
-> Decode.fromString User.Decoder """{ "id": 67, "email": "user@mail.com" }"""
-val it : Result = Ok { Id = 67; Name = ""; Email = "user@mail.com"; Followers = 0 }
-```
-
-#### Auto decoder
-
-If your JSON structure is a one to one match, with your F# type, you can use auto decoders. Auto decoders, will generate the decoder at runtime for you and still guarantee that the JSON structure is correct.
-
-```fsharp
-> let json = """{ "Id" : 0, "Name": "maxime", "Email": "mail@domain.com", "Followers": 0 }"""
-> Decode.Auto.fromString(json)
-val it : Result = Ok { Id = 0; Name = "maxime"; Email = "mail@domain.com"; Followers = 0 }
-```
-
-Auto decoder accept an optional argument `isCamelCase`:
-- if `true`, then the keys in the JSON are considered `camelCase`
-- if `false`, then the keys in the JSON are considered `PascalCase`
-
-```fsharp
-> let json = """{ "id" : 0, "name": "maxime", "email": "mail@domain.com", "followers": 0 }"""
-> Decode.Auto.fromString(json, isCamelCase=true)
-val it : Result = Ok { Id = 0; Name = "maxime"; Email = "mail@domain.com"; Followers = 0 }
-```
-
-If you prefer not to deal with a `Result<'T, string>` type you can use `Decode.Auto.unsafeFromString`.
-- if the decoder succeed, it returns `'T`.
-- if the decoder failed, it will throw an exception with the explanation in the `Message` property.
-
-### Size optimization
-
-Note auto decoders use reflection info, which in Fable 2 is generated in the call site. If you want to save some bytes in the generated JS code, it's recommended to cache decoders instead of using `Decode.Auto.fromString` directly.
-
-```fsharp
-// Instead of:
-let method1 json =
- Decode.Auto.fromString json
-
-let method2 json =
- Decode.Auto.fromString json
-
-// Do this:
-let fooDecoder = Decode.Auto.generateDecoder()
-
-let method1 json =
- Decode.fromString fooDecoder json
-
-let method2 json =
- Decode.fromString fooDecoder json
-```
-
-For similar reasons, when possible it's better to compose decoders instead of generating them automatically.
-
-```fsharp
-// Instead of:
-type Group = { foo: Foo; bar: Bar }
-
-let fooDecoder = Decode.Auto.generateDecoder()
-let barDecoder = Decode.Auto.generateDecoder()
-
-let fooListDecoder = Decode.Auto.generateDecoder()
-let groupDecoder = Decode.Auto.generateDecoder()
-
-// Do this:
-let fooListDecoder: Decode.Decoder =
- Decode.list fooDecoder
-
-let groupDecoder: Decode.Decoder =
- Decode.object (fun get ->
- { foo = get.Required.Field "foo" fooDecoder
- bar = get.Required.Field "bar" barDecoder })
-```
-
-## Encoder
-
-Module for turning F# values into JSON values.
-
-*This module is inspired by [Json.Encode from Elm](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Encode).*
-
-### How to use it ?
-
-```fsharp
- open Thoth.Json
-
- let person =
- Encode.object
- [ "firstname", Encode.string "maxime"
- "surname", Encode.string "mangel"
- "age", Encode.int 25
- "address", Encode.object
- [ "street", Encode.string "main street"
- "city", Encode.string "Bordeaux" ]
- ]
-
- let compact = Encode.toString 0 person
- // {"firstname":"maxime","surname":"mangel","age":25,"address":{"street":"main street","city":"Bordeaux"}}
-
- let readable = Encode.toString 4 person
- // {
- // "firstname": "maxime",
- // "surname": "mangel",
- // "age": 25,
- // "address": {
- // "street": "main street",
- // "city": "Bordeaux"
- // }
- // }
-```
-
-### Auto encoder
-
-```fsharp
-type User =
- { Id : int
- Name : string
- Email : string
- Followers : int }
-
-let user =
- { Id = 0
- Name = "maxime"
- Email = "mail@domain.com"
- Followers = 0 }
-
-let json = Encode.Auto.toString(4, user)
-// {
-// "Id": 0,
-// "Name": "maxime",
-// "Email": "mail@domain.com",
-// "Followers": 0
-// }
-```
-
-## .Net & NetCore support
-
-You can share your decoders and encoders **between your client and server**.
-
-In order to use Thoth.Json API on .Net or NetCore you need to use the `Thoth.Json.Net` package.
-
-### Code sample
-
-```fsharp
-// By adding this condition, you can share your code between your client and server
-##if FABLE_COMPILER
-open Thoth.Json
-##else
-open Thoth.Json.Net
-##endif
-
-type User =
- { Id : int
- Name : string
- Email : string
- Followers : int }
-
- static member Decoder : Decode.Decoder =
- Decode.object
- (fun get ->
- { Id = get.Required.Field "id" Decode.int
- Name = get.Optional.Field "name" Decode.string
- |> Option.defaultValue ""
- Email = get.Required.Field "email" Decode.string
- Followers = 0 }
- )
-
- static member Encoder (user : User) =
- Encode.object
- [ "id", Encode.int user.Id
- "name", Encode.string user.Name
- "email", Encode.string user.Email
- "followers", Encode.int user.Followers
- ]
-```
-
-### Online tool
-
-Convert a JSON snippet to F# record with Decoders using [JSON to Thoth](https://nojaf.com/redhood/).
diff --git a/docs/legacy/v3.md b/docs/legacy/v3.md
deleted file mode 100644
index 6df6aaf..0000000
--- a/docs/legacy/v3.md
+++ /dev/null
@@ -1,370 +0,0 @@
----
-title: Thoth.Json
----
-
-[[toc]]
-
-:::warning
-Your are looking at **version 3** of Thoth.Json and Thoth.Json.Net.
-
-Please consider upgrading your project to a newest version.
-:::
-
-## Decoder
-
-Turn JSON values into F# values.
-
-By using a Decoder, you will be guaranteed that the JSON structure is correct.
-This is especially useful if you use Fable without sharing your domain with the server.
-
-*This module is inspired by [Json.Decode from Elm](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode)
-and [elm-decode-pipeline](http://package.elm-lang.org/packages/NoRedInk/elm-decode-pipeline/latest).*
-
-You can also take a look at the [Elm documentation](https://guide.elm-lang.org/interop/json.html).
-
-### What is a Decoder?
-
-Here is the signature of a `Decoder`:
-
-```fsharp
-type Decoder<'T> = string -> obj -> Result<'T, DecoderError>
-```
-
-This is taking two arguments:
-
-- the traveled path
-- an "untyped" value and checking if it has the expected structure.
-
-If the structure is correct, then you get an `Ok` result, otherwise an `Error` explaining where and why the decoder failed.
-
-Example of a decoder error:
-
-```fsharp
-Error at: `$.user.firstname`
-Expecting an object with path `user.firstname` but instead got:
-{
- "user": {
- "name": "maxime",
- "age": 25
- }
-}
-Node `firstname` is unknown.
-```
-
-The path generated is a valid `JSONPath`, so you can use tools like [JSONPath Online Evaluator](http://jsonpath.com/) to explore your JSON.
-
-### Primitives decoders
-
-- `string : Decoder`
-- `guid : Decoder`
-- `int : Decoder`
-- `int64 : Decoder`
-- `uint64 : Decoder`
-- `bigint : Decoder`
-- `bool : Decoder`
-- `float : Decoder`
-- `decimal : Decoder`
-- `datetime : Decoder`
-- `datetimeOffset : Decoder`
-- `timespan : Decoder`
-
-```fsharp
-open Thoth.Json
-
-> Decode.fromString Decode.string "\"maxime\""
-val it : Result = Ok "maxime"
-
-> Decode.fromString Decode.int "25"
-val it : Result = Ok 25
-
-> Decode.fromString Decode.bool "true"
-val it : Result = Ok true
-
-> Decode.fromString Decode.float "true"
-val it : Result = Error "Error at: `$$`\n Expecting a float but instead got: true"
-```
-
-With these primitives decoders we can handle basic JSON values.
-
-### Collections
-
-There are special decoders for the following collections.
-
-- `list : Decoder<'value> -> Decoder<'value list>`
-- `array : Decoder<'value> -> Decoder<'value array>`
-- `index : -> int -> Decoder<'value> -> Decoder<'value>`
-
-```fsharp
-open Thoth.Json
-
-> Decode.fromString (array int) "[1, 2, 3]"
-val it : Result = Ok [|1, 2, 3|]
-
-> Decode.fromString (list string) """["Maxime", "Alfonso", "Vesper"]"""
-val it : Result = Ok ["Maxime", "Alfonso", "Vesper"]
-
-> Decode.fromString (Decode.index 1 Decode.string) """["maxime", "alfonso", "steffen"]"""
-val it : Result = Ok("alfonso")
-```
-
-### Decoding Objects
-
-In order to decode objects, you can use:
-
-- `field : string -> Decoder<'value> -> Decoder<'value>`
- - Decode a JSON object, requiring a particular field.
-- `at : string list -> Decoder<'value> -> Decoder<'value>`
- - Decode a JSON object, requiring certain path.
-
-```fsharp
-open Thoth.Json
-
-> Decode.fromString (field "x" int) """{"x": 10, "y": 21}"""
-val it : Result = Ok 10
-
-> Decode.fromString (field "y" int) """{"x": 10, "y": 21}"""
-val it : Result = Ok 21
-```
-
-**Important:**
-
-These two decoders only take into account the provided field or path. The object can have other fields/paths with other content.
-
-#### Map functions
-
-To get data from several fields and convert them into a record you will need to use the `map` functions:
-`map2`, `map3`, ..., `map8`.
-
-```fsharp
-open Thoth.Json
-
-type Point =
- { X : int
- Y : int }
-
- static member Decoder : Decoder =
- Decode.map2 (fun x y ->
- { X = x
- Y = y } : Point)
- (Decode.field "x" Decode.int)
- (Decode.field "y" Decode.int)
-
-> Decode.fromString Point.Decoder """{"x": 10, "y": 21}"""
-val it : Result = Ok { X = 10; Y = 21 }
-```
-
-#### Object builder style
-
-When working with larger objects, you can use the object builder helper.
-
-```fsharp
-open Thoth.Json
-
-type User =
- { Id : int
- Name : string
- Email : string
- Followers : int }
-
- static member Decoder : Decoder =
- Decode.object
- (fun get ->
- { Id = get.Required.Field "id" Decode.int
- Name = get.Optional.Field "name" Decode.string
- |> Option.defaultValue ""
- Email = get.Required.Field "email" Decode.string
- Followers = 0 }
- )
-
-> Decode.fromString User.Decoder """{ "id": 67, "email": "user@mail.com" }"""
-val it : Result = Ok { Id = 67; Name = ""; Email = "user@mail.com"; Followers = 0 }
-```
-
-## Encoder
-
-Module for turning F# values into JSON values.
-
-*This module is inspired by [Json.Encode from Elm](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Encode).*
-
-### How to use it?
-
-```fsharp
- open Thoth.Json
-
- let person =
- Encode.object
- [ "firstname", Encode.string "maxime"
- "surname", Encode.string "mangel"
- "age", Encode.int 25
- "address", Encode.object
- [ "street", Encode.string "main street"
- "city", Encode.string "Bordeaux" ]
- ]
-
- let compact = Encode.toString 0 person
- // {"firstname":"maxime","surname":"mangel","age":25,"address":{"street":"main street","city":"Bordeaux"}}
-
- let readable = Encode.toString 4 person
- // {
- // "firstname": "maxime",
- // "surname": "mangel",
- // "age": 25,
- // "address": {
- // "street": "main street",
- // "city": "Bordeaux"
- // }
- // }
-```
-
-## Auto coders
-
-
-
-
-When using **auto coders**, we are referring to both **auto encoders** and **auto decoders**.
-
-
-
-
-If your JSON structure is a one to one match with your F# type, then you can use auto coders.
-
-### Auto encoder
-
-Auto decoders will generate the decoder at runtime for you and still guarantee that the JSON structure is correct.
-
-```fsharp
-> let json = """{ "Id" : 0, "Name": "maxime", "Email": "mail@domain.com", "Followers": 0 }"""
-> Decode.Auto.fromString(json)
-val it : Result = Ok { Id = 0; Name = "maxime"; Email = "mail@domain.com"; Followers = 0 }
-```
-
-`Decode.Auto` helpers accept an optional argument `isCamelCase`:
-
-- if `true`, then the keys in the JSON are considered `camelCase`
-- if `false`, then the keys in the JSON are considered `PascalCase`
-
-```fsharp
-> let json = """{ "id" : 0, "name": "maxime", "email": "mail@domain.com", "followers": 0 }"""
-> Decode.Auto.fromString(json, isCamelCase=true)
-val it : Result = Ok { Id = 0; Name = "maxime"; Email = "mail@domain.com"; Followers = 0 }
-```
-
-### Auto encoder
-
-Auto decoders will generate the encoder at runtime for you.
-
-```fsharp
-type User =
- { Id : int
- Name : string
- Email : string
- Followers : int }
-
-let user =
- { Id = 0
- Name = "maxime"
- Email = "mail@domain.com"
- Followers = 0 }
-
-let json = Encode.Auto.toString(4, user)
-// {
-// "Id": 0,
-// "Name": "maxime",
-// "Email": "mail@domain.com",
-// "Followers": 0
-// }
-```
-
-### Extra coders
-
-When generating an auto coder, sometimes you will want to use a manual coder for a type nested in your domain hierarchy.
-
-In those cases you can pass **extra coders** that will replace the default (or missing) coders. Use the `Extra` module to build the map for extra coders (see example below).
-
-```fsharp
-let myExtraCoders =
- Extra.empty
- |> Extra.withCustom MyType.Encode MyType.Decode
-```
-
-### Decoding int64, decimal or bigint
-
-Coders for `int64`, `decimal` or `bigint` won't be automatically generated by default. If they were, the bundle size would increase significantly even if you don't intend to use these types.
-
-If required, you can easily include them in your extra coders with the helpers in the `Extra` module:
-
-```fsharp
-let myExtraCoders =
- Extra.empty
- |> Extra.withInt64
- |> Extra.withDecimal
- |> Extra.withCustom MyType.Encode MyType.Decode
-```
-
-### Caching
-
-To avoid having to regenerate your auto coders every time you need them, you can use the helpers with the `Cached` suffix instead (please note in these cases you shouldn't change the value of extra parameters like `isCamelCase` or `extra`).
-
-The easiest way to do it is to include some helpers in your app to easily generate (or retrieve from cache) coders whenever you need them. For example:
-
-```fsharp
-// Note the helpers must be inlined to resolve generic parameters in Fable
-let inline encoder<'T> = Encode.Auto.generateEncoderCached<'T>(isCamelCase = true, extra = myExtraCoders)
-let inline decoder<'T> = Decode.Auto.generateDecoderCached<'T>(isCamelCase = true, extra = myExtraCoders)
-```
-
-Now you can easily invoke the helpers whenever you need a coder. Most of the times you can omit the generic argument as it will be inferred.
-
-```fsharp
-let demo(x : RequestType) : ResponseType =
- let requestJson = encoder x |> Encode.toString 4
- let responseJson = (* Send JSON to server and receive response *)
- Decode.unsafeFromString decoder responseJson
-```
-
-## .Net & NetCore support
-
-You can share your decoders and encoders **between your client and server**.
-
-In order to use Thoth.Json API on .Net or NetCore you need to use the `Thoth.Json.Net` package.
-
-### Code sample
-
-```fsharp
-// By adding this condition, you can share your code between your client and server
-#if FABLE_COMPILER
-open Thoth.Json
-#else
-open Thoth.Json.Net
-#endif
-
-type User =
- { Id : int
- Name : string
- Email : string
- Followers : int }
-
- static member Decoder : Decode.Decoder =
- Decode.object
- (fun get ->
- { Id = get.Required.Field "id" Decode.int
- Name = get.Optional.Field "name" Decode.string
- |> Option.defaultValue ""
- Email = get.Required.Field "email" Decode.string
- Followers = 0 }
- )
-
- static member Encoder (user : User) =
- Encode.object
- [ "id", Encode.int user.Id
- "name", Encode.string user.Name
- "email", Encode.string user.Email
- "followers", Encode.int user.Followers
- ]
-```
-
-### Giraffe
-
-If you're using the [Giraffe](https://github.com/giraffe-fsharp/Giraffe) or [Saturn](https://saturnframework.org/) web servers, you can use the `Thoth.Json.Giraffe` package to enable automatic JSON serialization with Thoth in your responses. Check [how to add a custom serializer](https://github.com/giraffe-fsharp/Giraffe/blob/master/DOCUMENTATION.md#using-a-different-json-serializer) to Giraffe.
-
-> The `ThothSerializer` type also includes some static helpers to deal with JSON directly for request and response streams.
diff --git a/docs/style.scss b/docs/style.scss
deleted file mode 100644
index c5a4787..0000000
--- a/docs/style.scss
+++ /dev/null
@@ -1,32 +0,0 @@
-@import "./../node_modules/bulma/sass/utilities/initial-variables";
-
-$primary: #2D3947;
-$text: #2b2b2b;
-
-$navbar-item-color: $white;
-$navbar-background-color: $primary;
-$navbar-item-hover-color: $white;
-$navbar-item-hover-background-color: lighten($primary, 8%);
-
-$toc-item-active-color: $primary;
-$toc-item-active-font-weight: bold;
-
-$body-size: 14px;
-
-@import "./../node_modules/bulma/bulma.sass";
-@import "./../node_modules/nacara/scss/nacara.scss";
-
-input[type="checkbox"], input[type="radio"] {
- margin-right: .5em;
-}
-
-// Need to underline the current TOC item because chrome doesn't handle
-// font-weight: 1000 and because primary is pretty dark it doesn't work well with a small font-weight
-// Underline helps working around this issue
-.toc-container {
- a {
- &.is-active {
- text-decoration: underline;
- }
- }
-}
diff --git a/global.json b/global.json
index e9aac8c..d151b80 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "3.1.100"
+ "version": "3.1.301"
}
}
diff --git a/nacara.js b/nacara.js
deleted file mode 100644
index 3ea8668..0000000
--- a/nacara.js
+++ /dev/null
@@ -1,96 +0,0 @@
-const standard = require('nacara/dist/layouts/standard/Export').default;
-const mdMessage = require('nacara/dist/js/utils').mdMessage;
-
-module.exports = {
- githubURL: "https://github.com/thoth-org/Thoth.Json",
- url: "https://thoth-org.github.io/",
- source: "docs",
- output: "docs_deploy",
- baseUrl: "/Thoth.Json/",
- editUrl: "https://github.com/thoth-org/Thoth.Json/edit/master/docs",
- title: "Thoth.Json",
- debug: true,
- version: "4.1.0",
- navbar: {
- showVersion: true,
- links: [
- {
- href: "/Thoth.Json/index.html",
- label: "Documentation",
- icon: "fas fa-book"
- },
- {
- href: "/Thoth.Json/changelog.html",
- label: "Changelog",
- icon: "fas fa-tasks"
- },
- {
- href: "https://gitter.im/fable-compiler/Fable",
- label: "Support",
- icon: "fab fa-gitter",
- isExternal: true
- },
- {
- href: "https://github.com/thoth-org/Thoth.Json",
- icon: "fab fa-github",
- isExternal: true
- },
- {
- href: "https://twitter.com/MangelMaxime",
- icon: "fab fa-twitter",
- isExternal: true,
- color: "#55acee"
- }
- ]
- },
- lightner: {
- backgroundColor: "#FAFAFA",
- textColor: "",
- themeFile: "./paket-files/grammars/akamud/vscode-theme-onelight/themes/OneLight.json",
- grammars: [
- "./paket-files/grammars/ionide/ionide-fsgrammar/grammar/fsharp.json",
- ]
- },
- layouts: {
- default: standard.Default,
- changelog: standard.Changelog,
- },
- plugins: {
- markdown: [
- {
- path: 'markdown-it-container',
- args: [
- 'warning',
- mdMessage("warning")
- ]
- },
- {
- path: 'markdown-it-container',
- args: [
- 'info',
- mdMessage("info")
- ]
- },
- {
- path: 'markdown-it-container',
- args: [
- 'success',
- mdMessage("success")
- ]
- },
- {
- path: 'markdown-it-container',
- args: [
- 'danger',
- mdMessage("danger")
- ]
- },
- {
- path: 'nacara/dist/js/markdown-it-anchored.js'
- },
- {
- path: 'nacara/dist/js/markdown-it-toc.js'
- }
- ]
- }
-};
diff --git a/package.json b/package.json
index f2f3309..461c028 100644
--- a/package.json
+++ b/package.json
@@ -2,17 +2,17 @@
"private": true,
"scripts": {},
"devDependencies": {
- "@babel/core": "^7.5.5",
- "@babel/preset-env": "^7.5.5",
- "@fortawesome/fontawesome-free": "^5.10.0",
+ "@babel/core": "^7.11.4",
+ "@babel/preset-env": "^7.11.0",
+ "@fortawesome/fontawesome-free": "^5.14.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"fable-compiler": "^2.4.7",
- "fable-splitter": "^2.1.10",
- "mocha": "^6.2.0",
- "gh-pages": "^2.1.1",
+ "fable-splitter": "^2.2.1",
+ "gh-pages": "^3.1.0",
+ "mocha": "^8.1.2",
"nacara": "^0.2.1",
- "react": "^16.9.0",
- "react-dom": "^16.9.0"
+ "react": "^16.13.1",
+ "react-dom": "^16.13.1"
},
"dependencies": {}
}
diff --git a/paket.dependencies b/paket.dependencies
index e38a278..89f42af 100644
--- a/paket.dependencies
+++ b/paket.dependencies
@@ -1,15 +1,6 @@
-version 5.226.0
+version 5.247.3
source https://www.nuget.org/api/v2
-storage:none
-
-nuget Fable.Core
-nuget FSharp.Core redirects:force
-
-group Grammars
- github akamud/vscode-theme-onelight themes/OneLight.json
- github ionide/ionide-fsgrammar grammar/fsharp.json
-
group netcorebuild
source https://www.nuget.org/api/v2
framework: netstandard2.0
diff --git a/paket.lock b/paket.lock
index 00eee93..1a38fc0 100644
--- a/paket.lock
+++ b/paket.lock
@@ -1,17 +1,5 @@
-STORAGE: NONE
-NUGET
- remote: https://www.nuget.org/api/v2
- Fable.Core (3.1.4)
- FSharp.Core (>= 4.7) - restriction: >= netstandard2.0
- FSharp.Core (4.7) - redirects: force
-GROUP Grammars
-GITHUB
- remote: akamud/vscode-theme-onelight
- themes/OneLight.json (b6e1a53d5ed5e6bc5878fe2e77513ee5395fb4ea)
- remote: ionide/ionide-fsgrammar
- grammar/fsharp.json (b4f43aafa6f843707410fabe9f904ec04fa536dc)
GROUP netcorebuild
STORAGE: NONE
RESTRICTION: == netstandard2.0
@@ -20,155 +8,143 @@ NUGET
BlackFox.Fake.BuildTask (0.1.3)
Fake.Core.Target (>= 5.1)
FSharp.Core (>= 4.3.4)
- BlackFox.VsWhere (1.0)
+ BlackFox.VsWhere (1.1)
FSharp.Core (>= 4.2.3)
- Fake.Api.GitHub (5.19)
- FSharp.Core (>= 4.7)
- Octokit (>= 0.36)
- Fake.Core.CommandLineParsing (5.19)
- FParsec (>= 1.0.3)
- FSharp.Core (>= 4.7)
- Fake.Core.Context (5.19)
- FSharp.Core (>= 4.7)
- Fake.Core.Environment (5.19)
- FSharp.Core (>= 4.7)
- Fake.Core.FakeVar (5.19)
- Fake.Core.Context (>= 5.19)
- FSharp.Core (>= 4.7)
- Fake.Core.Process (5.19)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.FakeVar (>= 5.19)
- Fake.Core.String (>= 5.19)
- Fake.Core.Trace (>= 5.19)
- Fake.IO.FileSystem (>= 5.19)
- FSharp.Core (>= 4.7)
- System.Diagnostics.Process (>= 4.3)
- Fake.Core.ReleaseNotes (5.19)
- Fake.Core.SemVer (>= 5.19)
- Fake.Core.String (>= 5.19)
- FSharp.Core (>= 4.7)
- Fake.Core.SemVer (5.19)
- FSharp.Core (>= 4.7)
- System.Runtime.Numerics (>= 4.3)
- Fake.Core.String (5.19)
- FSharp.Core (>= 4.7)
- Fake.Core.Target (5.19)
- Fake.Core.CommandLineParsing (>= 5.19)
- Fake.Core.Context (>= 5.19)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.FakeVar (>= 5.19)
- Fake.Core.Process (>= 5.19)
- Fake.Core.String (>= 5.19)
- Fake.Core.Trace (>= 5.19)
- FSharp.Control.Reactive (>= 4.2)
- FSharp.Core (>= 4.7)
- System.Reactive.Compatibility (>= 4.3.1)
- Fake.Core.Tasks (5.19)
- Fake.Core.Trace (>= 5.19)
- FSharp.Core (>= 4.7)
- Fake.Core.Trace (5.19)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.FakeVar (>= 5.19)
- FSharp.Core (>= 4.7)
- Fake.Core.Xml (5.19)
- Fake.Core.String (>= 5.19)
- FSharp.Core (>= 4.7)
- System.Xml.ReaderWriter (>= 4.3.1)
- System.Xml.XDocument (>= 4.3)
- System.Xml.XPath (>= 4.3)
- System.Xml.XPath.XDocument (>= 4.3)
- System.Xml.XPath.XmlDocument (>= 4.3)
- Fake.DotNet.Cli (5.19)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.Process (>= 5.19)
- Fake.Core.String (>= 5.19)
- Fake.Core.Trace (>= 5.19)
- Fake.DotNet.MsBuild (>= 5.19)
- Fake.DotNet.NuGet (>= 5.19)
- Fake.IO.FileSystem (>= 5.19)
- FSharp.Core (>= 4.7)
+ Microsoft.Win32.Registry (>= 4.7)
+ Fake.Api.GitHub (5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Octokit (>= 0.48)
+ Fake.Core.CommandLineParsing (5.20.2)
+ FParsec (>= 1.1.1)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.Context (5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.Environment (5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.FakeVar (5.20.2)
+ Fake.Core.Context (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.Process (5.20.2)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.FakeVar (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ Fake.IO.FileSystem (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ System.Collections.Immutable (>= 1.7.1)
+ Fake.Core.ReleaseNotes (5.20.2)
+ Fake.Core.SemVer (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.SemVer (5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.String (5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.Target (5.20.2)
+ Fake.Core.CommandLineParsing (>= 5.20.2)
+ Fake.Core.Context (>= 5.20.2)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.FakeVar (>= 5.20.2)
+ Fake.Core.Process (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ FSharp.Control.Reactive (>= 4.4)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.Tasks (5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.Trace (5.20.2)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.FakeVar (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Core.Xml (5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.DotNet.Cli (5.20.2)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.Process (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ Fake.DotNet.MSBuild (>= 5.20.2)
+ Fake.DotNet.NuGet (>= 5.20.2)
+ Fake.IO.FileSystem (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
Mono.Posix.NETStandard (>= 1.0)
Newtonsoft.Json (>= 12.0.3)
- Fake.DotNet.MsBuild (5.19)
- BlackFox.VsWhere (>= 1.0)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.Process (>= 5.19)
- Fake.Core.String (>= 5.19)
- Fake.Core.Trace (>= 5.19)
- Fake.IO.FileSystem (>= 5.19)
- FSharp.Core (>= 4.7)
- MSBuild.StructuredLogger (>= 2.0.152)
- Fake.DotNet.NuGet (5.19)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.Process (>= 5.19)
- Fake.Core.SemVer (>= 5.19)
- Fake.Core.String (>= 5.19)
- Fake.Core.Tasks (>= 5.19)
- Fake.Core.Trace (>= 5.19)
- Fake.Core.Xml (>= 5.19)
- Fake.IO.FileSystem (>= 5.19)
- Fake.Net.Http (>= 5.19)
- FSharp.Core (>= 4.7)
+ Fake.DotNet.MSBuild (5.20.2)
+ BlackFox.VsWhere (>= 1.1)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.Process (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ Fake.IO.FileSystem (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ MSBuild.StructuredLogger (>= 2.1.133)
+ Fake.DotNet.NuGet (5.20.2)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.Process (>= 5.20.2)
+ Fake.Core.SemVer (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ Fake.Core.Tasks (>= 5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ Fake.Core.Xml (>= 5.20.2)
+ Fake.IO.FileSystem (>= 5.20.2)
+ Fake.Net.Http (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
Newtonsoft.Json (>= 12.0.3)
- NuGet.Protocol (>= 4.9.4)
- System.Net.Http (>= 4.3.4)
- Fake.DotNet.Paket (5.19)
- Fake.Core.Process (>= 5.19)
- Fake.Core.String (>= 5.19)
- Fake.Core.Trace (>= 5.19)
- Fake.DotNet.Cli (>= 5.19)
- Fake.IO.FileSystem (>= 5.19)
- FSharp.Core (>= 4.7)
- Fake.IO.FileSystem (5.19)
- Fake.Core.String (>= 5.19)
- FSharp.Core (>= 4.7)
- System.Diagnostics.FileVersionInfo (>= 4.3)
- System.IO.FileSystem.Watcher (>= 4.3)
- Fake.JavaScript.Yarn (5.19)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.Process (>= 5.19)
- FSharp.Core (>= 4.7)
- Fake.Net.Http (5.19)
- Fake.Core.Trace (>= 5.19)
- FSharp.Core (>= 4.7)
- System.Net.Http (>= 4.3.4)
- Fake.Tools.Git (5.19)
- Fake.Core.Environment (>= 5.19)
- Fake.Core.Process (>= 5.19)
- Fake.Core.SemVer (>= 5.19)
- Fake.Core.String (>= 5.19)
- Fake.Core.Trace (>= 5.19)
- Fake.IO.FileSystem (>= 5.19)
- FSharp.Core (>= 4.7)
- FParsec (1.1)
+ NuGet.Protocol (>= 5.6)
+ Fake.DotNet.Paket (5.20.2)
+ Fake.Core.Process (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ Fake.DotNet.Cli (>= 5.20.2)
+ Fake.IO.FileSystem (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.IO.FileSystem (5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.JavaScript.Yarn (5.20.2)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.Process (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Net.Http (5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ Fake.Tools.Git (5.20.2)
+ Fake.Core.Environment (>= 5.20.2)
+ Fake.Core.Process (>= 5.20.2)
+ Fake.Core.SemVer (>= 5.20.2)
+ Fake.Core.String (>= 5.20.2)
+ Fake.Core.Trace (>= 5.20.2)
+ Fake.IO.FileSystem (>= 5.20.2)
+ FSharp.Core (>= 4.7.2)
+ FParsec (1.1.1)
FSharp.Core (>= 4.3.4)
- FSharp.Control.Reactive (4.2)
- FSharp.Core (>= 4.2.3)
- System.Reactive (>= 4.0)
- FSharp.Core (4.7)
- Microsoft.Build (16.4)
- Microsoft.Build.Framework (16.4)
- System.Runtime.Serialization.Primitives (>= 4.1.1)
- System.Threading.Thread (>= 4.0)
- Microsoft.Build.Tasks.Core (16.4)
- Microsoft.Build.Framework (>= 16.4)
- Microsoft.Build.Utilities.Core (>= 16.4)
+ FSharp.Control.Reactive (4.4.1)
+ FSharp.Core (>= 4.7.2)
+ System.Reactive (>= 4.4.1)
+ FSharp.Core (4.7.2)
+ Microsoft.Build (16.6)
+ Microsoft.Build.Framework (16.6)
+ System.Security.Permissions (>= 4.7)
+ Microsoft.Build.Tasks.Core (16.6)
+ Microsoft.Build.Framework (>= 16.6)
+ Microsoft.Build.Utilities.Core (>= 16.6)
Microsoft.Win32.Registry (>= 4.3)
System.CodeDom (>= 4.4)
System.Collections.Immutable (>= 1.5)
- System.Linq.Parallel (>= 4.0.1)
- System.Net.Http (>= 4.3.4)
System.Reflection.Metadata (>= 1.6)
System.Reflection.TypeExtensions (>= 4.1)
System.Resources.Extensions (>= 4.6)
- System.Resources.Writer (>= 4.0)
+ System.Security.Permissions (>= 4.7)
System.Threading.Tasks.Dataflow (>= 4.9)
- Microsoft.Build.Utilities.Core (16.4)
- Microsoft.Build.Framework (>= 16.4)
+ Microsoft.Build.Utilities.Core (16.6)
+ Microsoft.Build.Framework (>= 16.6)
Microsoft.Win32.Registry (>= 4.3)
System.Collections.Immutable (>= 1.5)
+ System.Security.Permissions (>= 4.7)
System.Text.Encoding.CodePages (>= 4.0.1)
- Microsoft.NETCore.Platforms (3.1)
+ Microsoft.NETCore.Platforms (3.1.1)
Microsoft.NETCore.Targets (3.1)
Microsoft.Win32.Primitives (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
@@ -180,105 +156,49 @@ NUGET
System.Security.AccessControl (>= 4.7)
System.Security.Principal.Windows (>= 4.7)
Mono.Posix.NETStandard (1.0)
- MSBuild.StructuredLogger (2.0.174)
- Microsoft.Build (>= 15.8.166)
- Microsoft.Build.Framework (>= 15.8.166)
- Microsoft.Build.Tasks.Core (>= 15.8.166)
- Microsoft.Build.Utilities.Core (>= 15.8.166)
+ MSBuild.StructuredLogger (2.1.133)
+ Microsoft.Build (>= 16.4)
+ Microsoft.Build.Framework (>= 16.4)
+ Microsoft.Build.Tasks.Core (>= 16.4)
+ Microsoft.Build.Utilities.Core (>= 16.4)
+ System.IO.Compression (>= 4.3)
Newtonsoft.Json (12.0.3)
- NuGet.Common (5.4)
- NuGet.Frameworks (>= 5.4)
+ NuGet.Common (5.6)
+ NuGet.Frameworks (>= 5.6)
System.Diagnostics.Process (>= 4.3)
System.Threading.Thread (>= 4.3)
- NuGet.Configuration (5.4)
- NuGet.Common (>= 5.4)
+ NuGet.Configuration (5.6)
+ NuGet.Common (>= 5.6)
System.Security.Cryptography.ProtectedData (>= 4.3)
- NuGet.Frameworks (5.4)
- NuGet.Packaging (5.4)
+ NuGet.Frameworks (5.6)
+ NuGet.Packaging (5.6)
Newtonsoft.Json (>= 9.0.1)
- NuGet.Configuration (>= 5.4)
- NuGet.Versioning (>= 5.4)
+ NuGet.Configuration (>= 5.6)
+ NuGet.Versioning (>= 5.6)
System.Dynamic.Runtime (>= 4.3)
- NuGet.Protocol (5.4)
- NuGet.Packaging (>= 5.4)
+ NuGet.Protocol (5.6)
+ NuGet.Packaging (>= 5.6)
System.Dynamic.Runtime (>= 4.3)
- NuGet.Versioning (5.4)
- Octokit (0.36)
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
+ NuGet.Versioning (5.6)
+ Octokit (0.48)
runtime.native.System (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
- runtime.native.System.Net.Http (4.3.1)
+ runtime.native.System.IO.Compression (4.3.2)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
- runtime.native.System.Security.Cryptography.Apple (4.3.1)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (>= 4.3.1)
- runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (4.3.1)
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
- System.Buffers (4.5)
+ System.Buffers (4.5.1)
System.CodeDom (4.7)
System.Collections (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
- System.Collections.Concurrent (4.3)
- System.Collections (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Diagnostics.Tracing (>= 4.3)
- System.Globalization (>= 4.3)
- System.Reflection (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Threading (>= 4.3)
- System.Threading.Tasks (>= 4.3)
- System.Collections.Immutable (1.7)
- System.Memory (>= 4.5.3)
+ System.Collections.Immutable (1.7.1)
+ System.Memory (>= 4.5.4)
System.Diagnostics.Debug (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
- System.Diagnostics.DiagnosticSource (4.7)
- System.Memory (>= 4.5.3)
- System.Diagnostics.FileVersionInfo (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- System.Globalization (>= 4.3)
- System.IO (>= 4.3)
- System.IO.FileSystem (>= 4.3)
- System.IO.FileSystem.Primitives (>= 4.3)
- System.Reflection.Metadata (>= 1.4.1)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
System.Diagnostics.Process (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.Win32.Primitives (>= 4.3)
@@ -301,14 +221,6 @@ NUGET
System.Threading.Tasks (>= 4.3)
System.Threading.Thread (>= 4.3)
System.Threading.ThreadPool (>= 4.3)
- System.Diagnostics.Tools (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- Microsoft.NETCore.Targets (>= 1.1)
- System.Runtime (>= 4.3)
- System.Diagnostics.Tracing (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- Microsoft.NETCore.Targets (>= 1.1)
- System.Runtime (>= 4.3)
System.Dynamic.Runtime (4.3)
System.Collections (>= 4.3)
System.Diagnostics.Debug (>= 4.3)
@@ -328,23 +240,27 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
- System.Globalization.Calendars (4.3)
+ System.IO (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
- System.Globalization (>= 4.3)
System.Runtime (>= 4.3)
- System.Globalization.Extensions (4.3)
+ System.Text.Encoding (>= 4.3)
+ System.Threading.Tasks (>= 4.3)
+ System.IO.Compression (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
- System.Globalization (>= 4.3)
+ runtime.native.System (>= 4.3)
+ runtime.native.System.IO.Compression (>= 4.3)
+ System.Buffers (>= 4.3)
+ System.Collections (>= 4.3)
+ System.Diagnostics.Debug (>= 4.3)
+ System.IO (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
+ System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
- System.IO (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- Microsoft.NETCore.Targets (>= 1.1)
- System.Runtime (>= 4.3)
System.Text.Encoding (>= 4.3)
+ System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.IO.FileSystem (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
@@ -357,23 +273,6 @@ NUGET
System.Threading.Tasks (>= 4.3)
System.IO.FileSystem.Primitives (4.3)
System.Runtime (>= 4.3)
- System.IO.FileSystem.Watcher (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- Microsoft.Win32.Primitives (>= 4.3)
- runtime.native.System (>= 4.3)
- System.Collections (>= 4.3)
- System.IO.FileSystem (>= 4.3)
- System.IO.FileSystem.Primitives (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.Handles (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Threading (>= 4.3)
- System.Threading.Overlapped (>= 4.3)
- System.Threading.Tasks (>= 4.3)
- System.Threading.Thread (>= 4.3)
System.Linq (4.3)
System.Collections (>= 4.3)
System.Diagnostics.Debug (>= 4.3)
@@ -398,53 +297,10 @@ NUGET
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Threading (>= 4.3)
- System.Linq.Parallel (4.3)
- System.Collections (>= 4.3)
- System.Collections.Concurrent (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Diagnostics.Tracing (>= 4.3)
- System.Linq (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Threading (>= 4.3)
- System.Threading.Tasks (>= 4.3)
- System.Memory (4.5.3)
- System.Buffers (>= 4.4)
+ System.Memory (4.5.4)
+ System.Buffers (>= 4.5.1)
System.Numerics.Vectors (>= 4.4)
- System.Runtime.CompilerServices.Unsafe (>= 4.5.2)
- System.Net.Http (4.3.4)
- Microsoft.NETCore.Platforms (>= 1.1.1)
- runtime.native.System (>= 4.3)
- runtime.native.System.Net.Http (>= 4.3)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2)
- System.Collections (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Diagnostics.DiagnosticSource (>= 4.3)
- System.Diagnostics.Tracing (>= 4.3)
- System.Globalization (>= 4.3)
- System.Globalization.Extensions (>= 4.3)
- System.IO (>= 4.3)
- System.IO.FileSystem (>= 4.3)
- System.Net.Primitives (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.Handles (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
- System.Security.Cryptography.Algorithms (>= 4.3)
- System.Security.Cryptography.Encoding (>= 4.3)
- System.Security.Cryptography.OpenSsl (>= 4.3)
- System.Security.Cryptography.Primitives (>= 4.3)
- System.Security.Cryptography.X509Certificates (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Threading (>= 4.3)
- System.Threading.Tasks (>= 4.3)
- System.Net.Primitives (4.3.1)
- Microsoft.NETCore.Platforms (>= 1.1.1)
- Microsoft.NETCore.Targets (>= 1.1.3)
- System.Runtime (>= 4.3.1)
- System.Runtime.Handles (>= 4.3)
+ System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
System.Numerics.Vectors (4.5)
System.ObjectModel (4.3)
System.Collections (>= 4.3)
@@ -452,30 +308,30 @@ NUGET
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Threading (>= 4.3)
- System.Reactive (4.3.2)
+ System.Reactive (4.4.1)
System.Runtime.InteropServices.WindowsRuntime (>= 4.3)
- System.Threading.Tasks.Extensions (>= 4.5.3)
- System.Reactive.Compatibility (4.3.2)
- System.Reactive.Core (>= 4.3.2)
- System.Reactive.Interfaces (>= 4.3.2)
- System.Reactive.Linq (>= 4.3.2)
- System.Reactive.PlatformServices (>= 4.3.2)
- System.Reactive.Providers (>= 4.3.2)
- System.Reactive.Core (4.3.2)
- System.Reactive (>= 4.3.2)
- System.Threading.Tasks.Extensions (>= 4.5.3)
- System.Reactive.Interfaces (4.3.2)
- System.Reactive (>= 4.3.2)
- System.Threading.Tasks.Extensions (>= 4.5.3)
- System.Reactive.Linq (4.3.2)
- System.Reactive (>= 4.3.2)
- System.Threading.Tasks.Extensions (>= 4.5.3)
- System.Reactive.PlatformServices (4.3.2)
- System.Reactive (>= 4.3.2)
- System.Threading.Tasks.Extensions (>= 4.5.3)
- System.Reactive.Providers (4.3.2)
- System.Reactive (>= 4.3.2)
- System.Threading.Tasks.Extensions (>= 4.5.3)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
+ System.Reactive.Compatibility (4.4.1)
+ System.Reactive.Core (>= 4.4.1)
+ System.Reactive.Interfaces (>= 4.4.1)
+ System.Reactive.Linq (>= 4.4.1)
+ System.Reactive.PlatformServices (>= 4.4.1)
+ System.Reactive.Providers (>= 4.4.1)
+ System.Reactive.Core (4.4.1)
+ System.Reactive (>= 4.4.1)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
+ System.Reactive.Interfaces (4.4.1)
+ System.Reactive (>= 4.4.1)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
+ System.Reactive.Linq (4.4.1)
+ System.Reactive (>= 4.4.1)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
+ System.Reactive.PlatformServices (4.4.1)
+ System.Reactive (>= 4.4.1)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
+ System.Reactive.Providers (4.4.1)
+ System.Reactive (>= 4.4.1)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
System.Reflection (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
@@ -492,32 +348,25 @@ NUGET
Microsoft.NETCore.Targets (>= 1.1)
System.Reflection (>= 4.3)
System.Runtime (>= 4.3)
- System.Reflection.Metadata (1.8)
- System.Collections.Immutable (>= 1.7)
+ System.Reflection.Metadata (1.8.1)
+ System.Collections.Immutable (>= 1.7.1)
System.Reflection.Primitives (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Reflection.TypeExtensions (4.7)
- System.Resources.Extensions (4.7)
- System.Memory (>= 4.5.3)
+ System.Resources.Extensions (4.7.1)
+ System.Memory (>= 4.5.4)
System.Resources.ResourceManager (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Globalization (>= 4.3)
System.Reflection (>= 4.3)
System.Runtime (>= 4.3)
- System.Resources.Writer (4.3)
- System.Collections (>= 4.3)
- System.IO (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Text.Encoding (>= 4.3)
System.Runtime (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
- System.Runtime.CompilerServices.Unsafe (4.7)
+ System.Runtime.CompilerServices.Unsafe (4.7.1)
System.Runtime.Extensions (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
@@ -535,203 +384,36 @@ NUGET
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices.WindowsRuntime (4.3)
System.Runtime (>= 4.3)
- System.Runtime.Numerics (4.3)
- System.Globalization (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.Serialization.Primitives (4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
System.Security.AccessControl (4.7)
System.Security.Principal.Windows (>= 4.7)
- System.Security.Cryptography.Algorithms (4.3.1)
- Microsoft.NETCore.Platforms (>= 1.1)
- runtime.native.System.Security.Cryptography.Apple (>= 4.3.1)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2)
- System.Collections (>= 4.3)
- System.IO (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.Handles (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
- System.Runtime.Numerics (>= 4.3)
- System.Security.Cryptography.Encoding (>= 4.3)
- System.Security.Cryptography.Primitives (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Security.Cryptography.Cng (4.7)
- System.Security.Cryptography.Csp (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- System.IO (>= 4.3)
- System.Reflection (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.Handles (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
- System.Security.Cryptography.Algorithms (>= 4.3)
- System.Security.Cryptography.Encoding (>= 4.3)
- System.Security.Cryptography.Primitives (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Threading (>= 4.3)
- System.Security.Cryptography.Encoding (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3)
- System.Collections (>= 4.3)
- System.Collections.Concurrent (>= 4.3)
- System.Linq (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.Handles (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
- System.Security.Cryptography.Primitives (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Security.Cryptography.OpenSsl (4.7)
- System.Security.Cryptography.Primitives (4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Globalization (>= 4.3)
- System.IO (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Threading (>= 4.3)
- System.Threading.Tasks (>= 4.3)
System.Security.Cryptography.ProtectedData (4.7)
System.Memory (>= 4.5.3)
- System.Security.Cryptography.X509Certificates (4.3.2)
- Microsoft.NETCore.Platforms (>= 1.1)
- runtime.native.System (>= 4.3)
- runtime.native.System.Net.Http (>= 4.3)
- runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2)
- System.Collections (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Globalization (>= 4.3)
- System.Globalization.Calendars (>= 4.3)
- System.IO (>= 4.3)
- System.IO.FileSystem (>= 4.3)
- System.IO.FileSystem.Primitives (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.Handles (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
- System.Runtime.Numerics (>= 4.3)
- System.Security.Cryptography.Algorithms (>= 4.3)
- System.Security.Cryptography.Cng (>= 4.3)
- System.Security.Cryptography.Csp (>= 4.3)
- System.Security.Cryptography.Encoding (>= 4.3)
- System.Security.Cryptography.OpenSsl (>= 4.3)
- System.Security.Cryptography.Primitives (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Threading (>= 4.3)
+ System.Security.Permissions (4.7)
+ System.Security.AccessControl (>= 4.7)
System.Security.Principal.Windows (4.7)
System.Text.Encoding (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
- System.Text.Encoding.CodePages (4.7)
- System.Runtime.CompilerServices.Unsafe (>= 4.7)
+ System.Text.Encoding.CodePages (4.7.1)
+ System.Runtime.CompilerServices.Unsafe (>= 4.7.1)
System.Text.Encoding.Extensions (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Text.Encoding (>= 4.3)
- System.Text.RegularExpressions (4.3.1)
- System.Collections (>= 4.3)
- System.Globalization (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3.1)
- System.Runtime.Extensions (>= 4.3.1)
- System.Threading (>= 4.3)
System.Threading (4.3)
System.Runtime (>= 4.3)
System.Threading.Tasks (>= 4.3)
- System.Threading.Overlapped (4.3)
- Microsoft.NETCore.Platforms (>= 1.1)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Handles (>= 4.3)
System.Threading.Tasks (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
- System.Threading.Tasks.Dataflow (4.11)
- System.Threading.Tasks.Extensions (4.5.3)
- System.Runtime.CompilerServices.Unsafe (>= 4.5.2)
+ System.Threading.Tasks.Dataflow (4.11.1)
+ System.Threading.Tasks.Extensions (4.5.4)
+ System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
System.Threading.Thread (4.3)
System.Runtime (>= 4.3)
System.Threading.ThreadPool (4.3)
System.Runtime (>= 4.3)
System.Runtime.Handles (>= 4.3)
- System.Xml.ReaderWriter (4.3.1)
- System.Collections (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Globalization (>= 4.3)
- System.IO (>= 4.3)
- System.IO.FileSystem (>= 4.3)
- System.IO.FileSystem.Primitives (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Runtime.InteropServices (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Text.Encoding.Extensions (>= 4.3)
- System.Text.RegularExpressions (>= 4.3)
- System.Threading.Tasks (>= 4.3)
- System.Threading.Tasks.Extensions (>= 4.3)
- System.Xml.XDocument (4.3)
- System.Collections (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Diagnostics.Tools (>= 4.3)
- System.Globalization (>= 4.3)
- System.IO (>= 4.3)
- System.Reflection (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Threading (>= 4.3)
- System.Xml.ReaderWriter (>= 4.3)
- System.Xml.XmlDocument (4.3)
- System.Collections (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Globalization (>= 4.3)
- System.IO (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Text.Encoding (>= 4.3)
- System.Threading (>= 4.3)
- System.Xml.ReaderWriter (>= 4.3)
- System.Xml.XPath (4.3)
- System.Collections (>= 4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Globalization (>= 4.3)
- System.IO (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Threading (>= 4.3)
- System.Xml.ReaderWriter (>= 4.3)
- System.Xml.XPath.XDocument (4.3)
- System.Diagnostics.Debug (>= 4.3)
- System.Linq (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Threading (>= 4.3)
- System.Xml.ReaderWriter (>= 4.3)
- System.Xml.XDocument (>= 4.3)
- System.Xml.XPath (>= 4.3)
- System.Xml.XPath.XmlDocument (4.3)
- System.Collections (>= 4.3)
- System.Globalization (>= 4.3)
- System.IO (>= 4.3)
- System.Resources.ResourceManager (>= 4.3)
- System.Runtime (>= 4.3)
- System.Runtime.Extensions (>= 4.3)
- System.Threading (>= 4.3)
- System.Xml.ReaderWriter (>= 4.3)
- System.Xml.XmlDocument (>= 4.3)
- System.Xml.XPath (>= 4.3)
diff --git a/src/Decode.fs b/src/Decode.fs
index 3e55753..f25e0e2 100644
--- a/src/Decode.fs
+++ b/src/Decode.fs
@@ -1,253 +1,139 @@
-
namespace Thoth.Json
-open System.Text.RegularExpressions
+
+open Thoth.Json.Parser
+open System.Globalization
[]
module Decode =
- open System.Globalization
- open Fable.Core
- open Fable.Core.JsInterop
-
- module internal Helpers =
- []
- let jsTypeof (_ : JsonValue) : string = jsNative
-
- []
- let isSyntaxError (_ : JsonValue) : bool = jsNative
-
- let inline getField (fieldName: string) (o: JsonValue) = o?(fieldName)
- let inline isString (o: JsonValue) : bool = o :? string
-
- let inline isBoolean (o: JsonValue) : bool = o :? bool
-
- let inline isNumber (o: JsonValue) : bool = jsTypeof o = "number"
-
- let inline isArray (o: JsonValue) : bool = JS.Constructors.Array.isArray(o)
-
- []
- let isObject (_ : JsonValue) : bool = jsNative
-
- let inline isNaN (o: JsonValue) : bool = JS.Constructors.Number.isNaN(!!o)
-
- let inline isNullValue (o: JsonValue): bool = isNull o
-
- /// is the value an integer? This returns false for 1.1, NaN, Infinite, ...
- []
- let isIntegralValue (_: JsonValue) : bool = jsNative
-
- []
- let isBetweenInclusive(_v: JsonValue, _min: obj, _max: obj) = jsNative
-
- []
- let isIntFinite (_: JsonValue) : bool = jsNative
-
- let isUndefined (o: JsonValue): bool = jsTypeof o = "undefined"
-
- []
- let anyToString (_: JsonValue) : string = jsNative
-
- let inline isFunction (o: JsonValue) : bool = jsTypeof o = "function"
-
- let inline objectKeys (o: JsonValue) : string seq = upcast JS.Constructors.Object.keys(o)
- let inline asBool (o: JsonValue): bool = unbox o
- let inline asInt (o: JsonValue): int = unbox o
- let inline asFloat (o: JsonValue): float = unbox o
- let inline asFloat32 (o: JsonValue): float32 = unbox o
- let inline asString (o: JsonValue): string = unbox o
- let inline asArray (o: JsonValue): JsonValue[] = unbox o
-
- let private genericMsg msg value newLine =
- try
- "Expecting "
- + msg
- + " but instead got:"
- + (if newLine then "\n" else " ")
- + (Helpers.anyToString value)
- with
- | _ ->
- "Expecting "
- + msg
- + " but decoder failed. Couldn't report given value due to circular structure."
- + (if newLine then "\n" else " ")
-
- let private errorToString (path : string, error) =
- let reason =
- match error with
- | BadPrimitive (msg, value) ->
- genericMsg msg value false
- | BadType (msg, value) ->
- genericMsg msg value true
- | BadPrimitiveExtra (msg, value, reason) ->
- genericMsg msg value false + "\nReason: " + reason
- | BadField (msg, value) ->
- genericMsg msg value true
- | BadPath (msg, value, fieldName) ->
- genericMsg msg value true + ("\nNode `" + fieldName + "` is unkown.")
- | TooSmallArray (msg, value) ->
- "Expecting " + msg + ".\n" + (Helpers.anyToString value)
- | BadOneOf messages ->
- "The following errors were found:\n\n" + String.concat "\n\n" messages
- | FailMessage msg ->
- "The following `failure` occurred with the decoder: " + msg
-
- match error with
- | BadOneOf _ ->
- // Don't need to show the path here because each error case will show it's own path
- reason
- | _ ->
- "Error at: `" + path + "`\n" + reason
-
- ///////////////
- // Runners ///
- /////////////
-
- let fromValue (path : string) (decoder : Decoder<'T>) =
- fun value ->
- match decoder path value with
- | Ok success ->
- Ok success
- | Error error ->
- Error (errorToString error)
-
- let fromString (decoder : Decoder<'T>) =
- fun value ->
- try
- let json = JS.JSON.parse value
- fromValue "$" decoder json
- with
- | ex when Helpers.isSyntaxError ex ->
- Error("Given an invalid JSON: " + ex.Message)
-
- let unsafeFromString (decoder : Decoder<'T>) =
- fun value ->
- match fromString decoder value with
- | Ok x -> x
- | Error msg -> failwith msg
-
- []
- let decodeValue (path : string) (decoder : Decoder<'T>) = fromValue path decoder
-
- []
- let decodeString (decoder : Decoder<'T>) = fromString decoder
-
//////////////////
// Primitives ///
////////////////
let string : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isString value then
Ok(Helpers.asString value)
else
- (path, BadPrimitive("a string", value)) |> Error
+ ("", BadPrimitive("a string", value)) |> Error
+
+ let char : Decoder =
+ fun value ->
+ if Helpers.isString value then
+ try
+ value |> Helpers.asString |> System.Char.Parse |> Ok
+ with
+ | _ ->
+ ("", BadPrimitive("a char", value)) |> Error
+ else
+ ("", BadPrimitive("a string", value)) |> Error
let guid : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isString value then
match System.Guid.TryParse (Helpers.asString value) with
| true, x -> Ok x
- | _ -> (path, BadPrimitive("a guid", value)) |> Error
- else (path, BadPrimitive("a guid", value)) |> Error
+ | _ -> ("", BadPrimitive("a guid", value)) |> Error
+ else ("", BadPrimitive("a guid", value)) |> Error
let unit : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isNullValue value then
Ok ()
else
- (path, BadPrimitive("null", value)) |> Error
+ ("", BadPrimitive("null", value)) |> Error
let inline private integral
(name : string)
(tryParse : (string -> bool * 'T))
- (min : 'T)
- (max : 'T)
- (conv : float -> 'T) : Decoder< 'T > =
+ (min : unit -> 'T)
+ (max : unit -> 'T)
+ (conv : float -> 'T) : Decoder<'T > =
- fun path value ->
+ fun value ->
if Helpers.isNumber value then
- let value : float = unbox value
if Helpers.isIntegralValue value then
- if (float min) <= value && value <= (float max) then
- Ok(conv value)
+ let fValue = Helpers.asFloat value
+ if (float (min())) <= fValue && fValue <= (float (max())) then
+ Ok(conv fValue)
else
- (path, BadPrimitiveExtra(name, value, "Value was either too large or too small for " + name)) |> Error
+ ("", BadPrimitiveExtra(name, value, "Value was either too large or too small for " + name)) |> Error
else
- (path, BadPrimitiveExtra(name, value, "Value is not an integral value")) |> Error
+ ("", BadPrimitiveExtra(name, value, "Value is not an integral value")) |> Error
elif Helpers.isString value then
match tryParse (Helpers.asString value) with
| true, x -> Ok x
- | _ -> (path, BadPrimitive(name, value)) |> Error
+ | _ -> ("", BadPrimitive(name, value)) |> Error
else
- (path, BadPrimitive(name, value)) |> Error
+ ("", BadPrimitive(name, value)) |> Error
- let sbyte : Decoder =
+ let sbyte<'JsonValue> : Decoder =
integral
"a sbyte"
System.SByte.TryParse
- System.SByte.MinValue
- System.SByte.MaxValue
+ (fun () -> System.SByte.MinValue)
+ (fun () -> System.SByte.MaxValue)
sbyte
/// Alias to Decode.uint8
- let byte : Decoder =
+ let byte<'JsonValue> : Decoder =
integral
"a byte"
System.Byte.TryParse
- System.Byte.MinValue
- System.Byte.MaxValue
+ (fun () -> System.Byte.MinValue)
+ (fun () -> System.Byte.MaxValue)
byte
- let int16 : Decoder =
+ let int16<'JsonValue> : Decoder =
integral
"an int16"
System.Int16.TryParse
- System.Int16.MinValue
- System.Int16.MaxValue
+ (fun () -> System.Int16.MinValue)
+ (fun () -> System.Int16.MaxValue)
int16
- let uint16 : Decoder =
+ let uint16<'JsonValue> : Decoder =
integral
"an uint16"
System.UInt16.TryParse
- System.UInt16.MinValue
- System.UInt16.MaxValue
+ (fun () -> System.UInt16.MinValue)
+ (fun () -> System.UInt16.MaxValue)
uint16
- let int : Decoder =
+ let int<'JsonValue> : Decoder =
integral
"an int"
System.Int32.TryParse
- System.Int32.MinValue
- System.Int32.MaxValue
+ (fun () -> System.Int32.MinValue)
+ (fun () -> System.Int32.MaxValue)
int
- let uint32 : Decoder =
+ let uint32<'JsonValue> : Decoder =
integral
"an uint32"
System.UInt32.TryParse
- System.UInt32.MinValue
- System.UInt32.MaxValue
+ (fun () -> System.UInt32.MinValue)
+ (fun () -> System.UInt32.MaxValue)
uint32
- let int64 : Decoder =
+ let int64<'JsonValue> : Decoder =
integral
"an int64"
System.Int64.TryParse
- System.Int64.MinValue
- System.Int64.MaxValue
+ (fun () -> System.Int64.MinValue)
+ (fun () -> System.Int64.MaxValue)
int64
- let uint64 : Decoder =
+ let uint64<'JsonValue> : Decoder =
integral
"an uint64"
System.UInt64.TryParse
- System.UInt64.MinValue
- System.UInt64.MaxValue
+ (fun () -> System.UInt64.MinValue)
+ (fun () -> System.UInt64.MaxValue)
uint64
let bigint : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isNumber value then
Helpers.asInt value |> bigint |> Ok
elif Helpers.isString value then
@@ -256,104 +142,108 @@ module Decode =
try
bigint.Parse (Helpers.asString value) |> Ok
with _ ->
- (path, BadPrimitive("a bigint", value)) |> Error
+ ("", BadPrimitive("a bigint", value)) |> Error
else
- (path, BadPrimitive("a bigint", value)) |> Error
+ ("", BadPrimitive("a bigint", value)) |> Error
let bool : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isBoolean value then
Ok(Helpers.asBool value)
else
- (path, BadPrimitive("a boolean", value)) |> Error
+ ("", BadPrimitive("a boolean", value)) |> Error
let float : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isNumber value then
Ok(Helpers.asFloat value)
else
- (path, BadPrimitive("a float", value)) |> Error
+ ("", BadPrimitive("a float", value)) |> Error
let float32 : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isNumber value then
Ok(Helpers.asFloat32 value)
else
- (path, BadPrimitive("a float32", value)) |> Error
+ ("", BadPrimitive("a float32", value)) |> Error
let decimal : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isNumber value then
Helpers.asFloat value |> decimal |> Ok
elif Helpers.isString value then
- match System.Decimal.TryParse (Helpers.asString value) with
+ // Accept any culture for now
+ #if THOTH_JSON_NEWTONSOFT || THOTH_JSON && !FABLE_COMPILER
+ match System.Decimal.TryParse(Helpers.asString value, NumberStyles.Any, CultureInfo.InvariantCulture) with
+ #else
+ match System.Decimal.TryParse(Helpers.asString value) with
+ #endif
| true, x -> Ok x
- | _ -> (path, BadPrimitive("a decimal", value)) |> Error
+ | _ -> ("", BadPrimitive("a decimal", value)) |> Error
else
- (path, BadPrimitive("a decimal", value)) |> Error
+ ("", BadPrimitive("a decimal", value)) |> Error
let datetime : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isString value then
match System.DateTime.TryParse (Helpers.asString value) with
| true, x -> x.ToUniversalTime() |> Ok
- | _ -> (path, BadPrimitive("a datetime", value)) |> Error
+ | _ -> ("", BadPrimitive("a datetime", value)) |> Error
else
- (path, BadPrimitive("a datetime", value)) |> Error
+ ("", BadPrimitive("a datetime", value)) |> Error
let datetimeOffset : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isString value then
match System.DateTimeOffset.TryParse(Helpers.asString value) with
| true, x -> Ok x
- | _ -> (path, BadPrimitive("a datetimeoffset", value)) |> Error
+ | _ -> ("", BadPrimitive("a datetimeoffset", value)) |> Error
else
- (path, BadPrimitive("a datetime", value)) |> Error
+ ("", BadPrimitive("a datetime", value)) |> Error
let timespan : Decoder =
- fun path value ->
+ fun value ->
if Helpers.isString value then
match System.TimeSpan.TryParse(Helpers.asString value) with
| true, x -> Ok x
- | _ -> (path, BadPrimitive("a timespan", value)) |> Error
+ | _ -> ("", BadPrimitive("a timespan", value)) |> Error
else
- (path, BadPrimitive("a timespan", value)) |> Error
+ ("", BadPrimitive("a timespan", value)) |> Error
/////////////////////////
// Object primitives ///
///////////////////////
- let private decodeMaybeNull path (decoder : Decoder<'T>) value =
- // The decoder may be an option decoder so give it an opportunity to check null values
- match decoder path value with
- | Ok v -> Ok(Some v)
- | Error _ when Helpers.isNullValue value -> Ok None
- | Error er -> Error er
-
let optional (fieldName : string) (decoder : Decoder<'value>) : Decoder<'value option> =
- fun path value ->
+ fun value ->
if Helpers.isObject value then
let fieldValue = Helpers.getField fieldName value
if Helpers.isUndefined fieldValue then Ok None
- else decodeMaybeNull (path + "." + fieldName) decoder fieldValue
+ else
+ // The decoder may be an option decoder so give it an opportunity to check null values
+ match decoder fieldValue with
+ | Ok v -> Ok (Some v)
+ | Error _ when Helpers.isNullValue fieldValue -> Ok None
+ | Error er ->
+ Error(er |> DecoderError.prependPath ("." + fieldName))
else
- Error(path, BadType("an object", value))
+ Error("", BadType("an object", value))
let private badPathError fieldNames currentPath value =
- let currentPath = defaultArg currentPath ("$"::fieldNames |> String.concat ".")
+ // IMPORTANT: The empty string is normal, this is to prefix by "." the generated path
+ let currentPath = defaultArg currentPath (""::fieldNames |> String.concat ".")
let msg = "an object with path `" + (String.concat "." fieldNames) + "`"
Error(currentPath, BadPath (msg, value, List.tryLast fieldNames |> Option.defaultValue ""))
let optionalAt (fieldNames : string list) (decoder : Decoder<'value>) : Decoder<'value option> =
- fun firstPath firstValue ->
- ((firstPath, firstValue, None), fieldNames)
+ fun firstValue ->
+ (("", firstValue, None), fieldNames)
||> List.fold (fun (curPath, curValue, res) field ->
match res with
| Some _ -> curPath, curValue, res
| None ->
if Helpers.isNullValue curValue then
- let res = badPathError fieldNames (Some curPath) firstValue
- curPath, curValue, Some res
+ curPath, curValue, None
elif Helpers.isObject curValue then
let curValue = Helpers.getField field curValue
curPath + "." + field, curValue, None
@@ -364,22 +254,31 @@ module Decode =
| _, _, Some res -> res
| lastPath, lastValue, None ->
if Helpers.isUndefined lastValue then Ok None
- else decodeMaybeNull lastPath decoder lastValue
+ else
+ // The decoder may be an option decoder so give it an opportunity to check null values
+ match decoder lastValue with
+ | Ok v -> Ok (Some v)
+ | Error _ when Helpers.isNullValue lastValue -> Ok None
+ | Error er ->
+ Error(er |> DecoderError.prependPath lastPath)
let field (fieldName: string) (decoder : Decoder<'value>) : Decoder<'value> =
- fun path value ->
+ fun value ->
if Helpers.isObject value then
let fieldValue = Helpers.getField fieldName value
if Helpers.isUndefined fieldValue then
- Error(path, BadField ("an object with a field named `" + fieldName + "`", value))
+ Error("", BadField ("an object with a field named `" + fieldName + "`", value))
else
- decoder (path + "." + fieldName) fieldValue
+ match decoder fieldValue with
+ | Ok _ as ok -> ok
+ | Error er ->
+ Error(er |> DecoderError.prependPath ("." + fieldName))
else
- Error(path, BadType("an object", value))
+ Error("", BadType("an object", value))
let at (fieldNames: string list) (decoder : Decoder<'value>) : Decoder<'value> =
- fun firstPath firstValue ->
- ((firstPath, firstValue, None), fieldNames)
+ fun firstValue ->
+ (("", firstValue, None), fieldNames)
||> List.fold (fun (curPath, curValue, res) field ->
match res with
| Some _ -> curPath, curValue, res
@@ -400,15 +299,18 @@ module Decode =
|> function
| _, _, Some res -> res
| lastPath, lastValue, None ->
- decoder lastPath lastValue
+ match decoder lastValue with
+ | Ok _ as ok -> ok
+ | Error er ->
+ Error(er |> DecoderError.prependPath lastPath)
let index (requestedIndex: int) (decoder : Decoder<'value>) : Decoder<'value> =
- fun path value ->
- let currentPath = path + ".[" + (Operators.string requestedIndex) + "]"
+ fun value ->
if Helpers.isArray value then
let vArray = Helpers.asArray value
if requestedIndex < vArray.Length then
- decoder currentPath (vArray.[requestedIndex])
+ decoder (vArray.[requestedIndex])
+ |> DecoderError.prependPathToResult (".[" + (Operators.string requestedIndex) + "]")
else
let msg =
"a longer array. Need index `"
@@ -417,93 +319,86 @@ module Decode =
+ (vArray.Length.ToString())
+ "` entries"
- (currentPath, TooSmallArray(msg, value))
+ ("", TooSmallArray(msg, value))
|> Error
+ |> DecoderError.prependPathToResult (".[" + (Operators.string requestedIndex) + "]")
else
- (currentPath, BadPrimitive("an array", value))
+ ("", BadPrimitive("an array", value))
|> Error
+ |> DecoderError.prependPathToResult (".[" + (Operators.string requestedIndex) + "]")
let option (decoder : Decoder<'value>) : Decoder<'value option> =
- fun path value ->
- if Helpers.isNullValue value then Ok None
- else decoder path value |> Result.map Some
+ fun value ->
+ #if THOTH_JSON
+ if Helpers.isNullValue value || Helpers.isUndefined value then
+ Ok None
+ else
+ decoder value |> Result.map Some
+ #else
+ if Helpers.isNullValue value then
+ Ok None
+ else
+ decoder value |> Result.map Some
+ #endif
+
//////////////////////
// Data structure ///
////////////////////
- let list (decoder : Decoder<'value>) : Decoder<'value list> =
- fun path value ->
+ let private arrayWith expectedMsg (mapping: 'value[] -> 'result) (decoder : Decoder<'value>) : Decoder<'result> =
+ fun value ->
if Helpers.isArray value then
let mutable i = -1
let tokens = Helpers.asArray value
- (Ok [], tokens) ||> Array.fold (fun acc value ->
+ let result = Array.zeroCreate tokens.Length
+ let mutable error : DecoderError option = None
+
+ while i < tokens.Length - 1 && error.IsNone do
i <- i + 1
- match acc with
- | Error _ -> acc
- | Ok acc ->
- match decoder (path + ".[" + (i.ToString()) + "]") value with
- | Error er -> Error er
- | Ok value -> Ok (value::acc))
- |> Result.map List.rev
+ match decoder tokens.[i] with
+ | Ok value ->
+ result.[i] <- value
+
+ | Error err ->
+ error <- Some (err |> DecoderError.prependPath (".[" + (i.ToString()) + "]"))
+
+ if error.IsNone then
+ Ok (result |> mapping)
+ else
+ Error error.Value
+
else
- (path, BadPrimitive ("a list", value))
+ ("", BadPrimitive (expectedMsg, value))
|> Error
+ let list (decoder : Decoder<'value>) : Decoder<'value list> =
+ arrayWith "a list" List.ofArray decoder
+
let seq (decoder : Decoder<'value>) : Decoder<'value seq> =
- fun path value ->
- if Helpers.isArray value then
- let mutable i = -1
- let tokens = Helpers.asArray value
- (Ok (seq []), tokens) ||> Array.fold (fun acc value ->
- i <- i + 1
- match acc with
- | Error _ -> acc
- | Ok acc ->
- match decoder (path + ".[" + (i.ToString()) + "]") value with
- | Error er -> Error er
- | Ok value -> Ok (Seq.append [value] acc))
- |> Result.map Seq.rev
- else
- (path, BadPrimitive ("a seq", value))
- |> Error
+ arrayWith "a seq" Seq.ofArray decoder
let array (decoder : Decoder<'value>) : Decoder<'value array> =
- fun path value ->
- if Helpers.isArray value then
- let mutable i = -1
- let tokens = Helpers.asArray value
- let arr = Array.zeroCreate tokens.Length
- (Ok arr, tokens) ||> Array.fold (fun acc value ->
- i <- i + 1
- match acc with
- | Error _ -> acc
- | Ok acc ->
- match decoder (path + ".[" + (i.ToString()) + "]") value with
- | Error er -> Error er
- | Ok value -> acc.[i] <- value; Ok acc)
- else
- (path, BadPrimitive ("an array", value))
- |> Error
+ arrayWith "an array" id decoder
let keys: Decoder =
- fun path value ->
+ fun value ->
if Helpers.isObject value then
Helpers.objectKeys value |> List.ofSeq |> Ok
else
- (path, BadPrimitive ("an object", value))
+ ("", BadPrimitive ("an object", value))
|> Error
let keyValuePairs (decoder : Decoder<'value>) : Decoder<(string * 'value) list> =
- fun path value ->
- match keys path value with
+ fun value ->
+ match keys value with
| Ok objectKeys ->
(Ok [], objectKeys) ||> List.fold (fun acc prop ->
match acc with
| Error _ -> acc
| Ok acc ->
- match Helpers.getField prop value |> decoder path with
- | Error er -> Error er
+ match Helpers.getField prop value |> decoder with
+ | Error er -> Error (er |> DecoderError.prependPath ( "." + prop))
| Ok value -> (prop, value)::acc |> Ok)
|> Result.map List.rev
| Error e -> Error e
@@ -513,15 +408,16 @@ module Decode =
////////////////////////////
let oneOf (decoders : Decoder<'value> list) : Decoder<'value> =
- fun path value ->
- let rec runner (decoders : Decoder<'value> list) (errors : string list) =
+ fun value ->
+ let rec runner (decoders : Decoder<'value> list) (errors : DecoderError list) =
match decoders with
| head::tail ->
- match fromValue path head value with
+ match head value with
| Ok v ->
Ok v
- | Error error -> runner tail (errors @ [error])
- | [] -> (path, BadOneOf errors) |> Error
+ | Error error ->
+ runner tail (errors @ [error])
+ | [] -> ("", BadOneOf errors) |> Error
runner decoders []
@@ -530,34 +426,34 @@ module Decode =
////////////////////
let nil (output : 'a) : Decoder<'a> =
- fun path value ->
+ fun value ->
if Helpers.isNullValue value then
Ok output
else
- (path, BadPrimitive("null", value)) |> Error
+ ("", BadPrimitive("null", value)) |> Error
let value _ v = Ok v
let succeed (output : 'a) : Decoder<'a> =
- fun _ _ ->
+ fun _ ->
Ok output
let fail (msg: string) : Decoder<'a> =
- fun path _ ->
- (path, FailMessage msg) |> Error
+ fun _ ->
+ ("", FailMessage msg) |> Error
- let andThen (cb: 'a -> Decoder<'b>) (decoder : Decoder<'a>) : Decoder<'b> =
- fun path value ->
- match decoder path value with
+ let andThen<'JsonValue, 'a, 'b> (cb: 'a -> Decoder<'b>) (decoder : Decoder<'a>) : Decoder<'b> =
+ fun value ->
+ match decoder value with
| Error error -> Error error
- | Ok result -> cb result path value
+ | Ok result -> cb result value
let all (decoders: Decoder<'a> list): Decoder<'a list> =
- fun path value ->
+ fun value ->
let rec runner (decoders: Decoder<'a> list) (values: 'a list) =
match decoders with
| decoder :: tail ->
- match decoder path value with
+ match decoder value with
| Ok value -> runner tail (values @ [ value ])
| Error error -> Error error
| [] -> Ok values
@@ -571,8 +467,8 @@ module Decode =
let map
(ctor : 'a -> 'value)
(d1 : Decoder<'a>) : Decoder<'value> =
- fun path value ->
- match d1 path value with
+ fun value ->
+ match d1 value with
| Ok v1 -> Ok (ctor v1)
| Error er -> Error er
@@ -580,8 +476,8 @@ module Decode =
(ctor : 'a -> 'b -> 'value)
(d1 : Decoder<'a>)
(d2 : Decoder<'b>) : Decoder<'value> =
- fun path value ->
- match d1 path value, d2 path value with
+ fun value ->
+ match d1 value, d2 value with
| Ok v1, Ok v2 -> Ok (ctor v1 v2)
| Error er,_ -> Error er
| _,Error er -> Error er
@@ -591,8 +487,8 @@ module Decode =
(d1 : Decoder<'a>)
(d2 : Decoder<'b>)
(d3 : Decoder<'c>) : Decoder<'value> =
- fun path value ->
- match d1 path value, d2 path value, d3 path value with
+ fun value ->
+ match d1 value, d2 value, d3 value with
| Ok v1, Ok v2, Ok v3 -> Ok (ctor v1 v2 v3)
| Error er,_,_ -> Error er
| _,Error er,_ -> Error er
@@ -604,8 +500,8 @@ module Decode =
(d2 : Decoder<'b>)
(d3 : Decoder<'c>)
(d4 : Decoder<'d>) : Decoder<'value> =
- fun path value ->
- match d1 path value, d2 path value, d3 path value, d4 path value with
+ fun value ->
+ match d1 value, d2 value, d3 value, d4 value with
| Ok v1, Ok v2, Ok v3, Ok v4 -> Ok (ctor v1 v2 v3 v4)
| Error er,_,_,_ -> Error er
| _,Error er,_,_ -> Error er
@@ -619,8 +515,8 @@ module Decode =
(d3 : Decoder<'c>)
(d4 : Decoder<'d>)
(d5 : Decoder<'e>) : Decoder<'value> =
- fun path value ->
- match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value with
+ fun value ->
+ match d1 value, d2 value, d3 value, d4 value, d5 value with
| Ok v1, Ok v2, Ok v3, Ok v4, Ok v5 -> Ok (ctor v1 v2 v3 v4 v5)
| Error er,_,_,_,_ -> Error er
| _,Error er,_,_,_ -> Error er
@@ -636,8 +532,8 @@ module Decode =
(d4 : Decoder<'d>)
(d5 : Decoder<'e>)
(d6 : Decoder<'f>) : Decoder<'value> =
- fun path value ->
- match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value, d6 path value with
+ fun value ->
+ match d1 value, d2 value, d3 value, d4 value, d5 value, d6 value with
| Ok v1, Ok v2, Ok v3, Ok v4, Ok v5, Ok v6 -> Ok (ctor v1 v2 v3 v4 v5 v6)
| Error er,_,_,_,_,_ -> Error er
| _,Error er,_,_,_,_ -> Error er
@@ -655,8 +551,8 @@ module Decode =
(d5 : Decoder<'e>)
(d6 : Decoder<'f>)
(d7 : Decoder<'g>) : Decoder<'value> =
- fun path value ->
- match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value, d6 path value, d7 path value with
+ fun value ->
+ match d1 value, d2 value, d3 value, d4 value, d5 value, d6 value, d7 value with
| Ok v1, Ok v2, Ok v3, Ok v4, Ok v5, Ok v6, Ok v7 -> Ok (ctor v1 v2 v3 v4 v5 v6 v7)
| Error er,_,_,_,_,_,_ -> Error er
| _,Error er,_,_,_,_,_ -> Error er
@@ -676,8 +572,8 @@ module Decode =
(d6 : Decoder<'f>)
(d7 : Decoder<'g>)
(d8 : Decoder<'h>) : Decoder<'value> =
- fun path value ->
- match d1 path value, d2 path value, d3 path value, d4 path value, d5 path value, d6 path value, d7 path value, d8 path value with
+ fun value ->
+ match d1 value, d2 value, d3 value, d4 value, d5 value, d6 value, d7 value, d8 value with
| Ok v1, Ok v2, Ok v3, Ok v4, Ok v5, Ok v6, Ok v7, Ok v8 -> Ok (ctor v1 v2 v3 v4 v5 v6 v7 v8)
| Error er,_,_,_,_,_,_,_ -> Error er
| _,Error er,_,_,_,_,_,_ -> Error er
@@ -688,7 +584,7 @@ module Decode =
| _,_,_,_,_,_,Error er,_ -> Error er
| _,_,_,_,_,_,_,Error er -> Error er
- let dict (decoder : Decoder<'value>) : Decoder