nojaf / jason-to-thoth

JSON -> Thoth
https://nojaf.github.io/jason-to-thoth/
4 stars 0 forks source link

Invalid output dependings on the version of Thoth.Json #3

Open MangelMaxime opened 5 years ago

MangelMaxime commented 5 years ago

With current version of Thoth.Json v2, static member Decoder : Decoder<Root> = is invalid it should be static member Decoder : Decode.Decoder<Root> =

However, v3 of Thoth.Json will ask for static member Decoder : Decoder<Root> =. The changes of the API is needed to support more features and make the Auto decoders easier to use and more powerful.

nojaf commented 5 years ago

Hmm, that should be made clear on the website what version of Thoth will work. I tried a couple of samples in the fable repl before announcing this. There it didn't need Decode.Decoder. Does this mean the repl is already on V3? Should the tool already be looking at V3?

MangelMaxime commented 5 years ago

Yes, I think the REPL is already using the future v3 because paket.dependencies use :

github alfonsogarciacaro/Thoth:auto-encode src/Thoth.Json/Types.fs
github alfonsogarciacaro/Thoth:auto-encode src/Thoth.Json/Decode.fs
github alfonsogarciacaro/Thoth:auto-encode src/Thoth.Json/Encode.fs
github alfonsogarciacaro/Thoth:auto-encode src/Thoth.Json/Extra.fs

Note the alfonsogarciacaro as a repo. I wasn't aware that @alfonsogarciacaro used his fork as the source for the REPL.