Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e68f574
Add default field values for auto decoded records
alfonsogarciacaro Apr 6, 2020
39340b1
Enable custom field encoders and decoders
alfonsogarciacaro Apr 20, 2020
1667ae3
Auto code mutables dictionaries and hashsets
alfonsogarciacaro Apr 20, 2020
709433d
Add tests for custom field coders
alfonsogarciacaro Apr 20, 2020
4cc9f8b
Better decode dictionaries with string keys
alfonsogarciacaro Apr 20, 2020
6a2187b
Merge master into default-fields
alfonsogarciacaro Apr 27, 2020
fd30783
Merge pull request #63 from alfonsogarciacaro/default-fields
Apr 27, 2020
c72eb03
Auto coders for seq
alfonsogarciacaro Apr 28, 2020
dacb946
Merge branch 'master' into develop
May 7, 2020
0c38aea
Add quicktests
May 7, 2020
243eb3a
Add documentation for the field customisation feature
May 7, 2020
c52e7ea
Merge remote-tracking branch 'alfonsogarciacaro/auto-code-seq' into d…
May 7, 2020
5a48b39
WIP
Jun 23, 2020
b21e0d1
Remove Fornax + Port auto APIs
Jun 29, 2020
415a50d
Auto APIs works for Fable and Newtonsoft now tests suite seems to pass
Jun 30, 2020
f3173c8
Remove unused API when targeting THOTH_JSON_FABLE
Jun 30, 2020
e1d8934
Add test checking that we can even the default type
Jul 1, 2020
2f73dff
Mirror Fable behaviour when Decoding "StringEnum" UnionCase
Jul 1, 2020
d724329
Mimic Fable behaviour for Deode + StringEnum only for Newtonsoft version
Jul 1, 2020
28248d2
Re-activate the tests for the object builders
Jul 2, 2020
1039407
Support single union case on Newtonsoft and Fable side
Jul 2, 2020
39fb2cc
Make the decoder support both old and new style of single case union
Jul 2, 2020
432c960
Fix single case DU encoders, it was checking the number of field and …
Jul 2, 2020
bc5a977
Apply inline optimisation in Decode module only for Fable as boxing i…
Jul 2, 2020
0ce3365
Add char support
Jul 2, 2020
8183022
Add support for 'T seq, mutable hashset, mutable dictionnary
Jul 3, 2020
1a2b520
WIP remove Docs group
Aug 7, 2020
4d88b25
Implement THOTH_JSON for Fable runtime and make the tests pass on the…
Aug 31, 2020
f4e07ca
Implement THOTH_JSON for .NET Runtime
Oct 5, 2020
cee021d
WIP
Oct 13, 2020
53982b6
Port optionalAt changes from master
Oct 13, 2020
7f41f5d
Remove all the plateform dependant code
Oct 13, 2020
c5483e8
Activate seq tests on complex type
Oct 28, 2020
ad02349
Fix documentation snippet
Oct 28, 2020
93f97d7
Save WIP
Nov 24, 2020
c7eb73c
Improve tree shaking for longs
Jan 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"paket": {
"version": "5.226.0",
"version": "5.247.3",
"commands": [
"paket"
]
Expand All @@ -13,6 +13,12 @@
"commands": [
"fake"
]
},
"fornax": {
"version": "0.13.1",
"commands": [
"fornax"
]
}
}
}
9 changes: 0 additions & 9 deletions .docker/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,4 @@ demos/Thoth\.Elmish\.Demo/output/
\.ionide/

docs_deploy/
docs/_public/
21 changes: 0 additions & 21 deletions .gitpod.yml

This file was deleted.

481 changes: 0 additions & 481 deletions .paket/Paket.Restore.targets

This file was deleted.

Binary file removed .paket/paket.exe
Binary file not shown.
6 changes: 0 additions & 6 deletions .paket/paket.exe.config

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true
}
40 changes: 27 additions & 13 deletions docs/index.md → DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
---
title: Thoth.Json
---

[[toc]]

This documentation is for `Thoth.Json` v4, documentation for older versions can be found here:

- [Thoth.Json v1](/Thoth.Json/legacy/v1.html)
- [Thoth.Json v2](/Thoth.Json/legacy/v2.html)
- [Thoth.Json v3](/Thoth.Json/legacy/v3.html)
# Thoth.JSON documentation

## Table of contents

<!-- TOC -->

- [Table of contents](#table-of-contents)
- [Decoder](#decoder)
- [What is a Decoder?](#what-is-a-decoder)
- [Primitives decoders](#primitives-decoders)
- [Collections](#collections)
- [Decoding Objects](#decoding-objects)
- [Encoder](#encoder)
- [How to use it?](#how-to-use-it)
- [Auto coders](#auto-coders)
- [Auto decoder](#auto-decoder)
- [Auto encoder](#auto-encoder)
- [Extra coders](#extra-coders)
- [Decoding int64, decimal or bigint](#decoding-int64-decimal-or-bigint)
- [Caching](#caching)
- [.Net & NetCore support](#net--netcore-support)
- [Code sample](#code-sample)
- [Giraffe](#giraffe)

<!-- /TOC -->

## Decoder

Expand Down Expand Up @@ -97,10 +111,10 @@ There are special decoders for the following collections.
```fsharp
open Thoth.Json

> Decode.fromString (array int) "[1, 2, 3]"
> Decode.fromString (Decode.array int) "[1, 2, 3]"
val it : Result<int [], string> = Ok [|1, 2, 3|]

> Decode.fromString (list string) """["Maxime", "Alfonso", "Vesper"]"""
> Decode.fromString (Decode.list string) """["Maxime", "Alfonso", "Vesper"]"""
val it : Result<string list, string> = Ok ["Maxime", "Alfonso", "Vesper"]

> Decode.fromString (Decode.index 1 Decode.string) """["maxime", "alfonso", "steffen"]"""
Expand Down
81 changes: 81 additions & 0 deletions Thoth.Json.Projets.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
MinimumVisualStudioVersion = 15.0.26124.0
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Thoth.Json", "src\Thoth.Json.fsproj", "{B967432B-CE16-480B-B364-B5A6B18AB3DC}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Tests.Thoth.Json.FableRuntime", "tests\Tests.Thoth.Json.FableRuntime.fsproj", "{77152A74-CFC7-437C-9415-3FC1F3593DA0}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Tests.Thoth.Json.NetRuntime", "tests\Tests.Thoth.Json.NetRuntime.fsproj", "{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Thoth.Json.FableRuntime", "src\Thoth.Json.FableRuntime.fsproj", "{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Debug|x64.ActiveCfg = Debug|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Debug|x64.Build.0 = Debug|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Debug|x86.ActiveCfg = Debug|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Debug|x86.Build.0 = Debug|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Release|Any CPU.Build.0 = Release|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Release|x64.ActiveCfg = Release|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Release|x64.Build.0 = Release|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Release|x86.ActiveCfg = Release|Any CPU
{B967432B-CE16-480B-B364-B5A6B18AB3DC}.Release|x86.Build.0 = Release|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Debug|x64.ActiveCfg = Debug|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Debug|x64.Build.0 = Debug|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Debug|x86.ActiveCfg = Debug|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Debug|x86.Build.0 = Debug|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Release|Any CPU.Build.0 = Release|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Release|x64.ActiveCfg = Release|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Release|x64.Build.0 = Release|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Release|x86.ActiveCfg = Release|Any CPU
{77152A74-CFC7-437C-9415-3FC1F3593DA0}.Release|x86.Build.0 = Release|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Debug|x64.ActiveCfg = Debug|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Debug|x64.Build.0 = Debug|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Debug|x86.ActiveCfg = Debug|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Debug|x86.Build.0 = Debug|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Release|Any CPU.Build.0 = Release|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Release|x64.ActiveCfg = Release|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Release|x64.Build.0 = Release|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Release|x86.ActiveCfg = Release|Any CPU
{BC1BD8D5-D518-4C04-89D9-9E62A932D5E6}.Release|x86.Build.0 = Release|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Debug|x64.ActiveCfg = Debug|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Debug|x64.Build.0 = Debug|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Debug|x86.ActiveCfg = Debug|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Debug|x86.Build.0 = Debug|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Release|Any CPU.Build.0 = Release|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Release|x64.ActiveCfg = Release|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Release|x64.Build.0 = Release|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Release|x86.ActiveCfg = Release|Any CPU
{4C938BA5-EF95-4BB0-B1B5-C04F188DB17E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {138D696D-3E83-4254-99CF-C6A0675E97E7}
EndGlobalSection
EndGlobal
Binary file added _lib/Fornax.Core.dll
Binary file not shown.
Binary file added _lib/Markdig.dll
Binary file not shown.
42 changes: 42 additions & 0 deletions config.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#r "_lib/Fornax.Core.dll"

open Config
open System.IO

let postPredicate (projectRoot: string, page: string) =
let fileName = Path.Combine(projectRoot,page)
let ext = Path.GetExtension page
if ext = ".md" then
let ctn = File.ReadAllText fileName
ctn.Contains("layout: post")
else
false

let staticPredicate (projectRoot: string, page: string) =
let ext = Path.GetExtension page
if page.Contains "_public" ||
page.Contains "_bin" ||
page.Contains "_lib" ||
page.Contains "_data" ||
page.Contains "_settings" ||
page.Contains "_config.yml" ||
page.Contains ".sass-cache" ||
page.Contains ".git" ||
page.Contains ".ionide" ||
ext = ".fsx"
then
false
else
true

let config = {
Generators = [
{Script = "less.fsx"; Trigger = OnFileExt ".less"; OutputFile = ChangeExtension "css" }
{Script = "sass.fsx"; Trigger = OnFileExt ".scss"; OutputFile = ChangeExtension "css" }
{Script = "post.fsx"; Trigger = OnFilePredicate postPredicate; OutputFile = ChangeExtension "html" }
{Script = "staticfile.fsx"; Trigger = OnFilePredicate staticPredicate; OutputFile = SameFileName }
{Script = "index.fsx"; Trigger = Once; OutputFile = NewFileName "index.html" }
{Script = "about.fsx"; Trigger = Once; OutputFile = NewFileName "about.html" }
{Script = "contact.fsx"; Trigger = Once; OutputFile = NewFileName "contact.html" }
]
}
6 changes: 0 additions & 6 deletions docs/changelog.md

This file was deleted.

Loading