Thoth.Json icon indicating copy to clipboard operation
Thoth.Json copied to clipboard

Documentation for collection deserialization snippet needs to be fixed

Open MangelMaxime opened this issue 5 years ago • 1 comments

Issue by ImaginaryDevelopment Thursday May 02, 2019 at 12:44 GMT Originally opened as https://github.com/MangelMaxime/Thoth/issues/139


Using Thoth.Json (2.5) (per my paket.lock file) following https://mangelmaxime.github.io/Thoth/json/v2.html the collections sections shows Decode.fromString (array int) "[1, 2, 3]" which does not compile with only the shown above open Thoth.Json The syntax showing up in intellisense wants a decoder before you can pass a value to Decode.fromString I believe array int isn't legal syntax outside of type annotations and generic calls.

Is the issue a missing namespace import, wrong doc version, wrong documentation, or something else?

MangelMaxime avatar Nov 08 '19 14:11 MangelMaxime

Comment by MangelMaxime Thursday May 02, 2019 at 13:05 GMT


Hello,

this is an error in the documentation.

You should use:

open Thoth.Json

Decode.fromString (Decode.array Decode.int) "[1, 2, 3]"

MangelMaxime avatar Nov 08 '19 14:11 MangelMaxime