Skip to content

Commit

Permalink
Release version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Mangel committed May 6, 2019
1 parent 61d0bad commit ea5202a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

## 2.1.0

### Fixed

* Fix encoding when passing `None`

## 2.0.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Thoth.Json.Giraffe.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RepositoryUrl>https://github.com/MangelMaxime/Thoth</RepositoryUrl>
<PackageTags>fsharp;json;Giraffe;ASP.NET;Core</PackageTags>
<Authors>Maxime Mangel</Authors>
<Version>2.0.0</Version>
<Version>2.1.0</Version>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
Expand Down
6 changes: 2 additions & 4 deletions src/ThothSerializer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ type ThothSerializer (?isCamelCase : bool, ?extra: ExtraCoders) =

interface IJsonSerializer with
member __.SerializeToString (o : 'T) =
let t = o.GetType()
let encoder = Encode.Auto.generateEncoderCached(t, ?isCamelCase=isCamelCase, ?extra=extra)
let encoder = Encode.Auto.generateEncoderCached<'T>(?isCamelCase=isCamelCase, ?extra=extra)
encoder o |> Encode.toString 0

member __.Deserialize<'T> (json : string) =
Expand Down Expand Up @@ -108,8 +107,7 @@ type ThothSerializer (?isCamelCase : bool, ?extra: ExtraCoders) =
}

member __.SerializeToBytes<'T>(o : 'T) : byte array =
let t = o.GetType()
let encoder = Encode.Auto.generateEncoderCached(t, ?isCamelCase=isCamelCase, ?extra=extra)
let encoder = Encode.Auto.generateEncoderCached<'T>(?isCamelCase=isCamelCase, ?extra=extra)
// TODO: Would it help to create a pool of buffers for the memory stream?
use stream = new MemoryStream()
use writer = new StreamWriter(stream, Utf8EncodingWithoutBom, DefaultBufferSize)
Expand Down

0 comments on commit ea5202a

Please sign in to comment.