aelve / guide

A workspace for research teams
https://guide.aelve.com
106 stars 10 forks source link

Decoding of `ItemKind` failed #204

Closed sectore closed 7 years ago

sectore commented 7 years ago

Description: If a data constructor of ItemKind has a Maybe a parameter, then decoding the result of endpoint http://localhost:4400/category/{id} (e.g. http://localhost:4400/category/jhgj62o7) might be failed with an error such as:

Error loading data: [JSONDecodingError]: "Generic json decoding failed: Expected a string: '[]'"

What I can see is that this issue ^ is related to decoding Library (Maybe Text) (and maybe Tool (Maybe Text) - I've not found an example of Tool ..). Parsing / decoding Other has no issues (For example http://localhost:4400/category/dila2lox).

How to reproduce?

  1. git checkout -b sectore/202-api-endpoints
  2. Follow all steps of frontend's README to install and run everything.
  3. Open http://localhost:3333 and click any category to open a category detail page. Some of these pages (e.g. http://localhost:3333/category/haskell/jhgj62o7) will return an error as described above.

How to fix: Check if purescript-argonaut-generic-codecs does need another options as we currently have defined to parse sum types with Maybe a as a parameter of data types as ItemKind it has.