File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ defmodule JSON do
257257
258258 ## Encoding
259259
260- Elixir built-in data structures are encoded to JSON as follows:
260+ Elixir primitive types are encoded to JSON as follows:
261261
262262 | **Elixir** | **JSON** |
263263 |------------------------|----------|
@@ -272,10 +272,19 @@ defmodule JSON do
272272 | `%{integer() => _}` | Object |
273273
274274 You may also implement the `JSON.Encoder` protocol for custom data structures.
275+ Some built-in data-structures already derive the `JSON.Encoder` protocol:
276+
277+ | **Elixir** | **JSON** |
278+ |------------------------|-----------------|
279+ | `Date.t()` | ISO 8601 string |
280+ | `Time.t()` | ISO 8601 string |
281+ | `DateTime.t()` | ISO 8601 string |
282+ | `NaiveDateTime.t()` | ISO 8601 string |
283+ | `Duration.t()` | ISO 8601 string |
275284
276285 ## Decoding
277286
278- Elixir built-in data structures are decoded from JSON as follows:
287+ Elixir types are decoded from JSON as follows:
279288
280289 | **JSON** | **Elixir** |
281290 |----------|------------------------|
You can’t perform that action at this time.
0 commit comments