nerves-project/nerves

Fix JSON handling

jjcarstens opened this issue · 1 comments

Right now :nerves support specifying the desired JSON codec to use (Poison, Jason, etc). It does this by using optional dependencies and expecting the calling lib to have one set.

However, if the user of :nerves does not have one set, it emits a warning by does not fail anything. This causes more confusing messages later on.

Checking for prebuilt Nerves artifacts...
  Checking nerves_toolchain_armv7_nerves_linux_gnueabihf...
  [GitHub] nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_arm-1.8.0-0C250B7.tar.xz
Nerves is attempting to decode JSON data but there is no JSON codec defined.

Please include :jason as a dependency or configure your own JSON parser
by updating your config.exs

  config :nerves, json_codec: Poison

** (UndefinedFunctionError) function :ok.decode!/1 is undefined (module :ok is not available)
    :ok.decode!("{\"url\":\"https://api.github.com/repos/nerves-project/toolchai

We need to evaluate the JSON requirement and either remove it or make it more strict so when places around the lib use JSON, confusing errors are not presented

Fixed in v1.10.0