JaSerializer.Deserializer

This plug “deserializes” params to underscores.

For example these params:

%{
  "data" => %{
    "attributes" => %{
      "foo-bar" => true
    }
  }
}

are transformed to:

%{
  "data" => %{
    "attributes" => %{
      "foo_bar" => true
    }
  }
}

Usage

Just include in your plug stack after a json parser:

plug Plug.Parsers, parsers: [:json], json_decoder: Poison
plug JaSerializer.Deserializer
Source

Summary

call(conn, opts)

Callback implementation for c:Plug.call/2

do_deep_format_keys(map)
do_format_resource(resource)
format_key(key)
init(opts)

Callback implementation for c:Plug.init/1

Functions

call(conn, opts)

Callback implementation for c:Plug.call/2.

Source
do_deep_format_keys(map)
Source
do_format_resource(resource)
Source
format_key(key)
Source
init(opts)

Callback implementation for c:Plug.init/1.

Source