Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
5test cases
5files differ
4modified
1new
0deleted
38changed lines
+34 −4insertions / deletions
Base d3014aaec4f7ed11fb83168f39211b755deeeb1d · PR merge e78f519b9610843fa96c9d72c0f9eecb32a07c7d · Head 49a6cec989330360ab54594fedb75e8d5f095896 · raw patch
Test case

test/inputs/json/misc/ed095.json

1 generated file · +5 −1
Melixirdefault / QuickType.ex+5 −1
@@ -6,8 +6,12 @@
66 # Encode into a JSON string: TopLevel.to_json(struct)
77
88 defmodule TopLevel do
9+ def decode_value(value) when is_map(value), do: value
10+
911 def from_json(json) do
10- Jason.decode!(json)
12+ json
13+ |> Jason.decode!()
14+ |> decode_value()
1115 end
1216
1317 def to_json(data) do
Test case

test/inputs/json/priority/bug855-short.json

1 generated file · +5 −1
Melixirdefault / QuickType.ex+5 −1
@@ -51,8 +51,12 @@ defmodule TopLevelValue do
5151 end
5252
5353 defmodule TopLevel do
54+ def decode_value(value) when is_map(value), do: value
55+
5456 def from_json(json) do
55- Jason.decode!(json)
57+ json
58+ |> Jason.decode!()
59+ |> decode_value()
5660 end
5761
5862 def to_json(data) do
Test case

test/inputs/json/priority/no-classes.json

1 generated file · +2 −1
Melixirdefault / QuickType.ex+2 −1
@@ -7,7 +7,8 @@
77
88 defmodule TopLevel do
99 def from_json(json) do
10- Jason.decode!(json)
10+ json
11+ |> Jason.decode!()
1112 end
1213
1314 def to_json(data) do
Test case

test/inputs/schema/empty-object.schema

1 generated file · +20 −0
Aschema-elixirdefault / QuickType.ex+20 −0
@@ -0,0 +1,20 @@
1+# This file was autogenerated using quicktype https://github.com/quicktype/quicktype
2+#
3+# Add Jason to your mix.exs
4+#
5+# Decode a JSON string: TopLevel.from_json(data)
6+# Encode into a JSON string: TopLevel.to_json(struct)
7+
8+defmodule TopLevel do
9+ def decode_value(value) when is_map(value), do: value
10+
11+ def from_json(json) do
12+ json
13+ |> Jason.decode!()
14+ |> decode_value()
15+ end
16+
17+ def to_json(data) do
18+ Jason.encode!(data)
19+ end
20+end
Test case

test/inputs/schema/top-level-primitive.schema

1 generated file · +2 −1
Mschema-elixirdefault / QuickType.ex+2 −1
@@ -11,7 +11,8 @@ defmodule TopLevel do
1111 """
1212
1313 def from_json(json) do
14- Jason.decode!(json)
14+ json
15+ |> Jason.decode!()
1516 end
1617
1718 def to_json(data) do
No generated files match these filters.