iex(kiwi@nerves.local)4> RingLogger.next 21:34:06.863 [info] POST /settings 21:34:06.868 [error] %Plug.Parsers.ParseError{exception: %Jason.DecodeError{data: "{\n \"settings\": [\n {\n \"id\": \"key_1_in_row_1\",\n \"object\": {\n \"keydown\": {\n \"http\": [\n {\n \"body\": \"{}\",\n \"method\": \"post\",\n \"headers\": {\n \"content-type\": \"application/json\"\n },\n \"url\": \"http://192.168.33.129/cm?cmnd=Power%20TOGGLE\"\n }\n ]\n }\n }\n }\n }", position: 550, token: nil}, plug_status: 400} 21:34:06.871 [error] #PID<0.548.0> running Kiwi.Api (connection #PID<0.547.0>, stream id 1) terminated Server: 192.168.33.116:8080 (http) Request: POST /settings ** (exit) an exception was raised: ** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for %Plug.Parsers.ParseError{exception: %Jason.DecodeError{data: "{\n \"settings\": [\n {\n \"id\": \"key_1_in_row_1\",\n \"object\": {\n \"keydown\": {\n \"http\": [\n {\n \"body\": \"{}\",\n \"method\": \"post\",\n \"headers\": {\n \"content-type\": \"application/json\"\n },\n \"url\": \"http://192.168.33.129/cm?cmnd=Power%20TOGGLE\"\n }\n ]\n }\n }\n }\n }", position: 550, token: nil}, plug_status: 400} of type Plug.Parsers.ParseError (a struct), Jason.Encoder protocol must always be explicitly implemented. If you own the struct, you can derive the implementation specifying which fields should be encoded to JSON: @derive {Jason.Encoder, only: [....]} defstruct ... It is also possible to encode all fields, although this should be used carefully to avoid accidentally leaking private information when new fields are added: @derive Jason.Encoder defstruct ... Finally, if you don't own the struct you want to encode to JSON, you may use Protocol.derive/3 placed outside of any module: Protocol.derive(Jason.Encoder, NameOfTheStruct, only: [...]) Protocol.derive(Jason.Encoder, NameOfTheStruct) . This protocol is implemented for the following type(s): Kiwi.Collection.Setting, Kiwi.Collection.Led, NaiveDateTime, Atom, DateTime, BitString, Map, Decimal, Date, Any, Jason.Fragment, Integer, Float, List, Time (jason 1.2.2) lib/jason.ex:199: Jason.encode_to_iodata!/2 (kiwi 1.0.2) lib/kiwi/helpers/response.ex:29: Kiwi.Helpers.Response.resp_json/2 (plug_cowboy 2.5.0) lib/plug/cowboy/handler.ex:12: Plug.Cowboy.Handler.init/2 (cowboy 2.9.0) /home/runner/work/kiwi/kiwi/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2 (cowboy 2.9.0) /home/runner/work/kiwi/kiwi/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3 (cowboy 2.9.0) /home/runner/work/kiwi/kiwi/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3 (stdlib 3.14.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3 3 out of 3 new messages shown. :ok iex(kiwi@nerves.local)5>