PlugIdColumn
Goals:
- To convert the phoenix json responses in array to map
- Hash the json response.
How To use:
- Install the library
- Include in plug in api pipeline
-
pass the key used to make array as map in the url as
id_column. Ex: http://localhost:4000/api/get-some-info?id_column=name (map key isname) -
pass the data key you need to hash in case the data is giving a map which contains the array. ex:
?id_column=name&data_key=services
Installation
If available in Hex, the package can be installed
by adding plug_id_column to your list of dependencies in mix.exs:
def deps do
[
{:plug_id_column, "~> 0.1.0"}
]
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/plug_id_column.