File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,17 @@ defmodule Phoenix do
4343
4444 config :phoenix, :json_library, AlternativeJsonLibrary
4545
46+ The configured module is required to provide three functions:
47+
48+ - **`decode!/1`** — decodes a JSON binary, raising on invalid input
49+ - **`encode!/1`** — encodes a term to a JSON binary, raising on encoding errors
50+ - **`encode_to_iodata!/1`** — encodes a term to JSON as iodata, raising on
51+ encoding errors.
52+
53+ These correspond to the single-argument, raising variants of
54+ the functions provided by Elixir's built-in `JSON` module. A conforming
55+ `:json_library` module does not need to implement any other functions
56+ `JSON` has, that are not defined above.
4657 """
4758 def json_library do
4859 Application . get_env ( :phoenix , :json_library , Jason )
You can’t perform that action at this time.
0 commit comments