Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
37test cases
86files differ
81modified
5new
0deleted
9,258changed lines
+8,624 −634insertions / deletions
Base 66df8a7480383ad7d4784464b395df83fd482c7f · PR merge dd4ed6b799e6211a679168a26bc85461a19b4f5e · Head b7096c6ce2a6fe7a25396501065306d2c37c8046 · raw patch
Test case

test/inputs/json/misc/0a91a.json

1 generated file · +28 −4
Melixirdefault / QuickType.ex+28 −4
@@ -1591,6 +1591,12 @@ defmodule Payload do
15911591 def encode_before(value) when is_binary(value), do: value
15921592 def encode_before(_), do: {:error, "Unexpected type when encoding Payload.before"}
15931593
1594+ def decode_distinct_size(value) when is_integer(value), do: value
1595+ def decode_distinct_size(_), do: {:error, "Unexpected type when decoding Payload.distinct_size"}
1596+
1597+ def encode_distinct_size(value) when is_integer(value), do: value
1598+ def encode_distinct_size(_), do: {:error, "Unexpected type when encoding Payload.distinct_size"}
1599+
15941600 def decode_head(value) when is_binary(value), do: value
15951601 def decode_head(_), do: {:error, "Unexpected type when decoding Payload.head"}
15961602
@@ -1603,6 +1609,18 @@ defmodule Payload do
16031609 def encode_master_branch(value) when is_binary(value), do: value
16041610 def encode_master_branch(_), do: {:error, "Unexpected type when encoding Payload.master_branch"}
16051611
1612+ def decode_number(value) when is_integer(value), do: value
1613+ def decode_number(_), do: {:error, "Unexpected type when decoding Payload.number"}
1614+
1615+ def encode_number(value) when is_integer(value), do: value
1616+ def encode_number(_), do: {:error, "Unexpected type when encoding Payload.number"}
1617+
1618+ def decode_push_id(value) when is_integer(value), do: value
1619+ def decode_push_id(_), do: {:error, "Unexpected type when decoding Payload.push_id"}
1620+
1621+ def encode_push_id(value) when is_integer(value), do: value
1622+ def encode_push_id(_), do: {:error, "Unexpected type when encoding Payload.push_id"}
1623+
16061624 def decode_pusher_type(value) when is_binary(value), do: value
16071625 def decode_pusher_type(_), do: {:error, "Unexpected type when decoding Payload.pusher_type"}
16081626
@@ -1621,22 +1639,28 @@ defmodule Payload do
16211639 def encode_ref_type(value) when is_binary(value), do: value
16221640 def encode_ref_type(_), do: {:error, "Unexpected type when encoding Payload.ref_type"}
16231641
1642+ def decode_size(value) when is_integer(value), do: value
1643+ def decode_size(_), do: {:error, "Unexpected type when decoding Payload.size"}
1644+
1645+ def encode_size(value) when is_integer(value), do: value
1646+ def encode_size(_), do: {:error, "Unexpected type when encoding Payload.size"}
1647+
16241648 def from_map(m) do
16251649 %Payload{
16261650 action: m["action"] && decode_action(m["action"]),
16271651 before: m["before"] && decode_before(m["before"]),
16281652 commits: m["commits"] && Enum.map(m["commits"], &Commit.from_map/1),
16291653 description: m["description"],
1630- distinct_size: m["distinct_size"],
1654+ distinct_size: m["distinct_size"] && decode_distinct_size(m["distinct_size"]),
16311655 head: m["head"] && decode_head(m["head"]),
16321656 master_branch: m["master_branch"] && decode_master_branch(m["master_branch"]),
1633- number: m["number"],
1657+ number: m["number"] && decode_number(m["number"]),
16341658 pull_request: m["pull_request"] && PullRequest.from_map(m["pull_request"]),
1635- push_id: m["push_id"],
1659+ push_id: m["push_id"] && decode_push_id(m["push_id"]),
16361660 pusher_type: m["pusher_type"] && decode_pusher_type(m["pusher_type"]),
16371661 ref: m["ref"] && decode_ref(m["ref"]),
16381662 ref_type: m["ref_type"] && decode_ref_type(m["ref_type"]),
1639- size: m["size"],
1663+ size: m["size"] && decode_size(m["size"]),
16401664 }
16411665 end
Test case

test/inputs/json/misc/26c9c.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -265,6 +265,18 @@ defmodule Column do
265265 def encode_render_type_name(value) when is_binary(value), do: value
266266 def encode_render_type_name(_), do: {:error, "Unexpected type when encoding Column.render_type_name"}
267267
268+ def decode_table_column_id(value) when is_integer(value), do: value
269+ def decode_table_column_id(_), do: {:error, "Unexpected type when decoding Column.table_column_id"}
270+
271+ def encode_table_column_id(value) when is_integer(value), do: value
272+ def encode_table_column_id(_), do: {:error, "Unexpected type when encoding Column.table_column_id"}
273+
274+ def decode_width(value) when is_integer(value), do: value
275+ def decode_width(_), do: {:error, "Unexpected type when decoding Column.width"}
276+
277+ def encode_width(value) when is_integer(value), do: value
278+ def encode_width(_), do: {:error, "Unexpected type when encoding Column.width"}
279+
268280 def from_map(m) do
269281 %Column{
270282 cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
@@ -276,8 +288,8 @@ defmodule Column do
276288 name: decode_name(m["name"]),
277289 position: decode_position(m["position"]),
278290 render_type_name: decode_render_type_name(m["renderTypeName"]),
279- table_column_id: m["tableColumnId"],
280- width: m["width"],
291+ table_column_id: m["tableColumnId"] && decode_table_column_id(m["tableColumnId"]),
292+ width: m["width"] && decode_width(m["width"]),
281293 }
282294 end
Test case

test/inputs/json/misc/27332.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -243,12 +243,24 @@ defmodule MediaEmbed do
243243 def encode_content(value) when is_binary(value), do: value
244244 def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
245245
246+ def decode_height(value) when is_integer(value), do: value
247+ def decode_height(_), do: {:error, "Unexpected type when decoding MediaEmbed.height"}
248+
249+ def encode_height(value) when is_integer(value), do: value
250+ def encode_height(_), do: {:error, "Unexpected type when encoding MediaEmbed.height"}
251+
252+ def decode_width(value) when is_integer(value), do: value
253+ def decode_width(_), do: {:error, "Unexpected type when decoding MediaEmbed.width"}
254+
255+ def encode_width(value) when is_integer(value), do: value
256+ def encode_width(_), do: {:error, "Unexpected type when encoding MediaEmbed.width"}
257+
246258 def from_map(m) do
247259 %MediaEmbed{
248260 content: m["content"] && decode_content(m["content"]),
249- height: m["height"],
261+ height: m["height"] && decode_height(m["height"]),
250262 scrolling: m["scrolling"],
251- width: m["width"],
263+ width: m["width"] && decode_width(m["width"]),
252264 }
253265 end
Test case

test/inputs/json/misc/31189.json

1 generated file · +45 −5
Melixirdefault / QuickType.ex+45 −5
@@ -18,6 +18,38 @@ defmodule Rates do
1818 super_reduced: float() | nil
1919 }
2020
21+ def decode_parking(value) when is_float(value), do: value
22+ def decode_parking(value) when is_integer(value), do: value
23+ def decode_parking(_), do: {:error, "Unexpected type when decoding Rates.parking"}
24+
25+ def encode_parking(value) when is_float(value), do: value
26+ def encode_parking(value) when is_integer(value), do: value
27+ def encode_parking(_), do: {:error, "Unexpected type when encoding Rates.parking"}
28+
29+ def decode_reduced(value) when is_float(value), do: value
30+ def decode_reduced(value) when is_integer(value), do: value
31+ def decode_reduced(_), do: {:error, "Unexpected type when decoding Rates.reduced"}
32+
33+ def encode_reduced(value) when is_float(value), do: value
34+ def encode_reduced(value) when is_integer(value), do: value
35+ def encode_reduced(_), do: {:error, "Unexpected type when encoding Rates.reduced"}
36+
37+ def decode_reduced1(value) when is_float(value), do: value
38+ def decode_reduced1(value) when is_integer(value), do: value
39+ def decode_reduced1(_), do: {:error, "Unexpected type when decoding Rates.reduced1"}
40+
41+ def encode_reduced1(value) when is_float(value), do: value
42+ def encode_reduced1(value) when is_integer(value), do: value
43+ def encode_reduced1(_), do: {:error, "Unexpected type when encoding Rates.reduced1"}
44+
45+ def decode_reduced2(value) when is_float(value), do: value
46+ def decode_reduced2(value) when is_integer(value), do: value
47+ def decode_reduced2(_), do: {:error, "Unexpected type when decoding Rates.reduced2"}
48+
49+ def encode_reduced2(value) when is_float(value), do: value
50+ def encode_reduced2(value) when is_integer(value), do: value
51+ def encode_reduced2(_), do: {:error, "Unexpected type when encoding Rates.reduced2"}
52+
2153 def decode_standard(value) when is_float(value), do: value
2254 def decode_standard(value) when is_integer(value), do: value
2355 def decode_standard(_), do: {:error, "Unexpected type when decoding Rates.standard"}
@@ -26,14 +58,22 @@ defmodule Rates do
2658 def encode_standard(value) when is_integer(value), do: value
2759 def encode_standard(_), do: {:error, "Unexpected type when encoding Rates.standard"}
2860
61+ def decode_super_reduced(value) when is_float(value), do: value
62+ def decode_super_reduced(value) when is_integer(value), do: value
63+ def decode_super_reduced(_), do: {:error, "Unexpected type when decoding Rates.super_reduced"}
64+
65+ def encode_super_reduced(value) when is_float(value), do: value
66+ def encode_super_reduced(value) when is_integer(value), do: value
67+ def encode_super_reduced(_), do: {:error, "Unexpected type when encoding Rates.super_reduced"}
68+
2969 def from_map(m) do
3070 %Rates{
31- parking: m["parking"],
32- reduced: m["reduced"],
33- reduced1: m["reduced1"],
34- reduced2: m["reduced2"],
71+ parking: m["parking"] && decode_parking(m["parking"]),
72+ reduced: m["reduced"] && decode_reduced(m["reduced"]),
73+ reduced1: m["reduced1"] && decode_reduced1(m["reduced1"]),
74+ reduced2: m["reduced2"] && decode_reduced2(m["reduced2"]),
3575 standard: decode_standard(m["standard"]),
36- super_reduced: m["super_reduced"],
76+ super_reduced: m["super_reduced"] && decode_super_reduced(m["super_reduced"]),
3777 }
3878 end
Test case

test/inputs/json/misc/421d4.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -223,6 +223,18 @@ defmodule Column do
223223 def encode_render_type_name(value) when is_binary(value), do: value
224224 def encode_render_type_name(_), do: {:error, "Unexpected type when encoding Column.render_type_name"}
225225
226+ def decode_table_column_id(value) when is_integer(value), do: value
227+ def decode_table_column_id(_), do: {:error, "Unexpected type when decoding Column.table_column_id"}
228+
229+ def encode_table_column_id(value) when is_integer(value), do: value
230+ def encode_table_column_id(_), do: {:error, "Unexpected type when encoding Column.table_column_id"}
231+
232+ def decode_width(value) when is_integer(value), do: value
233+ def decode_width(_), do: {:error, "Unexpected type when decoding Column.width"}
234+
235+ def encode_width(value) when is_integer(value), do: value
236+ def encode_width(_), do: {:error, "Unexpected type when encoding Column.width"}
237+
226238 def from_map(m) do
227239 %Column{
228240 cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
@@ -234,8 +246,8 @@ defmodule Column do
234246 name: decode_name(m["name"]),
235247 position: decode_position(m["position"]),
236248 render_type_name: decode_render_type_name(m["renderTypeName"]),
237- table_column_id: m["tableColumnId"],
238- width: m["width"],
249+ table_column_id: m["tableColumnId"] && decode_table_column_id(m["tableColumnId"]),
250+ width: m["width"] && decode_width(m["width"]),
239251 }
240252 end
Test case

test/inputs/json/misc/4d6fb.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -210,12 +210,24 @@ defmodule MediaEmbed do
210210 def encode_content(value) when is_binary(value), do: value
211211 def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
212212
213+ def decode_height(value) when is_integer(value), do: value
214+ def decode_height(_), do: {:error, "Unexpected type when decoding MediaEmbed.height"}
215+
216+ def encode_height(value) when is_integer(value), do: value
217+ def encode_height(_), do: {:error, "Unexpected type when encoding MediaEmbed.height"}
218+
219+ def decode_width(value) when is_integer(value), do: value
220+ def decode_width(_), do: {:error, "Unexpected type when decoding MediaEmbed.width"}
221+
222+ def encode_width(value) when is_integer(value), do: value
223+ def encode_width(_), do: {:error, "Unexpected type when encoding MediaEmbed.width"}
224+
213225 def from_map(m) do
214226 %MediaEmbed{
215227 content: m["content"] && decode_content(m["content"]),
216- height: m["height"],
228+ height: m["height"] && decode_height(m["height"]),
217229 scrolling: m["scrolling"],
218- width: m["width"],
230+ width: m["width"] && decode_width(m["width"]),
219231 }
220232 end
Test case

test/inputs/json/misc/5f7fe.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -264,6 +264,18 @@ defmodule Column do
264264 def encode_position(value) when is_integer(value), do: value
265265 def encode_position(_), do: {:error, "Unexpected type when encoding Column.position"}
266266
267+ def decode_table_column_id(value) when is_integer(value), do: value
268+ def decode_table_column_id(_), do: {:error, "Unexpected type when decoding Column.table_column_id"}
269+
270+ def encode_table_column_id(value) when is_integer(value), do: value
271+ def encode_table_column_id(_), do: {:error, "Unexpected type when encoding Column.table_column_id"}
272+
273+ def decode_width(value) when is_integer(value), do: value
274+ def decode_width(_), do: {:error, "Unexpected type when decoding Column.width"}
275+
276+ def encode_width(value) when is_integer(value), do: value
277+ def encode_width(_), do: {:error, "Unexpected type when encoding Column.width"}
278+
267279 def from_map(m) do
268280 %Column{
269281 cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
@@ -275,8 +287,8 @@ defmodule Column do
275287 name: decode_name(m["name"]),
276288 position: decode_position(m["position"]),
277289 render_type_name: TypeName.decode(m["renderTypeName"]),
278- table_column_id: m["tableColumnId"],
279- width: m["width"],
290+ table_column_id: m["tableColumnId"] && decode_table_column_id(m["tableColumnId"]),
291+ width: m["width"] && decode_width(m["width"]),
280292 }
281293 end
Test case

test/inputs/json/misc/617e8.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -271,6 +271,18 @@ defmodule Column do
271271 def encode_position(value) when is_integer(value), do: value
272272 def encode_position(_), do: {:error, "Unexpected type when encoding Column.position"}
273273
274+ def decode_table_column_id(value) when is_integer(value), do: value
275+ def decode_table_column_id(_), do: {:error, "Unexpected type when decoding Column.table_column_id"}
276+
277+ def encode_table_column_id(value) when is_integer(value), do: value
278+ def encode_table_column_id(_), do: {:error, "Unexpected type when encoding Column.table_column_id"}
279+
280+ def decode_width(value) when is_integer(value), do: value
281+ def decode_width(_), do: {:error, "Unexpected type when decoding Column.width"}
282+
283+ def encode_width(value) when is_integer(value), do: value
284+ def encode_width(_), do: {:error, "Unexpected type when encoding Column.width"}
285+
274286 def from_map(m) do
275287 %Column{
276288 cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
@@ -283,8 +295,8 @@ defmodule Column do
283295 name: decode_name(m["name"]),
284296 position: decode_position(m["position"]),
285297 render_type_name: TypeName.decode(m["renderTypeName"]),
286- table_column_id: m["tableColumnId"],
287- width: m["width"],
298+ table_column_id: m["tableColumnId"] && decode_table_column_id(m["tableColumnId"]),
299+ width: m["width"] && decode_width(m["width"]),
288300 }
289301 end
Test case

test/inputs/json/misc/6de06.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -201,12 +201,24 @@ defmodule MediaEmbed do
201201 def encode_content(value) when is_binary(value), do: value
202202 def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
203203
204+ def decode_height(value) when is_integer(value), do: value
205+ def decode_height(_), do: {:error, "Unexpected type when decoding MediaEmbed.height"}
206+
207+ def encode_height(value) when is_integer(value), do: value
208+ def encode_height(_), do: {:error, "Unexpected type when encoding MediaEmbed.height"}
209+
210+ def decode_width(value) when is_integer(value), do: value
211+ def decode_width(_), do: {:error, "Unexpected type when decoding MediaEmbed.width"}
212+
213+ def encode_width(value) when is_integer(value), do: value
214+ def encode_width(_), do: {:error, "Unexpected type when encoding MediaEmbed.width"}
215+
204216 def from_map(m) do
205217 %MediaEmbed{
206218 content: m["content"] && decode_content(m["content"]),
207- height: m["height"],
219+ height: m["height"] && decode_height(m["height"]),
208220 scrolling: m["scrolling"],
209- width: m["width"],
221+ width: m["width"] && decode_width(m["width"]),
210222 }
211223 end
Test case

test/inputs/json/misc/a3d8c.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -264,6 +264,18 @@ defmodule Column do
264264 def encode_position(value) when is_integer(value), do: value
265265 def encode_position(_), do: {:error, "Unexpected type when encoding Column.position"}
266266
267+ def decode_table_column_id(value) when is_integer(value), do: value
268+ def decode_table_column_id(_), do: {:error, "Unexpected type when decoding Column.table_column_id"}
269+
270+ def encode_table_column_id(value) when is_integer(value), do: value
271+ def encode_table_column_id(_), do: {:error, "Unexpected type when encoding Column.table_column_id"}
272+
273+ def decode_width(value) when is_integer(value), do: value
274+ def decode_width(_), do: {:error, "Unexpected type when decoding Column.width"}
275+
276+ def encode_width(value) when is_integer(value), do: value
277+ def encode_width(_), do: {:error, "Unexpected type when encoding Column.width"}
278+
267279 def from_map(m) do
268280 %Column{
269281 cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
@@ -275,8 +287,8 @@ defmodule Column do
275287 name: decode_name(m["name"]),
276288 position: decode_position(m["position"]),
277289 render_type_name: TypeName.decode(m["renderTypeName"]),
278- table_column_id: m["tableColumnId"],
279- width: m["width"],
290+ table_column_id: m["tableColumnId"] && decode_table_column_id(m["tableColumnId"]),
291+ width: m["width"] && decode_width(m["width"]),
280292 }
281293 end
Test case

test/inputs/json/misc/be234.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -244,12 +244,24 @@ defmodule MediaEmbed do
244244 def encode_content(value) when is_binary(value), do: value
245245 def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
246246
247+ def decode_height(value) when is_integer(value), do: value
248+ def decode_height(_), do: {:error, "Unexpected type when decoding MediaEmbed.height"}
249+
250+ def encode_height(value) when is_integer(value), do: value
251+ def encode_height(_), do: {:error, "Unexpected type when encoding MediaEmbed.height"}
252+
253+ def decode_width(value) when is_integer(value), do: value
254+ def decode_width(_), do: {:error, "Unexpected type when decoding MediaEmbed.width"}
255+
256+ def encode_width(value) when is_integer(value), do: value
257+ def encode_width(_), do: {:error, "Unexpected type when encoding MediaEmbed.width"}
258+
247259 def from_map(m) do
248260 %MediaEmbed{
249261 content: m["content"] && decode_content(m["content"]),
250- height: m["height"],
262+ height: m["height"] && decode_height(m["height"]),
251263 scrolling: m["scrolling"],
252- width: m["width"],
264+ width: m["width"] && decode_width(m["width"]),
253265 }
254266 end
Test case

test/inputs/json/misc/e8b04.json

1 generated file · +49 −7
Melixirdefault / QuickType.ex+49 −7
@@ -634,14 +634,26 @@ defmodule ChildMetadata do
634634 unified_version: integer() | nil
635635 }
636636
637+ def decode_include_auto(value) when is_integer(value), do: value
638+ def decode_include_auto(_), do: {:error, "Unexpected type when decoding ChildMetadata.include_auto"}
639+
640+ def encode_include_auto(value) when is_integer(value), do: value
641+ def encode_include_auto(_), do: {:error, "Unexpected type when encoding ChildMetadata.include_auto"}
642+
643+ def decode_unified_version(value) when is_integer(value), do: value
644+ def decode_unified_version(_), do: {:error, "Unexpected type when decoding ChildMetadata.unified_version"}
645+
646+ def encode_unified_version(value) when is_integer(value), do: value
647+ def encode_unified_version(_), do: {:error, "Unexpected type when encoding ChildMetadata.unified_version"}
648+
637649 def from_map(m) do
638650 %ChildMetadata{
639651 custom_values: m["customValues"],
640652 freeform: m["freeform"],
641- include_auto: m["includeAuto"],
653+ include_auto: m["includeAuto"] && decode_include_auto(m["includeAuto"]),
642654 operator: m["operator"] && MetadataOperator.decode(m["operator"]),
643655 table_column_id: m["tableColumnId"] && TableColumnID.from_map(m["tableColumnId"]),
644- unified_version: m["unifiedVersion"],
656+ unified_version: m["unifiedVersion"] && decode_unified_version(m["unifiedVersion"]),
645657 }
646658 end
647659
@@ -1650,6 +1662,12 @@ defmodule Owner do
16501662 def encode_id(value) when is_binary(value), do: value
16511663 def encode_id(_), do: {:error, "Unexpected type when encoding Owner.id"}
16521664
1665+ def decode_last_notification_seen_at(value) when is_integer(value), do: value
1666+ def decode_last_notification_seen_at(_), do: {:error, "Unexpected type when decoding Owner.last_notification_seen_at"}
1667+
1668+ def encode_last_notification_seen_at(value) when is_integer(value), do: value
1669+ def encode_last_notification_seen_at(_), do: {:error, "Unexpected type when encoding Owner.last_notification_seen_at"}
1670+
16531671 def decode_profile_image_url_large(value) when is_binary(value), do: value
16541672 def decode_profile_image_url_large(_), do: {:error, "Unexpected type when decoding Owner.profile_image_url_large"}
16551673
@@ -1679,7 +1697,7 @@ defmodule Owner do
16791697 display_name: decode_display_name(m["displayName"]),
16801698 flags: m["flags"],
16811699 id: decode_id(m["id"]),
1682- last_notification_seen_at: m["lastNotificationSeenAt"],
1700+ last_notification_seen_at: m["lastNotificationSeenAt"] && decode_last_notification_seen_at(m["lastNotificationSeenAt"]),
16831701 profile_image_url_large: m["profileImageUrlLarge"] && decode_profile_image_url_large(m["profileImageUrlLarge"]),
16841702 profile_image_url_medium: m["profileImageUrlMedium"] && decode_profile_image_url_medium(m["profileImageUrlMedium"]),
16851703 profile_image_url_small: m["profileImageUrlSmall"] && decode_profile_image_url_small(m["profileImageUrlSmall"]),
@@ -2148,6 +2166,12 @@ defmodule TopLevelElement do
21482166 def encode_id(value) when is_binary(value), do: value
21492167 def encode_id(_), do: {:error, "Unexpected type when encoding TopLevelElement.id"}
21502168
2169+ def decode_index_updated_at(value) when is_integer(value), do: value
2170+ def decode_index_updated_at(_), do: {:error, "Unexpected type when decoding TopLevelElement.index_updated_at"}
2171+
2172+ def encode_index_updated_at(value) when is_integer(value), do: value
2173+ def encode_index_updated_at(_), do: {:error, "Unexpected type when encoding TopLevelElement.index_updated_at"}
2174+
21512175 def decode_locale(value) when is_binary(value), do: value
21522176 def decode_locale(_), do: {:error, "Unexpected type when decoding TopLevelElement.locale"}
21532177
@@ -2184,6 +2208,12 @@ defmodule TopLevelElement do
21842208 def encode_publication_append_enabled(value) when is_boolean(value), do: value
21852209 def encode_publication_append_enabled(_), do: {:error, "Unexpected type when encoding TopLevelElement.publication_append_enabled"}
21862210
2211+ def decode_publication_date(value) when is_integer(value), do: value
2212+ def decode_publication_date(_), do: {:error, "Unexpected type when decoding TopLevelElement.publication_date"}
2213+
2214+ def encode_publication_date(value) when is_integer(value), do: value
2215+ def encode_publication_date(_), do: {:error, "Unexpected type when encoding TopLevelElement.publication_date"}
2216+
21872217 def decode_publication_group(value) when is_integer(value), do: value
21882218 def decode_publication_group(_), do: {:error, "Unexpected type when decoding TopLevelElement.publication_group"}
21892219
@@ -2208,6 +2238,18 @@ defmodule TopLevelElement do
22082238 def encode_row_class(value) when is_binary(value), do: value
22092239 def encode_row_class(_), do: {:error, "Unexpected type when encoding TopLevelElement.row_class"}
22102240
2241+ def decode_row_identifier_column_id(value) when is_integer(value), do: value
2242+ def decode_row_identifier_column_id(_), do: {:error, "Unexpected type when decoding TopLevelElement.row_identifier_column_id"}
2243+
2244+ def encode_row_identifier_column_id(value) when is_integer(value), do: value
2245+ def encode_row_identifier_column_id(_), do: {:error, "Unexpected type when encoding TopLevelElement.row_identifier_column_id"}
2246+
2247+ def decode_rows_updated_at(value) when is_integer(value), do: value
2248+ def decode_rows_updated_at(_), do: {:error, "Unexpected type when decoding TopLevelElement.rows_updated_at"}
2249+
2250+ def encode_rows_updated_at(value) when is_integer(value), do: value
2251+ def encode_rows_updated_at(_), do: {:error, "Unexpected type when encoding TopLevelElement.rows_updated_at"}
2252+
22112253 def decode_table_id(value) when is_integer(value), do: value
22122254 def decode_table_id(_), do: {:error, "Unexpected type when decoding TopLevelElement.table_id"}
22132255
@@ -2245,7 +2287,7 @@ defmodule TopLevelElement do
22452287 hide_from_catalog: decode_hide_from_catalog(m["hideFromCatalog"]),
22462288 hide_from_data_json: decode_hide_from_data_json(m["hideFromDataJson"]),
22472289 id: decode_id(m["id"]),
2248- index_updated_at: m["indexUpdatedAt"],
2290+ index_updated_at: m["indexUpdatedAt"] && decode_index_updated_at(m["indexUpdatedAt"]),
22492291 locale: decode_locale(m["locale"]),
22502292 metadata: TopLevelMetadata.from_map(m["metadata"]),
22512293 moderation_status: m["moderationStatus"],
@@ -2257,15 +2299,15 @@ defmodule TopLevelElement do
22572299 owner: Owner.from_map(m["owner"]),
22582300 provenance: Provenance.decode(m["provenance"]),
22592301 publication_append_enabled: decode_publication_append_enabled(m["publicationAppendEnabled"]),
2260- publication_date: m["publicationDate"],
2302+ publication_date: m["publicationDate"] && decode_publication_date(m["publicationDate"]),
22612303 publication_group: decode_publication_group(m["publicationGroup"]),
22622304 publication_stage: PublicationStage.decode(m["publicationStage"]),
22632305 ratings: m["ratings"] && Ratings.from_map(m["ratings"]),
22642306 resource_name: m["resourceName"] && decode_resource_name(m["resourceName"]),
22652307 rights: Enum.map(m["rights"], &Right.decode/1),
22662308 row_class: m["rowClass"] && decode_row_class(m["rowClass"]),
2267- row_identifier_column_id: m["rowIdentifierColumnId"],
2268- rows_updated_at: m["rowsUpdatedAt"],
2309+ row_identifier_column_id: m["rowIdentifierColumnId"] && decode_row_identifier_column_id(m["rowIdentifierColumnId"]),
2310+ rows_updated_at: m["rowsUpdatedAt"] && decode_rows_updated_at(m["rowsUpdatedAt"]),
22692311 rows_updated_by: m["rowsUpdatedBy"] && RowsUpdatedBy.decode(m["rowsUpdatedBy"]),
22702312 table_author: TableAuthor.from_map(m["tableAuthor"]),
22712313 table_id: decode_table_id(m["tableId"]),
Test case

test/inputs/json/misc/f74d5.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -264,6 +264,18 @@ defmodule Column do
264264 def encode_position(value) when is_integer(value), do: value
265265 def encode_position(_), do: {:error, "Unexpected type when encoding Column.position"}
266266
267+ def decode_table_column_id(value) when is_integer(value), do: value
268+ def decode_table_column_id(_), do: {:error, "Unexpected type when decoding Column.table_column_id"}
269+
270+ def encode_table_column_id(value) when is_integer(value), do: value
271+ def encode_table_column_id(_), do: {:error, "Unexpected type when encoding Column.table_column_id"}
272+
273+ def decode_width(value) when is_integer(value), do: value
274+ def decode_width(_), do: {:error, "Unexpected type when decoding Column.width"}
275+
276+ def encode_width(value) when is_integer(value), do: value
277+ def encode_width(_), do: {:error, "Unexpected type when encoding Column.width"}
278+
267279 def from_map(m) do
268280 %Column{
269281 cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
@@ -275,8 +287,8 @@ defmodule Column do
275287 name: decode_name(m["name"]),
276288 position: decode_position(m["position"]),
277289 render_type_name: TypeName.decode(m["renderTypeName"]),
278- table_column_id: m["tableColumnId"],
279- width: m["width"],
290+ table_column_id: m["tableColumnId"] && decode_table_column_id(m["tableColumnId"]),
291+ width: m["width"] && decode_width(m["width"]),
280292 }
281293 end
Test case

test/inputs/json/misc/fcca3.json

1 generated file · +14 −2
Melixirdefault / QuickType.ex+14 −2
@@ -298,6 +298,18 @@ defmodule Column do
298298 def encode_position(value) when is_integer(value), do: value
299299 def encode_position(_), do: {:error, "Unexpected type when encoding Column.position"}
300300
301+ def decode_table_column_id(value) when is_integer(value), do: value
302+ def decode_table_column_id(_), do: {:error, "Unexpected type when decoding Column.table_column_id"}
303+
304+ def encode_table_column_id(value) when is_integer(value), do: value
305+ def encode_table_column_id(_), do: {:error, "Unexpected type when encoding Column.table_column_id"}
306+
307+ def decode_width(value) when is_integer(value), do: value
308+ def decode_width(_), do: {:error, "Unexpected type when decoding Column.width"}
309+
310+ def encode_width(value) when is_integer(value), do: value
311+ def encode_width(_), do: {:error, "Unexpected type when encoding Column.width"}
312+
301313 def from_map(m) do
302314 %Column{
303315 cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
@@ -310,8 +322,8 @@ defmodule Column do
310322 name: decode_name(m["name"]),
311323 position: decode_position(m["position"]),
312324 render_type_name: TypeName.decode(m["renderTypeName"]),
313- table_column_id: m["tableColumnId"],
314- width: m["width"],
325+ table_column_id: m["tableColumnId"] && decode_table_column_id(m["tableColumnId"]),
326+ width: m["width"] && decode_width(m["width"]),
315327 }
316328 end
Test case

test/inputs/json/priority/blns-object.json

2 generated files · +2,101 −0
Aobjective-c-compiledefault / QTTopLevel.h+628 −0
@@ -0,0 +1,628 @@
1+// To parse this JSON:
2+//
3+// NSError *error;
4+// QTTopLevel *topLevel = [QTTopLevel fromJSON:json encoding:NSUTF8Encoding error:&error];
5+
6+#import <Foundation/Foundation.h>
7+
8+@class QTTopLevel;
9+@class QTA;
10+@class QTB;
11+@class QTC;
12+
13+NS_ASSUME_NONNULL_BEGIN
14+
15+#pragma mark - Top-level marshaling functions
16+
17+QTTopLevel *_Nullable QTTopLevelFromData(NSData *data, NSError **error);
18+QTTopLevel *_Nullable QTTopLevelFromJSON(NSString *json, NSStringEncoding encoding, NSError **error);
19+NSData *_Nullable QTTopLevelToData(QTTopLevel *topLevel, NSError **error);
20+NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding encoding, NSError **error);
21+
22+#pragma mark - Object interfaces
23+
24+@interface QTTopLevel : NSObject
25+@property (nonatomic, strong) QTA *a;
26+@property (nonatomic, strong) QTB *b;
27+@property (nonatomic, strong) QTC *c;
28+
29++ (_Nullable instancetype)fromJSON:(NSString *)json encoding:(NSStringEncoding)encoding error:(NSError *_Nullable *)error;
30++ (_Nullable instancetype)fromData:(NSData *)data error:(NSError *_Nullable *)error;
31+- (NSString *_Nullable)toJSON:(NSStringEncoding)encoding error:(NSError *_Nullable *)error;
32+- (NSData *_Nullable)toData:(NSError *_Nullable *)error;
33+@end
34+
35+@interface QTA : NSObject
36+@property (nonatomic, copy) NSString *a;
37+@property (nonatomic, copy) NSString *a0;
38+@property (nonatomic, copy) NSString *a000;
39+@property (nonatomic, copy) NSString *a0000;
40+@property (nonatomic, copy) NSString *a1;
41+@property (nonatomic, copy) NSString *a100000000;
42+@property (nonatomic, copy) NSString *a1E02;
43+@property (nonatomic, copy) NSString *aAlert123T;
44+@property (nonatomic, copy) NSString *aFalse;
45+@property (nonatomic, copy) NSString *aHrefJava123456781112ScriptJavascriptAlert1XXXA;
46+@property (nonatomic, copy) NSString *aHrefJavascriptX09JavascriptAlert1IDFuzzelement1TestA;
47+@property (nonatomic, copy) NSString *aHrefJavascriptX0AJavascriptAlert1IDFuzzelement1TestA;
48+@property (nonatomic, copy) NSString *aHrefJavascriptX3AJavascriptAlert1IDFuzzelement1TestA;
49+@property (nonatomic, copy) NSString *aHrefX01JavascriptJavascriptAlert1IDFuzzelement1TestA;
50+@property (nonatomic, copy) NSString *aHrefX05JavascriptJavascriptAlert1IDFuzzelement1TestA;
51+@property (nonatomic, copy) NSString *aHrefX08JavascriptJavascriptAlert1IDFuzzelement1TestA;
52+@property (nonatomic, copy) NSString *aHrefX09JavascriptJavascriptAlert1IDFuzzelement1TestA;
53+@property (nonatomic, copy) NSString *aHrefX0CjavascriptJavascriptAlert1IDFuzzelement1TestA;
54+@property (nonatomic, copy) NSString *aHrefX10JavascriptJavascriptAlert1IDFuzzelement1TestA;
55+@property (nonatomic, copy) NSString *aHrefX11JavascriptJavascriptAlert1IDFuzzelement1TestA;
56+@property (nonatomic, copy) NSString *aHrefX13JavascriptJavascriptAlert1IDFuzzelement1TestA;
57+@property (nonatomic, copy) NSString *aHrefX17JavascriptJavascriptAlert1IDFuzzelement1TestA;
58+@property (nonatomic, copy) NSString *aHrefX1FjavascriptJavascriptAlert1IDFuzzelement1TestA;
59+@property (nonatomic, copy) NSString *aHrefXC2XA0JavascriptJavascriptAlert1IDFuzzelement1TestA;
60+@property (nonatomic, copy) NSString *aHrefXE1X9AX80JavascriptJavascriptAlert1IDFuzzelement1TestA;
61+@property (nonatomic, copy) NSString *aHrefXE1XA0X8EjavascriptJavascriptAlert1IDFuzzelement1TestA;
62+@property (nonatomic, copy) NSString *aHrefXE2X80X83JavascriptJavascriptAlert1IDFuzzelement1TestA;
63+@property (nonatomic, copy) NSString *aHrefXE2X80X84JavascriptJavascriptAlert1IDFuzzelement1TestA;
64+@property (nonatomic, copy) NSString *aHrefXE2X80X86JavascriptJavascriptAlert1IDFuzzelement1TestA;
65+@property (nonatomic, copy) NSString *aHrefXE2X80X87JavascriptJavascriptAlert1IDFuzzelement1TestA;
66+@property (nonatomic, copy) NSString *aHrefXE2X80XA8JavascriptJavascriptAlert1IDFuzzelement1TestA;
67+@property (nonatomic, copy) NSString *aNil;
68+@property (nonatomic, copy) NSString *aTRUE;
69+@property (nonatomic, copy) NSString *aTest;
70+@property (nonatomic, copy) NSString *aTrue;
71+@property (nonatomic, copy) NSString *abcDivStyleXExpX00RessionJavascriptAlert1DEF;
72+@property (nonatomic, copy) NSString *abcDivStyleXExpX5CressionJavascriptAlert1DEF;
73+@property (nonatomic, copy) NSString *abcDivStyleXX09ExpressionJavascriptAlert1DEF;
74+@property (nonatomic, copy) NSString *abcDivStyleXX0BexpressionJavascriptAlert1DEF;
75+@property (nonatomic, copy) NSString *abcDivStyleXX20ExpressionJavascriptAlert1DEF;
76+@property (nonatomic, copy) NSString *abcDivStyleXX3AexpressionJavascriptAlert1DEF;
77+@property (nonatomic, copy) NSString *abcDivStyleXXC2XA0ExpressionJavascriptAlert1DEF;
78+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X80ExpressionJavascriptAlert1DEF;
79+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X84ExpressionJavascriptAlert1DEF;
80+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X89ExpressionJavascriptAlert1DEF;
81+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X8BexpressionJavascriptAlert1DEF;
82+@property (nonatomic, copy) NSString *alert123;
83+@property (nonatomic, copy) NSString *alert123T;
84+@property (nonatomic, copy) NSString *alertXSS;
85+@property (nonatomic, copy) NSString *andU200BZEROWIDTHSPACEWhichAreInTheCCategoriesButAreOften;
86+@property (nonatomic, copy) NSString *another;
87+@property (nonatomic, copy) NSString *arsenalCanal;
88+@property (nonatomic, copy) NSString *autofocusOnkeyupJavascriptAlert123;
89+@property (nonatomic, copy) NSString *aux;
90+@property (nonatomic, copy) NSString *changingLengthWhenLowercased;
91+@property (nonatomic, copy) NSString *charactersWhichIncreaseInLength2To3BytesWhenLowercased;
92+@property (nonatomic, copy) NSString *classic;
93+@property (nonatomic, copy) NSString *commandInjectionRuby;
94+@property (nonatomic, copy) NSString *d;
95+@property (nonatomic, copy) NSString *dickVanDyke;
96+@property (nonatomic, copy) NSString *drHermanILibshitz;
97+@property (nonatomic, copy) NSString *empty;
98+@property (nonatomic, copy) NSString *envHome;
99+@property (nonatomic, copy) NSString *etcHosts;
100+@property (nonatomic, copy) NSString *etcPasswd00;
101+@property (nonatomic, copy) NSString *fontsAndHaveANumberOfSpecialBehaviors;
102+@property (nonatomic, copy) NSString *fooValBar;
103+@property (nonatomic, copy) NSString *home;
104+@property (nonatomic, copy) NSString *humanInjection;
105+@property (nonatomic, copy) NSString *iNVOkINGTHEFÈẸLINGOFCHÁOS;
106+@property (nonatomic, copy) NSString *ifImgSrcXOnerrorJavascriptAlert1;
107+@property (nonatomic, copy) NSString *ifScriptJavascriptAlert1Script;
108+@property (nonatomic, copy) NSString *imgSRCJavAscriptAlertXSS;
109+@property (nonatomic, copy) NSString *imgSRCJavX0AAscriptAlertXSS;
110+@property (nonatomic, copy) NSString *imgSRCJavX0DAscriptAlertXSS;
111+@property (nonatomic, copy) NSString *imgSrc106971189711599114105112116589710810111411640398883833941;
112+@property (nonatomic, copy) NSString *imgSrcX09XOnerrorJavascriptAlert1;
113+@property (nonatomic, copy) NSString *imgSrcX11XOnerrorJavascriptAlert1;
114+@property (nonatomic, copy) NSString *imgSrcXOnerrorX00JavascriptAlert1;
115+@property (nonatomic, copy) NSString *imgSrcXOnerrorX09JavascriptAlert1;
116+@property (nonatomic, copy) NSString *imgSrcXX09OnerrorJavascriptAlert1;
117+@property (nonatomic, copy) NSString *imgSrcXX10OnerrorJavascriptAlert1;
118+@property (nonatomic, copy) NSString *imgSrcXX11OnerrorJavascriptAlert1;
119+@property (nonatomic, copy) NSString *imgSrcXX12OnerrorJavascriptAlert1;
120+@property (nonatomic, copy) NSString *imgSrcXX13OnerrorJavascriptAlert1;
121+@property (nonatomic, copy) NSString *imgSrcXxxXX00OnerrorJavascriptAlert1;
122+@property (nonatomic, copy) NSString *imgSrcXxxXX0BonerrorJavascriptAlert1;
123+@property (nonatomic, copy) NSString *imgSrcXxxXX2FonerrorJavascriptAlert1;
124+@property (nonatomic, copy) NSString *imgX00SrcXOnerrorAlert1;
125+@property (nonatomic, copy) NSString *imgX10SrcXOnerrorJavascriptAlert1;
126+@property (nonatomic, copy) NSString *imgX13SrcXOnerrorJavascriptAlert1;
127+@property (nonatomic, copy) NSString *imgX32SrcXOnerrorJavascriptAlert1;
128+@property (nonatomic, copy) NSString *imgX39SrcXOnerrorJavascriptAlert1;
129+@property (nonatomic, copy) NSString *inf;
130+@property (nonatomic, copy) NSString *infinity;
131+@property (nonatomic, copy) NSString *innocuousStringsWhichMayBeBlockedByProfanityFiltersHTTPSEnWikipediaOrgWikiScunthorpeProblem;
132+@property (nonatomic, assign) BOOL isDontMakeAMap;
133+@property (nonatomic, copy) NSString *jimmyClitheroe;
134+@property (nonatomic, copy) NSString *kernelExit1;
135+@property (nonatomic, copy) NSString *knownCVEsAndVulnerabilities;
136+@property (nonatomic, copy) NSString *lightwaterCountryPark;
137+@property (nonatomic, copy) NSString *lpt2;
138+@property (nonatomic, copy) NSString *lpt3;
139+@property (nonatomic, copy) NSString *lsAl;
140+@property (nonatomic, copy) NSString *msdosWindowsSpecialFilenames;
141+@property (nonatomic, copy) NSString *nonWhitespaceC1ControlsU0080ThroughU0084AndU0086ThroughU009F;
142+@property (nonatomic, copy) NSString *none;
143+@property (nonatomic, copy) NSString *null;
144+@property (nonatomic, copy) NSString *one;
145+@property (nonatomic, copy) NSString *one0;
146+@property (nonatomic, copy) NSString *one1;
147+@property (nonatomic, copy) NSString *onfocusJaVaSCriptAlert123Autofocus;
148+@property (nonatomic, copy) NSString *or11;
149+@property (nonatomic, copy) NSString *penistoneCommunityChurch;
150+@property (nonatomic, copy) NSString *perlEPrintIMGSRCJava0ScriptAlertXSSOut;
151+@property (nonatomic, copy) NSString *prn;
152+@property (nonatomic, copy) NSString *romansInSussexCoUk;
153+@property (nonatomic, copy) NSString *s;
154+@property (nonatomic, copy) NSString *sUnSU;
155+@property (nonatomic, copy) NSString *scScriptRiptAlert123ScScriptRipt;
156+@property (nonatomic, copy) NSString *scriptAlert123ScriptX;
157+@property (nonatomic, copy) NSString *scriptInjection;
158+@property (nonatomic, copy) NSString *scriptSRCHTTPHaCkersOrgXSSJSB;
159+@property (nonatomic, copy) NSString *scriptSRCHTTPHaCkersOrgXSSJSSCRIPT;
160+@property (nonatomic, copy) NSString *scriptScriptAlert123Script;
161+@property (nonatomic, copy) NSString *scriptX00JavascriptAlert1Script;
162+@property (nonatomic, copy) NSString *scriptX09TypeTextJavascriptJavascriptAlert1Script;
163+@property (nonatomic, copy) NSString *scriptX0CjavascriptAlert1Script;
164+@property (nonatomic, copy) NSString *scriptX0DjavascriptAlert1Script;
165+@property (nonatomic, copy) NSString *scriptX20TypeTextJavascriptJavascriptAlert1Script;
166+@property (nonatomic, copy) NSString *scriptX3EtypeTextJavascriptJavascriptAlert1Script;
167+@property (nonatomic, copy) NSString *scriptXC2X85JavascriptAlert1Script;
168+@property (nonatomic, copy) NSString *scriptXC2XA0JavascriptAlert1Script;
169+@property (nonatomic, copy) NSString *scriptXE1X9AX80JavascriptAlert1Script;
170+@property (nonatomic, copy) NSString *scriptXE1XA0X8EjavascriptAlert1Script;
171+@property (nonatomic, copy) NSString *scriptXE2X80X81JavascriptAlert1Script;
172+@property (nonatomic, copy) NSString *scriptXE2X80X86JavascriptAlert1Script;
173+@property (nonatomic, copy) NSString *scriptXE2X80X89JavascriptAlert1Script;
174+@property (nonatomic, copy) NSString *scriptXE2X81X9FjavascriptAlert1Script;
175+@property (nonatomic, copy) NSString *scriptXEFXBBXBFjavascriptAlert1Script;
176+@property (nonatomic, copy) NSString *scriptXF0X90X96X9AjavascriptAlert1Script;
177+@property (nonatomic, copy) NSString *scriptXSSSRCHTTPHaCkersOrgXSSJSSCRIPT;
178+@property (nonatomic, copy) NSString *some;
179+@property (nonatomic, copy) NSString *some0;
180+@property (nonatomic, copy) NSString *sqlInjection;
181+@property (nonatomic, copy) NSString *stringWhichCanRevealSystemFilesWhenParsedByABadlyConfiguredXMLParser;
182+@property (nonatomic, copy) NSString *stringsThatTestForKnownVulnerabilities;
183+@property (nonatomic, copy) NSString *stringsWhichCanBeAccidentallyExpandedIntoDifferentStringsIfEvaluatedInTheWrongContextEGUsedAsAPrintfFormatStringOrViaPERLOrShellEvalMightExposeSensitiveDataFromTheProgramDoingTheInterpolationOrMightJustRepresentTheWrongString;
184+@property (nonatomic, copy) NSString *stringsWhichCanCallSystemCommandsWithinRubyRailsApplications;
185+@property (nonatomic, copy) NSString *stringsWhichConsistsOfJapaneseStyleEmoticonsWhichArePopularOnTheWeb;
186+@property (nonatomic, copy) NSString *stringsWhichContainBoldItalicEtcVersionsOfNormalCharacters;
187+@property (nonatomic, copy) NSString *stringsWhichContainCommonUnicodeSymbolsEGSmartQuotes;
188+@property (nonatomic, copy) NSString *stringsWhichContainEmojiShouldBeTheSameBehaviorAsTwoByteCharactersButNotAlways;
189+@property (nonatomic, copy) NSString *stringsWhichContainMisplacedQuotationMarksCanCauseEncodingErrors;
190+@property (nonatomic, copy) NSString *stringsWhichContainUnicodeSubscriptsSuperscriptsCanCauseRenderingIssues;
191+@property (nonatomic, copy) NSString *stringsWhichCrashedIMessageInVariousVersionsOfIOS;
192+@property (nonatomic, copy) NSString *stringsWhichMayCauseHumanToReinterpretWorldview;
193+@property (nonatomic, copy) NSString *superBowlXXX;
194+@property (nonatomic, copy) NSString *test;
195+@property (nonatomic, copy) NSString *textareaScriptAlert123Script;
196+@property (nonatomic, copy) NSString *the;
197+@property (nonatomic, copy) NSString *the0;
198+@property (nonatomic, copy) NSString *the00;
199+@property (nonatomic, copy) NSString *the000;
200+@property (nonatomic, copy) NSString *the0000;
201+@property (nonatomic, copy) NSString *the00Ɩ;
202+@property (nonatomic, copy) NSString *the0X0;
203+@property (nonatomic, copy) NSString *the1;
204+@property (nonatomic, copy) NSString *the10;
205+@property (nonatomic, copy) NSString *the100;
206+@property (nonatomic, copy) NSString *the1000;
207+@property (nonatomic, copy) NSString *the100000;
208+@property (nonatomic, copy) NSString *the100000000;
209+@property (nonatomic, copy) NSString *the11;
210+@property (nonatomic, copy) NSString *the12;
211+@property (nonatomic, copy) NSString *the123456789012345678901234567890123456789;
212+@property (nonatomic, copy) NSString *the13;
213+@property (nonatomic, copy) NSString *the14;
214+@property (nonatomic, copy) NSString *the15;
215+@property (nonatomic, copy) NSString *the16;
216+@property (nonatomic, copy) NSString *the17;
217+@property (nonatomic, copy) NSString *the18;
218+@property (nonatomic, copy) NSString *the19;
219+@property (nonatomic, copy) NSString *the1DROPTABLEUsers;
220+@property (nonatomic, copy) NSString *the1E02;
221+@property (nonatomic, copy) NSString *the1E2;
222+@property (nonatomic, copy) NSString *the1Qnan;
223+@property (nonatomic, copy) NSString *the1Snan;
224+@property (nonatomic, copy) NSString *the2;
225+@property (nonatomic, copy) NSString *the20;
226+@property (nonatomic, copy) NSString *the21;
227+@property (nonatomic, copy) NSString *the22;
228+@property (nonatomic, copy) NSString *the23;
229+@property (nonatomic, copy) NSString *the3;
230+@property (nonatomic, copy) NSString *the4;
231+@property (nonatomic, copy) NSString *the5;
232+@property (nonatomic, copy) NSString *the6;
233+@property (nonatomic, copy) NSString *the7;
234+@property (nonatomic, copy) NSString *the8;
235+@property (nonatomic, copy) NSString *the9;
236+@property (nonatomic, copy) NSString *the999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
237+@property (nonatomic, copy) NSString *theFalse;
238+@property (nonatomic, copy) NSString *theNextTwoLinesMayAppearToBeBlankOrMojibakeInSomeViewers;
239+@property (nonatomic, copy) NSString *theQuicKBrownFoXBeeeep;
240+@property (nonatomic, copy) NSString *theTest;
241+@property (nonatomic, copy) NSString *the٠١٢٣٤٥٦٧٨٩;
242+@property (nonatomic, copy) NSString *twoByteCharacters;
243+@property (nonatomic, copy) NSString *u0000U000AOrU000DNULLFCR;
244+@property (nonatomic, copy) NSString *uOncopyAlertCopyMeU;
245+@property (nonatomic, copy) NSString *undef;
246+@property (nonatomic, copy) NSString *unicodeFont;
247+@property (nonatomic, copy) NSString *unicodeNumbers;
248+@property (nonatomic, copy) NSString *unwantedInterpolation;
249+@property (nonatomic, copy) NSString *xLsAl;
250+@property (nonatomic, copy) NSString *zḀḶGO;
251+@property (nonatomic, copy) NSString *ªº;
252+@property (nonatomic, copy) NSString *çIÂ;
253+@property (nonatomic, copy) NSString *œÁØ;
254+@property (nonatomic, copy) NSString *œØπ;
255+@property (nonatomic, copy) NSString *ʖ;
256+@property (nonatomic, copy) NSString *הָיְתָהTestالصفحاتالتّحول;
257+@property (nonatomic, copy) NSString *ثمنفسسقطتوبالتحديدجزيرتيباستخدامأندنوإذهناالستاروتنصيبكانأهّلايطاليابريطانيافرنساقدأخذسليمانإتفاقيةبينمايذكرالحدودأيبعدمعاملةبولنداالإطلاقعلإيو;
258+@property (nonatomic, copy) NSString *ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็;
259+@property (nonatomic, copy) NSString *ⱥ;
260+@property (nonatomic, copy) NSString *ⱦ;
261+@property (nonatomic, copy) NSString *パーティーへ行かないか;
262+@property (nonatomic, copy) NSString *和製漢語;
263+@property (nonatomic, copy) NSString *田中さんにあげて下さい;
264+@property (nonatomic, copy) NSString *fifl;
265+@property (nonatomic, copy) NSString *ィ;
266+@end
267+
268+@interface QTB : NSObject
269+@property (nonatomic, copy) NSString *aHrefHTTPFooBarXYAImgAltImgSrcXXOnerrorJavascriptAlert1A;
270+@property (nonatomic, copy) NSString *aHrefJavascriptX00JavascriptAlert1IDFuzzelement1TestA;
271+@property (nonatomic, copy) NSString *aHrefJavascriptX0DJavascriptAlert1IDFuzzelement1TestA;
272+@property (nonatomic, copy) NSString *aHrefX02JavascriptJavascriptAlert1IDFuzzelement1TestA;
273+@property (nonatomic, copy) NSString *aHrefX04JavascriptJavascriptAlert1IDFuzzelement1TestA;
274+@property (nonatomic, copy) NSString *aHrefX0AjavascriptJavascriptAlert1IDFuzzelement1TestA;
275+@property (nonatomic, copy) NSString *aHrefX0DjavascriptJavascriptAlert1IDFuzzelement1TestA;
276+@property (nonatomic, copy) NSString *aHrefX0EjavascriptJavascriptAlert1IDFuzzelement1TestA;
277+@property (nonatomic, copy) NSString *aHrefX0FjavascriptJavascriptAlert1IDFuzzelement1TestA;
278+@property (nonatomic, copy) NSString *aHrefX16JavascriptJavascriptAlert1IDFuzzelement1TestA;
279+@property (nonatomic, copy) NSString *aHrefX19JavascriptJavascriptAlert1IDFuzzelement1TestA;
280+@property (nonatomic, copy) NSString *aHrefX1AjavascriptJavascriptAlert1IDFuzzelement1TestA;
281+@property (nonatomic, copy) NSString *aHrefX1DjavascriptJavascriptAlert1IDFuzzelement1TestA;
282+@property (nonatomic, copy) NSString *aHrefX1EjavascriptJavascriptAlert1IDFuzzelement1TestA;
283+@property (nonatomic, copy) NSString *aHrefXE2X80X81JavascriptJavascriptAlert1IDFuzzelement1TestA;
284+@property (nonatomic, copy) NSString *aHrefXE2X80X82JavascriptJavascriptAlert1IDFuzzelement1TestA;
285+@property (nonatomic, copy) NSString *aHrefXE2X80XA9JavascriptJavascriptAlert1IDFuzzelement1TestA;
286+@property (nonatomic, copy) NSString *aHrefXE2X80XAFjavascriptJavascriptAlert1IDFuzzelement1TestA;
287+@property (nonatomic, copy) NSString *abcDivStyleXExpressionX5CJavascriptAlert1DEF;
288+@property (nonatomic, copy) NSString *abcDivStyleXX0AexpressionJavascriptAlert1DEF;
289+@property (nonatomic, copy) NSString *abcDivStyleXX0DexpressionJavascriptAlert1DEF;
290+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X82ExpressionJavascriptAlert1DEF;
291+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X83ExpressionJavascriptAlert1DEF;
292+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X85ExpressionJavascriptAlert1DEF;
293+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X87ExpressionJavascriptAlert1DEF;
294+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X8AexpressionJavascriptAlert1DEF;
295+@property (nonatomic, copy) NSString *another;
296+@property (nonatomic, copy) NSString *appearInInput;
297+@property (nonatomic, copy) NSString *ath0;
298+@property (nonatomic, copy) NSString *autofocusOnkeyupJavascriptAlert123;
299+@property (nonatomic, copy) NSString *b;
300+@property (nonatomic, copy) NSString *b100000;
301+@property (nonatomic, copy) NSString *bFALSE;
302+@property (nonatomic, copy) NSString *bIMGSRCOnmouseoverAlertXxs;
303+@property (nonatomic, copy) NSString *bNIL;
304+@property (nonatomic, copy) NSString *bScriptAlert123Script;
305+@property (nonatomic, copy) NSString *bTouchTmpBlnsFail;
306+@property (nonatomic, copy) NSString *basement;
307+@property (nonatomic, copy) NSString *butNow20CforMyGreatestTrick8M;
308+@property (nonatomic, copy) NSString *byteOrderMarksUFEFFAndUFFFEEachOnItsOwnLine;
309+@property (nonatomic, copy) NSString *com1;
310+@property (nonatomic, copy) NSString *com3;
311+@property (nonatomic, copy) NSString *commonlyMisinterpretedAsAdditionalGraphicCharacters;
312+@property (nonatomic, copy) NSString *con;
313+@property (nonatomic, copy) NSString *contextsDividedIntoThreeGroupsBasedOnUSLayoutKeyboardPosition;
314+@property (nonatomic, copy) NSString *creditHTTPSTwitterCOMJifaStatus625776454479970304;
315+@property (nonatomic, copy) NSString *devNullTouchTmpBlnsFailEcho;
316+@property (nonatomic, copy) NSString *empty;
317+@property (nonatomic, copy) NSString *evalPutsHelloWorld;
318+@property (nonatomic, copy) NSString *expression;
319+@property (nonatomic, copy) NSString *file;
320+@property (nonatomic, copy) NSString *fileInclusion;
321+@property (nonatomic, copy) NSString *fooValBar;
322+@property (nonatomic, copy) NSString *generalCategoryCFInUnicode800;
323+@property (nonatomic, copy) NSString *hEWHOWAĮTSBEHINDTHEWALḼ;
324+@property (nonatomic, copy) NSString *help;
325+@property (nonatomic, copy) NSString *httpA3030;
326+@property (nonatomic, copy) NSString *iOSVulnerabilities;
327+@property (nonatomic, copy) NSString *ifYouReReadingThisYouVeBeenInAComaForAlmost20YearsNowWeReTryingANewTechniqueWeDonTKnowWhereThisMessageWillEndUpInYourDreamButWeHopeItWorksPleaseWakeUpWeMissYou;
328+@property (nonatomic, copy) NSString *iframeSrcHTTPHaCkersOrgScriptletHTML;
329+@property (nonatomic, copy) NSString *imgSRC14JavascriptAlertXSS;
330+@property (nonatomic, copy) NSString *imgSRCJavX09AscriptAlertXSS;
331+@property (nonatomic, copy) NSString *imgSRCOnmouseoverAlertXxs;
332+@property (nonatomic, copy) NSString *imgSRCX6AX61X76X61X73X63X72X69X70X74X3AX61X6CX65X72X74X28X27X58X53X53X27X29;
333+@property (nonatomic, copy) NSString *imgSrc00001060000097000011800000970000115000009900001140000105000011200001160000058000009700001080000101000011400001160000040000003900000880000083000008300000390000041;
334+@property (nonatomic, copy) NSString *imgSrcX00XOnerrorJavascriptAlert1;
335+@property (nonatomic, copy) NSString *imgSrcXOnerrorX11JavascriptAlert1;
336+@property (nonatomic, copy) NSString *imgSrcXOnerrorX12JavascriptAlert1;
337+@property (nonatomic, copy) NSString *imgSrcXxxXX0AonerrorJavascriptAlert1;
338+@property (nonatomic, copy) NSString *imgSrcXxxXX0ConerrorJavascriptAlert1;
339+@property (nonatomic, copy) NSString *imgSrcXxxXX0DonerrorJavascriptAlert1;
340+@property (nonatomic, copy) NSString *imgX00SrcXOnerrorJavascriptAlert1;
341+@property (nonatomic, copy) NSString *imgX11SrcXOnerrorJavascriptAlert1;
342+@property (nonatomic, copy) NSString *imgX12SrcXOnerrorJavascriptAlert1;
343+@property (nonatomic, copy) NSString *imgX47SrcXOnerrorJavascriptAlert1;
344+@property (nonatomic, copy) NSString *ircSpecificStrings;
345+@property (nonatomic, assign) BOOL isDontMakeAMap;
346+@property (nonatomic, copy) NSString *japaneseEmoticons;
347+@property (nonatomic, copy) NSString *kernelExecLsAl;
348+@property (nonatomic, copy) NSString *lindaCallahan;
349+@property (nonatomic, copy) NSString *nul;
350+@property (nonatomic, copy) NSString *null;
351+@property (nonatomic, copy) NSString *numericStrings;
352+@property (nonatomic, copy) NSString *oftenForbiddenToAppearInVariousTextBasedFileFormatsEGXML;
353+@property (nonatomic, copy) NSString *one;
354+@property (nonatomic, copy) NSString *onfocusJaVaSCriptAlert123Autofocus;
355+@property (nonatomic, copy) NSString *or111;
356+@property (nonatomic, copy) NSString *quotationMarks;
357+@property (nonatomic, copy) NSString *regionalIndicatorSymbols;
358+@property (nonatomic, copy) NSString *regionalIndicatorSymbolsCanBeDisplayedDifferentlyAcross;
359+@property (nonatomic, copy) NSString *reservedStrings;
360+@property (nonatomic, copy) NSString *scriptAlert123Script;
361+@property (nonatomic, copy) NSString *scriptAlert123ScriptX;
362+@property (nonatomic, copy) NSString *scriptAlertXSSSCRIPT;
363+@property (nonatomic, copy) NSString *scriptSRCHaCkersOrgJ;
364+@property (nonatomic, copy) NSString *scriptSrcJscriptSScript;
365+@property (nonatomic, copy) NSString *scriptX09JavascriptAlert1Script;
366+@property (nonatomic, copy) NSString *scriptX0AtypeTextJavascriptJavascriptAlert1Script;
367+@property (nonatomic, copy) NSString *scriptX0DtypeTextJavascriptJavascriptAlert1Script;
368+@property (nonatomic, copy) NSString *scriptX21JavascriptAlert1Script;
369+@property (nonatomic, copy) NSString *scriptX3BjavascriptAlert1Script;
370+@property (nonatomic, copy) NSString *scriptXE2X80X85JavascriptAlert1Script;
371+@property (nonatomic, copy) NSString *scriptXE2X80X87JavascriptAlert1Script;
372+@property (nonatomic, copy) NSString *scriptXE2X80X8AjavascriptAlert1Script;
373+@property (nonatomic, copy) NSString *scriptXE2X80XA8JavascriptAlert1Script;
374+@property (nonatomic, copy) NSString *scriptXE2X80XA9JavascriptAlert1Script;
375+@property (nonatomic, copy) NSString *scriptXE2X80XAFjavascriptAlert1Script;
376+@property (nonatomic, copy) NSString *scriptXE3X80X80JavascriptAlert1Script;
377+@property (nonatomic, copy) NSString *scunthorpeProblem;
378+@property (nonatomic, copy) NSString *some;
379+@property (nonatomic, copy) NSString *stringsThatMayOccurOnIRCClientsThatMakeSecurityProductsFreakOut;
380+@property (nonatomic, copy) NSString *stringsWhichAreReservedCharactersInMSDOSWindows;
381+@property (nonatomic, copy) NSString *stringsWhichAttemptToInvokeABenignScriptInjectionShowsVulnerabilityToXSS;
382+@property (nonatomic, copy) NSString *stringsWhichContainTextThatShouldBeRenderedRTLIfPossibleEGArabicHebrew;
383+@property (nonatomic, copy) NSString *stringsWhichContainTwoByteCharactersCanCauseRenderingIssuesOrCharacterLengthIssues;
384+@property (nonatomic, copy) NSString *stringsWhichContainUnicodeNumbersIfTheCodeIsLocalizedItShouldSeeTheInputAsNumeric;
385+@property (nonatomic, copy) NSString *stringsWhichMayBeUsedElsewhereInCode;
386+@property (nonatomic, copy) NSString *terminalEscapeCodes;
387+@property (nonatomic, copy) NSString *the;
388+@property (nonatomic, copy) NSString *the000;
389+@property (nonatomic, copy) NSString *the01000;
390+@property (nonatomic, copy) NSString *the08;
391+@property (nonatomic, copy) NSString *the09;
392+@property (nonatomic, copy) NSString *the0Xffffffffffffffff;
393+@property (nonatomic, copy) NSString *the1;
394+@property (nonatomic, copy) NSString *the100;
395+@property (nonatomic, copy) NSString *the1000;
396+@property (nonatomic, copy) NSString *the100000;
397+@property (nonatomic, copy) NSString *the100000000;
398+@property (nonatomic, copy) NSString *the1DROPTABLEUsers1;
399+@property (nonatomic, copy) NSString *the1Ind;
400+@property (nonatomic, copy) NSString *the1Inf;
401+@property (nonatomic, copy) NSString *the2;
402+@property (nonatomic, copy) NSString *the21474836481;
403+@property (nonatomic, copy) NSString *the22250738585072011E308;
404+@property (nonatomic, copy) NSString *the3;
405+@property (nonatomic, copy) NSString *theNextLineMayAppearToBeBlankMojibakeOrDingbatsInSomeViewers;
406+@property (nonatomic, copy) NSString *theNextLineMayAppearToBeBlankOrMojibakeInSomeViewers;
407+@property (nonatomic, copy) NSString *theNextLineMayBeFlaggedForTrailingWhitespaceInSomeViewers;
408+@property (nonatomic, copy) NSString *theScriptAlert123Script;
409+@property (nonatomic, copy) NSString *the123;
410+@property (nonatomic, copy) NSString *thisFileUnfortunatelyCannotExpressStringsContaining;
411+@property (nonatomic, copy) NSString *touchTmpBlnsFail;
412+@property (nonatomic, copy) NSString *touchTmpBlnsShellshock2Fail;
413+@property (nonatomic, copy) NSString *tysonGay;
414+@property (nonatomic, copy) NSString *unicodeSymbols;
415+@property (nonatomic, copy) NSString *x00ScriptJavascriptAlert1Script;
416+@property (nonatomic, copy) NSString *x3CscriptJavascriptAlert1Script;
417+@property (nonatomic, copy) NSString *åßƑÆ;
418+@property (nonatomic, copy) NSString *ɐnbᴉlɐⱯuƃɐɯƎɹolopꞱǝƎɹoqɐlꞱnꞱunpᴉpᴉɔuᴉɹodɯǝʇPoɯsnᴉǝOpPǝsꞱᴉlǝƂuᴉɔsᴉdᴉpɐɹnʇǝʇɔǝsuoɔꞱǝɯɐꞱᴉsɹolopƜnsdᴉƜǝɹo;
419+@property (nonatomic, copy) NSString *ωÇΜ;
420+@property (nonatomic, copy) NSString *ຈل͜ຈノヽຈل͜ຈノ;
421+@property (nonatomic, copy) NSString *ṱOINVOKèTHEHIVEMINDREPRESEǸTINGCHAOS;
422+@property (nonatomic, copy) NSString *社會科學院語學研究所;
423+@property (nonatomic, copy) NSString *部落格;
424+@property (nonatomic, copy) NSString *사회과학원어학연구소;
425+@property (nonatomic, copy) NSString *찦차를타고온펲시맨과쑛다리똠방각하;
426+@property (nonatomic, copy) NSString *ﷺ;
427+@property (nonatomic, copy) NSString *ロ_;
428+@end
429+
430+@interface QTC : NSObject
431+@property (nonatomic, copy) NSString *_1;
432+@property (nonatomic, copy) NSString *a;
433+@property (nonatomic, copy) NSString *aHrefX00JavascriptJavascriptAlert1IDFuzzelement1TestA;
434+@property (nonatomic, copy) NSString *aHrefX03JavascriptJavascriptAlert1IDFuzzelement1TestA;
435+@property (nonatomic, copy) NSString *aHrefX06JavascriptJavascriptAlert1IDFuzzelement1TestA;
436+@property (nonatomic, copy) NSString *aHrefX07JavascriptJavascriptAlert1IDFuzzelement1TestA;
437+@property (nonatomic, copy) NSString *aHrefX0BjavascriptJavascriptAlert1IDFuzzelement1TestA;
438+@property (nonatomic, copy) NSString *aHrefX12JavascriptJavascriptAlert1IDFuzzelement1TestA;
439+@property (nonatomic, copy) NSString *aHrefX14JavascriptJavascriptAlert1IDFuzzelement1TestA;
440+@property (nonatomic, copy) NSString *aHrefX15JavascriptJavascriptAlert1IDFuzzelement1TestA;
441+@property (nonatomic, copy) NSString *aHrefX18JavascriptJavascriptAlert1IDFuzzelement1TestA;
442+@property (nonatomic, copy) NSString *aHrefX1BjavascriptJavascriptAlert1IDFuzzelement1TestA;
443+@property (nonatomic, copy) NSString *aHrefX1CjavascriptJavascriptAlert1IDFuzzelement1TestA;
444+@property (nonatomic, copy) NSString *aHrefX20JavascriptJavascriptAlert1IDFuzzelement1TestA;
445+@property (nonatomic, copy) NSString *aHrefXE2X80X80JavascriptJavascriptAlert1IDFuzzelement1TestA;
446+@property (nonatomic, copy) NSString *aHrefXE2X80X85JavascriptJavascriptAlert1IDFuzzelement1TestA;
447+@property (nonatomic, copy) NSString *aHrefXE2X80X88JavascriptJavascriptAlert1IDFuzzelement1TestA;
448+@property (nonatomic, copy) NSString *aHrefXE2X80X89JavascriptJavascriptAlert1IDFuzzelement1TestA;
449+@property (nonatomic, copy) NSString *aHrefXE2X80X8AjavascriptJavascriptAlert1IDFuzzelement1TestA;
450+@property (nonatomic, copy) NSString *aHrefXE2X81X9FjavascriptJavascriptAlert1IDFuzzelement1TestA;
451+@property (nonatomic, copy) NSString *aHrefXE3X80X80JavascriptJavascriptAlert1IDFuzzelement1TestA;
452+@property (nonatomic, copy) NSString *abcDivStyleXExpressionX00JavascriptAlert1DEF;
453+@property (nonatomic, copy) NSString *abcDivStyleXX00ExpressionJavascriptAlert1DEF;
454+@property (nonatomic, copy) NSString *abcDivStyleXX0CexpressionJavascriptAlert1DEF;
455+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X81ExpressionJavascriptAlert1DEF;
456+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X86ExpressionJavascriptAlert1DEF;
457+@property (nonatomic, copy) NSString *abcDivStyleXXE2X80X88ExpressionJavascriptAlert1DEF;
458+@property (nonatomic, copy) NSString *abcDivStyleXXE3X80X80ExpressionJavascriptAlert1DEF;
459+@property (nonatomic, copy) NSString *abcDivStyleXXEFXBBXBFexpressionJavascriptAlert1DEF;
460+@property (nonatomic, copy) NSString *andU007FDEL;
461+@property (nonatomic, copy) NSString *another;
462+@property (nonatomic, copy) NSString *asciiPunctuationAllOfTheseCharactersMayNeedToBeEscapedInSome;
463+@property (nonatomic, copy) NSString *bodyOnloadAlertXSS;
464+@property (nonatomic, copy) NSString *c;
465+@property (nonatomic, copy) NSString *c00;
466+@property (nonatomic, copy) NSString *c000;
467+@property (nonatomic, copy) NSString *c1;
468+@property (nonatomic, copy) NSString *c100;
469+@property (nonatomic, copy) NSString *c100000;
470+@property (nonatomic, copy) NSString *c100000000;
471+@property (nonatomic, copy) NSString *c1E02;
472+@property (nonatomic, copy) NSString *cScriptAlert123Script;
473+@property (nonatomic, copy) NSString *cTrue;
474+@property (nonatomic, copy) NSString *clock;
475+@property (nonatomic, copy) NSString *com2;
476+@property (nonatomic, copy) NSString *com4;
477+@property (nonatomic, copy) NSString *craigCockburnSoftwareSpecialist;
478+@property (nonatomic, copy) NSString *dccSendStartkeylogger000;
479+@property (nonatomic, copy) NSString *emoji;
480+@property (nonatomic, copy) NSString *empty;
481+@property (nonatomic, copy) NSString *evaluate;
482+@property (nonatomic, copy) NSString *fooValBar;
483+@property (nonatomic, copy) NSString *hasOwnProperty;
484+@property (nonatomic, copy) NSString *hornimanMuseum;
485+@property (nonatomic, copy) NSString *httpWWWCumQcCA;
486+@property (nonatomic, copy) NSString *iOnwheelAlert1ScrollOverMeI;
487+@property (nonatomic, copy) NSString *imgABCSrcDXEOnerrorFAlert1;
488+@property (nonatomic, copy) NSString *imgOnmouseoverAlertXxs;
489+@property (nonatomic, copy) NSString *imgSCRIPTAlertXSSSCRIPT;
490+@property (nonatomic, copy) NSString *imgSRCJavascriptAlertStringFromCharCode888383;
491+@property (nonatomic, copy) NSString *imgSRCJavascriptAlertXSS;
492+@property (nonatomic, copy) NSString *imgSrcOnerrorAltJavascriptAlert1;
493+@property (nonatomic, copy) NSString *imgSrcX10XOnerrorJavascriptAlert1;
494+@property (nonatomic, copy) NSString *imgSrcX12XOnerrorJavascriptAlert1;
495+@property (nonatomic, copy) NSString *imgSrcX13XOnerrorJavascriptAlert1;
496+@property (nonatomic, copy) NSString *imgSrcX32XOnerrorJavascriptAlert1;
497+@property (nonatomic, copy) NSString *imgSrcX47XOnerrorJavascriptAlert1;
498+@property (nonatomic, copy) NSString *imgSrcXOnerrorAlert123;
499+@property (nonatomic, copy) NSString *imgSrcXOnerrorX10JavascriptAlert1;
500+@property (nonatomic, copy) NSString *imgSrcXOnerrorX32JavascriptAlert1;
501+@property (nonatomic, copy) NSString *imgSrcXScriptJavascriptAlert1Script;
502+@property (nonatomic, copy) NSString *imgSrcXxxXX09OnerrorJavascriptAlert1;
503+@property (nonatomic, copy) NSString *imgSrcXxxXX20OnerrorJavascriptAlert1;
504+@property (nonatomic, copy) NSString *imgSrcXxxXX22OnerrorJavascriptAlert1;
505+@property (nonatomic, copy) NSString *imgSrcXxxXX27OnerrorJavascriptAlert1;
506+@property (nonatomic, copy) NSString *imgX11SrcXOnerrorJavascriptAlert1;
507+@property (nonatomic, copy) NSString *imgX34SrcXOnerrorJavascriptAlert1;
508+@property (nonatomic, copy) NSString *imgX47SrcXOnerrorJavascriptAlert1;
509+@property (nonatomic, copy) NSString *infinity;
510+@property (nonatomic, assign) BOOL isDontMakeAMap;
511+@property (nonatomic, copy) NSString *javaSCriptAlert123;
512+@property (nonatomic, copy) NSString *lpt1;
513+@property (nonatomic, copy) NSString *ltScriptGtAlert3912339LtScriptGt;
514+@property (nonatomic, copy) NSString *magnaCumLaude;
515+@property (nonatomic, copy) NSString *medievalErectionOfParapets;
516+@property (nonatomic, copy) NSString *mocha;
517+@property (nonatomic, copy) NSString *naN;
518+@property (nonatomic, copy) NSString *nonWhitespaceC0ControlsU0001ThroughU0008U000EThroughU001F;
519+@property (nonatomic, copy) NSString *null;
520+@property (nonatomic, copy) NSString *one;
521+@property (nonatomic, copy) NSString *one00;
522+@property (nonatomic, copy) NSString *one100000;
523+@property (nonatomic, copy) NSString *one100000000;
524+@property (nonatomic, copy) NSString *onfocusJaVaSCriptAlert123Autofocus;
525+@property (nonatomic, copy) NSString *orReusedForInternalDelimitersOnTheTheoryThatTheyShouldNever;
526+@property (nonatomic, copy) NSString *plaintext;
527+@property (nonatomic, copy) NSString *powerلُلُصّبُلُلصّبُررًॣॣH冗;
528+@property (nonatomic, copy) NSString *rightToLeftStrings;
529+@property (nonatomic, copy) NSString *rosesAre031Mred0MVioletsAre034MblueHopeYouEnjoyTerminalHue;
530+@property (nonatomic, copy) NSString *s;
531+@property (nonatomic, copy) NSString *scriptAlert123Script;
532+@property (nonatomic, copy) NSString *scriptAlert123ScriptX;
533+@property (nonatomic, copy) NSString *scriptJavascriptAlert1Script;
534+@property (nonatomic, copy) NSString *scriptScriptAlert123Script;
535+@property (nonatomic, copy) NSString *scriptSrcJscriptSScript;
536+@property (nonatomic, copy) NSString *scriptX0AjavascriptAlert1Script;
537+@property (nonatomic, copy) NSString *scriptX0BjavascriptAlert1Script;
538+@property (nonatomic, copy) NSString *scriptX0CtypeTextJavascriptJavascriptAlert1Script;
539+@property (nonatomic, copy) NSString *scriptX20JavascriptAlert1Script;
540+@property (nonatomic, copy) NSString *scriptX2BjavascriptAlert1Script;
541+@property (nonatomic, copy) NSString *scriptX2FtypeTextJavascriptJavascriptAlert1Script;
542+@property (nonatomic, copy) NSString *scriptX7EjavascriptAlert1Script;
543+@property (nonatomic, copy) NSString *scriptXE2X80X80JavascriptAlert1Script;
544+@property (nonatomic, copy) NSString *scriptXE2X80X82JavascriptAlert1Script;
545+@property (nonatomic, copy) NSString *scriptXE2X80X83JavascriptAlert1Script;
546+@property (nonatomic, copy) NSString *scriptXE2X80X84JavascriptAlert1Script;
547+@property (nonatomic, copy) NSString *scriptXE2X80X88JavascriptAlert1Script;
548+@property (nonatomic, copy) NSString *scriptXE2X80X8BjavascriptAlert1Script;
549+@property (nonatomic, copy) NSString *scriptXEFXBFXAEjavascriptAlert1Script;
550+@property (nonatomic, copy) NSString *scriptXEFXBFXBEjavascriptAlert1Script;
551+@property (nonatomic, copy) NSString *scunthorpeGeneralHospital;
552+@property (nonatomic, copy) NSString *serverCodeInjection;
553+@property (nonatomic, copy) NSString *shitakeMushrooms;
554+@property (nonatomic, copy) NSString *some;
555+@property (nonatomic, copy) NSString *some00;
556+@property (nonatomic, copy) NSString *specialCharacters;
557+@property (nonatomic, copy) NSString *srcJaVaSCriptPrompt132;
558+@property (nonatomic, copy) NSString *stringsWhichCanBeInterpretedAsNumeric;
559+@property (nonatomic, copy) NSString *stringsWhichCanCauseASQLInjectionIfInputsAreNotSanitized;
560+@property (nonatomic, copy) NSString *stringsWhichCanCauseUserToPullInFilesThatShouldNotBeAPartOfAWebServer;
561+@property (nonatomic, copy) NSString *stringsWhichCanCauseUserToRunCodeOnServerAsAPrivilegedUserCFHTTPSNewsYcombinatorCOMItemID7665153;
562+@property (nonatomic, copy) NSString *stringsWhichContainCorruptedTextTheCorruptionWillNotAppearInNonHTMLTextHoweverViaHTTPWWWEeemoNet;
563+@property (nonatomic, copy) NSString *stringsWhichContainUnicodeWithAnUpsidedownEffectViaHTTPWWWUpsidedowntextCOM;
564+@property (nonatomic, copy) NSString *stringsWhichContainUnicodeWithUnusualPropertiesEGRightToLeftOverrideCFHTTPWWWUnicodeOrgChartsPDFU2000PDF;
565+@property (nonatomic, copy) NSString *stringsWhichPunishTheFoolsWhoUseCatTypeOnThisFile;
566+@property (nonatomic, copy) NSString *svgScript1231Alert123Script;
567+@property (nonatomic, copy) NSString *systemLsAl;
568+@property (nonatomic, copy) NSString *systemTouchTmpBlnsFail;
569+@property (nonatomic, copy) NSString *test;
570+@property (nonatomic, copy) NSString *testTest;
571+@property (nonatomic, copy) NSString *the;
572+@property (nonatomic, copy) NSString *the00;
573+@property (nonatomic, copy) NSString *the000;
574+@property (nonatomic, copy) NSString *the0TouchTmpBlnsShellshock1Fail;
575+@property (nonatomic, copy) NSString *the0Xabad1Dea;
576+@property (nonatomic, copy) NSString *the0Xffffffff;
577+@property (nonatomic, copy) NSString *the0️;
578+@property (nonatomic, copy) NSString *the0️1️2️3️4️5️6️7️8️9️;
579+@property (nonatomic, copy) NSString *the1;
580+@property (nonatomic, copy) NSString *the10;
581+@property (nonatomic, copy) NSString *the100;
582+@property (nonatomic, copy) NSString *the100000;
583+@property (nonatomic, copy) NSString *the100000000;
584+@property (nonatomic, copy) NSString *the11;
585+@property (nonatomic, copy) NSString *the12;
586+@property (nonatomic, copy) NSString *the13;
587+@property (nonatomic, copy) NSString *the1E02;
588+@property (nonatomic, copy) NSString *the1E2;
589+@property (nonatomic, copy) NSString *the1Ind;
590+@property (nonatomic, copy) NSString *the2;
591+@property (nonatomic, copy) NSString *the3;
592+@property (nonatomic, copy) NSString *the4;
593+@property (nonatomic, copy) NSString *the5;
594+@property (nonatomic, copy) NSString *the6;
595+@property (nonatomic, copy) NSString *the7;
596+@property (nonatomic, copy) NSString *the8;
597+@property (nonatomic, copy) NSString *the9;
598+@property (nonatomic, copy) NSString *the92233720368547758081;
599+@property (nonatomic, copy) NSString *theScriptAlert123Script;
600+@property (nonatomic, copy) NSString *the١٢٣;
601+@property (nonatomic, copy) NSString *titleOnpropertychangeJavascriptAlert1TitleTitleTitle;
602+@property (nonatomic, copy) NSString *treatedAsWhitespaceInSomeContexts;
603+@property (nonatomic, copy) NSString *trickUnicode;
604+@property (nonatomic, copy) NSString *undefined;
605+@property (nonatomic, copy) NSString *unicodeAdditionalControlCharactersAllOfTheCharactersWith;
606+@property (nonatomic, copy) NSString *unicodeSubscriptSuperscriptAccents;
607+@property (nonatomic, copy) NSString *unicodeUpsidedown;
608+@property (nonatomic, copy) NSString *user;
609+@property (nonatomic, copy) NSString *version;
610+@property (nonatomic, copy) NSString *version800PlusU0009HTU000BVTU000CFFU0085NEL;
611+@property (nonatomic, copy) NSString *whitespaceAllOfTheCharactersWithCategoryZsZlOrZpInUnicode;
612+@property (nonatomic, copy) NSString *xmlVersion10EncodingISO88591DOCTYPEFooELEMENTFooANYENTITYXxeSYSTEMFileEtcPasswdFooXxeFoo;
613+@property (nonatomic, copy) NSString *xxeInjectionXML;
614+@property (nonatomic, copy) NSString *zalgoText;
615+@property (nonatomic, copy) NSString *zz;
616+@property (nonatomic, copy) NSString *åíîïÓôÒúæ;
617+@property (nonatomic, copy) NSString *ω;
618+@property (nonatomic, copy) NSString *ёђѓєѕіїјљњћќѝўџабвгдежзийклмнопрстуфхцчшщъыьэюЯабвгдежзийклмнопрстуфхцчшщъыьэюя;
619+@property (nonatomic, copy) NSString *בְּרֵאשִׁיתבָּרָאאֱלֹהִיםאֵתהַשָּׁמַיִםוְאֵתהָאָרֶץ;
620+@property (nonatomic, copy) NSString *مُنَاقَشَةُسُبُلِاِسْتِخْدَامِاللُّغَةِفِيالنُّظُمِالْقَائِمَةِوَفِيميَخُصَّالتَّطْبِيقَاتُالْحاسُوبِيَّةُ;
621+@property (nonatomic, copy) NSString *ṯHENEZPERDIANHIVḘMINḌǪFCḤAƠSZALGO;
622+@property (nonatomic, copy) NSString *ノº_ºノ;
623+@property (nonatomic, copy) NSString *울란바토르;
624+@property (nonatomic, copy) NSString *theQuickBrownFoxJumpsOverTheLazyDog;
625+@property (nonatomic, copy) NSString *ノಥ益ಥノ;
626+@end
627+
628+NS_ASSUME_NONNULL_END
Aobjective-c-compiledefault / QTTopLevel.m+1,473 −0
@@ -0,0 +1,1473 @@
1+#import "QTTopLevel.h"
2+
3+#define λ(decl, expr) (^(decl) { return (expr); })
4+
5+static id NSNullify(id _Nullable x) {
6+ return (x == nil || x == NSNull.null) ? NSNull.null : x;
7+}
8+
9+NS_ASSUME_NONNULL_BEGIN
10+
11+@interface QTTopLevel (JSONConversion)
12++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
13+- (NSDictionary *)JSONDictionary;
14+@end
15+
16+@interface QTA (JSONConversion)
17++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
18+- (NSDictionary *)JSONDictionary;
19+@end
20+
21+@interface QTB (JSONConversion)
22++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
23+- (NSDictionary *)JSONDictionary;
24+@end
25+
26+@interface QTC (JSONConversion)
27++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
28+- (NSDictionary *)JSONDictionary;
29+@end
30+
31+#pragma mark - JSON serialization
32+
33+QTTopLevel *_Nullable QTTopLevelFromData(NSData *data, NSError **error)
34+{
35+ @try {
36+ id json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error];
37+ return *error ? nil : [QTTopLevel fromJSONDictionary:json];
38+ } @catch (NSException *exception) {
39+ *error = [NSError errorWithDomain:@"JSONSerialization" code:-1 userInfo:@{ @"exception": exception }];
40+ return nil;
41+ }
42+}
43+
44+QTTopLevel *_Nullable QTTopLevelFromJSON(NSString *json, NSStringEncoding encoding, NSError **error)
45+{
46+ return QTTopLevelFromData([json dataUsingEncoding:encoding], error);
47+}
48+
49+NSData *_Nullable QTTopLevelToData(QTTopLevel *topLevel, NSError **error)
50+{
51+ @try {
52+ id json = [topLevel JSONDictionary];
53+ NSData *data = [NSJSONSerialization dataWithJSONObject:json options:NSJSONWritingFragmentsAllowed error:error];
54+ return *error ? nil : data;
55+ } @catch (NSException *exception) {
56+ *error = [NSError errorWithDomain:@"JSONSerialization" code:-1 userInfo:@{ @"exception": exception }];
57+ return nil;
58+ }
59+}
60+
61+NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding encoding, NSError **error)
62+{
63+ NSData *data = QTTopLevelToData(topLevel, error);
64+ return data ? [[NSString alloc] initWithData:data encoding:encoding] : nil;
65+}
66+
67+@implementation QTTopLevel
68++ (NSDictionary<NSString *, NSString *> *)properties
69+{
70+ static NSDictionary<NSString *, NSString *> *properties;
71+ return properties = properties ? properties : @{
72+ @"a": @"a",
73+ @"b": @"b",
74+ @"c": @"c",
75+ };
76+}
77+
78++ (_Nullable instancetype)fromData:(NSData *)data error:(NSError *_Nullable *)error
79+{
80+ return QTTopLevelFromData(data, error);
81+}
82+
83++ (_Nullable instancetype)fromJSON:(NSString *)json encoding:(NSStringEncoding)encoding error:(NSError *_Nullable *)error
84+{
85+ return QTTopLevelFromJSON(json, encoding, error);
86+}
87+
88++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
89+{
90+ return [dict isKindOfClass:NSDictionary.class] ? [[QTTopLevel alloc] initWithJSONDictionary:dict] : nil;
91+}
92+
93+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
94+{
95+ if (self = [super init]) {
96+ if (![dict[@"a"] isKindOfClass:NSDictionary.class]) return nil;
97+ if (![dict[@"b"] isKindOfClass:NSDictionary.class]) return nil;
98+ if (![dict[@"c"] isKindOfClass:NSDictionary.class]) return nil;
99+ [self setValuesForKeysWithDictionary:dict];
100+ _a = [QTA fromJSONDictionary:(id)_a];
101+ if (!_a && dict[@"a"] && ![dict[@"a"] isKindOfClass:NSNull.class]) return nil;
102+ _b = [QTB fromJSONDictionary:(id)_b];
103+ if (!_b && dict[@"b"] && ![dict[@"b"] isKindOfClass:NSNull.class]) return nil;
104+ _c = [QTC fromJSONDictionary:(id)_c];
105+ if (!_c && dict[@"c"] && ![dict[@"c"] isKindOfClass:NSNull.class]) return nil;
106+ }
107+ return self;
108+}
109+
110+- (void)setValue:(nullable id)value forKey:(NSString *)key
111+{
112+ id resolved = QTTopLevel.properties[key];
113+ if (resolved) [super setValue:value forKey:resolved];
114+}
115+
116+- (void)setNilValueForKey:(NSString *)key
117+{
118+ id resolved = QTTopLevel.properties[key];
119+ if (resolved) [super setValue:@(0) forKey:resolved];
120+}
121+
122+- (NSDictionary *)JSONDictionary
123+{
124+ id dict = [[self dictionaryWithValuesForKeys:QTTopLevel.properties.allValues] mutableCopy];
125+
126+ [dict addEntriesFromDictionary:@{
127+ @"a": [_a JSONDictionary],
128+ @"b": [_b JSONDictionary],
129+ @"c": [_c JSONDictionary],
130+ }];
131+
132+ return dict;
133+}
134+
135+- (NSData *_Nullable)toData:(NSError *_Nullable *)error
136+{
137+ return QTTopLevelToData(self, error);
138+}
139+
140+- (NSString *_Nullable)toJSON:(NSStringEncoding)encoding error:(NSError *_Nullable *)error
141+{
142+ return QTTopLevelToJSON(self, encoding, error);
143+}
144+@end
145+
146+@implementation QTA
147++ (NSDictionary<NSString *, NSString *> *)properties
148+{
149+ static NSDictionary<NSString *, NSString *> *properties;
150+ return properties = properties ? properties : @{
151+ @"!@#$%^&*()`~": @"a",
152+ @"-0": @"a0",
153+ @"0,00": @"a000",
154+ @"0.0/0.0": @"a0000",
155+ @"-1": @"a1",
156+ @"1'000'000.00": @"a100000000",
157+ @"1E02": @"a1E02",
158+ @"';alert(123);t='": @"aAlert123T",
159+ @"False": @"aFalse",
160+ @"<a href=java&#1&#2&#3&#4&#5&#6&#7&#8&#11&#12script:javascript:alert(1)>XXX</a>": @"aHrefJava123456781112ScriptJavascriptAlert1XXXA",
161+ @"<a href=\"javascript\\x09:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefJavascriptX09JavascriptAlert1IDFuzzelement1TestA",
162+ @"<a href=\"javascript\\x0A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefJavascriptX0AJavascriptAlert1IDFuzzelement1TestA",
163+ @"<a href=\"javascript\\x3A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefJavascriptX3AJavascriptAlert1IDFuzzelement1TestA",
164+ @"<a href=\"\\x01javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX01JavascriptJavascriptAlert1IDFuzzelement1TestA",
165+ @"<a href=\"\\x05javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX05JavascriptJavascriptAlert1IDFuzzelement1TestA",
166+ @"<a href=\"\\x08javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX08JavascriptJavascriptAlert1IDFuzzelement1TestA",
167+ @"<a href=\"\\x09javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX09JavascriptJavascriptAlert1IDFuzzelement1TestA",
168+ @"<a href=\"\\x0Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX0CjavascriptJavascriptAlert1IDFuzzelement1TestA",
169+ @"<a href=\"\\x10javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX10JavascriptJavascriptAlert1IDFuzzelement1TestA",
170+ @"<a href=\"\\x11javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX11JavascriptJavascriptAlert1IDFuzzelement1TestA",
171+ @"<a href=\"\\x13javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX13JavascriptJavascriptAlert1IDFuzzelement1TestA",
172+ @"<a href=\"\\x17javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX17JavascriptJavascriptAlert1IDFuzzelement1TestA",
173+ @"<a href=\"\\x1Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX1FjavascriptJavascriptAlert1IDFuzzelement1TestA",
174+ @"<a href=\"\\xC2\\xA0javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXC2XA0JavascriptJavascriptAlert1IDFuzzelement1TestA",
175+ @"<a href=\"\\xE1\\x9A\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE1X9AX80JavascriptJavascriptAlert1IDFuzzelement1TestA",
176+ @"<a href=\"\\xE1\\xA0\\x8Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE1XA0X8EjavascriptJavascriptAlert1IDFuzzelement1TestA",
177+ @"<a href=\"\\xE2\\x80\\x83javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X83JavascriptJavascriptAlert1IDFuzzelement1TestA",
178+ @"<a href=\"\\xE2\\x80\\x84javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X84JavascriptJavascriptAlert1IDFuzzelement1TestA",
179+ @"<a href=\"\\xE2\\x80\\x86javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X86JavascriptJavascriptAlert1IDFuzzelement1TestA",
180+ @"<a href=\"\\xE2\\x80\\x87javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X87JavascriptJavascriptAlert1IDFuzzelement1TestA",
181+ @"<a href=\"\\xE2\\x80\\xA8javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80XA8JavascriptJavascriptAlert1IDFuzzelement1TestA",
182+ @"nil": @"aNil",
183+ @"TRUE": @"aTRUE",
184+ @"\u202btest\u202b": @"aTest",
185+ @"True": @"aTrue",
186+ @"ABC<div style=\"x:exp\\x00ression(javascript:alert(1)\">DEF": @"abcDivStyleXExpX00RessionJavascriptAlert1DEF",
187+ @"ABC<div style=\"x:exp\\x5Cression(javascript:alert(1)\">DEF": @"abcDivStyleXExpX5CressionJavascriptAlert1DEF",
188+ @"ABC<div style=\"x:\\x09expression(javascript:alert(1)\">DEF": @"abcDivStyleXX09ExpressionJavascriptAlert1DEF",
189+ @"ABC<div style=\"x:\\x0Bexpression(javascript:alert(1)\">DEF": @"abcDivStyleXX0BexpressionJavascriptAlert1DEF",
190+ @"ABC<div style=\"x:\\x20expression(javascript:alert(1)\">DEF": @"abcDivStyleXX20ExpressionJavascriptAlert1DEF",
191+ @"ABC<div style=\"x\\x3Aexpression(javascript:alert(1)\">DEF": @"abcDivStyleXX3AexpressionJavascriptAlert1DEF",
192+ @"ABC<div style=\"x:\\xC2\\xA0expression(javascript:alert(1)\">DEF": @"abcDivStyleXXC2XA0ExpressionJavascriptAlert1DEF",
193+ @"ABC<div style=\"x:\\xE2\\x80\\x80expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X80ExpressionJavascriptAlert1DEF",
194+ @"ABC<div style=\"x:\\xE2\\x80\\x84expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X84ExpressionJavascriptAlert1DEF",
195+ @"ABC<div style=\"x:\\xE2\\x80\\x89expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X89ExpressionJavascriptAlert1DEF",
196+ @"ABC<div style=\"x:\\xE2\\x80\\x8Bexpression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X8BexpressionJavascriptAlert1DEF",
197+ @";alert(123);": @"alert123",
198+ @"\";alert(123);t=\"": @"alert123T",
199+ @"\\\";alert('XSS');//": @"alertXSS",
200+ @"# and U+200B (ZERO WIDTH SPACE), which are in the C categories but are often": @"andU200BZEROWIDTHSPACEWhichAreInTheCCategoriesButAreOften",
201+ @",": @"another",
202+ @"Arsenal canal": @"arsenalCanal",
203+ @"\" autofocus onkeyup=\"javascript:alert(123)": @"autofocusOnkeyupJavascriptAlert123",
204+ @"AUX": @"aux",
205+ @"#\tChanging length when lowercased": @"changingLengthWhenLowercased",
206+ @"#\tCharacters which increase in length (2 to 3 bytes) when lowercased": @"charactersWhichIncreaseInLength2To3BytesWhenLowercased",
207+ @"classic": @"classic",
208+ @"#\tCommand Injection (Ruby)": @"commandInjectionRuby",
209+ @"%d": @"d",
210+ @"Dick Van Dyke": @"dickVanDyke",
211+ @"Dr. Herman I. Libshitz": @"drHermanILibshitz",
212+ @" ": @"empty",
213+ @"$ENV{'HOME'}": @"envHome",
214+ @"../../../../../../../../../../../etc/hosts": @"etcHosts",
215+ @"../../../../../../../../../../../etc/passwd%00": @"etcPasswd00",
216+ @"# fonts, and have a number of special behaviors": @"fontsAndHaveANumberOfSpecialBehaviors",
217+ @"<foo val=`bar' />": @"fooValBar",
218+ @"$HOME": @"home",
219+ @"#\tHuman injection": @"humanInjection",
220+ @"̡͓̞ͅI̗̘̦͝n͇͇͙v̮̫ok̲̫̙͈i̖͙̭̹̠̞n̡̻̮̣̺g̲͈͙̭͙̬͎ ̰t͔̦h̞̲e̢̤ ͍̬̲͖f̴̘͕̣è͖ẹ̥̩l͖͔͚i͓͚̦͠n͖͍̗͓̳̮g͍ ̨o͚̪͡f̘̣̬ ̖̘͖̟͙̮c҉͔̫͖͓͇͖ͅh̵̤̣͚͔á̗̼͕ͅo̼̣̥s̱͈̺̖̦̻͢.̛̖̞̠̫̰": @"iNVOkINGTHEFÈẸLINGOFCHÁOS",
221+ @"<!--[if<img src=x onerror=javascript:alert(1)//]> -->": @"ifImgSrcXOnerrorJavascriptAlert1",
222+ @"<!--[if]><script>javascript:alert(1)</script -->": @"ifScriptJavascriptAlert1Script",
223+ @"<IMG SRC=\"jav ascript:alert('XSS');\">": @"imgSRCJavAscriptAlertXSS",
224+ @"<IMG SRC=\"jav&#x0A;ascript:alert('XSS');\">": @"imgSRCJavX0AAscriptAlertXSS",
225+ @"<IMG SRC=\"jav&#x0D;ascript:alert('XSS');\">": @"imgSRCJavX0DAscriptAlertXSS",
226+ @"<IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>": @"imgSrc106971189711599114105112116589710810111411640398883833941",
227+ @"<img src\\x09=x onerror=\"javascript:alert(1)\">": @"imgSrcX09XOnerrorJavascriptAlert1",
228+ @"<img src\\x11=x onerror=\"javascript:alert(1)\">": @"imgSrcX11XOnerrorJavascriptAlert1",
229+ @"<img src=x onerror=\\x00\"javascript:alert(1)\">": @"imgSrcXOnerrorX00JavascriptAlert1",
230+ @"<img src=x onerror=\\x09\"javascript:alert(1)\">": @"imgSrcXOnerrorX09JavascriptAlert1",
231+ @"<img src=x\\x09onerror=\"javascript:alert(1)\">": @"imgSrcXX09OnerrorJavascriptAlert1",
232+ @"<img src=x\\x10onerror=\"javascript:alert(1)\">": @"imgSrcXX10OnerrorJavascriptAlert1",
233+ @"<img src=x\\x11onerror=\"javascript:alert(1)\">": @"imgSrcXX11OnerrorJavascriptAlert1",
234+ @"<img src=x\\x12onerror=\"javascript:alert(1)\">": @"imgSrcXX12OnerrorJavascriptAlert1",
235+ @"<img src=x\\x13onerror=\"javascript:alert(1)\">": @"imgSrcXX13OnerrorJavascriptAlert1",
236+ @"`\"'><img src=xxx:x \\x00onerror=javascript:alert(1)>": @"imgSrcXxxXX00OnerrorJavascriptAlert1",
237+ @"`\"'><img src=xxx:x \\x0Bonerror=javascript:alert(1)>": @"imgSrcXxxXX0BonerrorJavascriptAlert1",
238+ @"`\"'><img src=xxx:x \\x2Fonerror=javascript:alert(1)>": @"imgSrcXxxXX2FonerrorJavascriptAlert1",
239+ @"<img \\x00src=x onerror=\"alert(1)\">": @"imgX00SrcXOnerrorAlert1",
240+ @"<img\\x10src=x onerror=\"javascript:alert(1)\">": @"imgX10SrcXOnerrorJavascriptAlert1",
241+ @"<img\\x13src=x onerror=\"javascript:alert(1)\">": @"imgX13SrcXOnerrorJavascriptAlert1",
242+ @"<img\\x32src=x onerror=\"javascript:alert(1)\">": @"imgX32SrcXOnerrorJavascriptAlert1",
243+ @"<img \\x39src=x onerror=\"javascript:alert(1)\">": @"imgX39SrcXOnerrorJavascriptAlert1",
244+ @"INF": @"inf",
245+ @"-Infinity": @"infinity",
246+ @"#\tInnocuous strings which may be blocked by profanity filters (https://en.wikipedia.org/wiki/Scunthorpe_problem)": @"innocuousStringsWhichMayBeBlockedByProfanityFiltersHTTPSEnWikipediaOrgWikiScunthorpeProblem",
247+ @"dontMakeAMap": @"isDontMakeAMap",
248+ @"Jimmy Clitheroe": @"jimmyClitheroe",
249+ @"Kernel.exit(1)": @"kernelExit1",
250+ @"#\tKnown CVEs and Vulnerabilities": @"knownCVEsAndVulnerabilities",
251+ @"Lightwater Country Park": @"lightwaterCountryPark",
252+ @"LPT2": @"lpt2",
253+ @"LPT3": @"lpt3",
254+ @"`ls -al /`": @"lsAl",
255+ @"#\tMSDOS/Windows Special Filenames": @"msdosWindowsSpecialFilenames",
256+ @"# Non-whitespace C1 controls: U+0080 through U+0084 and U+0086 through U+009F.": @"nonWhitespaceC1ControlsU0080ThroughU0084AndU0086ThroughU009F",
257+ @"None": @"none",
258+ @"(null)": @"null",
259+ @"'\"'": @"one",
260+ @"0": @"one0",
261+ @"1": @"one1",
262+ @" onfocus=JaVaSCript:alert(123) autofocus": @"onfocusJaVaSCriptAlert123Autofocus",
263+ @"' OR '1'='1": @"or11",
264+ @"Penistone Community Church": @"penistoneCommunityChurch",
265+ @"perl -e 'print \"<IMG SRC=java\\0script:alert(\\\"XSS\\\")>\";' > out": @"perlEPrintIMGSRCJava0ScriptAlertXSSOut",
266+ @"PRN": @"prn",
267+ @"RomansInSussex.co.uk": @"romansInSussexCoUk",
268+ @"%s": @"s",
269+ @"<<< %s(un='%s') = %u": @"sUnSU",
270+ @"<sc<script>ript>alert(123)</sc</script>ript>": @"scScriptRiptAlert123ScScriptRipt",
271+ @"\"><script>alert(123);</script x=\"": @"scriptAlert123ScriptX",
272+ @"#\tScript Injection": @"scriptInjection",
273+ @"<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >": @"scriptSRCHTTPHaCkersOrgXSSJSB",
274+ @"<SCRIPT/SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>": @"scriptSRCHTTPHaCkersOrgXSSJSSCRIPT",
275+ @"</script><script>alert(123)</script>": @"scriptScriptAlert123Script",
276+ @"\"`'><script>\\x00javascript:alert(1)</script>": @"scriptX00JavascriptAlert1Script",
277+ @"<script\\x09type=\"text/javascript\">javascript:alert(1);</script>": @"scriptX09TypeTextJavascriptJavascriptAlert1Script",
278+ @"\"`'><script>\\x0Cjavascript:alert(1)</script>": @"scriptX0CjavascriptAlert1Script",
279+ @"\"`'><script>\\x0Djavascript:alert(1)</script>": @"scriptX0DjavascriptAlert1Script",
280+ @"<script\\x20type=\"text/javascript\">javascript:alert(1);</script>": @"scriptX20TypeTextJavascriptJavascriptAlert1Script",
281+ @"<script\\x3Etype=\"text/javascript\">javascript:alert(1);</script>": @"scriptX3EtypeTextJavascriptJavascriptAlert1Script",
282+ @"\"`'><script>\\xC2\\x85javascript:alert(1)</script>": @"scriptXC2X85JavascriptAlert1Script",
283+ @"\"`'><script>\\xC2\\xA0javascript:alert(1)</script>": @"scriptXC2XA0JavascriptAlert1Script",
284+ @"\"`'><script>\\xE1\\x9A\\x80javascript:alert(1)</script>": @"scriptXE1X9AX80JavascriptAlert1Script",
285+ @"\"`'><script>\\xE1\\xA0\\x8Ejavascript:alert(1)</script>": @"scriptXE1XA0X8EjavascriptAlert1Script",
286+ @"\"`'><script>\\xE2\\x80\\x81javascript:alert(1)</script>": @"scriptXE2X80X81JavascriptAlert1Script",
287+ @"\"`'><script>\\xE2\\x80\\x86javascript:alert(1)</script>": @"scriptXE2X80X86JavascriptAlert1Script",
288+ @"\"`'><script>\\xE2\\x80\\x89javascript:alert(1)</script>": @"scriptXE2X80X89JavascriptAlert1Script",
289+ @"\"`'><script>\\xE2\\x81\\x9Fjavascript:alert(1)</script>": @"scriptXE2X81X9FjavascriptAlert1Script",
290+ @"\"`'><script>\\xEF\\xBB\\xBFjavascript:alert(1)</script>": @"scriptXEFXBBXBFjavascriptAlert1Script",
291+ @"\"`'><script>\\xF0\\x90\\x96\\x9Ajavascript:alert(1)</script>": @"scriptXF0X90X96X9AjavascriptAlert1Script",
292+ @"<SCRIPT/XSS SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>": @"scriptXSSSRCHTTPHaCkersOrgXSSJSSCRIPT",
293+ @"(╯°□°)╯︵ ┻━┻)": @"some",
294+ @"{0}": @"some0",
295+ @"#\tSQL Injection": @"sqlInjection",
296+ @"#\tString which can reveal system files when parsed by a badly configured XML parser": @"stringWhichCanRevealSystemFilesWhenParsedByABadlyConfiguredXMLParser",
297+ @"#\tStrings that test for known vulnerabilities": @"stringsThatTestForKnownVulnerabilities",
298+ @"#\tStrings which can be accidentally expanded into different strings if evaluated in the wrong context, e.g. used as a printf format string or via Perl or shell eval. Might expose sensitive data from the program doing the interpolation, or might just represent the wrong string.": @"stringsWhichCanBeAccidentallyExpandedIntoDifferentStringsIfEvaluatedInTheWrongContextEGUsedAsAPrintfFormatStringOrViaPERLOrShellEvalMightExposeSensitiveDataFromTheProgramDoingTheInterpolationOrMightJustRepresentTheWrongString",
299+ @"#\tStrings which can call system commands within Ruby/Rails applications": @"stringsWhichCanCallSystemCommandsWithinRubyRailsApplications",
300+ @"#\tStrings which consists of Japanese-style emoticons which are popular on the web": @"stringsWhichConsistsOfJapaneseStyleEmoticonsWhichArePopularOnTheWeb",
301+ @"#\tStrings which contain bold/italic/etc. versions of normal characters": @"stringsWhichContainBoldItalicEtcVersionsOfNormalCharacters",
302+ @"#\tStrings which contain common unicode symbols (e.g. smart quotes)": @"stringsWhichContainCommonUnicodeSymbolsEGSmartQuotes",
303+ @"#\tStrings which contain Emoji; should be the same behavior as two-byte characters, but not always": @"stringsWhichContainEmojiShouldBeTheSameBehaviorAsTwoByteCharactersButNotAlways",
304+ @"#\tStrings which contain misplaced quotation marks; can cause encoding errors": @"stringsWhichContainMisplacedQuotationMarksCanCauseEncodingErrors",
305+ @"#\tStrings which contain unicode subscripts/superscripts; can cause rendering issues": @"stringsWhichContainUnicodeSubscriptsSuperscriptsCanCauseRenderingIssues",
306+ @"#\tStrings which crashed iMessage in various versions of iOS": @"stringsWhichCrashedIMessageInVariousVersionsOfIOS",
307+ @"#\tStrings which may cause human to reinterpret worldview": @"stringsWhichMayCauseHumanToReinterpretWorldview",
308+ @"Super Bowl XXX": @"superBowlXXX",
309+ @"\u202a\u202atest\u202a": @"test",
310+ @"</textarea><script>alert(123)</script>": @"textareaScriptAlert123Script",
311+ @"'": @"the",
312+ @"+0": @"the0",
313+ @"0..0": @"the00",
314+ @"0,0,0": @"the000",
315+ @"0,0/0,0": @"the0000",
316+ @"00˙Ɩ$-": @"the00Ɩ",
317+ @"0x0": @"the0X0",
318+ @",./;'[]\\-=": @"the1",
319+ @"1/0": @"the10",
320+ @"1.00": @"the100",
321+ @"1.0/0.0": @"the1000",
322+ @"1'000,00": @"the100000",
323+ @"1 000 000.00": @"the100000000",
324+ @"\U0001d47b\U0001d489\U0001d486 \U0001d492\U0001d496\U0001d48a\U0001d484\U0001d48c \U0001d483\U0001d493\U0001d490\U0001d498\U0001d48f \U0001d487\U0001d490\U0001d499 \U0001d48b\U0001d496\U0001d48e\U0001d491\U0001d494 \U0001d490\U0001d497\U0001d486\U0001d493 \U0001d495\U0001d489\U0001d486 \U0001d48d\U0001d482\U0001d49b\U0001d49a \U0001d485\U0001d490\U0001d488": @"the11",
325+ @"1/2": @"the12",
326+ @"123456789012345678901234567890123456789": @"the123456789012345678901234567890123456789",
327+ @"\U0001d4e3\U0001d4f1\U0001d4ee \U0001d4fa\U0001d4fe\U0001d4f2\U0001d4ec\U0001d4f4 \U0001d4eb\U0001d4fb\U0001d4f8\U0001d500\U0001d4f7 \U0001d4ef\U0001d4f8\U0001d501 \U0001d4f3\U0001d4fe\U0001d4f6\U0001d4f9\U0001d4fc \U0001d4f8\U0001d4ff\U0001d4ee\U0001d4fb \U0001d4fd\U0001d4f1\U0001d4ee \U0001d4f5\U0001d4ea\U0001d503\U0001d502 \U0001d4ed\U0001d4f8\U0001d4f0": @"the13",
328+ @"\U0001d57f\U0001d58d\U0001d58a \U0001d596\U0001d59a\U0001d58e\U0001d588\U0001d590 \U0001d587\U0001d597\U0001d594\U0001d59c\U0001d593 \U0001d58b\U0001d594\U0001d59d \U0001d58f\U0001d59a\U0001d592\U0001d595\U0001d598 \U0001d594\U0001d59b\U0001d58a\U0001d597 \U0001d599\U0001d58d\U0001d58a \U0001d591\U0001d586\U0001d59f\U0001d59e \U0001d589\U0001d594\U0001d58c": @"the14",
329+ @"\U0001f1fa\U0001f1f8\U0001f1f7\U0001f1fa\U0001f1f8 \U0001f1e6\U0001f1eb\U0001f1e6\U0001f1f2\U0001f1f8": @"the15",
330+ @"\U0001f1fa\U0001f1f8\U0001f1f7\U0001f1fa\U0001f1f8\U0001f1e6": @"the16",
331+ @"\U0001f1fa\U0001f1f8\U0001f1f7\U0001f1fa\U0001f1f8\U0001f1e6\U0001f1eb\U0001f1e6\U0001f1f2": @"the17",
332+ @"\U0001f469\U0001f3fd": @"the18",
333+ @"\U0001f6be \U0001f192 \U0001f193 \U0001f195 \U0001f196 \U0001f197 \U0001f199 \U0001f3e7": @"the19",
334+ @"1;DROP TABLE users": @"the1DROPTABLEUsers",
335+ @"-1E02": @"the1E02",
336+ @"1E2": @"the1E2",
337+ @"1#QNAN": @"the1Qnan",
338+ @"1#SNAN": @"the1Snan",
339+ @"-,": @"the2",
340+ @"﷽": @"the20",
341+ @"\ufeff": @"the21",
342+ @"゚・✿ヾ╲(。◕‿◕。)╱✿・゚": @"the22",
343+ @"\ufffe": @"the23",
344+ @"-.": @"the3",
345+ @"<>?:\"{}|_+": @"the4",
346+ @"\\": @"the5",
347+ @"\302\200\302\201\302\202\302\203\302\204\302\206\302\207\302\210\302\211\302\212\302\213\302\214\302\215\302\216\302\217\302\220\302\221\302\222\302\223\302\224\302\225\302\226\302\227\302\230\302\231\302\232\302\233\302\234\302\235\302\236\302\237": @"the6",
348+ @"\302\255\u0600\u0601\u0602\u0603\u0604\u0605\u061c\u06dd\u070f\u180e\u200b\u200c\u200d\u200e\u200f\u202a\u202b\u202c\u202d\u202e\u2060\u2061\u2062\u2063\u2064\u2066\u2067\u2068\u2069\u206a\u206b\u206c\u206d\u206e\u206f\ufeff\ufff9\ufffa\ufffb\U000110bd\U0001bca0\U0001bca1\U0001bca2\U0001bca3\U0001d173\U0001d174\U0001d175\U0001d176\U0001d177\U0001d178\U0001d179\U0001d17a\U000e0001\U000e0020\U000e0021\U000e0022\U000e0023\U000e0024\U000e0025\U000e0026\U000e0027\U000e0028\U000e0029\U000e002a\U000e002b\U000e002c\U000e002d\U000e002e\U000e002f\U000e0030\U000e0031\U000e0032\U000e0033\U000e0034\U000e0035\U000e0036\U000e0037\U000e0038\U000e0039\U000e003a\U000e003b\U000e003c\U000e003d\U000e003e\U000e003f\U000e0040\U000e0041\U000e0042\U000e0043\U000e0044\U000e0045\U000e0046\U000e0047\U000e0048\U000e0049\U000e004a\U000e004b\U000e004c\U000e004d\U000e004e\U000e004f\U000e0050\U000e0051\U000e0052\U000e0053\U000e0054\U000e0055\U000e0056\U000e0057\U000e0058\U000e0059\U000e005a\U000e005b\U000e005c\U000e005d\U000e005e\U000e005f\U000e0060\U000e0061\U000e0062\U000e0063\U000e0064\U000e0065\U000e0066\U000e0067\U000e0068\U000e0069\U000e006a\U000e006b\U000e006c\U000e006d\U000e006e\U000e006f\U000e0070\U000e0071\U000e0072\U000e0073\U000e0074\U000e0075\U000e0076\U000e0077\U000e0078\U000e0079\U000e007a\U000e007b\U000e007c\U000e007d\U000e007e\U000e007f": @"the7",
349+ @"₀₁₂": @"the8",
350+ @"⒯⒣⒠ ⒬⒰⒤⒞⒦ ⒝⒭⒪⒲⒩ ⒡⒪⒳ ⒥⒰⒨⒫⒮ ⒪⒱⒠⒭ ⒯⒣⒠ ⒧⒜⒵⒴ ⒟⒪⒢": @"the9",
351+ @"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999": @"the999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999",
352+ @"false": @"theFalse",
353+ @"# The next two lines may appear to be blank or mojibake in some viewers.": @"theNextTwoLinesMayAppearToBeBlankOrMojibakeInSomeViewers",
354+ @"The quic\010\010\010\010\010\010k brown fo\007\007\007\007\007\007\007\007\007\007\007x... [Beeeep]": @"theQuicKBrownFoXBeeeep",
355+ @"\u2066test\u2067": @"theTest",
356+ @"٠١٢٣٤٥٦٧٨٩": @"the٠١٢٣٤٥٦٧٨٩",
357+ @"#\tTwo-Byte Characters": @"twoByteCharacters",
358+ @"# U+0000, U+000A, or U+000D (NUL, LF, CR).": @"u0000U000AOrU000DNULLFCR",
359+ @"<u oncopy=alert()> Copy me</u>": @"uOncopyAlertCopyMeU",
360+ @"undef": @"undef",
361+ @"#\tUnicode font": @"unicodeFont",
362+ @"#\tUnicode Numbers": @"unicodeNumbers",
363+ @"#\tUnwanted Interpolation": @"unwantedInterpolation",
364+ @"%x('ls -al /')": @"xLsAl",
365+ @"Z̮̞̠͙͔ͅḀ̗̞͈̻̗Ḷ͙͎̯̹̞͓G̻O̭̗̮": @"zḀḶGO",
366+ @"¡™£¢∞§¶•ªº–≠": @"ªº",
367+ @"¸˛Ç◊ı˜Â¯˘¿": @"çIÂ",
368+ @"Œ„´‰ˇÁ¨ˆØ∏”’": @"œÁØ",
369+ @"œ∑´®†¥¨ˆøπ“‘": @"œØπ",
370+ @"( ͡° ͜ʖ ͡°)": @"ʖ",
371+ @"הָיְתָהtestالصفحات التّحول": @"הָיְתָהTestالصفحاتالتّحول",
372+ @"ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ايطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو.": @"ثمنفسسقطتوبالتحديدجزيرتيباستخدامأندنوإذهناالستاروتنصيبكانأهّلايطاليابريطانيافرنساقدأخذسليمانإتفاقيةبينمايذكرالحدودأيبعدمعاملةبولنداالإطلاقعلإيو",
373+ @"ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็": @"ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็",
374+ @"Ⱥ": @"ⱥ",
375+ @"Ⱦ": @"ⱦ",
376+ @"パーティーへ行かないか": @"パーティーへ行かないか",
377+ @"和製漢語": @"和製漢語",
378+ @"田中さんにあげて下さい": @"田中さんにあげて下さい",
379+ @"`⁄€‹›fifl‡°·‚—±": @"fifl",
380+ @"`ィ(´∀`∩": @"ィ",
381+ };
382+}
383+
384++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
385+{
386+ return [dict isKindOfClass:NSDictionary.class] ? [[QTA alloc] initWithJSONDictionary:dict] : nil;
387+}
388+
389+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
390+{
391+ if (self = [super init]) {
392+ if (![dict[@"!@#$%^&*()`~"] isKindOfClass:NSString.class]) return nil;
393+ if (![dict[@"-0"] isKindOfClass:NSString.class]) return nil;
394+ if (![dict[@"0,00"] isKindOfClass:NSString.class]) return nil;
395+ if (![dict[@"0.0/0.0"] isKindOfClass:NSString.class]) return nil;
396+ if (![dict[@"-1"] isKindOfClass:NSString.class]) return nil;
397+ if (![dict[@"1'000'000.00"] isKindOfClass:NSString.class]) return nil;
398+ if (![dict[@"1E02"] isKindOfClass:NSString.class]) return nil;
399+ if (![dict[@"';alert(123);t='"] isKindOfClass:NSString.class]) return nil;
400+ if (![dict[@"False"] isKindOfClass:NSString.class]) return nil;
401+ if (![dict[@"<a href=java&#1&#2&#3&#4&#5&#6&#7&#8&#11&#12script:javascript:alert(1)>XXX</a>"] isKindOfClass:NSString.class]) return nil;
402+ if (![dict[@"<a href=\"javascript\\x09:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
403+ if (![dict[@"<a href=\"javascript\\x0A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
404+ if (![dict[@"<a href=\"javascript\\x3A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
405+ if (![dict[@"<a href=\"\\x01javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
406+ if (![dict[@"<a href=\"\\x05javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
407+ if (![dict[@"<a href=\"\\x08javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
408+ if (![dict[@"<a href=\"\\x09javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
409+ if (![dict[@"<a href=\"\\x0Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
410+ if (![dict[@"<a href=\"\\x10javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
411+ if (![dict[@"<a href=\"\\x11javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
412+ if (![dict[@"<a href=\"\\x13javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
413+ if (![dict[@"<a href=\"\\x17javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
414+ if (![dict[@"<a href=\"\\x1Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
415+ if (![dict[@"<a href=\"\\xC2\\xA0javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
416+ if (![dict[@"<a href=\"\\xE1\\x9A\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
417+ if (![dict[@"<a href=\"\\xE1\\xA0\\x8Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
418+ if (![dict[@"<a href=\"\\xE2\\x80\\x83javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
419+ if (![dict[@"<a href=\"\\xE2\\x80\\x84javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
420+ if (![dict[@"<a href=\"\\xE2\\x80\\x86javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
421+ if (![dict[@"<a href=\"\\xE2\\x80\\x87javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
422+ if (![dict[@"<a href=\"\\xE2\\x80\\xA8javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
423+ if (![dict[@"nil"] isKindOfClass:NSString.class]) return nil;
424+ if (![dict[@"TRUE"] isKindOfClass:NSString.class]) return nil;
425+ if (![dict[@"\u202btest\u202b"] isKindOfClass:NSString.class]) return nil;
426+ if (![dict[@"True"] isKindOfClass:NSString.class]) return nil;
427+ if (![dict[@"ABC<div style=\"x:exp\\x00ression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
428+ if (![dict[@"ABC<div style=\"x:exp\\x5Cression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
429+ if (![dict[@"ABC<div style=\"x:\\x09expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
430+ if (![dict[@"ABC<div style=\"x:\\x0Bexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
431+ if (![dict[@"ABC<div style=\"x:\\x20expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
432+ if (![dict[@"ABC<div style=\"x\\x3Aexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
433+ if (![dict[@"ABC<div style=\"x:\\xC2\\xA0expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
434+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x80expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
435+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x84expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
436+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x89expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
437+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x8Bexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
438+ if (![dict[@";alert(123);"] isKindOfClass:NSString.class]) return nil;
439+ if (![dict[@"\";alert(123);t=\""] isKindOfClass:NSString.class]) return nil;
440+ if (![dict[@"\\\";alert('XSS');//"] isKindOfClass:NSString.class]) return nil;
441+ if (![dict[@"# and U+200B (ZERO WIDTH SPACE), which are in the C categories but are often"] isKindOfClass:NSString.class]) return nil;
442+ if (![dict[@","] isKindOfClass:NSString.class]) return nil;
443+ if (![dict[@"Arsenal canal"] isKindOfClass:NSString.class]) return nil;
444+ if (![dict[@"\" autofocus onkeyup=\"javascript:alert(123)"] isKindOfClass:NSString.class]) return nil;
445+ if (![dict[@"AUX"] isKindOfClass:NSString.class]) return nil;
446+ if (![dict[@"#\tChanging length when lowercased"] isKindOfClass:NSString.class]) return nil;
447+ if (![dict[@"#\tCharacters which increase in length (2 to 3 bytes) when lowercased"] isKindOfClass:NSString.class]) return nil;
448+ if (![dict[@"classic"] isKindOfClass:NSString.class]) return nil;
449+ if (![dict[@"#\tCommand Injection (Ruby)"] isKindOfClass:NSString.class]) return nil;
450+ if (![dict[@"%d"] isKindOfClass:NSString.class]) return nil;
451+ if (![dict[@"Dick Van Dyke"] isKindOfClass:NSString.class]) return nil;
452+ if (![dict[@"Dr. Herman I. Libshitz"] isKindOfClass:NSString.class]) return nil;
453+ if (![dict[@" "] isKindOfClass:NSString.class]) return nil;
454+ if (![dict[@"$ENV{'HOME'}"] isKindOfClass:NSString.class]) return nil;
455+ if (![dict[@"../../../../../../../../../../../etc/hosts"] isKindOfClass:NSString.class]) return nil;
456+ if (![dict[@"../../../../../../../../../../../etc/passwd%00"] isKindOfClass:NSString.class]) return nil;
457+ if (![dict[@"# fonts, and have a number of special behaviors"] isKindOfClass:NSString.class]) return nil;
458+ if (![dict[@"<foo val=`bar' />"] isKindOfClass:NSString.class]) return nil;
459+ if (![dict[@"$HOME"] isKindOfClass:NSString.class]) return nil;
460+ if (![dict[@"#\tHuman injection"] isKindOfClass:NSString.class]) return nil;
461+ if (![dict[@"̡͓̞ͅI̗̘̦͝n͇͇͙v̮̫ok̲̫̙͈i̖͙̭̹̠̞n̡̻̮̣̺g̲͈͙̭͙̬͎ ̰t͔̦h̞̲e̢̤ ͍̬̲͖f̴̘͕̣è͖ẹ̥̩l͖͔͚i͓͚̦͠n͖͍̗͓̳̮g͍ ̨o͚̪͡f̘̣̬ ̖̘͖̟͙̮c҉͔̫͖͓͇͖ͅh̵̤̣͚͔á̗̼͕ͅo̼̣̥s̱͈̺̖̦̻͢.̛̖̞̠̫̰"] isKindOfClass:NSString.class]) return nil;
462+ if (![dict[@"<!--[if<img src=x onerror=javascript:alert(1)//]> -->"] isKindOfClass:NSString.class]) return nil;
463+ if (![dict[@"<!--[if]><script>javascript:alert(1)</script -->"] isKindOfClass:NSString.class]) return nil;
464+ if (![dict[@"<IMG SRC=\"jav ascript:alert('XSS');\">"] isKindOfClass:NSString.class]) return nil;
465+ if (![dict[@"<IMG SRC=\"jav&#x0A;ascript:alert('XSS');\">"] isKindOfClass:NSString.class]) return nil;
466+ if (![dict[@"<IMG SRC=\"jav&#x0D;ascript:alert('XSS');\">"] isKindOfClass:NSString.class]) return nil;
467+ if (![dict[@"<IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>"] isKindOfClass:NSString.class]) return nil;
468+ if (![dict[@"<img src\\x09=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
469+ if (![dict[@"<img src\\x11=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
470+ if (![dict[@"<img src=x onerror=\\x00\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
471+ if (![dict[@"<img src=x onerror=\\x09\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
472+ if (![dict[@"<img src=x\\x09onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
473+ if (![dict[@"<img src=x\\x10onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
474+ if (![dict[@"<img src=x\\x11onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
475+ if (![dict[@"<img src=x\\x12onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
476+ if (![dict[@"<img src=x\\x13onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
477+ if (![dict[@"`\"'><img src=xxx:x \\x00onerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
478+ if (![dict[@"`\"'><img src=xxx:x \\x0Bonerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
479+ if (![dict[@"`\"'><img src=xxx:x \\x2Fonerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
480+ if (![dict[@"<img \\x00src=x onerror=\"alert(1)\">"] isKindOfClass:NSString.class]) return nil;
481+ if (![dict[@"<img\\x10src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
482+ if (![dict[@"<img\\x13src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
483+ if (![dict[@"<img\\x32src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
484+ if (![dict[@"<img \\x39src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
485+ if (![dict[@"INF"] isKindOfClass:NSString.class]) return nil;
486+ if (![dict[@"-Infinity"] isKindOfClass:NSString.class]) return nil;
487+ if (![dict[@"#\tInnocuous strings which may be blocked by profanity filters (https://en.wikipedia.org/wiki/Scunthorpe_problem)"] isKindOfClass:NSString.class]) return nil;
488+ if (![dict[@"dontMakeAMap"] isKindOfClass:NSNumber.class]) return nil;
489+ if (![dict[@"Jimmy Clitheroe"] isKindOfClass:NSString.class]) return nil;
490+ if (![dict[@"Kernel.exit(1)"] isKindOfClass:NSString.class]) return nil;
491+ if (![dict[@"#\tKnown CVEs and Vulnerabilities"] isKindOfClass:NSString.class]) return nil;
492+ if (![dict[@"Lightwater Country Park"] isKindOfClass:NSString.class]) return nil;
493+ if (![dict[@"LPT2"] isKindOfClass:NSString.class]) return nil;
494+ if (![dict[@"LPT3"] isKindOfClass:NSString.class]) return nil;
495+ if (![dict[@"`ls -al /`"] isKindOfClass:NSString.class]) return nil;
496+ if (![dict[@"#\tMSDOS/Windows Special Filenames"] isKindOfClass:NSString.class]) return nil;
497+ if (![dict[@"# Non-whitespace C1 controls: U+0080 through U+0084 and U+0086 through U+009F."] isKindOfClass:NSString.class]) return nil;
498+ if (![dict[@"None"] isKindOfClass:NSString.class]) return nil;
499+ if (![dict[@"(null)"] isKindOfClass:NSString.class]) return nil;
500+ if (![dict[@"'\"'"] isKindOfClass:NSString.class]) return nil;
501+ if (![dict[@"0"] isKindOfClass:NSString.class]) return nil;
502+ if (![dict[@"1"] isKindOfClass:NSString.class]) return nil;
503+ if (![dict[@" onfocus=JaVaSCript:alert(123) autofocus"] isKindOfClass:NSString.class]) return nil;
504+ if (![dict[@"' OR '1'='1"] isKindOfClass:NSString.class]) return nil;
505+ if (![dict[@"Penistone Community Church"] isKindOfClass:NSString.class]) return nil;
506+ if (![dict[@"perl -e 'print \"<IMG SRC=java\\0script:alert(\\\"XSS\\\")>\";' > out"] isKindOfClass:NSString.class]) return nil;
507+ if (![dict[@"PRN"] isKindOfClass:NSString.class]) return nil;
508+ if (![dict[@"RomansInSussex.co.uk"] isKindOfClass:NSString.class]) return nil;
509+ if (![dict[@"%s"] isKindOfClass:NSString.class]) return nil;
510+ if (![dict[@"<<< %s(un='%s') = %u"] isKindOfClass:NSString.class]) return nil;
511+ if (![dict[@"<sc<script>ript>alert(123)</sc</script>ript>"] isKindOfClass:NSString.class]) return nil;
512+ if (![dict[@"\"><script>alert(123);</script x=\""] isKindOfClass:NSString.class]) return nil;
513+ if (![dict[@"#\tScript Injection"] isKindOfClass:NSString.class]) return nil;
514+ if (![dict[@"<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >"] isKindOfClass:NSString.class]) return nil;
515+ if (![dict[@"<SCRIPT/SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>"] isKindOfClass:NSString.class]) return nil;
516+ if (![dict[@"</script><script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
517+ if (![dict[@"\"`'><script>\\x00javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
518+ if (![dict[@"<script\\x09type=\"text/javascript\">javascript:alert(1);</script>"] isKindOfClass:NSString.class]) return nil;
519+ if (![dict[@"\"`'><script>\\x0Cjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
520+ if (![dict[@"\"`'><script>\\x0Djavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
521+ if (![dict[@"<script\\x20type=\"text/javascript\">javascript:alert(1);</script>"] isKindOfClass:NSString.class]) return nil;
522+ if (![dict[@"<script\\x3Etype=\"text/javascript\">javascript:alert(1);</script>"] isKindOfClass:NSString.class]) return nil;
523+ if (![dict[@"\"`'><script>\\xC2\\x85javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
524+ if (![dict[@"\"`'><script>\\xC2\\xA0javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
525+ if (![dict[@"\"`'><script>\\xE1\\x9A\\x80javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
526+ if (![dict[@"\"`'><script>\\xE1\\xA0\\x8Ejavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
527+ if (![dict[@"\"`'><script>\\xE2\\x80\\x81javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
528+ if (![dict[@"\"`'><script>\\xE2\\x80\\x86javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
529+ if (![dict[@"\"`'><script>\\xE2\\x80\\x89javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
530+ if (![dict[@"\"`'><script>\\xE2\\x81\\x9Fjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
531+ if (![dict[@"\"`'><script>\\xEF\\xBB\\xBFjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
532+ if (![dict[@"\"`'><script>\\xF0\\x90\\x96\\x9Ajavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
533+ if (![dict[@"<SCRIPT/XSS SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>"] isKindOfClass:NSString.class]) return nil;
534+ if (![dict[@"(╯°□°)╯︵ ┻━┻)"] isKindOfClass:NSString.class]) return nil;
535+ if (![dict[@"{0}"] isKindOfClass:NSString.class]) return nil;
536+ if (![dict[@"#\tSQL Injection"] isKindOfClass:NSString.class]) return nil;
537+ if (![dict[@"#\tString which can reveal system files when parsed by a badly configured XML parser"] isKindOfClass:NSString.class]) return nil;
538+ if (![dict[@"#\tStrings that test for known vulnerabilities"] isKindOfClass:NSString.class]) return nil;
539+ if (![dict[@"#\tStrings which can be accidentally expanded into different strings if evaluated in the wrong context, e.g. used as a printf format string or via Perl or shell eval. Might expose sensitive data from the program doing the interpolation, or might just represent the wrong string."] isKindOfClass:NSString.class]) return nil;
540+ if (![dict[@"#\tStrings which can call system commands within Ruby/Rails applications"] isKindOfClass:NSString.class]) return nil;
541+ if (![dict[@"#\tStrings which consists of Japanese-style emoticons which are popular on the web"] isKindOfClass:NSString.class]) return nil;
542+ if (![dict[@"#\tStrings which contain bold/italic/etc. versions of normal characters"] isKindOfClass:NSString.class]) return nil;
543+ if (![dict[@"#\tStrings which contain common unicode symbols (e.g. smart quotes)"] isKindOfClass:NSString.class]) return nil;
544+ if (![dict[@"#\tStrings which contain Emoji; should be the same behavior as two-byte characters, but not always"] isKindOfClass:NSString.class]) return nil;
545+ if (![dict[@"#\tStrings which contain misplaced quotation marks; can cause encoding errors"] isKindOfClass:NSString.class]) return nil;
546+ if (![dict[@"#\tStrings which contain unicode subscripts/superscripts; can cause rendering issues"] isKindOfClass:NSString.class]) return nil;
547+ if (![dict[@"#\tStrings which crashed iMessage in various versions of iOS"] isKindOfClass:NSString.class]) return nil;
548+ if (![dict[@"#\tStrings which may cause human to reinterpret worldview"] isKindOfClass:NSString.class]) return nil;
549+ if (![dict[@"Super Bowl XXX"] isKindOfClass:NSString.class]) return nil;
550+ if (![dict[@"\u202a\u202atest\u202a"] isKindOfClass:NSString.class]) return nil;
551+ if (![dict[@"</textarea><script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
552+ if (![dict[@"'"] isKindOfClass:NSString.class]) return nil;
553+ if (![dict[@"+0"] isKindOfClass:NSString.class]) return nil;
554+ if (![dict[@"0..0"] isKindOfClass:NSString.class]) return nil;
555+ if (![dict[@"0,0,0"] isKindOfClass:NSString.class]) return nil;
556+ if (![dict[@"0,0/0,0"] isKindOfClass:NSString.class]) return nil;
557+ if (![dict[@"00˙Ɩ$-"] isKindOfClass:NSString.class]) return nil;
558+ if (![dict[@"0x0"] isKindOfClass:NSString.class]) return nil;
559+ if (![dict[@",./;'[]\\-="] isKindOfClass:NSString.class]) return nil;
560+ if (![dict[@"1/0"] isKindOfClass:NSString.class]) return nil;
561+ if (![dict[@"1.00"] isKindOfClass:NSString.class]) return nil;
562+ if (![dict[@"1.0/0.0"] isKindOfClass:NSString.class]) return nil;
563+ if (![dict[@"1'000,00"] isKindOfClass:NSString.class]) return nil;
564+ if (![dict[@"1 000 000.00"] isKindOfClass:NSString.class]) return nil;
565+ if (![dict[@"\U0001d47b\U0001d489\U0001d486 \U0001d492\U0001d496\U0001d48a\U0001d484\U0001d48c \U0001d483\U0001d493\U0001d490\U0001d498\U0001d48f \U0001d487\U0001d490\U0001d499 \U0001d48b\U0001d496\U0001d48e\U0001d491\U0001d494 \U0001d490\U0001d497\U0001d486\U0001d493 \U0001d495\U0001d489\U0001d486 \U0001d48d\U0001d482\U0001d49b\U0001d49a \U0001d485\U0001d490\U0001d488"] isKindOfClass:NSString.class]) return nil;
566+ if (![dict[@"1/2"] isKindOfClass:NSString.class]) return nil;
567+ if (![dict[@"123456789012345678901234567890123456789"] isKindOfClass:NSString.class]) return nil;
568+ if (![dict[@"\U0001d4e3\U0001d4f1\U0001d4ee \U0001d4fa\U0001d4fe\U0001d4f2\U0001d4ec\U0001d4f4 \U0001d4eb\U0001d4fb\U0001d4f8\U0001d500\U0001d4f7 \U0001d4ef\U0001d4f8\U0001d501 \U0001d4f3\U0001d4fe\U0001d4f6\U0001d4f9\U0001d4fc \U0001d4f8\U0001d4ff\U0001d4ee\U0001d4fb \U0001d4fd\U0001d4f1\U0001d4ee \U0001d4f5\U0001d4ea\U0001d503\U0001d502 \U0001d4ed\U0001d4f8\U0001d4f0"] isKindOfClass:NSString.class]) return nil;
569+ if (![dict[@"\U0001d57f\U0001d58d\U0001d58a \U0001d596\U0001d59a\U0001d58e\U0001d588\U0001d590 \U0001d587\U0001d597\U0001d594\U0001d59c\U0001d593 \U0001d58b\U0001d594\U0001d59d \U0001d58f\U0001d59a\U0001d592\U0001d595\U0001d598 \U0001d594\U0001d59b\U0001d58a\U0001d597 \U0001d599\U0001d58d\U0001d58a \U0001d591\U0001d586\U0001d59f\U0001d59e \U0001d589\U0001d594\U0001d58c"] isKindOfClass:NSString.class]) return nil;
570+ if (![dict[@"\U0001f1fa\U0001f1f8\U0001f1f7\U0001f1fa\U0001f1f8 \U0001f1e6\U0001f1eb\U0001f1e6\U0001f1f2\U0001f1f8"] isKindOfClass:NSString.class]) return nil;
571+ if (![dict[@"\U0001f1fa\U0001f1f8\U0001f1f7\U0001f1fa\U0001f1f8\U0001f1e6"] isKindOfClass:NSString.class]) return nil;
572+ if (![dict[@"\U0001f1fa\U0001f1f8\U0001f1f7\U0001f1fa\U0001f1f8\U0001f1e6\U0001f1eb\U0001f1e6\U0001f1f2"] isKindOfClass:NSString.class]) return nil;
573+ if (![dict[@"\U0001f469\U0001f3fd"] isKindOfClass:NSString.class]) return nil;
574+ if (![dict[@"\U0001f6be \U0001f192 \U0001f193 \U0001f195 \U0001f196 \U0001f197 \U0001f199 \U0001f3e7"] isKindOfClass:NSString.class]) return nil;
575+ if (![dict[@"1;DROP TABLE users"] isKindOfClass:NSString.class]) return nil;
576+ if (![dict[@"-1E02"] isKindOfClass:NSString.class]) return nil;
577+ if (![dict[@"1E2"] isKindOfClass:NSString.class]) return nil;
578+ if (![dict[@"1#QNAN"] isKindOfClass:NSString.class]) return nil;
579+ if (![dict[@"1#SNAN"] isKindOfClass:NSString.class]) return nil;
580+ if (![dict[@"-,"] isKindOfClass:NSString.class]) return nil;
581+ if (![dict[@"﷽"] isKindOfClass:NSString.class]) return nil;
582+ if (![dict[@"\ufeff"] isKindOfClass:NSString.class]) return nil;
583+ if (![dict[@"゚・✿ヾ╲(。◕‿◕。)╱✿・゚"] isKindOfClass:NSString.class]) return nil;
584+ if (![dict[@"\ufffe"] isKindOfClass:NSString.class]) return nil;
585+ if (![dict[@"-."] isKindOfClass:NSString.class]) return nil;
586+ if (![dict[@"<>?:\"{}|_+"] isKindOfClass:NSString.class]) return nil;
587+ if (![dict[@"\\"] isKindOfClass:NSString.class]) return nil;
588+ if (![dict[@"\302\200\302\201\302\202\302\203\302\204\302\206\302\207\302\210\302\211\302\212\302\213\302\214\302\215\302\216\302\217\302\220\302\221\302\222\302\223\302\224\302\225\302\226\302\227\302\230\302\231\302\232\302\233\302\234\302\235\302\236\302\237"] isKindOfClass:NSString.class]) return nil;
589+ if (![dict[@"\302\255\u0600\u0601\u0602\u0603\u0604\u0605\u061c\u06dd\u070f\u180e\u200b\u200c\u200d\u200e\u200f\u202a\u202b\u202c\u202d\u202e\u2060\u2061\u2062\u2063\u2064\u2066\u2067\u2068\u2069\u206a\u206b\u206c\u206d\u206e\u206f\ufeff\ufff9\ufffa\ufffb\U000110bd\U0001bca0\U0001bca1\U0001bca2\U0001bca3\U0001d173\U0001d174\U0001d175\U0001d176\U0001d177\U0001d178\U0001d179\U0001d17a\U000e0001\U000e0020\U000e0021\U000e0022\U000e0023\U000e0024\U000e0025\U000e0026\U000e0027\U000e0028\U000e0029\U000e002a\U000e002b\U000e002c\U000e002d\U000e002e\U000e002f\U000e0030\U000e0031\U000e0032\U000e0033\U000e0034\U000e0035\U000e0036\U000e0037\U000e0038\U000e0039\U000e003a\U000e003b\U000e003c\U000e003d\U000e003e\U000e003f\U000e0040\U000e0041\U000e0042\U000e0043\U000e0044\U000e0045\U000e0046\U000e0047\U000e0048\U000e0049\U000e004a\U000e004b\U000e004c\U000e004d\U000e004e\U000e004f\U000e0050\U000e0051\U000e0052\U000e0053\U000e0054\U000e0055\U000e0056\U000e0057\U000e0058\U000e0059\U000e005a\U000e005b\U000e005c\U000e005d\U000e005e\U000e005f\U000e0060\U000e0061\U000e0062\U000e0063\U000e0064\U000e0065\U000e0066\U000e0067\U000e0068\U000e0069\U000e006a\U000e006b\U000e006c\U000e006d\U000e006e\U000e006f\U000e0070\U000e0071\U000e0072\U000e0073\U000e0074\U000e0075\U000e0076\U000e0077\U000e0078\U000e0079\U000e007a\U000e007b\U000e007c\U000e007d\U000e007e\U000e007f"] isKindOfClass:NSString.class]) return nil;
590+ if (![dict[@"₀₁₂"] isKindOfClass:NSString.class]) return nil;
591+ if (![dict[@"⒯⒣⒠ ⒬⒰⒤⒞⒦ ⒝⒭⒪⒲⒩ ⒡⒪⒳ ⒥⒰⒨⒫⒮ ⒪⒱⒠⒭ ⒯⒣⒠ ⒧⒜⒵⒴ ⒟⒪⒢"] isKindOfClass:NSString.class]) return nil;
592+ if (![dict[@"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"] isKindOfClass:NSString.class]) return nil;
593+ if (![dict[@"false"] isKindOfClass:NSString.class]) return nil;
594+ if (![dict[@"# The next two lines may appear to be blank or mojibake in some viewers."] isKindOfClass:NSString.class]) return nil;
595+ if (![dict[@"The quic\010\010\010\010\010\010k brown fo\007\007\007\007\007\007\007\007\007\007\007x... [Beeeep]"] isKindOfClass:NSString.class]) return nil;
596+ if (![dict[@"\u2066test\u2067"] isKindOfClass:NSString.class]) return nil;
597+ if (![dict[@"٠١٢٣٤٥٦٧٨٩"] isKindOfClass:NSString.class]) return nil;
598+ if (![dict[@"#\tTwo-Byte Characters"] isKindOfClass:NSString.class]) return nil;
599+ if (![dict[@"# U+0000, U+000A, or U+000D (NUL, LF, CR)."] isKindOfClass:NSString.class]) return nil;
600+ if (![dict[@"<u oncopy=alert()> Copy me</u>"] isKindOfClass:NSString.class]) return nil;
601+ if (![dict[@"undef"] isKindOfClass:NSString.class]) return nil;
602+ if (![dict[@"#\tUnicode font"] isKindOfClass:NSString.class]) return nil;
603+ if (![dict[@"#\tUnicode Numbers"] isKindOfClass:NSString.class]) return nil;
604+ if (![dict[@"#\tUnwanted Interpolation"] isKindOfClass:NSString.class]) return nil;
605+ if (![dict[@"%x('ls -al /')"] isKindOfClass:NSString.class]) return nil;
606+ if (![dict[@"Z̮̞̠͙͔ͅḀ̗̞͈̻̗Ḷ͙͎̯̹̞͓G̻O̭̗̮"] isKindOfClass:NSString.class]) return nil;
607+ if (![dict[@"¡™£¢∞§¶•ªº–≠"] isKindOfClass:NSString.class]) return nil;
608+ if (![dict[@"¸˛Ç◊ı˜Â¯˘¿"] isKindOfClass:NSString.class]) return nil;
609+ if (![dict[@"Œ„´‰ˇÁ¨ˆØ∏”’"] isKindOfClass:NSString.class]) return nil;
610+ if (![dict[@"œ∑´®†¥¨ˆøπ“‘"] isKindOfClass:NSString.class]) return nil;
611+ if (![dict[@"( ͡° ͜ʖ ͡°)"] isKindOfClass:NSString.class]) return nil;
612+ if (![dict[@"הָיְתָהtestالصفحات التّحول"] isKindOfClass:NSString.class]) return nil;
613+ if (![dict[@"ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ايطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو."] isKindOfClass:NSString.class]) return nil;
614+ if (![dict[@"ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็"] isKindOfClass:NSString.class]) return nil;
615+ if (![dict[@"Ⱥ"] isKindOfClass:NSString.class]) return nil;
616+ if (![dict[@"Ⱦ"] isKindOfClass:NSString.class]) return nil;
617+ if (![dict[@"パーティーへ行かないか"] isKindOfClass:NSString.class]) return nil;
618+ if (![dict[@"和製漢語"] isKindOfClass:NSString.class]) return nil;
619+ if (![dict[@"田中さんにあげて下さい"] isKindOfClass:NSString.class]) return nil;
620+ if (![dict[@"`⁄€‹›fifl‡°·‚—±"] isKindOfClass:NSString.class]) return nil;
621+ if (![dict[@"`ィ(´∀`∩"] isKindOfClass:NSString.class]) return nil;
622+ [self setValuesForKeysWithDictionary:dict];
623+ }
624+ return self;
625+}
626+
627+- (void)setValue:(nullable id)value forKey:(NSString *)key
628+{
629+ id resolved = QTA.properties[key];
630+ if (resolved) [super setValue:value forKey:resolved];
631+}
632+
633+- (void)setNilValueForKey:(NSString *)key
634+{
635+ id resolved = QTA.properties[key];
636+ if (resolved) [super setValue:@(0) forKey:resolved];
637+}
638+
639+- (NSDictionary *)JSONDictionary
640+{
641+ id dict = [[self dictionaryWithValuesForKeys:QTA.properties.allValues] mutableCopy];
642+
643+ for (id jsonName in QTA.properties) {
644+ id propertyName = QTA.properties[jsonName];
645+ if (![jsonName isEqualToString:propertyName]) {
646+ dict[jsonName] = dict[propertyName];
647+ [dict removeObjectForKey:propertyName];
648+ }
649+ }
650+
651+ [dict addEntriesFromDictionary:@{
652+ @"dontMakeAMap": _isDontMakeAMap ? @YES : @NO,
653+ }];
654+
655+ return dict;
656+}
657+@end
658+
659+@implementation QTB
660++ (NSDictionary<NSString *, NSString *> *)properties
661+{
662+ static NSDictionary<NSString *, NSString *> *properties;
663+ return properties = properties ? properties : @{
664+ @"<a href=http://foo.bar/#x=`y></a><img alt=\"`><img src=x:x onerror=javascript:alert(1)></a>\">": @"aHrefHTTPFooBarXYAImgAltImgSrcXXOnerrorJavascriptAlert1A",
665+ @"<a href=\"javascript\\x00:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefJavascriptX00JavascriptAlert1IDFuzzelement1TestA",
666+ @"<a href=\"javascript\\x0D:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefJavascriptX0DJavascriptAlert1IDFuzzelement1TestA",
667+ @"<a href=\"\\x02javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX02JavascriptJavascriptAlert1IDFuzzelement1TestA",
668+ @"<a href=\"\\x04javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX04JavascriptJavascriptAlert1IDFuzzelement1TestA",
669+ @"<a href=\"\\x0Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX0AjavascriptJavascriptAlert1IDFuzzelement1TestA",
670+ @"<a href=\"\\x0Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX0DjavascriptJavascriptAlert1IDFuzzelement1TestA",
671+ @"<a href=\"\\x0Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX0EjavascriptJavascriptAlert1IDFuzzelement1TestA",
672+ @"<a href=\"\\x0Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX0FjavascriptJavascriptAlert1IDFuzzelement1TestA",
673+ @"<a href=\"\\x16javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX16JavascriptJavascriptAlert1IDFuzzelement1TestA",
674+ @"<a href=\"\\x19javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX19JavascriptJavascriptAlert1IDFuzzelement1TestA",
675+ @"<a href=\"\\x1Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX1AjavascriptJavascriptAlert1IDFuzzelement1TestA",
676+ @"<a href=\"\\x1Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX1DjavascriptJavascriptAlert1IDFuzzelement1TestA",
677+ @"<a href=\"\\x1Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX1EjavascriptJavascriptAlert1IDFuzzelement1TestA",
678+ @"<a href=\"\\xE2\\x80\\x81javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X81JavascriptJavascriptAlert1IDFuzzelement1TestA",
679+ @"<a href=\"\\xE2\\x80\\x82javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X82JavascriptJavascriptAlert1IDFuzzelement1TestA",
680+ @"<a href=\"\\xE2\\x80\\xA9javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80XA9JavascriptJavascriptAlert1IDFuzzelement1TestA",
681+ @"<a href=\"\\xE2\\x80\\xAFjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80XAFjavascriptJavascriptAlert1IDFuzzelement1TestA",
682+ @"ABC<div style=\"x:expression\\x5C(javascript:alert(1)\">DEF": @"abcDivStyleXExpressionX5CJavascriptAlert1DEF",
683+ @"ABC<div style=\"x:\\x0Aexpression(javascript:alert(1)\">DEF": @"abcDivStyleXX0AexpressionJavascriptAlert1DEF",
684+ @"ABC<div style=\"x:\\x0Dexpression(javascript:alert(1)\">DEF": @"abcDivStyleXX0DexpressionJavascriptAlert1DEF",
685+ @"ABC<div style=\"x:\\xE2\\x80\\x82expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X82ExpressionJavascriptAlert1DEF",
686+ @"ABC<div style=\"x:\\xE2\\x80\\x83expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X83ExpressionJavascriptAlert1DEF",
687+ @"ABC<div style=\"x:\\xE2\\x80\\x85expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X85ExpressionJavascriptAlert1DEF",
688+ @"ABC<div style=\"x:\\xE2\\x80\\x87expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X87ExpressionJavascriptAlert1DEF",
689+ @"ABC<div style=\"x:\\xE2\\x80\\x8Aexpression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X8AexpressionJavascriptAlert1DEF",
690+ @"⁰⁴⁵₀₁₂": @"another",
691+ @"# appear in input.": @"appearInInput",
692+ @"+++ATH0": @"ath0",
693+ @"' autofocus onkeyup='javascript:alert(123)": @"autofocusOnkeyupJavascriptAlert123",
694+ @"\t\013\014 \302\205             \u200b\u2028\u2029   ": @"b",
695+ @"1'000.00": @"b100000",
696+ @"FALSE": @"bFALSE",
697+ @"<IMG SRC=# onmouseover=\"alert('xxs')\">": @"bIMGSRCOnmouseoverAlertXxs",
698+ @"NIL": @"bNIL",
699+ @"--><script>alert(123)</script>": @"bScriptAlert123Script",
700+ @"`touch /tmp/blns.fail`": @"bTouchTmpBlnsFail",
701+ @"basement": @"basement",
702+ @"But now...\033[20Cfor my greatest trick...\033[8m": @"butNow20CforMyGreatestTrick8M",
703+ @"# \"Byte order marks\", U+FEFF and U+FFFE, each on its own line.": @"byteOrderMarksUFEFFAndUFFFEEachOnItsOwnLine",
704+ @"COM1": @"com1",
705+ @"COM3": @"com3",
706+ @"# Commonly misinterpreted as additional graphic characters.": @"commonlyMisinterpretedAsAdditionalGraphicCharacters",
707+ @"CON": @"con",
708+ @"# contexts. Divided into three groups based on (US-layout) keyboard position.": @"contextsDividedIntoThreeGroupsBasedOnUSLayoutKeyboardPosition",
709+ @"#\tCredit: https://twitter.com/jifa/status/625776454479970304": @"creditHTTPSTwitterCOMJifaStatus625776454479970304",
710+ @"/dev/null; touch /tmp/blns.fail ; echo": @"devNullTouchTmpBlnsFailEcho",
711+ @"\001\002\003\004\005\006\007\010\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\177": @"empty",
712+ @"eval(\"puts 'hello world'\")": @"evalPutsHelloWorld",
713+ @"expression": @"expression",
714+ @"File:///": @"file",
715+ @"#\tFile Inclusion": @"fileInclusion",
716+ @"<foo val=”bar“ />": @"fooValBar",
717+ @"# general category Cf (in Unicode 8.0.0).": @"generalCategoryCFInUnicode800",
718+ @"̦H̬̤̗̤͝e͜ ̜̥̝̻͍̟́w̕h̖̯͓o̝͙̖͎̱̮ ҉̺̙̞̟͈W̷̼̭a̺̪͍į͈͕̭͙̯̜t̶̼̮s̘͙͖̕ ̠̫̠B̻͍͙͉̳ͅe̵h̵̬͇̫͙i̹͓̳̳̮͎̫̕n͟d̴̪̜̖ ̰͉̩͇͙̲͞ͅT͖̼͓̪͢h͏͓̮̻e̬̝̟ͅ ̤̹̝W͙̞̝͔͇͝ͅa͏͓͔̹̼̣l̴͔̰̤̟͔ḽ̫.͕": @"hEWHOWAĮTSBEHINDTHEWALḼ",
719+ @"--help": @"help",
720+ @"http://a/%%30%30": @"httpA3030",
721+ @"#\tiOS Vulnerabilities": @"iOSVulnerabilities",
722+ @"If you're reading this, you've been in a coma for almost 20 years now. We're trying a new technique. We don't know where this message will end up in your dream, but we hope it works. Please wake up, we miss you.": @"ifYouReReadingThisYouVeBeenInAComaForAlmost20YearsNowWeReTryingANewTechniqueWeDonTKnowWhereThisMessageWillEndUpInYourDreamButWeHopeItWorksPleaseWakeUpWeMissYou",
723+ @"<iframe src=http://ha.ckers.org/scriptlet.html <": @"iframeSrcHTTPHaCkersOrgScriptletHTML",
724+ @"<IMG SRC=\" &#14; javascript:alert('XSS');\">": @"imgSRC14JavascriptAlertXSS",
725+ @"<IMG SRC=\"jav&#x09;ascript:alert('XSS');\">": @"imgSRCJavX09AscriptAlertXSS",
726+ @"<IMG SRC= onmouseover=\"alert('xxs')\">": @"imgSRCOnmouseoverAlertXxs",
727+ @"<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>": @"imgSRCX6AX61X76X61X73X63X72X69X70X74X3AX61X6CX65X72X74X28X27X58X53X53X27X29",
728+ @"<IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>": @"imgSrc00001060000097000011800000970000115000009900001140000105000011200001160000058000009700001080000101000011400001160000040000003900000880000083000008300000390000041",
729+ @"<img src\\x00=x onerror=\"javascript:alert(1)\">": @"imgSrcX00XOnerrorJavascriptAlert1",
730+ @"<img src=x onerror=\\x11\"javascript:alert(1)\">": @"imgSrcXOnerrorX11JavascriptAlert1",
731+ @"<img src=x onerror=\\x12\"javascript:alert(1)\">": @"imgSrcXOnerrorX12JavascriptAlert1",
732+ @"`\"'><img src=xxx:x \\x0Aonerror=javascript:alert(1)>": @"imgSrcXxxXX0AonerrorJavascriptAlert1",
733+ @"`\"'><img src=xxx:x \\x0Conerror=javascript:alert(1)>": @"imgSrcXxxXX0ConerrorJavascriptAlert1",
734+ @"`\"'><img src=xxx:x \\x0Donerror=javascript:alert(1)>": @"imgSrcXxxXX0DonerrorJavascriptAlert1",
735+ @"<img \\x00src=x onerror=\"javascript:alert(1)\">": @"imgX00SrcXOnerrorJavascriptAlert1",
736+ @"<img \\x11src=x onerror=\"javascript:alert(1)\">": @"imgX11SrcXOnerrorJavascriptAlert1",
737+ @"<img \\x12src=x onerror=\"javascript:alert(1)\">": @"imgX12SrcXOnerrorJavascriptAlert1",
738+ @"<img \\x47src=x onerror=\"javascript:alert(1)\">": @"imgX47SrcXOnerrorJavascriptAlert1",
739+ @"# IRC specific strings": @"ircSpecificStrings",
740+ @"dontMakeAMap": @"isDontMakeAMap",
741+ @"#\tJapanese Emoticons": @"japaneseEmoticons",
742+ @"Kernel.exec(\"ls -al /\")": @"kernelExecLsAl",
743+ @"Linda Callahan": @"lindaCallahan",
744+ @"NUL": @"nul",
745+ @"null": @"null",
746+ @"#\tNumeric Strings": @"numericStrings",
747+ @"# Often forbidden to appear in various text-based file formats (e.g. XML),": @"oftenForbiddenToAppearInVariousTextBasedFileFormatsEGXML",
748+ @"#": @"one",
749+ @"\" onfocus=JaVaSCript:alert(123) autofocus": @"onfocusJaVaSCriptAlert123Autofocus",
750+ @"' OR 1=1 -- 1": @"or111",
751+ @"#\tQuotation Marks": @"quotationMarks",
752+ @"# Regional Indicator Symbols": @"regionalIndicatorSymbols",
753+ @"# Regional Indicator Symbols can be displayed differently across": @"regionalIndicatorSymbolsCanBeDisplayedDifferentlyAcross",
754+ @"#\tReserved Strings": @"reservedStrings",
755+ @"\"><script>alert(123)</script>": @"scriptAlert123Script",
756+ @"><script>alert(123);</script x=": @"scriptAlert123ScriptX",
757+ @"<<SCRIPT>alert(\"XSS\");//<</SCRIPT>": @"scriptAlertXSSSCRIPT",
758+ @"<SCRIPT SRC=//ha.ckers.org/.j>": @"scriptSRCHaCkersOrgJ",
759+ @"<script src=\"\\\\%(jscript)s\"></script>": @"scriptSrcJscriptSScript",
760+ @"\"`'><script>\\x09javascript:alert(1)</script>": @"scriptX09JavascriptAlert1Script",
761+ @"<script\\x0Atype=\"text/javascript\">javascript:alert(1);</script>": @"scriptX0AtypeTextJavascriptJavascriptAlert1Script",
762+ @"<script\\x0Dtype=\"text/javascript\">javascript:alert(1);</script>": @"scriptX0DtypeTextJavascriptJavascriptAlert1Script",
763+ @"\"`'><script>\\x21javascript:alert(1)</script>": @"scriptX21JavascriptAlert1Script",
764+ @"\"`'><script>\\x3Bjavascript:alert(1)</script>": @"scriptX3BjavascriptAlert1Script",
765+ @"\"`'><script>\\xE2\\x80\\x85javascript:alert(1)</script>": @"scriptXE2X80X85JavascriptAlert1Script",
766+ @"\"`'><script>\\xE2\\x80\\x87javascript:alert(1)</script>": @"scriptXE2X80X87JavascriptAlert1Script",
767+ @"\"`'><script>\\xE2\\x80\\x8Ajavascript:alert(1)</script>": @"scriptXE2X80X8AjavascriptAlert1Script",
768+ @"\"`'><script>\\xE2\\x80\\xA8javascript:alert(1)</script>": @"scriptXE2X80XA8JavascriptAlert1Script",
769+ @"\"`'><script>\\xE2\\x80\\xA9javascript:alert(1)</script>": @"scriptXE2X80XA9JavascriptAlert1Script",
770+ @"\"`'><script>\\xE2\\x80\\xAFjavascript:alert(1)</script>": @"scriptXE2X80XAFjavascriptAlert1Script",
771+ @"\"`'><script>\\xE3\\x80\\x80javascript:alert(1)</script>": @"scriptXE3X80X80JavascriptAlert1Script",
772+ @"#\tScunthorpe Problem": @"scunthorpeProblem",
773+ @"(。◕ ∀ ◕。)": @"some",
774+ @"# Strings that may occur on IRC clients that make security products freak out": @"stringsThatMayOccurOnIRCClientsThatMakeSecurityProductsFreakOut",
775+ @"#\tStrings which are reserved characters in MSDOS/Windows": @"stringsWhichAreReservedCharactersInMSDOSWindows",
776+ @"#\tStrings which attempt to invoke a benign script injection; shows vulnerability to XSS": @"stringsWhichAttemptToInvokeABenignScriptInjectionShowsVulnerabilityToXSS",
777+ @"#\tStrings which contain text that should be rendered RTL if possible (e.g. Arabic, Hebrew)": @"stringsWhichContainTextThatShouldBeRenderedRTLIfPossibleEGArabicHebrew",
778+ @"#\tStrings which contain two-byte characters: can cause rendering issues or character-length issues": @"stringsWhichContainTwoByteCharactersCanCauseRenderingIssuesOrCharacterLengthIssues",
779+ @"#\tStrings which contain unicode numbers; if the code is localized, it should see the input as numeric": @"stringsWhichContainUnicodeNumbersIfTheCodeIsLocalizedItShouldSeeTheInputAsNumeric",
780+ @"#\tStrings which may be used elsewhere in code": @"stringsWhichMayBeUsedElsewhereInCode",
781+ @"#\tTerminal escape codes": @"terminalEscapeCodes",
782+ @"\"": @"the",
783+ @"0.00": @"the000",
784+ @"01000": @"the01000",
785+ @"08": @"the08",
786+ @"09": @"the09",
787+ @"0xffffffffffffffff": @"the0Xffffffffffffffff",
788+ @"❤️ \U0001f494 \U0001f48c \U0001f495 \U0001f49e \U0001f493 \U0001f497 \U0001f496 \U0001f498 \U0001f49d \U0001f49f \U0001f49c \U0001f49b \U0001f49a \U0001f499": @"the1",
789+ @"$1.00": @"the100",
790+ @"1,0/0,0": @"the1000",
791+ @"1 000.00": @"the100000",
792+ @"1 000 000,00": @"the100000000",
793+ @"1'; DROP TABLE users-- 1": @"the1DROPTABLEUsers1",
794+ @"1#IND": @"the1Ind",
795+ @"1#INF": @"the1Inf",
796+ @"\U0001d54b\U0001d559\U0001d556 \U0001d562\U0001d566\U0001d55a\U0001d554\U0001d55c \U0001d553\U0001d563\U0001d560\U0001d568\U0001d55f \U0001d557\U0001d560\U0001d569 \U0001d55b\U0001d566\U0001d55e\U0001d561\U0001d564 \U0001d560\U0001d567\U0001d556\U0001d563 \U0001d565\U0001d559\U0001d556 \U0001d55d\U0001d552\U0001d56b\U0001d56a \U0001d555\U0001d560\U0001d558": @"the2",
797+ @"-2147483648/-1": @"the21474836481",
798+ @"2.2250738585072011e-308": @"the22250738585072011E308",
799+ @"\U0001f60d": @"the3",
800+ @"# The next line may appear to be blank, mojibake, or dingbats in some viewers.": @"theNextLineMayAppearToBeBlankMojibakeOrDingbatsInSomeViewers",
801+ @"# The next line may appear to be blank or mojibake in some viewers.": @"theNextLineMayAppearToBeBlankOrMojibakeInSomeViewers",
802+ @"# The next line may be flagged for \"trailing whitespace\" in some viewers.": @"theNextLineMayBeFlaggedForTrailingWhitespaceInSomeViewers",
803+ @"<script>alert(123)</script>": @"theScriptAlert123Script",
804+ @"123": @"the123",
805+ @"# This file unfortunately cannot express strings containing": @"thisFileUnfortunatelyCannotExpressStringsContaining",
806+ @"$(touch /tmp/blns.fail)": @"touchTmpBlnsFail",
807+ @"() { _; } >_[$($())] { touch /tmp/blns.shellshock2.fail; }": @"touchTmpBlnsShellshock2Fail",
808+ @"Tyson Gay": @"tysonGay",
809+ @"#\tUnicode Symbols": @"unicodeSymbols",
810+ @"'`\"><\\x00script>javascript:alert(1)</script>": @"x00ScriptJavascriptAlert1Script",
811+ @"'`\"><\\x3Cscript>javascript:alert(1)</script>": @"x3CscriptJavascriptAlert1Script",
812+ @"åß∂ƒ©˙∆˚¬…æ": @"åßƑÆ",
813+ @"˙ɐnbᴉlɐ ɐuƃɐɯ ǝɹolop ʇǝ ǝɹoqɐl ʇn ʇunpᴉpᴉɔuᴉ ɹodɯǝʇ poɯsnᴉǝ op pǝs 'ʇᴉlǝ ƃuᴉɔsᴉdᴉpɐ ɹnʇǝʇɔǝsuoɔ 'ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥": @"ɐnbᴉlɐⱯuƃɐɯƎɹolopꞱǝƎɹoqɐlꞱnꞱunpᴉpᴉɔuᴉɹodɯǝʇPoɯsnᴉǝOpPǝsꞱᴉlǝƂuᴉɔsᴉdᴉpɐɹnʇǝʇɔǝsuoɔꞱǝɯɐꞱᴉsɹolopƜnsdᴉƜǝɹo",
814+ @"Ω≈ç√∫˜µ≤≥÷": @"ωÇΜ",
815+ @"ヽ༼ຈل͜ຈ༽ノ ヽ༼ຈل͜ຈ༽ノ": @"ຈل͜ຈノヽຈل͜ຈノ",
816+ @"Ṱ̺̺̕o͞ ̷i̲̬͇̪͙n̝̗͕v̟̜̘̦͟o̶̙̰̠kè͚̮̺̪̹̱̤ ̖t̝͕̳̣̻̪͞h̼͓̲̦̳̘̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ͏͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣": @"ṱOINVOKèTHEHIVEMINDREPRESEǸTINGCHAOS",
817+ @"社會科學院語學研究所": @"社會科學院語學研究所",
818+ @"部落格": @"部落格",
819+ @"사회과학원 어학연구소": @"사회과학원어학연구소",
820+ @"찦차를 타고 온 펲시맨과 쑛다리 똠방각하": @"찦차를타고온펲시맨과쑛다리똠방각하",
821+ @"ﷺ": @"ﷺ",
822+ @"__ロ(,_,*)": @"ロ_",
823+ };
824+}
825+
826++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
827+{
828+ return [dict isKindOfClass:NSDictionary.class] ? [[QTB alloc] initWithJSONDictionary:dict] : nil;
829+}
830+
831+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
832+{
833+ if (self = [super init]) {
834+ if (![dict[@"<a href=http://foo.bar/#x=`y></a><img alt=\"`><img src=x:x onerror=javascript:alert(1)></a>\">"] isKindOfClass:NSString.class]) return nil;
835+ if (![dict[@"<a href=\"javascript\\x00:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
836+ if (![dict[@"<a href=\"javascript\\x0D:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
837+ if (![dict[@"<a href=\"\\x02javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
838+ if (![dict[@"<a href=\"\\x04javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
839+ if (![dict[@"<a href=\"\\x0Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
840+ if (![dict[@"<a href=\"\\x0Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
841+ if (![dict[@"<a href=\"\\x0Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
842+ if (![dict[@"<a href=\"\\x0Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
843+ if (![dict[@"<a href=\"\\x16javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
844+ if (![dict[@"<a href=\"\\x19javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
845+ if (![dict[@"<a href=\"\\x1Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
846+ if (![dict[@"<a href=\"\\x1Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
847+ if (![dict[@"<a href=\"\\x1Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
848+ if (![dict[@"<a href=\"\\xE2\\x80\\x81javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
849+ if (![dict[@"<a href=\"\\xE2\\x80\\x82javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
850+ if (![dict[@"<a href=\"\\xE2\\x80\\xA9javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
851+ if (![dict[@"<a href=\"\\xE2\\x80\\xAFjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
852+ if (![dict[@"ABC<div style=\"x:expression\\x5C(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
853+ if (![dict[@"ABC<div style=\"x:\\x0Aexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
854+ if (![dict[@"ABC<div style=\"x:\\x0Dexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
855+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x82expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
856+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x83expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
857+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x85expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
858+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x87expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
859+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x8Aexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
860+ if (![dict[@"⁰⁴⁵₀₁₂"] isKindOfClass:NSString.class]) return nil;
861+ if (![dict[@"# appear in input."] isKindOfClass:NSString.class]) return nil;
862+ if (![dict[@"+++ATH0"] isKindOfClass:NSString.class]) return nil;
863+ if (![dict[@"' autofocus onkeyup='javascript:alert(123)"] isKindOfClass:NSString.class]) return nil;
864+ if (![dict[@"\t\013\014 \302\205             \u200b\u2028\u2029   "] isKindOfClass:NSString.class]) return nil;
865+ if (![dict[@"1'000.00"] isKindOfClass:NSString.class]) return nil;
866+ if (![dict[@"FALSE"] isKindOfClass:NSString.class]) return nil;
867+ if (![dict[@"<IMG SRC=# onmouseover=\"alert('xxs')\">"] isKindOfClass:NSString.class]) return nil;
868+ if (![dict[@"NIL"] isKindOfClass:NSString.class]) return nil;
869+ if (![dict[@"--><script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
870+ if (![dict[@"`touch /tmp/blns.fail`"] isKindOfClass:NSString.class]) return nil;
871+ if (![dict[@"basement"] isKindOfClass:NSString.class]) return nil;
872+ if (![dict[@"But now...\033[20Cfor my greatest trick...\033[8m"] isKindOfClass:NSString.class]) return nil;
873+ if (![dict[@"# \"Byte order marks\", U+FEFF and U+FFFE, each on its own line."] isKindOfClass:NSString.class]) return nil;
874+ if (![dict[@"COM1"] isKindOfClass:NSString.class]) return nil;
875+ if (![dict[@"COM3"] isKindOfClass:NSString.class]) return nil;
876+ if (![dict[@"# Commonly misinterpreted as additional graphic characters."] isKindOfClass:NSString.class]) return nil;
877+ if (![dict[@"CON"] isKindOfClass:NSString.class]) return nil;
878+ if (![dict[@"# contexts. Divided into three groups based on (US-layout) keyboard position."] isKindOfClass:NSString.class]) return nil;
879+ if (![dict[@"#\tCredit: https://twitter.com/jifa/status/625776454479970304"] isKindOfClass:NSString.class]) return nil;
880+ if (![dict[@"/dev/null; touch /tmp/blns.fail ; echo"] isKindOfClass:NSString.class]) return nil;
881+ if (![dict[@"\001\002\003\004\005\006\007\010\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\177"] isKindOfClass:NSString.class]) return nil;
882+ if (![dict[@"eval(\"puts 'hello world'\")"] isKindOfClass:NSString.class]) return nil;
883+ if (![dict[@"expression"] isKindOfClass:NSString.class]) return nil;
884+ if (![dict[@"File:///"] isKindOfClass:NSString.class]) return nil;
885+ if (![dict[@"#\tFile Inclusion"] isKindOfClass:NSString.class]) return nil;
886+ if (![dict[@"<foo val=”bar“ />"] isKindOfClass:NSString.class]) return nil;
887+ if (![dict[@"# general category Cf (in Unicode 8.0.0)."] isKindOfClass:NSString.class]) return nil;
888+ if (![dict[@"̦H̬̤̗̤͝e͜ ̜̥̝̻͍̟́w̕h̖̯͓o̝͙̖͎̱̮ ҉̺̙̞̟͈W̷̼̭a̺̪͍į͈͕̭͙̯̜t̶̼̮s̘͙͖̕ ̠̫̠B̻͍͙͉̳ͅe̵h̵̬͇̫͙i̹͓̳̳̮͎̫̕n͟d̴̪̜̖ ̰͉̩͇͙̲͞ͅT͖̼͓̪͢h͏͓̮̻e̬̝̟ͅ ̤̹̝W͙̞̝͔͇͝ͅa͏͓͔̹̼̣l̴͔̰̤̟͔ḽ̫.͕"] isKindOfClass:NSString.class]) return nil;
889+ if (![dict[@"--help"] isKindOfClass:NSString.class]) return nil;
890+ if (![dict[@"http://a/%%30%30"] isKindOfClass:NSString.class]) return nil;
891+ if (![dict[@"#\tiOS Vulnerabilities"] isKindOfClass:NSString.class]) return nil;
892+ if (![dict[@"If you're reading this, you've been in a coma for almost 20 years now. We're trying a new technique. We don't know where this message will end up in your dream, but we hope it works. Please wake up, we miss you."] isKindOfClass:NSString.class]) return nil;
893+ if (![dict[@"<iframe src=http://ha.ckers.org/scriptlet.html <"] isKindOfClass:NSString.class]) return nil;
894+ if (![dict[@"<IMG SRC=\" &#14; javascript:alert('XSS');\">"] isKindOfClass:NSString.class]) return nil;
895+ if (![dict[@"<IMG SRC=\"jav&#x09;ascript:alert('XSS');\">"] isKindOfClass:NSString.class]) return nil;
896+ if (![dict[@"<IMG SRC= onmouseover=\"alert('xxs')\">"] isKindOfClass:NSString.class]) return nil;
897+ if (![dict[@"<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>"] isKindOfClass:NSString.class]) return nil;
898+ if (![dict[@"<IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>"] isKindOfClass:NSString.class]) return nil;
899+ if (![dict[@"<img src\\x00=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
900+ if (![dict[@"<img src=x onerror=\\x11\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
901+ if (![dict[@"<img src=x onerror=\\x12\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
902+ if (![dict[@"`\"'><img src=xxx:x \\x0Aonerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
903+ if (![dict[@"`\"'><img src=xxx:x \\x0Conerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
904+ if (![dict[@"`\"'><img src=xxx:x \\x0Donerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
905+ if (![dict[@"<img \\x00src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
906+ if (![dict[@"<img \\x11src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
907+ if (![dict[@"<img \\x12src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
908+ if (![dict[@"<img \\x47src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
909+ if (![dict[@"# IRC specific strings"] isKindOfClass:NSString.class]) return nil;
910+ if (![dict[@"dontMakeAMap"] isKindOfClass:NSNumber.class]) return nil;
911+ if (![dict[@"#\tJapanese Emoticons"] isKindOfClass:NSString.class]) return nil;
912+ if (![dict[@"Kernel.exec(\"ls -al /\")"] isKindOfClass:NSString.class]) return nil;
913+ if (![dict[@"Linda Callahan"] isKindOfClass:NSString.class]) return nil;
914+ if (![dict[@"NUL"] isKindOfClass:NSString.class]) return nil;
915+ if (![dict[@"null"] isKindOfClass:NSString.class]) return nil;
916+ if (![dict[@"#\tNumeric Strings"] isKindOfClass:NSString.class]) return nil;
917+ if (![dict[@"# Often forbidden to appear in various text-based file formats (e.g. XML),"] isKindOfClass:NSString.class]) return nil;
918+ if (![dict[@"#"] isKindOfClass:NSString.class]) return nil;
919+ if (![dict[@"\" onfocus=JaVaSCript:alert(123) autofocus"] isKindOfClass:NSString.class]) return nil;
920+ if (![dict[@"' OR 1=1 -- 1"] isKindOfClass:NSString.class]) return nil;
921+ if (![dict[@"#\tQuotation Marks"] isKindOfClass:NSString.class]) return nil;
922+ if (![dict[@"# Regional Indicator Symbols"] isKindOfClass:NSString.class]) return nil;
923+ if (![dict[@"# Regional Indicator Symbols can be displayed differently across"] isKindOfClass:NSString.class]) return nil;
924+ if (![dict[@"#\tReserved Strings"] isKindOfClass:NSString.class]) return nil;
925+ if (![dict[@"\"><script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
926+ if (![dict[@"><script>alert(123);</script x="] isKindOfClass:NSString.class]) return nil;
927+ if (![dict[@"<<SCRIPT>alert(\"XSS\");//<</SCRIPT>"] isKindOfClass:NSString.class]) return nil;
928+ if (![dict[@"<SCRIPT SRC=//ha.ckers.org/.j>"] isKindOfClass:NSString.class]) return nil;
929+ if (![dict[@"<script src=\"\\\\%(jscript)s\"></script>"] isKindOfClass:NSString.class]) return nil;
930+ if (![dict[@"\"`'><script>\\x09javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
931+ if (![dict[@"<script\\x0Atype=\"text/javascript\">javascript:alert(1);</script>"] isKindOfClass:NSString.class]) return nil;
932+ if (![dict[@"<script\\x0Dtype=\"text/javascript\">javascript:alert(1);</script>"] isKindOfClass:NSString.class]) return nil;
933+ if (![dict[@"\"`'><script>\\x21javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
934+ if (![dict[@"\"`'><script>\\x3Bjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
935+ if (![dict[@"\"`'><script>\\xE2\\x80\\x85javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
936+ if (![dict[@"\"`'><script>\\xE2\\x80\\x87javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
937+ if (![dict[@"\"`'><script>\\xE2\\x80\\x8Ajavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
938+ if (![dict[@"\"`'><script>\\xE2\\x80\\xA8javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
939+ if (![dict[@"\"`'><script>\\xE2\\x80\\xA9javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
940+ if (![dict[@"\"`'><script>\\xE2\\x80\\xAFjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
941+ if (![dict[@"\"`'><script>\\xE3\\x80\\x80javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
942+ if (![dict[@"#\tScunthorpe Problem"] isKindOfClass:NSString.class]) return nil;
943+ if (![dict[@"(。◕ ∀ ◕。)"] isKindOfClass:NSString.class]) return nil;
944+ if (![dict[@"# Strings that may occur on IRC clients that make security products freak out"] isKindOfClass:NSString.class]) return nil;
945+ if (![dict[@"#\tStrings which are reserved characters in MSDOS/Windows"] isKindOfClass:NSString.class]) return nil;
946+ if (![dict[@"#\tStrings which attempt to invoke a benign script injection; shows vulnerability to XSS"] isKindOfClass:NSString.class]) return nil;
947+ if (![dict[@"#\tStrings which contain text that should be rendered RTL if possible (e.g. Arabic, Hebrew)"] isKindOfClass:NSString.class]) return nil;
948+ if (![dict[@"#\tStrings which contain two-byte characters: can cause rendering issues or character-length issues"] isKindOfClass:NSString.class]) return nil;
949+ if (![dict[@"#\tStrings which contain unicode numbers; if the code is localized, it should see the input as numeric"] isKindOfClass:NSString.class]) return nil;
950+ if (![dict[@"#\tStrings which may be used elsewhere in code"] isKindOfClass:NSString.class]) return nil;
951+ if (![dict[@"#\tTerminal escape codes"] isKindOfClass:NSString.class]) return nil;
952+ if (![dict[@"\""] isKindOfClass:NSString.class]) return nil;
953+ if (![dict[@"0.00"] isKindOfClass:NSString.class]) return nil;
954+ if (![dict[@"01000"] isKindOfClass:NSString.class]) return nil;
955+ if (![dict[@"08"] isKindOfClass:NSString.class]) return nil;
956+ if (![dict[@"09"] isKindOfClass:NSString.class]) return nil;
957+ if (![dict[@"0xffffffffffffffff"] isKindOfClass:NSString.class]) return nil;
958+ if (![dict[@"❤️ \U0001f494 \U0001f48c \U0001f495 \U0001f49e \U0001f493 \U0001f497 \U0001f496 \U0001f498 \U0001f49d \U0001f49f \U0001f49c \U0001f49b \U0001f49a \U0001f499"] isKindOfClass:NSString.class]) return nil;
959+ if (![dict[@"$1.00"] isKindOfClass:NSString.class]) return nil;
960+ if (![dict[@"1,0/0,0"] isKindOfClass:NSString.class]) return nil;
961+ if (![dict[@"1 000.00"] isKindOfClass:NSString.class]) return nil;
962+ if (![dict[@"1 000 000,00"] isKindOfClass:NSString.class]) return nil;
963+ if (![dict[@"1'; DROP TABLE users-- 1"] isKindOfClass:NSString.class]) return nil;
964+ if (![dict[@"1#IND"] isKindOfClass:NSString.class]) return nil;
965+ if (![dict[@"1#INF"] isKindOfClass:NSString.class]) return nil;
966+ if (![dict[@"\U0001d54b\U0001d559\U0001d556 \U0001d562\U0001d566\U0001d55a\U0001d554\U0001d55c \U0001d553\U0001d563\U0001d560\U0001d568\U0001d55f \U0001d557\U0001d560\U0001d569 \U0001d55b\U0001d566\U0001d55e\U0001d561\U0001d564 \U0001d560\U0001d567\U0001d556\U0001d563 \U0001d565\U0001d559\U0001d556 \U0001d55d\U0001d552\U0001d56b\U0001d56a \U0001d555\U0001d560\U0001d558"] isKindOfClass:NSString.class]) return nil;
967+ if (![dict[@"-2147483648/-1"] isKindOfClass:NSString.class]) return nil;
968+ if (![dict[@"2.2250738585072011e-308"] isKindOfClass:NSString.class]) return nil;
969+ if (![dict[@"\U0001f60d"] isKindOfClass:NSString.class]) return nil;
970+ if (![dict[@"# The next line may appear to be blank, mojibake, or dingbats in some viewers."] isKindOfClass:NSString.class]) return nil;
971+ if (![dict[@"# The next line may appear to be blank or mojibake in some viewers."] isKindOfClass:NSString.class]) return nil;
972+ if (![dict[@"# The next line may be flagged for \"trailing whitespace\" in some viewers."] isKindOfClass:NSString.class]) return nil;
973+ if (![dict[@"<script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
974+ if (![dict[@"123"] isKindOfClass:NSString.class]) return nil;
975+ if (![dict[@"# This file unfortunately cannot express strings containing"] isKindOfClass:NSString.class]) return nil;
976+ if (![dict[@"$(touch /tmp/blns.fail)"] isKindOfClass:NSString.class]) return nil;
977+ if (![dict[@"() { _; } >_[$($())] { touch /tmp/blns.shellshock2.fail; }"] isKindOfClass:NSString.class]) return nil;
978+ if (![dict[@"Tyson Gay"] isKindOfClass:NSString.class]) return nil;
979+ if (![dict[@"#\tUnicode Symbols"] isKindOfClass:NSString.class]) return nil;
980+ if (![dict[@"'`\"><\\x00script>javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
981+ if (![dict[@"'`\"><\\x3Cscript>javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
982+ if (![dict[@"åß∂ƒ©˙∆˚¬…æ"] isKindOfClass:NSString.class]) return nil;
983+ if (![dict[@"˙ɐnbᴉlɐ ɐuƃɐɯ ǝɹolop ʇǝ ǝɹoqɐl ʇn ʇunpᴉpᴉɔuᴉ ɹodɯǝʇ poɯsnᴉǝ op pǝs 'ʇᴉlǝ ƃuᴉɔsᴉdᴉpɐ ɹnʇǝʇɔǝsuoɔ 'ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥"] isKindOfClass:NSString.class]) return nil;
984+ if (![dict[@"Ω≈ç√∫˜µ≤≥÷"] isKindOfClass:NSString.class]) return nil;
985+ if (![dict[@"ヽ༼ຈل͜ຈ༽ノ ヽ༼ຈل͜ຈ༽ノ"] isKindOfClass:NSString.class]) return nil;
986+ if (![dict[@"Ṱ̺̺̕o͞ ̷i̲̬͇̪͙n̝̗͕v̟̜̘̦͟o̶̙̰̠kè͚̮̺̪̹̱̤ ̖t̝͕̳̣̻̪͞h̼͓̲̦̳̘̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ͏͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣"] isKindOfClass:NSString.class]) return nil;
987+ if (![dict[@"社會科學院語學研究所"] isKindOfClass:NSString.class]) return nil;
988+ if (![dict[@"部落格"] isKindOfClass:NSString.class]) return nil;
989+ if (![dict[@"사회과학원 어학연구소"] isKindOfClass:NSString.class]) return nil;
990+ if (![dict[@"찦차를 타고 온 펲시맨과 쑛다리 똠방각하"] isKindOfClass:NSString.class]) return nil;
991+ if (![dict[@"ﷺ"] isKindOfClass:NSString.class]) return nil;
992+ if (![dict[@"__ロ(,_,*)"] isKindOfClass:NSString.class]) return nil;
993+ [self setValuesForKeysWithDictionary:dict];
994+ }
995+ return self;
996+}
997+
998+- (void)setValue:(nullable id)value forKey:(NSString *)key
999+{
1000+ id resolved = QTB.properties[key];
1001+ if (resolved) [super setValue:value forKey:resolved];
1002+}
1003+
1004+- (void)setNilValueForKey:(NSString *)key
1005+{
1006+ id resolved = QTB.properties[key];
1007+ if (resolved) [super setValue:@(0) forKey:resolved];
1008+}
1009+
1010+- (NSDictionary *)JSONDictionary
1011+{
1012+ id dict = [[self dictionaryWithValuesForKeys:QTB.properties.allValues] mutableCopy];
1013+
1014+ for (id jsonName in QTB.properties) {
1015+ id propertyName = QTB.properties[jsonName];
1016+ if (![jsonName isEqualToString:propertyName]) {
1017+ dict[jsonName] = dict[propertyName];
1018+ [dict removeObjectForKey:propertyName];
1019+ }
1020+ }
1021+
1022+ [dict addEntriesFromDictionary:@{
1023+ @"dontMakeAMap": _isDontMakeAMap ? @YES : @NO,
1024+ }];
1025+
1026+ return dict;
1027+}
1028+@end
1029+
1030+@implementation QTC
1031++ (NSDictionary<NSString *, NSString *> *)properties
1032+{
1033+ static NSDictionary<NSString *, NSString *> *properties;
1034+ return properties = properties ? properties : @{
1035+ @"\U0002070e\U00020731\U00020779\U00020c53\U00020c78\U00020c96\U00020ccf": @"_1",
1036+ @"A:": @"a",
1037+ @"<a href=\"\\x00javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX00JavascriptJavascriptAlert1IDFuzzelement1TestA",
1038+ @"<a href=\"\\x03javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX03JavascriptJavascriptAlert1IDFuzzelement1TestA",
1039+ @"<a href=\"\\x06javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX06JavascriptJavascriptAlert1IDFuzzelement1TestA",
1040+ @"<a href=\"\\x07javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX07JavascriptJavascriptAlert1IDFuzzelement1TestA",
1041+ @"<a href=\"\\x0Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX0BjavascriptJavascriptAlert1IDFuzzelement1TestA",
1042+ @"<a href=\"\\x12javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX12JavascriptJavascriptAlert1IDFuzzelement1TestA",
1043+ @"<a href=\"\\x14javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX14JavascriptJavascriptAlert1IDFuzzelement1TestA",
1044+ @"<a href=\"\\x15javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX15JavascriptJavascriptAlert1IDFuzzelement1TestA",
1045+ @"<a href=\"\\x18javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX18JavascriptJavascriptAlert1IDFuzzelement1TestA",
1046+ @"<a href=\"\\x1Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX1BjavascriptJavascriptAlert1IDFuzzelement1TestA",
1047+ @"<a href=\"\\x1Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX1CjavascriptJavascriptAlert1IDFuzzelement1TestA",
1048+ @"<a href=\"\\x20javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefX20JavascriptJavascriptAlert1IDFuzzelement1TestA",
1049+ @"<a href=\"\\xE2\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X80JavascriptJavascriptAlert1IDFuzzelement1TestA",
1050+ @"<a href=\"\\xE2\\x80\\x85javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X85JavascriptJavascriptAlert1IDFuzzelement1TestA",
1051+ @"<a href=\"\\xE2\\x80\\x88javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X88JavascriptJavascriptAlert1IDFuzzelement1TestA",
1052+ @"<a href=\"\\xE2\\x80\\x89javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X89JavascriptJavascriptAlert1IDFuzzelement1TestA",
1053+ @"<a href=\"\\xE2\\x80\\x8Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X80X8AjavascriptJavascriptAlert1IDFuzzelement1TestA",
1054+ @"<a href=\"\\xE2\\x81\\x9Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE2X81X9FjavascriptJavascriptAlert1IDFuzzelement1TestA",
1055+ @"<a href=\"\\xE3\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>": @"aHrefXE3X80X80JavascriptJavascriptAlert1IDFuzzelement1TestA",
1056+ @"ABC<div style=\"x:expression\\x00(javascript:alert(1)\">DEF": @"abcDivStyleXExpressionX00JavascriptAlert1DEF",
1057+ @"ABC<div style=\"x:\\x00expression(javascript:alert(1)\">DEF": @"abcDivStyleXX00ExpressionJavascriptAlert1DEF",
1058+ @"ABC<div style=\"x:\\x0Cexpression(javascript:alert(1)\">DEF": @"abcDivStyleXX0CexpressionJavascriptAlert1DEF",
1059+ @"ABC<div style=\"x:\\xE2\\x80\\x81expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X81ExpressionJavascriptAlert1DEF",
1060+ @"ABC<div style=\"x:\\xE2\\x80\\x86expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X86ExpressionJavascriptAlert1DEF",
1061+ @"ABC<div style=\"x:\\xE2\\x80\\x88expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE2X80X88ExpressionJavascriptAlert1DEF",
1062+ @"ABC<div style=\"x:\\xE3\\x80\\x80expression(javascript:alert(1)\">DEF": @"abcDivStyleXXE3X80X80ExpressionJavascriptAlert1DEF",
1063+ @"ABC<div style=\"x:\\xEF\\xBB\\xBFexpression(javascript:alert(1)\">DEF": @"abcDivStyleXXEFXBBXBFexpressionJavascriptAlert1DEF",
1064+ @"# and U+007F (DEL)": @"andU007FDEL",
1065+ @"-": @"another",
1066+ @"# ASCII punctuation. All of these characters may need to be escaped in some": @"asciiPunctuationAllOfTheseCharactersMayNeedToBeEscapedInSome",
1067+ @"<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert(\"XSS\")>": @"bodyOnloadAlertXSS",
1068+ @"\"'\"'\"''''\"": @"c",
1069+ @"-0.0": @"c00",
1070+ @"0.0/0": @"c000",
1071+ @"--1": @"c1",
1072+ @"-1.00": @"c100",
1073+ @"1,000.00": @"c100000",
1074+ @"1,000,000.00": @"c100000000",
1075+ @"1E+02": @"c1E02",
1076+ @"><script>alert(123)</script>": @"cScriptAlert123Script",
1077+ @"true": @"cTrue",
1078+ @"CLOCK$": @"clock",
1079+ @"COM2": @"com2",
1080+ @"COM4": @"com4",
1081+ @"Craig Cockburn, Software Specialist": @"craigCockburnSoftwareSpecialist",
1082+ @"DCC SEND STARTKEYLOGGER 0 0 0": @"dccSendStartkeylogger000",
1083+ @"#\tEmoji": @"emoji",
1084+ @"\"\"": @"empty",
1085+ @"evaluate": @"evaluate",
1086+ @"<foo val=“bar” />": @"fooValBar",
1087+ @"hasOwnProperty": @"hasOwnProperty",
1088+ @"Horniman Museum": @"hornimanMuseum",
1089+ @"http://www.cum.qc.ca/": @"httpWWWCumQcCA",
1090+ @"<i onwheel=alert(1)> Scroll over me </i>": @"iOnwheelAlert1ScrollOverMeI",
1091+ @"<img[a][b][c]src[d]=x[e]onerror=[f]\"alert(1)\">": @"imgABCSrcDXEOnerrorFAlert1",
1092+ @"<IMG onmouseover=\"alert('xxs')\">": @"imgOnmouseoverAlertXxs",
1093+ @"<IMG \"\"\"><SCRIPT>alert(\"XSS\")</SCRIPT>\">": @"imgSCRIPTAlertXSSSCRIPT",
1094+ @"<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>": @"imgSRCJavascriptAlertStringFromCharCode888383",
1095+ @"<IMG SRC=\"javascript:alert('XSS')\"": @"imgSRCJavascriptAlertXSS",
1096+ @"<img src onerror /\" '\"= alt=javascript:alert(1)//\">": @"imgSrcOnerrorAltJavascriptAlert1",
1097+ @"<img src\\x10=x onerror=\"javascript:alert(1)\">": @"imgSrcX10XOnerrorJavascriptAlert1",
1098+ @"<img src\\x12=x onerror=\"javascript:alert(1)\">": @"imgSrcX12XOnerrorJavascriptAlert1",
1099+ @"<img src\\x13=x onerror=\"javascript:alert(1)\">": @"imgSrcX13XOnerrorJavascriptAlert1",
1100+ @"<img src\\x32=x onerror=\"javascript:alert(1)\">": @"imgSrcX32XOnerrorJavascriptAlert1",
1101+ @"<img src\\x47=x onerror=\"javascript:alert(1)\">": @"imgSrcX47XOnerrorJavascriptAlert1",
1102+ @"<img src=x onerror=alert(123) />": @"imgSrcXOnerrorAlert123",
1103+ @"<img src=x onerror=\\x10\"javascript:alert(1)\">": @"imgSrcXOnerrorX10JavascriptAlert1",
1104+ @"<img src=x onerror=\\x32\"javascript:alert(1)\">": @"imgSrcXOnerrorX32JavascriptAlert1",
1105+ @"<img src=\"x` `<script>javascript:alert(1)</script>\"` `>": @"imgSrcXScriptJavascriptAlert1Script",
1106+ @"`\"'><img src=xxx:x \\x09onerror=javascript:alert(1)>": @"imgSrcXxxXX09OnerrorJavascriptAlert1",
1107+ @"`\"'><img src=xxx:x \\x20onerror=javascript:alert(1)>": @"imgSrcXxxXX20OnerrorJavascriptAlert1",
1108+ @"`\"'><img src=xxx:x \\x22onerror=javascript:alert(1)>": @"imgSrcXxxXX22OnerrorJavascriptAlert1",
1109+ @"`\"'><img src=xxx:x \\x27onerror=javascript:alert(1)>": @"imgSrcXxxXX27OnerrorJavascriptAlert1",
1110+ @"<img\\x11src=x onerror=\"javascript:alert(1)\">": @"imgX11SrcXOnerrorJavascriptAlert1",
1111+ @"<img \\x34src=x onerror=\"javascript:alert(1)\">": @"imgX34SrcXOnerrorJavascriptAlert1",
1112+ @"<img\\x47src=x onerror=\"javascript:alert(1)\">": @"imgX47SrcXOnerrorJavascriptAlert1",
1113+ @"Infinity": @"infinity",
1114+ @"dontMakeAMap": @"isDontMakeAMap",
1115+ @"JavaSCript:alert(123)": @"javaSCriptAlert123",
1116+ @"LPT1": @"lpt1",
1117+ @"&lt;script&gt;alert(&#39;123&#39;);&lt;/script&gt;": @"ltScriptGtAlert3912339LtScriptGt",
1118+ @"magna cum laude": @"magnaCumLaude",
1119+ @"medieval erection of parapets": @"medievalErectionOfParapets",
1120+ @"mocha": @"mocha",
1121+ @"NaN": @"naN",
1122+ @"# Non-whitespace C0 controls: U+0001 through U+0008, U+000E through U+001F,": @"nonWhitespaceC0ControlsU0001ThroughU0008U000EThroughU001F",
1123+ @"NULL": @"null",
1124+ @"%": @"one",
1125+ @"0,,0": @"one00",
1126+ @"1.000,00": @"one100000",
1127+ @"1.000.000,00": @"one100000000",
1128+ @"' onfocus=JaVaSCript:alert(123) autofocus": @"onfocusJaVaSCriptAlert123Autofocus",
1129+ @"# or reused for internal delimiters on the theory that they should never": @"orReusedForInternalDelimitersOnTheTheoryThatTheyShouldNever",
1130+ @"<plaintext>": @"plaintext",
1131+ @"Powerلُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ冗": @"powerلُلُصّبُلُلصّبُررًॣॣH冗",
1132+ @"#\tRight-To-Left Strings": @"rightToLeftStrings",
1133+ @"Roses are \033[0;31mred\033[0m, violets are \033[0;34mblue. Hope you enjoy terminal hue": @"rosesAre031Mred0MVioletsAre034MblueHopeYouEnjoyTerminalHue",
1134+ @"%*.*s": @"s",
1135+ @"'><script>alert(123)</script>": @"scriptAlert123Script",
1136+ @"'><script>alert(123);</script x='": @"scriptAlert123ScriptX",
1137+ @"\"`'><script>-javascript:alert(1)</script>": @"scriptJavascriptAlert1Script",
1138+ @"< / script >< script >alert(123)< / script >": @"scriptScriptAlert123Script",
1139+ @"<script src=\"/\\%(jscript)s\"></script>": @"scriptSrcJscriptSScript",
1140+ @"\"`'><script>\\x0Ajavascript:alert(1)</script>": @"scriptX0AjavascriptAlert1Script",
1141+ @"\"`'><script>\\x0Bjavascript:alert(1)</script>": @"scriptX0BjavascriptAlert1Script",
1142+ @"<script\\x0Ctype=\"text/javascript\">javascript:alert(1);</script>": @"scriptX0CtypeTextJavascriptJavascriptAlert1Script",
1143+ @"\"`'><script>\\x20javascript:alert(1)</script>": @"scriptX20JavascriptAlert1Script",
1144+ @"\"`'><script>\\x2Bjavascript:alert(1)</script>": @"scriptX2BjavascriptAlert1Script",
1145+ @"<script\\x2Ftype=\"text/javascript\">javascript:alert(1);</script>": @"scriptX2FtypeTextJavascriptJavascriptAlert1Script",
1146+ @"\"`'><script>\\x7Ejavascript:alert(1)</script>": @"scriptX7EjavascriptAlert1Script",
1147+ @"\"`'><script>\\xE2\\x80\\x80javascript:alert(1)</script>": @"scriptXE2X80X80JavascriptAlert1Script",
1148+ @"\"`'><script>\\xE2\\x80\\x82javascript:alert(1)</script>": @"scriptXE2X80X82JavascriptAlert1Script",
1149+ @"\"`'><script>\\xE2\\x80\\x83javascript:alert(1)</script>": @"scriptXE2X80X83JavascriptAlert1Script",
1150+ @"\"`'><script>\\xE2\\x80\\x84javascript:alert(1)</script>": @"scriptXE2X80X84JavascriptAlert1Script",
1151+ @"\"`'><script>\\xE2\\x80\\x88javascript:alert(1)</script>": @"scriptXE2X80X88JavascriptAlert1Script",
1152+ @"\"`'><script>\\xE2\\x80\\x8Bjavascript:alert(1)</script>": @"scriptXE2X80X8BjavascriptAlert1Script",
1153+ @"\"`'><script>\\xEF\\xBF\\xAEjavascript:alert(1)</script>": @"scriptXEFXBFXAEjavascriptAlert1Script",
1154+ @"\"`'><script>\\xEF\\xBF\\xBEjavascript:alert(1)</script>": @"scriptXEFXBFXBEjavascriptAlert1Script",
1155+ @"Scunthorpe General Hospital": @"scunthorpeGeneralHospital",
1156+ @"#\tServer Code Injection": @"serverCodeInjection",
1157+ @"shitake mushrooms": @"shitakeMushrooms",
1158+ @"''": @"some",
1159+ @"0/0": @"some00",
1160+ @"#\tSpecial Characters": @"specialCharacters",
1161+ @"src=JaVaSCript:prompt(132)": @"srcJaVaSCriptPrompt132",
1162+ @"#\tStrings which can be interpreted as numeric": @"stringsWhichCanBeInterpretedAsNumeric",
1163+ @"#\tStrings which can cause a SQL injection if inputs are not sanitized": @"stringsWhichCanCauseASQLInjectionIfInputsAreNotSanitized",
1164+ @"#\tStrings which can cause user to pull in files that should not be a part of a web server": @"stringsWhichCanCauseUserToPullInFilesThatShouldNotBeAPartOfAWebServer",
1165+ @"#\tStrings which can cause user to run code on server as a privileged user (c.f. https://news.ycombinator.com/item?id=7665153)": @"stringsWhichCanCauseUserToRunCodeOnServerAsAPrivilegedUserCFHTTPSNewsYcombinatorCOMItemID7665153",
1166+ @"#\tStrings which contain \"corrupted\" text. The corruption will not appear in non-HTML text, however. (via http://www.eeemo.net)": @"stringsWhichContainCorruptedTextTheCorruptionWillNotAppearInNonHTMLTextHoweverViaHTTPWWWEeemoNet",
1167+ @"#\tStrings which contain unicode with an \"upsidedown\" effect (via http://www.upsidedowntext.com)": @"stringsWhichContainUnicodeWithAnUpsidedownEffectViaHTTPWWWUpsidedowntextCOM",
1168+ @"#\tStrings which contain unicode with unusual properties (e.g. Right-to-left override) (c.f. http://www.unicode.org/charts/PDF/U2000.pdf)": @"stringsWhichContainUnicodeWithUnusualPropertiesEGRightToLeftOverrideCFHTTPWWWUnicodeOrgChartsPDFU2000PDF",
1169+ @"#\tStrings which punish the fools who use cat/type on this file": @"stringsWhichPunishTheFoolsWhoUseCatTypeOnThisFile",
1170+ @"<svg><script>123<1>alert(123)</script>": @"svgScript1231Alert123Script",
1171+ @"System(\"ls -al /\")": @"systemLsAl",
1172+ @"@{[system \"touch /tmp/blns.fail\"]}": @"systemTouchTmpBlnsFail",
1173+ @"\u2029test\u2029": @"test",
1174+ @"test\u2060test\u202b": @"testTest",
1175+ @"\"''''\"'\"": @"the",
1176+ @"+0.0": @"the00",
1177+ @"0.0.0": @"the000",
1178+ @"() { 0; }; touch /tmp/blns.shellshock1.fail;": @"the0TouchTmpBlnsShellshock1Fail",
1179+ @"0xabad1dea": @"the0Xabad1Dea",
1180+ @"0xffffffff": @"the0Xffffffff",
1181+ @"\U0001f3f30\U0001f308️": @"the0️",
1182+ @"0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ \U0001f51f": @"the0️1️2️3️4️5️6️7️8️9️",
1183+ @"--": @"the1",
1184+ @"\U0001d683\U0001d691\U0001d68e \U0001d69a\U0001d69e\U0001d692\U0001d68c\U0001d694 \U0001d68b\U0001d69b\U0001d698\U0001d6a0\U0001d697 \U0001d68f\U0001d698\U0001d6a1 \U0001d693\U0001d69e\U0001d696\U0001d699\U0001d69c \U0001d698\U0001d69f\U0001d68e\U0001d69b \U0001d69d\U0001d691\U0001d68e \U0001d695\U0001d68a\U0001d6a3\U0001d6a2 \U0001d68d\U0001d698\U0001d690": @"the10",
1185+ @"-$1.00": @"the100",
1186+ @"1 000,00": @"the100000",
1187+ @"1'000'000,00": @"the100000000",
1188+ @"\U0001f435 \U0001f648 \U0001f649 \U0001f64a": @"the11",
1189+ @"-1/2": @"the12",
1190+ @"\U0001f47e \U0001f647 \U0001f481 \U0001f645 \U0001f646 \U0001f64b \U0001f64e \U0001f64d": @"the13",
1191+ @"-1E+02": @"the1E02",
1192+ @"-1E2": @"the1E2",
1193+ @"-1#IND": @"the1Ind",
1194+ @".": @"the2",
1195+ @"\\\\": @"the3",
1196+ @"_": @"the4",
1197+ @"⁰⁴⁵": @"the5",
1198+ @"⅛⅜⅝⅞": @"the6",
1199+ @"✋\U0001f3ff \U0001f4aa\U0001f3ff \U0001f450\U0001f3ff \U0001f64c\U0001f3ff \U0001f44f\U0001f3ff \U0001f64f\U0001f3ff": @"the7",
1200+ @"・( ̄∀ ̄)・:*:": @"the8",
1201+ @"\U0001d413\U0001d421\U0001d41e \U0001d42a\U0001d42e\U0001d422\U0001d41c\U0001d424 \U0001d41b\U0001d42b\U0001d428\U0001d430\U0001d427 \U0001d41f\U0001d428\U0001d431 \U0001d423\U0001d42e\U0001d426\U0001d429\U0001d42c \U0001d428\U0001d42f\U0001d41e\U0001d42b \U0001d42d\U0001d421\U0001d41e \U0001d425\U0001d41a\U0001d433\U0001d432 \U0001d41d\U0001d428\U0001d420": @"the9",
1202+ @"-9223372036854775808/-1": @"the92233720368547758081",
1203+ @"<script>alert(123)</script>": @"theScriptAlert123Script",
1204+ @"١٢٣": @"the١٢٣",
1205+ @"<title onpropertychange=javascript:alert(1)></title><title title=>": @"titleOnpropertychangeJavascriptAlert1TitleTitleTitle",
1206+ @"# treated as whitespace in some contexts.": @"treatedAsWhitespaceInSomeContexts",
1207+ @"#\tTrick Unicode": @"trickUnicode",
1208+ @"undefined": @"undefined",
1209+ @"# Unicode additional control characters: all of the characters with": @"unicodeAdditionalControlCharactersAllOfTheCharactersWith",
1210+ @"#\tUnicode Subscript/Superscript/Accents": @"unicodeSubscriptSuperscriptAccents",
1211+ @"#\tUnicode Upsidedown": @"unicodeUpsidedown",
1212+ @"$USER": @"user",
1213+ @"--version": @"version",
1214+ @"# version 8.0.0), plus U+0009 (HT), U+000B (VT), U+000C (FF), U+0085 (NEL),": @"version800PlusU0009HTU000BVTU000CFFU0085NEL",
1215+ @"# Whitespace: all of the characters with category Zs, Zl, or Zp (in Unicode": @"whitespaceAllOfTheCharactersWithCategoryZsZlOrZpInUnicode",
1216+ @"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><!DOCTYPE foo [ <!ELEMENT foo ANY ><!ENTITY xxe SYSTEM \"file:///etc/passwd\" >]><foo>&xxe;</foo>": @"xmlVersion10EncodingISO88591DOCTYPEFooELEMENTFooANYENTITYXxeSYSTEMFileEtcPasswdFooXxeFoo",
1217+ @"# XXE Injection (XML)": @"xxeInjectionXML",
1218+ @"#\tZalgo Text": @"zalgoText",
1219+ @"ZZ:": @"zz",
1220+ @"ÅÍÎÏ˝ÓÔ\uf8ffÒÚÆ☃": @"åíîïÓôÒúæ",
1221+ @",。・:*:・゜’( ☻ ω ☻ )。・:*:・゜’": @"ω",
1222+ @"ЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя": @"ёђѓєѕіїјљњћќѝўџабвгдежзийклмнопрстуфхцчшщъыьэюЯабвгдежзийклмнопрстуфхцчшщъыьэюя",
1223+ @"בְּרֵאשִׁית, בָּרָא אֱלֹהִים, אֵת הַשָּׁמַיִם, וְאֵת הָאָרֶץ": @"בְּרֵאשִׁיתבָּרָאאֱלֹהִיםאֵתהַשָּׁמַיִםוְאֵתהָאָרֶץ",
1224+ @"مُنَاقَشَةُ سُبُلِ اِسْتِخْدَامِ اللُّغَةِ فِي النُّظُمِ الْقَائِمَةِ وَفِيم يَخُصَّ التَّطْبِيقَاتُ الْحاسُوبِيَّةُ، ": @"مُنَاقَشَةُسُبُلِاِسْتِخْدَامِاللُّغَةِفِيالنُّظُمِالْقَائِمَةِوَفِيميَخُصَّالتَّطْبِيقَاتُالْحاسُوبِيَّةُ",
1225+ @"̗̺͖̹̯͓Ṯ̤͍̥͇͈h̲́e͏͓̼̗̙̼̣͔ ͇̜̱̠͓͍ͅN͕͠e̗̱z̘̝̜̺͙p̤̺̹͍̯͚e̠̻̠͜r̨̤͍̺̖͔̖̖d̠̟̭̬̝͟i̦͖̩͓͔̤a̠̗̬͉̙n͚͜ ̻̞̰͚ͅh̵͉i̳̞v̢͇ḙ͎͟-҉̭̩̼͔m̤̭̫i͕͇̝̦n̗͙ḍ̟ ̯̲͕͞ǫ̟̯̰̲͙̻̝f ̪̰̰̗̖̭̘͘c̦͍̲̞͍̩̙ḥ͚a̮͎̟̙͜ơ̩̹͎s̤.̝̝ ҉Z̡̖̜͖̰̣͉̜a͖̰͙̬͡l̲̫̳͍̩g̡̟̼̱͚̞̬ͅo̗͜.̟": @"ṯHENEZPERDIANHIVḘMINḌǪFCḤAƠSZALGO",
1226+ @"┬─┬ノ( º _ ºノ)": @"ノº_ºノ",
1227+ @"울란바토르": @"울란바토르",
1228+ @"The quick brown fox jumps over the lazy dog": @"theQuickBrownFoxJumpsOverTheLazyDog",
1229+ @"(ノಥ益ಥ)ノ\ufeff ┻━┻": @"ノಥ益ಥノ",
1230+ };
1231+}
1232+
1233++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
1234+{
1235+ return [dict isKindOfClass:NSDictionary.class] ? [[QTC alloc] initWithJSONDictionary:dict] : nil;
1236+}
1237+
1238+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1239+{
1240+ if (self = [super init]) {
1241+ if (![dict[@"\U0002070e\U00020731\U00020779\U00020c53\U00020c78\U00020c96\U00020ccf"] isKindOfClass:NSString.class]) return nil;
1242+ if (![dict[@"A:"] isKindOfClass:NSString.class]) return nil;
1243+ if (![dict[@"<a href=\"\\x00javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1244+ if (![dict[@"<a href=\"\\x03javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1245+ if (![dict[@"<a href=\"\\x06javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1246+ if (![dict[@"<a href=\"\\x07javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1247+ if (![dict[@"<a href=\"\\x0Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1248+ if (![dict[@"<a href=\"\\x12javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1249+ if (![dict[@"<a href=\"\\x14javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1250+ if (![dict[@"<a href=\"\\x15javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1251+ if (![dict[@"<a href=\"\\x18javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1252+ if (![dict[@"<a href=\"\\x1Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1253+ if (![dict[@"<a href=\"\\x1Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1254+ if (![dict[@"<a href=\"\\x20javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1255+ if (![dict[@"<a href=\"\\xE2\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1256+ if (![dict[@"<a href=\"\\xE2\\x80\\x85javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1257+ if (![dict[@"<a href=\"\\xE2\\x80\\x88javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1258+ if (![dict[@"<a href=\"\\xE2\\x80\\x89javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1259+ if (![dict[@"<a href=\"\\xE2\\x80\\x8Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1260+ if (![dict[@"<a href=\"\\xE2\\x81\\x9Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1261+ if (![dict[@"<a href=\"\\xE3\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>"] isKindOfClass:NSString.class]) return nil;
1262+ if (![dict[@"ABC<div style=\"x:expression\\x00(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1263+ if (![dict[@"ABC<div style=\"x:\\x00expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1264+ if (![dict[@"ABC<div style=\"x:\\x0Cexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1265+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x81expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1266+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x86expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1267+ if (![dict[@"ABC<div style=\"x:\\xE2\\x80\\x88expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1268+ if (![dict[@"ABC<div style=\"x:\\xE3\\x80\\x80expression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1269+ if (![dict[@"ABC<div style=\"x:\\xEF\\xBB\\xBFexpression(javascript:alert(1)\">DEF"] isKindOfClass:NSString.class]) return nil;
1270+ if (![dict[@"# and U+007F (DEL)"] isKindOfClass:NSString.class]) return nil;
1271+ if (![dict[@"-"] isKindOfClass:NSString.class]) return nil;
1272+ if (![dict[@"# ASCII punctuation. All of these characters may need to be escaped in some"] isKindOfClass:NSString.class]) return nil;
1273+ if (![dict[@"<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert(\"XSS\")>"] isKindOfClass:NSString.class]) return nil;
1274+ if (![dict[@"\"'\"'\"''''\""] isKindOfClass:NSString.class]) return nil;
1275+ if (![dict[@"-0.0"] isKindOfClass:NSString.class]) return nil;
1276+ if (![dict[@"0.0/0"] isKindOfClass:NSString.class]) return nil;
1277+ if (![dict[@"--1"] isKindOfClass:NSString.class]) return nil;
1278+ if (![dict[@"-1.00"] isKindOfClass:NSString.class]) return nil;
1279+ if (![dict[@"1,000.00"] isKindOfClass:NSString.class]) return nil;
1280+ if (![dict[@"1,000,000.00"] isKindOfClass:NSString.class]) return nil;
1281+ if (![dict[@"1E+02"] isKindOfClass:NSString.class]) return nil;
1282+ if (![dict[@"><script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
1283+ if (![dict[@"true"] isKindOfClass:NSString.class]) return nil;
1284+ if (![dict[@"CLOCK$"] isKindOfClass:NSString.class]) return nil;
1285+ if (![dict[@"COM2"] isKindOfClass:NSString.class]) return nil;
1286+ if (![dict[@"COM4"] isKindOfClass:NSString.class]) return nil;
1287+ if (![dict[@"Craig Cockburn, Software Specialist"] isKindOfClass:NSString.class]) return nil;
1288+ if (![dict[@"DCC SEND STARTKEYLOGGER 0 0 0"] isKindOfClass:NSString.class]) return nil;
1289+ if (![dict[@"#\tEmoji"] isKindOfClass:NSString.class]) return nil;
1290+ if (![dict[@"\"\""] isKindOfClass:NSString.class]) return nil;
1291+ if (![dict[@"evaluate"] isKindOfClass:NSString.class]) return nil;
1292+ if (![dict[@"<foo val=“bar” />"] isKindOfClass:NSString.class]) return nil;
1293+ if (![dict[@"hasOwnProperty"] isKindOfClass:NSString.class]) return nil;
1294+ if (![dict[@"Horniman Museum"] isKindOfClass:NSString.class]) return nil;
1295+ if (![dict[@"http://www.cum.qc.ca/"] isKindOfClass:NSString.class]) return nil;
1296+ if (![dict[@"<i onwheel=alert(1)> Scroll over me </i>"] isKindOfClass:NSString.class]) return nil;
1297+ if (![dict[@"<img[a][b][c]src[d]=x[e]onerror=[f]\"alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1298+ if (![dict[@"<IMG onmouseover=\"alert('xxs')\">"] isKindOfClass:NSString.class]) return nil;
1299+ if (![dict[@"<IMG \"\"\"><SCRIPT>alert(\"XSS\")</SCRIPT>\">"] isKindOfClass:NSString.class]) return nil;
1300+ if (![dict[@"<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>"] isKindOfClass:NSString.class]) return nil;
1301+ if (![dict[@"<IMG SRC=\"javascript:alert('XSS')\""] isKindOfClass:NSString.class]) return nil;
1302+ if (![dict[@"<img src onerror /\" '\"= alt=javascript:alert(1)//\">"] isKindOfClass:NSString.class]) return nil;
1303+ if (![dict[@"<img src\\x10=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1304+ if (![dict[@"<img src\\x12=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1305+ if (![dict[@"<img src\\x13=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1306+ if (![dict[@"<img src\\x32=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1307+ if (![dict[@"<img src\\x47=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1308+ if (![dict[@"<img src=x onerror=alert(123) />"] isKindOfClass:NSString.class]) return nil;
1309+ if (![dict[@"<img src=x onerror=\\x10\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1310+ if (![dict[@"<img src=x onerror=\\x32\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1311+ if (![dict[@"<img src=\"x` `<script>javascript:alert(1)</script>\"` `>"] isKindOfClass:NSString.class]) return nil;
1312+ if (![dict[@"`\"'><img src=xxx:x \\x09onerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
1313+ if (![dict[@"`\"'><img src=xxx:x \\x20onerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
1314+ if (![dict[@"`\"'><img src=xxx:x \\x22onerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
1315+ if (![dict[@"`\"'><img src=xxx:x \\x27onerror=javascript:alert(1)>"] isKindOfClass:NSString.class]) return nil;
1316+ if (![dict[@"<img\\x11src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1317+ if (![dict[@"<img \\x34src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1318+ if (![dict[@"<img\\x47src=x onerror=\"javascript:alert(1)\">"] isKindOfClass:NSString.class]) return nil;
1319+ if (![dict[@"Infinity"] isKindOfClass:NSString.class]) return nil;
1320+ if (![dict[@"dontMakeAMap"] isKindOfClass:NSNumber.class]) return nil;
1321+ if (![dict[@"JavaSCript:alert(123)"] isKindOfClass:NSString.class]) return nil;
1322+ if (![dict[@"LPT1"] isKindOfClass:NSString.class]) return nil;
1323+ if (![dict[@"&lt;script&gt;alert(&#39;123&#39;);&lt;/script&gt;"] isKindOfClass:NSString.class]) return nil;
1324+ if (![dict[@"magna cum laude"] isKindOfClass:NSString.class]) return nil;
1325+ if (![dict[@"medieval erection of parapets"] isKindOfClass:NSString.class]) return nil;
1326+ if (![dict[@"mocha"] isKindOfClass:NSString.class]) return nil;
1327+ if (![dict[@"NaN"] isKindOfClass:NSString.class]) return nil;
1328+ if (![dict[@"# Non-whitespace C0 controls: U+0001 through U+0008, U+000E through U+001F,"] isKindOfClass:NSString.class]) return nil;
1329+ if (![dict[@"NULL"] isKindOfClass:NSString.class]) return nil;
1330+ if (![dict[@"%"] isKindOfClass:NSString.class]) return nil;
1331+ if (![dict[@"0,,0"] isKindOfClass:NSString.class]) return nil;
1332+ if (![dict[@"1.000,00"] isKindOfClass:NSString.class]) return nil;
1333+ if (![dict[@"1.000.000,00"] isKindOfClass:NSString.class]) return nil;
1334+ if (![dict[@"' onfocus=JaVaSCript:alert(123) autofocus"] isKindOfClass:NSString.class]) return nil;
1335+ if (![dict[@"# or reused for internal delimiters on the theory that they should never"] isKindOfClass:NSString.class]) return nil;
1336+ if (![dict[@"<plaintext>"] isKindOfClass:NSString.class]) return nil;
1337+ if (![dict[@"Powerلُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ冗"] isKindOfClass:NSString.class]) return nil;
1338+ if (![dict[@"#\tRight-To-Left Strings"] isKindOfClass:NSString.class]) return nil;
1339+ if (![dict[@"Roses are \033[0;31mred\033[0m, violets are \033[0;34mblue. Hope you enjoy terminal hue"] isKindOfClass:NSString.class]) return nil;
1340+ if (![dict[@"%*.*s"] isKindOfClass:NSString.class]) return nil;
1341+ if (![dict[@"'><script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
1342+ if (![dict[@"'><script>alert(123);</script x='"] isKindOfClass:NSString.class]) return nil;
1343+ if (![dict[@"\"`'><script>-javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1344+ if (![dict[@"< / script >< script >alert(123)< / script >"] isKindOfClass:NSString.class]) return nil;
1345+ if (![dict[@"<script src=\"/\\%(jscript)s\"></script>"] isKindOfClass:NSString.class]) return nil;
1346+ if (![dict[@"\"`'><script>\\x0Ajavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1347+ if (![dict[@"\"`'><script>\\x0Bjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1348+ if (![dict[@"<script\\x0Ctype=\"text/javascript\">javascript:alert(1);</script>"] isKindOfClass:NSString.class]) return nil;
1349+ if (![dict[@"\"`'><script>\\x20javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1350+ if (![dict[@"\"`'><script>\\x2Bjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1351+ if (![dict[@"<script\\x2Ftype=\"text/javascript\">javascript:alert(1);</script>"] isKindOfClass:NSString.class]) return nil;
1352+ if (![dict[@"\"`'><script>\\x7Ejavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1353+ if (![dict[@"\"`'><script>\\xE2\\x80\\x80javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1354+ if (![dict[@"\"`'><script>\\xE2\\x80\\x82javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1355+ if (![dict[@"\"`'><script>\\xE2\\x80\\x83javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1356+ if (![dict[@"\"`'><script>\\xE2\\x80\\x84javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1357+ if (![dict[@"\"`'><script>\\xE2\\x80\\x88javascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1358+ if (![dict[@"\"`'><script>\\xE2\\x80\\x8Bjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1359+ if (![dict[@"\"`'><script>\\xEF\\xBF\\xAEjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1360+ if (![dict[@"\"`'><script>\\xEF\\xBF\\xBEjavascript:alert(1)</script>"] isKindOfClass:NSString.class]) return nil;
1361+ if (![dict[@"Scunthorpe General Hospital"] isKindOfClass:NSString.class]) return nil;
1362+ if (![dict[@"#\tServer Code Injection"] isKindOfClass:NSString.class]) return nil;
1363+ if (![dict[@"shitake mushrooms"] isKindOfClass:NSString.class]) return nil;
1364+ if (![dict[@"''"] isKindOfClass:NSString.class]) return nil;
1365+ if (![dict[@"0/0"] isKindOfClass:NSString.class]) return nil;
1366+ if (![dict[@"#\tSpecial Characters"] isKindOfClass:NSString.class]) return nil;
1367+ if (![dict[@"src=JaVaSCript:prompt(132)"] isKindOfClass:NSString.class]) return nil;
1368+ if (![dict[@"#\tStrings which can be interpreted as numeric"] isKindOfClass:NSString.class]) return nil;
1369+ if (![dict[@"#\tStrings which can cause a SQL injection if inputs are not sanitized"] isKindOfClass:NSString.class]) return nil;
1370+ if (![dict[@"#\tStrings which can cause user to pull in files that should not be a part of a web server"] isKindOfClass:NSString.class]) return nil;
1371+ if (![dict[@"#\tStrings which can cause user to run code on server as a privileged user (c.f. https://news.ycombinator.com/item?id=7665153)"] isKindOfClass:NSString.class]) return nil;
1372+ if (![dict[@"#\tStrings which contain \"corrupted\" text. The corruption will not appear in non-HTML text, however. (via http://www.eeemo.net)"] isKindOfClass:NSString.class]) return nil;
1373+ if (![dict[@"#\tStrings which contain unicode with an \"upsidedown\" effect (via http://www.upsidedowntext.com)"] isKindOfClass:NSString.class]) return nil;
1374+ if (![dict[@"#\tStrings which contain unicode with unusual properties (e.g. Right-to-left override) (c.f. http://www.unicode.org/charts/PDF/U2000.pdf)"] isKindOfClass:NSString.class]) return nil;
1375+ if (![dict[@"#\tStrings which punish the fools who use cat/type on this file"] isKindOfClass:NSString.class]) return nil;
1376+ if (![dict[@"<svg><script>123<1>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
1377+ if (![dict[@"System(\"ls -al /\")"] isKindOfClass:NSString.class]) return nil;
1378+ if (![dict[@"@{[system \"touch /tmp/blns.fail\"]}"] isKindOfClass:NSString.class]) return nil;
1379+ if (![dict[@"\u2029test\u2029"] isKindOfClass:NSString.class]) return nil;
1380+ if (![dict[@"test\u2060test\u202b"] isKindOfClass:NSString.class]) return nil;
1381+ if (![dict[@"\"''''\"'\""] isKindOfClass:NSString.class]) return nil;
1382+ if (![dict[@"+0.0"] isKindOfClass:NSString.class]) return nil;
1383+ if (![dict[@"0.0.0"] isKindOfClass:NSString.class]) return nil;
1384+ if (![dict[@"() { 0; }; touch /tmp/blns.shellshock1.fail;"] isKindOfClass:NSString.class]) return nil;
1385+ if (![dict[@"0xabad1dea"] isKindOfClass:NSString.class]) return nil;
1386+ if (![dict[@"0xffffffff"] isKindOfClass:NSString.class]) return nil;
1387+ if (![dict[@"\U0001f3f30\U0001f308️"] isKindOfClass:NSString.class]) return nil;
1388+ if (![dict[@"0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ \U0001f51f"] isKindOfClass:NSString.class]) return nil;
1389+ if (![dict[@"--"] isKindOfClass:NSString.class]) return nil;
1390+ if (![dict[@"\U0001d683\U0001d691\U0001d68e \U0001d69a\U0001d69e\U0001d692\U0001d68c\U0001d694 \U0001d68b\U0001d69b\U0001d698\U0001d6a0\U0001d697 \U0001d68f\U0001d698\U0001d6a1 \U0001d693\U0001d69e\U0001d696\U0001d699\U0001d69c \U0001d698\U0001d69f\U0001d68e\U0001d69b \U0001d69d\U0001d691\U0001d68e \U0001d695\U0001d68a\U0001d6a3\U0001d6a2 \U0001d68d\U0001d698\U0001d690"] isKindOfClass:NSString.class]) return nil;
1391+ if (![dict[@"-$1.00"] isKindOfClass:NSString.class]) return nil;
1392+ if (![dict[@"1 000,00"] isKindOfClass:NSString.class]) return nil;
1393+ if (![dict[@"1'000'000,00"] isKindOfClass:NSString.class]) return nil;
1394+ if (![dict[@"\U0001f435 \U0001f648 \U0001f649 \U0001f64a"] isKindOfClass:NSString.class]) return nil;
1395+ if (![dict[@"-1/2"] isKindOfClass:NSString.class]) return nil;
1396+ if (![dict[@"\U0001f47e \U0001f647 \U0001f481 \U0001f645 \U0001f646 \U0001f64b \U0001f64e \U0001f64d"] isKindOfClass:NSString.class]) return nil;
1397+ if (![dict[@"-1E+02"] isKindOfClass:NSString.class]) return nil;
1398+ if (![dict[@"-1E2"] isKindOfClass:NSString.class]) return nil;
1399+ if (![dict[@"-1#IND"] isKindOfClass:NSString.class]) return nil;
1400+ if (![dict[@"."] isKindOfClass:NSString.class]) return nil;
1401+ if (![dict[@"\\\\"] isKindOfClass:NSString.class]) return nil;
1402+ if (![dict[@"_"] isKindOfClass:NSString.class]) return nil;
1403+ if (![dict[@"⁰⁴⁵"] isKindOfClass:NSString.class]) return nil;
1404+ if (![dict[@"⅛⅜⅝⅞"] isKindOfClass:NSString.class]) return nil;
1405+ if (![dict[@"✋\U0001f3ff \U0001f4aa\U0001f3ff \U0001f450\U0001f3ff \U0001f64c\U0001f3ff \U0001f44f\U0001f3ff \U0001f64f\U0001f3ff"] isKindOfClass:NSString.class]) return nil;
1406+ if (![dict[@"・( ̄∀ ̄)・:*:"] isKindOfClass:NSString.class]) return nil;
1407+ if (![dict[@"\U0001d413\U0001d421\U0001d41e \U0001d42a\U0001d42e\U0001d422\U0001d41c\U0001d424 \U0001d41b\U0001d42b\U0001d428\U0001d430\U0001d427 \U0001d41f\U0001d428\U0001d431 \U0001d423\U0001d42e\U0001d426\U0001d429\U0001d42c \U0001d428\U0001d42f\U0001d41e\U0001d42b \U0001d42d\U0001d421\U0001d41e \U0001d425\U0001d41a\U0001d433\U0001d432 \U0001d41d\U0001d428\U0001d420"] isKindOfClass:NSString.class]) return nil;
1408+ if (![dict[@"-9223372036854775808/-1"] isKindOfClass:NSString.class]) return nil;
1409+ if (![dict[@"<script>alert(123)</script>"] isKindOfClass:NSString.class]) return nil;
1410+ if (![dict[@"١٢٣"] isKindOfClass:NSString.class]) return nil;
1411+ if (![dict[@"<title onpropertychange=javascript:alert(1)></title><title title=>"] isKindOfClass:NSString.class]) return nil;
1412+ if (![dict[@"# treated as whitespace in some contexts."] isKindOfClass:NSString.class]) return nil;
1413+ if (![dict[@"#\tTrick Unicode"] isKindOfClass:NSString.class]) return nil;
1414+ if (![dict[@"undefined"] isKindOfClass:NSString.class]) return nil;
1415+ if (![dict[@"# Unicode additional control characters: all of the characters with"] isKindOfClass:NSString.class]) return nil;
1416+ if (![dict[@"#\tUnicode Subscript/Superscript/Accents"] isKindOfClass:NSString.class]) return nil;
1417+ if (![dict[@"#\tUnicode Upsidedown"] isKindOfClass:NSString.class]) return nil;
1418+ if (![dict[@"$USER"] isKindOfClass:NSString.class]) return nil;
1419+ if (![dict[@"--version"] isKindOfClass:NSString.class]) return nil;
1420+ if (![dict[@"# version 8.0.0), plus U+0009 (HT), U+000B (VT), U+000C (FF), U+0085 (NEL),"] isKindOfClass:NSString.class]) return nil;
1421+ if (![dict[@"# Whitespace: all of the characters with category Zs, Zl, or Zp (in Unicode"] isKindOfClass:NSString.class]) return nil;
1422+ if (![dict[@"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><!DOCTYPE foo [ <!ELEMENT foo ANY ><!ENTITY xxe SYSTEM \"file:///etc/passwd\" >]><foo>&xxe;</foo>"] isKindOfClass:NSString.class]) return nil;
1423+ if (![dict[@"# XXE Injection (XML)"] isKindOfClass:NSString.class]) return nil;
1424+ if (![dict[@"#\tZalgo Text"] isKindOfClass:NSString.class]) return nil;
1425+ if (![dict[@"ZZ:"] isKindOfClass:NSString.class]) return nil;
1426+ if (![dict[@"ÅÍÎÏ˝ÓÔ\uf8ffÒÚÆ☃"] isKindOfClass:NSString.class]) return nil;
1427+ if (![dict[@",。・:*:・゜’( ☻ ω ☻ )。・:*:・゜’"] isKindOfClass:NSString.class]) return nil;
1428+ if (![dict[@"ЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"] isKindOfClass:NSString.class]) return nil;
1429+ if (![dict[@"בְּרֵאשִׁית, בָּרָא אֱלֹהִים, אֵת הַשָּׁמַיִם, וְאֵת הָאָרֶץ"] isKindOfClass:NSString.class]) return nil;
1430+ if (![dict[@"مُنَاقَشَةُ سُبُلِ اِسْتِخْدَامِ اللُّغَةِ فِي النُّظُمِ الْقَائِمَةِ وَفِيم يَخُصَّ التَّطْبِيقَاتُ الْحاسُوبِيَّةُ، "] isKindOfClass:NSString.class]) return nil;
1431+ if (![dict[@"̗̺͖̹̯͓Ṯ̤͍̥͇͈h̲́e͏͓̼̗̙̼̣͔ ͇̜̱̠͓͍ͅN͕͠e̗̱z̘̝̜̺͙p̤̺̹͍̯͚e̠̻̠͜r̨̤͍̺̖͔̖̖d̠̟̭̬̝͟i̦͖̩͓͔̤a̠̗̬͉̙n͚͜ ̻̞̰͚ͅh̵͉i̳̞v̢͇ḙ͎͟-҉̭̩̼͔m̤̭̫i͕͇̝̦n̗͙ḍ̟ ̯̲͕͞ǫ̟̯̰̲͙̻̝f ̪̰̰̗̖̭̘͘c̦͍̲̞͍̩̙ḥ͚a̮͎̟̙͜ơ̩̹͎s̤.̝̝ ҉Z̡̖̜͖̰̣͉̜a͖̰͙̬͡l̲̫̳͍̩g̡̟̼̱͚̞̬ͅo̗͜.̟"] isKindOfClass:NSString.class]) return nil;
1432+ if (![dict[@"┬─┬ノ( º _ ºノ)"] isKindOfClass:NSString.class]) return nil;
1433+ if (![dict[@"울란바토르"] isKindOfClass:NSString.class]) return nil;
1434+ if (![dict[@"The quick brown fox jumps over the lazy dog"] isKindOfClass:NSString.class]) return nil;
1435+ if (![dict[@"(ノಥ益ಥ)ノ\ufeff ┻━┻"] isKindOfClass:NSString.class]) return nil;
1436+ [self setValuesForKeysWithDictionary:dict];
1437+ }
1438+ return self;
1439+}
1440+
1441+- (void)setValue:(nullable id)value forKey:(NSString *)key
1442+{
1443+ id resolved = QTC.properties[key];
1444+ if (resolved) [super setValue:value forKey:resolved];
1445+}
1446+
1447+- (void)setNilValueForKey:(NSString *)key
1448+{
1449+ id resolved = QTC.properties[key];
1450+ if (resolved) [super setValue:@(0) forKey:resolved];
1451+}
1452+
1453+- (NSDictionary *)JSONDictionary
1454+{
1455+ id dict = [[self dictionaryWithValuesForKeys:QTC.properties.allValues] mutableCopy];
1456+
1457+ for (id jsonName in QTC.properties) {
1458+ id propertyName = QTC.properties[jsonName];
1459+ if (![jsonName isEqualToString:propertyName]) {
1460+ dict[jsonName] = dict[propertyName];
1461+ [dict removeObjectForKey:propertyName];
1462+ }
1463+ }
1464+
1465+ [dict addEntriesFromDictionary:@{
1466+ @"dontMakeAMap": _isDontMakeAMap ? @YES : @NO,
1467+ }];
1468+
1469+ return dict;
1470+}
1471+@end
1472+
1473+NS_ASSUME_NONNULL_END
Test case

test/inputs/json/priority/bug427.json

1 generated file · +49 −7
Melixirdefault / QuickType.ex+49 −7
@@ -1719,6 +1719,12 @@ defmodule ExtendedBy do
17191719 type_arguments: [ExtendedBy.t()] | nil
17201720 }
17211721
1722+ def decode_id(value) when is_integer(value), do: value
1723+ def decode_id(_), do: {:error, "Unexpected type when decoding ExtendedBy.id"}
1724+
1725+ def encode_id(value) when is_integer(value), do: value
1726+ def encode_id(_), do: {:error, "Unexpected type when encoding ExtendedBy.id"}
1727+
17221728 def decode_name(value) when is_binary(value), do: value
17231729 def decode_name(_), do: {:error, "Unexpected type when decoding ExtendedBy.name"}
17241730
@@ -1728,7 +1734,7 @@ defmodule ExtendedBy do
17281734 def from_map(m) do
17291735 %ExtendedBy{
17301736 constraint: m["constraint"] && ExtendedBy.from_map(m["constraint"]),
1731- id: m["id"],
1737+ id: m["id"] && decode_id(m["id"]),
17321738 name: decode_name(m["name"]),
17331739 type: TypeEnum.decode(m["type"]),
17341740 type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &ExtendedBy.from_map/1),
@@ -1808,6 +1814,12 @@ defmodule Type4 do
18081814 type_arguments: [ElementType.t()] | nil
18091815 }
18101816
1817+ def decode_id(value) when is_integer(value), do: value
1818+ def decode_id(_), do: {:error, "Unexpected type when decoding Type4.id"}
1819+
1820+ def encode_id(value) when is_integer(value), do: value
1821+ def encode_id(_), do: {:error, "Unexpected type when encoding Type4.id"}
1822+
18111823 def decode_name(value) when is_binary(value), do: value
18121824 def decode_name(_), do: {:error, "Unexpected type when decoding Type4.name"}
18131825
@@ -1820,7 +1832,7 @@ defmodule Type4 do
18201832 declaration: m["declaration"] && GetSignature.from_map(m["declaration"]),
18211833 element_type: m["elementType"] && ElementType.from_map(m["elementType"]),
18221834 elements: m["elements"] && Enum.map(m["elements"], &ExtendedBy.from_map/1),
1823- id: m["id"],
1835+ id: m["id"] && decode_id(m["id"]),
18241836 name: m["name"] && decode_name(m["name"]),
18251837 type: TypeEnum.decode(m["type"]),
18261838 type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &ElementType.from_map/1),
@@ -2598,6 +2610,12 @@ defmodule Type5 do
25982610 types: [TypeElement.t()] | nil
25992611 }
26002612
2613+ def decode_id(value) when is_integer(value), do: value
2614+ def decode_id(_), do: {:error, "Unexpected type when decoding Type5.id"}
2615+
2616+ def encode_id(value) when is_integer(value), do: value
2617+ def encode_id(_), do: {:error, "Unexpected type when encoding Type5.id"}
2618+
26012619 def decode_name(value) when is_binary(value), do: value
26022620 def decode_name(_), do: {:error, "Unexpected type when decoding Type5.name"}
26032621
@@ -2610,7 +2628,7 @@ defmodule Type5 do
26102628 declaration: m["declaration"] && Declaration2.from_map(m["declaration"]),
26112629 element_type: m["elementType"] && ExtendedBy.from_map(m["elementType"]),
26122630 elements: m["elements"] && Enum.map(m["elements"], &ElementType.from_map/1),
2613- id: m["id"],
2631+ id: m["id"] && decode_id(m["id"]),
26142632 name: m["name"] && decode_name(m["name"]),
26152633 type: TypeEnum.decode(m["type"]),
26162634 type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &TypeArgument1.from_map/1),
@@ -3048,6 +3066,12 @@ defmodule Type8 do
30483066 type_arguments: [ElementType.t()] | nil
30493067 }
30503068
3069+ def decode_id(value) when is_integer(value), do: value
3070+ def decode_id(_), do: {:error, "Unexpected type when decoding Type8.id"}
3071+
3072+ def encode_id(value) when is_integer(value), do: value
3073+ def encode_id(_), do: {:error, "Unexpected type when encoding Type8.id"}
3074+
30513075 def decode_name(value) when is_binary(value), do: value
30523076 def decode_name(_), do: {:error, "Unexpected type when decoding Type8.name"}
30533077
@@ -3058,7 +3082,7 @@ defmodule Type8 do
30583082 %Type8{
30593083 declaration: m["declaration"] && Declaration3.from_map(m["declaration"]),
30603084 element_type: m["elementType"] && ElementType.from_map(m["elementType"]),
3061- id: m["id"],
3085+ id: m["id"] && decode_id(m["id"]),
30623086 name: m["name"] && decode_name(m["name"]),
30633087 type: TypeEnum.decode(m["type"]),
30643088 type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &ElementType.from_map/1),
@@ -3188,10 +3212,16 @@ defmodule Type9 do
31883212 type_arguments: [ElementType.t()] | nil
31893213 }
31903214
3215+ def decode_id(value) when is_integer(value), do: value
3216+ def decode_id(_), do: {:error, "Unexpected type when decoding Type9.id"}
3217+
3218+ def encode_id(value) when is_integer(value), do: value
3219+ def encode_id(_), do: {:error, "Unexpected type when encoding Type9.id"}
3220+
31913221 def from_map(m) do
31923222 %Type9{
31933223 declaration: m["declaration"] && Declaration1.from_map(m["declaration"]),
3194- id: m["id"],
3224+ id: m["id"] && decode_id(m["id"]),
31953225 name: m["name"] && Name.decode(m["name"]),
31963226 type: TypeEnum.decode(m["type"]),
31973227 type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &ElementType.from_map/1),
@@ -3648,6 +3678,12 @@ defmodule Type10 do
36483678 value: String.t() | nil
36493679 }
36503680
3681+ def decode_id(value) when is_integer(value), do: value
3682+ def decode_id(_), do: {:error, "Unexpected type when decoding Type10.id"}
3683+
3684+ def encode_id(value) when is_integer(value), do: value
3685+ def encode_id(_), do: {:error, "Unexpected type when encoding Type10.id"}
3686+
36513687 def decode_name(value) when is_binary(value), do: value
36523688 def decode_name(_), do: {:error, "Unexpected type when decoding Type10.name"}
36533689
@@ -3665,7 +3701,7 @@ defmodule Type10 do
36653701 declaration: m["declaration"] && Declaration4.from_map(m["declaration"]),
36663702 element_type: m["elementType"] && ElementType.from_map(m["elementType"]),
36673703 elements: m["elements"] && Enum.map(m["elements"], &ExtendedBy.from_map/1),
3668- id: m["id"],
3704+ id: m["id"] && decode_id(m["id"]),
36693705 name: m["name"] && decode_name(m["name"]),
36703706 type: TypeEnum.decode(m["type"]),
36713707 type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &TypeArgument2.from_map/1),
@@ -3713,6 +3749,12 @@ defmodule Type12 do
37133749 type: String.t()
37143750 }
37153751
3752+ def decode_id(value) when is_integer(value), do: value
3753+ def decode_id(_), do: {:error, "Unexpected type when decoding Type12.id"}
3754+
3755+ def encode_id(value) when is_integer(value), do: value
3756+ def encode_id(_), do: {:error, "Unexpected type when encoding Type12.id"}
3757+
37163758 def decode_operator(value) when is_binary(value), do: value
37173759 def decode_operator(_), do: {:error, "Unexpected type when decoding Type12.operator"}
37183760
@@ -3727,7 +3769,7 @@ defmodule Type12 do
37273769
37283770 def from_map(m) do
37293771 %Type12{
3730- id: m["id"],
3772+ id: m["id"] && decode_id(m["id"]),
37313773 name: m["name"] && Name.decode(m["name"]),
37323774 operator: m["operator"] && decode_operator(m["operator"]),
37333775 target: m["target"] && ElementType.from_map(m["target"]),
Test case

test/inputs/json/priority/combinations1.json

1 generated file · +48 −6
Melixirdefault / QuickType.ex+48 −6
@@ -246,6 +246,20 @@ defmodule ChemotherapeuticClass do
246246 unshy: nil | nil
247247 }
248248
249+ def decode_catharticalness(value) when is_float(value), do: value
250+ def decode_catharticalness(value) when is_integer(value), do: value
251+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding ChemotherapeuticClass.catharticalness"}
252+
253+ def encode_catharticalness(value) when is_float(value), do: value
254+ def encode_catharticalness(value) when is_integer(value), do: value
255+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding ChemotherapeuticClass.catharticalness"}
256+
257+ def decode_chirotherium(value) when is_integer(value), do: value
258+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding ChemotherapeuticClass.chirotherium"}
259+
260+ def encode_chirotherium(value) when is_integer(value), do: value
261+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding ChemotherapeuticClass.chirotherium"}
262+
249263 def decode_disdiapason(value) when is_binary(value), do: value
250264 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding ChemotherapeuticClass.disdiapason"}
251265
@@ -257,10 +271,10 @@ defmodule ChemotherapeuticClass do
257271 angioneurotic: m["angioneurotic"],
258272 availment: m["availment"],
259273 bladelet: m["bladelet"],
260- catharticalness: m["catharticalness"],
274+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
261275 caulis: m["caulis"],
262276 chalcus: m["chalcus"],
263- chirotherium: m["Chirotherium"],
277+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
264278 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
265279 enteradenological: m["enteradenological"],
266280 homocerc: m["homocerc"],
@@ -433,6 +447,20 @@ defmodule CoadjustClass do
433447 unchargeable: nil | nil
434448 }
435449
450+ def decode_catharticalness(value) when is_float(value), do: value
451+ def decode_catharticalness(value) when is_integer(value), do: value
452+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding CoadjustClass.catharticalness"}
453+
454+ def encode_catharticalness(value) when is_float(value), do: value
455+ def encode_catharticalness(value) when is_integer(value), do: value
456+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding CoadjustClass.catharticalness"}
457+
458+ def decode_chirotherium(value) when is_integer(value), do: value
459+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding CoadjustClass.chirotherium"}
460+
461+ def encode_chirotherium(value) when is_integer(value), do: value
462+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding CoadjustClass.chirotherium"}
463+
436464 def decode_disdiapason(value) when is_binary(value), do: value
437465 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding CoadjustClass.disdiapason"}
438466
@@ -443,8 +471,8 @@ defmodule CoadjustClass do
443471 %CoadjustClass{
444472 amidosulphonal: m["amidosulphonal"],
445473 benny: m["Benny"],
446- catharticalness: m["catharticalness"],
447- chirotherium: m["Chirotherium"],
474+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
475+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
448476 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
449477 ensnare: m["ensnare"],
450478 homocerc: m["homocerc"],
@@ -2013,6 +2041,20 @@ defmodule HemocoeleClass do
20132041 walt: nil | nil
20142042 }
20152043
2044+ def decode_catharticalness(value) when is_float(value), do: value
2045+ def decode_catharticalness(value) when is_integer(value), do: value
2046+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding HemocoeleClass.catharticalness"}
2047+
2048+ def encode_catharticalness(value) when is_float(value), do: value
2049+ def encode_catharticalness(value) when is_integer(value), do: value
2050+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding HemocoeleClass.catharticalness"}
2051+
2052+ def decode_chirotherium(value) when is_integer(value), do: value
2053+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding HemocoeleClass.chirotherium"}
2054+
2055+ def encode_chirotherium(value) when is_integer(value), do: value
2056+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding HemocoeleClass.chirotherium"}
2057+
20162058 def decode_disdiapason(value) when is_binary(value), do: value
20172059 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding HemocoeleClass.disdiapason"}
20182060
@@ -2025,8 +2067,8 @@ defmodule HemocoeleClass do
20252067 amelification: m["amelification"],
20262068 autobiographic: m["autobiographic"],
20272069 berat: m["berat"],
2028- catharticalness: m["catharticalness"],
2029- chirotherium: m["Chirotherium"],
2070+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
2071+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
20302072 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
20312073 disproportionably: m["disproportionably"],
20322074 erythrite: m["erythrite"],
Test case

test/inputs/json/priority/combinations2.json

1 generated file · +468 −66
Melixirdefault / QuickType.ex+468 −66
@@ -323,39 +323,173 @@ defmodule Amphithyron do
323323 undecimal: integer() | nil
324324 }
325325
326+ def decode_akroasis(value) when is_integer(value), do: value
327+ def decode_akroasis(_), do: {:error, "Unexpected type when decoding Amphithyron.akroasis"}
328+
329+ def encode_akroasis(value) when is_integer(value), do: value
330+ def encode_akroasis(_), do: {:error, "Unexpected type when encoding Amphithyron.akroasis"}
331+
332+ def decode_antiphonical(value) when is_integer(value), do: value
333+ def decode_antiphonical(_), do: {:error, "Unexpected type when decoding Amphithyron.antiphonical"}
334+
335+ def encode_antiphonical(value) when is_integer(value), do: value
336+ def encode_antiphonical(_), do: {:error, "Unexpected type when encoding Amphithyron.antiphonical"}
337+
338+ def decode_basebred(value) when is_integer(value), do: value
339+ def decode_basebred(_), do: {:error, "Unexpected type when decoding Amphithyron.basebred"}
340+
341+ def encode_basebred(value) when is_integer(value), do: value
342+ def encode_basebred(_), do: {:error, "Unexpected type when encoding Amphithyron.basebred"}
343+
344+ def decode_catharticalness(value) when is_float(value), do: value
345+ def decode_catharticalness(value) when is_integer(value), do: value
346+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding Amphithyron.catharticalness"}
347+
348+ def encode_catharticalness(value) when is_float(value), do: value
349+ def encode_catharticalness(value) when is_integer(value), do: value
350+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding Amphithyron.catharticalness"}
351+
352+ def decode_chirotherium(value) when is_integer(value), do: value
353+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding Amphithyron.chirotherium"}
354+
355+ def encode_chirotherium(value) when is_integer(value), do: value
356+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding Amphithyron.chirotherium"}
357+
358+ def decode_conductometric(value) when is_integer(value), do: value
359+ def decode_conductometric(_), do: {:error, "Unexpected type when decoding Amphithyron.conductometric"}
360+
361+ def encode_conductometric(value) when is_integer(value), do: value
362+ def encode_conductometric(_), do: {:error, "Unexpected type when encoding Amphithyron.conductometric"}
363+
326364 def decode_disdiapason(value) when is_binary(value), do: value
327365 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Amphithyron.disdiapason"}
328366
329367 def encode_disdiapason(value) when is_binary(value), do: value
330368 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Amphithyron.disdiapason"}
331369
370+ def decode_ensilation(value) when is_integer(value), do: value
371+ def decode_ensilation(_), do: {:error, "Unexpected type when decoding Amphithyron.ensilation"}
372+
373+ def encode_ensilation(value) when is_integer(value), do: value
374+ def encode_ensilation(_), do: {:error, "Unexpected type when encoding Amphithyron.ensilation"}
375+
376+ def decode_eyebolt(value) when is_integer(value), do: value
377+ def decode_eyebolt(_), do: {:error, "Unexpected type when decoding Amphithyron.eyebolt"}
378+
379+ def encode_eyebolt(value) when is_integer(value), do: value
380+ def encode_eyebolt(_), do: {:error, "Unexpected type when encoding Amphithyron.eyebolt"}
381+
382+ def decode_fistulated(value) when is_integer(value), do: value
383+ def decode_fistulated(_), do: {:error, "Unexpected type when decoding Amphithyron.fistulated"}
384+
385+ def encode_fistulated(value) when is_integer(value), do: value
386+ def encode_fistulated(_), do: {:error, "Unexpected type when encoding Amphithyron.fistulated"}
387+
388+ def decode_heteropod(value) when is_integer(value), do: value
389+ def decode_heteropod(_), do: {:error, "Unexpected type when decoding Amphithyron.heteropod"}
390+
391+ def encode_heteropod(value) when is_integer(value), do: value
392+ def encode_heteropod(_), do: {:error, "Unexpected type when encoding Amphithyron.heteropod"}
393+
394+ def decode_juniperus(value) when is_integer(value), do: value
395+ def decode_juniperus(_), do: {:error, "Unexpected type when decoding Amphithyron.juniperus"}
396+
397+ def encode_juniperus(value) when is_integer(value), do: value
398+ def encode_juniperus(_), do: {:error, "Unexpected type when encoding Amphithyron.juniperus"}
399+
400+ def decode_labyrinthically(value) when is_integer(value), do: value
401+ def decode_labyrinthically(_), do: {:error, "Unexpected type when decoding Amphithyron.labyrinthically"}
402+
403+ def encode_labyrinthically(value) when is_integer(value), do: value
404+ def encode_labyrinthically(_), do: {:error, "Unexpected type when encoding Amphithyron.labyrinthically"}
405+
406+ def decode_martyrization(value) when is_integer(value), do: value
407+ def decode_martyrization(_), do: {:error, "Unexpected type when decoding Amphithyron.martyrization"}
408+
409+ def encode_martyrization(value) when is_integer(value), do: value
410+ def encode_martyrization(_), do: {:error, "Unexpected type when encoding Amphithyron.martyrization"}
411+
412+ def decode_mispolicy(value) when is_integer(value), do: value
413+ def decode_mispolicy(_), do: {:error, "Unexpected type when decoding Amphithyron.mispolicy"}
414+
415+ def encode_mispolicy(value) when is_integer(value), do: value
416+ def encode_mispolicy(_), do: {:error, "Unexpected type when encoding Amphithyron.mispolicy"}
417+
418+ def decode_multipara(value) when is_integer(value), do: value
419+ def decode_multipara(_), do: {:error, "Unexpected type when decoding Amphithyron.multipara"}
420+
421+ def encode_multipara(value) when is_integer(value), do: value
422+ def encode_multipara(_), do: {:error, "Unexpected type when encoding Amphithyron.multipara"}
423+
424+ def decode_nazirite(value) when is_integer(value), do: value
425+ def decode_nazirite(_), do: {:error, "Unexpected type when decoding Amphithyron.nazirite"}
426+
427+ def encode_nazirite(value) when is_integer(value), do: value
428+ def encode_nazirite(_), do: {:error, "Unexpected type when encoding Amphithyron.nazirite"}
429+
430+ def decode_possessorial(value) when is_integer(value), do: value
431+ def decode_possessorial(_), do: {:error, "Unexpected type when decoding Amphithyron.possessorial"}
432+
433+ def encode_possessorial(value) when is_integer(value), do: value
434+ def encode_possessorial(_), do: {:error, "Unexpected type when encoding Amphithyron.possessorial"}
435+
436+ def decode_shamed(value) when is_integer(value), do: value
437+ def decode_shamed(_), do: {:error, "Unexpected type when decoding Amphithyron.shamed"}
438+
439+ def encode_shamed(value) when is_integer(value), do: value
440+ def encode_shamed(_), do: {:error, "Unexpected type when encoding Amphithyron.shamed"}
441+
442+ def decode_shelfworn(value) when is_integer(value), do: value
443+ def decode_shelfworn(_), do: {:error, "Unexpected type when decoding Amphithyron.shelfworn"}
444+
445+ def encode_shelfworn(value) when is_integer(value), do: value
446+ def encode_shelfworn(_), do: {:error, "Unexpected type when encoding Amphithyron.shelfworn"}
447+
448+ def decode_stagnum(value) when is_integer(value), do: value
449+ def decode_stagnum(_), do: {:error, "Unexpected type when decoding Amphithyron.stagnum"}
450+
451+ def encode_stagnum(value) when is_integer(value), do: value
452+ def encode_stagnum(_), do: {:error, "Unexpected type when encoding Amphithyron.stagnum"}
453+
454+ def decode_those(value) when is_integer(value), do: value
455+ def decode_those(_), do: {:error, "Unexpected type when decoding Amphithyron.those"}
456+
457+ def encode_those(value) when is_integer(value), do: value
458+ def encode_those(_), do: {:error, "Unexpected type when encoding Amphithyron.those"}
459+
460+ def decode_undecimal(value) when is_integer(value), do: value
461+ def decode_undecimal(_), do: {:error, "Unexpected type when decoding Amphithyron.undecimal"}
462+
463+ def encode_undecimal(value) when is_integer(value), do: value
464+ def encode_undecimal(_), do: {:error, "Unexpected type when encoding Amphithyron.undecimal"}
465+
332466 def from_map(m) do
333467 %Amphithyron{
334- akroasis: m["akroasis"],
335- antiphonical: m["antiphonical"],
336- basebred: m["basebred"],
337- catharticalness: m["catharticalness"],
338- chirotherium: m["Chirotherium"],
339- conductometric: m["conductometric"],
468+ akroasis: m["akroasis"] && decode_akroasis(m["akroasis"]),
469+ antiphonical: m["antiphonical"] && decode_antiphonical(m["antiphonical"]),
470+ basebred: m["basebred"] && decode_basebred(m["basebred"]),
471+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
472+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
473+ conductometric: m["conductometric"] && decode_conductometric(m["conductometric"]),
340474 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
341- ensilation: m["ensilation"],
342- eyebolt: m["eyebolt"],
343- fistulated: m["fistulated"],
344- heteropod: m["heteropod"],
475+ ensilation: m["ensilation"] && decode_ensilation(m["ensilation"]),
476+ eyebolt: m["eyebolt"] && decode_eyebolt(m["eyebolt"]),
477+ fistulated: m["fistulated"] && decode_fistulated(m["fistulated"]),
478+ heteropod: m["heteropod"] && decode_heteropod(m["heteropod"]),
345479 homocerc: m["homocerc"],
346- juniperus: m["Juniperus"],
347- labyrinthically: m["labyrinthically"],
348- martyrization: m["martyrization"],
349- mispolicy: m["mispolicy"],
350- multipara: m["multipara"],
351- nazirite: m["Nazirite"],
480+ juniperus: m["Juniperus"] && decode_juniperus(m["Juniperus"]),
481+ labyrinthically: m["labyrinthically"] && decode_labyrinthically(m["labyrinthically"]),
482+ martyrization: m["martyrization"] && decode_martyrization(m["martyrization"]),
483+ mispolicy: m["mispolicy"] && decode_mispolicy(m["mispolicy"]),
484+ multipara: m["multipara"] && decode_multipara(m["multipara"]),
485+ nazirite: m["Nazirite"] && decode_nazirite(m["Nazirite"]),
352486 nonbookish: m["nonbookish"],
353- possessorial: m["possessorial"],
354- shamed: m["shamed"],
355- shelfworn: m["shelfworn"],
356- stagnum: m["stagnum"],
357- those: m["Those"],
358- undecimal: m["undecimal"],
487+ possessorial: m["possessorial"] && decode_possessorial(m["possessorial"]),
488+ shamed: m["shamed"] && decode_shamed(m["shamed"]),
489+ shelfworn: m["shelfworn"] && decode_shelfworn(m["shelfworn"]),
490+ stagnum: m["stagnum"] && decode_stagnum(m["stagnum"]),
491+ those: m["Those"] && decode_those(m["Those"]),
492+ undecimal: m["undecimal"] && decode_undecimal(m["undecimal"]),
359493 }
360494 end
361495
@@ -1063,39 +1197,173 @@ defmodule DiscordiaClass do
10631197 wingle: integer() | nil
10641198 }
10651199
1200+ def decode_altaic(value) when is_integer(value), do: value
1201+ def decode_altaic(_), do: {:error, "Unexpected type when decoding DiscordiaClass.altaic"}
1202+
1203+ def encode_altaic(value) when is_integer(value), do: value
1204+ def encode_altaic(_), do: {:error, "Unexpected type when encoding DiscordiaClass.altaic"}
1205+
1206+ def decode_amoristic(value) when is_integer(value), do: value
1207+ def decode_amoristic(_), do: {:error, "Unexpected type when decoding DiscordiaClass.amoristic"}
1208+
1209+ def encode_amoristic(value) when is_integer(value), do: value
1210+ def encode_amoristic(_), do: {:error, "Unexpected type when encoding DiscordiaClass.amoristic"}
1211+
1212+ def decode_blennophthalmia(value) when is_integer(value), do: value
1213+ def decode_blennophthalmia(_), do: {:error, "Unexpected type when decoding DiscordiaClass.blennophthalmia"}
1214+
1215+ def encode_blennophthalmia(value) when is_integer(value), do: value
1216+ def encode_blennophthalmia(_), do: {:error, "Unexpected type when encoding DiscordiaClass.blennophthalmia"}
1217+
1218+ def decode_catharticalness(value) when is_float(value), do: value
1219+ def decode_catharticalness(value) when is_integer(value), do: value
1220+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding DiscordiaClass.catharticalness"}
1221+
1222+ def encode_catharticalness(value) when is_float(value), do: value
1223+ def encode_catharticalness(value) when is_integer(value), do: value
1224+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding DiscordiaClass.catharticalness"}
1225+
1226+ def decode_chirotherium(value) when is_integer(value), do: value
1227+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding DiscordiaClass.chirotherium"}
1228+
1229+ def encode_chirotherium(value) when is_integer(value), do: value
1230+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding DiscordiaClass.chirotherium"}
1231+
1232+ def decode_disciplinability(value) when is_integer(value), do: value
1233+ def decode_disciplinability(_), do: {:error, "Unexpected type when decoding DiscordiaClass.disciplinability"}
1234+
1235+ def encode_disciplinability(value) when is_integer(value), do: value
1236+ def encode_disciplinability(_), do: {:error, "Unexpected type when encoding DiscordiaClass.disciplinability"}
1237+
10661238 def decode_disdiapason(value) when is_binary(value), do: value
10671239 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding DiscordiaClass.disdiapason"}
10681240
10691241 def encode_disdiapason(value) when is_binary(value), do: value
10701242 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding DiscordiaClass.disdiapason"}
10711243
1244+ def decode_goofer(value) when is_integer(value), do: value
1245+ def decode_goofer(_), do: {:error, "Unexpected type when decoding DiscordiaClass.goofer"}
1246+
1247+ def encode_goofer(value) when is_integer(value), do: value
1248+ def encode_goofer(_), do: {:error, "Unexpected type when encoding DiscordiaClass.goofer"}
1249+
1250+ def decode_laryngograph(value) when is_integer(value), do: value
1251+ def decode_laryngograph(_), do: {:error, "Unexpected type when decoding DiscordiaClass.laryngograph"}
1252+
1253+ def encode_laryngograph(value) when is_integer(value), do: value
1254+ def encode_laryngograph(_), do: {:error, "Unexpected type when encoding DiscordiaClass.laryngograph"}
1255+
1256+ def decode_leucitis(value) when is_integer(value), do: value
1257+ def decode_leucitis(_), do: {:error, "Unexpected type when decoding DiscordiaClass.leucitis"}
1258+
1259+ def encode_leucitis(value) when is_integer(value), do: value
1260+ def encode_leucitis(_), do: {:error, "Unexpected type when encoding DiscordiaClass.leucitis"}
1261+
1262+ def decode_lymphocyst(value) when is_integer(value), do: value
1263+ def decode_lymphocyst(_), do: {:error, "Unexpected type when decoding DiscordiaClass.lymphocyst"}
1264+
1265+ def encode_lymphocyst(value) when is_integer(value), do: value
1266+ def encode_lymphocyst(_), do: {:error, "Unexpected type when encoding DiscordiaClass.lymphocyst"}
1267+
1268+ def decode_microcosmology(value) when is_integer(value), do: value
1269+ def decode_microcosmology(_), do: {:error, "Unexpected type when decoding DiscordiaClass.microcosmology"}
1270+
1271+ def encode_microcosmology(value) when is_integer(value), do: value
1272+ def encode_microcosmology(_), do: {:error, "Unexpected type when encoding DiscordiaClass.microcosmology"}
1273+
1274+ def decode_nauseation(value) when is_integer(value), do: value
1275+ def decode_nauseation(_), do: {:error, "Unexpected type when decoding DiscordiaClass.nauseation"}
1276+
1277+ def encode_nauseation(value) when is_integer(value), do: value
1278+ def encode_nauseation(_), do: {:error, "Unexpected type when encoding DiscordiaClass.nauseation"}
1279+
1280+ def decode_patarin(value) when is_integer(value), do: value
1281+ def decode_patarin(_), do: {:error, "Unexpected type when decoding DiscordiaClass.patarin"}
1282+
1283+ def encode_patarin(value) when is_integer(value), do: value
1284+ def encode_patarin(_), do: {:error, "Unexpected type when encoding DiscordiaClass.patarin"}
1285+
1286+ def decode_preliberal(value) when is_integer(value), do: value
1287+ def decode_preliberal(_), do: {:error, "Unexpected type when decoding DiscordiaClass.preliberal"}
1288+
1289+ def encode_preliberal(value) when is_integer(value), do: value
1290+ def encode_preliberal(_), do: {:error, "Unexpected type when encoding DiscordiaClass.preliberal"}
1291+
1292+ def decode_prettifier(value) when is_integer(value), do: value
1293+ def decode_prettifier(_), do: {:error, "Unexpected type when decoding DiscordiaClass.prettifier"}
1294+
1295+ def encode_prettifier(value) when is_integer(value), do: value
1296+ def encode_prettifier(_), do: {:error, "Unexpected type when encoding DiscordiaClass.prettifier"}
1297+
1298+ def decode_rangework(value) when is_integer(value), do: value
1299+ def decode_rangework(_), do: {:error, "Unexpected type when decoding DiscordiaClass.rangework"}
1300+
1301+ def encode_rangework(value) when is_integer(value), do: value
1302+ def encode_rangework(_), do: {:error, "Unexpected type when encoding DiscordiaClass.rangework"}
1303+
1304+ def decode_redient(value) when is_integer(value), do: value
1305+ def decode_redient(_), do: {:error, "Unexpected type when decoding DiscordiaClass.redient"}
1306+
1307+ def encode_redient(value) when is_integer(value), do: value
1308+ def encode_redient(_), do: {:error, "Unexpected type when encoding DiscordiaClass.redient"}
1309+
1310+ def decode_subfusiform(value) when is_integer(value), do: value
1311+ def decode_subfusiform(_), do: {:error, "Unexpected type when decoding DiscordiaClass.subfusiform"}
1312+
1313+ def encode_subfusiform(value) when is_integer(value), do: value
1314+ def encode_subfusiform(_), do: {:error, "Unexpected type when encoding DiscordiaClass.subfusiform"}
1315+
1316+ def decode_suicidical(value) when is_integer(value), do: value
1317+ def decode_suicidical(_), do: {:error, "Unexpected type when decoding DiscordiaClass.suicidical"}
1318+
1319+ def encode_suicidical(value) when is_integer(value), do: value
1320+ def encode_suicidical(_), do: {:error, "Unexpected type when encoding DiscordiaClass.suicidical"}
1321+
1322+ def decode_swow(value) when is_integer(value), do: value
1323+ def decode_swow(_), do: {:error, "Unexpected type when decoding DiscordiaClass.swow"}
1324+
1325+ def encode_swow(value) when is_integer(value), do: value
1326+ def encode_swow(_), do: {:error, "Unexpected type when encoding DiscordiaClass.swow"}
1327+
1328+ def decode_wastrel(value) when is_integer(value), do: value
1329+ def decode_wastrel(_), do: {:error, "Unexpected type when decoding DiscordiaClass.wastrel"}
1330+
1331+ def encode_wastrel(value) when is_integer(value), do: value
1332+ def encode_wastrel(_), do: {:error, "Unexpected type when encoding DiscordiaClass.wastrel"}
1333+
1334+ def decode_wingle(value) when is_integer(value), do: value
1335+ def decode_wingle(_), do: {:error, "Unexpected type when decoding DiscordiaClass.wingle"}
1336+
1337+ def encode_wingle(value) when is_integer(value), do: value
1338+ def encode_wingle(_), do: {:error, "Unexpected type when encoding DiscordiaClass.wingle"}
1339+
10721340 def from_map(m) do
10731341 %DiscordiaClass{
1074- altaic: m["Altaic"],
1075- amoristic: m["amoristic"],
1076- blennophthalmia: m["blennophthalmia"],
1077- catharticalness: m["catharticalness"],
1078- chirotherium: m["Chirotherium"],
1079- disciplinability: m["disciplinability"],
1342+ altaic: m["Altaic"] && decode_altaic(m["Altaic"]),
1343+ amoristic: m["amoristic"] && decode_amoristic(m["amoristic"]),
1344+ blennophthalmia: m["blennophthalmia"] && decode_blennophthalmia(m["blennophthalmia"]),
1345+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
1346+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
1347+ disciplinability: m["disciplinability"] && decode_disciplinability(m["disciplinability"]),
10801348 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
1081- goofer: m["goofer"],
1349+ goofer: m["goofer"] && decode_goofer(m["goofer"]),
10821350 homocerc: m["homocerc"],
1083- laryngograph: m["laryngograph"],
1084- leucitis: m["leucitis"],
1085- lymphocyst: m["lymphocyst"],
1086- microcosmology: m["microcosmology"],
1087- nauseation: m["nauseation"],
1351+ laryngograph: m["laryngograph"] && decode_laryngograph(m["laryngograph"]),
1352+ leucitis: m["leucitis"] && decode_leucitis(m["leucitis"]),
1353+ lymphocyst: m["lymphocyst"] && decode_lymphocyst(m["lymphocyst"]),
1354+ microcosmology: m["microcosmology"] && decode_microcosmology(m["microcosmology"]),
1355+ nauseation: m["nauseation"] && decode_nauseation(m["nauseation"]),
10881356 nonbookish: m["nonbookish"],
1089- patarin: m["Patarin"],
1090- preliberal: m["preliberal"],
1091- prettifier: m["prettifier"],
1092- rangework: m["rangework"],
1093- redient: m["redient"],
1094- subfusiform: m["subfusiform"],
1095- suicidical: m["suicidical"],
1096- swow: m["swow"],
1097- wastrel: m["wastrel"],
1098- wingle: m["wingle"],
1357+ patarin: m["Patarin"] && decode_patarin(m["Patarin"]),
1358+ preliberal: m["preliberal"] && decode_preliberal(m["preliberal"]),
1359+ prettifier: m["prettifier"] && decode_prettifier(m["prettifier"]),
1360+ rangework: m["rangework"] && decode_rangework(m["rangework"]),
1361+ redient: m["redient"] && decode_redient(m["redient"]),
1362+ subfusiform: m["subfusiform"] && decode_subfusiform(m["subfusiform"]),
1363+ suicidical: m["suicidical"] && decode_suicidical(m["suicidical"]),
1364+ swow: m["swow"] && decode_swow(m["swow"]),
1365+ wastrel: m["wastrel"] && decode_wastrel(m["wastrel"]),
1366+ wingle: m["wingle"] && decode_wingle(m["wingle"]),
10991367 }
11001368 end
11011369
@@ -1383,39 +1651,173 @@ defmodule LaviniaClass do
13831651 uproute: integer() | nil
13841652 }
13851653
1654+ def decode_agitable(value) when is_integer(value), do: value
1655+ def decode_agitable(_), do: {:error, "Unexpected type when decoding LaviniaClass.agitable"}
1656+
1657+ def encode_agitable(value) when is_integer(value), do: value
1658+ def encode_agitable(_), do: {:error, "Unexpected type when encoding LaviniaClass.agitable"}
1659+
1660+ def decode_asininity(value) when is_integer(value), do: value
1661+ def decode_asininity(_), do: {:error, "Unexpected type when decoding LaviniaClass.asininity"}
1662+
1663+ def encode_asininity(value) when is_integer(value), do: value
1664+ def encode_asininity(_), do: {:error, "Unexpected type when encoding LaviniaClass.asininity"}
1665+
1666+ def decode_benefiter(value) when is_integer(value), do: value
1667+ def decode_benefiter(_), do: {:error, "Unexpected type when decoding LaviniaClass.benefiter"}
1668+
1669+ def encode_benefiter(value) when is_integer(value), do: value
1670+ def encode_benefiter(_), do: {:error, "Unexpected type when encoding LaviniaClass.benefiter"}
1671+
1672+ def decode_bronzelike(value) when is_integer(value), do: value
1673+ def decode_bronzelike(_), do: {:error, "Unexpected type when decoding LaviniaClass.bronzelike"}
1674+
1675+ def encode_bronzelike(value) when is_integer(value), do: value
1676+ def encode_bronzelike(_), do: {:error, "Unexpected type when encoding LaviniaClass.bronzelike"}
1677+
1678+ def decode_catharticalness(value) when is_float(value), do: value
1679+ def decode_catharticalness(value) when is_integer(value), do: value
1680+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding LaviniaClass.catharticalness"}
1681+
1682+ def encode_catharticalness(value) when is_float(value), do: value
1683+ def encode_catharticalness(value) when is_integer(value), do: value
1684+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding LaviniaClass.catharticalness"}
1685+
1686+ def decode_chirotherium(value) when is_integer(value), do: value
1687+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding LaviniaClass.chirotherium"}
1688+
1689+ def encode_chirotherium(value) when is_integer(value), do: value
1690+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding LaviniaClass.chirotherium"}
1691+
1692+ def decode_cholesteatomatous(value) when is_integer(value), do: value
1693+ def decode_cholesteatomatous(_), do: {:error, "Unexpected type when decoding LaviniaClass.cholesteatomatous"}
1694+
1695+ def encode_cholesteatomatous(value) when is_integer(value), do: value
1696+ def encode_cholesteatomatous(_), do: {:error, "Unexpected type when encoding LaviniaClass.cholesteatomatous"}
1697+
1698+ def decode_deprivement(value) when is_integer(value), do: value
1699+ def decode_deprivement(_), do: {:error, "Unexpected type when decoding LaviniaClass.deprivement"}
1700+
1701+ def encode_deprivement(value) when is_integer(value), do: value
1702+ def encode_deprivement(_), do: {:error, "Unexpected type when encoding LaviniaClass.deprivement"}
1703+
13861704 def decode_disdiapason(value) when is_binary(value), do: value
13871705 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding LaviniaClass.disdiapason"}
13881706
13891707 def encode_disdiapason(value) when is_binary(value), do: value
13901708 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding LaviniaClass.disdiapason"}
13911709
1710+ def decode_flippantness(value) when is_integer(value), do: value
1711+ def decode_flippantness(_), do: {:error, "Unexpected type when decoding LaviniaClass.flippantness"}
1712+
1713+ def encode_flippantness(value) when is_integer(value), do: value
1714+ def encode_flippantness(_), do: {:error, "Unexpected type when encoding LaviniaClass.flippantness"}
1715+
1716+ def decode_fogproof(value) when is_integer(value), do: value
1717+ def decode_fogproof(_), do: {:error, "Unexpected type when decoding LaviniaClass.fogproof"}
1718+
1719+ def encode_fogproof(value) when is_integer(value), do: value
1720+ def encode_fogproof(_), do: {:error, "Unexpected type when encoding LaviniaClass.fogproof"}
1721+
1722+ def decode_merrymeeting(value) when is_integer(value), do: value
1723+ def decode_merrymeeting(_), do: {:error, "Unexpected type when decoding LaviniaClass.merrymeeting"}
1724+
1725+ def encode_merrymeeting(value) when is_integer(value), do: value
1726+ def encode_merrymeeting(_), do: {:error, "Unexpected type when encoding LaviniaClass.merrymeeting"}
1727+
1728+ def decode_overcareful(value) when is_integer(value), do: value
1729+ def decode_overcareful(_), do: {:error, "Unexpected type when decoding LaviniaClass.overcareful"}
1730+
1731+ def encode_overcareful(value) when is_integer(value), do: value
1732+ def encode_overcareful(_), do: {:error, "Unexpected type when encoding LaviniaClass.overcareful"}
1733+
1734+ def decode_panaris(value) when is_integer(value), do: value
1735+ def decode_panaris(_), do: {:error, "Unexpected type when decoding LaviniaClass.panaris"}
1736+
1737+ def encode_panaris(value) when is_integer(value), do: value
1738+ def encode_panaris(_), do: {:error, "Unexpected type when encoding LaviniaClass.panaris"}
1739+
1740+ def decode_preacceptance(value) when is_integer(value), do: value
1741+ def decode_preacceptance(_), do: {:error, "Unexpected type when decoding LaviniaClass.preacceptance"}
1742+
1743+ def encode_preacceptance(value) when is_integer(value), do: value
1744+ def encode_preacceptance(_), do: {:error, "Unexpected type when encoding LaviniaClass.preacceptance"}
1745+
1746+ def decode_quinoxaline(value) when is_integer(value), do: value
1747+ def decode_quinoxaline(_), do: {:error, "Unexpected type when decoding LaviniaClass.quinoxaline"}
1748+
1749+ def encode_quinoxaline(value) when is_integer(value), do: value
1750+ def encode_quinoxaline(_), do: {:error, "Unexpected type when encoding LaviniaClass.quinoxaline"}
1751+
1752+ def decode_sig(value) when is_integer(value), do: value
1753+ def decode_sig(_), do: {:error, "Unexpected type when decoding LaviniaClass.sig"}
1754+
1755+ def encode_sig(value) when is_integer(value), do: value
1756+ def encode_sig(_), do: {:error, "Unexpected type when encoding LaviniaClass.sig"}
1757+
1758+ def decode_superconfusion(value) when is_integer(value), do: value
1759+ def decode_superconfusion(_), do: {:error, "Unexpected type when decoding LaviniaClass.superconfusion"}
1760+
1761+ def encode_superconfusion(value) when is_integer(value), do: value
1762+ def encode_superconfusion(_), do: {:error, "Unexpected type when encoding LaviniaClass.superconfusion"}
1763+
1764+ def decode_tacana(value) when is_integer(value), do: value
1765+ def decode_tacana(_), do: {:error, "Unexpected type when decoding LaviniaClass.tacana"}
1766+
1767+ def encode_tacana(value) when is_integer(value), do: value
1768+ def encode_tacana(_), do: {:error, "Unexpected type when encoding LaviniaClass.tacana"}
1769+
1770+ def decode_tillotter(value) when is_integer(value), do: value
1771+ def decode_tillotter(_), do: {:error, "Unexpected type when decoding LaviniaClass.tillotter"}
1772+
1773+ def encode_tillotter(value) when is_integer(value), do: value
1774+ def encode_tillotter(_), do: {:error, "Unexpected type when encoding LaviniaClass.tillotter"}
1775+
1776+ def decode_tranquillize(value) when is_integer(value), do: value
1777+ def decode_tranquillize(_), do: {:error, "Unexpected type when decoding LaviniaClass.tranquillize"}
1778+
1779+ def encode_tranquillize(value) when is_integer(value), do: value
1780+ def encode_tranquillize(_), do: {:error, "Unexpected type when encoding LaviniaClass.tranquillize"}
1781+
1782+ def decode_unquestionable(value) when is_integer(value), do: value
1783+ def decode_unquestionable(_), do: {:error, "Unexpected type when decoding LaviniaClass.unquestionable"}
1784+
1785+ def encode_unquestionable(value) when is_integer(value), do: value
1786+ def encode_unquestionable(_), do: {:error, "Unexpected type when encoding LaviniaClass.unquestionable"}
1787+
1788+ def decode_uproute(value) when is_integer(value), do: value
1789+ def decode_uproute(_), do: {:error, "Unexpected type when decoding LaviniaClass.uproute"}
1790+
1791+ def encode_uproute(value) when is_integer(value), do: value
1792+ def encode_uproute(_), do: {:error, "Unexpected type when encoding LaviniaClass.uproute"}
1793+
13921794 def from_map(m) do
13931795 %LaviniaClass{
1394- agitable: m["agitable"],
1395- asininity: m["asininity"],
1396- benefiter: m["benefiter"],
1397- bronzelike: m["bronzelike"],
1398- catharticalness: m["catharticalness"],
1399- chirotherium: m["Chirotherium"],
1400- cholesteatomatous: m["cholesteatomatous"],
1401- deprivement: m["deprivement"],
1796+ agitable: m["agitable"] && decode_agitable(m["agitable"]),
1797+ asininity: m["asininity"] && decode_asininity(m["asininity"]),
1798+ benefiter: m["benefiter"] && decode_benefiter(m["benefiter"]),
1799+ bronzelike: m["bronzelike"] && decode_bronzelike(m["bronzelike"]),
1800+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
1801+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
1802+ cholesteatomatous: m["cholesteatomatous"] && decode_cholesteatomatous(m["cholesteatomatous"]),
1803+ deprivement: m["deprivement"] && decode_deprivement(m["deprivement"]),
14021804 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
1403- flippantness: m["flippantness"],
1404- fogproof: m["fogproof"],
1805+ flippantness: m["flippantness"] && decode_flippantness(m["flippantness"]),
1806+ fogproof: m["fogproof"] && decode_fogproof(m["fogproof"]),
14051807 homocerc: m["homocerc"],
1406- merrymeeting: m["merrymeeting"],
1808+ merrymeeting: m["merrymeeting"] && decode_merrymeeting(m["merrymeeting"]),
14071809 nonbookish: m["nonbookish"],
1408- overcareful: m["overcareful"],
1409- panaris: m["panaris"],
1410- preacceptance: m["preacceptance"],
1411- quinoxaline: m["quinoxaline"],
1412- sig: m["sig"],
1413- superconfusion: m["superconfusion"],
1414- tacana: m["Tacana"],
1415- tillotter: m["tillotter"],
1416- tranquillize: m["tranquillize"],
1417- unquestionable: m["unquestionable"],
1418- uproute: m["uproute"],
1810+ overcareful: m["overcareful"] && decode_overcareful(m["overcareful"]),
1811+ panaris: m["panaris"] && decode_panaris(m["panaris"]),
1812+ preacceptance: m["preacceptance"] && decode_preacceptance(m["preacceptance"]),
1813+ quinoxaline: m["quinoxaline"] && decode_quinoxaline(m["quinoxaline"]),
1814+ sig: m["sig"] && decode_sig(m["sig"]),
1815+ superconfusion: m["superconfusion"] && decode_superconfusion(m["superconfusion"]),
1816+ tacana: m["Tacana"] && decode_tacana(m["Tacana"]),
1817+ tillotter: m["tillotter"] && decode_tillotter(m["tillotter"]),
1818+ tranquillize: m["tranquillize"] && decode_tranquillize(m["tranquillize"]),
1819+ unquestionable: m["unquestionable"] && decode_unquestionable(m["unquestionable"]),
1820+ uproute: m["uproute"] && decode_uproute(m["uproute"]),
14191821 }
14201822 end
Test case

test/inputs/json/priority/combinations3.json

1 generated file · +500 −70
Melixirdefault / QuickType.ex+500 −70
@@ -666,39 +666,173 @@ defmodule LupusClass do
666666 vendible: integer() | nil
667667 }
668668
669+ def decode_catharticalness(value) when is_float(value), do: value
670+ def decode_catharticalness(value) when is_integer(value), do: value
671+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding LupusClass.catharticalness"}
672+
673+ def encode_catharticalness(value) when is_float(value), do: value
674+ def encode_catharticalness(value) when is_integer(value), do: value
675+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding LupusClass.catharticalness"}
676+
677+ def decode_chirotherium(value) when is_integer(value), do: value
678+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding LupusClass.chirotherium"}
679+
680+ def encode_chirotherium(value) when is_integer(value), do: value
681+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding LupusClass.chirotherium"}
682+
683+ def decode_chlorioninae(value) when is_integer(value), do: value
684+ def decode_chlorioninae(_), do: {:error, "Unexpected type when decoding LupusClass.chlorioninae"}
685+
686+ def encode_chlorioninae(value) when is_integer(value), do: value
687+ def encode_chlorioninae(_), do: {:error, "Unexpected type when encoding LupusClass.chlorioninae"}
688+
689+ def decode_corvinae(value) when is_integer(value), do: value
690+ def decode_corvinae(_), do: {:error, "Unexpected type when decoding LupusClass.corvinae"}
691+
692+ def encode_corvinae(value) when is_integer(value), do: value
693+ def encode_corvinae(_), do: {:error, "Unexpected type when encoding LupusClass.corvinae"}
694+
695+ def decode_crassina(value) when is_integer(value), do: value
696+ def decode_crassina(_), do: {:error, "Unexpected type when decoding LupusClass.crassina"}
697+
698+ def encode_crassina(value) when is_integer(value), do: value
699+ def encode_crassina(_), do: {:error, "Unexpected type when encoding LupusClass.crassina"}
700+
669701 def decode_disdiapason(value) when is_binary(value), do: value
670702 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding LupusClass.disdiapason"}
671703
672704 def encode_disdiapason(value) when is_binary(value), do: value
673705 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding LupusClass.disdiapason"}
674706
707+ def decode_exiguity(value) when is_integer(value), do: value
708+ def decode_exiguity(_), do: {:error, "Unexpected type when decoding LupusClass.exiguity"}
709+
710+ def encode_exiguity(value) when is_integer(value), do: value
711+ def encode_exiguity(_), do: {:error, "Unexpected type when encoding LupusClass.exiguity"}
712+
713+ def decode_farcist(value) when is_integer(value), do: value
714+ def decode_farcist(_), do: {:error, "Unexpected type when decoding LupusClass.farcist"}
715+
716+ def encode_farcist(value) when is_integer(value), do: value
717+ def encode_farcist(_), do: {:error, "Unexpected type when encoding LupusClass.farcist"}
718+
719+ def decode_holographical(value) when is_integer(value), do: value
720+ def decode_holographical(_), do: {:error, "Unexpected type when decoding LupusClass.holographical"}
721+
722+ def encode_holographical(value) when is_integer(value), do: value
723+ def encode_holographical(_), do: {:error, "Unexpected type when encoding LupusClass.holographical"}
724+
725+ def decode_ichthyophagan(value) when is_integer(value), do: value
726+ def decode_ichthyophagan(_), do: {:error, "Unexpected type when decoding LupusClass.ichthyophagan"}
727+
728+ def encode_ichthyophagan(value) when is_integer(value), do: value
729+ def encode_ichthyophagan(_), do: {:error, "Unexpected type when encoding LupusClass.ichthyophagan"}
730+
731+ def decode_implacable(value) when is_integer(value), do: value
732+ def decode_implacable(_), do: {:error, "Unexpected type when decoding LupusClass.implacable"}
733+
734+ def encode_implacable(value) when is_integer(value), do: value
735+ def encode_implacable(_), do: {:error, "Unexpected type when encoding LupusClass.implacable"}
736+
737+ def decode_outshiner(value) when is_integer(value), do: value
738+ def decode_outshiner(_), do: {:error, "Unexpected type when decoding LupusClass.outshiner"}
739+
740+ def encode_outshiner(value) when is_integer(value), do: value
741+ def encode_outshiner(_), do: {:error, "Unexpected type when encoding LupusClass.outshiner"}
742+
743+ def decode_overweather(value) when is_integer(value), do: value
744+ def decode_overweather(_), do: {:error, "Unexpected type when decoding LupusClass.overweather"}
745+
746+ def encode_overweather(value) when is_integer(value), do: value
747+ def encode_overweather(_), do: {:error, "Unexpected type when encoding LupusClass.overweather"}
748+
749+ def decode_protonegroid(value) when is_integer(value), do: value
750+ def decode_protonegroid(_), do: {:error, "Unexpected type when decoding LupusClass.protonegroid"}
751+
752+ def encode_protonegroid(value) when is_integer(value), do: value
753+ def encode_protonegroid(_), do: {:error, "Unexpected type when encoding LupusClass.protonegroid"}
754+
755+ def decode_shallowish(value) when is_integer(value), do: value
756+ def decode_shallowish(_), do: {:error, "Unexpected type when decoding LupusClass.shallowish"}
757+
758+ def encode_shallowish(value) when is_integer(value), do: value
759+ def encode_shallowish(_), do: {:error, "Unexpected type when encoding LupusClass.shallowish"}
760+
761+ def decode_snoke(value) when is_integer(value), do: value
762+ def decode_snoke(_), do: {:error, "Unexpected type when decoding LupusClass.snoke"}
763+
764+ def encode_snoke(value) when is_integer(value), do: value
765+ def encode_snoke(_), do: {:error, "Unexpected type when encoding LupusClass.snoke"}
766+
767+ def decode_snout(value) when is_integer(value), do: value
768+ def decode_snout(_), do: {:error, "Unexpected type when decoding LupusClass.snout"}
769+
770+ def encode_snout(value) when is_integer(value), do: value
771+ def encode_snout(_), do: {:error, "Unexpected type when encoding LupusClass.snout"}
772+
773+ def decode_surveillance(value) when is_integer(value), do: value
774+ def decode_surveillance(_), do: {:error, "Unexpected type when decoding LupusClass.surveillance"}
775+
776+ def encode_surveillance(value) when is_integer(value), do: value
777+ def encode_surveillance(_), do: {:error, "Unexpected type when encoding LupusClass.surveillance"}
778+
779+ def decode_threshingtime(value) when is_integer(value), do: value
780+ def decode_threshingtime(_), do: {:error, "Unexpected type when decoding LupusClass.threshingtime"}
781+
782+ def encode_threshingtime(value) when is_integer(value), do: value
783+ def encode_threshingtime(_), do: {:error, "Unexpected type when encoding LupusClass.threshingtime"}
784+
785+ def decode_thysanocarpus(value) when is_integer(value), do: value
786+ def decode_thysanocarpus(_), do: {:error, "Unexpected type when decoding LupusClass.thysanocarpus"}
787+
788+ def encode_thysanocarpus(value) when is_integer(value), do: value
789+ def encode_thysanocarpus(_), do: {:error, "Unexpected type when encoding LupusClass.thysanocarpus"}
790+
791+ def decode_unsignificantly(value) when is_integer(value), do: value
792+ def decode_unsignificantly(_), do: {:error, "Unexpected type when decoding LupusClass.unsignificantly"}
793+
794+ def encode_unsignificantly(value) when is_integer(value), do: value
795+ def encode_unsignificantly(_), do: {:error, "Unexpected type when encoding LupusClass.unsignificantly"}
796+
797+ def decode_unsnap(value) when is_integer(value), do: value
798+ def decode_unsnap(_), do: {:error, "Unexpected type when decoding LupusClass.unsnap"}
799+
800+ def encode_unsnap(value) when is_integer(value), do: value
801+ def encode_unsnap(_), do: {:error, "Unexpected type when encoding LupusClass.unsnap"}
802+
803+ def decode_vendible(value) when is_integer(value), do: value
804+ def decode_vendible(_), do: {:error, "Unexpected type when decoding LupusClass.vendible"}
805+
806+ def encode_vendible(value) when is_integer(value), do: value
807+ def encode_vendible(_), do: {:error, "Unexpected type when encoding LupusClass.vendible"}
808+
675809 def from_map(m) do
676810 %LupusClass{
677- catharticalness: m["catharticalness"],
678- chirotherium: m["Chirotherium"],
679- chlorioninae: m["Chlorioninae"],
680- corvinae: m["Corvinae"],
681- crassina: m["Crassina"],
811+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
812+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
813+ chlorioninae: m["Chlorioninae"] && decode_chlorioninae(m["Chlorioninae"]),
814+ corvinae: m["Corvinae"] && decode_corvinae(m["Corvinae"]),
815+ crassina: m["Crassina"] && decode_crassina(m["Crassina"]),
682816 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
683- exiguity: m["exiguity"],
684- farcist: m["farcist"],
685- holographical: m["holographical"],
817+ exiguity: m["exiguity"] && decode_exiguity(m["exiguity"]),
818+ farcist: m["farcist"] && decode_farcist(m["farcist"]),
819+ holographical: m["holographical"] && decode_holographical(m["holographical"]),
686820 homocerc: m["homocerc"],
687- ichthyophagan: m["ichthyophagan"],
688- implacable: m["implacable"],
821+ ichthyophagan: m["ichthyophagan"] && decode_ichthyophagan(m["ichthyophagan"]),
822+ implacable: m["implacable"] && decode_implacable(m["implacable"]),
689823 nonbookish: m["nonbookish"],
690- outshiner: m["outshiner"],
691- overweather: m["overweather"],
692- protonegroid: m["protonegroid"],
693- shallowish: m["shallowish"],
694- snoke: m["snoke"],
695- snout: m["snout"],
696- surveillance: m["surveillance"],
697- threshingtime: m["threshingtime"],
698- thysanocarpus: m["Thysanocarpus"],
699- unsignificantly: m["unsignificantly"],
700- unsnap: m["unsnap"],
701- vendible: m["vendible"],
824+ outshiner: m["outshiner"] && decode_outshiner(m["outshiner"]),
825+ overweather: m["overweather"] && decode_overweather(m["overweather"]),
826+ protonegroid: m["protonegroid"] && decode_protonegroid(m["protonegroid"]),
827+ shallowish: m["shallowish"] && decode_shallowish(m["shallowish"]),
828+ snoke: m["snoke"] && decode_snoke(m["snoke"]),
829+ snout: m["snout"] && decode_snout(m["snout"]),
830+ surveillance: m["surveillance"] && decode_surveillance(m["surveillance"]),
831+ threshingtime: m["threshingtime"] && decode_threshingtime(m["threshingtime"]),
832+ thysanocarpus: m["Thysanocarpus"] && decode_thysanocarpus(m["Thysanocarpus"]),
833+ unsignificantly: m["unsignificantly"] && decode_unsignificantly(m["unsignificantly"]),
834+ unsnap: m["unsnap"] && decode_unsnap(m["unsnap"]),
835+ vendible: m["vendible"] && decode_vendible(m["vendible"]),
702836 }
703837 end
704838
@@ -796,57 +930,191 @@ defmodule Maslin do
796930 unjudiciously: nil | nil
797931 }
798932
933+ def decode_alicant(value) when is_integer(value), do: value
934+ def decode_alicant(_), do: {:error, "Unexpected type when decoding Maslin.alicant"}
935+
936+ def encode_alicant(value) when is_integer(value), do: value
937+ def encode_alicant(_), do: {:error, "Unexpected type when encoding Maslin.alicant"}
938+
939+ def decode_anticorrosive(value) when is_integer(value), do: value
940+ def decode_anticorrosive(_), do: {:error, "Unexpected type when decoding Maslin.anticorrosive"}
941+
942+ def encode_anticorrosive(value) when is_integer(value), do: value
943+ def encode_anticorrosive(_), do: {:error, "Unexpected type when encoding Maslin.anticorrosive"}
944+
945+ def decode_be(value) when is_integer(value), do: value
946+ def decode_be(_), do: {:error, "Unexpected type when decoding Maslin.be"}
947+
948+ def encode_be(value) when is_integer(value), do: value
949+ def encode_be(_), do: {:error, "Unexpected type when encoding Maslin.be"}
950+
951+ def decode_catharticalness(value) when is_float(value), do: value
952+ def decode_catharticalness(value) when is_integer(value), do: value
953+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding Maslin.catharticalness"}
954+
955+ def encode_catharticalness(value) when is_float(value), do: value
956+ def encode_catharticalness(value) when is_integer(value), do: value
957+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding Maslin.catharticalness"}
958+
959+ def decode_chirotherium(value) when is_integer(value), do: value
960+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding Maslin.chirotherium"}
961+
962+ def encode_chirotherium(value) when is_integer(value), do: value
963+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding Maslin.chirotherium"}
964+
965+ def decode_chub(value) when is_integer(value), do: value
966+ def decode_chub(_), do: {:error, "Unexpected type when decoding Maslin.chub"}
967+
968+ def encode_chub(value) when is_integer(value), do: value
969+ def encode_chub(_), do: {:error, "Unexpected type when encoding Maslin.chub"}
970+
971+ def decode_cuprosilicon(value) when is_integer(value), do: value
972+ def decode_cuprosilicon(_), do: {:error, "Unexpected type when decoding Maslin.cuprosilicon"}
973+
974+ def encode_cuprosilicon(value) when is_integer(value), do: value
975+ def encode_cuprosilicon(_), do: {:error, "Unexpected type when encoding Maslin.cuprosilicon"}
976+
977+ def decode_curtailedly(value) when is_integer(value), do: value
978+ def decode_curtailedly(_), do: {:error, "Unexpected type when decoding Maslin.curtailedly"}
979+
980+ def encode_curtailedly(value) when is_integer(value), do: value
981+ def encode_curtailedly(_), do: {:error, "Unexpected type when encoding Maslin.curtailedly"}
982+
983+ def decode_dellenite(value) when is_integer(value), do: value
984+ def decode_dellenite(_), do: {:error, "Unexpected type when decoding Maslin.dellenite"}
985+
986+ def encode_dellenite(value) when is_integer(value), do: value
987+ def encode_dellenite(_), do: {:error, "Unexpected type when encoding Maslin.dellenite"}
988+
989+ def decode_dimitry(value) when is_integer(value), do: value
990+ def decode_dimitry(_), do: {:error, "Unexpected type when decoding Maslin.dimitry"}
991+
992+ def encode_dimitry(value) when is_integer(value), do: value
993+ def encode_dimitry(_), do: {:error, "Unexpected type when encoding Maslin.dimitry"}
994+
799995 def decode_disdiapason(value) when is_binary(value), do: value
800996 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Maslin.disdiapason"}
801997
802998 def encode_disdiapason(value) when is_binary(value), do: value
803999 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Maslin.disdiapason"}
8041000
1001+ def decode_ethmoiditis(value) when is_integer(value), do: value
1002+ def decode_ethmoiditis(_), do: {:error, "Unexpected type when decoding Maslin.ethmoiditis"}
1003+
1004+ def encode_ethmoiditis(value) when is_integer(value), do: value
1005+ def encode_ethmoiditis(_), do: {:error, "Unexpected type when encoding Maslin.ethmoiditis"}
1006+
1007+ def decode_goatherd(value) when is_integer(value), do: value
1008+ def decode_goatherd(_), do: {:error, "Unexpected type when decoding Maslin.goatherd"}
1009+
1010+ def encode_goatherd(value) when is_integer(value), do: value
1011+ def encode_goatherd(_), do: {:error, "Unexpected type when encoding Maslin.goatherd"}
1012+
1013+ def decode_hammerdress(value) when is_integer(value), do: value
1014+ def decode_hammerdress(_), do: {:error, "Unexpected type when decoding Maslin.hammerdress"}
1015+
1016+ def encode_hammerdress(value) when is_integer(value), do: value
1017+ def encode_hammerdress(_), do: {:error, "Unexpected type when encoding Maslin.hammerdress"}
1018+
1019+ def decode_lacunosity(value) when is_integer(value), do: value
1020+ def decode_lacunosity(_), do: {:error, "Unexpected type when decoding Maslin.lacunosity"}
1021+
1022+ def encode_lacunosity(value) when is_integer(value), do: value
1023+ def encode_lacunosity(_), do: {:error, "Unexpected type when encoding Maslin.lacunosity"}
1024+
1025+ def decode_mameliere(value) when is_integer(value), do: value
1026+ def decode_mameliere(_), do: {:error, "Unexpected type when decoding Maslin.mameliere"}
1027+
1028+ def encode_mameliere(value) when is_integer(value), do: value
1029+ def encode_mameliere(_), do: {:error, "Unexpected type when encoding Maslin.mameliere"}
1030+
1031+ def decode_oafishly(value) when is_integer(value), do: value
1032+ def decode_oafishly(_), do: {:error, "Unexpected type when decoding Maslin.oafishly"}
1033+
1034+ def encode_oafishly(value) when is_integer(value), do: value
1035+ def encode_oafishly(_), do: {:error, "Unexpected type when encoding Maslin.oafishly"}
1036+
1037+ def decode_saccharulmic(value) when is_integer(value), do: value
1038+ def decode_saccharulmic(_), do: {:error, "Unexpected type when decoding Maslin.saccharulmic"}
1039+
1040+ def encode_saccharulmic(value) when is_integer(value), do: value
1041+ def encode_saccharulmic(_), do: {:error, "Unexpected type when encoding Maslin.saccharulmic"}
1042+
1043+ def decode_scowlful(value) when is_integer(value), do: value
1044+ def decode_scowlful(_), do: {:error, "Unexpected type when decoding Maslin.scowlful"}
1045+
1046+ def encode_scowlful(value) when is_integer(value), do: value
1047+ def encode_scowlful(_), do: {:error, "Unexpected type when encoding Maslin.scowlful"}
1048+
1049+ def decode_sphaeridial(value) when is_integer(value), do: value
1050+ def decode_sphaeridial(_), do: {:error, "Unexpected type when decoding Maslin.sphaeridial"}
1051+
1052+ def encode_sphaeridial(value) when is_integer(value), do: value
1053+ def encode_sphaeridial(_), do: {:error, "Unexpected type when encoding Maslin.sphaeridial"}
1054+
1055+ def decode_subsecive(value) when is_integer(value), do: value
1056+ def decode_subsecive(_), do: {:error, "Unexpected type when decoding Maslin.subsecive"}
1057+
1058+ def encode_subsecive(value) when is_integer(value), do: value
1059+ def encode_subsecive(_), do: {:error, "Unexpected type when encoding Maslin.subsecive"}
1060+
1061+ def decode_trachyglossate(value) when is_integer(value), do: value
1062+ def decode_trachyglossate(_), do: {:error, "Unexpected type when decoding Maslin.trachyglossate"}
1063+
1064+ def encode_trachyglossate(value) when is_integer(value), do: value
1065+ def encode_trachyglossate(_), do: {:error, "Unexpected type when encoding Maslin.trachyglossate"}
1066+
1067+ def decode_unassuaged(value) when is_integer(value), do: value
1068+ def decode_unassuaged(_), do: {:error, "Unexpected type when decoding Maslin.unassuaged"}
1069+
1070+ def encode_unassuaged(value) when is_integer(value), do: value
1071+ def encode_unassuaged(_), do: {:error, "Unexpected type when encoding Maslin.unassuaged"}
1072+
8051073 def from_map(m) do
8061074 %Maslin{
807- alicant: m["Alicant"],
1075+ alicant: m["Alicant"] && decode_alicant(m["Alicant"]),
8081076 antiatonement: m["antiatonement"],
809- anticorrosive: m["anticorrosive"],
1077+ anticorrosive: m["anticorrosive"] && decode_anticorrosive(m["anticorrosive"]),
8101078 aphidozer: m["aphidozer"],
8111079 bakuninist: m["Bakuninist"],
812- be: m["be"],
813- catharticalness: m["catharticalness"],
814- chirotherium: m["Chirotherium"],
815- chub: m["chub"],
816- cuprosilicon: m["cuprosilicon"],
817- curtailedly: m["curtailedly"],
818- dellenite: m["dellenite"],
819- dimitry: m["Dimitry"],
1080+ be: m["be"] && decode_be(m["be"]),
1081+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
1082+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
1083+ chub: m["chub"] && decode_chub(m["chub"]),
1084+ cuprosilicon: m["cuprosilicon"] && decode_cuprosilicon(m["cuprosilicon"]),
1085+ curtailedly: m["curtailedly"] && decode_curtailedly(m["curtailedly"]),
1086+ dellenite: m["dellenite"] && decode_dellenite(m["dellenite"]),
1087+ dimitry: m["Dimitry"] && decode_dimitry(m["Dimitry"]),
8201088 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
8211089 edifying: m["edifying"],
822- ethmoiditis: m["ethmoiditis"],
1090+ ethmoiditis: m["ethmoiditis"] && decode_ethmoiditis(m["ethmoiditis"]),
8231091 gastralgy: m["gastralgy"],
824- goatherd: m["goatherd"],
825- hammerdress: m["hammerdress"],
1092+ goatherd: m["goatherd"] && decode_goatherd(m["goatherd"]),
1093+ hammerdress: m["hammerdress"] && decode_hammerdress(m["hammerdress"]),
8261094 hangfire: m["hangfire"],
8271095 homocerc: m["homocerc"],
828- lacunosity: m["lacunosity"],
1096+ lacunosity: m["lacunosity"] && decode_lacunosity(m["lacunosity"]),
8291097 longiloquence: m["longiloquence"],
830- mameliere: m["mameliere"],
1098+ mameliere: m["mameliere"] && decode_mameliere(m["mameliere"]),
8311099 motherless: m["motherless"],
8321100 nonbookish: m["nonbookish"],
8331101 noncorrodible: m["noncorrodible"],
8341102 nonsensicality: m["nonsensicality"],
835- oafishly: m["oafishly"],
1103+ oafishly: m["oafishly"] && decode_oafishly(m["oafishly"]),
8361104 pfund: m["pfund"],
8371105 preadvisory: m["preadvisory"],
8381106 retroflexed: m["retroflexed"],
839- saccharulmic: m["saccharulmic"],
840- scowlful: m["scowlful"],
1107+ saccharulmic: m["saccharulmic"] && decode_saccharulmic(m["saccharulmic"]),
1108+ scowlful: m["scowlful"] && decode_scowlful(m["scowlful"]),
8411109 secluded: m["secluded"],
8421110 slackage: m["slackage"],
843- sphaeridial: m["sphaeridial"],
1111+ sphaeridial: m["sphaeridial"] && decode_sphaeridial(m["sphaeridial"]),
8441112 spondulics: m["spondulics"],
845- subsecive: m["subsecive"],
1113+ subsecive: m["subsecive"] && decode_subsecive(m["subsecive"]),
8461114 swellmobsman: m["swellmobsman"],
847- trachyglossate: m["trachyglossate"],
1115+ trachyglossate: m["trachyglossate"] && decode_trachyglossate(m["trachyglossate"]),
8481116 trialogue: m["trialogue"],
849- unassuaged: m["unassuaged"],
1117+ unassuaged: m["unassuaged"] && decode_unassuaged(m["unassuaged"]),
8501118 ungross: m["ungross"],
8511119 unjudiciously: m["unjudiciously"],
8521120 }
@@ -1023,6 +1291,20 @@ defmodule MonotheisticallyClass do
10231291 whitestone: nil | nil
10241292 }
10251293
1294+ def decode_catharticalness(value) when is_float(value), do: value
1295+ def decode_catharticalness(value) when is_integer(value), do: value
1296+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding MonotheisticallyClass.catharticalness"}
1297+
1298+ def encode_catharticalness(value) when is_float(value), do: value
1299+ def encode_catharticalness(value) when is_integer(value), do: value
1300+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding MonotheisticallyClass.catharticalness"}
1301+
1302+ def decode_chirotherium(value) when is_integer(value), do: value
1303+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding MonotheisticallyClass.chirotherium"}
1304+
1305+ def encode_chirotherium(value) when is_integer(value), do: value
1306+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding MonotheisticallyClass.chirotherium"}
1307+
10261308 def decode_disdiapason(value) when is_binary(value), do: value
10271309 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding MonotheisticallyClass.disdiapason"}
10281310
@@ -1032,9 +1314,9 @@ defmodule MonotheisticallyClass do
10321314 def from_map(m) do
10331315 %MonotheisticallyClass{
10341316 blaspheme: m["blaspheme"],
1035- catharticalness: m["catharticalness"],
1317+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
10361318 celiosalpingectomy: m["celiosalpingectomy"],
1037- chirotherium: m["Chirotherium"],
1319+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
10381320 consummativeness: m["consummativeness"],
10391321 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
10401322 egestive: m["egestive"],
@@ -1630,39 +1912,173 @@ defmodule PiaculumClass do
16301912 zipper: integer() | nil
16311913 }
16321914
1915+ def decode_alada(value) when is_integer(value), do: value
1916+ def decode_alada(_), do: {:error, "Unexpected type when decoding PiaculumClass.alada"}
1917+
1918+ def encode_alada(value) when is_integer(value), do: value
1919+ def encode_alada(_), do: {:error, "Unexpected type when encoding PiaculumClass.alada"}
1920+
1921+ def decode_amphistomous(value) when is_integer(value), do: value
1922+ def decode_amphistomous(_), do: {:error, "Unexpected type when decoding PiaculumClass.amphistomous"}
1923+
1924+ def encode_amphistomous(value) when is_integer(value), do: value
1925+ def encode_amphistomous(_), do: {:error, "Unexpected type when encoding PiaculumClass.amphistomous"}
1926+
1927+ def decode_boysenberry(value) when is_integer(value), do: value
1928+ def decode_boysenberry(_), do: {:error, "Unexpected type when decoding PiaculumClass.boysenberry"}
1929+
1930+ def encode_boysenberry(value) when is_integer(value), do: value
1931+ def encode_boysenberry(_), do: {:error, "Unexpected type when encoding PiaculumClass.boysenberry"}
1932+
1933+ def decode_catharticalness(value) when is_float(value), do: value
1934+ def decode_catharticalness(value) when is_integer(value), do: value
1935+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding PiaculumClass.catharticalness"}
1936+
1937+ def encode_catharticalness(value) when is_float(value), do: value
1938+ def encode_catharticalness(value) when is_integer(value), do: value
1939+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding PiaculumClass.catharticalness"}
1940+
1941+ def decode_chirotherium(value) when is_integer(value), do: value
1942+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding PiaculumClass.chirotherium"}
1943+
1944+ def encode_chirotherium(value) when is_integer(value), do: value
1945+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding PiaculumClass.chirotherium"}
1946+
1947+ def decode_decardinalize(value) when is_integer(value), do: value
1948+ def decode_decardinalize(_), do: {:error, "Unexpected type when decoding PiaculumClass.decardinalize"}
1949+
1950+ def encode_decardinalize(value) when is_integer(value), do: value
1951+ def encode_decardinalize(_), do: {:error, "Unexpected type when encoding PiaculumClass.decardinalize"}
1952+
1953+ def decode_discouragement(value) when is_integer(value), do: value
1954+ def decode_discouragement(_), do: {:error, "Unexpected type when decoding PiaculumClass.discouragement"}
1955+
1956+ def encode_discouragement(value) when is_integer(value), do: value
1957+ def encode_discouragement(_), do: {:error, "Unexpected type when encoding PiaculumClass.discouragement"}
1958+
16331959 def decode_disdiapason(value) when is_binary(value), do: value
16341960 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding PiaculumClass.disdiapason"}
16351961
16361962 def encode_disdiapason(value) when is_binary(value), do: value
16371963 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding PiaculumClass.disdiapason"}
16381964
1965+ def decode_doitrified(value) when is_integer(value), do: value
1966+ def decode_doitrified(_), do: {:error, "Unexpected type when decoding PiaculumClass.doitrified"}
1967+
1968+ def encode_doitrified(value) when is_integer(value), do: value
1969+ def encode_doitrified(_), do: {:error, "Unexpected type when encoding PiaculumClass.doitrified"}
1970+
1971+ def decode_hexaspermous(value) when is_integer(value), do: value
1972+ def decode_hexaspermous(_), do: {:error, "Unexpected type when decoding PiaculumClass.hexaspermous"}
1973+
1974+ def encode_hexaspermous(value) when is_integer(value), do: value
1975+ def encode_hexaspermous(_), do: {:error, "Unexpected type when encoding PiaculumClass.hexaspermous"}
1976+
1977+ def decode_insinking(value) when is_integer(value), do: value
1978+ def decode_insinking(_), do: {:error, "Unexpected type when decoding PiaculumClass.insinking"}
1979+
1980+ def encode_insinking(value) when is_integer(value), do: value
1981+ def encode_insinking(_), do: {:error, "Unexpected type when encoding PiaculumClass.insinking"}
1982+
1983+ def decode_loathfulness(value) when is_integer(value), do: value
1984+ def decode_loathfulness(_), do: {:error, "Unexpected type when decoding PiaculumClass.loathfulness"}
1985+
1986+ def encode_loathfulness(value) when is_integer(value), do: value
1987+ def encode_loathfulness(_), do: {:error, "Unexpected type when encoding PiaculumClass.loathfulness"}
1988+
1989+ def decode_miasmatical(value) when is_integer(value), do: value
1990+ def decode_miasmatical(_), do: {:error, "Unexpected type when decoding PiaculumClass.miasmatical"}
1991+
1992+ def encode_miasmatical(value) when is_integer(value), do: value
1993+ def encode_miasmatical(_), do: {:error, "Unexpected type when encoding PiaculumClass.miasmatical"}
1994+
1995+ def decode_neurofibril(value) when is_integer(value), do: value
1996+ def decode_neurofibril(_), do: {:error, "Unexpected type when decoding PiaculumClass.neurofibril"}
1997+
1998+ def encode_neurofibril(value) when is_integer(value), do: value
1999+ def encode_neurofibril(_), do: {:error, "Unexpected type when encoding PiaculumClass.neurofibril"}
2000+
2001+ def decode_phonendoscope(value) when is_integer(value), do: value
2002+ def decode_phonendoscope(_), do: {:error, "Unexpected type when decoding PiaculumClass.phonendoscope"}
2003+
2004+ def encode_phonendoscope(value) when is_integer(value), do: value
2005+ def encode_phonendoscope(_), do: {:error, "Unexpected type when encoding PiaculumClass.phonendoscope"}
2006+
2007+ def decode_pilferment(value) when is_integer(value), do: value
2008+ def decode_pilferment(_), do: {:error, "Unexpected type when decoding PiaculumClass.pilferment"}
2009+
2010+ def encode_pilferment(value) when is_integer(value), do: value
2011+ def encode_pilferment(_), do: {:error, "Unexpected type when encoding PiaculumClass.pilferment"}
2012+
2013+ def decode_predismissory(value) when is_integer(value), do: value
2014+ def decode_predismissory(_), do: {:error, "Unexpected type when decoding PiaculumClass.predismissory"}
2015+
2016+ def encode_predismissory(value) when is_integer(value), do: value
2017+ def encode_predismissory(_), do: {:error, "Unexpected type when encoding PiaculumClass.predismissory"}
2018+
2019+ def decode_preinscription(value) when is_integer(value), do: value
2020+ def decode_preinscription(_), do: {:error, "Unexpected type when decoding PiaculumClass.preinscription"}
2021+
2022+ def encode_preinscription(value) when is_integer(value), do: value
2023+ def encode_preinscription(_), do: {:error, "Unexpected type when encoding PiaculumClass.preinscription"}
2024+
2025+ def decode_quotative(value) when is_integer(value), do: value
2026+ def decode_quotative(_), do: {:error, "Unexpected type when decoding PiaculumClass.quotative"}
2027+
2028+ def encode_quotative(value) when is_integer(value), do: value
2029+ def encode_quotative(_), do: {:error, "Unexpected type when encoding PiaculumClass.quotative"}
2030+
2031+ def decode_sienna(value) when is_integer(value), do: value
2032+ def decode_sienna(_), do: {:error, "Unexpected type when decoding PiaculumClass.sienna"}
2033+
2034+ def encode_sienna(value) when is_integer(value), do: value
2035+ def encode_sienna(_), do: {:error, "Unexpected type when encoding PiaculumClass.sienna"}
2036+
2037+ def decode_thorax(value) when is_integer(value), do: value
2038+ def decode_thorax(_), do: {:error, "Unexpected type when decoding PiaculumClass.thorax"}
2039+
2040+ def encode_thorax(value) when is_integer(value), do: value
2041+ def encode_thorax(_), do: {:error, "Unexpected type when encoding PiaculumClass.thorax"}
2042+
2043+ def decode_yachting(value) when is_integer(value), do: value
2044+ def decode_yachting(_), do: {:error, "Unexpected type when decoding PiaculumClass.yachting"}
2045+
2046+ def encode_yachting(value) when is_integer(value), do: value
2047+ def encode_yachting(_), do: {:error, "Unexpected type when encoding PiaculumClass.yachting"}
2048+
2049+ def decode_zipper(value) when is_integer(value), do: value
2050+ def decode_zipper(_), do: {:error, "Unexpected type when decoding PiaculumClass.zipper"}
2051+
2052+ def encode_zipper(value) when is_integer(value), do: value
2053+ def encode_zipper(_), do: {:error, "Unexpected type when encoding PiaculumClass.zipper"}
2054+
16392055 def from_map(m) do
16402056 %PiaculumClass{
1641- alada: m["alada"],
1642- amphistomous: m["amphistomous"],
1643- boysenberry: m["boysenberry"],
1644- catharticalness: m["catharticalness"],
1645- chirotherium: m["Chirotherium"],
1646- decardinalize: m["decardinalize"],
1647- discouragement: m["discouragement"],
2057+ alada: m["alada"] && decode_alada(m["alada"]),
2058+ amphistomous: m["amphistomous"] && decode_amphistomous(m["amphistomous"]),
2059+ boysenberry: m["boysenberry"] && decode_boysenberry(m["boysenberry"]),
2060+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
2061+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
2062+ decardinalize: m["decardinalize"] && decode_decardinalize(m["decardinalize"]),
2063+ discouragement: m["discouragement"] && decode_discouragement(m["discouragement"]),
16482064 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
1649- doitrified: m["doitrified"],
1650- hexaspermous: m["hexaspermous"],
2065+ doitrified: m["doitrified"] && decode_doitrified(m["doitrified"]),
2066+ hexaspermous: m["hexaspermous"] && decode_hexaspermous(m["hexaspermous"]),
16512067 homocerc: m["homocerc"],
1652- insinking: m["insinking"],
1653- loathfulness: m["loathfulness"],
1654- miasmatical: m["miasmatical"],
1655- neurofibril: m["neurofibril"],
2068+ insinking: m["insinking"] && decode_insinking(m["insinking"]),
2069+ loathfulness: m["loathfulness"] && decode_loathfulness(m["loathfulness"]),
2070+ miasmatical: m["miasmatical"] && decode_miasmatical(m["miasmatical"]),
2071+ neurofibril: m["neurofibril"] && decode_neurofibril(m["neurofibril"]),
16562072 nonbookish: m["nonbookish"],
1657- phonendoscope: m["phonendoscope"],
1658- pilferment: m["pilferment"],
1659- predismissory: m["predismissory"],
1660- preinscription: m["preinscription"],
1661- quotative: m["quotative"],
1662- sienna: m["sienna"],
1663- thorax: m["thorax"],
1664- yachting: m["yachting"],
1665- zipper: m["Zipper"],
2073+ phonendoscope: m["phonendoscope"] && decode_phonendoscope(m["phonendoscope"]),
2074+ pilferment: m["pilferment"] && decode_pilferment(m["pilferment"]),
2075+ predismissory: m["predismissory"] && decode_predismissory(m["predismissory"]),
2076+ preinscription: m["preinscription"] && decode_preinscription(m["preinscription"]),
2077+ quotative: m["quotative"] && decode_quotative(m["quotative"]),
2078+ sienna: m["sienna"] && decode_sienna(m["sienna"]),
2079+ thorax: m["thorax"] && decode_thorax(m["thorax"]),
2080+ yachting: m["yachting"] && decode_yachting(m["yachting"]),
2081+ zipper: m["Zipper"] && decode_zipper(m["Zipper"]),
16662082 }
16672083 end
16682084
@@ -1740,6 +2156,20 @@ defmodule Pneumocele do
17402156 visitorial: nil | nil
17412157 }
17422158
2159+ def decode_catharticalness(value) when is_float(value), do: value
2160+ def decode_catharticalness(value) when is_integer(value), do: value
2161+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding Pneumocele.catharticalness"}
2162+
2163+ def encode_catharticalness(value) when is_float(value), do: value
2164+ def encode_catharticalness(value) when is_integer(value), do: value
2165+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding Pneumocele.catharticalness"}
2166+
2167+ def decode_chirotherium(value) when is_integer(value), do: value
2168+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding Pneumocele.chirotherium"}
2169+
2170+ def encode_chirotherium(value) when is_integer(value), do: value
2171+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding Pneumocele.chirotherium"}
2172+
17432173 def decode_disdiapason(value) when is_binary(value), do: value
17442174 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Pneumocele.disdiapason"}
17452175
@@ -1749,8 +2179,8 @@ defmodule Pneumocele do
17492179 def from_map(m) do
17502180 %Pneumocele{
17512181 carbonarism: m["Carbonarism"],
1752- catharticalness: m["catharticalness"],
1753- chirotherium: m["Chirotherium"],
2182+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
2183+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
17542184 cineolic: m["cineolic"],
17552185 cobbly: m["cobbly"],
17562186 conchyliferous: m["conchyliferous"],
Test case

test/inputs/json/priority/combinations4.json

1 generated file · +516 −72
Melixirdefault / QuickType.ex+516 −72
@@ -533,6 +533,20 @@ defmodule Reimagine do
533533 waltzlike: nil | nil
534534 }
535535
536+ def decode_catharticalness(value) when is_float(value), do: value
537+ def decode_catharticalness(value) when is_integer(value), do: value
538+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding Reimagine.catharticalness"}
539+
540+ def encode_catharticalness(value) when is_float(value), do: value
541+ def encode_catharticalness(value) when is_integer(value), do: value
542+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding Reimagine.catharticalness"}
543+
544+ def decode_chirotherium(value) when is_integer(value), do: value
545+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding Reimagine.chirotherium"}
546+
547+ def encode_chirotherium(value) when is_integer(value), do: value
548+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding Reimagine.chirotherium"}
549+
536550 def decode_disdiapason(value) when is_binary(value), do: value
537551 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Reimagine.disdiapason"}
538552
@@ -544,8 +558,8 @@ defmodule Reimagine do
544558 adducible: m["adducible"],
545559 anabolin: m["anabolin"],
546560 brainy: m["brainy"],
547- catharticalness: m["catharticalness"],
548- chirotherium: m["Chirotherium"],
561+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
562+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
549563 chrysamine: m["chrysamine"],
550564 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
551565 fluxweed: m["fluxweed"],
@@ -1273,6 +1287,20 @@ defmodule SaxtenClass do
12731287 withdrawnness: nil | nil
12741288 }
12751289
1290+ def decode_catharticalness(value) when is_float(value), do: value
1291+ def decode_catharticalness(value) when is_integer(value), do: value
1292+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding SaxtenClass.catharticalness"}
1293+
1294+ def encode_catharticalness(value) when is_float(value), do: value
1295+ def encode_catharticalness(value) when is_integer(value), do: value
1296+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding SaxtenClass.catharticalness"}
1297+
1298+ def decode_chirotherium(value) when is_integer(value), do: value
1299+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding SaxtenClass.chirotherium"}
1300+
1301+ def encode_chirotherium(value) when is_integer(value), do: value
1302+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding SaxtenClass.chirotherium"}
1303+
12761304 def decode_disdiapason(value) when is_binary(value), do: value
12771305 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding SaxtenClass.disdiapason"}
12781306
@@ -1283,9 +1311,9 @@ defmodule SaxtenClass do
12831311 %SaxtenClass{
12841312 algarrobilla: m["algarrobilla"],
12851313 bowgrace: m["bowgrace"],
1286- catharticalness: m["catharticalness"],
1314+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
12871315 centaurid: m["Centaurid"],
1288- chirotherium: m["Chirotherium"],
1316+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
12891317 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
12901318 flix: m["flix"],
12911319 germanely: m["germanely"],
@@ -1803,39 +1831,173 @@ defmodule Staghunting do
18031831 ungirlish: integer() | nil
18041832 }
18051833
1834+ def decode_calorimetric(value) when is_integer(value), do: value
1835+ def decode_calorimetric(_), do: {:error, "Unexpected type when decoding Staghunting.calorimetric"}
1836+
1837+ def encode_calorimetric(value) when is_integer(value), do: value
1838+ def encode_calorimetric(_), do: {:error, "Unexpected type when encoding Staghunting.calorimetric"}
1839+
1840+ def decode_canid(value) when is_integer(value), do: value
1841+ def decode_canid(_), do: {:error, "Unexpected type when decoding Staghunting.canid"}
1842+
1843+ def encode_canid(value) when is_integer(value), do: value
1844+ def encode_canid(_), do: {:error, "Unexpected type when encoding Staghunting.canid"}
1845+
1846+ def decode_catharticalness(value) when is_float(value), do: value
1847+ def decode_catharticalness(value) when is_integer(value), do: value
1848+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding Staghunting.catharticalness"}
1849+
1850+ def encode_catharticalness(value) when is_float(value), do: value
1851+ def encode_catharticalness(value) when is_integer(value), do: value
1852+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding Staghunting.catharticalness"}
1853+
1854+ def decode_chirotherium(value) when is_integer(value), do: value
1855+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding Staghunting.chirotherium"}
1856+
1857+ def encode_chirotherium(value) when is_integer(value), do: value
1858+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding Staghunting.chirotherium"}
1859+
18061860 def decode_disdiapason(value) when is_binary(value), do: value
18071861 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Staghunting.disdiapason"}
18081862
18091863 def encode_disdiapason(value) when is_binary(value), do: value
18101864 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Staghunting.disdiapason"}
18111865
1866+ def decode_ditriglyphic(value) when is_integer(value), do: value
1867+ def decode_ditriglyphic(_), do: {:error, "Unexpected type when decoding Staghunting.ditriglyphic"}
1868+
1869+ def encode_ditriglyphic(value) when is_integer(value), do: value
1870+ def encode_ditriglyphic(_), do: {:error, "Unexpected type when encoding Staghunting.ditriglyphic"}
1871+
1872+ def decode_floriferousness(value) when is_integer(value), do: value
1873+ def decode_floriferousness(_), do: {:error, "Unexpected type when decoding Staghunting.floriferousness"}
1874+
1875+ def encode_floriferousness(value) when is_integer(value), do: value
1876+ def encode_floriferousness(_), do: {:error, "Unexpected type when encoding Staghunting.floriferousness"}
1877+
1878+ def decode_gamelike(value) when is_integer(value), do: value
1879+ def decode_gamelike(_), do: {:error, "Unexpected type when decoding Staghunting.gamelike"}
1880+
1881+ def encode_gamelike(value) when is_integer(value), do: value
1882+ def encode_gamelike(_), do: {:error, "Unexpected type when encoding Staghunting.gamelike"}
1883+
1884+ def decode_grig(value) when is_integer(value), do: value
1885+ def decode_grig(_), do: {:error, "Unexpected type when decoding Staghunting.grig"}
1886+
1887+ def encode_grig(value) when is_integer(value), do: value
1888+ def encode_grig(_), do: {:error, "Unexpected type when encoding Staghunting.grig"}
1889+
1890+ def decode_interloan(value) when is_integer(value), do: value
1891+ def decode_interloan(_), do: {:error, "Unexpected type when decoding Staghunting.interloan"}
1892+
1893+ def encode_interloan(value) when is_integer(value), do: value
1894+ def encode_interloan(_), do: {:error, "Unexpected type when encoding Staghunting.interloan"}
1895+
1896+ def decode_lithotomy(value) when is_integer(value), do: value
1897+ def decode_lithotomy(_), do: {:error, "Unexpected type when decoding Staghunting.lithotomy"}
1898+
1899+ def encode_lithotomy(value) when is_integer(value), do: value
1900+ def encode_lithotomy(_), do: {:error, "Unexpected type when encoding Staghunting.lithotomy"}
1901+
1902+ def decode_loric(value) when is_integer(value), do: value
1903+ def decode_loric(_), do: {:error, "Unexpected type when decoding Staghunting.loric"}
1904+
1905+ def encode_loric(value) when is_integer(value), do: value
1906+ def encode_loric(_), do: {:error, "Unexpected type when encoding Staghunting.loric"}
1907+
1908+ def decode_membranocoriaceous(value) when is_integer(value), do: value
1909+ def decode_membranocoriaceous(_), do: {:error, "Unexpected type when decoding Staghunting.membranocoriaceous"}
1910+
1911+ def encode_membranocoriaceous(value) when is_integer(value), do: value
1912+ def encode_membranocoriaceous(_), do: {:error, "Unexpected type when encoding Staghunting.membranocoriaceous"}
1913+
1914+ def decode_membranogenic(value) when is_integer(value), do: value
1915+ def decode_membranogenic(_), do: {:error, "Unexpected type when decoding Staghunting.membranogenic"}
1916+
1917+ def encode_membranogenic(value) when is_integer(value), do: value
1918+ def encode_membranogenic(_), do: {:error, "Unexpected type when encoding Staghunting.membranogenic"}
1919+
1920+ def decode_overtrump(value) when is_integer(value), do: value
1921+ def decode_overtrump(_), do: {:error, "Unexpected type when decoding Staghunting.overtrump"}
1922+
1923+ def encode_overtrump(value) when is_integer(value), do: value
1924+ def encode_overtrump(_), do: {:error, "Unexpected type when encoding Staghunting.overtrump"}
1925+
1926+ def decode_scotino(value) when is_integer(value), do: value
1927+ def decode_scotino(_), do: {:error, "Unexpected type when decoding Staghunting.scotino"}
1928+
1929+ def encode_scotino(value) when is_integer(value), do: value
1930+ def encode_scotino(_), do: {:error, "Unexpected type when encoding Staghunting.scotino"}
1931+
1932+ def decode_seasonable(value) when is_integer(value), do: value
1933+ def decode_seasonable(_), do: {:error, "Unexpected type when decoding Staghunting.seasonable"}
1934+
1935+ def encode_seasonable(value) when is_integer(value), do: value
1936+ def encode_seasonable(_), do: {:error, "Unexpected type when encoding Staghunting.seasonable"}
1937+
1938+ def decode_sephen(value) when is_integer(value), do: value
1939+ def decode_sephen(_), do: {:error, "Unexpected type when decoding Staghunting.sephen"}
1940+
1941+ def encode_sephen(value) when is_integer(value), do: value
1942+ def encode_sephen(_), do: {:error, "Unexpected type when encoding Staghunting.sephen"}
1943+
1944+ def decode_stigmarioid(value) when is_integer(value), do: value
1945+ def decode_stigmarioid(_), do: {:error, "Unexpected type when decoding Staghunting.stigmarioid"}
1946+
1947+ def encode_stigmarioid(value) when is_integer(value), do: value
1948+ def encode_stigmarioid(_), do: {:error, "Unexpected type when encoding Staghunting.stigmarioid"}
1949+
1950+ def decode_tired(value) when is_integer(value), do: value
1951+ def decode_tired(_), do: {:error, "Unexpected type when decoding Staghunting.tired"}
1952+
1953+ def encode_tired(value) when is_integer(value), do: value
1954+ def encode_tired(_), do: {:error, "Unexpected type when encoding Staghunting.tired"}
1955+
1956+ def decode_trifid(value) when is_integer(value), do: value
1957+ def decode_trifid(_), do: {:error, "Unexpected type when decoding Staghunting.trifid"}
1958+
1959+ def encode_trifid(value) when is_integer(value), do: value
1960+ def encode_trifid(_), do: {:error, "Unexpected type when encoding Staghunting.trifid"}
1961+
1962+ def decode_undefeatedly(value) when is_integer(value), do: value
1963+ def decode_undefeatedly(_), do: {:error, "Unexpected type when decoding Staghunting.undefeatedly"}
1964+
1965+ def encode_undefeatedly(value) when is_integer(value), do: value
1966+ def encode_undefeatedly(_), do: {:error, "Unexpected type when encoding Staghunting.undefeatedly"}
1967+
1968+ def decode_ungirlish(value) when is_integer(value), do: value
1969+ def decode_ungirlish(_), do: {:error, "Unexpected type when decoding Staghunting.ungirlish"}
1970+
1971+ def encode_ungirlish(value) when is_integer(value), do: value
1972+ def encode_ungirlish(_), do: {:error, "Unexpected type when encoding Staghunting.ungirlish"}
1973+
18121974 def from_map(m) do
18131975 %Staghunting{
1814- calorimetric: m["calorimetric"],
1815- canid: m["canid"],
1816- catharticalness: m["catharticalness"],
1817- chirotherium: m["Chirotherium"],
1976+ calorimetric: m["calorimetric"] && decode_calorimetric(m["calorimetric"]),
1977+ canid: m["canid"] && decode_canid(m["canid"]),
1978+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
1979+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
18181980 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
1819- ditriglyphic: m["ditriglyphic"],
1820- floriferousness: m["floriferousness"],
1821- gamelike: m["gamelike"],
1822- grig: m["grig"],
1981+ ditriglyphic: m["ditriglyphic"] && decode_ditriglyphic(m["ditriglyphic"]),
1982+ floriferousness: m["floriferousness"] && decode_floriferousness(m["floriferousness"]),
1983+ gamelike: m["gamelike"] && decode_gamelike(m["gamelike"]),
1984+ grig: m["grig"] && decode_grig(m["grig"]),
18231985 homocerc: m["homocerc"],
1824- interloan: m["interloan"],
1825- lithotomy: m["lithotomy"],
1826- loric: m["loric"],
1827- membranocoriaceous: m["membranocoriaceous"],
1828- membranogenic: m["membranogenic"],
1986+ interloan: m["interloan"] && decode_interloan(m["interloan"]),
1987+ lithotomy: m["lithotomy"] && decode_lithotomy(m["lithotomy"]),
1988+ loric: m["loric"] && decode_loric(m["loric"]),
1989+ membranocoriaceous: m["membranocoriaceous"] && decode_membranocoriaceous(m["membranocoriaceous"]),
1990+ membranogenic: m["membranogenic"] && decode_membranogenic(m["membranogenic"]),
18291991 nonbookish: m["nonbookish"],
1830- overtrump: m["overtrump"],
1831- scotino: m["scotino"],
1832- seasonable: m["seasonable"],
1833- sephen: m["sephen"],
1834- stigmarioid: m["stigmarioid"],
1835- tired: m["tired"],
1836- trifid: m["trifid"],
1837- undefeatedly: m["undefeatedly"],
1838- ungirlish: m["ungirlish"],
1992+ overtrump: m["overtrump"] && decode_overtrump(m["overtrump"]),
1993+ scotino: m["scotino"] && decode_scotino(m["scotino"]),
1994+ seasonable: m["seasonable"] && decode_seasonable(m["seasonable"]),
1995+ sephen: m["sephen"] && decode_sephen(m["sephen"]),
1996+ stigmarioid: m["stigmarioid"] && decode_stigmarioid(m["stigmarioid"]),
1997+ tired: m["tired"] && decode_tired(m["tired"]),
1998+ trifid: m["trifid"] && decode_trifid(m["trifid"]),
1999+ undefeatedly: m["undefeatedly"] && decode_undefeatedly(m["undefeatedly"]),
2000+ ungirlish: m["ungirlish"] && decode_ungirlish(m["ungirlish"]),
18392001 }
18402002 end
18412003
@@ -1913,39 +2075,173 @@ defmodule StrenuosityClass do
19132075 yankeeist: integer() | nil
19142076 }
19152077
2078+ def decode_bliss(value) when is_integer(value), do: value
2079+ def decode_bliss(_), do: {:error, "Unexpected type when decoding StrenuosityClass.bliss"}
2080+
2081+ def encode_bliss(value) when is_integer(value), do: value
2082+ def encode_bliss(_), do: {:error, "Unexpected type when encoding StrenuosityClass.bliss"}
2083+
2084+ def decode_buccate(value) when is_integer(value), do: value
2085+ def decode_buccate(_), do: {:error, "Unexpected type when decoding StrenuosityClass.buccate"}
2086+
2087+ def encode_buccate(value) when is_integer(value), do: value
2088+ def encode_buccate(_), do: {:error, "Unexpected type when encoding StrenuosityClass.buccate"}
2089+
2090+ def decode_bulletproof(value) when is_integer(value), do: value
2091+ def decode_bulletproof(_), do: {:error, "Unexpected type when decoding StrenuosityClass.bulletproof"}
2092+
2093+ def encode_bulletproof(value) when is_integer(value), do: value
2094+ def encode_bulletproof(_), do: {:error, "Unexpected type when encoding StrenuosityClass.bulletproof"}
2095+
2096+ def decode_catharticalness(value) when is_float(value), do: value
2097+ def decode_catharticalness(value) when is_integer(value), do: value
2098+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding StrenuosityClass.catharticalness"}
2099+
2100+ def encode_catharticalness(value) when is_float(value), do: value
2101+ def encode_catharticalness(value) when is_integer(value), do: value
2102+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding StrenuosityClass.catharticalness"}
2103+
2104+ def decode_chirotherium(value) when is_integer(value), do: value
2105+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding StrenuosityClass.chirotherium"}
2106+
2107+ def encode_chirotherium(value) when is_integer(value), do: value
2108+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding StrenuosityClass.chirotherium"}
2109+
2110+ def decode_crumblingness(value) when is_integer(value), do: value
2111+ def decode_crumblingness(_), do: {:error, "Unexpected type when decoding StrenuosityClass.crumblingness"}
2112+
2113+ def encode_crumblingness(value) when is_integer(value), do: value
2114+ def encode_crumblingness(_), do: {:error, "Unexpected type when encoding StrenuosityClass.crumblingness"}
2115+
19162116 def decode_disdiapason(value) when is_binary(value), do: value
19172117 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding StrenuosityClass.disdiapason"}
19182118
19192119 def encode_disdiapason(value) when is_binary(value), do: value
19202120 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding StrenuosityClass.disdiapason"}
19212121
2122+ def decode_engagedly(value) when is_integer(value), do: value
2123+ def decode_engagedly(_), do: {:error, "Unexpected type when decoding StrenuosityClass.engagedly"}
2124+
2125+ def encode_engagedly(value) when is_integer(value), do: value
2126+ def encode_engagedly(_), do: {:error, "Unexpected type when encoding StrenuosityClass.engagedly"}
2127+
2128+ def decode_fightable(value) when is_integer(value), do: value
2129+ def decode_fightable(_), do: {:error, "Unexpected type when decoding StrenuosityClass.fightable"}
2130+
2131+ def encode_fightable(value) when is_integer(value), do: value
2132+ def encode_fightable(_), do: {:error, "Unexpected type when encoding StrenuosityClass.fightable"}
2133+
2134+ def decode_hoariness(value) when is_integer(value), do: value
2135+ def decode_hoariness(_), do: {:error, "Unexpected type when decoding StrenuosityClass.hoariness"}
2136+
2137+ def encode_hoariness(value) when is_integer(value), do: value
2138+ def encode_hoariness(_), do: {:error, "Unexpected type when encoding StrenuosityClass.hoariness"}
2139+
2140+ def decode_hypopodium(value) when is_integer(value), do: value
2141+ def decode_hypopodium(_), do: {:error, "Unexpected type when decoding StrenuosityClass.hypopodium"}
2142+
2143+ def encode_hypopodium(value) when is_integer(value), do: value
2144+ def encode_hypopodium(_), do: {:error, "Unexpected type when encoding StrenuosityClass.hypopodium"}
2145+
2146+ def decode_luxurist(value) when is_integer(value), do: value
2147+ def decode_luxurist(_), do: {:error, "Unexpected type when decoding StrenuosityClass.luxurist"}
2148+
2149+ def encode_luxurist(value) when is_integer(value), do: value
2150+ def encode_luxurist(_), do: {:error, "Unexpected type when encoding StrenuosityClass.luxurist"}
2151+
2152+ def decode_mechanician(value) when is_integer(value), do: value
2153+ def decode_mechanician(_), do: {:error, "Unexpected type when decoding StrenuosityClass.mechanician"}
2154+
2155+ def encode_mechanician(value) when is_integer(value), do: value
2156+ def encode_mechanician(_), do: {:error, "Unexpected type when encoding StrenuosityClass.mechanician"}
2157+
2158+ def decode_onopordon(value) when is_integer(value), do: value
2159+ def decode_onopordon(_), do: {:error, "Unexpected type when decoding StrenuosityClass.onopordon"}
2160+
2161+ def encode_onopordon(value) when is_integer(value), do: value
2162+ def encode_onopordon(_), do: {:error, "Unexpected type when encoding StrenuosityClass.onopordon"}
2163+
2164+ def decode_podgily(value) when is_integer(value), do: value
2165+ def decode_podgily(_), do: {:error, "Unexpected type when decoding StrenuosityClass.podgily"}
2166+
2167+ def encode_podgily(value) when is_integer(value), do: value
2168+ def encode_podgily(_), do: {:error, "Unexpected type when encoding StrenuosityClass.podgily"}
2169+
2170+ def decode_reformableness(value) when is_integer(value), do: value
2171+ def decode_reformableness(_), do: {:error, "Unexpected type when decoding StrenuosityClass.reformableness"}
2172+
2173+ def encode_reformableness(value) when is_integer(value), do: value
2174+ def encode_reformableness(_), do: {:error, "Unexpected type when encoding StrenuosityClass.reformableness"}
2175+
2176+ def decode_scatterbrains(value) when is_integer(value), do: value
2177+ def decode_scatterbrains(_), do: {:error, "Unexpected type when decoding StrenuosityClass.scatterbrains"}
2178+
2179+ def encode_scatterbrains(value) when is_integer(value), do: value
2180+ def encode_scatterbrains(_), do: {:error, "Unexpected type when encoding StrenuosityClass.scatterbrains"}
2181+
2182+ def decode_seminuria(value) when is_integer(value), do: value
2183+ def decode_seminuria(_), do: {:error, "Unexpected type when decoding StrenuosityClass.seminuria"}
2184+
2185+ def encode_seminuria(value) when is_integer(value), do: value
2186+ def encode_seminuria(_), do: {:error, "Unexpected type when encoding StrenuosityClass.seminuria"}
2187+
2188+ def decode_sodomite(value) when is_integer(value), do: value
2189+ def decode_sodomite(_), do: {:error, "Unexpected type when decoding StrenuosityClass.sodomite"}
2190+
2191+ def encode_sodomite(value) when is_integer(value), do: value
2192+ def encode_sodomite(_), do: {:error, "Unexpected type when encoding StrenuosityClass.sodomite"}
2193+
2194+ def decode_tramp(value) when is_integer(value), do: value
2195+ def decode_tramp(_), do: {:error, "Unexpected type when decoding StrenuosityClass.tramp"}
2196+
2197+ def encode_tramp(value) when is_integer(value), do: value
2198+ def encode_tramp(_), do: {:error, "Unexpected type when encoding StrenuosityClass.tramp"}
2199+
2200+ def decode_undueness(value) when is_integer(value), do: value
2201+ def decode_undueness(_), do: {:error, "Unexpected type when decoding StrenuosityClass.undueness"}
2202+
2203+ def encode_undueness(value) when is_integer(value), do: value
2204+ def encode_undueness(_), do: {:error, "Unexpected type when encoding StrenuosityClass.undueness"}
2205+
2206+ def decode_worthily(value) when is_integer(value), do: value
2207+ def decode_worthily(_), do: {:error, "Unexpected type when decoding StrenuosityClass.worthily"}
2208+
2209+ def encode_worthily(value) when is_integer(value), do: value
2210+ def encode_worthily(_), do: {:error, "Unexpected type when encoding StrenuosityClass.worthily"}
2211+
2212+ def decode_yankeeist(value) when is_integer(value), do: value
2213+ def decode_yankeeist(_), do: {:error, "Unexpected type when decoding StrenuosityClass.yankeeist"}
2214+
2215+ def encode_yankeeist(value) when is_integer(value), do: value
2216+ def encode_yankeeist(_), do: {:error, "Unexpected type when encoding StrenuosityClass.yankeeist"}
2217+
19222218 def from_map(m) do
19232219 %StrenuosityClass{
1924- bliss: m["bliss"],
1925- buccate: m["buccate"],
1926- bulletproof: m["bulletproof"],
1927- catharticalness: m["catharticalness"],
1928- chirotherium: m["Chirotherium"],
1929- crumblingness: m["crumblingness"],
2220+ bliss: m["bliss"] && decode_bliss(m["bliss"]),
2221+ buccate: m["buccate"] && decode_buccate(m["buccate"]),
2222+ bulletproof: m["bulletproof"] && decode_bulletproof(m["bulletproof"]),
2223+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
2224+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
2225+ crumblingness: m["crumblingness"] && decode_crumblingness(m["crumblingness"]),
19302226 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
1931- engagedly: m["engagedly"],
1932- fightable: m["fightable"],
1933- hoariness: m["hoariness"],
2227+ engagedly: m["engagedly"] && decode_engagedly(m["engagedly"]),
2228+ fightable: m["fightable"] && decode_fightable(m["fightable"]),
2229+ hoariness: m["hoariness"] && decode_hoariness(m["hoariness"]),
19342230 homocerc: m["homocerc"],
1935- hypopodium: m["hypopodium"],
1936- luxurist: m["luxurist"],
1937- mechanician: m["mechanician"],
2231+ hypopodium: m["hypopodium"] && decode_hypopodium(m["hypopodium"]),
2232+ luxurist: m["luxurist"] && decode_luxurist(m["luxurist"]),
2233+ mechanician: m["mechanician"] && decode_mechanician(m["mechanician"]),
19382234 nonbookish: m["nonbookish"],
1939- onopordon: m["Onopordon"],
1940- podgily: m["podgily"],
1941- reformableness: m["reformableness"],
1942- scatterbrains: m["scatterbrains"],
1943- seminuria: m["seminuria"],
1944- sodomite: m["Sodomite"],
1945- tramp: m["tramp"],
1946- undueness: m["undueness"],
1947- worthily: m["worthily"],
1948- yankeeist: m["Yankeeist"],
2235+ onopordon: m["Onopordon"] && decode_onopordon(m["Onopordon"]),
2236+ podgily: m["podgily"] && decode_podgily(m["podgily"]),
2237+ reformableness: m["reformableness"] && decode_reformableness(m["reformableness"]),
2238+ scatterbrains: m["scatterbrains"] && decode_scatterbrains(m["scatterbrains"]),
2239+ seminuria: m["seminuria"] && decode_seminuria(m["seminuria"]),
2240+ sodomite: m["Sodomite"] && decode_sodomite(m["Sodomite"]),
2241+ tramp: m["tramp"] && decode_tramp(m["tramp"]),
2242+ undueness: m["undueness"] && decode_undueness(m["undueness"]),
2243+ worthily: m["worthily"] && decode_worthily(m["worthily"]),
2244+ yankeeist: m["Yankeeist"] && decode_yankeeist(m["Yankeeist"]),
19492245 }
19502246 end
19512247
@@ -2023,6 +2319,20 @@ defmodule TruantcyClass do
20232319 yuman: nil | nil
20242320 }
20252321
2322+ def decode_catharticalness(value) when is_float(value), do: value
2323+ def decode_catharticalness(value) when is_integer(value), do: value
2324+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding TruantcyClass.catharticalness"}
2325+
2326+ def encode_catharticalness(value) when is_float(value), do: value
2327+ def encode_catharticalness(value) when is_integer(value), do: value
2328+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding TruantcyClass.catharticalness"}
2329+
2330+ def decode_chirotherium(value) when is_integer(value), do: value
2331+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding TruantcyClass.chirotherium"}
2332+
2333+ def encode_chirotherium(value) when is_integer(value), do: value
2334+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding TruantcyClass.chirotherium"}
2335+
20262336 def decode_disdiapason(value) when is_binary(value), do: value
20272337 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding TruantcyClass.disdiapason"}
20282338
@@ -2034,9 +2344,9 @@ defmodule TruantcyClass do
20342344 alfiona: m["alfiona"],
20352345 ascaridiasis: m["ascaridiasis"],
20362346 bungey: m["bungey"],
2037- catharticalness: m["catharticalness"],
2347+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
20382348 ceroxyle: m["ceroxyle"],
2039- chirotherium: m["Chirotherium"],
2349+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
20402350 chorology: m["chorology"],
20412351 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
20422352 enmarble: m["enmarble"],
@@ -2133,39 +2443,173 @@ defmodule UnimpeachablyClass do
21332443 unsuggestedness: integer() | nil
21342444 }
21352445
2446+ def decode_acerin(value) when is_integer(value), do: value
2447+ def decode_acerin(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.acerin"}
2448+
2449+ def encode_acerin(value) when is_integer(value), do: value
2450+ def encode_acerin(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.acerin"}
2451+
2452+ def decode_bobadil(value) when is_integer(value), do: value
2453+ def decode_bobadil(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.bobadil"}
2454+
2455+ def encode_bobadil(value) when is_integer(value), do: value
2456+ def encode_bobadil(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.bobadil"}
2457+
2458+ def decode_catharticalness(value) when is_float(value), do: value
2459+ def decode_catharticalness(value) when is_integer(value), do: value
2460+ def decode_catharticalness(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.catharticalness"}
2461+
2462+ def encode_catharticalness(value) when is_float(value), do: value
2463+ def encode_catharticalness(value) when is_integer(value), do: value
2464+ def encode_catharticalness(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.catharticalness"}
2465+
2466+ def decode_chirotherium(value) when is_integer(value), do: value
2467+ def decode_chirotherium(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.chirotherium"}
2468+
2469+ def encode_chirotherium(value) when is_integer(value), do: value
2470+ def encode_chirotherium(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.chirotherium"}
2471+
2472+ def decode_chlorophylligenous(value) when is_integer(value), do: value
2473+ def decode_chlorophylligenous(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.chlorophylligenous"}
2474+
2475+ def encode_chlorophylligenous(value) when is_integer(value), do: value
2476+ def encode_chlorophylligenous(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.chlorophylligenous"}
2477+
2478+ def decode_conversational(value) when is_integer(value), do: value
2479+ def decode_conversational(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.conversational"}
2480+
2481+ def encode_conversational(value) when is_integer(value), do: value
2482+ def encode_conversational(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.conversational"}
2483+
2484+ def decode_demiowl(value) when is_integer(value), do: value
2485+ def decode_demiowl(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.demiowl"}
2486+
2487+ def encode_demiowl(value) when is_integer(value), do: value
2488+ def encode_demiowl(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.demiowl"}
2489+
21362490 def decode_disdiapason(value) when is_binary(value), do: value
21372491 def decode_disdiapason(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.disdiapason"}
21382492
21392493 def encode_disdiapason(value) when is_binary(value), do: value
21402494 def encode_disdiapason(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.disdiapason"}
21412495
2496+ def decode_ectorhinal(value) when is_integer(value), do: value
2497+ def decode_ectorhinal(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.ectorhinal"}
2498+
2499+ def encode_ectorhinal(value) when is_integer(value), do: value
2500+ def encode_ectorhinal(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.ectorhinal"}
2501+
2502+ def decode_gamblesomeness(value) when is_integer(value), do: value
2503+ def decode_gamblesomeness(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.gamblesomeness"}
2504+
2505+ def encode_gamblesomeness(value) when is_integer(value), do: value
2506+ def encode_gamblesomeness(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.gamblesomeness"}
2507+
2508+ def decode_irrorate(value) when is_integer(value), do: value
2509+ def decode_irrorate(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.irrorate"}
2510+
2511+ def encode_irrorate(value) when is_integer(value), do: value
2512+ def encode_irrorate(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.irrorate"}
2513+
2514+ def decode_kindergartening(value) when is_integer(value), do: value
2515+ def decode_kindergartening(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.kindergartening"}
2516+
2517+ def encode_kindergartening(value) when is_integer(value), do: value
2518+ def encode_kindergartening(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.kindergartening"}
2519+
2520+ def decode_lateritic(value) when is_integer(value), do: value
2521+ def decode_lateritic(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.lateritic"}
2522+
2523+ def encode_lateritic(value) when is_integer(value), do: value
2524+ def encode_lateritic(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.lateritic"}
2525+
2526+ def decode_mespil(value) when is_integer(value), do: value
2527+ def decode_mespil(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.mespil"}
2528+
2529+ def encode_mespil(value) when is_integer(value), do: value
2530+ def encode_mespil(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.mespil"}
2531+
2532+ def decode_misconfiguration(value) when is_integer(value), do: value
2533+ def decode_misconfiguration(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.misconfiguration"}
2534+
2535+ def encode_misconfiguration(value) when is_integer(value), do: value
2536+ def encode_misconfiguration(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.misconfiguration"}
2537+
2538+ def decode_planometry(value) when is_integer(value), do: value
2539+ def decode_planometry(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.planometry"}
2540+
2541+ def encode_planometry(value) when is_integer(value), do: value
2542+ def encode_planometry(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.planometry"}
2543+
2544+ def decode_quiina(value) when is_integer(value), do: value
2545+ def decode_quiina(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.quiina"}
2546+
2547+ def encode_quiina(value) when is_integer(value), do: value
2548+ def encode_quiina(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.quiina"}
2549+
2550+ def decode_robert(value) when is_integer(value), do: value
2551+ def decode_robert(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.robert"}
2552+
2553+ def encode_robert(value) when is_integer(value), do: value
2554+ def encode_robert(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.robert"}
2555+
2556+ def decode_rot(value) when is_integer(value), do: value
2557+ def decode_rot(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.rot"}
2558+
2559+ def encode_rot(value) when is_integer(value), do: value
2560+ def encode_rot(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.rot"}
2561+
2562+ def decode_subcinctorium(value) when is_integer(value), do: value
2563+ def decode_subcinctorium(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.subcinctorium"}
2564+
2565+ def encode_subcinctorium(value) when is_integer(value), do: value
2566+ def encode_subcinctorium(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.subcinctorium"}
2567+
2568+ def decode_tussocker(value) when is_integer(value), do: value
2569+ def decode_tussocker(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.tussocker"}
2570+
2571+ def encode_tussocker(value) when is_integer(value), do: value
2572+ def encode_tussocker(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.tussocker"}
2573+
2574+ def decode_ultraproud(value) when is_integer(value), do: value
2575+ def decode_ultraproud(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.ultraproud"}
2576+
2577+ def encode_ultraproud(value) when is_integer(value), do: value
2578+ def encode_ultraproud(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.ultraproud"}
2579+
2580+ def decode_unsuggestedness(value) when is_integer(value), do: value
2581+ def decode_unsuggestedness(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.unsuggestedness"}
2582+
2583+ def encode_unsuggestedness(value) when is_integer(value), do: value
2584+ def encode_unsuggestedness(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.unsuggestedness"}
2585+
21422586 def from_map(m) do
21432587 %UnimpeachablyClass{
2144- acerin: m["acerin"],
2145- bobadil: m["Bobadil"],
2146- catharticalness: m["catharticalness"],
2147- chirotherium: m["Chirotherium"],
2148- chlorophylligenous: m["chlorophylligenous"],
2149- conversational: m["conversational"],
2150- demiowl: m["demiowl"],
2588+ acerin: m["acerin"] && decode_acerin(m["acerin"]),
2589+ bobadil: m["Bobadil"] && decode_bobadil(m["Bobadil"]),
2590+ catharticalness: m["catharticalness"] && decode_catharticalness(m["catharticalness"]),
2591+ chirotherium: m["Chirotherium"] && decode_chirotherium(m["Chirotherium"]),
2592+ chlorophylligenous: m["chlorophylligenous"] && decode_chlorophylligenous(m["chlorophylligenous"]),
2593+ conversational: m["conversational"] && decode_conversational(m["conversational"]),
2594+ demiowl: m["demiowl"] && decode_demiowl(m["demiowl"]),
21512595 disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
2152- ectorhinal: m["ectorhinal"],
2153- gamblesomeness: m["gamblesomeness"],
2596+ ectorhinal: m["ectorhinal"] && decode_ectorhinal(m["ectorhinal"]),
2597+ gamblesomeness: m["gamblesomeness"] && decode_gamblesomeness(m["gamblesomeness"]),
21542598 homocerc: m["homocerc"],
2155- irrorate: m["irrorate"],
2156- kindergartening: m["kindergartening"],
2157- lateritic: m["lateritic"],
2158- mespil: m["mespil"],
2159- misconfiguration: m["misconfiguration"],
2599+ irrorate: m["irrorate"] && decode_irrorate(m["irrorate"]),
2600+ kindergartening: m["kindergartening"] && decode_kindergartening(m["kindergartening"]),
2601+ lateritic: m["lateritic"] && decode_lateritic(m["lateritic"]),
2602+ mespil: m["mespil"] && decode_mespil(m["mespil"]),
2603+ misconfiguration: m["misconfiguration"] && decode_misconfiguration(m["misconfiguration"]),
21602604 nonbookish: m["nonbookish"],
2161- planometry: m["planometry"],
2162- quiina: m["Quiina"],
2163- robert: m["Robert"],
2164- rot: m["rot"],
2165- subcinctorium: m["subcinctorium"],
2166- tussocker: m["tussocker"],
2167- ultraproud: m["ultraproud"],
2168- unsuggestedness: m["unsuggestedness"],
2605+ planometry: m["planometry"] && decode_planometry(m["planometry"]),
2606+ quiina: m["Quiina"] && decode_quiina(m["Quiina"]),
2607+ robert: m["Robert"] && decode_robert(m["Robert"]),
2608+ rot: m["rot"] && decode_rot(m["rot"]),
2609+ subcinctorium: m["subcinctorium"] && decode_subcinctorium(m["subcinctorium"]),
2610+ tussocker: m["tussocker"] && decode_tussocker(m["tussocker"]),
2611+ ultraproud: m["ultraproud"] && decode_ultraproud(m["ultraproud"]),
2612+ unsuggestedness: m["unsuggestedness"] && decode_unsuggestedness(m["unsuggestedness"]),
21692613 }
21702614 end
Test case

test/inputs/json/priority/keywords.json

37 generated files · +764 −48
Mcjsondefault / TopLevel.c+65 −0
@@ -14990,6 +14990,61 @@ void cJSON_DeleteRight(struct Right * x) {
1499014990 }
1499114991 }
1499214992
14993+struct S * cJSON_ParseS(const char * s) {
14994+ struct S * x = NULL;
14995+ if (NULL != s) {
14996+ cJSON * j = cJSON_Parse(s);
14997+ if (NULL != j) {
14998+ x = cJSON_GetSValue(j);
14999+ cJSON_Delete(j);
15000+ }
15001+ }
15002+ return x;
15003+}
15004+
15005+struct S * cJSON_GetSValue(const cJSON * j) {
15006+ struct S * x = NULL;
15007+ if (NULL != j) {
15008+ if (NULL != (x = cJSON_malloc(sizeof(struct S)))) {
15009+ memset(x, 0, sizeof(struct S));
15010+ if (!cJSON_HasObjectItem(j, "s")) { cJSON_DeleteS(x); return NULL; }
15011+ if (cJSON_HasObjectItem(j, "s")) {
15012+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "s"))) { cJSON_DeleteS(x); return NULL; }
15013+ x->s = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "s"));
15014+ }
15015+ }
15016+ }
15017+ return x;
15018+}
15019+
15020+cJSON * cJSON_CreateS(const struct S * x) {
15021+ cJSON * j = NULL;
15022+ if (NULL != x) {
15023+ if (NULL != (j = cJSON_CreateObject())) {
15024+ cJSON_AddNumberToObject(j, "s", x->s);
15025+ }
15026+ }
15027+ return j;
15028+}
15029+
15030+char * cJSON_PrintS(const struct S * x) {
15031+ char * s = NULL;
15032+ if (NULL != x) {
15033+ cJSON * j = cJSON_CreateS(x);
15034+ if (NULL != j) {
15035+ s = cJSON_Print(j);
15036+ cJSON_Delete(j);
15037+ }
15038+ }
15039+ return s;
15040+}
15041+
15042+void cJSON_DeleteS(struct S * x) {
15043+ if (NULL != x) {
15044+ cJSON_free(x);
15045+ }
15046+}
15047+
1499315048 struct Sbyte * cJSON_ParseSbyte(const char * s) {
1499415049 struct Sbyte * x = NULL;
1499515050 if (NULL != s) {
@@ -16621,6 +16676,12 @@ struct Obj4 * cJSON_GetObj4Value(const cJSON * j) {
1662116676 x->right = cJSON_GetRightValue(cJSON_GetObjectItemCaseSensitive(j, "right"));
1662216677 if (NULL == x->right) { cJSON_DeleteObj4(x); return NULL; }
1662316678 }
16679+ if (!cJSON_HasObjectItem(j, "s")) { cJSON_DeleteObj4(x); return NULL; }
16680+ if (cJSON_HasObjectItem(j, "s")) {
16681+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "s"))) { cJSON_DeleteObj4(x); return NULL; }
16682+ x->s = cJSON_GetSValue(cJSON_GetObjectItemCaseSensitive(j, "s"));
16683+ if (NULL == x->s) { cJSON_DeleteObj4(x); return NULL; }
16684+ }
1662416685 if (!cJSON_HasObjectItem(j, "sbyte")) { cJSON_DeleteObj4(x); return NULL; }
1662516686 if (cJSON_HasObjectItem(j, "sbyte")) {
1662616687 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "sbyte"))) { cJSON_DeleteObj4(x); return NULL; }
@@ -16820,6 +16881,7 @@ cJSON * cJSON_CreateObj4(const struct Obj4 * x) {
1682016881 cJSON_AddItemToObject(j, "retain", cJSON_CreateRetain(x->retain));
1682116882 cJSON_AddItemToObject(j, "rethrows", cJSON_CreateRethrows(x->rethrows));
1682216883 cJSON_AddItemToObject(j, "right", cJSON_CreateRight(x->right));
16884+ cJSON_AddItemToObject(j, "s", cJSON_CreateS(x->s));
1682316885 cJSON_AddItemToObject(j, "sbyte", cJSON_CreateSbyte(x->sbyte));
1682416886 cJSON_AddItemToObject(j, "sealed", cJSON_CreateSealed(x->sealed));
1682516887 cJSON_AddItemToObject(j, "SEL", cJSON_CreateSel(x->sel));
@@ -16981,6 +17043,9 @@ void cJSON_DeleteObj4(struct Obj4 * x) {
1698117043 if (NULL != x->right) {
1698217044 cJSON_DeleteRight(x->right);
1698317045 }
17046+ if (NULL != x->s) {
17047+ cJSON_DeleteS(x->s);
17048+ }
1698417049 if (NULL != x->sbyte) {
1698517050 cJSON_DeleteSbyte(x->sbyte);
1698617051 }
Mcjsondefault / TopLevel.h+11 −0
@@ -1181,6 +1181,10 @@ struct Right {
11811181 int64_t right;
11821182 };
11831183
1184+struct S {
1185+ int64_t s;
1186+};
1187+
11841188 struct Sbyte {
11851189 int64_t sbyte;
11861190 };
@@ -1322,6 +1326,7 @@ struct Obj4 {
13221326 struct Retain * retain;
13231327 struct Rethrows * rethrows;
13241328 struct Right * right;
1329+ struct S * s;
13251330 struct Sbyte * sbyte;
13261331 struct Sealed * sealed;
13271332 struct Sel * sel;
@@ -2884,6 +2889,12 @@ cJSON * cJSON_CreateRight(const struct Right * x);
28842889 char * cJSON_PrintRight(const struct Right * x);
28852890 void cJSON_DeleteRight(struct Right * x);
28862891
2892+struct S * cJSON_ParseS(const char * s);
2893+struct S * cJSON_GetSValue(const cJSON * j);
2894+cJSON * cJSON_CreateS(const struct S * x);
2895+char * cJSON_PrintS(const struct S * x);
2896+void cJSON_DeleteS(struct S * x);
2897+
28872898 struct Sbyte * cJSON_ParseSbyte(const char * s);
28882899 struct Sbyte * cJSON_GetSbyteValue(const cJSON * j);
28892900 cJSON * cJSON_CreateSbyte(const struct Sbyte * x);
Mcplusplusdefault / quicktype.hpp+35 −0
@@ -4310,6 +4310,20 @@ namespace quicktype {
43104310 void set_right(const int64_t & value) { this->right = value; }
43114311 };
43124312
4313+ class S {
4314+ public:
4315+ S() = default;
4316+ virtual ~S() = default;
4317+
4318+ private:
4319+ int64_t s;
4320+
4321+ public:
4322+ const int64_t & get_s() const { return s; }
4323+ int64_t & get_mutable_s() { return s; }
4324+ void set_s(const int64_t & value) { this->s = value; }
4325+ };
4326+
43134327 class Sbyte {
43144328 public:
43154329 Sbyte() = default;
@@ -4719,6 +4733,7 @@ namespace quicktype {
47194733 Retain retain;
47204734 Rethrows rethrows;
47214735 Right right;
4736+ S s;
47224737 Sbyte sbyte;
47234738 Sealed sealed;
47244739 Sel sel;
@@ -4903,6 +4918,10 @@ namespace quicktype {
49034918 Right & get_mutable_right() { return right; }
49044919 void set_right(const Right & value) { this->right = value; }
49054920
4921+ const S & get_s() const { return s; }
4922+ S & get_mutable_s() { return s; }
4923+ void set_s(const S & value) { this->s = value; }
4924+
49064925 const Sbyte & get_sbyte() const { return sbyte; }
49074926 Sbyte & get_mutable_sbyte() { return sbyte; }
49084927 void set_sbyte(const Sbyte & value) { this->sbyte = value; }
@@ -6151,6 +6170,9 @@ namespace quicktype {
61516170 void from_json(const json & j, Right & x);
61526171 void to_json(json & j, const Right & x);
61536172
6173+ void from_json(const json & j, S & x);
6174+ void to_json(json & j, const S & x);
6175+
61546176 void from_json(const json & j, Sbyte & x);
61556177 void to_json(json & j, const Sbyte & x);
61566178
@@ -9284,6 +9306,17 @@ namespace quicktype {
92849306 j["right"] = x.get_right();
92859307 }
92869308
9309+ inline void from_json(const json & j, S& x) {
9310+ if (!j.is_object()) throw std::runtime_error("Expected object");
9311+ if (j.find("s") != j.end() && !j.at("s").is_number_integer()) throw std::runtime_error("Expected integer");
9312+ x.set_s(j.at("s").get<int64_t>());
9313+ }
9314+
9315+ inline void to_json(json & j, const S & x) {
9316+ j = json::object();
9317+ j["s"] = x.get_s();
9318+ }
9319+
92879320 inline void from_json(const json & j, Sbyte& x) {
92889321 if (!j.is_object()) throw std::runtime_error("Expected object");
92899322 if (j.find("sbyte") != j.end() && !j.at("sbyte").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -9612,6 +9645,7 @@ namespace quicktype {
96129645 x.set_retain(j.at("retain").get<Retain>());
96139646 x.set_rethrows(j.at("rethrows").get<Rethrows>());
96149647 x.set_right(j.at("right").get<Right>());
9648+ x.set_s(j.at("s").get<S>());
96159649 x.set_sbyte(j.at("sbyte").get<Sbyte>());
96169650 x.set_sealed(j.at("sealed").get<Sealed>());
96179651 x.set_sel(j.at("SEL").get<Sel>());
@@ -9681,6 +9715,7 @@ namespace quicktype {
96819715 j["retain"] = x.get_retain();
96829716 j["rethrows"] = x.get_rethrows();
96839717 j["right"] = x.get_right();
9718+ j["s"] = x.get_s();
96849719 j["sbyte"] = x.get_sbyte();
96859720 j["sealed"] = x.get_sealed();
96869721 j["SEL"] = x.get_sel();
Mcrystaldefault / TopLevel.cr+8 −0
@@ -1755,6 +1755,8 @@ class Obj4
17551755
17561756 property right : Right
17571757
1758+ property s : S
1759+
17581760 property sbyte : Sbyte
17591761
17601762 property sealed : Sealed
@@ -2020,6 +2022,12 @@ class Right
20202022 property right : Int64
20212023 end
20222024
2025+class S
2026+ include JSON::Serializable
2027+
2028+ property s : Int64
2029+end
2030+
20232031 class Sbyte
20242032 include JSON::Serializable
Mcsharp-recordsdefault / QuickType.cs+9 −0
@@ -1885,6 +1885,9 @@ namespace QuickType
18851885 [JsonProperty("right", Required = Required.Always)]
18861886 public Right Right { get; set; }
18871887
1888+ [JsonProperty("s", Required = Required.Always)]
1889+ public S S { get; set; }
1890+
18881891 [JsonProperty("sbyte", Required = Required.Always)]
18891892 public Sbyte Sbyte { get; set; }
18901893
@@ -2141,6 +2144,12 @@ namespace QuickType
21412144 public long RightRight { get; set; }
21422145 }
21432146
2147+ public partial record S
2148+ {
2149+ [JsonProperty("s", Required = Required.Always)]
2150+ public long SS { get; set; }
2151+ }
2152+
21442153 public partial record Sbyte
21452154 {
21462155 [JsonProperty("sbyte", Required = Required.Always)]
Mcsharp-SystemTextJsondefault / QuickType.cs+11 −0
@@ -2303,6 +2303,10 @@ namespace QuickType
23032303 [JsonPropertyName("right")]
23042304 public Right Right { get; set; }
23052305
2306+ [JsonRequired]
2307+ [JsonPropertyName("s")]
2308+ public S S { get; set; }
2309+
23062310 [JsonRequired]
23072311 [JsonPropertyName("sbyte")]
23082312 public Sbyte Sbyte { get; set; }
@@ -2623,6 +2627,13 @@ namespace QuickType
26232627 public long RightRight { get; set; }
26242628 }
26252629
2630+ public partial class S
2631+ {
2632+ [JsonRequired]
2633+ [JsonPropertyName("s")]
2634+ public long SS { get; set; }
2635+ }
2636+
26262637 public partial class Sbyte
26272638 {
26282639 [JsonRequired]
Mcsharpdefault / QuickType.cs+9 −0
@@ -1885,6 +1885,9 @@ namespace QuickType
18851885 [JsonProperty("right", Required = Required.Always)]
18861886 public Right Right { get; set; }
18871887
1888+ [JsonProperty("s", Required = Required.Always)]
1889+ public S S { get; set; }
1890+
18881891 [JsonProperty("sbyte", Required = Required.Always)]
18891892 public Sbyte Sbyte { get; set; }
18901893
@@ -2141,6 +2144,12 @@ namespace QuickType
21412144 public long RightRight { get; set; }
21422145 }
21432146
2147+ public partial class S
2148+ {
2149+ [JsonProperty("s", Required = Required.Always)]
2150+ public long SS { get; set; }
2151+ }
2152+
21442153 public partial class Sbyte
21452154 {
21462155 [JsonProperty("sbyte", Required = Required.Always)]
Mdartdefault / TopLevel.dart+20 −0
@@ -4024,6 +4024,7 @@ class Obj4 {
40244024 final Retain retain;
40254025 final Rethrows rethrows;
40264026 final Right right;
4027+ final S s;
40274028 final Sbyte sbyte;
40284029 final Sealed sealed;
40294030 final Sel sel;
@@ -4091,6 +4092,7 @@ class Obj4 {
40914092 required this.retain,
40924093 required this.rethrows,
40934094 required this.right,
4095+ required this.s,
40944096 required this.sbyte,
40954097 required this.sealed,
40964098 required this.sel,
@@ -4159,6 +4161,7 @@ class Obj4 {
41594161 retain: Retain.fromJson(json["retain"]),
41604162 rethrows: Rethrows.fromJson(json["rethrows"]),
41614163 right: Right.fromJson(json["right"]),
4164+ s: S.fromJson(json["s"]),
41624165 sbyte: Sbyte.fromJson(json["sbyte"]),
41634166 sealed: Sealed.fromJson(json["sealed"]),
41644167 sel: Sel.fromJson(json["SEL"]),
@@ -4227,6 +4230,7 @@ class Obj4 {
42274230 "retain": retain.toJson(),
42284231 "rethrows": rethrows.toJson(),
42294232 "right": right.toJson(),
4233+ "s": s.toJson(),
42304234 "sbyte": sbyte.toJson(),
42314235 "sealed": sealed.toJson(),
42324236 "SEL": sel.toJson(),
@@ -4744,6 +4748,22 @@ class Right {
47444748 };
47454749 }
47464750
4751+class S {
4752+ final int s;
4753+
4754+ S({
4755+ required this.s,
4756+ });
4757+
4758+ factory S.fromJson(Map<String, dynamic> json) => S(
4759+ s: json["s"],
4760+ );
4761+
4762+ Map<String, dynamic> toJson() => {
4763+ "s": s,
4764+ };
4765+}
4766+
47474767 class Sbyte {
47484768 final int sbyte;
Melixirdefault / QuickType.ex+44 −2
@@ -9092,6 +9092,45 @@ defmodule Right do
90929092 end
90939093 end
90949094
9095+defmodule S do
9096+ @enforce_keys [:s]
9097+ defstruct [:s]
9098+
9099+ @type t :: %__MODULE__{
9100+ s: integer()
9101+ }
9102+
9103+ def decode_s(value) when is_integer(value), do: value
9104+ def decode_s(_), do: {:error, "Unexpected type when decoding S.s"}
9105+
9106+ def encode_s(value) when is_integer(value), do: value
9107+ def encode_s(_), do: {:error, "Unexpected type when encoding S.s"}
9108+
9109+ def from_map(m) do
9110+ %S{
9111+ s: decode_s(m["s"]),
9112+ }
9113+ end
9114+
9115+ def from_json(json) do
9116+ json
9117+ |> Jason.decode!()
9118+ |> from_map()
9119+ end
9120+
9121+ def to_map(struct) do
9122+ %{
9123+ "s" => struct.s,
9124+ }
9125+ end
9126+
9127+ def to_json(struct) do
9128+ struct
9129+ |> to_map()
9130+ |> Jason.encode!()
9131+ end
9132+end
9133+
90959134 defmodule Sbyte do
90969135 @enforce_keys [:sbyte]
90979136 defstruct [:sbyte]
@@ -10809,8 +10848,8 @@ defmodule Undefined do
1080910848 end
1081010849
1081110850 defmodule Obj4 do
10812- @enforce_keys [:dummy, :obj4_self, :obj4_true, :obj4_type, :public, :quicktype, :raise, :range, :readonly, :ref, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :sbyte, :sealed, :sel, :select, :self, :serialize, :set, :short, :signed, :sizeof, :stackalloc, :static, :static_assert, :static_cast, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :to_json, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined]
10813- defstruct [:dummy, :obj4_self, :obj4_true, :obj4_type, :public, :quicktype, :raise, :range, :readonly, :ref, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :sbyte, :sealed, :sel, :select, :self, :serialize, :set, :short, :signed, :sizeof, :stackalloc, :static, :static_assert, :static_cast, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :to_json, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined]
10851+ @enforce_keys [:dummy, :obj4_self, :obj4_true, :obj4_type, :public, :quicktype, :raise, :range, :readonly, :ref, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :s, :sbyte, :sealed, :sel, :select, :self, :serialize, :set, :short, :signed, :sizeof, :stackalloc, :static, :static_assert, :static_cast, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :to_json, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined]
10852+ defstruct [:dummy, :obj4_self, :obj4_true, :obj4_type, :public, :quicktype, :raise, :range, :readonly, :ref, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :s, :sbyte, :sealed, :sel, :select, :self, :serialize, :set, :short, :signed, :sizeof, :stackalloc, :static, :static_assert, :static_cast, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :to_json, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined]
1081410853
1081510854 @type t :: %__MODULE__{
1081610855 dummy: integer(),
@@ -10834,6 +10873,7 @@ defmodule Obj4 do
1083410873 rethrows: Rethrows.t(),
1083510874 return: Return.t(),
1083610875 right: Right.t(),
10876+ s: S.t(),
1083710877 sbyte: Sbyte.t(),
1083810878 sealed: Sealed.t(),
1083910879 sel: Sel.t(),
@@ -10909,6 +10949,7 @@ defmodule Obj4 do
1090910949 rethrows: Rethrows.from_map(m["rethrows"]),
1091010950 return: Return.from_map(m["return"]),
1091110951 right: Right.from_map(m["right"]),
10952+ s: S.from_map(m["s"]),
1091210953 sbyte: Sbyte.from_map(m["sbyte"]),
1091310954 sealed: Sealed.from_map(m["sealed"]),
1091410955 sel: Sel.from_map(m["SEL"]),
@@ -10985,6 +11026,7 @@ defmodule Obj4 do
1098511026 "rethrows" => Rethrows.to_map(struct.rethrows),
1098611027 "return" => Return.to_map(struct.return),
1098711028 "right" => Right.to_map(struct.right),
11029+ "s" => S.to_map(struct.s),
1098811030 "sbyte" => Sbyte.to_map(struct.sbyte),
1098911031 "sealed" => Sealed.to_map(struct.sealed),
1099011032 "SEL" => Sel.to_map(struct.sel),
Melmdefault / QuickType.elm+19 −0
@@ -237,6 +237,7 @@ module QuickType exposing
237237 , Rethrows
238238 , Return
239239 , Right
240+ , S
240241 , Sbyte
241242 , Sealed
242243 , Sel
@@ -1327,6 +1328,7 @@ type alias Obj4 =
13271328 , rethrows : Rethrows
13281329 , return : Return
13291330 , right : Right
1331+ , s : S
13301332 , sbyte : Sbyte
13311333 , sealed : Sealed
13321334 , sel : Sel
@@ -1462,6 +1464,10 @@ type alias Right =
14621464 { right : Int
14631465 }
14641466
1467+type alias S =
1468+ { s : Int
1469+ }
1470+
14651471 type alias Sbyte =
14661472 { sbyte : Int
14671473 }
@@ -4357,6 +4363,7 @@ obj4 =
43574363 |> Jpipe.required "rethrows" rethrows
43584364 |> Jpipe.required "return" return
43594365 |> Jpipe.required "right" right
4366+ |> Jpipe.required "s" s
43604367 |> Jpipe.required "sbyte" sbyte
43614368 |> Jpipe.required "sealed" sealed
43624369 |> Jpipe.required "SEL" sel
@@ -4426,6 +4433,7 @@ encodeObj4 x =
44264433 , ("rethrows", encodeRethrows x.rethrows)
44274434 , ("return", encodeReturn x.return)
44284435 , ("right", encodeRight x.right)
4436+ , ("s", encodeS x.s)
44294437 , ("sbyte", encodeSbyte x.sbyte)
44304438 , ("sealed", encodeSealed x.sealed)
44314439 , ("SEL", encodeSel x.sel)
@@ -4722,6 +4730,17 @@ encodeRight x =
47224730 [ ("right", Jenc.int x.right)
47234731 ]
47244732
4733+s : Jdec.Decoder S
4734+s =
4735+ Jdec.succeed S
4736+ |> Jpipe.required "s" Jdec.int
4737+
4738+encodeS : S -> Jenc.Value
4739+encodeS x =
4740+ Jenc.object
4741+ [ ("s", Jenc.int x.s)
4742+ ]
4743+
47254744 sbyte : Jdec.Decoder Sbyte
47264745 sbyte =
47274746 Jdec.succeed Sbyte
Mflowdefault / TopLevel.js+9 −0
@@ -1028,6 +1028,7 @@ export type Obj4 = {
10281028 rethrows: Rethrows;
10291029 return: Return;
10301030 right: Right;
1031+ s: S;
10311032 sbyte: Sbyte;
10321033 sealed: Sealed;
10331034 select: Select;
@@ -1157,6 +1158,10 @@ export type Right = {
11571158 right: number;
11581159 };
11591160
1161+export type S = {
1162+ s: number;
1163+};
1164+
11601165 export type Sbyte = {
11611166 sbyte: number;
11621167 };
@@ -2438,6 +2443,7 @@ const typeMap: any = {
24382443 { json: "rethrows", js: "rethrows", typ: r("Rethrows") },
24392444 { json: "return", js: "return", typ: r("Return") },
24402445 { json: "right", js: "right", typ: r("Right") },
2446+ { json: "s", js: "s", typ: r("S") },
24412447 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
24422448 { json: "sealed", js: "sealed", typ: r("Sealed") },
24432449 { json: "select", js: "select", typ: r("Select") },
@@ -2545,6 +2551,9 @@ const typeMap: any = {
25452551 "Right": o([
25462552 { json: "right", js: "right", typ: i(0) },
25472553 ], false),
2554+ "S": o([
2555+ { json: "s", js: "s", typ: i(0) },
2556+ ], false),
25482557 "Sbyte": o([
25492558 { json: "sbyte", js: "sbyte", typ: i(0) },
25502559 ], false),
Mgolangdefault / quicktype.go+5 −0
@@ -1036,6 +1036,7 @@ type Obj4 struct {
10361036 Rethrows Rethrows `json:"rethrows"`
10371037 Return Return `json:"return"`
10381038 Right Right `json:"right"`
1039+ S S `json:"s"`
10391040 Sbyte Sbyte `json:"sbyte"`
10401041 Sealed Sealed `json:"sealed"`
10411042 Sel Sel `json:"SEL"`
@@ -1162,6 +1163,10 @@ type Right struct {
11621163 Right int64 `json:"right"`
11631164 }
11641165
1166+type S struct {
1167+ S int64 `json:"s"`
1168+}
1169+
11651170 type Sbyte struct {
11661171 Sbyte int64 `json:"sbyte"`
11671172 }
Mhaskelldefault / QuickType.hs+19 −1
@@ -224,6 +224,7 @@ module QuickType
224224 , Rethrows (..)
225225 , Return (..)
226226 , RightClass (..)
227+ , S (..)
227228 , Sbyte (..)
228229 , Sealed (..)
229230 , Sel (..)
@@ -1316,6 +1317,7 @@ data Obj4 = Obj4
13161317 , rethrowsObj4 :: Rethrows
13171318 , returnObj4 :: Return
13181319 , rightObj4 :: RightClass
1320+ , sObj4 :: S
13191321 , sbyteObj4 :: Sbyte
13201322 , sealedObj4 :: Sealed
13211323 , selObj4 :: Sel
@@ -1448,6 +1450,10 @@ data RightClass = RightClass
14481450 { rightRightClass :: Int
14491451 } deriving (Show)
14501452
1453+data S = S
1454+ { sS :: Int
1455+ } deriving (Show)
1456+
14511457 data Sbyte = Sbyte
14521458 { sbyteSbyte :: Int
14531459 } deriving (Show)
@@ -4114,7 +4120,7 @@ instance FromJSON Protocol where
41144120 <$> v .: "Protocol"
41154121
41164122 instance ToJSON Obj4 where
4117- toJSON (Obj4 dummyObj4 obj4SelfObj4 obj4ThenObj4 obj4TrueObj4 obj4TypeObj4 publicObj4 purpleTypeObj4 quicktypeObj4 raiseObj4 rangeObj4 readonlyObj4 refObj4 registerObj4 reinterpretCastObj4 repeatObj4 requireObj4 requiredObj4 requiresObj4 restrictObj4 retainObj4 rethrowsObj4 returnObj4 rightObj4 sbyteObj4 sealedObj4 selObj4 selectObj4 selfObj4 serializeObj4 setObj4 shortObj4 signedObj4 sizeofObj4 stackallocObj4 staticObj4 staticAssertObj4 staticCastObj4 strictfpObj4 stringObj4 structObj4 subscriptObj4 superObj4 switchObj4 symbolObj4 synchronizedObj4 systemObj4 templateObj4 thisObj4 threadLocalObj4 throwObj4 throwsObj4 toJSONObj4 topLevelObj4 transientObj4 trueObj4 tryObj4 typealiasObj4 typedefObj4 typeidObj4 typenameObj4 typeofObj4 uintObj4 ulongObj4 uncheckedObj4 undefinedObj4) =
4123+ toJSON (Obj4 dummyObj4 obj4SelfObj4 obj4ThenObj4 obj4TrueObj4 obj4TypeObj4 publicObj4 purpleTypeObj4 quicktypeObj4 raiseObj4 rangeObj4 readonlyObj4 refObj4 registerObj4 reinterpretCastObj4 repeatObj4 requireObj4 requiredObj4 requiresObj4 restrictObj4 retainObj4 rethrowsObj4 returnObj4 rightObj4 sObj4 sbyteObj4 sealedObj4 selObj4 selectObj4 selfObj4 serializeObj4 setObj4 shortObj4 signedObj4 sizeofObj4 stackallocObj4 staticObj4 staticAssertObj4 staticCastObj4 strictfpObj4 stringObj4 structObj4 subscriptObj4 superObj4 switchObj4 symbolObj4 synchronizedObj4 systemObj4 templateObj4 thisObj4 threadLocalObj4 throwObj4 throwsObj4 toJSONObj4 topLevelObj4 transientObj4 trueObj4 tryObj4 typealiasObj4 typedefObj4 typeidObj4 typenameObj4 typeofObj4 uintObj4 ulongObj4 uncheckedObj4 undefinedObj4) =
41184124 object
41194125 [ "dummy" .= dummyObj4
41204126 , "self" .= obj4SelfObj4
@@ -4139,6 +4145,7 @@ instance ToJSON Obj4 where
41394145 , "rethrows" .= rethrowsObj4
41404146 , "return" .= returnObj4
41414147 , "right" .= rightObj4
4148+ , "s" .= sObj4
41424149 , "sbyte" .= sbyteObj4
41434150 , "sealed" .= sealedObj4
41444151 , "SEL" .= selObj4
@@ -4208,6 +4215,7 @@ instance FromJSON Obj4 where
42084215 <*> v .: "rethrows"
42094216 <*> v .: "return"
42104217 <*> v .: "right"
4218+ <*> v .: "s"
42114219 <*> v .: "sbyte"
42124220 <*> v .: "sealed"
42134221 <*> v .: "SEL"
@@ -4471,6 +4479,16 @@ instance FromJSON RightClass where
44714479 parseJSON (Object v) = RightClass
44724480 <$> v .: "right"
44734481
4482+instance ToJSON S where
4483+ toJSON (S sS) =
4484+ object
4485+ [ "s" .= sS
4486+ ]
4487+
4488+instance FromJSON S where
4489+ parseJSON (Object v) = S
4490+ <$> v .: "s"
4491+
44744492 instance ToJSON Sbyte where
44754493 toJSON (Sbyte sbyteSbyte) =
44764494 object
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj4.java+6 −0
@@ -36,6 +36,7 @@ public class Obj4 {
3636 private Retain retain;
3737 private Rethrows rethrows;
3838 private Right right;
39+ private S s;
3940 private Sbyte sbyte;
4041 private Sealed sealed;
4142 private Sel sel;
@@ -234,6 +235,11 @@ public class Obj4 {
234235 @JsonProperty("right")
235236 public void setRight(Right value) { this.right = value; }
236237
238+ @JsonProperty("s")
239+ public S getS() { return s; }
240+ @JsonProperty("s")
241+ public void setS(S value) { this.s = value; }
242+
237243 @JsonProperty("sbyte")
238244 public Sbyte getSbyte() { return sbyte; }
239245 @JsonProperty("sbyte")
Ajava-datetime-legacydefault / src / main / java / io / quicktype / S.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class S {
6+ private long s;
7+
8+ @JsonProperty("s")
9+ public long getS() { return s; }
10+ @JsonProperty("s")
11+ public void setS(long value) { this.s = value; }
12+}
Mjava-lombokdefault / src / main / java / io / quicktype / Obj4.java+6 −0
@@ -36,6 +36,7 @@ public class Obj4 {
3636 private Retain retain;
3737 private Rethrows rethrows;
3838 private Right right;
39+ private S s;
3940 private Sbyte sbyte;
4041 private Sealed sealed;
4142 private Sel sel;
@@ -234,6 +235,11 @@ public class Obj4 {
234235 @JsonProperty("right")
235236 public void setRight(Right value) { this.right = value; }
236237
238+ @JsonProperty("s")
239+ public S getS() { return s; }
240+ @JsonProperty("s")
241+ public void setS(S value) { this.s = value; }
242+
237243 @JsonProperty("sbyte")
238244 public Sbyte getSbyte() { return sbyte; }
239245 @JsonProperty("sbyte")
Ajava-lombokdefault / src / main / java / io / quicktype / S.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class S {
6+ private long s;
7+
8+ @JsonProperty("s")
9+ public long getS() { return s; }
10+ @JsonProperty("s")
11+ public void setS(long value) { this.s = value; }
12+}
Mjavadefault / src / main / java / io / quicktype / Obj4.java+6 −0
@@ -36,6 +36,7 @@ public class Obj4 {
3636 private Retain retain;
3737 private Rethrows rethrows;
3838 private Right right;
39+ private S s;
3940 private Sbyte sbyte;
4041 private Sealed sealed;
4142 private Sel sel;
@@ -234,6 +235,11 @@ public class Obj4 {
234235 @JsonProperty("right")
235236 public void setRight(Right value) { this.right = value; }
236237
238+ @JsonProperty("s")
239+ public S getS() { return s; }
240+ @JsonProperty("s")
241+ public void setS(S value) { this.s = value; }
242+
237243 @JsonProperty("sbyte")
238244 public Sbyte getSbyte() { return sbyte; }
239245 @JsonProperty("sbyte")
Ajavadefault / src / main / java / io / quicktype / S.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class S {
6+ private long s;
7+
8+ @JsonProperty("s")
9+ public long getS() { return s; }
10+ @JsonProperty("s")
11+ public void setS(long value) { this.s = value; }
12+}
Mjavascript-prop-typesdefault / toplevel.js+5 −0
@@ -234,6 +234,7 @@ let _Retain;
234234 let _Rethrows;
235235 let _Return;
236236 let _Right;
237+let _S;
237238 let _Sbyte;
238239 let _Sealed;
239240 let _Select;
@@ -1150,6 +1151,9 @@ _Return = PropTypes.shape({
11501151 _Right = PropTypes.shape({
11511152 "right": PropTypes.oneOfType([Integer]).isRequired,
11521153 });
1154+_S = PropTypes.shape({
1155+ "s": PropTypes.oneOfType([Integer]).isRequired,
1156+});
11531157 _Sbyte = PropTypes.shape({
11541158 "sbyte": PropTypes.oneOfType([Integer]).isRequired,
11551159 });
@@ -1302,6 +1306,7 @@ _Obj4 = PropTypes.shape({
13021306 "rethrows": _Rethrows,
13031307 "return": _Return,
13041308 "right": _Right,
1309+ "s": _S,
13051310 "sbyte": _Sbyte,
13061311 "sealed": _Sealed,
13071312 "select": _Select,
Mjavascriptdefault / TopLevel.js+4 −0
@@ -1012,6 +1012,7 @@ const typeMap = {
10121012 { json: "rethrows", js: "rethrows", typ: r("Rethrows") },
10131013 { json: "return", js: "return", typ: r("Return") },
10141014 { json: "right", js: "right", typ: r("Right") },
1015+ { json: "s", js: "s", typ: r("S") },
10151016 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
10161017 { json: "sealed", js: "sealed", typ: r("Sealed") },
10171018 { json: "select", js: "select", typ: r("Select") },
@@ -1119,6 +1120,9 @@ const typeMap = {
11191120 "Right": o([
11201121 { json: "right", js: "right", typ: i(0) },
11211122 ], false),
1123+ "S": o([
1124+ { json: "s", js: "s", typ: i(0) },
1125+ ], false),
11221126 "Sbyte": o([
11231127 { json: "sbyte", js: "sbyte", typ: i(0) },
11241128 ], false),
Mkotlin-jacksondefault / TopLevel.kt+8 −0
@@ -1705,6 +1705,9 @@ data class Obj4 (
17051705 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
17061706 val right: Right,
17071707
1708+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1709+ val s: S,
1710+
17081711 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
17091712 val sbyte: Sbyte,
17101713
@@ -1952,6 +1955,11 @@ data class Right (
19521955 val right: Long
19531956 )
19541957
1958+data class S (
1959+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1960+ val s: Long
1961+)
1962+
19551963 data class Sbyte (
19561964 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
19571965 val sbyte: Long
Mkotlindefault / TopLevel.kt+5 −0
@@ -1247,6 +1247,7 @@ data class Obj4 (
12471247 val retain: Retain,
12481248 val rethrows: Rethrows,
12491249 val right: Right,
1250+ val s: S,
12501251 val sbyte: Sbyte,
12511252 val sealed: Sealed,
12521253
@@ -1426,6 +1427,10 @@ data class Right (
14261427 val right: Long
14271428 )
14281429
1430+data class S (
1431+ val s: Long
1432+)
1433+
14291434 data class Sbyte (
14301435 val sbyte: Long
14311436 )
Mkotlinxdefault / TopLevel.kt+6 −0
@@ -1443,6 +1443,7 @@ data class Obj4 (
14431443 val retain: Retain,
14441444 val rethrows: Rethrows,
14451445 val right: Right,
1446+ val s: S,
14461447 val sbyte: Sbyte,
14471448 val sealed: Sealed,
14481449
@@ -1649,6 +1650,11 @@ data class Right (
16491650 val right: Long
16501651 )
16511652
1653+@Serializable
1654+data class S (
1655+ val s: Long
1656+)
1657+
16521658 @Serializable
16531659 data class Sbyte (
16541660 val sbyte: Long
Mobjective-cdefault / QTTopLevel.h+6 −0
@@ -233,6 +233,7 @@
233233 @class QTRequires;
234234 @class QTRethrows;
235235 @class QTRight;
236+@class QTS;
236237 @class QTSbyte;
237238 @class QTSealed;
238239 @class QTSel;
@@ -1333,6 +1334,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
13331334 @property (nonatomic, strong) QTRequires *requires;
13341335 @property (nonatomic, strong) QTRethrows *rethrows;
13351336 @property (nonatomic, strong) QTRight *right;
1337+@property (nonatomic, strong) QTS *s;
13361338 @property (nonatomic, strong) QTSbyte *sbyte;
13371339 @property (nonatomic, strong) QTSealed *sealed;
13381340 @property (nonatomic, strong) QTSel *sel;
@@ -1483,6 +1485,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
14831485 @property (nonatomic, assign) NSInteger right;
14841486 @end
14851487
1488+@interface QTS : NSObject
1489+@property (nonatomic, assign) NSInteger s;
1490+@end
1491+
14861492 @interface QTSbyte : NSObject
14871493 @property (nonatomic, assign) NSInteger sbyte;
14881494 @end
Mobjective-cdefault / QTTopLevel.m+52 −0
@@ -1148,6 +1148,11 @@ NS_ASSUME_NONNULL_BEGIN
11481148 - (NSDictionary *)JSONDictionary;
11491149 @end
11501150
1151+@interface QTS (JSONConversion)
1152++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1153+- (NSDictionary *)JSONDictionary;
1154+@end
1155+
11511156 @interface QTSbyte (JSONConversion)
11521157 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
11531158 - (NSDictionary *)JSONDictionary;
@@ -11565,6 +11570,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1156511570 @"requires": @"requires",
1156611571 @"rethrows": @"rethrows",
1156711572 @"right": @"right",
11573+ @"s": @"s",
1156811574 @"sbyte": @"sbyte",
1156911575 @"sealed": @"sealed",
1157011576 @"SEL": @"sel",
@@ -11642,6 +11648,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1164211648 if (![dict[@"requires"] isKindOfClass:NSDictionary.class]) return nil;
1164311649 if (![dict[@"rethrows"] isKindOfClass:NSDictionary.class]) return nil;
1164411650 if (![dict[@"right"] isKindOfClass:NSDictionary.class]) return nil;
11651+ if (![dict[@"s"] isKindOfClass:NSDictionary.class]) return nil;
1164511652 if (![dict[@"sbyte"] isKindOfClass:NSDictionary.class]) return nil;
1164611653 if (![dict[@"sealed"] isKindOfClass:NSDictionary.class]) return nil;
1164711654 if (![dict[@"SEL"] isKindOfClass:NSDictionary.class]) return nil;
@@ -11735,6 +11742,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1173511742 if (!_rethrows && dict[@"rethrows"] && ![dict[@"rethrows"] isKindOfClass:NSNull.class]) return nil;
1173611743 _right = [QTRight fromJSONDictionary:(id)_right];
1173711744 if (!_right && dict[@"right"] && ![dict[@"right"] isKindOfClass:NSNull.class]) return nil;
11745+ _s = [QTS fromJSONDictionary:(id)_s];
11746+ if (!_s && dict[@"s"] && ![dict[@"s"] isKindOfClass:NSNull.class]) return nil;
1173811747 _sbyte = [QTSbyte fromJSONDictionary:(id)_sbyte];
1173911748 if (!_sbyte && dict[@"sbyte"] && ![dict[@"sbyte"] isKindOfClass:NSNull.class]) return nil;
1174011749 _sealed = [QTSealed fromJSONDictionary:(id)_sealed];
@@ -11864,6 +11873,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1186411873 @"requires": [_requires JSONDictionary],
1186511874 @"rethrows": [_rethrows JSONDictionary],
1186611875 @"right": [_right JSONDictionary],
11876+ @"s": [_s JSONDictionary],
1186711877 @"sbyte": [_sbyte JSONDictionary],
1186811878 @"sealed": [_sealed JSONDictionary],
1186911879 @"SEL": [_sel JSONDictionary],
@@ -13222,6 +13232,48 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1322213232 }
1322313233 @end
1322413234
13235+@implementation QTS
13236++ (NSDictionary<NSString *, NSString *> *)properties
13237+{
13238+ static NSDictionary<NSString *, NSString *> *properties;
13239+ return properties = properties ? properties : @{
13240+ @"s": @"s",
13241+ };
13242+}
13243+
13244++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
13245+{
13246+ return [dict isKindOfClass:NSDictionary.class] ? [[QTS alloc] initWithJSONDictionary:dict] : nil;
13247+}
13248+
13249+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
13250+{
13251+ if (self = [super init]) {
13252+ if (![dict[@"s"] isKindOfClass:NSNumber.class]) return nil;
13253+ if ([dict[@"s"] doubleValue] != [dict[@"s"] longLongValue]) return nil;
13254+ [self setValuesForKeysWithDictionary:dict];
13255+ }
13256+ return self;
13257+}
13258+
13259+- (void)setValue:(nullable id)value forKey:(NSString *)key
13260+{
13261+ id resolved = QTS.properties[key];
13262+ if (resolved) [super setValue:value forKey:resolved];
13263+}
13264+
13265+- (void)setNilValueForKey:(NSString *)key
13266+{
13267+ id resolved = QTS.properties[key];
13268+ if (resolved) [super setValue:@(0) forKey:resolved];
13269+}
13270+
13271+- (NSDictionary *)JSONDictionary
13272+{
13273+ return [self dictionaryWithValuesForKeys:QTS.properties.allValues];
13274+}
13275+@end
13276+
1322513277 @implementation QTSbyte
1322613278 + (NSDictionary<NSString *, NSString *> *)properties
1322713279 {
Mphpdefault / TopLevel.php+203 −44
@@ -31725,6 +31725,7 @@ class Obj4 {
3172531725 private Rethrows $rethrows; // json:rethrows Required
3172631726 private ReturnClass $return; // json:return Required
3172731727 private Right $right; // json:right Required
31728+ private S $s; // json:s Required
3172831729 private Sbyte $sbyte; // json:sbyte Required
3172931730 private Sealed $sealed; // json:sealed Required
3173031731 private Sel $sel; // json:SEL Required
@@ -31792,6 +31793,7 @@ class Obj4 {
3179231793 * @param Rethrows $rethrows
3179331794 * @param ReturnClass $return
3179431795 * @param Right $right
31796+ * @param S $s
3179531797 * @param Sbyte $sbyte
3179631798 * @param Sealed $sealed
3179731799 * @param Sel $sel
@@ -31836,7 +31838,7 @@ class Obj4 {
3183631838 * @param Unchecked $unchecked
3183731839 * @param Undefined $undefined
3183831840 */
31839- public function __construct(int $dummy, Obj4Self $obj4Self, This $obj4This, Obj4True $obj4True, TypeClass $obj4Type, PublicClass $public, Quicktype $quicktype, Raise $raise, Range $range, ReadonlyClass $readonly, Ref $ref, Register $register, ReinterpretCast $reinterpretCast, Repeat $repeat, RequireClass $require, Required $required, Requires $requires, Restrict $restrict, Retain $retain, Rethrows $rethrows, ReturnClass $return, Right $right, Sbyte $sbyte, Sealed $sealed, Sel $sel, Select $select, SelfClass $self, Serialize $serialize, Set $set, Short $short, Signed $signed, Sizeof $sizeof, Stackalloc $stackalloc, StaticClass $static, StaticAssert $staticAssert, StaticCast $staticCast, Strictfp $strictfp, StringClass $string, Struct $struct, Subscript $subscript, Super $super, SwitchClass $switch, Symbol $symbol, Synchronized $synchronized, System $system, Template $template, Then $then, ThreadLocal $threadLocal, ThrowClass $throw, Throws $throws, ToJSON $toJSON, TopLevelClass $topLevel, Transient $transient, TrueClass $true, TryClass $try, Type $type, Typealias $typealias, Typedef $typedef, Typeid $typeid, Typename $typename, Typeof $typeof, Uint $uint, Ulong $ulong, Unchecked $unchecked, Undefined $undefined) {
31841+ public function __construct(int $dummy, Obj4Self $obj4Self, This $obj4This, Obj4True $obj4True, TypeClass $obj4Type, PublicClass $public, Quicktype $quicktype, Raise $raise, Range $range, ReadonlyClass $readonly, Ref $ref, Register $register, ReinterpretCast $reinterpretCast, Repeat $repeat, RequireClass $require, Required $required, Requires $requires, Restrict $restrict, Retain $retain, Rethrows $rethrows, ReturnClass $return, Right $right, S $s, Sbyte $sbyte, Sealed $sealed, Sel $sel, Select $select, SelfClass $self, Serialize $serialize, Set $set, Short $short, Signed $signed, Sizeof $sizeof, Stackalloc $stackalloc, StaticClass $static, StaticAssert $staticAssert, StaticCast $staticCast, Strictfp $strictfp, StringClass $string, Struct $struct, Subscript $subscript, Super $super, SwitchClass $switch, Symbol $symbol, Synchronized $synchronized, System $system, Template $template, Then $then, ThreadLocal $threadLocal, ThrowClass $throw, Throws $throws, ToJSON $toJSON, TopLevelClass $topLevel, Transient $transient, TrueClass $true, TryClass $try, Type $type, Typealias $typealias, Typedef $typedef, Typeid $typeid, Typename $typename, Typeof $typeof, Uint $uint, Ulong $ulong, Unchecked $unchecked, Undefined $undefined) {
3184031842 $this->dummy = $dummy;
3184131843 $this->obj4Self = $obj4Self;
3184231844 $this->obj4This = $obj4This;
@@ -31859,6 +31861,7 @@ class Obj4 {
3185931861 $this->rethrows = $rethrows;
3186031862 $this->return = $return;
3186131863 $this->right = $right;
31864+ $this->s = $s;
3186231865 $this->sbyte = $sbyte;
3186331866 $this->sealed = $sealed;
3186431867 $this->sel = $sel;
@@ -32959,6 +32962,54 @@ class Obj4 {
3295932962 return Right::sample(); /*52:right*/
3296032963 }
3296132964
32965+ /**
32966+ * @param stdClass $value
32967+ * @throws Exception
32968+ * @return S
32969+ */
32970+ public static function fromS(stdClass $value): S {
32971+ return S::from($value); /*class*/
32972+ }
32973+
32974+ /**
32975+ * @throws Exception
32976+ * @return stdClass
32977+ */
32978+ public function toS(): stdClass {
32979+ if (Obj4::validateS($this->s)) {
32980+ return $this->s->to(); /*class*/
32981+ }
32982+ throw new Exception('never get to this Obj4::s');
32983+ }
32984+
32985+ /**
32986+ * @param S
32987+ * @return bool
32988+ * @throws Exception
32989+ */
32990+ public static function validateS(S $value): bool {
32991+ $value->validate();
32992+ return true;
32993+ }
32994+
32995+ /**
32996+ * @throws Exception
32997+ * @return S
32998+ */
32999+ public function getS(): S {
33000+ if (Obj4::validateS($this->s)) {
33001+ return $this->s;
33002+ }
33003+ throw new Exception('never get to getS Obj4::s');
33004+ }
33005+
33006+ /**
33007+ * @return S
33008+ */
33009+ public static function sampleS(): S {
33010+ return S::sample(); /*53:s*/
33011+ }
33012+
3296233013 /**
3296333014 * @param stdClass $value
3296433015 * @throws Exception
@@ -33004,7 +33055,7 @@ class Obj4 {
3300433055 * @return Sbyte
3300533056 */
3300633057 public static function sampleSbyte(): Sbyte {
33007- return Sbyte::sample(); /*53:sbyte*/
33058+ return Sbyte::sample(); /*54:sbyte*/
3300833059 }
3300933060
3301033061 /**
@@ -33052,7 +33103,7 @@ class Obj4 {
3305233103 * @return Sealed
3305333104 */
3305433105 public static function sampleSealed(): Sealed {
33055- return Sealed::sample(); /*54:sealed*/
33106+ return Sealed::sample(); /*55:sealed*/
3305633107 }
3305733108
3305833109 /**
@@ -33100,7 +33151,7 @@ class Obj4 {
3310033151 * @return Sel
3310133152 */
3310233153 public static function sampleSel(): Sel {
33103- return Sel::sample(); /*55:sel*/
33154+ return Sel::sample(); /*56:sel*/
3310433155 }
3310533156
3310633157 /**
@@ -33148,7 +33199,7 @@ class Obj4 {
3314833199 * @return Select
3314933200 */
3315033201 public static function sampleSelect(): Select {
33151- return Select::sample(); /*56:select*/
33202+ return Select::sample(); /*57:select*/
3315233203 }
3315333204
3315433205 /**
@@ -33196,7 +33247,7 @@ class Obj4 {
3319633247 * @return SelfClass
3319733248 */
3319833249 public static function sampleSelf(): SelfClass {
33199- return SelfClass::sample(); /*57:self*/
33250+ return SelfClass::sample(); /*58:self*/
3320033251 }
3320133252
3320233253 /**
@@ -33244,7 +33295,7 @@ class Obj4 {
3324433295 * @return Serialize
3324533296 */
3324633297 public static function sampleSerialize(): Serialize {
33247- return Serialize::sample(); /*58:serialize*/
33298+ return Serialize::sample(); /*59:serialize*/
3324833299 }
3324933300
3325033301 /**
@@ -33292,7 +33343,7 @@ class Obj4 {
3329233343 * @return Set
3329333344 */
3329433345 public static function sampleSet(): Set {
33295- return Set::sample(); /*59:set*/
33346+ return Set::sample(); /*60:set*/
3329633347 }
3329733348
3329833349 /**
@@ -33340,7 +33391,7 @@ class Obj4 {
3334033391 * @return Short
3334133392 */
3334233393 public static function sampleShort(): Short {
33343- return Short::sample(); /*60:short*/
33394+ return Short::sample(); /*61:short*/
3334433395 }
3334533396
3334633397 /**
@@ -33388,7 +33439,7 @@ class Obj4 {
3338833439 * @return Signed
3338933440 */
3339033441 public static function sampleSigned(): Signed {
33391- return Signed::sample(); /*61:signed*/
33442+ return Signed::sample(); /*62:signed*/
3339233443 }
3339333444
3339433445 /**
@@ -33436,7 +33487,7 @@ class Obj4 {
3343633487 * @return Sizeof
3343733488 */
3343833489 public static function sampleSizeof(): Sizeof {
33439- return Sizeof::sample(); /*62:sizeof*/
33490+ return Sizeof::sample(); /*63:sizeof*/
3344033491 }
3344133492
3344233493 /**
@@ -33484,7 +33535,7 @@ class Obj4 {
3348433535 * @return Stackalloc
3348533536 */
3348633537 public static function sampleStackalloc(): Stackalloc {
33487- return Stackalloc::sample(); /*63:stackalloc*/
33538+ return Stackalloc::sample(); /*64:stackalloc*/
3348833539 }
3348933540
3349033541 /**
@@ -33532,7 +33583,7 @@ class Obj4 {
3353233583 * @return StaticClass
3353333584 */
3353433585 public static function sampleStatic(): StaticClass {
33535- return StaticClass::sample(); /*64:static*/
33586+ return StaticClass::sample(); /*65:static*/
3353633587 }
3353733588
3353833589 /**
@@ -33580,7 +33631,7 @@ class Obj4 {
3358033631 * @return StaticAssert
3358133632 */
3358233633 public static function sampleStaticAssert(): StaticAssert {
33583- return StaticAssert::sample(); /*65:staticAssert*/
33634+ return StaticAssert::sample(); /*66:staticAssert*/
3358433635 }
3358533636
3358633637 /**
@@ -33628,7 +33679,7 @@ class Obj4 {
3362833679 * @return StaticCast
3362933680 */
3363033681 public static function sampleStaticCast(): StaticCast {
33631- return StaticCast::sample(); /*66:staticCast*/
33682+ return StaticCast::sample(); /*67:staticCast*/
3363233683 }
3363333684
3363433685 /**
@@ -33676,7 +33727,7 @@ class Obj4 {
3367633727 * @return Strictfp
3367733728 */
3367833729 public static function sampleStrictfp(): Strictfp {
33679- return Strictfp::sample(); /*67:strictfp*/
33730+ return Strictfp::sample(); /*68:strictfp*/
3368033731 }
3368133732
3368233733 /**
@@ -33724,7 +33775,7 @@ class Obj4 {
3372433775 * @return StringClass
3372533776 */
3372633777 public static function sampleString(): StringClass {
33727- return StringClass::sample(); /*68:string*/
33778+ return StringClass::sample(); /*69:string*/
3372833779 }
3372933780
3373033781 /**
@@ -33772,7 +33823,7 @@ class Obj4 {
3377233823 * @return Struct
3377333824 */
3377433825 public static function sampleStruct(): Struct {
33775- return Struct::sample(); /*69:struct*/
33826+ return Struct::sample(); /*70:struct*/
3377633827 }
3377733828
3377833829 /**
@@ -33820,7 +33871,7 @@ class Obj4 {
3382033871 * @return Subscript
3382133872 */
3382233873 public static function sampleSubscript(): Subscript {
33823- return Subscript::sample(); /*70:subscript*/
33874+ return Subscript::sample(); /*71:subscript*/
3382433875 }
3382533876
3382633877 /**
@@ -33868,7 +33919,7 @@ class Obj4 {
3386833919 * @return Super
3386933920 */
3387033921 public static function sampleSuper(): Super {
33871- return Super::sample(); /*71:super*/
33922+ return Super::sample(); /*72:super*/
3387233923 }
3387333924
3387433925 /**
@@ -33916,7 +33967,7 @@ class Obj4 {
3391633967 * @return SwitchClass
3391733968 */
3391833969 public static function sampleSwitch(): SwitchClass {
33919- return SwitchClass::sample(); /*72:switch*/
33970+ return SwitchClass::sample(); /*73:switch*/
3392033971 }
3392133972
3392233973 /**
@@ -33964,7 +34015,7 @@ class Obj4 {
3396434015 * @return Symbol
3396534016 */
3396634017 public static function sampleSymbol(): Symbol {
33967- return Symbol::sample(); /*73:symbol*/
34018+ return Symbol::sample(); /*74:symbol*/
3396834019 }
3396934020
3397034021 /**
@@ -34012,7 +34063,7 @@ class Obj4 {
3401234063 * @return Synchronized
3401334064 */
3401434065 public static function sampleSynchronized(): Synchronized {
34015- return Synchronized::sample(); /*74:synchronized*/
34066+ return Synchronized::sample(); /*75:synchronized*/
3401634067 }
3401734068
3401834069 /**
@@ -34060,7 +34111,7 @@ class Obj4 {
3406034111 * @return System
3406134112 */
3406234113 public static function sampleSystem(): System {
34063- return System::sample(); /*75:system*/
34114+ return System::sample(); /*76:system*/
3406434115 }
3406534116
3406634117 /**
@@ -34108,7 +34159,7 @@ class Obj4 {
3410834159 * @return Template
3410934160 */
3411034161 public static function sampleTemplate(): Template {
34111- return Template::sample(); /*76:template*/
34162+ return Template::sample(); /*77:template*/
3411234163 }
3411334164
3411434165 /**
@@ -34156,7 +34207,7 @@ class Obj4 {
3415634207 * @return Then
3415734208 */
3415834209 public static function sampleThen(): Then {
34159- return Then::sample(); /*77:then*/
34210+ return Then::sample(); /*78:then*/
3416034211 }
3416134212
3416234213 /**
@@ -34204,7 +34255,7 @@ class Obj4 {
3420434255 * @return ThreadLocal
3420534256 */
3420634257 public static function sampleThreadLocal(): ThreadLocal {
34207- return ThreadLocal::sample(); /*78:threadLocal*/
34258+ return ThreadLocal::sample(); /*79:threadLocal*/
3420834259 }
3420934260
3421034261 /**
@@ -34252,7 +34303,7 @@ class Obj4 {
3425234303 * @return ThrowClass
3425334304 */
3425434305 public static function sampleThrow(): ThrowClass {
34255- return ThrowClass::sample(); /*79:throw*/
34306+ return ThrowClass::sample(); /*80:throw*/
3425634307 }
3425734308
3425834309 /**
@@ -34300,7 +34351,7 @@ class Obj4 {
3430034351 * @return Throws
3430134352 */
3430234353 public static function sampleThrows(): Throws {
34303- return Throws::sample(); /*80:throws*/
34354+ return Throws::sample(); /*81:throws*/
3430434355 }
3430534356
3430634357 /**
@@ -34348,7 +34399,7 @@ class Obj4 {
3434834399 * @return ToJSON
3434934400 */
3435034401 public static function sampleToJSON(): ToJSON {
34351- return ToJSON::sample(); /*81:toJSON*/
34402+ return ToJSON::sample(); /*82:toJSON*/
3435234403 }
3435334404
3435434405 /**
@@ -34396,7 +34447,7 @@ class Obj4 {
3439634447 * @return TopLevelClass
3439734448 */
3439834449 public static function sampleTopLevel(): TopLevelClass {
34399- return TopLevelClass::sample(); /*82:topLevel*/
34450+ return TopLevelClass::sample(); /*83:topLevel*/
3440034451 }
3440134452
3440234453 /**
@@ -34444,7 +34495,7 @@ class Obj4 {
3444434495 * @return Transient
3444534496 */
3444634497 public static function sampleTransient(): Transient {
34447- return Transient::sample(); /*83:transient*/
34498+ return Transient::sample(); /*84:transient*/
3444834499 }
3444934500
3445034501 /**
@@ -34492,7 +34543,7 @@ class Obj4 {
3449234543 * @return TrueClass
3449334544 */
3449434545 public static function sampleTrue(): TrueClass {
34495- return TrueClass::sample(); /*84:true*/
34546+ return TrueClass::sample(); /*85:true*/
3449634547 }
3449734548
3449834549 /**
@@ -34540,7 +34591,7 @@ class Obj4 {
3454034591 * @return TryClass
3454134592 */
3454234593 public static function sampleTry(): TryClass {
34543- return TryClass::sample(); /*85:try*/
34594+ return TryClass::sample(); /*86:try*/
3454434595 }
3454534596
3454634597 /**
@@ -34588,7 +34639,7 @@ class Obj4 {
3458834639 * @return Type
3458934640 */
3459034641 public static function sampleType(): Type {
34591- return Type::sample(); /*86:type*/
34642+ return Type::sample(); /*87:type*/
3459234643 }
3459334644
3459434645 /**
@@ -34636,7 +34687,7 @@ class Obj4 {
3463634687 * @return Typealias
3463734688 */
3463834689 public static function sampleTypealias(): Typealias {
34639- return Typealias::sample(); /*87:typealias*/
34690+ return Typealias::sample(); /*88:typealias*/
3464034691 }
3464134692
3464234693 /**
@@ -34684,7 +34735,7 @@ class Obj4 {
3468434735 * @return Typedef
3468534736 */
3468634737 public static function sampleTypedef(): Typedef {
34687- return Typedef::sample(); /*88:typedef*/
34738+ return Typedef::sample(); /*89:typedef*/
3468834739 }
3468934740
3469034741 /**
@@ -34732,7 +34783,7 @@ class Obj4 {
3473234783 * @return Typeid
3473334784 */
3473434785 public static function sampleTypeid(): Typeid {
34735- return Typeid::sample(); /*89:typeid*/
34786+ return Typeid::sample(); /*90:typeid*/
3473634787 }
3473734788
3473834789 /**
@@ -34780,7 +34831,7 @@ class Obj4 {
3478034831 * @return Typename
3478134832 */
3478234833 public static function sampleTypename(): Typename {
34783- return Typename::sample(); /*90:typename*/
34834+ return Typename::sample(); /*91:typename*/
3478434835 }
3478534836
3478634837 /**
@@ -34828,7 +34879,7 @@ class Obj4 {
3482834879 * @return Typeof
3482934880 */
3483034881 public static function sampleTypeof(): Typeof {
34831- return Typeof::sample(); /*91:typeof*/
34882+ return Typeof::sample(); /*92:typeof*/
3483234883 }
3483334884
3483434885 /**
@@ -34876,7 +34927,7 @@ class Obj4 {
3487634927 * @return Uint
3487734928 */
3487834929 public static function sampleUint(): Uint {
34879- return Uint::sample(); /*92:uint*/
34930+ return Uint::sample(); /*93:uint*/
3488034931 }
3488134932
3488234933 /**
@@ -34924,7 +34975,7 @@ class Obj4 {
3492434975 * @return Ulong
3492534976 */
3492634977 public static function sampleUlong(): Ulong {
34927- return Ulong::sample(); /*93:ulong*/
34978+ return Ulong::sample(); /*94:ulong*/
3492834979 }
3492934980
3493034981 /**
@@ -34972,7 +35023,7 @@ class Obj4 {
3497235023 * @return Unchecked
3497335024 */
3497435025 public static function sampleUnchecked(): Unchecked {
34975- return Unchecked::sample(); /*94:unchecked*/
35026+ return Unchecked::sample(); /*95:unchecked*/
3497635027 }
3497735028
3497835029 /**
@@ -35020,7 +35071,7 @@ class Obj4 {
3502035071 * @return Undefined
3502135072 */
3502235073 public static function sampleUndefined(): Undefined {
35023- return Undefined::sample(); /*95:undefined*/
35074+ return Undefined::sample(); /*96:undefined*/
3502435075 }
3502535076
3502635077 /**
@@ -35050,6 +35101,7 @@ class Obj4 {
3505035101 || Obj4::validateRethrows($this->rethrows)
3505135102 || Obj4::validateReturn($this->return)
3505235103 || Obj4::validateRight($this->right)
35104+ || Obj4::validateS($this->s)
3505335105 || Obj4::validateSbyte($this->sbyte)
3505435106 || Obj4::validateSealed($this->sealed)
3505535107 || Obj4::validateSel($this->sel)
@@ -35123,6 +35175,7 @@ class Obj4 {
3512335175 $out->{'rethrows'} = $this->toRethrows();
3512435176 $out->{'return'} = $this->toReturn();
3512535177 $out->{'right'} = $this->toRight();
35178+ $out->{'s'} = $this->toS();
3512635179 $out->{'sbyte'} = $this->toSbyte();
3512735180 $out->{'sealed'} = $this->toSealed();
3512835181 $out->{'SEL'} = $this->toSel();
@@ -35241,6 +35294,9 @@ class Obj4 {
3524135294 if (!property_exists($obj, 'right')) {
3524235295 throw new Exception("Missing required property");
3524335296 }
35297+ if (!property_exists($obj, 's')) {
35298+ throw new Exception("Missing required property");
35299+ }
3524435300 if (!property_exists($obj, 'sbyte')) {
3524535301 throw new Exception("Missing required property");
3524635302 }
@@ -35393,6 +35449,7 @@ class Obj4 {
3539335449 ,Obj4::fromRethrows($obj->{'rethrows'})
3539435450 ,Obj4::fromReturn($obj->{'return'})
3539535451 ,Obj4::fromRight($obj->{'right'})
35452+ ,Obj4::fromS($obj->{'s'})
3539635453 ,Obj4::fromSbyte($obj->{'sbyte'})
3539735454 ,Obj4::fromSealed($obj->{'sealed'})
3539835455 ,Obj4::fromSel($obj->{'SEL'})
@@ -35466,6 +35523,7 @@ class Obj4 {
3546635523 ,Obj4::sampleRethrows()
3546735524 ,Obj4::sampleReturn()
3546835525 ,Obj4::sampleRight()
35526+ ,Obj4::sampleS()
3546935527 ,Obj4::sampleSbyte()
3547035528 ,Obj4::sampleSealed()
3547135529 ,Obj4::sampleSel()
@@ -37634,6 +37692,107 @@ class Right {
3763437692 }
3763537693 }
3763637694
37695+// This is an autogenerated file:S
37696+
37697+class S {
37698+ private int $s; // json:s Required
37699+
37700+ /**
37701+ * @param int $s
37702+ */
37703+ public function __construct(int $s) {
37704+ $this->s = $s;
37705+ }
37706+
37707+ /**
37708+ * @param int $value
37709+ * @throws Exception
37710+ * @return int
37711+ */
37712+ public static function fromS(int $value): int {
37713+ return $value; /*int*/
37714+ }
37715+
37716+ /**
37717+ * @throws Exception
37718+ * @return int
37719+ */
37720+ public function toS(): int {
37721+ if (S::validateS($this->s)) {
37722+ return $this->s; /*int*/
37723+ }
37724+ throw new Exception('never get to this S::s');
37725+ }
37726+
37727+ /**
37728+ * @param int
37729+ * @return bool
37730+ * @throws Exception
37731+ */
37732+ public static function validateS(int $value): bool {
37733+ return true;
37734+ }
37735+
37736+ /**
37737+ * @throws Exception
37738+ * @return int
37739+ */
37740+ public function getS(): int {
37741+ if (S::validateS($this->s)) {
37742+ return $this->s;
37743+ }
37744+ throw new Exception('never get to getS S::s');
37745+ }
37746+
37747+ /**
37748+ * @return int
37749+ */
37750+ public static function sampleS(): int {
37751+ return 31; /*31:s*/
37752+ }
37753+
37754+ /**
37755+ * @throws Exception
37756+ * @return bool
37757+ */
37758+ public function validate(): bool {
37759+ return S::validateS($this->s);
37760+ }
37761+
37762+ /**
37763+ * @return stdClass
37764+ * @throws Exception
37765+ */
37766+ public function to(): stdClass {
37767+ $out = new stdClass();
37768+ $out->{'s'} = $this->toS();
37769+ return $out;
37770+ }
37771+
37772+ /**
37773+ * @param stdClass $obj
37774+ * @return S
37775+ * @throws Exception
37776+ */
37777+ public static function from(stdClass $obj): S {
37778+ if (!property_exists($obj, 's')) {
37779+ throw new Exception("Missing required property");
37780+ }
37781+ return new S(
37782+ S::fromS($obj->{'s'})
37783+ );
37784+ }
37785+
37786+ /**
37787+ * @return S
37788+ */
37789+ public static function sample(): S {
37790+ return new S(
37791+ S::sampleS()
37792+ );
37793+ }
37794+}
37795+
3763737796 // This is an autogenerated file:Sbyte
3763837797
3763937798 class Sbyte {
Mpikedefault / TopLevel.pmod+24 −0
@@ -4818,6 +4818,7 @@ class Obj4 {
48184818 Retain retain; // json: "retain"
48194819 Rethrows rethrows; // json: "rethrows"
48204820 Right right; // json: "right"
4821+ S s; // json: "s"
48214822 Sbyte sbyte; // json: "sbyte"
48224823 Sealed sealed; // json: "sealed"
48234824 Sel sel; // json: "SEL"
@@ -4886,6 +4887,7 @@ class Obj4 {
48864887 "retain" : retain,
48874888 "rethrows" : rethrows,
48884889 "right" : right,
4890+ "s" : s,
48894891 "sbyte" : sbyte,
48904892 "sealed" : sealed,
48914893 "SEL" : sel,
@@ -4961,6 +4963,7 @@ Obj4 Obj4_from_JSON(mixed json) {
49614963 retval.retain = json["retain"];
49624964 retval.rethrows = json["rethrows"];
49634965 retval.right = json["right"];
4966+ retval.s = json["s"];
49644967 retval.sbyte = json["sbyte"];
49654968 retval.sealed = json["sealed"];
49664969 retval.sel = json["SEL"];
@@ -5529,6 +5532,27 @@ Right Right_from_JSON(mixed json) {
55295532 return retval;
55305533 }
55315534
5535+class S {
5536+ int s; // json: "s"
5537+
5538+ string encode_json() {
5539+ mapping(string:mixed) json = ([
5540+ "s" : s,
5541+ ]);
5542+
5543+ return Standards.JSON.encode(json);
5544+ }
5545+}
5546+
5547+S S_from_JSON(mixed json) {
5548+ S retval = S();
5549+
5550+ if (!intp(json["s"])) error("Expected integer");
5551+ retval.s = json["s"];
5552+
5553+ return retval;
5554+}
5555+
55325556 class Sbyte {
55335557 int sbyte; // json: "sbyte"
Mpythondefault / quicktype.py+20 −1
@@ -4120,6 +4120,22 @@ class Right:
41204120 return result
41214121
41224122
4123+@dataclass
4124+class S:
4125+ s: int
4126+
4127+ @staticmethod
4128+ def from_dict(obj: Any) -> 'S':
4129+ assert isinstance(obj, dict)
4130+ s = from_int(obj.get("s"))
4131+ return S(s)
4132+
4133+ def to_dict(self) -> dict:
4134+ result: dict = {}
4135+ result["s"] = from_int(self.s)
4136+ return result
4137+
4138+
41234139 @dataclass
41244140 class Sbyte:
41254141 sbyte: int
@@ -4816,6 +4832,7 @@ class Obj4:
48164832 rethrows: Rethrows
48174833 obj4_return: Return
48184834 right: Right
4835+ s: S
48194836 sbyte: Sbyte
48204837 sealed: Sealed
48214838 select: Select
@@ -4885,6 +4902,7 @@ class Obj4:
48854902 rethrows = Rethrows.from_dict(obj.get("rethrows"))
48864903 obj4_return = Return.from_dict(obj.get("return"))
48874904 right = Right.from_dict(obj.get("right"))
4905+ s = S.from_dict(obj.get("s"))
48884906 sbyte = Sbyte.from_dict(obj.get("sbyte"))
48894907 sealed = Sealed.from_dict(obj.get("sealed"))
48904908 select = Select.from_dict(obj.get("select"))
@@ -4928,7 +4946,7 @@ class Obj4:
49284946 ulong = Ulong.from_dict(obj.get("ulong"))
49294947 unchecked = Unchecked.from_dict(obj.get("unchecked"))
49304948 undefined = Undefined.from_dict(obj.get("undefined"))
4931- return Obj4(sel, obj4_self, true, type, dummy, public, quicktype, obj4_raise, range, readonly, ref, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, obj4_return, right, sbyte, sealed, select, purple_self, serialize, set, short, signed, sizeof, stackalloc, static, static_assert, static_cast, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, to_json, top_level, transient, obj4_true, obj4_try, obj4_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined)
4949+ return Obj4(sel, obj4_self, true, type, dummy, public, quicktype, obj4_raise, range, readonly, ref, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, obj4_return, right, s, sbyte, sealed, select, purple_self, serialize, set, short, signed, sizeof, stackalloc, static, static_assert, static_cast, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, to_json, top_level, transient, obj4_true, obj4_try, obj4_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined)
49324950
49334951 def to_dict(self) -> dict:
49344952 result: dict = {}
@@ -4954,6 +4972,7 @@ class Obj4:
49544972 result["rethrows"] = to_class(Rethrows, self.rethrows)
49554973 result["return"] = to_class(Return, self.obj4_return)
49564974 result["right"] = to_class(Right, self.right)
4975+ result["s"] = to_class(S, self.s)
49574976 result["sbyte"] = to_class(Sbyte, self.sbyte)
49584977 result["sealed"] = to_class(Sealed, self.sealed)
49594978 result["select"] = to_class(Select, self.select)
Mrubydefault / TopLevel.rb+28 −0
@@ -6229,6 +6229,31 @@ class Right < Dry::Struct
62296229 end
62306230 end
62316231
6232+class S < Dry::Struct
6233+ attribute :s, Types::Integer
6234+
6235+ def self.from_dynamic!(d)
6236+ d = Types::Hash[d]
6237+ new(
6238+ s: d.fetch("s"),
6239+ )
6240+ end
6241+
6242+ def self.from_json!(json)
6243+ from_dynamic!(JSON.parse(json))
6244+ end
6245+
6246+ def to_dynamic
6247+ {
6248+ "s" => s,
6249+ }
6250+ end
6251+
6252+ def to_json(options = nil)
6253+ JSON.generate(to_dynamic, options)
6254+ end
6255+end
6256+
62326257 class Sbyte < Dry::Struct
62336258 attribute :sbyte, Types::Integer
62346259
@@ -7183,6 +7208,7 @@ class Obj4 < Dry::Struct
71837208 attribute :retain, Retain
71847209 attribute :rethrows, Rethrows
71857210 attribute :right, Right
7211+ attribute :s, S
71867212 attribute :sbyte, Sbyte
71877213 attribute :sealed, Sealed
71887214 attribute :sel, Sel
@@ -7252,6 +7278,7 @@ class Obj4 < Dry::Struct
72527278 retain: Retain.from_dynamic!(d.fetch("retain")),
72537279 rethrows: Rethrows.from_dynamic!(d.fetch("rethrows")),
72547280 right: Right.from_dynamic!(d.fetch("right")),
7281+ s: S.from_dynamic!(d.fetch("s")),
72557282 sbyte: Sbyte.from_dynamic!(d.fetch("sbyte")),
72567283 sealed: Sealed.from_dynamic!(d.fetch("sealed")),
72577284 sel: Sel.from_dynamic!(d.fetch("SEL")),
@@ -7326,6 +7353,7 @@ class Obj4 < Dry::Struct
73267353 "retain" => retain.to_dynamic,
73277354 "rethrows" => rethrows.to_dynamic,
73287355 "right" => right.to_dynamic,
7356+ "s" => s.to_dynamic,
73297357 "sbyte" => sbyte.to_dynamic,
73307358 "sealed" => sealed.to_dynamic,
73317359 "SEL" => sel.to_dynamic,
Mrustdefault / module_under_test.rs+7 −0
@@ -1565,6 +1565,8 @@ pub struct Obj4 {
15651565
15661566 pub right: Right,
15671567
1568+ pub s: S,
1569+
15681570 pub sbyte: Sbyte,
15691571
15701572 pub sealed: Sealed,
@@ -1795,6 +1797,11 @@ pub struct Right {
17951797 pub right: i64,
17961798 }
17971799
1800+#[derive(Debug, Clone, Serialize, Deserialize)]
1801+pub struct S {
1802+ pub s: i64,
1803+}
1804+
17981805 #[derive(Debug, Clone, Serialize, Deserialize)]
17991806 pub struct Sbyte {
18001807 pub sbyte: i64,
Mscala3-upickledefault / TopLevel.scala+5 −0
@@ -1097,6 +1097,7 @@ case class Obj4 (
10971097 val retain : Retain,
10981098 val rethrows : Rethrows,
10991099 val right : Right,
1100+ val s : S,
11001101 val sbyte : Sbyte,
11011102 val SEL : Sel,
11021103 val select : Select,
@@ -1248,6 +1249,10 @@ case class Right (
12481249 val right : Long
12491250 ) derives OptionPickler.ReadWriter
12501251
1252+case class S (
1253+ val s : Long
1254+) derives OptionPickler.ReadWriter
1255+
12511256 case class Sbyte (
12521257 val sbyte : Long
12531258 ) derives OptionPickler.ReadWriter
Mscala3default / TopLevel.scala+5 −0
@@ -1061,6 +1061,7 @@ case class Obj4 (
10611061 val retain : Retain,
10621062 val rethrows : Rethrows,
10631063 val right : Right,
1064+ val s : S,
10641065 val sbyte : Sbyte,
10651066 val SEL : Sel,
10661067 val select : Select,
@@ -1220,6 +1221,10 @@ case class Right (
12201221 val right : Long
12211222 ) derives Encoder.AsObject, Decoder
12221223
1224+case class S (
1225+ val s : Long
1226+) derives Encoder.AsObject, Decoder
1227+
12231228 case class Sbyte (
12241229 val sbyte : Long
12251230 ) derives Encoder.AsObject, Decoder
Mswiftdefault / quicktype.swift+48 −0
@@ -9596,6 +9596,7 @@ struct Obj4: Codable {
95969596 let requires: Requires
95979597 let restrict: Restrict
95989598 let retain: Retain
9599+ let s: S
95999600 let sbyte: Sbyte
96009601 let sealed: Sealed
96019602 let sel: Sel
@@ -9663,6 +9664,7 @@ struct Obj4: Codable {
96639664 case requires = "requires"
96649665 case restrict = "restrict"
96659666 case retain = "retain"
9667+ case s = "s"
96669668 case sbyte = "sbyte"
96679669 case sealed = "sealed"
96689670 case sel = "SEL"
@@ -9750,6 +9752,7 @@ extension Obj4 {
97509752 requires: Requires? = nil,
97519753 restrict: Restrict? = nil,
97529754 retain: Retain? = nil,
9755+ s: S? = nil,
97539756 sbyte: Sbyte? = nil,
97549757 sealed: Sealed? = nil,
97559758 sel: Sel? = nil,
@@ -9817,6 +9820,7 @@ extension Obj4 {
98179820 requires: requires ?? self.requires,
98189821 restrict: restrict ?? self.restrict,
98199822 retain: retain ?? self.retain,
9823+ s: s ?? self.s,
98209824 sbyte: sbyte ?? self.sbyte,
98219825 sealed: sealed ?? self.sealed,
98229826 sel: sel ?? self.sel,
@@ -11269,6 +11273,50 @@ extension Retain {
1126911273 }
1127011274 }
1127111275
11276+// MARK: - S
11277+struct S: Codable {
11278+ let s: Int
11279+
11280+ enum CodingKeys: String, CodingKey {
11281+ case s = "s"
11282+ }
11283+}
11284+
11285+// MARK: S convenience initializers and mutators
11286+
11287+extension S {
11288+ init(data: Data) throws {
11289+ self = try newJSONDecoder().decode(S.self, from: data)
11290+ }
11291+
11292+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
11293+ guard let data = json.data(using: encoding) else {
11294+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11295+ }
11296+ try self.init(data: data)
11297+ }
11298+
11299+ init(fromURL url: URL) throws {
11300+ try self.init(data: try Data(contentsOf: url))
11301+ }
11302+
11303+ func with(
11304+ s: Int? = nil
11305+ ) -> S {
11306+ return S(
11307+ s: s ?? self.s
11308+ )
11309+ }
11310+
11311+ func jsonData() throws -> Data {
11312+ return try newJSONEncoder().encode(self)
11313+ }
11314+
11315+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
11316+ return String(data: try self.jsonData(), encoding: encoding)
11317+ }
11318+}
11319+
1127211320 // MARK: - Sbyte
1127311321 struct Sbyte: Codable {
1127411322 let sbyte: Int
Mtypescript-effect-schemadefault / TopLevel.ts+5 −0
@@ -281,6 +281,10 @@ export class Sbyte extends S.Class<Sbyte>("Sbyte")({
281281 "sbyte": S.Int,
282282 }) {}
283283
284+export class SClass extends S.Class<SClass>("SClass")({
285+ "s": S.Int,
286+}) {}
287+
284288 export class Right extends S.Class<Right>("Right")({
285289 "right": S.Int,
286290 }) {}
@@ -383,6 +387,7 @@ export class Obj4 extends S.Class<Obj4>("Obj4")({
383387 "rethrows": Rethrows,
384388 "return": Return,
385389 "right": Right,
390+ "s": SClass,
386391 "sbyte": Sbyte,
387392 "sealed": Sealed,
388393 "SEL": Sel,
Mtypescript-zoddefault / TopLevel.ts+6 −0
@@ -1076,6 +1076,11 @@ export const RightSchema = z.object({
10761076 });
10771077 export type Right = z.infer<typeof RightSchema>;
10781078
1079+export const SSchema = z.object({
1080+ "s": z.number().int(),
1081+});
1082+export type S = z.infer<typeof SSchema>;
1083+
10791084 export const SbyteSchema = z.object({
10801085 "sbyte": z.number().int(),
10811086 });
@@ -1628,6 +1633,7 @@ export const Obj4Schema = z.object({
16281633 "rethrows": RethrowsSchema,
16291634 "return": ReturnSchema,
16301635 "right": RightSchema,
1636+ "s": SSchema,
16311637 "sbyte": SbyteSchema,
16321638 "sealed": SealedSchema,
16331639 "SEL": SelSchema,
Mtypescriptdefault / TopLevel.ts+9 −0
@@ -1026,6 +1026,7 @@ export interface Obj4 {
10261026 rethrows: Rethrows;
10271027 return: Return;
10281028 right: Right;
1029+ s: S;
10291030 sbyte: Sbyte;
10301031 sealed: Sealed;
10311032 select: Select;
@@ -1155,6 +1156,10 @@ export interface Right {
11551156 right: number;
11561157 }
11571158
1159+export interface S {
1160+ s: number;
1161+}
1162+
11581163 export interface Sbyte {
11591164 sbyte: number;
11601165 }
@@ -2438,6 +2443,7 @@ const typeMap: any = {
24382443 { json: "rethrows", js: "rethrows", typ: r("Rethrows") },
24392444 { json: "return", js: "return", typ: r("Return") },
24402445 { json: "right", js: "right", typ: r("Right") },
2446+ { json: "s", js: "s", typ: r("S") },
24412447 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
24422448 { json: "sealed", js: "sealed", typ: r("Sealed") },
24432449 { json: "select", js: "select", typ: r("Select") },
@@ -2545,6 +2551,9 @@ const typeMap: any = {
25452551 "Right": o([
25462552 { json: "right", js: "right", typ: i(0) },
25472553 ], false),
2554+ "S": o([
2555+ { json: "s", js: "s", typ: i(0) },
2556+ ], false),
25482557 "Sbyte": o([
25492558 { json: "sbyte", js: "sbyte", typ: i(0) },
25502559 ], false),
Test case

test/inputs/json/priority/nbl-stats.json

1 generated file · +21 −3
Melixirdefault / QuickType.ex+21 −3
@@ -816,6 +816,12 @@ defmodule Scorer do
816816 def encode_name(value) when is_binary(value), do: value
817817 def encode_name(_), do: {:error, "Unexpected type when encoding Scorer.name"}
818818
819+ def decode_per(value) when is_integer(value), do: value
820+ def decode_per(_), do: {:error, "Unexpected type when decoding Scorer.per"}
821+
822+ def encode_per(value) when is_integer(value), do: value
823+ def encode_per(_), do: {:error, "Unexpected type when encoding Scorer.per"}
824+
819825 def decode_player(value) when is_binary(value), do: value
820826 def decode_player(_), do: {:error, "Unexpected type when decoding Scorer.player"}
821827
@@ -846,6 +852,12 @@ defmodule Scorer do
846852 def encode_tno(value) when is_integer(value), do: value
847853 def encode_tno(_), do: {:error, "Unexpected type when encoding Scorer.tno"}
848854
855+ def decode_tot(value) when is_integer(value), do: value
856+ def decode_tot(_), do: {:error, "Unexpected type when decoding Scorer.tot"}
857+
858+ def encode_tot(value) when is_integer(value), do: value
859+ def encode_tot(_), do: {:error, "Unexpected type when encoding Scorer.tot"}
860+
849861 def from_map(m) do
850862 %Scorer{
851863 family_name: m["familyName"] && decode_family_name(m["familyName"]),
@@ -858,7 +870,7 @@ defmodule Scorer do
858870 international_first_name: m["internationalFirstName"] && decode_international_first_name(m["internationalFirstName"]),
859871 international_first_name_initial: m["internationalFirstNameInitial"] && FirstNameInitial.decode(m["internationalFirstNameInitial"]),
860872 name: m["name"] && decode_name(m["name"]),
861- per: m["per"],
873+ per: m["per"] && decode_per(m["per"]),
862874 per_type: m["perType"] && PerType.decode(m["perType"]),
863875 player: m["player"] && decode_player(m["player"]),
864876 pno: decode_pno(m["pno"]),
@@ -867,7 +879,7 @@ defmodule Scorer do
867879 summary: m["summary"] && decode_summary(m["summary"]),
868880 times: m["times"] && Enum.map(m["times"], &TimeElement.from_map/1),
869881 tno: decode_tno(m["tno"]),
870- tot: m["tot"],
882+ tot: m["tot"] && decode_tot(m["tot"]),
871883 }
872884 end
873885
@@ -1130,6 +1142,12 @@ defmodule Pl do
11301142 def encode_active(value) when is_integer(value), do: value
11311143 def encode_active(_), do: {:error, "Unexpected type when encoding Pl.active"}
11321144
1145+ def decode_captain(value) when is_integer(value), do: value
1146+ def decode_captain(_), do: {:error, "Unexpected type when decoding Pl.captain"}
1147+
1148+ def encode_captain(value) when is_integer(value), do: value
1149+ def encode_captain(_), do: {:error, "Unexpected type when encoding Pl.captain"}
1150+
11331151 def decode_eff_1(value) when is_integer(value), do: value
11341152 def decode_eff_1(_), do: {:error, "Unexpected type when decoding Pl.eff_1"}
11351153
@@ -1389,7 +1407,7 @@ defmodule Pl do
13891407 def from_map(m) do
13901408 %Pl{
13911409 active: decode_active(m["active"]),
1392- captain: m["captain"],
1410+ captain: m["captain"] && decode_captain(m["captain"]),
13931411 comp: m["comp"] && Comp.from_map(m["comp"]),
13941412 eff_1: decode_eff_1(m["eff_1"]),
13951413 eff_2: decode_eff_2(m["eff_2"]),
Test case

test/inputs/json/samples/github-events.json

1 generated file · +28 −4
Melixirdefault / QuickType.ex+28 −4
@@ -2233,6 +2233,12 @@ defmodule Payload do
22332233 def encode_description(value) when is_binary(value), do: value
22342234 def encode_description(_), do: {:error, "Unexpected type when encoding Payload.description"}
22352235
2236+ def decode_distinct_size(value) when is_integer(value), do: value
2237+ def decode_distinct_size(_), do: {:error, "Unexpected type when decoding Payload.distinct_size"}
2238+
2239+ def encode_distinct_size(value) when is_integer(value), do: value
2240+ def encode_distinct_size(_), do: {:error, "Unexpected type when encoding Payload.distinct_size"}
2241+
22362242 def decode_head(value) when is_binary(value), do: value
22372243 def decode_head(_), do: {:error, "Unexpected type when decoding Payload.head"}
22382244
@@ -2245,6 +2251,18 @@ defmodule Payload do
22452251 def encode_master_branch(value) when is_binary(value), do: value
22462252 def encode_master_branch(_), do: {:error, "Unexpected type when encoding Payload.master_branch"}
22472253
2254+ def decode_number(value) when is_integer(value), do: value
2255+ def decode_number(_), do: {:error, "Unexpected type when decoding Payload.number"}
2256+
2257+ def encode_number(value) when is_integer(value), do: value
2258+ def encode_number(_), do: {:error, "Unexpected type when encoding Payload.number"}
2259+
2260+ def decode_push_id(value) when is_integer(value), do: value
2261+ def decode_push_id(_), do: {:error, "Unexpected type when decoding Payload.push_id"}
2262+
2263+ def encode_push_id(value) when is_integer(value), do: value
2264+ def encode_push_id(_), do: {:error, "Unexpected type when encoding Payload.push_id"}
2265+
22482266 def decode_pusher_type(value) when is_binary(value), do: value
22492267 def decode_pusher_type(_), do: {:error, "Unexpected type when decoding Payload.pusher_type"}
22502268
@@ -2263,6 +2281,12 @@ defmodule Payload do
22632281 def encode_ref_type(value) when is_binary(value), do: value
22642282 def encode_ref_type(_), do: {:error, "Unexpected type when encoding Payload.ref_type"}
22652283
2284+ def decode_size(value) when is_integer(value), do: value
2285+ def decode_size(_), do: {:error, "Unexpected type when decoding Payload.size"}
2286+
2287+ def encode_size(value) when is_integer(value), do: value
2288+ def encode_size(_), do: {:error, "Unexpected type when encoding Payload.size"}
2289+
22662290 def from_map(m) do
22672291 %Payload{
22682292 action: m["action"] && decode_action(m["action"]),
@@ -2270,17 +2294,17 @@ defmodule Payload do
22702294 comment: m["comment"] && Comment.from_map(m["comment"]),
22712295 commits: m["commits"] && Enum.map(m["commits"], &Commit.from_map/1),
22722296 description: m["description"] && decode_description(m["description"]),
2273- distinct_size: m["distinct_size"],
2297+ distinct_size: m["distinct_size"] && decode_distinct_size(m["distinct_size"]),
22742298 head: m["head"] && decode_head(m["head"]),
22752299 issue: m["issue"] && Issue.from_map(m["issue"]),
22762300 master_branch: m["master_branch"] && decode_master_branch(m["master_branch"]),
2277- number: m["number"],
2301+ number: m["number"] && decode_number(m["number"]),
22782302 pull_request: m["pull_request"] && PayloadPullRequest.from_map(m["pull_request"]),
2279- push_id: m["push_id"],
2303+ push_id: m["push_id"] && decode_push_id(m["push_id"]),
22802304 pusher_type: m["pusher_type"] && decode_pusher_type(m["pusher_type"]),
22812305 ref: m["ref"] && decode_ref(m["ref"]),
22822306 ref_type: m["ref_type"] && decode_ref_type(m["ref_type"]),
2283- size: m["size"],
2307+ size: m["size"] && decode_size(m["size"]),
22842308 }
22852309 end
Test case

test/inputs/json/samples/pokedex.json

1 generated file · +7 −1
Melixirdefault / QuickType.ex+7 −1
@@ -202,6 +202,12 @@ defmodule Pokemon do
202202 def encode_candy(value) when is_binary(value), do: value
203203 def encode_candy(_), do: {:error, "Unexpected type when encoding Pokemon.candy"}
204204
205+ def decode_candy_count(value) when is_integer(value), do: value
206+ def decode_candy_count(_), do: {:error, "Unexpected type when decoding Pokemon.candy_count"}
207+
208+ def encode_candy_count(value) when is_integer(value), do: value
209+ def encode_candy_count(_), do: {:error, "Unexpected type when encoding Pokemon.candy_count"}
210+
205211 def decode_height(value) when is_binary(value), do: value
206212 def decode_height(_), do: {:error, "Unexpected type when decoding Pokemon.height"}
207213
@@ -276,7 +282,7 @@ defmodule Pokemon do
276282 %Pokemon{
277283 avg_spawns: decode_avg_spawns(m["avg_spawns"]),
278284 candy: decode_candy(m["candy"]),
279- candy_count: m["candy_count"],
285+ candy_count: m["candy_count"] && decode_candy_count(m["candy_count"]),
280286 egg: Egg.decode(m["egg"]),
281287 height: decode_height(m["height"]),
282288 id: decode_id(m["id"]),
Test case

test/inputs/schema/class-map-union.schema

1 generated file · +7 −1
Mschema-elixirdefault / QuickType.ex+7 −1
@@ -12,9 +12,15 @@ defmodule UnionClass do
1212 quux: integer() | nil
1313 }
1414
15+ def decode_quux(value) when is_integer(value), do: value
16+ def decode_quux(_), do: {:error, "Unexpected type when decoding UnionClass.quux"}
17+
18+ def encode_quux(value) when is_integer(value), do: value
19+ def encode_quux(_), do: {:error, "Unexpected type when encoding UnionClass.quux"}
20+
1521 def from_map(m) do
1622 %UnionClass{
17- quux: m["quux"],
23+ quux: m["quux"] && decode_quux(m["quux"]),
1824 }
1925 end
Test case

test/inputs/schema/description.schema

1 generated file · +9 −1
Mschema-elixirdefault / QuickType.ex+9 −1
@@ -119,6 +119,14 @@ defmodule TopLevel do
119119 union: float() | String.t()
120120 }
121121
122+ def decode_foo(value) when is_float(value), do: value
123+ def decode_foo(value) when is_integer(value), do: value
124+ def decode_foo(_), do: {:error, "Unexpected type when decoding TopLevel.foo"}
125+
126+ def encode_foo(value) when is_float(value), do: value
127+ def encode_foo(value) when is_integer(value), do: value
128+ def encode_foo(_), do: {:error, "Unexpected type when encoding TopLevel.foo"}
129+
122130 def decode_object_or_string(%{"prop" => _,} = value), do: ObjectOrStringClass.from_map(value)
123131 def decode_object_or_string(value) when is_binary(value), do: value
124132 def decode_object_or_string(_), do: {:error, "Unexpected type when decoding TopLevel.object_or_string"}
@@ -131,7 +139,7 @@ defmodule TopLevel do
131139 %TopLevel{
132140 bar: m["bar"],
133141 enum: EnumEnum.decode(m["enum"]),
134- foo: m["foo"],
142+ foo: m["foo"] && decode_foo(m["foo"]),
135143 object_or_string: decode_object_or_string(m["object-or-string"]),
136144 union: Map.fetch!(m, "union"),
137145 }
Test case

test/inputs/schema/integer-type.schema

4 generated files · +792 −8
Mschema-csharp-recordsdefault / QuickType.cs+280 −0
@@ -26,27 +26,35 @@ namespace QuickType
2626 public partial record TopLevel
2727 {
2828 [JsonProperty("above_i32_max", Required = Required.Always)]
29+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
2930 public long AboveI32Max { get; set; }
3031
3132 [JsonProperty("below_i32_min", Required = Required.Always)]
33+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3234 public long BelowI32Min { get; set; }
3335
3436 [JsonProperty("i32_range", Required = Required.Always)]
37+ [JsonConverter(typeof(TentacledMinMaxValueCheckConverter))]
3538 public long I32Range { get; set; }
3639
3740 [JsonProperty("large_bounds", Required = Required.Always)]
41+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
3842 public long LargeBounds { get; set; }
3943
4044 [JsonProperty("only_maximum", Required = Required.Always)]
45+ [JsonConverter(typeof(IndigoMinMaxValueCheckConverter))]
4146 public long OnlyMaximum { get; set; }
4247
4348 [JsonProperty("only_minimum", Required = Required.Always)]
49+ [JsonConverter(typeof(IndecentMinMaxValueCheckConverter))]
4450 public long OnlyMinimum { get; set; }
4551
4652 [JsonProperty("small_negative", Required = Required.Always)]
53+ [JsonConverter(typeof(HilariousMinMaxValueCheckConverter))]
4754 public long SmallNegative { get; set; }
4855
4956 [JsonProperty("small_positive", Required = Required.Always)]
57+ [JsonConverter(typeof(AmbitiousMinMaxValueCheckConverter))]
5058 public long SmallPositive { get; set; }
5159
5260 [JsonProperty("unbounded", Required = Required.Always)]
@@ -75,6 +83,278 @@ namespace QuickType
7583 },
7684 };
7785 }
86+
87+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
88+ {
89+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
90+
91+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
92+ {
93+ if (reader.TokenType == JsonToken.Null) return null;
94+ var value = serializer.Deserialize<long>(reader);
95+ if (value >= 0 && value <= 2147483648)
96+ {
97+ return value;
98+ }
99+ throw new Exception("Cannot unmarshal type long");
100+ }
101+
102+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
103+ {
104+ if (untypedValue == null)
105+ {
106+ serializer.Serialize(writer, null);
107+ return;
108+ }
109+ var value = (long)untypedValue;
110+ if (value >= 0 && value <= 2147483648)
111+ {
112+ serializer.Serialize(writer, value);
113+ return;
114+ }
115+ throw new Exception("Cannot marshal type long");
116+ }
117+
118+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
119+ }
120+
121+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
122+ {
123+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
124+
125+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
126+ {
127+ if (reader.TokenType == JsonToken.Null) return null;
128+ var value = serializer.Deserialize<long>(reader);
129+ if (value >= -2147483649 && value <= 0)
130+ {
131+ return value;
132+ }
133+ throw new Exception("Cannot unmarshal type long");
134+ }
135+
136+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
137+ {
138+ if (untypedValue == null)
139+ {
140+ serializer.Serialize(writer, null);
141+ return;
142+ }
143+ var value = (long)untypedValue;
144+ if (value >= -2147483649 && value <= 0)
145+ {
146+ serializer.Serialize(writer, value);
147+ return;
148+ }
149+ throw new Exception("Cannot marshal type long");
150+ }
151+
152+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
153+ }
154+
155+ internal class TentacledMinMaxValueCheckConverter : JsonConverter
156+ {
157+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
158+
159+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
160+ {
161+ if (reader.TokenType == JsonToken.Null) return null;
162+ var value = serializer.Deserialize<long>(reader);
163+ if (value >= -2147483648 && value <= 2147483647)
164+ {
165+ return value;
166+ }
167+ throw new Exception("Cannot unmarshal type long");
168+ }
169+
170+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
171+ {
172+ if (untypedValue == null)
173+ {
174+ serializer.Serialize(writer, null);
175+ return;
176+ }
177+ var value = (long)untypedValue;
178+ if (value >= -2147483648 && value <= 2147483647)
179+ {
180+ serializer.Serialize(writer, value);
181+ return;
182+ }
183+ throw new Exception("Cannot marshal type long");
184+ }
185+
186+ public static readonly TentacledMinMaxValueCheckConverter Singleton = new TentacledMinMaxValueCheckConverter();
187+ }
188+
189+ internal class StickyMinMaxValueCheckConverter : JsonConverter
190+ {
191+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
192+
193+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
194+ {
195+ if (reader.TokenType == JsonToken.Null) return null;
196+ var value = serializer.Deserialize<long>(reader);
197+ if (value >= -9007199254740991 && value <= 9007199254740991)
198+ {
199+ return value;
200+ }
201+ throw new Exception("Cannot unmarshal type long");
202+ }
203+
204+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
205+ {
206+ if (untypedValue == null)
207+ {
208+ serializer.Serialize(writer, null);
209+ return;
210+ }
211+ var value = (long)untypedValue;
212+ if (value >= -9007199254740991 && value <= 9007199254740991)
213+ {
214+ serializer.Serialize(writer, value);
215+ return;
216+ }
217+ throw new Exception("Cannot marshal type long");
218+ }
219+
220+ public static readonly StickyMinMaxValueCheckConverter Singleton = new StickyMinMaxValueCheckConverter();
221+ }
222+
223+ internal class IndigoMinMaxValueCheckConverter : JsonConverter
224+ {
225+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
226+
227+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
228+ {
229+ if (reader.TokenType == JsonToken.Null) return null;
230+ var value = serializer.Deserialize<long>(reader);
231+ if (value <= 0)
232+ {
233+ return value;
234+ }
235+ throw new Exception("Cannot unmarshal type long");
236+ }
237+
238+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
239+ {
240+ if (untypedValue == null)
241+ {
242+ serializer.Serialize(writer, null);
243+ return;
244+ }
245+ var value = (long)untypedValue;
246+ if (value <= 0)
247+ {
248+ serializer.Serialize(writer, value);
249+ return;
250+ }
251+ throw new Exception("Cannot marshal type long");
252+ }
253+
254+ public static readonly IndigoMinMaxValueCheckConverter Singleton = new IndigoMinMaxValueCheckConverter();
255+ }
256+
257+ internal class IndecentMinMaxValueCheckConverter : JsonConverter
258+ {
259+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
260+
261+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
262+ {
263+ if (reader.TokenType == JsonToken.Null) return null;
264+ var value = serializer.Deserialize<long>(reader);
265+ if (value >= 0)
266+ {
267+ return value;
268+ }
269+ throw new Exception("Cannot unmarshal type long");
270+ }
271+
272+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
273+ {
274+ if (untypedValue == null)
275+ {
276+ serializer.Serialize(writer, null);
277+ return;
278+ }
279+ var value = (long)untypedValue;
280+ if (value >= 0)
281+ {
282+ serializer.Serialize(writer, value);
283+ return;
284+ }
285+ throw new Exception("Cannot marshal type long");
286+ }
287+
288+ public static readonly IndecentMinMaxValueCheckConverter Singleton = new IndecentMinMaxValueCheckConverter();
289+ }
290+
291+ internal class HilariousMinMaxValueCheckConverter : JsonConverter
292+ {
293+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
294+
295+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
296+ {
297+ if (reader.TokenType == JsonToken.Null) return null;
298+ var value = serializer.Deserialize<long>(reader);
299+ if (value >= -100 && value <= 0)
300+ {
301+ return value;
302+ }
303+ throw new Exception("Cannot unmarshal type long");
304+ }
305+
306+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
307+ {
308+ if (untypedValue == null)
309+ {
310+ serializer.Serialize(writer, null);
311+ return;
312+ }
313+ var value = (long)untypedValue;
314+ if (value >= -100 && value <= 0)
315+ {
316+ serializer.Serialize(writer, value);
317+ return;
318+ }
319+ throw new Exception("Cannot marshal type long");
320+ }
321+
322+ public static readonly HilariousMinMaxValueCheckConverter Singleton = new HilariousMinMaxValueCheckConverter();
323+ }
324+
325+ internal class AmbitiousMinMaxValueCheckConverter : JsonConverter
326+ {
327+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
328+
329+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
330+ {
331+ if (reader.TokenType == JsonToken.Null) return null;
332+ var value = serializer.Deserialize<long>(reader);
333+ if (value >= 0 && value <= 100)
334+ {
335+ return value;
336+ }
337+ throw new Exception("Cannot unmarshal type long");
338+ }
339+
340+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
341+ {
342+ if (untypedValue == null)
343+ {
344+ serializer.Serialize(writer, null);
345+ return;
346+ }
347+ var value = (long)untypedValue;
348+ if (value >= 0 && value <= 100)
349+ {
350+ serializer.Serialize(writer, value);
351+ return;
352+ }
353+ throw new Exception("Cannot marshal type long");
354+ }
355+
356+ public static readonly AmbitiousMinMaxValueCheckConverter Singleton = new AmbitiousMinMaxValueCheckConverter();
357+ }
78358 }
79359 #pragma warning restore CS8618
80360 #pragma warning restore CS8601
Mschema-csharp-SystemTextJsondefault / QuickType.cs+224 −0
@@ -24,34 +24,42 @@ namespace QuickType
2424 {
2525 [JsonRequired]
2626 [JsonPropertyName("above_i32_max")]
27+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
2728 public long AboveI32Max { get; set; }
2829
2930 [JsonRequired]
3031 [JsonPropertyName("below_i32_min")]
32+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3133 public long BelowI32Min { get; set; }
3234
3335 [JsonRequired]
3436 [JsonPropertyName("i32_range")]
37+ [JsonConverter(typeof(TentacledMinMaxValueCheckConverter))]
3538 public long I32Range { get; set; }
3639
3740 [JsonRequired]
3841 [JsonPropertyName("large_bounds")]
42+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
3943 public long LargeBounds { get; set; }
4044
4145 [JsonRequired]
4246 [JsonPropertyName("only_maximum")]
47+ [JsonConverter(typeof(IndigoMinMaxValueCheckConverter))]
4348 public long OnlyMaximum { get; set; }
4449
4550 [JsonRequired]
4651 [JsonPropertyName("only_minimum")]
52+ [JsonConverter(typeof(IndecentMinMaxValueCheckConverter))]
4753 public long OnlyMinimum { get; set; }
4854
4955 [JsonRequired]
5056 [JsonPropertyName("small_negative")]
57+ [JsonConverter(typeof(HilariousMinMaxValueCheckConverter))]
5158 public long SmallNegative { get; set; }
5259
5360 [JsonRequired]
5461 [JsonPropertyName("small_positive")]
62+ [JsonConverter(typeof(AmbitiousMinMaxValueCheckConverter))]
5563 public long SmallPositive { get; set; }
5664
5765 [JsonRequired]
@@ -81,6 +89,222 @@ namespace QuickType
8189 },
8290 };
8391 }
92+
93+ internal class PurpleMinMaxValueCheckConverter : JsonConverter<long>
94+ {
95+ public override bool CanConvert(Type t) => t == typeof(long);
96+
97+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
98+ {
99+ var value = reader.GetInt64();
100+ if (value >= 0 && value <= 2147483648)
101+ {
102+ return value;
103+ }
104+ throw new JsonException("Cannot unmarshal type long");
105+ }
106+
107+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
108+ {
109+ if (value >= 0 && value <= 2147483648)
110+ {
111+ JsonSerializer.Serialize(writer, value, options);
112+ return;
113+ }
114+ throw new NotSupportedException("Cannot marshal type long");
115+ }
116+
117+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
118+ }
119+
120+ internal class FluffyMinMaxValueCheckConverter : JsonConverter<long>
121+ {
122+ public override bool CanConvert(Type t) => t == typeof(long);
123+
124+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
125+ {
126+ var value = reader.GetInt64();
127+ if (value >= -2147483649 && value <= 0)
128+ {
129+ return value;
130+ }
131+ throw new JsonException("Cannot unmarshal type long");
132+ }
133+
134+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
135+ {
136+ if (value >= -2147483649 && value <= 0)
137+ {
138+ JsonSerializer.Serialize(writer, value, options);
139+ return;
140+ }
141+ throw new NotSupportedException("Cannot marshal type long");
142+ }
143+
144+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
145+ }
146+
147+ internal class TentacledMinMaxValueCheckConverter : JsonConverter<long>
148+ {
149+ public override bool CanConvert(Type t) => t == typeof(long);
150+
151+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
152+ {
153+ var value = reader.GetInt64();
154+ if (value >= -2147483648 && value <= 2147483647)
155+ {
156+ return value;
157+ }
158+ throw new JsonException("Cannot unmarshal type long");
159+ }
160+
161+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
162+ {
163+ if (value >= -2147483648 && value <= 2147483647)
164+ {
165+ JsonSerializer.Serialize(writer, value, options);
166+ return;
167+ }
168+ throw new NotSupportedException("Cannot marshal type long");
169+ }
170+
171+ public static readonly TentacledMinMaxValueCheckConverter Singleton = new TentacledMinMaxValueCheckConverter();
172+ }
173+
174+ internal class StickyMinMaxValueCheckConverter : JsonConverter<long>
175+ {
176+ public override bool CanConvert(Type t) => t == typeof(long);
177+
178+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
179+ {
180+ var value = reader.GetInt64();
181+ if (value >= -9007199254740991 && value <= 9007199254740991)
182+ {
183+ return value;
184+ }
185+ throw new JsonException("Cannot unmarshal type long");
186+ }
187+
188+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
189+ {
190+ if (value >= -9007199254740991 && value <= 9007199254740991)
191+ {
192+ JsonSerializer.Serialize(writer, value, options);
193+ return;
194+ }
195+ throw new NotSupportedException("Cannot marshal type long");
196+ }
197+
198+ public static readonly StickyMinMaxValueCheckConverter Singleton = new StickyMinMaxValueCheckConverter();
199+ }
200+
201+ internal class IndigoMinMaxValueCheckConverter : JsonConverter<long>
202+ {
203+ public override bool CanConvert(Type t) => t == typeof(long);
204+
205+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
206+ {
207+ var value = reader.GetInt64();
208+ if (value <= 0)
209+ {
210+ return value;
211+ }
212+ throw new JsonException("Cannot unmarshal type long");
213+ }
214+
215+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
216+ {
217+ if (value <= 0)
218+ {
219+ JsonSerializer.Serialize(writer, value, options);
220+ return;
221+ }
222+ throw new NotSupportedException("Cannot marshal type long");
223+ }
224+
225+ public static readonly IndigoMinMaxValueCheckConverter Singleton = new IndigoMinMaxValueCheckConverter();
226+ }
227+
228+ internal class IndecentMinMaxValueCheckConverter : JsonConverter<long>
229+ {
230+ public override bool CanConvert(Type t) => t == typeof(long);
231+
232+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
233+ {
234+ var value = reader.GetInt64();
235+ if (value >= 0)
236+ {
237+ return value;
238+ }
239+ throw new JsonException("Cannot unmarshal type long");
240+ }
241+
242+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
243+ {
244+ if (value >= 0)
245+ {
246+ JsonSerializer.Serialize(writer, value, options);
247+ return;
248+ }
249+ throw new NotSupportedException("Cannot marshal type long");
250+ }
251+
252+ public static readonly IndecentMinMaxValueCheckConverter Singleton = new IndecentMinMaxValueCheckConverter();
253+ }
254+
255+ internal class HilariousMinMaxValueCheckConverter : JsonConverter<long>
256+ {
257+ public override bool CanConvert(Type t) => t == typeof(long);
258+
259+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
260+ {
261+ var value = reader.GetInt64();
262+ if (value >= -100 && value <= 0)
263+ {
264+ return value;
265+ }
266+ throw new JsonException("Cannot unmarshal type long");
267+ }
268+
269+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
270+ {
271+ if (value >= -100 && value <= 0)
272+ {
273+ JsonSerializer.Serialize(writer, value, options);
274+ return;
275+ }
276+ throw new NotSupportedException("Cannot marshal type long");
277+ }
278+
279+ public static readonly HilariousMinMaxValueCheckConverter Singleton = new HilariousMinMaxValueCheckConverter();
280+ }
281+
282+ internal class AmbitiousMinMaxValueCheckConverter : JsonConverter<long>
283+ {
284+ public override bool CanConvert(Type t) => t == typeof(long);
285+
286+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
287+ {
288+ var value = reader.GetInt64();
289+ if (value >= 0 && value <= 100)
290+ {
291+ return value;
292+ }
293+ throw new JsonException("Cannot unmarshal type long");
294+ }
295+
296+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
297+ {
298+ if (value >= 0 && value <= 100)
299+ {
300+ JsonSerializer.Serialize(writer, value, options);
301+ return;
302+ }
303+ throw new NotSupportedException("Cannot marshal type long");
304+ }
305+
306+ public static readonly AmbitiousMinMaxValueCheckConverter Singleton = new AmbitiousMinMaxValueCheckConverter();
307+ }
84308
85309 public class DateOnlyConverter : JsonConverter<DateOnly>
86310 {
Mschema-csharpdefault / QuickType.cs+280 −0
@@ -26,27 +26,35 @@ namespace QuickType
2626 public partial class TopLevel
2727 {
2828 [JsonProperty("above_i32_max", Required = Required.Always)]
29+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
2930 public long AboveI32Max { get; set; }
3031
3132 [JsonProperty("below_i32_min", Required = Required.Always)]
33+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3234 public long BelowI32Min { get; set; }
3335
3436 [JsonProperty("i32_range", Required = Required.Always)]
37+ [JsonConverter(typeof(TentacledMinMaxValueCheckConverter))]
3538 public long I32Range { get; set; }
3639
3740 [JsonProperty("large_bounds", Required = Required.Always)]
41+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
3842 public long LargeBounds { get; set; }
3943
4044 [JsonProperty("only_maximum", Required = Required.Always)]
45+ [JsonConverter(typeof(IndigoMinMaxValueCheckConverter))]
4146 public long OnlyMaximum { get; set; }
4247
4348 [JsonProperty("only_minimum", Required = Required.Always)]
49+ [JsonConverter(typeof(IndecentMinMaxValueCheckConverter))]
4450 public long OnlyMinimum { get; set; }
4551
4652 [JsonProperty("small_negative", Required = Required.Always)]
53+ [JsonConverter(typeof(HilariousMinMaxValueCheckConverter))]
4754 public long SmallNegative { get; set; }
4855
4956 [JsonProperty("small_positive", Required = Required.Always)]
57+ [JsonConverter(typeof(AmbitiousMinMaxValueCheckConverter))]
5058 public long SmallPositive { get; set; }
5159
5260 [JsonProperty("unbounded", Required = Required.Always)]
@@ -75,6 +83,278 @@ namespace QuickType
7583 },
7684 };
7785 }
86+
87+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
88+ {
89+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
90+
91+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
92+ {
93+ if (reader.TokenType == JsonToken.Null) return null;
94+ var value = serializer.Deserialize<long>(reader);
95+ if (value >= 0 && value <= 2147483648)
96+ {
97+ return value;
98+ }
99+ throw new Exception("Cannot unmarshal type long");
100+ }
101+
102+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
103+ {
104+ if (untypedValue == null)
105+ {
106+ serializer.Serialize(writer, null);
107+ return;
108+ }
109+ var value = (long)untypedValue;
110+ if (value >= 0 && value <= 2147483648)
111+ {
112+ serializer.Serialize(writer, value);
113+ return;
114+ }
115+ throw new Exception("Cannot marshal type long");
116+ }
117+
118+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
119+ }
120+
121+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
122+ {
123+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
124+
125+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
126+ {
127+ if (reader.TokenType == JsonToken.Null) return null;
128+ var value = serializer.Deserialize<long>(reader);
129+ if (value >= -2147483649 && value <= 0)
130+ {
131+ return value;
132+ }
133+ throw new Exception("Cannot unmarshal type long");
134+ }
135+
136+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
137+ {
138+ if (untypedValue == null)
139+ {
140+ serializer.Serialize(writer, null);
141+ return;
142+ }
143+ var value = (long)untypedValue;
144+ if (value >= -2147483649 && value <= 0)
145+ {
146+ serializer.Serialize(writer, value);
147+ return;
148+ }
149+ throw new Exception("Cannot marshal type long");
150+ }
151+
152+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
153+ }
154+
155+ internal class TentacledMinMaxValueCheckConverter : JsonConverter
156+ {
157+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
158+
159+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
160+ {
161+ if (reader.TokenType == JsonToken.Null) return null;
162+ var value = serializer.Deserialize<long>(reader);
163+ if (value >= -2147483648 && value <= 2147483647)
164+ {
165+ return value;
166+ }
167+ throw new Exception("Cannot unmarshal type long");
168+ }
169+
170+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
171+ {
172+ if (untypedValue == null)
173+ {
174+ serializer.Serialize(writer, null);
175+ return;
176+ }
177+ var value = (long)untypedValue;
178+ if (value >= -2147483648 && value <= 2147483647)
179+ {
180+ serializer.Serialize(writer, value);
181+ return;
182+ }
183+ throw new Exception("Cannot marshal type long");
184+ }
185+
186+ public static readonly TentacledMinMaxValueCheckConverter Singleton = new TentacledMinMaxValueCheckConverter();
187+ }
188+
189+ internal class StickyMinMaxValueCheckConverter : JsonConverter
190+ {
191+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
192+
193+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
194+ {
195+ if (reader.TokenType == JsonToken.Null) return null;
196+ var value = serializer.Deserialize<long>(reader);
197+ if (value >= -9007199254740991 && value <= 9007199254740991)
198+ {
199+ return value;
200+ }
201+ throw new Exception("Cannot unmarshal type long");
202+ }
203+
204+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
205+ {
206+ if (untypedValue == null)
207+ {
208+ serializer.Serialize(writer, null);
209+ return;
210+ }
211+ var value = (long)untypedValue;
212+ if (value >= -9007199254740991 && value <= 9007199254740991)
213+ {
214+ serializer.Serialize(writer, value);
215+ return;
216+ }
217+ throw new Exception("Cannot marshal type long");
218+ }
219+
220+ public static readonly StickyMinMaxValueCheckConverter Singleton = new StickyMinMaxValueCheckConverter();
221+ }
222+
223+ internal class IndigoMinMaxValueCheckConverter : JsonConverter
224+ {
225+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
226+
227+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
228+ {
229+ if (reader.TokenType == JsonToken.Null) return null;
230+ var value = serializer.Deserialize<long>(reader);
231+ if (value <= 0)
232+ {
233+ return value;
234+ }
235+ throw new Exception("Cannot unmarshal type long");
236+ }
237+
238+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
239+ {
240+ if (untypedValue == null)
241+ {
242+ serializer.Serialize(writer, null);
243+ return;
244+ }
245+ var value = (long)untypedValue;
246+ if (value <= 0)
247+ {
248+ serializer.Serialize(writer, value);
249+ return;
250+ }
251+ throw new Exception("Cannot marshal type long");
252+ }
253+
254+ public static readonly IndigoMinMaxValueCheckConverter Singleton = new IndigoMinMaxValueCheckConverter();
255+ }
256+
257+ internal class IndecentMinMaxValueCheckConverter : JsonConverter
258+ {
259+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
260+
261+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
262+ {
263+ if (reader.TokenType == JsonToken.Null) return null;
264+ var value = serializer.Deserialize<long>(reader);
265+ if (value >= 0)
266+ {
267+ return value;
268+ }
269+ throw new Exception("Cannot unmarshal type long");
270+ }
271+
272+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
273+ {
274+ if (untypedValue == null)
275+ {
276+ serializer.Serialize(writer, null);
277+ return;
278+ }
279+ var value = (long)untypedValue;
280+ if (value >= 0)
281+ {
282+ serializer.Serialize(writer, value);
283+ return;
284+ }
285+ throw new Exception("Cannot marshal type long");
286+ }
287+
288+ public static readonly IndecentMinMaxValueCheckConverter Singleton = new IndecentMinMaxValueCheckConverter();
289+ }
290+
291+ internal class HilariousMinMaxValueCheckConverter : JsonConverter
292+ {
293+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
294+
295+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
296+ {
297+ if (reader.TokenType == JsonToken.Null) return null;
298+ var value = serializer.Deserialize<long>(reader);
299+ if (value >= -100 && value <= 0)
300+ {
301+ return value;
302+ }
303+ throw new Exception("Cannot unmarshal type long");
304+ }
305+
306+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
307+ {
308+ if (untypedValue == null)
309+ {
310+ serializer.Serialize(writer, null);
311+ return;
312+ }
313+ var value = (long)untypedValue;
314+ if (value >= -100 && value <= 0)
315+ {
316+ serializer.Serialize(writer, value);
317+ return;
318+ }
319+ throw new Exception("Cannot marshal type long");
320+ }
321+
322+ public static readonly HilariousMinMaxValueCheckConverter Singleton = new HilariousMinMaxValueCheckConverter();
323+ }
324+
325+ internal class AmbitiousMinMaxValueCheckConverter : JsonConverter
326+ {
327+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
328+
329+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
330+ {
331+ if (reader.TokenType == JsonToken.Null) return null;
332+ var value = serializer.Deserialize<long>(reader);
333+ if (value >= 0 && value <= 100)
334+ {
335+ return value;
336+ }
337+ throw new Exception("Cannot unmarshal type long");
338+ }
339+
340+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
341+ {
342+ if (untypedValue == null)
343+ {
344+ serializer.Serialize(writer, null);
345+ return;
346+ }
347+ var value = (long)untypedValue;
348+ if (value >= 0 && value <= 100)
349+ {
350+ serializer.Serialize(writer, value);
351+ return;
352+ }
353+ throw new Exception("Cannot marshal type long");
354+ }
355+
356+ public static readonly AmbitiousMinMaxValueCheckConverter Singleton = new AmbitiousMinMaxValueCheckConverter();
357+ }
78358 }
79359 #pragma warning restore CS8618
80360 #pragma warning restore CS8601
Mschema-elixirdefault / QuickType.ex+8 −8
@@ -21,49 +21,49 @@ defmodule TopLevel do
2121 unbounded: integer()
2222 }
2323
24- def decode_above_i32_max(value) when is_integer(value), do: value
24+ def decode_above_i32_max(value) when is_integer(value) and value >= 0 and value <= 2147483648, do: value
2525 def decode_above_i32_max(_), do: {:error, "Unexpected type when decoding TopLevel.above_i32_max"}
2626
2727 def encode_above_i32_max(value) when is_integer(value), do: value
2828 def encode_above_i32_max(_), do: {:error, "Unexpected type when encoding TopLevel.above_i32_max"}
2929
30- def decode_below_i32_min(value) when is_integer(value), do: value
30+ def decode_below_i32_min(value) when is_integer(value) and value >= -2147483649 and value <= 0, do: value
3131 def decode_below_i32_min(_), do: {:error, "Unexpected type when decoding TopLevel.below_i32_min"}
3232
3333 def encode_below_i32_min(value) when is_integer(value), do: value
3434 def encode_below_i32_min(_), do: {:error, "Unexpected type when encoding TopLevel.below_i32_min"}
3535
36- def decode_i32_range(value) when is_integer(value), do: value
36+ def decode_i32_range(value) when is_integer(value) and value >= -2147483648 and value <= 2147483647, do: value
3737 def decode_i32_range(_), do: {:error, "Unexpected type when decoding TopLevel.i32_range"}
3838
3939 def encode_i32_range(value) when is_integer(value), do: value
4040 def encode_i32_range(_), do: {:error, "Unexpected type when encoding TopLevel.i32_range"}
4141
42- def decode_large_bounds(value) when is_integer(value), do: value
42+ def decode_large_bounds(value) when is_integer(value) and value >= -9007199254740991 and value <= 9007199254740991, do: value
4343 def decode_large_bounds(_), do: {:error, "Unexpected type when decoding TopLevel.large_bounds"}
4444
4545 def encode_large_bounds(value) when is_integer(value), do: value
4646 def encode_large_bounds(_), do: {:error, "Unexpected type when encoding TopLevel.large_bounds"}
4747
48- def decode_only_maximum(value) when is_integer(value), do: value
48+ def decode_only_maximum(value) when is_integer(value) and value <= 0, do: value
4949 def decode_only_maximum(_), do: {:error, "Unexpected type when decoding TopLevel.only_maximum"}
5050
5151 def encode_only_maximum(value) when is_integer(value), do: value
5252 def encode_only_maximum(_), do: {:error, "Unexpected type when encoding TopLevel.only_maximum"}
5353
54- def decode_only_minimum(value) when is_integer(value), do: value
54+ def decode_only_minimum(value) when is_integer(value) and value >= 0, do: value
5555 def decode_only_minimum(_), do: {:error, "Unexpected type when decoding TopLevel.only_minimum"}
5656
5757 def encode_only_minimum(value) when is_integer(value), do: value
5858 def encode_only_minimum(_), do: {:error, "Unexpected type when encoding TopLevel.only_minimum"}
5959
60- def decode_small_negative(value) when is_integer(value), do: value
60+ def decode_small_negative(value) when is_integer(value) and value >= -100 and value <= 0, do: value
6161 def decode_small_negative(_), do: {:error, "Unexpected type when decoding TopLevel.small_negative"}
6262
6363 def encode_small_negative(value) when is_integer(value), do: value
6464 def encode_small_negative(_), do: {:error, "Unexpected type when encoding TopLevel.small_negative"}
6565
66- def decode_small_positive(value) when is_integer(value), do: value
66+ def decode_small_positive(value) when is_integer(value) and value >= 0 and value <= 100, do: value
6767 def decode_small_positive(_), do: {:error, "Unexpected type when decoding TopLevel.small_positive"}
6868
6969 def encode_small_positive(value) when is_integer(value), do: value
Test case

test/inputs/schema/intersection-nested.schema

1 generated file · +9 −1
Mschema-elixirdefault / QuickType.ex+9 −1
@@ -12,9 +12,17 @@ defmodule TopLevel do
1212 intersection: float() | nil
1313 }
1414
15+ def decode_intersection(value) when is_float(value), do: value
16+ def decode_intersection(value) when is_integer(value), do: value
17+ def decode_intersection(_), do: {:error, "Unexpected type when decoding TopLevel.intersection"}
18+
19+ def encode_intersection(value) when is_float(value), do: value
20+ def encode_intersection(value) when is_integer(value), do: value
21+ def encode_intersection(_), do: {:error, "Unexpected type when encoding TopLevel.intersection"}
22+
1523 def from_map(m) do
1624 %TopLevel{
17- intersection: m["intersection"],
25+ intersection: m["intersection"] && decode_intersection(m["intersection"]),
1826 }
1927 end
Test case

test/inputs/schema/keyword-unions.schema

1 generated file · +9 −1
Mschema-elixirdefault / QuickType.ex+9 −1
@@ -9204,6 +9204,14 @@ defmodule TopLevel do
92049204 def encode_double(value) when is_nil(value), do: value
92059205 def encode_double(_), do: {:error, "Unexpected type when encoding TopLevel.double"}
92069206
9207+ def decode_dummy(value) when is_float(value), do: value
9208+ def decode_dummy(value) when is_integer(value), do: value
9209+ def decode_dummy(_), do: {:error, "Unexpected type when decoding TopLevel.dummy"}
9210+
9211+ def encode_dummy(value) when is_float(value), do: value
9212+ def encode_dummy(value) when is_integer(value), do: value
9213+ def encode_dummy(_), do: {:error, "Unexpected type when encoding TopLevel.dummy"}
9214+
92079215 def decode_dynamic(%{} = value), do: Dynamic.from_map(value)
92089216 def decode_dynamic(value) when is_float(value), do: value
92099217 def decode_dynamic(value) when is_integer(value), do: value
@@ -11682,7 +11690,7 @@ defmodule TopLevel do
1168211690 did_set: decode_did_set(m["didSet"]),
1168311691 top_level_do: decode_top_level_do(m["do"]),
1168411692 double: decode_double(m["double"]),
11685- dummy: m["dummy"],
11693+ dummy: m["dummy"] && decode_dummy(m["dummy"]),
1168611694 dynamic: decode_dynamic(m["dynamic"]),
1168711695 dynamic_cast: decode_dynamic_cast(m["dynamic_cast"]),
1168811696 elif: decode_elif(m["elif"]),
Test case

test/inputs/schema/minmax-integer.schema

4 generated files · +499 −6
Mschema-csharp-recordsdefault / QuickType.cs+176 −0
@@ -29,24 +29,30 @@ namespace QuickType
2929 public long Free { get; set; }
3030
3131 [JsonProperty("intersection", Required = Required.Always)]
32+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3233 public long Intersection { get; set; }
3334
3435 [JsonProperty("max", Required = Required.Always)]
36+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3537 public long Max { get; set; }
3638
3739 [JsonProperty("min", Required = Required.Always)]
40+ [JsonConverter(typeof(TentacledMinMaxValueCheckConverter))]
3841 public long Min { get; set; }
3942
4043 [JsonProperty("minmax", Required = Required.Always)]
44+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
4145 public long Minmax { get; set; }
4246
4347 [JsonProperty("minMaxIntersection", Required = Required.Always)]
48+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
4449 public long MinMaxIntersection { get; set; }
4550
4651 [JsonProperty("minMaxUnion", Required = Required.Always)]
4752 public long MinMaxUnion { get; set; }
4853
4954 [JsonProperty("union", Required = Required.Always)]
55+ [JsonConverter(typeof(IndigoMinMaxValueCheckConverter))]
5056 public long Union { get; set; }
5157 }
5258
@@ -72,6 +78,176 @@ namespace QuickType
7278 },
7379 };
7480 }
81+
82+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
83+ {
84+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
85+
86+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
87+ {
88+ if (reader.TokenType == JsonToken.Null) return null;
89+ var value = serializer.Deserialize<long>(reader);
90+ if (value >= 4 && value <= 5)
91+ {
92+ return value;
93+ }
94+ throw new Exception("Cannot unmarshal type long");
95+ }
96+
97+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
98+ {
99+ if (untypedValue == null)
100+ {
101+ serializer.Serialize(writer, null);
102+ return;
103+ }
104+ var value = (long)untypedValue;
105+ if (value >= 4 && value <= 5)
106+ {
107+ serializer.Serialize(writer, value);
108+ return;
109+ }
110+ throw new Exception("Cannot marshal type long");
111+ }
112+
113+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
114+ }
115+
116+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
117+ {
118+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
119+
120+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
121+ {
122+ if (reader.TokenType == JsonToken.Null) return null;
123+ var value = serializer.Deserialize<long>(reader);
124+ if (value <= 5)
125+ {
126+ return value;
127+ }
128+ throw new Exception("Cannot unmarshal type long");
129+ }
130+
131+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
132+ {
133+ if (untypedValue == null)
134+ {
135+ serializer.Serialize(writer, null);
136+ return;
137+ }
138+ var value = (long)untypedValue;
139+ if (value <= 5)
140+ {
141+ serializer.Serialize(writer, value);
142+ return;
143+ }
144+ throw new Exception("Cannot marshal type long");
145+ }
146+
147+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
148+ }
149+
150+ internal class TentacledMinMaxValueCheckConverter : JsonConverter
151+ {
152+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
153+
154+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
155+ {
156+ if (reader.TokenType == JsonToken.Null) return null;
157+ var value = serializer.Deserialize<long>(reader);
158+ if (value >= 3)
159+ {
160+ return value;
161+ }
162+ throw new Exception("Cannot unmarshal type long");
163+ }
164+
165+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
166+ {
167+ if (untypedValue == null)
168+ {
169+ serializer.Serialize(writer, null);
170+ return;
171+ }
172+ var value = (long)untypedValue;
173+ if (value >= 3)
174+ {
175+ serializer.Serialize(writer, value);
176+ return;
177+ }
178+ throw new Exception("Cannot marshal type long");
179+ }
180+
181+ public static readonly TentacledMinMaxValueCheckConverter Singleton = new TentacledMinMaxValueCheckConverter();
182+ }
183+
184+ internal class StickyMinMaxValueCheckConverter : JsonConverter
185+ {
186+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
187+
188+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
189+ {
190+ if (reader.TokenType == JsonToken.Null) return null;
191+ var value = serializer.Deserialize<long>(reader);
192+ if (value >= 3 && value <= 5)
193+ {
194+ return value;
195+ }
196+ throw new Exception("Cannot unmarshal type long");
197+ }
198+
199+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
200+ {
201+ if (untypedValue == null)
202+ {
203+ serializer.Serialize(writer, null);
204+ return;
205+ }
206+ var value = (long)untypedValue;
207+ if (value >= 3 && value <= 5)
208+ {
209+ serializer.Serialize(writer, value);
210+ return;
211+ }
212+ throw new Exception("Cannot marshal type long");
213+ }
214+
215+ public static readonly StickyMinMaxValueCheckConverter Singleton = new StickyMinMaxValueCheckConverter();
216+ }
217+
218+ internal class IndigoMinMaxValueCheckConverter : JsonConverter
219+ {
220+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
221+
222+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
223+ {
224+ if (reader.TokenType == JsonToken.Null) return null;
225+ var value = serializer.Deserialize<long>(reader);
226+ if (value >= 3 && value <= 6)
227+ {
228+ return value;
229+ }
230+ throw new Exception("Cannot unmarshal type long");
231+ }
232+
233+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
234+ {
235+ if (untypedValue == null)
236+ {
237+ serializer.Serialize(writer, null);
238+ return;
239+ }
240+ var value = (long)untypedValue;
241+ if (value >= 3 && value <= 6)
242+ {
243+ serializer.Serialize(writer, value);
244+ return;
245+ }
246+ throw new Exception("Cannot marshal type long");
247+ }
248+
249+ public static readonly IndigoMinMaxValueCheckConverter Singleton = new IndigoMinMaxValueCheckConverter();
250+ }
75251 }
76252 #pragma warning restore CS8618
77253 #pragma warning restore CS8601
Mschema-csharp-SystemTextJsondefault / QuickType.cs+141 −0
@@ -28,22 +28,27 @@ namespace QuickType
2828
2929 [JsonRequired]
3030 [JsonPropertyName("intersection")]
31+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3132 public long Intersection { get; set; }
3233
3334 [JsonRequired]
3435 [JsonPropertyName("max")]
36+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3537 public long Max { get; set; }
3638
3739 [JsonRequired]
3840 [JsonPropertyName("min")]
41+ [JsonConverter(typeof(TentacledMinMaxValueCheckConverter))]
3942 public long Min { get; set; }
4043
4144 [JsonRequired]
4245 [JsonPropertyName("minmax")]
46+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
4347 public long Minmax { get; set; }
4448
4549 [JsonRequired]
4650 [JsonPropertyName("minMaxIntersection")]
51+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
4752 public long MinMaxIntersection { get; set; }
4853
4954 [JsonRequired]
@@ -52,6 +57,7 @@ namespace QuickType
5257
5358 [JsonRequired]
5459 [JsonPropertyName("union")]
60+ [JsonConverter(typeof(IndigoMinMaxValueCheckConverter))]
5561 public long Union { get; set; }
5662 }
5763
@@ -77,6 +83,141 @@ namespace QuickType
7783 },
7884 };
7985 }
86+
87+ internal class PurpleMinMaxValueCheckConverter : JsonConverter<long>
88+ {
89+ public override bool CanConvert(Type t) => t == typeof(long);
90+
91+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
92+ {
93+ var value = reader.GetInt64();
94+ if (value >= 4 && value <= 5)
95+ {
96+ return value;
97+ }
98+ throw new JsonException("Cannot unmarshal type long");
99+ }
100+
101+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
102+ {
103+ if (value >= 4 && value <= 5)
104+ {
105+ JsonSerializer.Serialize(writer, value, options);
106+ return;
107+ }
108+ throw new NotSupportedException("Cannot marshal type long");
109+ }
110+
111+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
112+ }
113+
114+ internal class FluffyMinMaxValueCheckConverter : JsonConverter<long>
115+ {
116+ public override bool CanConvert(Type t) => t == typeof(long);
117+
118+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
119+ {
120+ var value = reader.GetInt64();
121+ if (value <= 5)
122+ {
123+ return value;
124+ }
125+ throw new JsonException("Cannot unmarshal type long");
126+ }
127+
128+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
129+ {
130+ if (value <= 5)
131+ {
132+ JsonSerializer.Serialize(writer, value, options);
133+ return;
134+ }
135+ throw new NotSupportedException("Cannot marshal type long");
136+ }
137+
138+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
139+ }
140+
141+ internal class TentacledMinMaxValueCheckConverter : JsonConverter<long>
142+ {
143+ public override bool CanConvert(Type t) => t == typeof(long);
144+
145+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
146+ {
147+ var value = reader.GetInt64();
148+ if (value >= 3)
149+ {
150+ return value;
151+ }
152+ throw new JsonException("Cannot unmarshal type long");
153+ }
154+
155+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
156+ {
157+ if (value >= 3)
158+ {
159+ JsonSerializer.Serialize(writer, value, options);
160+ return;
161+ }
162+ throw new NotSupportedException("Cannot marshal type long");
163+ }
164+
165+ public static readonly TentacledMinMaxValueCheckConverter Singleton = new TentacledMinMaxValueCheckConverter();
166+ }
167+
168+ internal class StickyMinMaxValueCheckConverter : JsonConverter<long>
169+ {
170+ public override bool CanConvert(Type t) => t == typeof(long);
171+
172+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
173+ {
174+ var value = reader.GetInt64();
175+ if (value >= 3 && value <= 5)
176+ {
177+ return value;
178+ }
179+ throw new JsonException("Cannot unmarshal type long");
180+ }
181+
182+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
183+ {
184+ if (value >= 3 && value <= 5)
185+ {
186+ JsonSerializer.Serialize(writer, value, options);
187+ return;
188+ }
189+ throw new NotSupportedException("Cannot marshal type long");
190+ }
191+
192+ public static readonly StickyMinMaxValueCheckConverter Singleton = new StickyMinMaxValueCheckConverter();
193+ }
194+
195+ internal class IndigoMinMaxValueCheckConverter : JsonConverter<long>
196+ {
197+ public override bool CanConvert(Type t) => t == typeof(long);
198+
199+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
200+ {
201+ var value = reader.GetInt64();
202+ if (value >= 3 && value <= 6)
203+ {
204+ return value;
205+ }
206+ throw new JsonException("Cannot unmarshal type long");
207+ }
208+
209+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
210+ {
211+ if (value >= 3 && value <= 6)
212+ {
213+ JsonSerializer.Serialize(writer, value, options);
214+ return;
215+ }
216+ throw new NotSupportedException("Cannot marshal type long");
217+ }
218+
219+ public static readonly IndigoMinMaxValueCheckConverter Singleton = new IndigoMinMaxValueCheckConverter();
220+ }
80221
81222 public class DateOnlyConverter : JsonConverter<DateOnly>
82223 {
Mschema-csharpdefault / QuickType.cs+176 −0
@@ -29,24 +29,30 @@ namespace QuickType
2929 public long Free { get; set; }
3030
3131 [JsonProperty("intersection", Required = Required.Always)]
32+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3233 public long Intersection { get; set; }
3334
3435 [JsonProperty("max", Required = Required.Always)]
36+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3537 public long Max { get; set; }
3638
3739 [JsonProperty("min", Required = Required.Always)]
40+ [JsonConverter(typeof(TentacledMinMaxValueCheckConverter))]
3841 public long Min { get; set; }
3942
4043 [JsonProperty("minmax", Required = Required.Always)]
44+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
4145 public long Minmax { get; set; }
4246
4347 [JsonProperty("minMaxIntersection", Required = Required.Always)]
48+ [JsonConverter(typeof(StickyMinMaxValueCheckConverter))]
4449 public long MinMaxIntersection { get; set; }
4550
4651 [JsonProperty("minMaxUnion", Required = Required.Always)]
4752 public long MinMaxUnion { get; set; }
4853
4954 [JsonProperty("union", Required = Required.Always)]
55+ [JsonConverter(typeof(IndigoMinMaxValueCheckConverter))]
5056 public long Union { get; set; }
5157 }
5258
@@ -72,6 +78,176 @@ namespace QuickType
7278 },
7379 };
7480 }
81+
82+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
83+ {
84+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
85+
86+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
87+ {
88+ if (reader.TokenType == JsonToken.Null) return null;
89+ var value = serializer.Deserialize<long>(reader);
90+ if (value >= 4 && value <= 5)
91+ {
92+ return value;
93+ }
94+ throw new Exception("Cannot unmarshal type long");
95+ }
96+
97+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
98+ {
99+ if (untypedValue == null)
100+ {
101+ serializer.Serialize(writer, null);
102+ return;
103+ }
104+ var value = (long)untypedValue;
105+ if (value >= 4 && value <= 5)
106+ {
107+ serializer.Serialize(writer, value);
108+ return;
109+ }
110+ throw new Exception("Cannot marshal type long");
111+ }
112+
113+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
114+ }
115+
116+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
117+ {
118+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
119+
120+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
121+ {
122+ if (reader.TokenType == JsonToken.Null) return null;
123+ var value = serializer.Deserialize<long>(reader);
124+ if (value <= 5)
125+ {
126+ return value;
127+ }
128+ throw new Exception("Cannot unmarshal type long");
129+ }
130+
131+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
132+ {
133+ if (untypedValue == null)
134+ {
135+ serializer.Serialize(writer, null);
136+ return;
137+ }
138+ var value = (long)untypedValue;
139+ if (value <= 5)
140+ {
141+ serializer.Serialize(writer, value);
142+ return;
143+ }
144+ throw new Exception("Cannot marshal type long");
145+ }
146+
147+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
148+ }
149+
150+ internal class TentacledMinMaxValueCheckConverter : JsonConverter
151+ {
152+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
153+
154+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
155+ {
156+ if (reader.TokenType == JsonToken.Null) return null;
157+ var value = serializer.Deserialize<long>(reader);
158+ if (value >= 3)
159+ {
160+ return value;
161+ }
162+ throw new Exception("Cannot unmarshal type long");
163+ }
164+
165+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
166+ {
167+ if (untypedValue == null)
168+ {
169+ serializer.Serialize(writer, null);
170+ return;
171+ }
172+ var value = (long)untypedValue;
173+ if (value >= 3)
174+ {
175+ serializer.Serialize(writer, value);
176+ return;
177+ }
178+ throw new Exception("Cannot marshal type long");
179+ }
180+
181+ public static readonly TentacledMinMaxValueCheckConverter Singleton = new TentacledMinMaxValueCheckConverter();
182+ }
183+
184+ internal class StickyMinMaxValueCheckConverter : JsonConverter
185+ {
186+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
187+
188+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
189+ {
190+ if (reader.TokenType == JsonToken.Null) return null;
191+ var value = serializer.Deserialize<long>(reader);
192+ if (value >= 3 && value <= 5)
193+ {
194+ return value;
195+ }
196+ throw new Exception("Cannot unmarshal type long");
197+ }
198+
199+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
200+ {
201+ if (untypedValue == null)
202+ {
203+ serializer.Serialize(writer, null);
204+ return;
205+ }
206+ var value = (long)untypedValue;
207+ if (value >= 3 && value <= 5)
208+ {
209+ serializer.Serialize(writer, value);
210+ return;
211+ }
212+ throw new Exception("Cannot marshal type long");
213+ }
214+
215+ public static readonly StickyMinMaxValueCheckConverter Singleton = new StickyMinMaxValueCheckConverter();
216+ }
217+
218+ internal class IndigoMinMaxValueCheckConverter : JsonConverter
219+ {
220+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
221+
222+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
223+ {
224+ if (reader.TokenType == JsonToken.Null) return null;
225+ var value = serializer.Deserialize<long>(reader);
226+ if (value >= 3 && value <= 6)
227+ {
228+ return value;
229+ }
230+ throw new Exception("Cannot unmarshal type long");
231+ }
232+
233+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
234+ {
235+ if (untypedValue == null)
236+ {
237+ serializer.Serialize(writer, null);
238+ return;
239+ }
240+ var value = (long)untypedValue;
241+ if (value >= 3 && value <= 6)
242+ {
243+ serializer.Serialize(writer, value);
244+ return;
245+ }
246+ throw new Exception("Cannot marshal type long");
247+ }
248+
249+ public static readonly IndigoMinMaxValueCheckConverter Singleton = new IndigoMinMaxValueCheckConverter();
250+ }
75251 }
76252 #pragma warning restore CS8618
77253 #pragma warning restore CS8601
Mschema-elixirdefault / QuickType.ex+6 −6
@@ -26,31 +26,31 @@ defmodule TopLevel do
2626 def encode_free(value) when is_integer(value), do: value
2727 def encode_free(_), do: {:error, "Unexpected type when encoding TopLevel.free"}
2828
29- def decode_intersection(value) when is_integer(value), do: value
29+ def decode_intersection(value) when is_integer(value) and value >= 4 and value <= 5, do: value
3030 def decode_intersection(_), do: {:error, "Unexpected type when decoding TopLevel.intersection"}
3131
3232 def encode_intersection(value) when is_integer(value), do: value
3333 def encode_intersection(_), do: {:error, "Unexpected type when encoding TopLevel.intersection"}
3434
35- def decode_max(value) when is_integer(value), do: value
35+ def decode_max(value) when is_integer(value) and value <= 5, do: value
3636 def decode_max(_), do: {:error, "Unexpected type when decoding TopLevel.max"}
3737
3838 def encode_max(value) when is_integer(value), do: value
3939 def encode_max(_), do: {:error, "Unexpected type when encoding TopLevel.max"}
4040
41- def decode_min(value) when is_integer(value), do: value
41+ def decode_min(value) when is_integer(value) and value >= 3, do: value
4242 def decode_min(_), do: {:error, "Unexpected type when decoding TopLevel.min"}
4343
4444 def encode_min(value) when is_integer(value), do: value
4545 def encode_min(_), do: {:error, "Unexpected type when encoding TopLevel.min"}
4646
47- def decode_minmax(value) when is_integer(value), do: value
47+ def decode_minmax(value) when is_integer(value) and value >= 3 and value <= 5, do: value
4848 def decode_minmax(_), do: {:error, "Unexpected type when decoding TopLevel.minmax"}
4949
5050 def encode_minmax(value) when is_integer(value), do: value
5151 def encode_minmax(_), do: {:error, "Unexpected type when encoding TopLevel.minmax"}
5252
53- def decode_min_max_intersection(value) when is_integer(value), do: value
53+ def decode_min_max_intersection(value) when is_integer(value) and value >= 3 and value <= 5, do: value
5454 def decode_min_max_intersection(_), do: {:error, "Unexpected type when decoding TopLevel.min_max_intersection"}
5555
5656 def encode_min_max_intersection(value) when is_integer(value), do: value
@@ -62,7 +62,7 @@ defmodule TopLevel do
6262 def encode_min_max_union(value) when is_integer(value), do: value
6363 def encode_min_max_union(_), do: {:error, "Unexpected type when encoding TopLevel.min_max_union"}
6464
65- def decode_union(value) when is_integer(value), do: value
65+ def decode_union(value) when is_integer(value) and value >= 3 and value <= 6, do: value
6666 def decode_union(_), do: {:error, "Unexpected type when decoding TopLevel.union"}
6767
6868 def encode_union(value) when is_integer(value), do: value
Test case

test/inputs/schema/minmax.schema

1 generated file · +12 −12
Mschema-elixirdefault / QuickType.ex+12 −12
@@ -28,40 +28,40 @@ defmodule TopLevel do
2828 def encode_free(value) when is_integer(value), do: value
2929 def encode_free(_), do: {:error, "Unexpected type when encoding TopLevel.free"}
3030
31- def decode_intersection(value) when is_float(value), do: value
32- def decode_intersection(value) when is_integer(value), do: value
31+ def decode_intersection(value) when is_float(value) and value >= 4 and value <= 5, do: value
32+ def decode_intersection(value) when is_integer(value) and value >= 4 and value <= 5, do: value
3333 def decode_intersection(_), do: {:error, "Unexpected type when decoding TopLevel.intersection"}
3434
3535 def encode_intersection(value) when is_float(value), do: value
3636 def encode_intersection(value) when is_integer(value), do: value
3737 def encode_intersection(_), do: {:error, "Unexpected type when encoding TopLevel.intersection"}
3838
39- def decode_max(value) when is_float(value), do: value
40- def decode_max(value) when is_integer(value), do: value
39+ def decode_max(value) when is_float(value) and value <= 5, do: value
40+ def decode_max(value) when is_integer(value) and value <= 5, do: value
4141 def decode_max(_), do: {:error, "Unexpected type when decoding TopLevel.max"}
4242
4343 def encode_max(value) when is_float(value), do: value
4444 def encode_max(value) when is_integer(value), do: value
4545 def encode_max(_), do: {:error, "Unexpected type when encoding TopLevel.max"}
4646
47- def decode_min(value) when is_float(value), do: value
48- def decode_min(value) when is_integer(value), do: value
47+ def decode_min(value) when is_float(value) and value >= 3, do: value
48+ def decode_min(value) when is_integer(value) and value >= 3, do: value
4949 def decode_min(_), do: {:error, "Unexpected type when decoding TopLevel.min"}
5050
5151 def encode_min(value) when is_float(value), do: value
5252 def encode_min(value) when is_integer(value), do: value
5353 def encode_min(_), do: {:error, "Unexpected type when encoding TopLevel.min"}
5454
55- def decode_minmax(value) when is_float(value), do: value
56- def decode_minmax(value) when is_integer(value), do: value
55+ def decode_minmax(value) when is_float(value) and value >= 3 and value <= 5, do: value
56+ def decode_minmax(value) when is_integer(value) and value >= 3 and value <= 5, do: value
5757 def decode_minmax(_), do: {:error, "Unexpected type when decoding TopLevel.minmax"}
5858
5959 def encode_minmax(value) when is_float(value), do: value
6060 def encode_minmax(value) when is_integer(value), do: value
6161 def encode_minmax(_), do: {:error, "Unexpected type when encoding TopLevel.minmax"}
6262
63- def decode_min_max_intersection(value) when is_float(value), do: value
64- def decode_min_max_intersection(value) when is_integer(value), do: value
63+ def decode_min_max_intersection(value) when is_float(value) and value >= 3 and value <= 5, do: value
64+ def decode_min_max_intersection(value) when is_integer(value) and value >= 3 and value <= 5, do: value
6565 def decode_min_max_intersection(_), do: {:error, "Unexpected type when decoding TopLevel.min_max_intersection"}
6666
6767 def encode_min_max_intersection(value) when is_float(value), do: value
@@ -76,8 +76,8 @@ defmodule TopLevel do
7676 def encode_min_max_union(value) when is_integer(value), do: value
7777 def encode_min_max_union(_), do: {:error, "Unexpected type when encoding TopLevel.min_max_union"}
7878
79- def decode_union(value) when is_float(value), do: value
80- def decode_union(value) when is_integer(value), do: value
79+ def decode_union(value) when is_float(value) and value >= 3 and value <= 6, do: value
80+ def decode_union(value) when is_integer(value) and value >= 3 and value <= 6, do: value
8181 def decode_union(_), do: {:error, "Unexpected type when decoding TopLevel.union"}
8282
8383 def encode_union(value) when is_float(value), do: value
Test case

test/inputs/schema/optional-const-ref.schema

4 generated files · +127 −12
Mschema-csharp-recordsdefault / QuickType.cs+39 −3
@@ -29,6 +29,7 @@ namespace QuickType
2929 public Coordinate[]? Coordinates { get; set; }
3030
3131 [JsonProperty("count", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
32+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3233 public long? Count { get; set; }
3334
3435 [JsonProperty("label", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
@@ -39,6 +40,7 @@ namespace QuickType
3940 public Coordinate[] RequiredCoordinates { get; set; }
4041
4142 [JsonProperty("requiredCount", Required = Required.Always)]
43+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
4244 public long RequiredCount { get; set; }
4345
4446 [JsonProperty("requiredLabel", Required = Required.Always)]
@@ -46,7 +48,7 @@ namespace QuickType
4648 public string RequiredLabel { get; set; }
4749
4850 [JsonProperty("weight", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
49- [JsonConverter(typeof(MinMaxValueCheckConverter))]
51+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
5052 public double? Weight { get; set; }
5153 }
5254
@@ -82,6 +84,40 @@ namespace QuickType
8284 };
8385 }
8486
87+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
88+ {
89+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
90+
91+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
92+ {
93+ if (reader.TokenType == JsonToken.Null) return null;
94+ var value = serializer.Deserialize<long>(reader);
95+ if (value >= 1 && value <= 100)
96+ {
97+ return value;
98+ }
99+ throw new Exception("Cannot unmarshal type long");
100+ }
101+
102+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
103+ {
104+ if (untypedValue == null)
105+ {
106+ serializer.Serialize(writer, null);
107+ return;
108+ }
109+ var value = (long)untypedValue;
110+ if (value >= 1 && value <= 100)
111+ {
112+ serializer.Serialize(writer, value);
113+ return;
114+ }
115+ throw new Exception("Cannot marshal type long");
116+ }
117+
118+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
119+ }
120+
85121 internal class MinMaxLengthCheckConverter : JsonConverter
86122 {
87123 public override bool CanConvert(Type t) => t == typeof(string);
@@ -110,7 +146,7 @@ namespace QuickType
110146 public static readonly MinMaxLengthCheckConverter Singleton = new MinMaxLengthCheckConverter();
111147 }
112148
113- internal class MinMaxValueCheckConverter : JsonConverter
149+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
114150 {
115151 public override bool CanConvert(Type t) => t == typeof(double) || t == typeof(double?);
116152
@@ -141,7 +177,7 @@ namespace QuickType
141177 throw new Exception("Cannot marshal type double");
142178 }
143179
144- public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
180+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
145181 }
146182 }
147183 #pragma warning restore CS8618
Mschema-csharp-SystemTextJsondefault / QuickType.cs+32 −3
@@ -28,6 +28,7 @@ namespace QuickType
2828
2929 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
3030 [JsonPropertyName("count")]
31+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3132 public long? Count { get; set; }
3233
3334 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -41,6 +42,7 @@ namespace QuickType
4142
4243 [JsonRequired]
4344 [JsonPropertyName("requiredCount")]
45+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
4446 public long RequiredCount { get; set; }
4547
4648 [JsonRequired]
@@ -50,7 +52,7 @@ namespace QuickType
5052
5153 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5254 [JsonPropertyName("weight")]
53- [JsonConverter(typeof(MinMaxValueCheckConverter))]
55+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
5456 public double? Weight { get; set; }
5557 }
5658
@@ -88,6 +90,33 @@ namespace QuickType
8890 };
8991 }
9092
93+ internal class PurpleMinMaxValueCheckConverter : JsonConverter<long>
94+ {
95+ public override bool CanConvert(Type t) => t == typeof(long);
96+
97+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
98+ {
99+ var value = reader.GetInt64();
100+ if (value >= 1 && value <= 100)
101+ {
102+ return value;
103+ }
104+ throw new JsonException("Cannot unmarshal type long");
105+ }
106+
107+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
108+ {
109+ if (value >= 1 && value <= 100)
110+ {
111+ JsonSerializer.Serialize(writer, value, options);
112+ return;
113+ }
114+ throw new NotSupportedException("Cannot marshal type long");
115+ }
116+
117+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
118+ }
119+
91120 internal class MinMaxLengthCheckConverter : JsonConverter<string>
92121 {
93122 public override bool CanConvert(Type t) => t == typeof(string);
@@ -115,7 +144,7 @@ namespace QuickType
115144 public static readonly MinMaxLengthCheckConverter Singleton = new MinMaxLengthCheckConverter();
116145 }
117146
118- internal class MinMaxValueCheckConverter : JsonConverter<double>
147+ internal class FluffyMinMaxValueCheckConverter : JsonConverter<double>
119148 {
120149 public override bool CanConvert(Type t) => t == typeof(double);
121150
@@ -139,7 +168,7 @@ namespace QuickType
139168 throw new NotSupportedException("Cannot marshal type double");
140169 }
141170
142- public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
171+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
143172 }
144173
145174 public class DateOnlyConverter : JsonConverter<DateOnly>
Mschema-csharpdefault / QuickType.cs+39 −3
@@ -29,6 +29,7 @@ namespace QuickType
2929 public Coordinate[]? Coordinates { get; set; }
3030
3131 [JsonProperty("count", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
32+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3233 public long? Count { get; set; }
3334
3435 [JsonProperty("label", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
@@ -39,6 +40,7 @@ namespace QuickType
3940 public Coordinate[] RequiredCoordinates { get; set; }
4041
4142 [JsonProperty("requiredCount", Required = Required.Always)]
43+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
4244 public long RequiredCount { get; set; }
4345
4446 [JsonProperty("requiredLabel", Required = Required.Always)]
@@ -46,7 +48,7 @@ namespace QuickType
4648 public string RequiredLabel { get; set; }
4749
4850 [JsonProperty("weight", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
49- [JsonConverter(typeof(MinMaxValueCheckConverter))]
51+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
5052 public double? Weight { get; set; }
5153 }
5254
@@ -82,6 +84,40 @@ namespace QuickType
8284 };
8385 }
8486
87+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
88+ {
89+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
90+
91+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
92+ {
93+ if (reader.TokenType == JsonToken.Null) return null;
94+ var value = serializer.Deserialize<long>(reader);
95+ if (value >= 1 && value <= 100)
96+ {
97+ return value;
98+ }
99+ throw new Exception("Cannot unmarshal type long");
100+ }
101+
102+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
103+ {
104+ if (untypedValue == null)
105+ {
106+ serializer.Serialize(writer, null);
107+ return;
108+ }
109+ var value = (long)untypedValue;
110+ if (value >= 1 && value <= 100)
111+ {
112+ serializer.Serialize(writer, value);
113+ return;
114+ }
115+ throw new Exception("Cannot marshal type long");
116+ }
117+
118+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
119+ }
120+
85121 internal class MinMaxLengthCheckConverter : JsonConverter
86122 {
87123 public override bool CanConvert(Type t) => t == typeof(string);
@@ -110,7 +146,7 @@ namespace QuickType
110146 public static readonly MinMaxLengthCheckConverter Singleton = new MinMaxLengthCheckConverter();
111147 }
112148
113- internal class MinMaxValueCheckConverter : JsonConverter
149+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
114150 {
115151 public override bool CanConvert(Type t) => t == typeof(double) || t == typeof(double?);
116152
@@ -141,7 +177,7 @@ namespace QuickType
141177 throw new Exception("Cannot marshal type double");
142178 }
143179
144- public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
180+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
145181 }
146182 }
147183 #pragma warning restore CS8618
Mschema-elixirdefault / QuickType.ex+17 −3
@@ -71,6 +71,12 @@ defmodule TopLevel do
7171 weight: float() | nil
7272 }
7373
74+ def decode_count(value) when is_integer(value) and value >= 1 and value <= 100, do: value
75+ def decode_count(_), do: {:error, "Unexpected type when decoding TopLevel.count"}
76+
77+ def encode_count(value) when is_integer(value), do: value
78+ def encode_count(_), do: {:error, "Unexpected type when encoding TopLevel.count"}
79+
7480 def decode_label(value) when is_binary(value) do
7581 if String.length(value) >= 2 and String.length(value) <= 16, do: value, else: raise(ArgumentError)
7682 end
@@ -85,7 +91,7 @@ defmodule TopLevel do
8591 def encode_required_coordinates(value) when is_list(value), do: value
8692 def encode_required_coordinates(_), do: {:error, "Unexpected type when encoding TopLevel.required_coordinates"}
8793
88- def decode_required_count(value) when is_integer(value), do: value
94+ def decode_required_count(value) when is_integer(value) and value >= 1 and value <= 100, do: value
8995 def decode_required_count(_), do: {:error, "Unexpected type when decoding TopLevel.required_count"}
9096
9197 def encode_required_count(value) when is_integer(value), do: value
@@ -99,15 +105,23 @@ defmodule TopLevel do
99105 def encode_required_label(value) when is_binary(value), do: value
100106 def encode_required_label(_), do: {:error, "Unexpected type when encoding TopLevel.required_label"}
101107
108+ def decode_weight(value) when is_float(value) and value >= 0.5 and value <= 99.5, do: value
109+ def decode_weight(value) when is_integer(value) and value >= 0.5 and value <= 99.5, do: value
110+ def decode_weight(_), do: {:error, "Unexpected type when decoding TopLevel.weight"}
111+
112+ def encode_weight(value) when is_float(value), do: value
113+ def encode_weight(value) when is_integer(value), do: value
114+ def encode_weight(_), do: {:error, "Unexpected type when encoding TopLevel.weight"}
115+
102116 def from_map(m) do
103117 %TopLevel{
104118 coordinates: m["coordinates"] && Enum.map(m["coordinates"], &Coordinate.from_map/1),
105- count: m["count"],
119+ count: m["count"] && decode_count(m["count"]),
106120 label: m["label"] && decode_label(m["label"]),
107121 required_coordinates: Enum.map(m["requiredCoordinates"], &Coordinate.from_map/1),
108122 required_count: decode_required_count(m["requiredCount"]),
109123 required_label: decode_required_label(m["requiredLabel"]),
110- weight: m["weight"],
124+ weight: m["weight"] && decode_weight(m["weight"]),
111125 }
112126 end
Test case

test/inputs/schema/optional-constraints.schema

4 generated files · +127 −12
Mschema-csharp-recordsdefault / QuickType.cs+39 −3
@@ -26,10 +26,11 @@ namespace QuickType
2626 public partial record TopLevel
2727 {
2828 [JsonProperty("optDouble", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
29- [JsonConverter(typeof(MinMaxValueCheckConverter))]
29+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3030 public double? OptDouble { get; set; }
3131
3232 [JsonProperty("optInt", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
33+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3334 public long? OptInt { get; set; }
3435
3536 [JsonProperty("optPattern", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
@@ -40,6 +41,7 @@ namespace QuickType
4041 public string? OptString { get; set; }
4142
4243 [JsonProperty("reqZeroMin", Required = Required.Always)]
44+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
4345 public long ReqZeroMin { get; set; }
4446 }
4547
@@ -66,7 +68,7 @@ namespace QuickType
6668 };
6769 }
6870
69- internal class MinMaxValueCheckConverter : JsonConverter
71+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
7072 {
7173 public override bool CanConvert(Type t) => t == typeof(double) || t == typeof(double?);
7274
@@ -97,7 +99,41 @@ namespace QuickType
9799 throw new Exception("Cannot marshal type double");
98100 }
99101
100- public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
102+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
103+ }
104+
105+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
106+ {
107+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
108+
109+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
110+ {
111+ if (reader.TokenType == JsonToken.Null) return null;
112+ var value = serializer.Deserialize<long>(reader);
113+ if (value >= 0 && value <= 100)
114+ {
115+ return value;
116+ }
117+ throw new Exception("Cannot unmarshal type long");
118+ }
119+
120+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
121+ {
122+ if (untypedValue == null)
123+ {
124+ serializer.Serialize(writer, null);
125+ return;
126+ }
127+ var value = (long)untypedValue;
128+ if (value >= 0 && value <= 100)
129+ {
130+ serializer.Serialize(writer, value);
131+ return;
132+ }
133+ throw new Exception("Cannot marshal type long");
134+ }
135+
136+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
101137 }
102138
103139 internal class MinMaxLengthCheckConverter : JsonConverter
Mschema-csharp-SystemTextJsondefault / QuickType.cs+32 −3
@@ -24,11 +24,12 @@ namespace QuickType
2424 {
2525 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
2626 [JsonPropertyName("optDouble")]
27- [JsonConverter(typeof(MinMaxValueCheckConverter))]
27+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
2828 public double? OptDouble { get; set; }
2929
3030 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
3131 [JsonPropertyName("optInt")]
32+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3233 public long? OptInt { get; set; }
3334
3435 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -42,6 +43,7 @@ namespace QuickType
4243
4344 [JsonRequired]
4445 [JsonPropertyName("reqZeroMin")]
46+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
4547 public long ReqZeroMin { get; set; }
4648 }
4749
@@ -68,7 +70,7 @@ namespace QuickType
6870 };
6971 }
7072
71- internal class MinMaxValueCheckConverter : JsonConverter<double>
73+ internal class PurpleMinMaxValueCheckConverter : JsonConverter<double>
7274 {
7375 public override bool CanConvert(Type t) => t == typeof(double);
7476
@@ -92,7 +94,34 @@ namespace QuickType
9294 throw new NotSupportedException("Cannot marshal type double");
9395 }
9496
95- public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
97+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
98+ }
99+
100+ internal class FluffyMinMaxValueCheckConverter : JsonConverter<long>
101+ {
102+ public override bool CanConvert(Type t) => t == typeof(long);
103+
104+ public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
105+ {
106+ var value = reader.GetInt64();
107+ if (value >= 0 && value <= 100)
108+ {
109+ return value;
110+ }
111+ throw new JsonException("Cannot unmarshal type long");
112+ }
113+
114+ public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
115+ {
116+ if (value >= 0 && value <= 100)
117+ {
118+ JsonSerializer.Serialize(writer, value, options);
119+ return;
120+ }
121+ throw new NotSupportedException("Cannot marshal type long");
122+ }
123+
124+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
96125 }
97126
98127 internal class MinMaxLengthCheckConverter : JsonConverter<string>
Mschema-csharpdefault / QuickType.cs+39 −3
@@ -26,10 +26,11 @@ namespace QuickType
2626 public partial class TopLevel
2727 {
2828 [JsonProperty("optDouble", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
29- [JsonConverter(typeof(MinMaxValueCheckConverter))]
29+ [JsonConverter(typeof(PurpleMinMaxValueCheckConverter))]
3030 public double? OptDouble { get; set; }
3131
3232 [JsonProperty("optInt", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
33+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
3334 public long? OptInt { get; set; }
3435
3536 [JsonProperty("optPattern", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
@@ -40,6 +41,7 @@ namespace QuickType
4041 public string? OptString { get; set; }
4142
4243 [JsonProperty("reqZeroMin", Required = Required.Always)]
44+ [JsonConverter(typeof(FluffyMinMaxValueCheckConverter))]
4345 public long ReqZeroMin { get; set; }
4446 }
4547
@@ -66,7 +68,7 @@ namespace QuickType
6668 };
6769 }
6870
69- internal class MinMaxValueCheckConverter : JsonConverter
71+ internal class PurpleMinMaxValueCheckConverter : JsonConverter
7072 {
7173 public override bool CanConvert(Type t) => t == typeof(double) || t == typeof(double?);
7274
@@ -97,7 +99,41 @@ namespace QuickType
9799 throw new Exception("Cannot marshal type double");
98100 }
99101
100- public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
102+ public static readonly PurpleMinMaxValueCheckConverter Singleton = new PurpleMinMaxValueCheckConverter();
103+ }
104+
105+ internal class FluffyMinMaxValueCheckConverter : JsonConverter
106+ {
107+ public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
108+
109+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
110+ {
111+ if (reader.TokenType == JsonToken.Null) return null;
112+ var value = serializer.Deserialize<long>(reader);
113+ if (value >= 0 && value <= 100)
114+ {
115+ return value;
116+ }
117+ throw new Exception("Cannot unmarshal type long");
118+ }
119+
120+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
121+ {
122+ if (untypedValue == null)
123+ {
124+ serializer.Serialize(writer, null);
125+ return;
126+ }
127+ var value = (long)untypedValue;
128+ if (value >= 0 && value <= 100)
129+ {
130+ serializer.Serialize(writer, value);
131+ return;
132+ }
133+ throw new Exception("Cannot marshal type long");
134+ }
135+
136+ public static readonly FluffyMinMaxValueCheckConverter Singleton = new FluffyMinMaxValueCheckConverter();
101137 }
102138
103139 internal class MinMaxLengthCheckConverter : JsonConverter
Mschema-elixirdefault / QuickType.ex+17 −3
@@ -17,6 +17,20 @@ defmodule TopLevel do
1717 req_zero_min: integer()
1818 }
1919
20+ def decode_opt_double(value) when is_float(value) and value >= 0.5 and value <= 99.5, do: value
21+ def decode_opt_double(value) when is_integer(value) and value >= 0.5 and value <= 99.5, do: value
22+ def decode_opt_double(_), do: {:error, "Unexpected type when decoding TopLevel.opt_double"}
23+
24+ def encode_opt_double(value) when is_float(value), do: value
25+ def encode_opt_double(value) when is_integer(value), do: value
26+ def encode_opt_double(_), do: {:error, "Unexpected type when encoding TopLevel.opt_double"}
27+
28+ def decode_opt_int(value) when is_integer(value) and value >= 0 and value <= 100, do: value
29+ def decode_opt_int(_), do: {:error, "Unexpected type when decoding TopLevel.opt_int"}
30+
31+ def encode_opt_int(value) when is_integer(value), do: value
32+ def encode_opt_int(_), do: {:error, "Unexpected type when encoding TopLevel.opt_int"}
33+
2034 def decode_opt_pattern(value) when is_binary(value) do
2135 if Regex.match?(Regex.compile!("^[a-z]+$"), value), do: value, else: raise(ArgumentError)
2236 end
@@ -33,7 +47,7 @@ defmodule TopLevel do
3347 def encode_opt_string(value) when is_binary(value), do: value
3448 def encode_opt_string(_), do: {:error, "Unexpected type when encoding TopLevel.opt_string"}
3549
36- def decode_req_zero_min(value) when is_integer(value), do: value
50+ def decode_req_zero_min(value) when is_integer(value) and value >= 0 and value <= 100, do: value
3751 def decode_req_zero_min(_), do: {:error, "Unexpected type when decoding TopLevel.req_zero_min"}
3852
3953 def encode_req_zero_min(value) when is_integer(value), do: value
@@ -41,8 +55,8 @@ defmodule TopLevel do
4155
4256 def from_map(m) do
4357 %TopLevel{
44- opt_double: m["optDouble"],
45- opt_int: m["optInt"],
58+ opt_double: m["optDouble"] && decode_opt_double(m["optDouble"]),
59+ opt_int: m["optInt"] && decode_opt_int(m["optInt"]),
4660 opt_pattern: m["optPattern"] && decode_opt_pattern(m["optPattern"]),
4761 opt_string: m["optString"] && decode_opt_string(m["optString"]),
4862 req_zero_min: decode_req_zero_min(m["reqZeroMin"]),
Test case

test/inputs/schema/renaming-bug.schema

1 generated file · +27 −3
Mschema-elixirdefault / QuickType.ex+27 −3
@@ -12,9 +12,17 @@ defmodule Color do
1212 rgb: float() | nil
1313 }
1414
15+ def decode_rgb(value) when is_float(value), do: value
16+ def decode_rgb(value) when is_integer(value), do: value
17+ def decode_rgb(_), do: {:error, "Unexpected type when decoding Color.rgb"}
18+
19+ def encode_rgb(value) when is_float(value), do: value
20+ def encode_rgb(value) when is_integer(value), do: value
21+ def encode_rgb(_), do: {:error, "Unexpected type when encoding Color.rgb"}
22+
1523 def from_map(m) do
1624 %Color{
17- rgb: m["rgb"],
25+ rgb: m["rgb"] && decode_rgb(m["rgb"]),
1826 }
1927 end
2028
@@ -363,10 +371,26 @@ defmodule Limit do
363371 minimum: float() | nil
364372 }
365373
374+ def decode_maximum(value) when is_float(value), do: value
375+ def decode_maximum(value) when is_integer(value), do: value
376+ def decode_maximum(_), do: {:error, "Unexpected type when decoding Limit.maximum"}
377+
378+ def encode_maximum(value) when is_float(value), do: value
379+ def encode_maximum(value) when is_integer(value), do: value
380+ def encode_maximum(_), do: {:error, "Unexpected type when encoding Limit.maximum"}
381+
382+ def decode_minimum(value) when is_float(value), do: value
383+ def decode_minimum(value) when is_integer(value), do: value
384+ def decode_minimum(_), do: {:error, "Unexpected type when decoding Limit.minimum"}
385+
386+ def encode_minimum(value) when is_float(value), do: value
387+ def encode_minimum(value) when is_integer(value), do: value
388+ def encode_minimum(_), do: {:error, "Unexpected type when encoding Limit.minimum"}
389+
366390 def from_map(m) do
367391 %Limit{
368- maximum: m["maximum"],
369- minimum: m["minimum"],
392+ maximum: m["maximum"] && decode_maximum(m["maximum"]),
393+ minimum: m["minimum"] && decode_minimum(m["minimum"]),
370394 }
371395 end
Test case

test/inputs/schema/schema-constraints.schema

1 generated file · +2 −2
Mschema-elixirdefault / QuickType.ex+2 −2
@@ -22,8 +22,8 @@ defmodule TopLevel do
2222 def encode_min_max_length(value) when is_binary(value), do: value
2323 def encode_min_max_length(_), do: {:error, "Unexpected type when encoding TopLevel.min_max_length"}
2424
25- def decode_percent(value) when is_float(value), do: value
26- def decode_percent(value) when is_integer(value), do: value
25+ def decode_percent(value) when is_float(value) and value >= 0 and value <= 1, do: value
26+ def decode_percent(value) when is_integer(value) and value >= 0 and value <= 1, do: value
2727 def decode_percent(_), do: {:error, "Unexpected type when decoding TopLevel.percent"}
2828
2929 def encode_percent(value) when is_float(value), do: value
Test case

test/inputs/schema/union.schema

1 generated file · +16 −2
Mschema-elixirdefault / QuickType.ex+16 −2
@@ -15,17 +15,31 @@ defmodule TopLevelElement do
1515 three: float() | nil
1616 }
1717
18+ def decode_one(value) when is_integer(value), do: value
19+ def decode_one(_), do: {:error, "Unexpected type when decoding TopLevelElement.one"}
20+
21+ def encode_one(value) when is_integer(value), do: value
22+ def encode_one(_), do: {:error, "Unexpected type when encoding TopLevelElement.one"}
23+
1824 def decode_two(value) when is_boolean(value), do: value
1925 def decode_two(_), do: {:error, "Unexpected type when decoding TopLevelElement.two"}
2026
2127 def encode_two(value) when is_boolean(value), do: value
2228 def encode_two(_), do: {:error, "Unexpected type when encoding TopLevelElement.two"}
2329
30+ def decode_three(value) when is_float(value), do: value
31+ def decode_three(value) when is_integer(value), do: value
32+ def decode_three(_), do: {:error, "Unexpected type when decoding TopLevelElement.three"}
33+
34+ def encode_three(value) when is_float(value), do: value
35+ def encode_three(value) when is_integer(value), do: value
36+ def encode_three(_), do: {:error, "Unexpected type when encoding TopLevelElement.three"}
37+
2438 def from_map(m) do
2539 %TopLevelElement{
26- one: m["one"],
40+ one: m["one"] && decode_one(m["one"]),
2741 two: decode_two(m["two"]),
28- three: m["three"],
42+ three: m["three"] && decode_three(m["three"]),
2943 }
3044 end
Test case

test/inputs/schema/vega-lite.schema

1 generated file · +2,210 −258
Mschema-elixirdefault / QuickType.ex+2,210 −258
@@ -661,27 +661,67 @@ defmodule MarkConfig do
661661 theta: float() | nil
662662 }
663663
664+ def decode_angle(value) when is_float(value) and value >= 0 and value <= 360, do: value
665+ def decode_angle(value) when is_integer(value) and value >= 0 and value <= 360, do: value
666+ def decode_angle(_), do: {:error, "Unexpected type when decoding MarkConfig.angle"}
667+
668+ def encode_angle(value) when is_float(value), do: value
669+ def encode_angle(value) when is_integer(value), do: value
670+ def encode_angle(_), do: {:error, "Unexpected type when encoding MarkConfig.angle"}
671+
664672 def decode_color(value) when is_binary(value), do: value
665673 def decode_color(_), do: {:error, "Unexpected type when decoding MarkConfig.color"}
666674
667675 def encode_color(value) when is_binary(value), do: value
668676 def encode_color(_), do: {:error, "Unexpected type when encoding MarkConfig.color"}
669677
678+ def decode_dx(value) when is_float(value), do: value
679+ def decode_dx(value) when is_integer(value), do: value
680+ def decode_dx(_), do: {:error, "Unexpected type when decoding MarkConfig.dx"}
681+
682+ def encode_dx(value) when is_float(value), do: value
683+ def encode_dx(value) when is_integer(value), do: value
684+ def encode_dx(_), do: {:error, "Unexpected type when encoding MarkConfig.dx"}
685+
686+ def decode_dy(value) when is_float(value), do: value
687+ def decode_dy(value) when is_integer(value), do: value
688+ def decode_dy(_), do: {:error, "Unexpected type when decoding MarkConfig.dy"}
689+
690+ def encode_dy(value) when is_float(value), do: value
691+ def encode_dy(value) when is_integer(value), do: value
692+ def encode_dy(_), do: {:error, "Unexpected type when encoding MarkConfig.dy"}
693+
670694 def decode_fill(value) when is_binary(value), do: value
671695 def decode_fill(_), do: {:error, "Unexpected type when decoding MarkConfig.fill"}
672696
673697 def encode_fill(value) when is_binary(value), do: value
674698 def encode_fill(_), do: {:error, "Unexpected type when encoding MarkConfig.fill"}
675699
700+ def decode_fill_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
701+ def decode_fill_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
702+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding MarkConfig.fill_opacity"}
703+
704+ def encode_fill_opacity(value) when is_float(value), do: value
705+ def encode_fill_opacity(value) when is_integer(value), do: value
706+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding MarkConfig.fill_opacity"}
707+
676708 def decode_font(value) when is_binary(value), do: value
677709 def decode_font(_), do: {:error, "Unexpected type when decoding MarkConfig.font"}
678710
679711 def encode_font(value) when is_binary(value), do: value
680712 def encode_font(_), do: {:error, "Unexpected type when encoding MarkConfig.font"}
681713
714+ def decode_font_size(value) when is_float(value) and value >= 0, do: value
715+ def decode_font_size(value) when is_integer(value) and value >= 0, do: value
716+ def decode_font_size(_), do: {:error, "Unexpected type when decoding MarkConfig.font_size"}
717+
718+ def encode_font_size(value) when is_float(value), do: value
719+ def encode_font_size(value) when is_integer(value), do: value
720+ def encode_font_size(_), do: {:error, "Unexpected type when encoding MarkConfig.font_size"}
721+
682722 def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
683- def decode_font_weight(value) when is_float(value), do: value
684- def decode_font_weight(value) when is_integer(value), do: value
723+ def decode_font_weight(value) when is_float(value) and value >= 100 and value <= 900, do: value
724+ def decode_font_weight(value) when is_integer(value) and value >= 100 and value <= 900, do: value
685725 def decode_font_weight(value) when is_nil(value), do: value
686726 def decode_font_weight(_), do: {:error, "Unexpected type when decoding MarkConfig.font_weight"}
687727
@@ -697,56 +737,128 @@ defmodule MarkConfig do
697737 def encode_href(value) when is_binary(value), do: value
698738 def encode_href(_), do: {:error, "Unexpected type when encoding MarkConfig.href"}
699739
740+ def decode_limit(value) when is_float(value), do: value
741+ def decode_limit(value) when is_integer(value), do: value
742+ def decode_limit(_), do: {:error, "Unexpected type when decoding MarkConfig.limit"}
743+
744+ def encode_limit(value) when is_float(value), do: value
745+ def encode_limit(value) when is_integer(value), do: value
746+ def encode_limit(_), do: {:error, "Unexpected type when encoding MarkConfig.limit"}
747+
748+ def decode_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
749+ def decode_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
750+ def decode_opacity(_), do: {:error, "Unexpected type when decoding MarkConfig.opacity"}
751+
752+ def encode_opacity(value) when is_float(value), do: value
753+ def encode_opacity(value) when is_integer(value), do: value
754+ def encode_opacity(_), do: {:error, "Unexpected type when encoding MarkConfig.opacity"}
755+
756+ def decode_radius(value) when is_float(value) and value >= 0, do: value
757+ def decode_radius(value) when is_integer(value) and value >= 0, do: value
758+ def decode_radius(_), do: {:error, "Unexpected type when decoding MarkConfig.radius"}
759+
760+ def encode_radius(value) when is_float(value), do: value
761+ def encode_radius(value) when is_integer(value), do: value
762+ def encode_radius(_), do: {:error, "Unexpected type when encoding MarkConfig.radius"}
763+
700764 def decode_shape(value) when is_binary(value), do: value
701765 def decode_shape(_), do: {:error, "Unexpected type when decoding MarkConfig.shape"}
702766
703767 def encode_shape(value) when is_binary(value), do: value
704768 def encode_shape(_), do: {:error, "Unexpected type when encoding MarkConfig.shape"}
705769
770+ def decode_size(value) when is_float(value) and value >= 0, do: value
771+ def decode_size(value) when is_integer(value) and value >= 0, do: value
772+ def decode_size(_), do: {:error, "Unexpected type when decoding MarkConfig.size"}
773+
774+ def encode_size(value) when is_float(value), do: value
775+ def encode_size(value) when is_integer(value), do: value
776+ def encode_size(_), do: {:error, "Unexpected type when encoding MarkConfig.size"}
777+
706778 def decode_stroke(value) when is_binary(value), do: value
707779 def decode_stroke(_), do: {:error, "Unexpected type when decoding MarkConfig.stroke"}
708780
709781 def encode_stroke(value) when is_binary(value), do: value
710782 def encode_stroke(_), do: {:error, "Unexpected type when encoding MarkConfig.stroke"}
711783
784+ def decode_stroke_dash_offset(value) when is_float(value), do: value
785+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
786+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding MarkConfig.stroke_dash_offset"}
787+
788+ def encode_stroke_dash_offset(value) when is_float(value), do: value
789+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
790+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding MarkConfig.stroke_dash_offset"}
791+
792+ def decode_stroke_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
793+ def decode_stroke_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
794+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding MarkConfig.stroke_opacity"}
795+
796+ def encode_stroke_opacity(value) when is_float(value), do: value
797+ def encode_stroke_opacity(value) when is_integer(value), do: value
798+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding MarkConfig.stroke_opacity"}
799+
800+ def decode_stroke_width(value) when is_float(value) and value >= 0, do: value
801+ def decode_stroke_width(value) when is_integer(value) and value >= 0, do: value
802+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding MarkConfig.stroke_width"}
803+
804+ def encode_stroke_width(value) when is_float(value), do: value
805+ def encode_stroke_width(value) when is_integer(value), do: value
806+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding MarkConfig.stroke_width"}
807+
808+ def decode_tension(value) when is_float(value) and value >= 0 and value <= 1, do: value
809+ def decode_tension(value) when is_integer(value) and value >= 0 and value <= 1, do: value
810+ def decode_tension(_), do: {:error, "Unexpected type when decoding MarkConfig.tension"}
811+
812+ def encode_tension(value) when is_float(value), do: value
813+ def encode_tension(value) when is_integer(value), do: value
814+ def encode_tension(_), do: {:error, "Unexpected type when encoding MarkConfig.tension"}
815+
712816 def decode_text(value) when is_binary(value), do: value
713817 def decode_text(_), do: {:error, "Unexpected type when decoding MarkConfig.text"}
714818
715819 def encode_text(value) when is_binary(value), do: value
716820 def encode_text(_), do: {:error, "Unexpected type when encoding MarkConfig.text"}
717821
822+ def decode_theta(value) when is_float(value), do: value
823+ def decode_theta(value) when is_integer(value), do: value
824+ def decode_theta(_), do: {:error, "Unexpected type when decoding MarkConfig.theta"}
825+
826+ def encode_theta(value) when is_float(value), do: value
827+ def encode_theta(value) when is_integer(value), do: value
828+ def encode_theta(_), do: {:error, "Unexpected type when encoding MarkConfig.theta"}
829+
718830 def from_map(m) do
719831 %MarkConfig{
720832 align: m["align"] && HorizontalAlign.decode(m["align"]),
721- angle: m["angle"],
833+ angle: m["angle"] && decode_angle(m["angle"]),
722834 baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
723835 color: m["color"] && decode_color(m["color"]),
724836 cursor: m["cursor"] && Cursor.decode(m["cursor"]),
725- dx: m["dx"],
726- dy: m["dy"],
837+ dx: m["dx"] && decode_dx(m["dx"]),
838+ dy: m["dy"] && decode_dy(m["dy"]),
727839 fill: m["fill"] && decode_fill(m["fill"]),
728840 filled: m["filled"],
729- fill_opacity: m["fillOpacity"],
841+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
730842 font: m["font"] && decode_font(m["font"]),
731- font_size: m["fontSize"],
843+ font_size: m["fontSize"] && decode_font_size(m["fontSize"]),
732844 font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
733845 font_weight: decode_font_weight(m["fontWeight"]),
734846 href: m["href"] && decode_href(m["href"]),
735847 interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
736- limit: m["limit"],
737- opacity: m["opacity"],
848+ limit: m["limit"] && decode_limit(m["limit"]),
849+ opacity: m["opacity"] && decode_opacity(m["opacity"]),
738850 orient: m["orient"] && Orient.decode(m["orient"]),
739- radius: m["radius"],
851+ radius: m["radius"] && decode_radius(m["radius"]),
740852 shape: m["shape"] && decode_shape(m["shape"]),
741- size: m["size"],
853+ size: m["size"] && decode_size(m["size"]),
742854 stroke: m["stroke"] && decode_stroke(m["stroke"]),
743855 stroke_dash: m["strokeDash"],
744- stroke_dash_offset: m["strokeDashOffset"],
745- stroke_opacity: m["strokeOpacity"],
746- stroke_width: m["strokeWidth"],
747- tension: m["tension"],
856+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
857+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
858+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
859+ tension: m["tension"] && decode_tension(m["tension"]),
748860 text: m["text"] && decode_text(m["text"]),
749- theta: m["theta"],
861+ theta: m["theta"] && decode_theta(m["theta"]),
750862 }
751863 end
752864
@@ -934,18 +1046,58 @@ defmodule AxisConfig do
9341046 title_y: float() | nil
9351047 }
9361048
1049+ def decode_band_position(value) when is_float(value), do: value
1050+ def decode_band_position(value) when is_integer(value), do: value
1051+ def decode_band_position(_), do: {:error, "Unexpected type when decoding AxisConfig.band_position"}
1052+
1053+ def encode_band_position(value) when is_float(value), do: value
1054+ def encode_band_position(value) when is_integer(value), do: value
1055+ def encode_band_position(_), do: {:error, "Unexpected type when encoding AxisConfig.band_position"}
1056+
9371057 def decode_domain_color(value) when is_binary(value), do: value
9381058 def decode_domain_color(_), do: {:error, "Unexpected type when decoding AxisConfig.domain_color"}
9391059
9401060 def encode_domain_color(value) when is_binary(value), do: value
9411061 def encode_domain_color(_), do: {:error, "Unexpected type when encoding AxisConfig.domain_color"}
9421062
1063+ def decode_domain_width(value) when is_float(value), do: value
1064+ def decode_domain_width(value) when is_integer(value), do: value
1065+ def decode_domain_width(_), do: {:error, "Unexpected type when decoding AxisConfig.domain_width"}
1066+
1067+ def encode_domain_width(value) when is_float(value), do: value
1068+ def encode_domain_width(value) when is_integer(value), do: value
1069+ def encode_domain_width(_), do: {:error, "Unexpected type when encoding AxisConfig.domain_width"}
1070+
9431071 def decode_grid_color(value) when is_binary(value), do: value
9441072 def decode_grid_color(_), do: {:error, "Unexpected type when decoding AxisConfig.grid_color"}
9451073
9461074 def encode_grid_color(value) when is_binary(value), do: value
9471075 def encode_grid_color(_), do: {:error, "Unexpected type when encoding AxisConfig.grid_color"}
9481076
1077+ def decode_grid_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
1078+ def decode_grid_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
1079+ def decode_grid_opacity(_), do: {:error, "Unexpected type when decoding AxisConfig.grid_opacity"}
1080+
1081+ def encode_grid_opacity(value) when is_float(value), do: value
1082+ def encode_grid_opacity(value) when is_integer(value), do: value
1083+ def encode_grid_opacity(_), do: {:error, "Unexpected type when encoding AxisConfig.grid_opacity"}
1084+
1085+ def decode_grid_width(value) when is_float(value) and value >= 0, do: value
1086+ def decode_grid_width(value) when is_integer(value) and value >= 0, do: value
1087+ def decode_grid_width(_), do: {:error, "Unexpected type when decoding AxisConfig.grid_width"}
1088+
1089+ def encode_grid_width(value) when is_float(value), do: value
1090+ def encode_grid_width(value) when is_integer(value), do: value
1091+ def encode_grid_width(_), do: {:error, "Unexpected type when encoding AxisConfig.grid_width"}
1092+
1093+ def decode_label_angle(value) when is_float(value) and value >= -360 and value <= 360, do: value
1094+ def decode_label_angle(value) when is_integer(value) and value >= -360 and value <= 360, do: value
1095+ def decode_label_angle(_), do: {:error, "Unexpected type when decoding AxisConfig.label_angle"}
1096+
1097+ def encode_label_angle(value) when is_float(value), do: value
1098+ def encode_label_angle(value) when is_integer(value), do: value
1099+ def encode_label_angle(_), do: {:error, "Unexpected type when encoding AxisConfig.label_angle"}
1100+
9491101 def decode_label_color(value) when is_binary(value), do: value
9501102 def decode_label_color(_), do: {:error, "Unexpected type when decoding AxisConfig.label_color"}
9511103
@@ -958,6 +1110,22 @@ defmodule AxisConfig do
9581110 def encode_label_font(value) when is_binary(value), do: value
9591111 def encode_label_font(_), do: {:error, "Unexpected type when encoding AxisConfig.label_font"}
9601112
1113+ def decode_label_font_size(value) when is_float(value) and value >= 0, do: value
1114+ def decode_label_font_size(value) when is_integer(value) and value >= 0, do: value
1115+ def decode_label_font_size(_), do: {:error, "Unexpected type when decoding AxisConfig.label_font_size"}
1116+
1117+ def encode_label_font_size(value) when is_float(value), do: value
1118+ def encode_label_font_size(value) when is_integer(value), do: value
1119+ def encode_label_font_size(_), do: {:error, "Unexpected type when encoding AxisConfig.label_font_size"}
1120+
1121+ def decode_label_limit(value) when is_float(value), do: value
1122+ def decode_label_limit(value) when is_integer(value), do: value
1123+ def decode_label_limit(_), do: {:error, "Unexpected type when decoding AxisConfig.label_limit"}
1124+
1125+ def encode_label_limit(value) when is_float(value), do: value
1126+ def encode_label_limit(value) when is_integer(value), do: value
1127+ def encode_label_limit(_), do: {:error, "Unexpected type when encoding AxisConfig.label_limit"}
1128+
9611129 def decode_label_overlap(value) when is_boolean(value), do: value
9621130 def decode_label_overlap(value) when is_binary(value), do: LabelOverlapEnum.decode(value)
9631131 def decode_label_overlap(value) when is_nil(value), do: value
@@ -968,18 +1136,66 @@ defmodule AxisConfig do
9681136 def encode_label_overlap(value) when is_nil(value), do: value
9691137 def encode_label_overlap(_), do: {:error, "Unexpected type when encoding AxisConfig.label_overlap"}
9701138
1139+ def decode_label_padding(value) when is_float(value), do: value
1140+ def decode_label_padding(value) when is_integer(value), do: value
1141+ def decode_label_padding(_), do: {:error, "Unexpected type when decoding AxisConfig.label_padding"}
1142+
1143+ def encode_label_padding(value) when is_float(value), do: value
1144+ def encode_label_padding(value) when is_integer(value), do: value
1145+ def encode_label_padding(_), do: {:error, "Unexpected type when encoding AxisConfig.label_padding"}
1146+
1147+ def decode_max_extent(value) when is_float(value), do: value
1148+ def decode_max_extent(value) when is_integer(value), do: value
1149+ def decode_max_extent(_), do: {:error, "Unexpected type when decoding AxisConfig.max_extent"}
1150+
1151+ def encode_max_extent(value) when is_float(value), do: value
1152+ def encode_max_extent(value) when is_integer(value), do: value
1153+ def encode_max_extent(_), do: {:error, "Unexpected type when encoding AxisConfig.max_extent"}
1154+
1155+ def decode_min_extent(value) when is_float(value), do: value
1156+ def decode_min_extent(value) when is_integer(value), do: value
1157+ def decode_min_extent(_), do: {:error, "Unexpected type when decoding AxisConfig.min_extent"}
1158+
1159+ def encode_min_extent(value) when is_float(value), do: value
1160+ def encode_min_extent(value) when is_integer(value), do: value
1161+ def encode_min_extent(_), do: {:error, "Unexpected type when encoding AxisConfig.min_extent"}
1162+
9711163 def decode_tick_color(value) when is_binary(value), do: value
9721164 def decode_tick_color(_), do: {:error, "Unexpected type when decoding AxisConfig.tick_color"}
9731165
9741166 def encode_tick_color(value) when is_binary(value), do: value
9751167 def encode_tick_color(_), do: {:error, "Unexpected type when encoding AxisConfig.tick_color"}
9761168
1169+ def decode_tick_size(value) when is_float(value) and value >= 0, do: value
1170+ def decode_tick_size(value) when is_integer(value) and value >= 0, do: value
1171+ def decode_tick_size(_), do: {:error, "Unexpected type when decoding AxisConfig.tick_size"}
1172+
1173+ def encode_tick_size(value) when is_float(value), do: value
1174+ def encode_tick_size(value) when is_integer(value), do: value
1175+ def encode_tick_size(_), do: {:error, "Unexpected type when encoding AxisConfig.tick_size"}
1176+
1177+ def decode_tick_width(value) when is_float(value) and value >= 0, do: value
1178+ def decode_tick_width(value) when is_integer(value) and value >= 0, do: value
1179+ def decode_tick_width(_), do: {:error, "Unexpected type when decoding AxisConfig.tick_width"}
1180+
1181+ def encode_tick_width(value) when is_float(value), do: value
1182+ def encode_tick_width(value) when is_integer(value), do: value
1183+ def encode_tick_width(_), do: {:error, "Unexpected type when encoding AxisConfig.tick_width"}
1184+
9771185 def decode_title_align(value) when is_binary(value), do: value
9781186 def decode_title_align(_), do: {:error, "Unexpected type when decoding AxisConfig.title_align"}
9791187
9801188 def encode_title_align(value) when is_binary(value), do: value
9811189 def encode_title_align(_), do: {:error, "Unexpected type when encoding AxisConfig.title_align"}
9821190
1191+ def decode_title_angle(value) when is_float(value), do: value
1192+ def decode_title_angle(value) when is_integer(value), do: value
1193+ def decode_title_angle(_), do: {:error, "Unexpected type when decoding AxisConfig.title_angle"}
1194+
1195+ def encode_title_angle(value) when is_float(value), do: value
1196+ def encode_title_angle(value) when is_integer(value), do: value
1197+ def encode_title_angle(_), do: {:error, "Unexpected type when encoding AxisConfig.title_angle"}
1198+
9831199 def decode_title_baseline(value) when is_binary(value), do: value
9841200 def decode_title_baseline(_), do: {:error, "Unexpected type when decoding AxisConfig.title_baseline"}
9851201
@@ -998,47 +1214,95 @@ defmodule AxisConfig do
9981214 def encode_title_font(value) when is_binary(value), do: value
9991215 def encode_title_font(_), do: {:error, "Unexpected type when encoding AxisConfig.title_font"}
10001216
1217+ def decode_title_font_size(value) when is_float(value) and value >= 0, do: value
1218+ def decode_title_font_size(value) when is_integer(value) and value >= 0, do: value
1219+ def decode_title_font_size(_), do: {:error, "Unexpected type when decoding AxisConfig.title_font_size"}
1220+
1221+ def encode_title_font_size(value) when is_float(value), do: value
1222+ def encode_title_font_size(value) when is_integer(value), do: value
1223+ def encode_title_font_size(_), do: {:error, "Unexpected type when encoding AxisConfig.title_font_size"}
1224+
1225+ def decode_title_limit(value) when is_float(value), do: value
1226+ def decode_title_limit(value) when is_integer(value), do: value
1227+ def decode_title_limit(_), do: {:error, "Unexpected type when decoding AxisConfig.title_limit"}
1228+
1229+ def encode_title_limit(value) when is_float(value), do: value
1230+ def encode_title_limit(value) when is_integer(value), do: value
1231+ def encode_title_limit(_), do: {:error, "Unexpected type when encoding AxisConfig.title_limit"}
1232+
1233+ def decode_title_max_length(value) when is_float(value), do: value
1234+ def decode_title_max_length(value) when is_integer(value), do: value
1235+ def decode_title_max_length(_), do: {:error, "Unexpected type when decoding AxisConfig.title_max_length"}
1236+
1237+ def encode_title_max_length(value) when is_float(value), do: value
1238+ def encode_title_max_length(value) when is_integer(value), do: value
1239+ def encode_title_max_length(_), do: {:error, "Unexpected type when encoding AxisConfig.title_max_length"}
1240+
1241+ def decode_title_padding(value) when is_float(value), do: value
1242+ def decode_title_padding(value) when is_integer(value), do: value
1243+ def decode_title_padding(_), do: {:error, "Unexpected type when decoding AxisConfig.title_padding"}
1244+
1245+ def encode_title_padding(value) when is_float(value), do: value
1246+ def encode_title_padding(value) when is_integer(value), do: value
1247+ def encode_title_padding(_), do: {:error, "Unexpected type when encoding AxisConfig.title_padding"}
1248+
1249+ def decode_title_x(value) when is_float(value), do: value
1250+ def decode_title_x(value) when is_integer(value), do: value
1251+ def decode_title_x(_), do: {:error, "Unexpected type when decoding AxisConfig.title_x"}
1252+
1253+ def encode_title_x(value) when is_float(value), do: value
1254+ def encode_title_x(value) when is_integer(value), do: value
1255+ def encode_title_x(_), do: {:error, "Unexpected type when encoding AxisConfig.title_x"}
1256+
1257+ def decode_title_y(value) when is_float(value), do: value
1258+ def decode_title_y(value) when is_integer(value), do: value
1259+ def decode_title_y(_), do: {:error, "Unexpected type when decoding AxisConfig.title_y"}
1260+
1261+ def encode_title_y(value) when is_float(value), do: value
1262+ def encode_title_y(value) when is_integer(value), do: value
1263+ def encode_title_y(_), do: {:error, "Unexpected type when encoding AxisConfig.title_y"}
1264+
10011265 def from_map(m) do
10021266 %AxisConfig{
1003- band_position: m["bandPosition"],
1267+ band_position: m["bandPosition"] && decode_band_position(m["bandPosition"]),
10041268 domain: m["domain"],
10051269 domain_color: m["domainColor"] && decode_domain_color(m["domainColor"]),
1006- domain_width: m["domainWidth"],
1270+ domain_width: m["domainWidth"] && decode_domain_width(m["domainWidth"]),
10071271 grid: m["grid"],
10081272 grid_color: m["gridColor"] && decode_grid_color(m["gridColor"]),
10091273 grid_dash: m["gridDash"],
1010- grid_opacity: m["gridOpacity"],
1011- grid_width: m["gridWidth"],
1012- label_angle: m["labelAngle"],
1274+ grid_opacity: m["gridOpacity"] && decode_grid_opacity(m["gridOpacity"]),
1275+ grid_width: m["gridWidth"] && decode_grid_width(m["gridWidth"]),
1276+ label_angle: m["labelAngle"] && decode_label_angle(m["labelAngle"]),
10131277 label_bound: m["labelBound"],
10141278 label_color: m["labelColor"] && decode_label_color(m["labelColor"]),
10151279 label_flush: m["labelFlush"],
10161280 label_font: m["labelFont"] && decode_label_font(m["labelFont"]),
1017- label_font_size: m["labelFontSize"],
1018- label_limit: m["labelLimit"],
1281+ label_font_size: m["labelFontSize"] && decode_label_font_size(m["labelFontSize"]),
1282+ label_limit: m["labelLimit"] && decode_label_limit(m["labelLimit"]),
10191283 label_overlap: decode_label_overlap(m["labelOverlap"]),
1020- label_padding: m["labelPadding"],
1284+ label_padding: m["labelPadding"] && decode_label_padding(m["labelPadding"]),
10211285 labels: m["labels"],
1022- max_extent: m["maxExtent"],
1023- min_extent: m["minExtent"],
1286+ max_extent: m["maxExtent"] && decode_max_extent(m["maxExtent"]),
1287+ min_extent: m["minExtent"] && decode_min_extent(m["minExtent"]),
10241288 short_time_labels: m["shortTimeLabels"],
10251289 tick_color: m["tickColor"] && decode_tick_color(m["tickColor"]),
10261290 tick_round: m["tickRound"],
10271291 ticks: m["ticks"],
1028- tick_size: m["tickSize"],
1029- tick_width: m["tickWidth"],
1292+ tick_size: m["tickSize"] && decode_tick_size(m["tickSize"]),
1293+ tick_width: m["tickWidth"] && decode_tick_width(m["tickWidth"]),
10301294 title_align: m["titleAlign"] && decode_title_align(m["titleAlign"]),
1031- title_angle: m["titleAngle"],
1295+ title_angle: m["titleAngle"] && decode_title_angle(m["titleAngle"]),
10321296 title_baseline: m["titleBaseline"] && decode_title_baseline(m["titleBaseline"]),
10331297 title_color: m["titleColor"] && decode_title_color(m["titleColor"]),
10341298 title_font: m["titleFont"] && decode_title_font(m["titleFont"]),
1035- title_font_size: m["titleFontSize"],
1299+ title_font_size: m["titleFontSize"] && decode_title_font_size(m["titleFontSize"]),
10361300 title_font_weight: m["titleFontWeight"],
1037- title_limit: m["titleLimit"],
1038- title_max_length: m["titleMaxLength"],
1039- title_padding: m["titlePadding"],
1040- title_x: m["titleX"],
1041- title_y: m["titleY"],
1301+ title_limit: m["titleLimit"] && decode_title_limit(m["titleLimit"]),
1302+ title_max_length: m["titleMaxLength"] && decode_title_max_length(m["titleMaxLength"]),
1303+ title_padding: m["titlePadding"] && decode_title_padding(m["titlePadding"]),
1304+ title_x: m["titleX"] && decode_title_x(m["titleX"]),
1305+ title_y: m["titleY"] && decode_title_y(m["titleY"]),
10421306 }
10431307 end
10441308
@@ -1197,18 +1461,58 @@ defmodule VGAxisConfig do
11971461 title_y: float() | nil
11981462 }
11991463
1464+ def decode_band_position(value) when is_float(value), do: value
1465+ def decode_band_position(value) when is_integer(value), do: value
1466+ def decode_band_position(_), do: {:error, "Unexpected type when decoding VGAxisConfig.band_position"}
1467+
1468+ def encode_band_position(value) when is_float(value), do: value
1469+ def encode_band_position(value) when is_integer(value), do: value
1470+ def encode_band_position(_), do: {:error, "Unexpected type when encoding VGAxisConfig.band_position"}
1471+
12001472 def decode_domain_color(value) when is_binary(value), do: value
12011473 def decode_domain_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.domain_color"}
12021474
12031475 def encode_domain_color(value) when is_binary(value), do: value
12041476 def encode_domain_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.domain_color"}
12051477
1478+ def decode_domain_width(value) when is_float(value), do: value
1479+ def decode_domain_width(value) when is_integer(value), do: value
1480+ def decode_domain_width(_), do: {:error, "Unexpected type when decoding VGAxisConfig.domain_width"}
1481+
1482+ def encode_domain_width(value) when is_float(value), do: value
1483+ def encode_domain_width(value) when is_integer(value), do: value
1484+ def encode_domain_width(_), do: {:error, "Unexpected type when encoding VGAxisConfig.domain_width"}
1485+
12061486 def decode_grid_color(value) when is_binary(value), do: value
12071487 def decode_grid_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.grid_color"}
12081488
12091489 def encode_grid_color(value) when is_binary(value), do: value
12101490 def encode_grid_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.grid_color"}
12111491
1492+ def decode_grid_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
1493+ def decode_grid_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
1494+ def decode_grid_opacity(_), do: {:error, "Unexpected type when decoding VGAxisConfig.grid_opacity"}
1495+
1496+ def encode_grid_opacity(value) when is_float(value), do: value
1497+ def encode_grid_opacity(value) when is_integer(value), do: value
1498+ def encode_grid_opacity(_), do: {:error, "Unexpected type when encoding VGAxisConfig.grid_opacity"}
1499+
1500+ def decode_grid_width(value) when is_float(value) and value >= 0, do: value
1501+ def decode_grid_width(value) when is_integer(value) and value >= 0, do: value
1502+ def decode_grid_width(_), do: {:error, "Unexpected type when decoding VGAxisConfig.grid_width"}
1503+
1504+ def encode_grid_width(value) when is_float(value), do: value
1505+ def encode_grid_width(value) when is_integer(value), do: value
1506+ def encode_grid_width(_), do: {:error, "Unexpected type when encoding VGAxisConfig.grid_width"}
1507+
1508+ def decode_label_angle(value) when is_float(value) and value >= -360 and value <= 360, do: value
1509+ def decode_label_angle(value) when is_integer(value) and value >= -360 and value <= 360, do: value
1510+ def decode_label_angle(_), do: {:error, "Unexpected type when decoding VGAxisConfig.label_angle"}
1511+
1512+ def encode_label_angle(value) when is_float(value), do: value
1513+ def encode_label_angle(value) when is_integer(value), do: value
1514+ def encode_label_angle(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_angle"}
1515+
12121516 def decode_label_color(value) when is_binary(value), do: value
12131517 def decode_label_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.label_color"}
12141518
@@ -1221,6 +1525,22 @@ defmodule VGAxisConfig do
12211525 def encode_label_font(value) when is_binary(value), do: value
12221526 def encode_label_font(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_font"}
12231527
1528+ def decode_label_font_size(value) when is_float(value) and value >= 0, do: value
1529+ def decode_label_font_size(value) when is_integer(value) and value >= 0, do: value
1530+ def decode_label_font_size(_), do: {:error, "Unexpected type when decoding VGAxisConfig.label_font_size"}
1531+
1532+ def encode_label_font_size(value) when is_float(value), do: value
1533+ def encode_label_font_size(value) when is_integer(value), do: value
1534+ def encode_label_font_size(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_font_size"}
1535+
1536+ def decode_label_limit(value) when is_float(value), do: value
1537+ def decode_label_limit(value) when is_integer(value), do: value
1538+ def decode_label_limit(_), do: {:error, "Unexpected type when decoding VGAxisConfig.label_limit"}
1539+
1540+ def encode_label_limit(value) when is_float(value), do: value
1541+ def encode_label_limit(value) when is_integer(value), do: value
1542+ def encode_label_limit(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_limit"}
1543+
12241544 def decode_label_overlap(value) when is_boolean(value), do: value
12251545 def decode_label_overlap(value) when is_binary(value), do: LabelOverlapEnum.decode(value)
12261546 def decode_label_overlap(value) when is_nil(value), do: value
@@ -1231,18 +1551,66 @@ defmodule VGAxisConfig do
12311551 def encode_label_overlap(value) when is_nil(value), do: value
12321552 def encode_label_overlap(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_overlap"}
12331553
1554+ def decode_label_padding(value) when is_float(value), do: value
1555+ def decode_label_padding(value) when is_integer(value), do: value
1556+ def decode_label_padding(_), do: {:error, "Unexpected type when decoding VGAxisConfig.label_padding"}
1557+
1558+ def encode_label_padding(value) when is_float(value), do: value
1559+ def encode_label_padding(value) when is_integer(value), do: value
1560+ def encode_label_padding(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_padding"}
1561+
1562+ def decode_max_extent(value) when is_float(value), do: value
1563+ def decode_max_extent(value) when is_integer(value), do: value
1564+ def decode_max_extent(_), do: {:error, "Unexpected type when decoding VGAxisConfig.max_extent"}
1565+
1566+ def encode_max_extent(value) when is_float(value), do: value
1567+ def encode_max_extent(value) when is_integer(value), do: value
1568+ def encode_max_extent(_), do: {:error, "Unexpected type when encoding VGAxisConfig.max_extent"}
1569+
1570+ def decode_min_extent(value) when is_float(value), do: value
1571+ def decode_min_extent(value) when is_integer(value), do: value
1572+ def decode_min_extent(_), do: {:error, "Unexpected type when decoding VGAxisConfig.min_extent"}
1573+
1574+ def encode_min_extent(value) when is_float(value), do: value
1575+ def encode_min_extent(value) when is_integer(value), do: value
1576+ def encode_min_extent(_), do: {:error, "Unexpected type when encoding VGAxisConfig.min_extent"}
1577+
12341578 def decode_tick_color(value) when is_binary(value), do: value
12351579 def decode_tick_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.tick_color"}
12361580
12371581 def encode_tick_color(value) when is_binary(value), do: value
12381582 def encode_tick_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.tick_color"}
12391583
1584+ def decode_tick_size(value) when is_float(value) and value >= 0, do: value
1585+ def decode_tick_size(value) when is_integer(value) and value >= 0, do: value
1586+ def decode_tick_size(_), do: {:error, "Unexpected type when decoding VGAxisConfig.tick_size"}
1587+
1588+ def encode_tick_size(value) when is_float(value), do: value
1589+ def encode_tick_size(value) when is_integer(value), do: value
1590+ def encode_tick_size(_), do: {:error, "Unexpected type when encoding VGAxisConfig.tick_size"}
1591+
1592+ def decode_tick_width(value) when is_float(value) and value >= 0, do: value
1593+ def decode_tick_width(value) when is_integer(value) and value >= 0, do: value
1594+ def decode_tick_width(_), do: {:error, "Unexpected type when decoding VGAxisConfig.tick_width"}
1595+
1596+ def encode_tick_width(value) when is_float(value), do: value
1597+ def encode_tick_width(value) when is_integer(value), do: value
1598+ def encode_tick_width(_), do: {:error, "Unexpected type when encoding VGAxisConfig.tick_width"}
1599+
12401600 def decode_title_align(value) when is_binary(value), do: value
12411601 def decode_title_align(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_align"}
12421602
12431603 def encode_title_align(value) when is_binary(value), do: value
12441604 def encode_title_align(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_align"}
12451605
1606+ def decode_title_angle(value) when is_float(value), do: value
1607+ def decode_title_angle(value) when is_integer(value), do: value
1608+ def decode_title_angle(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_angle"}
1609+
1610+ def encode_title_angle(value) when is_float(value), do: value
1611+ def encode_title_angle(value) when is_integer(value), do: value
1612+ def encode_title_angle(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_angle"}
1613+
12461614 def decode_title_baseline(value) when is_binary(value), do: value
12471615 def decode_title_baseline(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_baseline"}
12481616
@@ -1261,46 +1629,94 @@ defmodule VGAxisConfig do
12611629 def encode_title_font(value) when is_binary(value), do: value
12621630 def encode_title_font(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_font"}
12631631
1632+ def decode_title_font_size(value) when is_float(value) and value >= 0, do: value
1633+ def decode_title_font_size(value) when is_integer(value) and value >= 0, do: value
1634+ def decode_title_font_size(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_font_size"}
1635+
1636+ def encode_title_font_size(value) when is_float(value), do: value
1637+ def encode_title_font_size(value) when is_integer(value), do: value
1638+ def encode_title_font_size(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_font_size"}
1639+
1640+ def decode_title_limit(value) when is_float(value), do: value
1641+ def decode_title_limit(value) when is_integer(value), do: value
1642+ def decode_title_limit(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_limit"}
1643+
1644+ def encode_title_limit(value) when is_float(value), do: value
1645+ def encode_title_limit(value) when is_integer(value), do: value
1646+ def encode_title_limit(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_limit"}
1647+
1648+ def decode_title_max_length(value) when is_float(value), do: value
1649+ def decode_title_max_length(value) when is_integer(value), do: value
1650+ def decode_title_max_length(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_max_length"}
1651+
1652+ def encode_title_max_length(value) when is_float(value), do: value
1653+ def encode_title_max_length(value) when is_integer(value), do: value
1654+ def encode_title_max_length(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_max_length"}
1655+
1656+ def decode_title_padding(value) when is_float(value), do: value
1657+ def decode_title_padding(value) when is_integer(value), do: value
1658+ def decode_title_padding(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_padding"}
1659+
1660+ def encode_title_padding(value) when is_float(value), do: value
1661+ def encode_title_padding(value) when is_integer(value), do: value
1662+ def encode_title_padding(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_padding"}
1663+
1664+ def decode_title_x(value) when is_float(value), do: value
1665+ def decode_title_x(value) when is_integer(value), do: value
1666+ def decode_title_x(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_x"}
1667+
1668+ def encode_title_x(value) when is_float(value), do: value
1669+ def encode_title_x(value) when is_integer(value), do: value
1670+ def encode_title_x(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_x"}
1671+
1672+ def decode_title_y(value) when is_float(value), do: value
1673+ def decode_title_y(value) when is_integer(value), do: value
1674+ def decode_title_y(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_y"}
1675+
1676+ def encode_title_y(value) when is_float(value), do: value
1677+ def encode_title_y(value) when is_integer(value), do: value
1678+ def encode_title_y(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_y"}
1679+
12641680 def from_map(m) do
12651681 %VGAxisConfig{
1266- band_position: m["bandPosition"],
1682+ band_position: m["bandPosition"] && decode_band_position(m["bandPosition"]),
12671683 domain: m["domain"],
12681684 domain_color: m["domainColor"] && decode_domain_color(m["domainColor"]),
1269- domain_width: m["domainWidth"],
1685+ domain_width: m["domainWidth"] && decode_domain_width(m["domainWidth"]),
12701686 grid: m["grid"],
12711687 grid_color: m["gridColor"] && decode_grid_color(m["gridColor"]),
12721688 grid_dash: m["gridDash"],
1273- grid_opacity: m["gridOpacity"],
1274- grid_width: m["gridWidth"],
1275- label_angle: m["labelAngle"],
1689+ grid_opacity: m["gridOpacity"] && decode_grid_opacity(m["gridOpacity"]),
1690+ grid_width: m["gridWidth"] && decode_grid_width(m["gridWidth"]),
1691+ label_angle: m["labelAngle"] && decode_label_angle(m["labelAngle"]),
12761692 label_bound: m["labelBound"],
12771693 label_color: m["labelColor"] && decode_label_color(m["labelColor"]),
12781694 label_flush: m["labelFlush"],
12791695 label_font: m["labelFont"] && decode_label_font(m["labelFont"]),
1280- label_font_size: m["labelFontSize"],
1281- label_limit: m["labelLimit"],
1696+ label_font_size: m["labelFontSize"] && decode_label_font_size(m["labelFontSize"]),
1697+ label_limit: m["labelLimit"] && decode_label_limit(m["labelLimit"]),
12821698 label_overlap: decode_label_overlap(m["labelOverlap"]),
1283- label_padding: m["labelPadding"],
1699+ label_padding: m["labelPadding"] && decode_label_padding(m["labelPadding"]),
12841700 labels: m["labels"],
1285- max_extent: m["maxExtent"],
1286- min_extent: m["minExtent"],
1701+ max_extent: m["maxExtent"] && decode_max_extent(m["maxExtent"]),
1702+ min_extent: m["minExtent"] && decode_min_extent(m["minExtent"]),
12871703 tick_color: m["tickColor"] && decode_tick_color(m["tickColor"]),
12881704 tick_round: m["tickRound"],
12891705 ticks: m["ticks"],
1290- tick_size: m["tickSize"],
1291- tick_width: m["tickWidth"],
1706+ tick_size: m["tickSize"] && decode_tick_size(m["tickSize"]),
1707+ tick_width: m["tickWidth"] && decode_tick_width(m["tickWidth"]),
12921708 title_align: m["titleAlign"] && decode_title_align(m["titleAlign"]),
1293- title_angle: m["titleAngle"],
1709+ title_angle: m["titleAngle"] && decode_title_angle(m["titleAngle"]),
12941710 title_baseline: m["titleBaseline"] && decode_title_baseline(m["titleBaseline"]),
12951711 title_color: m["titleColor"] && decode_title_color(m["titleColor"]),
12961712 title_font: m["titleFont"] && decode_title_font(m["titleFont"]),
1297- title_font_size: m["titleFontSize"],
1713+ title_font_size: m["titleFontSize"] && decode_title_font_size(m["titleFontSize"]),
12981714 title_font_weight: m["titleFontWeight"],
1299- title_limit: m["titleLimit"],
1300- title_max_length: m["titleMaxLength"],
1301- title_padding: m["titlePadding"],
1302- title_x: m["titleX"],
1303- title_y: m["titleY"],
1715+ title_limit: m["titleLimit"] && decode_title_limit(m["titleLimit"]),
1716+ title_max_length: m["titleMaxLength"] && decode_title_max_length(m["titleMaxLength"]),
1717+ title_padding: m["titlePadding"] && decode_title_padding(m["titlePadding"]),
1718+ title_x: m["titleX"] && decode_title_x(m["titleX"]),
1719+ title_y: m["titleY"] && decode_title_y(m["titleY"]),
13041720 }
13051721 end
13061722
@@ -1436,27 +1852,91 @@ defmodule BarConfig do
14361852 theta: float() | nil
14371853 }
14381854
1855+ def decode_angle(value) when is_float(value) and value >= 0 and value <= 360, do: value
1856+ def decode_angle(value) when is_integer(value) and value >= 0 and value <= 360, do: value
1857+ def decode_angle(_), do: {:error, "Unexpected type when decoding BarConfig.angle"}
1858+
1859+ def encode_angle(value) when is_float(value), do: value
1860+ def encode_angle(value) when is_integer(value), do: value
1861+ def encode_angle(_), do: {:error, "Unexpected type when encoding BarConfig.angle"}
1862+
1863+ def decode_bin_spacing(value) when is_float(value) and value >= 0, do: value
1864+ def decode_bin_spacing(value) when is_integer(value) and value >= 0, do: value
1865+ def decode_bin_spacing(_), do: {:error, "Unexpected type when decoding BarConfig.bin_spacing"}
1866+
1867+ def encode_bin_spacing(value) when is_float(value), do: value
1868+ def encode_bin_spacing(value) when is_integer(value), do: value
1869+ def encode_bin_spacing(_), do: {:error, "Unexpected type when encoding BarConfig.bin_spacing"}
1870+
14391871 def decode_color(value) when is_binary(value), do: value
14401872 def decode_color(_), do: {:error, "Unexpected type when decoding BarConfig.color"}
14411873
14421874 def encode_color(value) when is_binary(value), do: value
14431875 def encode_color(_), do: {:error, "Unexpected type when encoding BarConfig.color"}
14441876
1877+ def decode_continuous_band_size(value) when is_float(value) and value >= 0, do: value
1878+ def decode_continuous_band_size(value) when is_integer(value) and value >= 0, do: value
1879+ def decode_continuous_band_size(_), do: {:error, "Unexpected type when decoding BarConfig.continuous_band_size"}
1880+
1881+ def encode_continuous_band_size(value) when is_float(value), do: value
1882+ def encode_continuous_band_size(value) when is_integer(value), do: value
1883+ def encode_continuous_band_size(_), do: {:error, "Unexpected type when encoding BarConfig.continuous_band_size"}
1884+
1885+ def decode_discrete_band_size(value) when is_float(value) and value >= 0, do: value
1886+ def decode_discrete_band_size(value) when is_integer(value) and value >= 0, do: value
1887+ def decode_discrete_band_size(_), do: {:error, "Unexpected type when decoding BarConfig.discrete_band_size"}
1888+
1889+ def encode_discrete_band_size(value) when is_float(value), do: value
1890+ def encode_discrete_band_size(value) when is_integer(value), do: value
1891+ def encode_discrete_band_size(_), do: {:error, "Unexpected type when encoding BarConfig.discrete_band_size"}
1892+
1893+ def decode_dx(value) when is_float(value), do: value
1894+ def decode_dx(value) when is_integer(value), do: value
1895+ def decode_dx(_), do: {:error, "Unexpected type when decoding BarConfig.dx"}
1896+
1897+ def encode_dx(value) when is_float(value), do: value
1898+ def encode_dx(value) when is_integer(value), do: value
1899+ def encode_dx(_), do: {:error, "Unexpected type when encoding BarConfig.dx"}
1900+
1901+ def decode_dy(value) when is_float(value), do: value
1902+ def decode_dy(value) when is_integer(value), do: value
1903+ def decode_dy(_), do: {:error, "Unexpected type when decoding BarConfig.dy"}
1904+
1905+ def encode_dy(value) when is_float(value), do: value
1906+ def encode_dy(value) when is_integer(value), do: value
1907+ def encode_dy(_), do: {:error, "Unexpected type when encoding BarConfig.dy"}
1908+
14451909 def decode_fill(value) when is_binary(value), do: value
14461910 def decode_fill(_), do: {:error, "Unexpected type when decoding BarConfig.fill"}
14471911
14481912 def encode_fill(value) when is_binary(value), do: value
14491913 def encode_fill(_), do: {:error, "Unexpected type when encoding BarConfig.fill"}
14501914
1915+ def decode_fill_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
1916+ def decode_fill_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
1917+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding BarConfig.fill_opacity"}
1918+
1919+ def encode_fill_opacity(value) when is_float(value), do: value
1920+ def encode_fill_opacity(value) when is_integer(value), do: value
1921+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding BarConfig.fill_opacity"}
1922+
14511923 def decode_font(value) when is_binary(value), do: value
14521924 def decode_font(_), do: {:error, "Unexpected type when decoding BarConfig.font"}
14531925
14541926 def encode_font(value) when is_binary(value), do: value
14551927 def encode_font(_), do: {:error, "Unexpected type when encoding BarConfig.font"}
14561928
1929+ def decode_font_size(value) when is_float(value) and value >= 0, do: value
1930+ def decode_font_size(value) when is_integer(value) and value >= 0, do: value
1931+ def decode_font_size(_), do: {:error, "Unexpected type when decoding BarConfig.font_size"}
1932+
1933+ def encode_font_size(value) when is_float(value), do: value
1934+ def encode_font_size(value) when is_integer(value), do: value
1935+ def encode_font_size(_), do: {:error, "Unexpected type when encoding BarConfig.font_size"}
1936+
14571937 def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
1458- def decode_font_weight(value) when is_float(value), do: value
1459- def decode_font_weight(value) when is_integer(value), do: value
1938+ def decode_font_weight(value) when is_float(value) and value >= 100 and value <= 900, do: value
1939+ def decode_font_weight(value) when is_integer(value) and value >= 100 and value <= 900, do: value
14601940 def decode_font_weight(value) when is_nil(value), do: value
14611941 def decode_font_weight(_), do: {:error, "Unexpected type when decoding BarConfig.font_weight"}
14621942
@@ -1472,59 +1952,131 @@ defmodule BarConfig do
14721952 def encode_href(value) when is_binary(value), do: value
14731953 def encode_href(_), do: {:error, "Unexpected type when encoding BarConfig.href"}
14741954
1955+ def decode_limit(value) when is_float(value), do: value
1956+ def decode_limit(value) when is_integer(value), do: value
1957+ def decode_limit(_), do: {:error, "Unexpected type when decoding BarConfig.limit"}
1958+
1959+ def encode_limit(value) when is_float(value), do: value
1960+ def encode_limit(value) when is_integer(value), do: value
1961+ def encode_limit(_), do: {:error, "Unexpected type when encoding BarConfig.limit"}
1962+
1963+ def decode_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
1964+ def decode_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
1965+ def decode_opacity(_), do: {:error, "Unexpected type when decoding BarConfig.opacity"}
1966+
1967+ def encode_opacity(value) when is_float(value), do: value
1968+ def encode_opacity(value) when is_integer(value), do: value
1969+ def encode_opacity(_), do: {:error, "Unexpected type when encoding BarConfig.opacity"}
1970+
1971+ def decode_radius(value) when is_float(value) and value >= 0, do: value
1972+ def decode_radius(value) when is_integer(value) and value >= 0, do: value
1973+ def decode_radius(_), do: {:error, "Unexpected type when decoding BarConfig.radius"}
1974+
1975+ def encode_radius(value) when is_float(value), do: value
1976+ def encode_radius(value) when is_integer(value), do: value
1977+ def encode_radius(_), do: {:error, "Unexpected type when encoding BarConfig.radius"}
1978+
14751979 def decode_shape(value) when is_binary(value), do: value
14761980 def decode_shape(_), do: {:error, "Unexpected type when decoding BarConfig.shape"}
14771981
14781982 def encode_shape(value) when is_binary(value), do: value
14791983 def encode_shape(_), do: {:error, "Unexpected type when encoding BarConfig.shape"}
14801984
1985+ def decode_size(value) when is_float(value) and value >= 0, do: value
1986+ def decode_size(value) when is_integer(value) and value >= 0, do: value
1987+ def decode_size(_), do: {:error, "Unexpected type when decoding BarConfig.size"}
1988+
1989+ def encode_size(value) when is_float(value), do: value
1990+ def encode_size(value) when is_integer(value), do: value
1991+ def encode_size(_), do: {:error, "Unexpected type when encoding BarConfig.size"}
1992+
14811993 def decode_stroke(value) when is_binary(value), do: value
14821994 def decode_stroke(_), do: {:error, "Unexpected type when decoding BarConfig.stroke"}
14831995
14841996 def encode_stroke(value) when is_binary(value), do: value
14851997 def encode_stroke(_), do: {:error, "Unexpected type when encoding BarConfig.stroke"}
14861998
1999+ def decode_stroke_dash_offset(value) when is_float(value), do: value
2000+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
2001+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding BarConfig.stroke_dash_offset"}
2002+
2003+ def encode_stroke_dash_offset(value) when is_float(value), do: value
2004+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
2005+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding BarConfig.stroke_dash_offset"}
2006+
2007+ def decode_stroke_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
2008+ def decode_stroke_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
2009+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding BarConfig.stroke_opacity"}
2010+
2011+ def encode_stroke_opacity(value) when is_float(value), do: value
2012+ def encode_stroke_opacity(value) when is_integer(value), do: value
2013+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding BarConfig.stroke_opacity"}
2014+
2015+ def decode_stroke_width(value) when is_float(value) and value >= 0, do: value
2016+ def decode_stroke_width(value) when is_integer(value) and value >= 0, do: value
2017+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding BarConfig.stroke_width"}
2018+
2019+ def encode_stroke_width(value) when is_float(value), do: value
2020+ def encode_stroke_width(value) when is_integer(value), do: value
2021+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding BarConfig.stroke_width"}
2022+
2023+ def decode_tension(value) when is_float(value) and value >= 0 and value <= 1, do: value
2024+ def decode_tension(value) when is_integer(value) and value >= 0 and value <= 1, do: value
2025+ def decode_tension(_), do: {:error, "Unexpected type when decoding BarConfig.tension"}
2026+
2027+ def encode_tension(value) when is_float(value), do: value
2028+ def encode_tension(value) when is_integer(value), do: value
2029+ def encode_tension(_), do: {:error, "Unexpected type when encoding BarConfig.tension"}
2030+
14872031 def decode_text(value) when is_binary(value), do: value
14882032 def decode_text(_), do: {:error, "Unexpected type when decoding BarConfig.text"}
14892033
14902034 def encode_text(value) when is_binary(value), do: value
14912035 def encode_text(_), do: {:error, "Unexpected type when encoding BarConfig.text"}
14922036
2037+ def decode_theta(value) when is_float(value), do: value
2038+ def decode_theta(value) when is_integer(value), do: value
2039+ def decode_theta(_), do: {:error, "Unexpected type when decoding BarConfig.theta"}
2040+
2041+ def encode_theta(value) when is_float(value), do: value
2042+ def encode_theta(value) when is_integer(value), do: value
2043+ def encode_theta(_), do: {:error, "Unexpected type when encoding BarConfig.theta"}
2044+
14932045 def from_map(m) do
14942046 %BarConfig{
14952047 align: m["align"] && HorizontalAlign.decode(m["align"]),
1496- angle: m["angle"],
2048+ angle: m["angle"] && decode_angle(m["angle"]),
14972049 baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
1498- bin_spacing: m["binSpacing"],
2050+ bin_spacing: m["binSpacing"] && decode_bin_spacing(m["binSpacing"]),
14992051 color: m["color"] && decode_color(m["color"]),
1500- continuous_band_size: m["continuousBandSize"],
2052+ continuous_band_size: m["continuousBandSize"] && decode_continuous_band_size(m["continuousBandSize"]),
15012053 cursor: m["cursor"] && Cursor.decode(m["cursor"]),
1502- discrete_band_size: m["discreteBandSize"],
1503- dx: m["dx"],
1504- dy: m["dy"],
2054+ discrete_band_size: m["discreteBandSize"] && decode_discrete_band_size(m["discreteBandSize"]),
2055+ dx: m["dx"] && decode_dx(m["dx"]),
2056+ dy: m["dy"] && decode_dy(m["dy"]),
15052057 fill: m["fill"] && decode_fill(m["fill"]),
15062058 filled: m["filled"],
1507- fill_opacity: m["fillOpacity"],
2059+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
15082060 font: m["font"] && decode_font(m["font"]),
1509- font_size: m["fontSize"],
2061+ font_size: m["fontSize"] && decode_font_size(m["fontSize"]),
15102062 font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
15112063 font_weight: decode_font_weight(m["fontWeight"]),
15122064 href: m["href"] && decode_href(m["href"]),
15132065 interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
1514- limit: m["limit"],
1515- opacity: m["opacity"],
2066+ limit: m["limit"] && decode_limit(m["limit"]),
2067+ opacity: m["opacity"] && decode_opacity(m["opacity"]),
15162068 orient: m["orient"] && Orient.decode(m["orient"]),
1517- radius: m["radius"],
2069+ radius: m["radius"] && decode_radius(m["radius"]),
15182070 shape: m["shape"] && decode_shape(m["shape"]),
1519- size: m["size"],
2071+ size: m["size"] && decode_size(m["size"]),
15202072 stroke: m["stroke"] && decode_stroke(m["stroke"]),
15212073 stroke_dash: m["strokeDash"],
1522- stroke_dash_offset: m["strokeDashOffset"],
1523- stroke_opacity: m["strokeOpacity"],
1524- stroke_width: m["strokeWidth"],
1525- tension: m["tension"],
2074+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
2075+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
2076+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
2077+ tension: m["tension"] && decode_tension(m["tension"]),
15262078 text: m["text"] && decode_text(m["text"]),
1527- theta: m["theta"],
2079+ theta: m["theta"] && decode_theta(m["theta"]),
15282080 }
15292081 end
15302082
@@ -1829,24 +2381,80 @@ defmodule LegendConfig do
18292381 title_padding: float() | nil
18302382 }
18312383
2384+ def decode_corner_radius(value) when is_float(value), do: value
2385+ def decode_corner_radius(value) when is_integer(value), do: value
2386+ def decode_corner_radius(_), do: {:error, "Unexpected type when decoding LegendConfig.corner_radius"}
2387+
2388+ def encode_corner_radius(value) when is_float(value), do: value
2389+ def encode_corner_radius(value) when is_integer(value), do: value
2390+ def encode_corner_radius(_), do: {:error, "Unexpected type when encoding LegendConfig.corner_radius"}
2391+
2392+ def decode_entry_padding(value) when is_float(value), do: value
2393+ def decode_entry_padding(value) when is_integer(value), do: value
2394+ def decode_entry_padding(_), do: {:error, "Unexpected type when decoding LegendConfig.entry_padding"}
2395+
2396+ def encode_entry_padding(value) when is_float(value), do: value
2397+ def encode_entry_padding(value) when is_integer(value), do: value
2398+ def encode_entry_padding(_), do: {:error, "Unexpected type when encoding LegendConfig.entry_padding"}
2399+
18322400 def decode_fill_color(value) when is_binary(value), do: value
18332401 def decode_fill_color(_), do: {:error, "Unexpected type when decoding LegendConfig.fill_color"}
18342402
18352403 def encode_fill_color(value) when is_binary(value), do: value
18362404 def encode_fill_color(_), do: {:error, "Unexpected type when encoding LegendConfig.fill_color"}
18372405
2406+ def decode_gradient_height(value) when is_float(value) and value >= 0, do: value
2407+ def decode_gradient_height(value) when is_integer(value) and value >= 0, do: value
2408+ def decode_gradient_height(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_height"}
2409+
2410+ def encode_gradient_height(value) when is_float(value), do: value
2411+ def encode_gradient_height(value) when is_integer(value), do: value
2412+ def encode_gradient_height(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_height"}
2413+
18382414 def decode_gradient_label_baseline(value) when is_binary(value), do: value
18392415 def decode_gradient_label_baseline(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_label_baseline"}
18402416
18412417 def encode_gradient_label_baseline(value) when is_binary(value), do: value
18422418 def encode_gradient_label_baseline(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_label_baseline"}
18432419
2420+ def decode_gradient_label_limit(value) when is_float(value), do: value
2421+ def decode_gradient_label_limit(value) when is_integer(value), do: value
2422+ def decode_gradient_label_limit(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_label_limit"}
2423+
2424+ def encode_gradient_label_limit(value) when is_float(value), do: value
2425+ def encode_gradient_label_limit(value) when is_integer(value), do: value
2426+ def encode_gradient_label_limit(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_label_limit"}
2427+
2428+ def decode_gradient_label_offset(value) when is_float(value), do: value
2429+ def decode_gradient_label_offset(value) when is_integer(value), do: value
2430+ def decode_gradient_label_offset(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_label_offset"}
2431+
2432+ def encode_gradient_label_offset(value) when is_float(value), do: value
2433+ def encode_gradient_label_offset(value) when is_integer(value), do: value
2434+ def encode_gradient_label_offset(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_label_offset"}
2435+
18442436 def decode_gradient_stroke_color(value) when is_binary(value), do: value
18452437 def decode_gradient_stroke_color(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_stroke_color"}
18462438
18472439 def encode_gradient_stroke_color(value) when is_binary(value), do: value
18482440 def encode_gradient_stroke_color(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_stroke_color"}
18492441
2442+ def decode_gradient_stroke_width(value) when is_float(value) and value >= 0, do: value
2443+ def decode_gradient_stroke_width(value) when is_integer(value) and value >= 0, do: value
2444+ def decode_gradient_stroke_width(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_stroke_width"}
2445+
2446+ def encode_gradient_stroke_width(value) when is_float(value), do: value
2447+ def encode_gradient_stroke_width(value) when is_integer(value), do: value
2448+ def encode_gradient_stroke_width(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_stroke_width"}
2449+
2450+ def decode_gradient_width(value) when is_float(value) and value >= 0, do: value
2451+ def decode_gradient_width(value) when is_integer(value) and value >= 0, do: value
2452+ def decode_gradient_width(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_width"}
2453+
2454+ def encode_gradient_width(value) when is_float(value), do: value
2455+ def encode_gradient_width(value) when is_integer(value), do: value
2456+ def encode_gradient_width(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_width"}
2457+
18502458 def decode_label_align(value) when is_binary(value), do: value
18512459 def decode_label_align(_), do: {:error, "Unexpected type when decoding LegendConfig.label_align"}
18522460
@@ -1871,18 +2479,82 @@ defmodule LegendConfig do
18712479 def encode_label_font(value) when is_binary(value), do: value
18722480 def encode_label_font(_), do: {:error, "Unexpected type when encoding LegendConfig.label_font"}
18732481
2482+ def decode_label_font_size(value) when is_float(value) and value >= 0, do: value
2483+ def decode_label_font_size(value) when is_integer(value) and value >= 0, do: value
2484+ def decode_label_font_size(_), do: {:error, "Unexpected type when decoding LegendConfig.label_font_size"}
2485+
2486+ def encode_label_font_size(value) when is_float(value), do: value
2487+ def encode_label_font_size(value) when is_integer(value), do: value
2488+ def encode_label_font_size(_), do: {:error, "Unexpected type when encoding LegendConfig.label_font_size"}
2489+
2490+ def decode_label_limit(value) when is_float(value), do: value
2491+ def decode_label_limit(value) when is_integer(value), do: value
2492+ def decode_label_limit(_), do: {:error, "Unexpected type when decoding LegendConfig.label_limit"}
2493+
2494+ def encode_label_limit(value) when is_float(value), do: value
2495+ def encode_label_limit(value) when is_integer(value), do: value
2496+ def encode_label_limit(_), do: {:error, "Unexpected type when encoding LegendConfig.label_limit"}
2497+
2498+ def decode_label_offset(value) when is_float(value) and value >= 0, do: value
2499+ def decode_label_offset(value) when is_integer(value) and value >= 0, do: value
2500+ def decode_label_offset(_), do: {:error, "Unexpected type when decoding LegendConfig.label_offset"}
2501+
2502+ def encode_label_offset(value) when is_float(value), do: value
2503+ def encode_label_offset(value) when is_integer(value), do: value
2504+ def encode_label_offset(_), do: {:error, "Unexpected type when encoding LegendConfig.label_offset"}
2505+
2506+ def decode_offset(value) when is_float(value), do: value
2507+ def decode_offset(value) when is_integer(value), do: value
2508+ def decode_offset(_), do: {:error, "Unexpected type when decoding LegendConfig.offset"}
2509+
2510+ def encode_offset(value) when is_float(value), do: value
2511+ def encode_offset(value) when is_integer(value), do: value
2512+ def encode_offset(_), do: {:error, "Unexpected type when encoding LegendConfig.offset"}
2513+
2514+ def decode_padding(value) when is_float(value), do: value
2515+ def decode_padding(value) when is_integer(value), do: value
2516+ def decode_padding(_), do: {:error, "Unexpected type when decoding LegendConfig.padding"}
2517+
2518+ def encode_padding(value) when is_float(value), do: value
2519+ def encode_padding(value) when is_integer(value), do: value
2520+ def encode_padding(_), do: {:error, "Unexpected type when encoding LegendConfig.padding"}
2521+
18742522 def decode_stroke_color(value) when is_binary(value), do: value
18752523 def decode_stroke_color(_), do: {:error, "Unexpected type when decoding LegendConfig.stroke_color"}
18762524
18772525 def encode_stroke_color(value) when is_binary(value), do: value
18782526 def encode_stroke_color(_), do: {:error, "Unexpected type when encoding LegendConfig.stroke_color"}
18792527
2528+ def decode_stroke_width(value) when is_float(value), do: value
2529+ def decode_stroke_width(value) when is_integer(value), do: value
2530+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding LegendConfig.stroke_width"}
2531+
2532+ def encode_stroke_width(value) when is_float(value), do: value
2533+ def encode_stroke_width(value) when is_integer(value), do: value
2534+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding LegendConfig.stroke_width"}
2535+
18802536 def decode_symbol_color(value) when is_binary(value), do: value
18812537 def decode_symbol_color(_), do: {:error, "Unexpected type when decoding LegendConfig.symbol_color"}
18822538
18832539 def encode_symbol_color(value) when is_binary(value), do: value
18842540 def encode_symbol_color(_), do: {:error, "Unexpected type when encoding LegendConfig.symbol_color"}
18852541
2542+ def decode_symbol_size(value) when is_float(value) and value >= 0, do: value
2543+ def decode_symbol_size(value) when is_integer(value) and value >= 0, do: value
2544+ def decode_symbol_size(_), do: {:error, "Unexpected type when decoding LegendConfig.symbol_size"}
2545+
2546+ def encode_symbol_size(value) when is_float(value), do: value
2547+ def encode_symbol_size(value) when is_integer(value), do: value
2548+ def encode_symbol_size(_), do: {:error, "Unexpected type when encoding LegendConfig.symbol_size"}
2549+
2550+ def decode_symbol_stroke_width(value) when is_float(value) and value >= 0, do: value
2551+ def decode_symbol_stroke_width(value) when is_integer(value) and value >= 0, do: value
2552+ def decode_symbol_stroke_width(_), do: {:error, "Unexpected type when decoding LegendConfig.symbol_stroke_width"}
2553+
2554+ def encode_symbol_stroke_width(value) when is_float(value), do: value
2555+ def encode_symbol_stroke_width(value) when is_integer(value), do: value
2556+ def encode_symbol_stroke_width(_), do: {:error, "Unexpected type when encoding LegendConfig.symbol_stroke_width"}
2557+
18862558 def decode_symbol_type(value) when is_binary(value), do: value
18872559 def decode_symbol_type(_), do: {:error, "Unexpected type when decoding LegendConfig.symbol_type"}
18882560
@@ -1913,44 +2585,68 @@ defmodule LegendConfig do
19132585 def encode_title_font(value) when is_binary(value), do: value
19142586 def encode_title_font(_), do: {:error, "Unexpected type when encoding LegendConfig.title_font"}
19152587
2588+ def decode_title_font_size(value) when is_float(value), do: value
2589+ def decode_title_font_size(value) when is_integer(value), do: value
2590+ def decode_title_font_size(_), do: {:error, "Unexpected type when decoding LegendConfig.title_font_size"}
2591+
2592+ def encode_title_font_size(value) when is_float(value), do: value
2593+ def encode_title_font_size(value) when is_integer(value), do: value
2594+ def encode_title_font_size(_), do: {:error, "Unexpected type when encoding LegendConfig.title_font_size"}
2595+
2596+ def decode_title_limit(value) when is_float(value), do: value
2597+ def decode_title_limit(value) when is_integer(value), do: value
2598+ def decode_title_limit(_), do: {:error, "Unexpected type when decoding LegendConfig.title_limit"}
2599+
2600+ def encode_title_limit(value) when is_float(value), do: value
2601+ def encode_title_limit(value) when is_integer(value), do: value
2602+ def encode_title_limit(_), do: {:error, "Unexpected type when encoding LegendConfig.title_limit"}
2603+
2604+ def decode_title_padding(value) when is_float(value), do: value
2605+ def decode_title_padding(value) when is_integer(value), do: value
2606+ def decode_title_padding(_), do: {:error, "Unexpected type when decoding LegendConfig.title_padding"}
2607+
2608+ def encode_title_padding(value) when is_float(value), do: value
2609+ def encode_title_padding(value) when is_integer(value), do: value
2610+ def encode_title_padding(_), do: {:error, "Unexpected type when encoding LegendConfig.title_padding"}
2611+
19162612 def from_map(m) do
19172613 %LegendConfig{
1918- corner_radius: m["cornerRadius"],
1919- entry_padding: m["entryPadding"],
2614+ corner_radius: m["cornerRadius"] && decode_corner_radius(m["cornerRadius"]),
2615+ entry_padding: m["entryPadding"] && decode_entry_padding(m["entryPadding"]),
19202616 fill_color: m["fillColor"] && decode_fill_color(m["fillColor"]),
1921- gradient_height: m["gradientHeight"],
2617+ gradient_height: m["gradientHeight"] && decode_gradient_height(m["gradientHeight"]),
19222618 gradient_label_baseline: m["gradientLabelBaseline"] && decode_gradient_label_baseline(m["gradientLabelBaseline"]),
1923- gradient_label_limit: m["gradientLabelLimit"],
1924- gradient_label_offset: m["gradientLabelOffset"],
2619+ gradient_label_limit: m["gradientLabelLimit"] && decode_gradient_label_limit(m["gradientLabelLimit"]),
2620+ gradient_label_offset: m["gradientLabelOffset"] && decode_gradient_label_offset(m["gradientLabelOffset"]),
19252621 gradient_stroke_color: m["gradientStrokeColor"] && decode_gradient_stroke_color(m["gradientStrokeColor"]),
1926- gradient_stroke_width: m["gradientStrokeWidth"],
1927- gradient_width: m["gradientWidth"],
2622+ gradient_stroke_width: m["gradientStrokeWidth"] && decode_gradient_stroke_width(m["gradientStrokeWidth"]),
2623+ gradient_width: m["gradientWidth"] && decode_gradient_width(m["gradientWidth"]),
19282624 label_align: m["labelAlign"] && decode_label_align(m["labelAlign"]),
19292625 label_baseline: m["labelBaseline"] && decode_label_baseline(m["labelBaseline"]),
19302626 label_color: m["labelColor"] && decode_label_color(m["labelColor"]),
19312627 label_font: m["labelFont"] && decode_label_font(m["labelFont"]),
1932- label_font_size: m["labelFontSize"],
1933- label_limit: m["labelLimit"],
1934- label_offset: m["labelOffset"],
1935- offset: m["offset"],
2628+ label_font_size: m["labelFontSize"] && decode_label_font_size(m["labelFontSize"]),
2629+ label_limit: m["labelLimit"] && decode_label_limit(m["labelLimit"]),
2630+ label_offset: m["labelOffset"] && decode_label_offset(m["labelOffset"]),
2631+ offset: m["offset"] && decode_offset(m["offset"]),
19362632 orient: m["orient"] && LegendOrient.decode(m["orient"]),
1937- padding: m["padding"],
2633+ padding: m["padding"] && decode_padding(m["padding"]),
19382634 short_time_labels: m["shortTimeLabels"],
19392635 stroke_color: m["strokeColor"] && decode_stroke_color(m["strokeColor"]),
19402636 stroke_dash: m["strokeDash"],
1941- stroke_width: m["strokeWidth"],
2637+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
19422638 symbol_color: m["symbolColor"] && decode_symbol_color(m["symbolColor"]),
1943- symbol_size: m["symbolSize"],
1944- symbol_stroke_width: m["symbolStrokeWidth"],
2639+ symbol_size: m["symbolSize"] && decode_symbol_size(m["symbolSize"]),
2640+ symbol_stroke_width: m["symbolStrokeWidth"] && decode_symbol_stroke_width(m["symbolStrokeWidth"]),
19452641 symbol_type: m["symbolType"] && decode_symbol_type(m["symbolType"]),
19462642 title_align: m["titleAlign"] && decode_title_align(m["titleAlign"]),
19472643 title_baseline: m["titleBaseline"] && decode_title_baseline(m["titleBaseline"]),
19482644 title_color: m["titleColor"] && decode_title_color(m["titleColor"]),
19492645 title_font: m["titleFont"] && decode_title_font(m["titleFont"]),
1950- title_font_size: m["titleFontSize"],
2646+ title_font_size: m["titleFontSize"] && decode_title_font_size(m["titleFontSize"]),
19512647 title_font_weight: m["titleFontWeight"],
1952- title_limit: m["titleLimit"],
1953- title_padding: m["titlePadding"],
2648+ title_limit: m["titleLimit"] && decode_title_limit(m["titleLimit"]),
2649+ title_padding: m["titlePadding"] && decode_title_padding(m["titlePadding"]),
19542650 }
19552651 end
19562652
@@ -2018,12 +2714,44 @@ defmodule PaddingClass do
20182714 top: float() | nil
20192715 }
20202716
2717+ def decode_bottom(value) when is_float(value), do: value
2718+ def decode_bottom(value) when is_integer(value), do: value
2719+ def decode_bottom(_), do: {:error, "Unexpected type when decoding PaddingClass.bottom"}
2720+
2721+ def encode_bottom(value) when is_float(value), do: value
2722+ def encode_bottom(value) when is_integer(value), do: value
2723+ def encode_bottom(_), do: {:error, "Unexpected type when encoding PaddingClass.bottom"}
2724+
2725+ def decode_left(value) when is_float(value), do: value
2726+ def decode_left(value) when is_integer(value), do: value
2727+ def decode_left(_), do: {:error, "Unexpected type when decoding PaddingClass.left"}
2728+
2729+ def encode_left(value) when is_float(value), do: value
2730+ def encode_left(value) when is_integer(value), do: value
2731+ def encode_left(_), do: {:error, "Unexpected type when encoding PaddingClass.left"}
2732+
2733+ def decode_right(value) when is_float(value), do: value
2734+ def decode_right(value) when is_integer(value), do: value
2735+ def decode_right(_), do: {:error, "Unexpected type when decoding PaddingClass.right"}
2736+
2737+ def encode_right(value) when is_float(value), do: value
2738+ def encode_right(value) when is_integer(value), do: value
2739+ def encode_right(_), do: {:error, "Unexpected type when encoding PaddingClass.right"}
2740+
2741+ def decode_top(value) when is_float(value), do: value
2742+ def decode_top(value) when is_integer(value), do: value
2743+ def decode_top(_), do: {:error, "Unexpected type when decoding PaddingClass.top"}
2744+
2745+ def encode_top(value) when is_float(value), do: value
2746+ def encode_top(value) when is_integer(value), do: value
2747+ def encode_top(_), do: {:error, "Unexpected type when encoding PaddingClass.top"}
2748+
20212749 def from_map(m) do
20222750 %PaddingClass{
2023- bottom: m["bottom"],
2024- left: m["left"],
2025- right: m["right"],
2026- top: m["top"],
2751+ bottom: m["bottom"] && decode_bottom(m["bottom"]),
2752+ left: m["left"] && decode_left(m["left"]),
2753+ right: m["right"] && decode_right(m["right"]),
2754+ top: m["top"] && decode_top(m["top"]),
20272755 }
20282756 end
20292757
@@ -2150,6 +2878,54 @@ defmodule ProjectionConfig do
21502878 type: VGProjectionType.t() | nil
21512879 }
21522880
2881+ def decode_clip_angle(value) when is_float(value), do: value
2882+ def decode_clip_angle(value) when is_integer(value), do: value
2883+ def decode_clip_angle(_), do: {:error, "Unexpected type when decoding ProjectionConfig.clip_angle"}
2884+
2885+ def encode_clip_angle(value) when is_float(value), do: value
2886+ def encode_clip_angle(value) when is_integer(value), do: value
2887+ def encode_clip_angle(_), do: {:error, "Unexpected type when encoding ProjectionConfig.clip_angle"}
2888+
2889+ def decode_coefficient(value) when is_float(value), do: value
2890+ def decode_coefficient(value) when is_integer(value), do: value
2891+ def decode_coefficient(_), do: {:error, "Unexpected type when decoding ProjectionConfig.coefficient"}
2892+
2893+ def encode_coefficient(value) when is_float(value), do: value
2894+ def encode_coefficient(value) when is_integer(value), do: value
2895+ def encode_coefficient(_), do: {:error, "Unexpected type when encoding ProjectionConfig.coefficient"}
2896+
2897+ def decode_distance(value) when is_float(value), do: value
2898+ def decode_distance(value) when is_integer(value), do: value
2899+ def decode_distance(_), do: {:error, "Unexpected type when decoding ProjectionConfig.distance"}
2900+
2901+ def encode_distance(value) when is_float(value), do: value
2902+ def encode_distance(value) when is_integer(value), do: value
2903+ def encode_distance(_), do: {:error, "Unexpected type when encoding ProjectionConfig.distance"}
2904+
2905+ def decode_fraction(value) when is_float(value), do: value
2906+ def decode_fraction(value) when is_integer(value), do: value
2907+ def decode_fraction(_), do: {:error, "Unexpected type when decoding ProjectionConfig.fraction"}
2908+
2909+ def encode_fraction(value) when is_float(value), do: value
2910+ def encode_fraction(value) when is_integer(value), do: value
2911+ def encode_fraction(_), do: {:error, "Unexpected type when encoding ProjectionConfig.fraction"}
2912+
2913+ def decode_lobes(value) when is_float(value), do: value
2914+ def decode_lobes(value) when is_integer(value), do: value
2915+ def decode_lobes(_), do: {:error, "Unexpected type when decoding ProjectionConfig.lobes"}
2916+
2917+ def encode_lobes(value) when is_float(value), do: value
2918+ def encode_lobes(value) when is_integer(value), do: value
2919+ def encode_lobes(_), do: {:error, "Unexpected type when encoding ProjectionConfig.lobes"}
2920+
2921+ def decode_parallel(value) when is_float(value), do: value
2922+ def decode_parallel(value) when is_integer(value), do: value
2923+ def decode_parallel(_), do: {:error, "Unexpected type when decoding ProjectionConfig.parallel"}
2924+
2925+ def encode_parallel(value) when is_float(value), do: value
2926+ def encode_parallel(value) when is_integer(value), do: value
2927+ def encode_parallel(_), do: {:error, "Unexpected type when encoding ProjectionConfig.parallel"}
2928+
21532929 def decode_precision_value(value) when is_float(value), do: value
21542930 def decode_precision_value(value) when is_integer(value), do: value
21552931 def decode_precision_value(value) when is_binary(value), do: value
@@ -2160,23 +2936,55 @@ defmodule ProjectionConfig do
21602936 def encode_precision_value(value) when is_binary(value), do: value
21612937 def encode_precision_value(_), do: {:error, "Unexpected type when encoding ProjectionConfig.precision"}
21622938
2939+ def decode_radius(value) when is_float(value), do: value
2940+ def decode_radius(value) when is_integer(value), do: value
2941+ def decode_radius(_), do: {:error, "Unexpected type when decoding ProjectionConfig.radius"}
2942+
2943+ def encode_radius(value) when is_float(value), do: value
2944+ def encode_radius(value) when is_integer(value), do: value
2945+ def encode_radius(_), do: {:error, "Unexpected type when encoding ProjectionConfig.radius"}
2946+
2947+ def decode_ratio(value) when is_float(value), do: value
2948+ def decode_ratio(value) when is_integer(value), do: value
2949+ def decode_ratio(_), do: {:error, "Unexpected type when decoding ProjectionConfig.ratio"}
2950+
2951+ def encode_ratio(value) when is_float(value), do: value
2952+ def encode_ratio(value) when is_integer(value), do: value
2953+ def encode_ratio(_), do: {:error, "Unexpected type when encoding ProjectionConfig.ratio"}
2954+
2955+ def decode_spacing(value) when is_float(value), do: value
2956+ def decode_spacing(value) when is_integer(value), do: value
2957+ def decode_spacing(_), do: {:error, "Unexpected type when decoding ProjectionConfig.spacing"}
2958+
2959+ def encode_spacing(value) when is_float(value), do: value
2960+ def encode_spacing(value) when is_integer(value), do: value
2961+ def encode_spacing(_), do: {:error, "Unexpected type when encoding ProjectionConfig.spacing"}
2962+
2963+ def decode_tilt(value) when is_float(value), do: value
2964+ def decode_tilt(value) when is_integer(value), do: value
2965+ def decode_tilt(_), do: {:error, "Unexpected type when decoding ProjectionConfig.tilt"}
2966+
2967+ def encode_tilt(value) when is_float(value), do: value
2968+ def encode_tilt(value) when is_integer(value), do: value
2969+ def encode_tilt(_), do: {:error, "Unexpected type when encoding ProjectionConfig.tilt"}
2970+
21632971 def from_map(m) do
21642972 %ProjectionConfig{
21652973 center: m["center"],
2166- clip_angle: m["clipAngle"],
2974+ clip_angle: m["clipAngle"] && decode_clip_angle(m["clipAngle"]),
21672975 clip_extent: m["clipExtent"],
2168- coefficient: m["coefficient"],
2169- distance: m["distance"],
2170- fraction: m["fraction"],
2171- lobes: m["lobes"],
2172- parallel: m["parallel"],
2976+ coefficient: m["coefficient"] && decode_coefficient(m["coefficient"]),
2977+ distance: m["distance"] && decode_distance(m["distance"]),
2978+ fraction: m["fraction"] && decode_fraction(m["fraction"]),
2979+ lobes: m["lobes"] && decode_lobes(m["lobes"]),
2980+ parallel: m["parallel"] && decode_parallel(m["parallel"]),
21732981 precision: m["precision"]
21742982 |> Map.new(fn {key, value} -> {key, decode_precision_value(value)} end),
2175- radius: m["radius"],
2176- ratio: m["ratio"],
2983+ radius: m["radius"] && decode_radius(m["radius"]),
2984+ ratio: m["ratio"] && decode_ratio(m["ratio"]),
21772985 rotate: m["rotate"],
2178- spacing: m["spacing"],
2179- tilt: m["tilt"],
2986+ spacing: m["spacing"] && decode_spacing(m["spacing"]),
2987+ tilt: m["tilt"] && decode_tilt(m["tilt"]),
21802988 type: m["type"] && VGProjectionType.decode(m["type"]),
21812989 }
21822990 end
@@ -2225,18 +3033,34 @@ defmodule VGScheme do
22253033 step: float() | nil
22263034 }
22273035
3036+ def decode_count(value) when is_float(value), do: value
3037+ def decode_count(value) when is_integer(value), do: value
3038+ def decode_count(_), do: {:error, "Unexpected type when decoding VGScheme.count"}
3039+
3040+ def encode_count(value) when is_float(value), do: value
3041+ def encode_count(value) when is_integer(value), do: value
3042+ def encode_count(_), do: {:error, "Unexpected type when encoding VGScheme.count"}
3043+
22283044 def decode_scheme(value) when is_binary(value), do: value
22293045 def decode_scheme(_), do: {:error, "Unexpected type when decoding VGScheme.scheme"}
22303046
22313047 def encode_scheme(value) when is_binary(value), do: value
22323048 def encode_scheme(_), do: {:error, "Unexpected type when encoding VGScheme.scheme"}
22333049
3050+ def decode_step(value) when is_float(value), do: value
3051+ def decode_step(value) when is_integer(value), do: value
3052+ def decode_step(_), do: {:error, "Unexpected type when decoding VGScheme.step"}
3053+
3054+ def encode_step(value) when is_float(value), do: value
3055+ def encode_step(value) when is_integer(value), do: value
3056+ def encode_step(_), do: {:error, "Unexpected type when encoding VGScheme.step"}
3057+
22343058 def from_map(m) do
22353059 %VGScheme{
2236- count: m["count"],
3060+ count: m["count"] && decode_count(m["count"]),
22373061 extent: m["extent"],
22383062 scheme: m["scheme"] && decode_scheme(m["scheme"]),
2239- step: m["step"],
3063+ step: m["step"] && decode_step(m["step"]),
22403064 }
22413065 end
22423066
@@ -2312,26 +3136,146 @@ defmodule ScaleConfig do
23123136 use_unaggregated_domain: boolean() | nil
23133137 }
23143138
3139+ def decode_band_padding_inner(value) when is_float(value) and value >= 0 and value <= 1, do: value
3140+ def decode_band_padding_inner(value) when is_integer(value) and value >= 0 and value <= 1, do: value
3141+ def decode_band_padding_inner(_), do: {:error, "Unexpected type when decoding ScaleConfig.band_padding_inner"}
3142+
3143+ def encode_band_padding_inner(value) when is_float(value), do: value
3144+ def encode_band_padding_inner(value) when is_integer(value), do: value
3145+ def encode_band_padding_inner(_), do: {:error, "Unexpected type when encoding ScaleConfig.band_padding_inner"}
3146+
3147+ def decode_band_padding_outer(value) when is_float(value) and value >= 0 and value <= 1, do: value
3148+ def decode_band_padding_outer(value) when is_integer(value) and value >= 0 and value <= 1, do: value
3149+ def decode_band_padding_outer(_), do: {:error, "Unexpected type when decoding ScaleConfig.band_padding_outer"}
3150+
3151+ def encode_band_padding_outer(value) when is_float(value), do: value
3152+ def encode_band_padding_outer(value) when is_integer(value), do: value
3153+ def encode_band_padding_outer(_), do: {:error, "Unexpected type when encoding ScaleConfig.band_padding_outer"}
3154+
3155+ def decode_continuous_padding(value) when is_float(value) and value >= 0, do: value
3156+ def decode_continuous_padding(value) when is_integer(value) and value >= 0, do: value
3157+ def decode_continuous_padding(_), do: {:error, "Unexpected type when decoding ScaleConfig.continuous_padding"}
3158+
3159+ def encode_continuous_padding(value) when is_float(value), do: value
3160+ def encode_continuous_padding(value) when is_integer(value), do: value
3161+ def encode_continuous_padding(_), do: {:error, "Unexpected type when encoding ScaleConfig.continuous_padding"}
3162+
3163+ def decode_max_band_size(value) when is_float(value) and value >= 0, do: value
3164+ def decode_max_band_size(value) when is_integer(value) and value >= 0, do: value
3165+ def decode_max_band_size(_), do: {:error, "Unexpected type when decoding ScaleConfig.max_band_size"}
3166+
3167+ def encode_max_band_size(value) when is_float(value), do: value
3168+ def encode_max_band_size(value) when is_integer(value), do: value
3169+ def encode_max_band_size(_), do: {:error, "Unexpected type when encoding ScaleConfig.max_band_size"}
3170+
3171+ def decode_max_font_size(value) when is_float(value) and value >= 0, do: value
3172+ def decode_max_font_size(value) when is_integer(value) and value >= 0, do: value
3173+ def decode_max_font_size(_), do: {:error, "Unexpected type when decoding ScaleConfig.max_font_size"}
3174+
3175+ def encode_max_font_size(value) when is_float(value), do: value
3176+ def encode_max_font_size(value) when is_integer(value), do: value
3177+ def encode_max_font_size(_), do: {:error, "Unexpected type when encoding ScaleConfig.max_font_size"}
3178+
3179+ def decode_max_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
3180+ def decode_max_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
3181+ def decode_max_opacity(_), do: {:error, "Unexpected type when decoding ScaleConfig.max_opacity"}
3182+
3183+ def encode_max_opacity(value) when is_float(value), do: value
3184+ def encode_max_opacity(value) when is_integer(value), do: value
3185+ def encode_max_opacity(_), do: {:error, "Unexpected type when encoding ScaleConfig.max_opacity"}
3186+
3187+ def decode_max_size(value) when is_float(value) and value >= 0, do: value
3188+ def decode_max_size(value) when is_integer(value) and value >= 0, do: value
3189+ def decode_max_size(_), do: {:error, "Unexpected type when decoding ScaleConfig.max_size"}
3190+
3191+ def encode_max_size(value) when is_float(value), do: value
3192+ def encode_max_size(value) when is_integer(value), do: value
3193+ def encode_max_size(_), do: {:error, "Unexpected type when encoding ScaleConfig.max_size"}
3194+
3195+ def decode_max_stroke_width(value) when is_float(value) and value >= 0, do: value
3196+ def decode_max_stroke_width(value) when is_integer(value) and value >= 0, do: value
3197+ def decode_max_stroke_width(_), do: {:error, "Unexpected type when decoding ScaleConfig.max_stroke_width"}
3198+
3199+ def encode_max_stroke_width(value) when is_float(value), do: value
3200+ def encode_max_stroke_width(value) when is_integer(value), do: value
3201+ def encode_max_stroke_width(_), do: {:error, "Unexpected type when encoding ScaleConfig.max_stroke_width"}
3202+
3203+ def decode_min_band_size(value) when is_float(value) and value >= 0, do: value
3204+ def decode_min_band_size(value) when is_integer(value) and value >= 0, do: value
3205+ def decode_min_band_size(_), do: {:error, "Unexpected type when decoding ScaleConfig.min_band_size"}
3206+
3207+ def encode_min_band_size(value) when is_float(value), do: value
3208+ def encode_min_band_size(value) when is_integer(value), do: value
3209+ def encode_min_band_size(_), do: {:error, "Unexpected type when encoding ScaleConfig.min_band_size"}
3210+
3211+ def decode_min_font_size(value) when is_float(value) and value >= 0, do: value
3212+ def decode_min_font_size(value) when is_integer(value) and value >= 0, do: value
3213+ def decode_min_font_size(_), do: {:error, "Unexpected type when decoding ScaleConfig.min_font_size"}
3214+
3215+ def encode_min_font_size(value) when is_float(value), do: value
3216+ def encode_min_font_size(value) when is_integer(value), do: value
3217+ def encode_min_font_size(_), do: {:error, "Unexpected type when encoding ScaleConfig.min_font_size"}
3218+
3219+ def decode_min_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
3220+ def decode_min_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
3221+ def decode_min_opacity(_), do: {:error, "Unexpected type when decoding ScaleConfig.min_opacity"}
3222+
3223+ def encode_min_opacity(value) when is_float(value), do: value
3224+ def encode_min_opacity(value) when is_integer(value), do: value
3225+ def encode_min_opacity(_), do: {:error, "Unexpected type when encoding ScaleConfig.min_opacity"}
3226+
3227+ def decode_min_size(value) when is_float(value) and value >= 0, do: value
3228+ def decode_min_size(value) when is_integer(value) and value >= 0, do: value
3229+ def decode_min_size(_), do: {:error, "Unexpected type when decoding ScaleConfig.min_size"}
3230+
3231+ def encode_min_size(value) when is_float(value), do: value
3232+ def encode_min_size(value) when is_integer(value), do: value
3233+ def encode_min_size(_), do: {:error, "Unexpected type when encoding ScaleConfig.min_size"}
3234+
3235+ def decode_min_stroke_width(value) when is_float(value) and value >= 0, do: value
3236+ def decode_min_stroke_width(value) when is_integer(value) and value >= 0, do: value
3237+ def decode_min_stroke_width(_), do: {:error, "Unexpected type when decoding ScaleConfig.min_stroke_width"}
3238+
3239+ def encode_min_stroke_width(value) when is_float(value), do: value
3240+ def encode_min_stroke_width(value) when is_integer(value), do: value
3241+ def encode_min_stroke_width(_), do: {:error, "Unexpected type when encoding ScaleConfig.min_stroke_width"}
3242+
3243+ def decode_point_padding(value) when is_float(value) and value >= 0 and value <= 1, do: value
3244+ def decode_point_padding(value) when is_integer(value) and value >= 0 and value <= 1, do: value
3245+ def decode_point_padding(_), do: {:error, "Unexpected type when decoding ScaleConfig.point_padding"}
3246+
3247+ def encode_point_padding(value) when is_float(value), do: value
3248+ def encode_point_padding(value) when is_integer(value), do: value
3249+ def encode_point_padding(_), do: {:error, "Unexpected type when encoding ScaleConfig.point_padding"}
3250+
3251+ def decode_text_x_range_step(value) when is_float(value) and value >= 0, do: value
3252+ def decode_text_x_range_step(value) when is_integer(value) and value >= 0, do: value
3253+ def decode_text_x_range_step(_), do: {:error, "Unexpected type when decoding ScaleConfig.text_x_range_step"}
3254+
3255+ def encode_text_x_range_step(value) when is_float(value), do: value
3256+ def encode_text_x_range_step(value) when is_integer(value), do: value
3257+ def encode_text_x_range_step(_), do: {:error, "Unexpected type when encoding ScaleConfig.text_x_range_step"}
3258+
23153259 def from_map(m) do
23163260 %ScaleConfig{
2317- band_padding_inner: m["bandPaddingInner"],
2318- band_padding_outer: m["bandPaddingOuter"],
3261+ band_padding_inner: m["bandPaddingInner"] && decode_band_padding_inner(m["bandPaddingInner"]),
3262+ band_padding_outer: m["bandPaddingOuter"] && decode_band_padding_outer(m["bandPaddingOuter"]),
23193263 clamp: m["clamp"],
2320- continuous_padding: m["continuousPadding"],
2321- max_band_size: m["maxBandSize"],
2322- max_font_size: m["maxFontSize"],
2323- max_opacity: m["maxOpacity"],
2324- max_size: m["maxSize"],
2325- max_stroke_width: m["maxStrokeWidth"],
2326- min_band_size: m["minBandSize"],
2327- min_font_size: m["minFontSize"],
2328- min_opacity: m["minOpacity"],
2329- min_size: m["minSize"],
2330- min_stroke_width: m["minStrokeWidth"],
2331- point_padding: m["pointPadding"],
3264+ continuous_padding: m["continuousPadding"] && decode_continuous_padding(m["continuousPadding"]),
3265+ max_band_size: m["maxBandSize"] && decode_max_band_size(m["maxBandSize"]),
3266+ max_font_size: m["maxFontSize"] && decode_max_font_size(m["maxFontSize"]),
3267+ max_opacity: m["maxOpacity"] && decode_max_opacity(m["maxOpacity"]),
3268+ max_size: m["maxSize"] && decode_max_size(m["maxSize"]),
3269+ max_stroke_width: m["maxStrokeWidth"] && decode_max_stroke_width(m["maxStrokeWidth"]),
3270+ min_band_size: m["minBandSize"] && decode_min_band_size(m["minBandSize"]),
3271+ min_font_size: m["minFontSize"] && decode_min_font_size(m["minFontSize"]),
3272+ min_opacity: m["minOpacity"] && decode_min_opacity(m["minOpacity"]),
3273+ min_size: m["minSize"] && decode_min_size(m["minSize"]),
3274+ min_stroke_width: m["minStrokeWidth"] && decode_min_stroke_width(m["minStrokeWidth"]),
3275+ point_padding: m["pointPadding"] && decode_point_padding(m["pointPadding"]),
23323276 range_step: m["rangeStep"],
23333277 round: m["round"],
2334- text_x_range_step: m["textXRangeStep"],
3278+ text_x_range_step: m["textXRangeStep"] && decode_text_x_range_step(m["textXRangeStep"]),
23353279 use_unaggregated_domain: m["useUnaggregatedDomain"],
23363280 }
23373281 end
@@ -2562,21 +3506,53 @@ defmodule BrushConfig do
25623506 def encode_fill(value) when is_binary(value), do: value
25633507 def encode_fill(_), do: {:error, "Unexpected type when encoding BrushConfig.fill"}
25643508
3509+ def decode_fill_opacity(value) when is_float(value), do: value
3510+ def decode_fill_opacity(value) when is_integer(value), do: value
3511+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding BrushConfig.fill_opacity"}
3512+
3513+ def encode_fill_opacity(value) when is_float(value), do: value
3514+ def encode_fill_opacity(value) when is_integer(value), do: value
3515+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding BrushConfig.fill_opacity"}
3516+
25653517 def decode_stroke(value) when is_binary(value), do: value
25663518 def decode_stroke(_), do: {:error, "Unexpected type when decoding BrushConfig.stroke"}
25673519
25683520 def encode_stroke(value) when is_binary(value), do: value
25693521 def encode_stroke(_), do: {:error, "Unexpected type when encoding BrushConfig.stroke"}
25703522
3523+ def decode_stroke_dash_offset(value) when is_float(value), do: value
3524+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
3525+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding BrushConfig.stroke_dash_offset"}
3526+
3527+ def encode_stroke_dash_offset(value) when is_float(value), do: value
3528+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
3529+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding BrushConfig.stroke_dash_offset"}
3530+
3531+ def decode_stroke_opacity(value) when is_float(value), do: value
3532+ def decode_stroke_opacity(value) when is_integer(value), do: value
3533+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding BrushConfig.stroke_opacity"}
3534+
3535+ def encode_stroke_opacity(value) when is_float(value), do: value
3536+ def encode_stroke_opacity(value) when is_integer(value), do: value
3537+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding BrushConfig.stroke_opacity"}
3538+
3539+ def decode_stroke_width(value) when is_float(value), do: value
3540+ def decode_stroke_width(value) when is_integer(value), do: value
3541+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding BrushConfig.stroke_width"}
3542+
3543+ def encode_stroke_width(value) when is_float(value), do: value
3544+ def encode_stroke_width(value) when is_integer(value), do: value
3545+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding BrushConfig.stroke_width"}
3546+
25713547 def from_map(m) do
25723548 %BrushConfig{
25733549 fill: m["fill"] && decode_fill(m["fill"]),
2574- fill_opacity: m["fillOpacity"],
3550+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
25753551 stroke: m["stroke"] && decode_stroke(m["stroke"]),
25763552 stroke_dash: m["strokeDash"],
2577- stroke_dash_offset: m["strokeDashOffset"],
2578- stroke_opacity: m["strokeOpacity"],
2579- stroke_width: m["strokeWidth"],
3553+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
3554+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
3555+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
25803556 }
25813557 end
25823558
@@ -2822,14 +3798,38 @@ defmodule VGBinding do
28223798 def encode_input(value) when is_binary(value), do: value
28233799 def encode_input(_), do: {:error, "Unexpected type when encoding VGBinding.input"}
28243800
3801+ def decode_max(value) when is_float(value), do: value
3802+ def decode_max(value) when is_integer(value), do: value
3803+ def decode_max(_), do: {:error, "Unexpected type when decoding VGBinding.max"}
3804+
3805+ def encode_max(value) when is_float(value), do: value
3806+ def encode_max(value) when is_integer(value), do: value
3807+ def encode_max(_), do: {:error, "Unexpected type when encoding VGBinding.max"}
3808+
3809+ def decode_min(value) when is_float(value), do: value
3810+ def decode_min(value) when is_integer(value), do: value
3811+ def decode_min(_), do: {:error, "Unexpected type when decoding VGBinding.min"}
3812+
3813+ def encode_min(value) when is_float(value), do: value
3814+ def encode_min(value) when is_integer(value), do: value
3815+ def encode_min(_), do: {:error, "Unexpected type when encoding VGBinding.min"}
3816+
3817+ def decode_step(value) when is_float(value), do: value
3818+ def decode_step(value) when is_integer(value), do: value
3819+ def decode_step(_), do: {:error, "Unexpected type when decoding VGBinding.step"}
3820+
3821+ def encode_step(value) when is_float(value), do: value
3822+ def encode_step(value) when is_integer(value), do: value
3823+ def encode_step(_), do: {:error, "Unexpected type when encoding VGBinding.step"}
3824+
28253825 def from_map(m) do
28263826 %VGBinding{
28273827 element: m["element"] && decode_element(m["element"]),
28283828 input: decode_input(m["input"]),
28293829 options: m["options"],
2830- max: m["max"],
2831- min: m["min"],
2832- step: m["step"],
3830+ max: m["max"] && decode_max(m["max"]),
3831+ min: m["min"] && decode_min(m["min"]),
3832+ step: m["step"] && decode_step(m["step"]),
28333833 }
28343834 end
28353835
@@ -3085,21 +4085,61 @@ defmodule VGMarkConfig do
30854085 theta: float() | nil
30864086 }
30874087
4088+ def decode_angle(value) when is_float(value) and value >= 0 and value <= 360, do: value
4089+ def decode_angle(value) when is_integer(value) and value >= 0 and value <= 360, do: value
4090+ def decode_angle(_), do: {:error, "Unexpected type when decoding VGMarkConfig.angle"}
4091+
4092+ def encode_angle(value) when is_float(value), do: value
4093+ def encode_angle(value) when is_integer(value), do: value
4094+ def encode_angle(_), do: {:error, "Unexpected type when encoding VGMarkConfig.angle"}
4095+
4096+ def decode_dx(value) when is_float(value), do: value
4097+ def decode_dx(value) when is_integer(value), do: value
4098+ def decode_dx(_), do: {:error, "Unexpected type when decoding VGMarkConfig.dx"}
4099+
4100+ def encode_dx(value) when is_float(value), do: value
4101+ def encode_dx(value) when is_integer(value), do: value
4102+ def encode_dx(_), do: {:error, "Unexpected type when encoding VGMarkConfig.dx"}
4103+
4104+ def decode_dy(value) when is_float(value), do: value
4105+ def decode_dy(value) when is_integer(value), do: value
4106+ def decode_dy(_), do: {:error, "Unexpected type when decoding VGMarkConfig.dy"}
4107+
4108+ def encode_dy(value) when is_float(value), do: value
4109+ def encode_dy(value) when is_integer(value), do: value
4110+ def encode_dy(_), do: {:error, "Unexpected type when encoding VGMarkConfig.dy"}
4111+
30884112 def decode_fill(value) when is_binary(value), do: value
30894113 def decode_fill(_), do: {:error, "Unexpected type when decoding VGMarkConfig.fill"}
30904114
30914115 def encode_fill(value) when is_binary(value), do: value
30924116 def encode_fill(_), do: {:error, "Unexpected type when encoding VGMarkConfig.fill"}
30934117
4118+ def decode_fill_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4119+ def decode_fill_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4120+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding VGMarkConfig.fill_opacity"}
4121+
4122+ def encode_fill_opacity(value) when is_float(value), do: value
4123+ def encode_fill_opacity(value) when is_integer(value), do: value
4124+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding VGMarkConfig.fill_opacity"}
4125+
30944126 def decode_font(value) when is_binary(value), do: value
30954127 def decode_font(_), do: {:error, "Unexpected type when decoding VGMarkConfig.font"}
30964128
30974129 def encode_font(value) when is_binary(value), do: value
30984130 def encode_font(_), do: {:error, "Unexpected type when encoding VGMarkConfig.font"}
30994131
4132+ def decode_font_size(value) when is_float(value) and value >= 0, do: value
4133+ def decode_font_size(value) when is_integer(value) and value >= 0, do: value
4134+ def decode_font_size(_), do: {:error, "Unexpected type when decoding VGMarkConfig.font_size"}
4135+
4136+ def encode_font_size(value) when is_float(value), do: value
4137+ def encode_font_size(value) when is_integer(value), do: value
4138+ def encode_font_size(_), do: {:error, "Unexpected type when encoding VGMarkConfig.font_size"}
4139+
31004140 def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
3101- def decode_font_weight(value) when is_float(value), do: value
3102- def decode_font_weight(value) when is_integer(value), do: value
4141+ def decode_font_weight(value) when is_float(value) and value >= 100 and value <= 900, do: value
4142+ def decode_font_weight(value) when is_integer(value) and value >= 100 and value <= 900, do: value
31034143 def decode_font_weight(value) when is_nil(value), do: value
31044144 def decode_font_weight(_), do: {:error, "Unexpected type when decoding VGMarkConfig.font_weight"}
31054145
@@ -3115,54 +4155,126 @@ defmodule VGMarkConfig do
31154155 def encode_href(value) when is_binary(value), do: value
31164156 def encode_href(_), do: {:error, "Unexpected type when encoding VGMarkConfig.href"}
31174157
4158+ def decode_limit(value) when is_float(value), do: value
4159+ def decode_limit(value) when is_integer(value), do: value
4160+ def decode_limit(_), do: {:error, "Unexpected type when decoding VGMarkConfig.limit"}
4161+
4162+ def encode_limit(value) when is_float(value), do: value
4163+ def encode_limit(value) when is_integer(value), do: value
4164+ def encode_limit(_), do: {:error, "Unexpected type when encoding VGMarkConfig.limit"}
4165+
4166+ def decode_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4167+ def decode_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4168+ def decode_opacity(_), do: {:error, "Unexpected type when decoding VGMarkConfig.opacity"}
4169+
4170+ def encode_opacity(value) when is_float(value), do: value
4171+ def encode_opacity(value) when is_integer(value), do: value
4172+ def encode_opacity(_), do: {:error, "Unexpected type when encoding VGMarkConfig.opacity"}
4173+
4174+ def decode_radius(value) when is_float(value) and value >= 0, do: value
4175+ def decode_radius(value) when is_integer(value) and value >= 0, do: value
4176+ def decode_radius(_), do: {:error, "Unexpected type when decoding VGMarkConfig.radius"}
4177+
4178+ def encode_radius(value) when is_float(value), do: value
4179+ def encode_radius(value) when is_integer(value), do: value
4180+ def encode_radius(_), do: {:error, "Unexpected type when encoding VGMarkConfig.radius"}
4181+
31184182 def decode_shape(value) when is_binary(value), do: value
31194183 def decode_shape(_), do: {:error, "Unexpected type when decoding VGMarkConfig.shape"}
31204184
31214185 def encode_shape(value) when is_binary(value), do: value
31224186 def encode_shape(_), do: {:error, "Unexpected type when encoding VGMarkConfig.shape"}
31234187
4188+ def decode_size(value) when is_float(value) and value >= 0, do: value
4189+ def decode_size(value) when is_integer(value) and value >= 0, do: value
4190+ def decode_size(_), do: {:error, "Unexpected type when decoding VGMarkConfig.size"}
4191+
4192+ def encode_size(value) when is_float(value), do: value
4193+ def encode_size(value) when is_integer(value), do: value
4194+ def encode_size(_), do: {:error, "Unexpected type when encoding VGMarkConfig.size"}
4195+
31244196 def decode_stroke(value) when is_binary(value), do: value
31254197 def decode_stroke(_), do: {:error, "Unexpected type when decoding VGMarkConfig.stroke"}
31264198
31274199 def encode_stroke(value) when is_binary(value), do: value
31284200 def encode_stroke(_), do: {:error, "Unexpected type when encoding VGMarkConfig.stroke"}
31294201
4202+ def decode_stroke_dash_offset(value) when is_float(value), do: value
4203+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
4204+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding VGMarkConfig.stroke_dash_offset"}
4205+
4206+ def encode_stroke_dash_offset(value) when is_float(value), do: value
4207+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
4208+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding VGMarkConfig.stroke_dash_offset"}
4209+
4210+ def decode_stroke_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4211+ def decode_stroke_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4212+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding VGMarkConfig.stroke_opacity"}
4213+
4214+ def encode_stroke_opacity(value) when is_float(value), do: value
4215+ def encode_stroke_opacity(value) when is_integer(value), do: value
4216+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding VGMarkConfig.stroke_opacity"}
4217+
4218+ def decode_stroke_width(value) when is_float(value) and value >= 0, do: value
4219+ def decode_stroke_width(value) when is_integer(value) and value >= 0, do: value
4220+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding VGMarkConfig.stroke_width"}
4221+
4222+ def encode_stroke_width(value) when is_float(value), do: value
4223+ def encode_stroke_width(value) when is_integer(value), do: value
4224+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding VGMarkConfig.stroke_width"}
4225+
4226+ def decode_tension(value) when is_float(value) and value >= 0 and value <= 1, do: value
4227+ def decode_tension(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4228+ def decode_tension(_), do: {:error, "Unexpected type when decoding VGMarkConfig.tension"}
4229+
4230+ def encode_tension(value) when is_float(value), do: value
4231+ def encode_tension(value) when is_integer(value), do: value
4232+ def encode_tension(_), do: {:error, "Unexpected type when encoding VGMarkConfig.tension"}
4233+
31304234 def decode_text(value) when is_binary(value), do: value
31314235 def decode_text(_), do: {:error, "Unexpected type when decoding VGMarkConfig.text"}
31324236
31334237 def encode_text(value) when is_binary(value), do: value
31344238 def encode_text(_), do: {:error, "Unexpected type when encoding VGMarkConfig.text"}
31354239
4240+ def decode_theta(value) when is_float(value), do: value
4241+ def decode_theta(value) when is_integer(value), do: value
4242+ def decode_theta(_), do: {:error, "Unexpected type when decoding VGMarkConfig.theta"}
4243+
4244+ def encode_theta(value) when is_float(value), do: value
4245+ def encode_theta(value) when is_integer(value), do: value
4246+ def encode_theta(_), do: {:error, "Unexpected type when encoding VGMarkConfig.theta"}
4247+
31364248 def from_map(m) do
31374249 %VGMarkConfig{
31384250 align: m["align"] && HorizontalAlign.decode(m["align"]),
3139- angle: m["angle"],
4251+ angle: m["angle"] && decode_angle(m["angle"]),
31404252 baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
31414253 cursor: m["cursor"] && Cursor.decode(m["cursor"]),
3142- dx: m["dx"],
3143- dy: m["dy"],
4254+ dx: m["dx"] && decode_dx(m["dx"]),
4255+ dy: m["dy"] && decode_dy(m["dy"]),
31444256 fill: m["fill"] && decode_fill(m["fill"]),
3145- fill_opacity: m["fillOpacity"],
4257+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
31464258 font: m["font"] && decode_font(m["font"]),
3147- font_size: m["fontSize"],
4259+ font_size: m["fontSize"] && decode_font_size(m["fontSize"]),
31484260 font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
31494261 font_weight: decode_font_weight(m["fontWeight"]),
31504262 href: m["href"] && decode_href(m["href"]),
31514263 interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
3152- limit: m["limit"],
3153- opacity: m["opacity"],
4264+ limit: m["limit"] && decode_limit(m["limit"]),
4265+ opacity: m["opacity"] && decode_opacity(m["opacity"]),
31544266 orient: m["orient"] && Orient.decode(m["orient"]),
3155- radius: m["radius"],
4267+ radius: m["radius"] && decode_radius(m["radius"]),
31564268 shape: m["shape"] && decode_shape(m["shape"]),
3157- size: m["size"],
4269+ size: m["size"] && decode_size(m["size"]),
31584270 stroke: m["stroke"] && decode_stroke(m["stroke"]),
31594271 stroke_dash: m["strokeDash"],
3160- stroke_dash_offset: m["strokeDashOffset"],
3161- stroke_opacity: m["strokeOpacity"],
3162- stroke_width: m["strokeWidth"],
3163- tension: m["tension"],
4272+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
4273+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
4274+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
4275+ tension: m["tension"] && decode_tension(m["tension"]),
31644276 text: m["text"] && decode_text(m["text"]),
3165- theta: m["theta"],
4277+ theta: m["theta"] && decode_theta(m["theta"]),
31664278 }
31674279 end
31684280
@@ -3284,27 +4396,67 @@ defmodule TextConfig do
32844396 theta: float() | nil
32854397 }
32864398
4399+ def decode_angle(value) when is_float(value) and value >= 0 and value <= 360, do: value
4400+ def decode_angle(value) when is_integer(value) and value >= 0 and value <= 360, do: value
4401+ def decode_angle(_), do: {:error, "Unexpected type when decoding TextConfig.angle"}
4402+
4403+ def encode_angle(value) when is_float(value), do: value
4404+ def encode_angle(value) when is_integer(value), do: value
4405+ def encode_angle(_), do: {:error, "Unexpected type when encoding TextConfig.angle"}
4406+
32874407 def decode_color(value) when is_binary(value), do: value
32884408 def decode_color(_), do: {:error, "Unexpected type when decoding TextConfig.color"}
32894409
32904410 def encode_color(value) when is_binary(value), do: value
32914411 def encode_color(_), do: {:error, "Unexpected type when encoding TextConfig.color"}
32924412
4413+ def decode_dx(value) when is_float(value), do: value
4414+ def decode_dx(value) when is_integer(value), do: value
4415+ def decode_dx(_), do: {:error, "Unexpected type when decoding TextConfig.dx"}
4416+
4417+ def encode_dx(value) when is_float(value), do: value
4418+ def encode_dx(value) when is_integer(value), do: value
4419+ def encode_dx(_), do: {:error, "Unexpected type when encoding TextConfig.dx"}
4420+
4421+ def decode_dy(value) when is_float(value), do: value
4422+ def decode_dy(value) when is_integer(value), do: value
4423+ def decode_dy(_), do: {:error, "Unexpected type when decoding TextConfig.dy"}
4424+
4425+ def encode_dy(value) when is_float(value), do: value
4426+ def encode_dy(value) when is_integer(value), do: value
4427+ def encode_dy(_), do: {:error, "Unexpected type when encoding TextConfig.dy"}
4428+
32934429 def decode_fill(value) when is_binary(value), do: value
32944430 def decode_fill(_), do: {:error, "Unexpected type when decoding TextConfig.fill"}
32954431
32964432 def encode_fill(value) when is_binary(value), do: value
32974433 def encode_fill(_), do: {:error, "Unexpected type when encoding TextConfig.fill"}
32984434
4435+ def decode_fill_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4436+ def decode_fill_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4437+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding TextConfig.fill_opacity"}
4438+
4439+ def encode_fill_opacity(value) when is_float(value), do: value
4440+ def encode_fill_opacity(value) when is_integer(value), do: value
4441+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding TextConfig.fill_opacity"}
4442+
32994443 def decode_font(value) when is_binary(value), do: value
33004444 def decode_font(_), do: {:error, "Unexpected type when decoding TextConfig.font"}
33014445
33024446 def encode_font(value) when is_binary(value), do: value
33034447 def encode_font(_), do: {:error, "Unexpected type when encoding TextConfig.font"}
33044448
4449+ def decode_font_size(value) when is_float(value) and value >= 0, do: value
4450+ def decode_font_size(value) when is_integer(value) and value >= 0, do: value
4451+ def decode_font_size(_), do: {:error, "Unexpected type when decoding TextConfig.font_size"}
4452+
4453+ def encode_font_size(value) when is_float(value), do: value
4454+ def encode_font_size(value) when is_integer(value), do: value
4455+ def encode_font_size(_), do: {:error, "Unexpected type when encoding TextConfig.font_size"}
4456+
33054457 def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
3306- def decode_font_weight(value) when is_float(value), do: value
3307- def decode_font_weight(value) when is_integer(value), do: value
4458+ def decode_font_weight(value) when is_float(value) and value >= 100 and value <= 900, do: value
4459+ def decode_font_weight(value) when is_integer(value) and value >= 100 and value <= 900, do: value
33084460 def decode_font_weight(value) when is_nil(value), do: value
33094461 def decode_font_weight(_), do: {:error, "Unexpected type when decoding TextConfig.font_weight"}
33104462
@@ -3320,57 +4472,129 @@ defmodule TextConfig do
33204472 def encode_href(value) when is_binary(value), do: value
33214473 def encode_href(_), do: {:error, "Unexpected type when encoding TextConfig.href"}
33224474
4475+ def decode_limit(value) when is_float(value), do: value
4476+ def decode_limit(value) when is_integer(value), do: value
4477+ def decode_limit(_), do: {:error, "Unexpected type when decoding TextConfig.limit"}
4478+
4479+ def encode_limit(value) when is_float(value), do: value
4480+ def encode_limit(value) when is_integer(value), do: value
4481+ def encode_limit(_), do: {:error, "Unexpected type when encoding TextConfig.limit"}
4482+
4483+ def decode_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4484+ def decode_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4485+ def decode_opacity(_), do: {:error, "Unexpected type when decoding TextConfig.opacity"}
4486+
4487+ def encode_opacity(value) when is_float(value), do: value
4488+ def encode_opacity(value) when is_integer(value), do: value
4489+ def encode_opacity(_), do: {:error, "Unexpected type when encoding TextConfig.opacity"}
4490+
4491+ def decode_radius(value) when is_float(value) and value >= 0, do: value
4492+ def decode_radius(value) when is_integer(value) and value >= 0, do: value
4493+ def decode_radius(_), do: {:error, "Unexpected type when decoding TextConfig.radius"}
4494+
4495+ def encode_radius(value) when is_float(value), do: value
4496+ def encode_radius(value) when is_integer(value), do: value
4497+ def encode_radius(_), do: {:error, "Unexpected type when encoding TextConfig.radius"}
4498+
33234499 def decode_shape(value) when is_binary(value), do: value
33244500 def decode_shape(_), do: {:error, "Unexpected type when decoding TextConfig.shape"}
33254501
33264502 def encode_shape(value) when is_binary(value), do: value
33274503 def encode_shape(_), do: {:error, "Unexpected type when encoding TextConfig.shape"}
33284504
4505+ def decode_size(value) when is_float(value) and value >= 0, do: value
4506+ def decode_size(value) when is_integer(value) and value >= 0, do: value
4507+ def decode_size(_), do: {:error, "Unexpected type when decoding TextConfig.size"}
4508+
4509+ def encode_size(value) when is_float(value), do: value
4510+ def encode_size(value) when is_integer(value), do: value
4511+ def encode_size(_), do: {:error, "Unexpected type when encoding TextConfig.size"}
4512+
33294513 def decode_stroke(value) when is_binary(value), do: value
33304514 def decode_stroke(_), do: {:error, "Unexpected type when decoding TextConfig.stroke"}
33314515
33324516 def encode_stroke(value) when is_binary(value), do: value
33334517 def encode_stroke(_), do: {:error, "Unexpected type when encoding TextConfig.stroke"}
33344518
4519+ def decode_stroke_dash_offset(value) when is_float(value), do: value
4520+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
4521+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding TextConfig.stroke_dash_offset"}
4522+
4523+ def encode_stroke_dash_offset(value) when is_float(value), do: value
4524+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
4525+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding TextConfig.stroke_dash_offset"}
4526+
4527+ def decode_stroke_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4528+ def decode_stroke_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4529+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding TextConfig.stroke_opacity"}
4530+
4531+ def encode_stroke_opacity(value) when is_float(value), do: value
4532+ def encode_stroke_opacity(value) when is_integer(value), do: value
4533+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding TextConfig.stroke_opacity"}
4534+
4535+ def decode_stroke_width(value) when is_float(value) and value >= 0, do: value
4536+ def decode_stroke_width(value) when is_integer(value) and value >= 0, do: value
4537+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding TextConfig.stroke_width"}
4538+
4539+ def encode_stroke_width(value) when is_float(value), do: value
4540+ def encode_stroke_width(value) when is_integer(value), do: value
4541+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding TextConfig.stroke_width"}
4542+
4543+ def decode_tension(value) when is_float(value) and value >= 0 and value <= 1, do: value
4544+ def decode_tension(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4545+ def decode_tension(_), do: {:error, "Unexpected type when decoding TextConfig.tension"}
4546+
4547+ def encode_tension(value) when is_float(value), do: value
4548+ def encode_tension(value) when is_integer(value), do: value
4549+ def encode_tension(_), do: {:error, "Unexpected type when encoding TextConfig.tension"}
4550+
33354551 def decode_text(value) when is_binary(value), do: value
33364552 def decode_text(_), do: {:error, "Unexpected type when decoding TextConfig.text"}
33374553
33384554 def encode_text(value) when is_binary(value), do: value
33394555 def encode_text(_), do: {:error, "Unexpected type when encoding TextConfig.text"}
33404556
4557+ def decode_theta(value) when is_float(value), do: value
4558+ def decode_theta(value) when is_integer(value), do: value
4559+ def decode_theta(_), do: {:error, "Unexpected type when decoding TextConfig.theta"}
4560+
4561+ def encode_theta(value) when is_float(value), do: value
4562+ def encode_theta(value) when is_integer(value), do: value
4563+ def encode_theta(_), do: {:error, "Unexpected type when encoding TextConfig.theta"}
4564+
33414565 def from_map(m) do
33424566 %TextConfig{
33434567 align: m["align"] && HorizontalAlign.decode(m["align"]),
3344- angle: m["angle"],
4568+ angle: m["angle"] && decode_angle(m["angle"]),
33454569 baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
33464570 color: m["color"] && decode_color(m["color"]),
33474571 cursor: m["cursor"] && Cursor.decode(m["cursor"]),
3348- dx: m["dx"],
3349- dy: m["dy"],
4572+ dx: m["dx"] && decode_dx(m["dx"]),
4573+ dy: m["dy"] && decode_dy(m["dy"]),
33504574 fill: m["fill"] && decode_fill(m["fill"]),
33514575 filled: m["filled"],
3352- fill_opacity: m["fillOpacity"],
4576+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
33534577 font: m["font"] && decode_font(m["font"]),
3354- font_size: m["fontSize"],
4578+ font_size: m["fontSize"] && decode_font_size(m["fontSize"]),
33554579 font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
33564580 font_weight: decode_font_weight(m["fontWeight"]),
33574581 href: m["href"] && decode_href(m["href"]),
33584582 interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
3359- limit: m["limit"],
3360- opacity: m["opacity"],
4583+ limit: m["limit"] && decode_limit(m["limit"]),
4584+ opacity: m["opacity"] && decode_opacity(m["opacity"]),
33614585 orient: m["orient"] && Orient.decode(m["orient"]),
3362- radius: m["radius"],
4586+ radius: m["radius"] && decode_radius(m["radius"]),
33634587 shape: m["shape"] && decode_shape(m["shape"]),
33644588 short_time_labels: m["shortTimeLabels"],
3365- size: m["size"],
4589+ size: m["size"] && decode_size(m["size"]),
33664590 stroke: m["stroke"] && decode_stroke(m["stroke"]),
33674591 stroke_dash: m["strokeDash"],
3368- stroke_dash_offset: m["strokeDashOffset"],
3369- stroke_opacity: m["strokeOpacity"],
3370- stroke_width: m["strokeWidth"],
3371- tension: m["tension"],
4592+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
4593+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
4594+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
4595+ tension: m["tension"] && decode_tension(m["tension"]),
33724596 text: m["text"] && decode_text(m["text"]),
3373- theta: m["theta"],
4597+ theta: m["theta"] && decode_theta(m["theta"]),
33744598 }
33754599 end
33764600
@@ -3497,27 +4721,75 @@ defmodule TickConfig do
34974721 thickness: float() | nil
34984722 }
34994723
4724+ def decode_angle(value) when is_float(value) and value >= 0 and value <= 360, do: value
4725+ def decode_angle(value) when is_integer(value) and value >= 0 and value <= 360, do: value
4726+ def decode_angle(_), do: {:error, "Unexpected type when decoding TickConfig.angle"}
4727+
4728+ def encode_angle(value) when is_float(value), do: value
4729+ def encode_angle(value) when is_integer(value), do: value
4730+ def encode_angle(_), do: {:error, "Unexpected type when encoding TickConfig.angle"}
4731+
4732+ def decode_band_size(value) when is_float(value) and value >= 0, do: value
4733+ def decode_band_size(value) when is_integer(value) and value >= 0, do: value
4734+ def decode_band_size(_), do: {:error, "Unexpected type when decoding TickConfig.band_size"}
4735+
4736+ def encode_band_size(value) when is_float(value), do: value
4737+ def encode_band_size(value) when is_integer(value), do: value
4738+ def encode_band_size(_), do: {:error, "Unexpected type when encoding TickConfig.band_size"}
4739+
35004740 def decode_color(value) when is_binary(value), do: value
35014741 def decode_color(_), do: {:error, "Unexpected type when decoding TickConfig.color"}
35024742
35034743 def encode_color(value) when is_binary(value), do: value
35044744 def encode_color(_), do: {:error, "Unexpected type when encoding TickConfig.color"}
35054745
4746+ def decode_dx(value) when is_float(value), do: value
4747+ def decode_dx(value) when is_integer(value), do: value
4748+ def decode_dx(_), do: {:error, "Unexpected type when decoding TickConfig.dx"}
4749+
4750+ def encode_dx(value) when is_float(value), do: value
4751+ def encode_dx(value) when is_integer(value), do: value
4752+ def encode_dx(_), do: {:error, "Unexpected type when encoding TickConfig.dx"}
4753+
4754+ def decode_dy(value) when is_float(value), do: value
4755+ def decode_dy(value) when is_integer(value), do: value
4756+ def decode_dy(_), do: {:error, "Unexpected type when decoding TickConfig.dy"}
4757+
4758+ def encode_dy(value) when is_float(value), do: value
4759+ def encode_dy(value) when is_integer(value), do: value
4760+ def encode_dy(_), do: {:error, "Unexpected type when encoding TickConfig.dy"}
4761+
35064762 def decode_fill(value) when is_binary(value), do: value
35074763 def decode_fill(_), do: {:error, "Unexpected type when decoding TickConfig.fill"}
35084764
35094765 def encode_fill(value) when is_binary(value), do: value
35104766 def encode_fill(_), do: {:error, "Unexpected type when encoding TickConfig.fill"}
35114767
4768+ def decode_fill_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4769+ def decode_fill_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4770+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding TickConfig.fill_opacity"}
4771+
4772+ def encode_fill_opacity(value) when is_float(value), do: value
4773+ def encode_fill_opacity(value) when is_integer(value), do: value
4774+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding TickConfig.fill_opacity"}
4775+
35124776 def decode_font(value) when is_binary(value), do: value
35134777 def decode_font(_), do: {:error, "Unexpected type when decoding TickConfig.font"}
35144778
35154779 def encode_font(value) when is_binary(value), do: value
35164780 def encode_font(_), do: {:error, "Unexpected type when encoding TickConfig.font"}
35174781
4782+ def decode_font_size(value) when is_float(value) and value >= 0, do: value
4783+ def decode_font_size(value) when is_integer(value) and value >= 0, do: value
4784+ def decode_font_size(_), do: {:error, "Unexpected type when decoding TickConfig.font_size"}
4785+
4786+ def encode_font_size(value) when is_float(value), do: value
4787+ def encode_font_size(value) when is_integer(value), do: value
4788+ def encode_font_size(_), do: {:error, "Unexpected type when encoding TickConfig.font_size"}
4789+
35184790 def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
3519- def decode_font_weight(value) when is_float(value), do: value
3520- def decode_font_weight(value) when is_integer(value), do: value
4791+ def decode_font_weight(value) when is_float(value) and value >= 100 and value <= 900, do: value
4792+ def decode_font_weight(value) when is_integer(value) and value >= 100 and value <= 900, do: value
35214793 def decode_font_weight(value) when is_nil(value), do: value
35224794 def decode_font_weight(_), do: {:error, "Unexpected type when decoding TickConfig.font_weight"}
35234795
@@ -3533,58 +4805,138 @@ defmodule TickConfig do
35334805 def encode_href(value) when is_binary(value), do: value
35344806 def encode_href(_), do: {:error, "Unexpected type when encoding TickConfig.href"}
35354807
4808+ def decode_limit(value) when is_float(value), do: value
4809+ def decode_limit(value) when is_integer(value), do: value
4810+ def decode_limit(_), do: {:error, "Unexpected type when decoding TickConfig.limit"}
4811+
4812+ def encode_limit(value) when is_float(value), do: value
4813+ def encode_limit(value) when is_integer(value), do: value
4814+ def encode_limit(_), do: {:error, "Unexpected type when encoding TickConfig.limit"}
4815+
4816+ def decode_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4817+ def decode_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4818+ def decode_opacity(_), do: {:error, "Unexpected type when decoding TickConfig.opacity"}
4819+
4820+ def encode_opacity(value) when is_float(value), do: value
4821+ def encode_opacity(value) when is_integer(value), do: value
4822+ def encode_opacity(_), do: {:error, "Unexpected type when encoding TickConfig.opacity"}
4823+
4824+ def decode_radius(value) when is_float(value) and value >= 0, do: value
4825+ def decode_radius(value) when is_integer(value) and value >= 0, do: value
4826+ def decode_radius(_), do: {:error, "Unexpected type when decoding TickConfig.radius"}
4827+
4828+ def encode_radius(value) when is_float(value), do: value
4829+ def encode_radius(value) when is_integer(value), do: value
4830+ def encode_radius(_), do: {:error, "Unexpected type when encoding TickConfig.radius"}
4831+
35364832 def decode_shape(value) when is_binary(value), do: value
35374833 def decode_shape(_), do: {:error, "Unexpected type when decoding TickConfig.shape"}
35384834
35394835 def encode_shape(value) when is_binary(value), do: value
35404836 def encode_shape(_), do: {:error, "Unexpected type when encoding TickConfig.shape"}
35414837
4838+ def decode_size(value) when is_float(value) and value >= 0, do: value
4839+ def decode_size(value) when is_integer(value) and value >= 0, do: value
4840+ def decode_size(_), do: {:error, "Unexpected type when decoding TickConfig.size"}
4841+
4842+ def encode_size(value) when is_float(value), do: value
4843+ def encode_size(value) when is_integer(value), do: value
4844+ def encode_size(_), do: {:error, "Unexpected type when encoding TickConfig.size"}
4845+
35424846 def decode_stroke(value) when is_binary(value), do: value
35434847 def decode_stroke(_), do: {:error, "Unexpected type when decoding TickConfig.stroke"}
35444848
35454849 def encode_stroke(value) when is_binary(value), do: value
35464850 def encode_stroke(_), do: {:error, "Unexpected type when encoding TickConfig.stroke"}
35474851
4852+ def decode_stroke_dash_offset(value) when is_float(value), do: value
4853+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
4854+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding TickConfig.stroke_dash_offset"}
4855+
4856+ def encode_stroke_dash_offset(value) when is_float(value), do: value
4857+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
4858+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding TickConfig.stroke_dash_offset"}
4859+
4860+ def decode_stroke_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
4861+ def decode_stroke_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4862+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding TickConfig.stroke_opacity"}
4863+
4864+ def encode_stroke_opacity(value) when is_float(value), do: value
4865+ def encode_stroke_opacity(value) when is_integer(value), do: value
4866+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding TickConfig.stroke_opacity"}
4867+
4868+ def decode_stroke_width(value) when is_float(value) and value >= 0, do: value
4869+ def decode_stroke_width(value) when is_integer(value) and value >= 0, do: value
4870+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding TickConfig.stroke_width"}
4871+
4872+ def encode_stroke_width(value) when is_float(value), do: value
4873+ def encode_stroke_width(value) when is_integer(value), do: value
4874+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding TickConfig.stroke_width"}
4875+
4876+ def decode_tension(value) when is_float(value) and value >= 0 and value <= 1, do: value
4877+ def decode_tension(value) when is_integer(value) and value >= 0 and value <= 1, do: value
4878+ def decode_tension(_), do: {:error, "Unexpected type when decoding TickConfig.tension"}
4879+
4880+ def encode_tension(value) when is_float(value), do: value
4881+ def encode_tension(value) when is_integer(value), do: value
4882+ def encode_tension(_), do: {:error, "Unexpected type when encoding TickConfig.tension"}
4883+
35484884 def decode_text(value) when is_binary(value), do: value
35494885 def decode_text(_), do: {:error, "Unexpected type when decoding TickConfig.text"}
35504886
35514887 def encode_text(value) when is_binary(value), do: value
35524888 def encode_text(_), do: {:error, "Unexpected type when encoding TickConfig.text"}
35534889
4890+ def decode_theta(value) when is_float(value), do: value
4891+ def decode_theta(value) when is_integer(value), do: value
4892+ def decode_theta(_), do: {:error, "Unexpected type when decoding TickConfig.theta"}
4893+
4894+ def encode_theta(value) when is_float(value), do: value
4895+ def encode_theta(value) when is_integer(value), do: value
4896+ def encode_theta(_), do: {:error, "Unexpected type when encoding TickConfig.theta"}
4897+
4898+ def decode_thickness(value) when is_float(value) and value >= 0, do: value
4899+ def decode_thickness(value) when is_integer(value) and value >= 0, do: value
4900+ def decode_thickness(_), do: {:error, "Unexpected type when decoding TickConfig.thickness"}
4901+
4902+ def encode_thickness(value) when is_float(value), do: value
4903+ def encode_thickness(value) when is_integer(value), do: value
4904+ def encode_thickness(_), do: {:error, "Unexpected type when encoding TickConfig.thickness"}
4905+
35544906 def from_map(m) do
35554907 %TickConfig{
35564908 align: m["align"] && HorizontalAlign.decode(m["align"]),
3557- angle: m["angle"],
3558- band_size: m["bandSize"],
4909+ angle: m["angle"] && decode_angle(m["angle"]),
4910+ band_size: m["bandSize"] && decode_band_size(m["bandSize"]),
35594911 baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
35604912 color: m["color"] && decode_color(m["color"]),
35614913 cursor: m["cursor"] && Cursor.decode(m["cursor"]),
3562- dx: m["dx"],
3563- dy: m["dy"],
4914+ dx: m["dx"] && decode_dx(m["dx"]),
4915+ dy: m["dy"] && decode_dy(m["dy"]),
35644916 fill: m["fill"] && decode_fill(m["fill"]),
35654917 filled: m["filled"],
3566- fill_opacity: m["fillOpacity"],
4918+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
35674919 font: m["font"] && decode_font(m["font"]),
3568- font_size: m["fontSize"],
4920+ font_size: m["fontSize"] && decode_font_size(m["fontSize"]),
35694921 font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
35704922 font_weight: decode_font_weight(m["fontWeight"]),
35714923 href: m["href"] && decode_href(m["href"]),
35724924 interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
3573- limit: m["limit"],
3574- opacity: m["opacity"],
4925+ limit: m["limit"] && decode_limit(m["limit"]),
4926+ opacity: m["opacity"] && decode_opacity(m["opacity"]),
35754927 orient: m["orient"] && Orient.decode(m["orient"]),
3576- radius: m["radius"],
4928+ radius: m["radius"] && decode_radius(m["radius"]),
35774929 shape: m["shape"] && decode_shape(m["shape"]),
3578- size: m["size"],
4930+ size: m["size"] && decode_size(m["size"]),
35794931 stroke: m["stroke"] && decode_stroke(m["stroke"]),
35804932 stroke_dash: m["strokeDash"],
3581- stroke_dash_offset: m["strokeDashOffset"],
3582- stroke_opacity: m["strokeOpacity"],
3583- stroke_width: m["strokeWidth"],
3584- tension: m["tension"],
4933+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
4934+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
4935+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
4936+ tension: m["tension"] && decode_tension(m["tension"]),
35854937 text: m["text"] && decode_text(m["text"]),
3586- theta: m["theta"],
3587- thickness: m["thickness"],
4938+ theta: m["theta"] && decode_theta(m["theta"]),
4939+ thickness: m["thickness"] && decode_thickness(m["thickness"]),
35884940 }
35894941 end
35904942
@@ -3789,6 +5141,14 @@ defmodule VGTitleConfig do
37895141 orient: TitleOrient.t() | nil
37905142 }
37915143
5144+ def decode_angle(value) when is_float(value), do: value
5145+ def decode_angle(value) when is_integer(value), do: value
5146+ def decode_angle(_), do: {:error, "Unexpected type when decoding VGTitleConfig.angle"}
5147+
5148+ def encode_angle(value) when is_float(value), do: value
5149+ def encode_angle(value) when is_integer(value), do: value
5150+ def encode_angle(_), do: {:error, "Unexpected type when encoding VGTitleConfig.angle"}
5151+
37925152 def decode_color(value) when is_binary(value), do: value
37935153 def decode_color(_), do: {:error, "Unexpected type when decoding VGTitleConfig.color"}
37945154
@@ -3801,9 +5161,17 @@ defmodule VGTitleConfig do
38015161 def encode_font(value) when is_binary(value), do: value
38025162 def encode_font(_), do: {:error, "Unexpected type when encoding VGTitleConfig.font"}
38035163
5164+ def decode_font_size(value) when is_float(value) and value >= 0, do: value
5165+ def decode_font_size(value) when is_integer(value) and value >= 0, do: value
5166+ def decode_font_size(_), do: {:error, "Unexpected type when decoding VGTitleConfig.font_size"}
5167+
5168+ def encode_font_size(value) when is_float(value), do: value
5169+ def encode_font_size(value) when is_integer(value), do: value
5170+ def encode_font_size(_), do: {:error, "Unexpected type when encoding VGTitleConfig.font_size"}
5171+
38045172 def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
3805- def decode_font_weight(value) when is_float(value), do: value
3806- def decode_font_weight(value) when is_integer(value), do: value
5173+ def decode_font_weight(value) when is_float(value) and value >= 100 and value <= 900, do: value
5174+ def decode_font_weight(value) when is_integer(value) and value >= 100 and value <= 900, do: value
38075175 def decode_font_weight(value) when is_nil(value), do: value
38085176 def decode_font_weight(_), do: {:error, "Unexpected type when decoding VGTitleConfig.font_weight"}
38095177
@@ -3813,17 +5181,33 @@ defmodule VGTitleConfig do
38135181 def encode_font_weight(value) when is_nil(value), do: value
38145182 def encode_font_weight(_), do: {:error, "Unexpected type when encoding VGTitleConfig.font_weight"}
38155183
5184+ def decode_limit(value) when is_float(value) and value >= 0, do: value
5185+ def decode_limit(value) when is_integer(value) and value >= 0, do: value
5186+ def decode_limit(_), do: {:error, "Unexpected type when decoding VGTitleConfig.limit"}
5187+
5188+ def encode_limit(value) when is_float(value), do: value
5189+ def encode_limit(value) when is_integer(value), do: value
5190+ def encode_limit(_), do: {:error, "Unexpected type when encoding VGTitleConfig.limit"}
5191+
5192+ def decode_offset(value) when is_float(value), do: value
5193+ def decode_offset(value) when is_integer(value), do: value
5194+ def decode_offset(_), do: {:error, "Unexpected type when decoding VGTitleConfig.offset"}
5195+
5196+ def encode_offset(value) when is_float(value), do: value
5197+ def encode_offset(value) when is_integer(value), do: value
5198+ def encode_offset(_), do: {:error, "Unexpected type when encoding VGTitleConfig.offset"}
5199+
38165200 def from_map(m) do
38175201 %VGTitleConfig{
38185202 anchor: m["anchor"] && Anchor.decode(m["anchor"]),
3819- angle: m["angle"],
5203+ angle: m["angle"] && decode_angle(m["angle"]),
38205204 baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
38215205 color: m["color"] && decode_color(m["color"]),
38225206 font: m["font"] && decode_font(m["font"]),
3823- font_size: m["fontSize"],
5207+ font_size: m["fontSize"] && decode_font_size(m["fontSize"]),
38245208 font_weight: decode_font_weight(m["fontWeight"]),
3825- limit: m["limit"],
3826- offset: m["offset"],
5209+ limit: m["limit"] && decode_limit(m["limit"]),
5210+ offset: m["offset"] && decode_offset(m["offset"]),
38275211 orient: m["orient"] && TitleOrient.decode(m["orient"]),
38285212 }
38295213 end
@@ -3892,24 +5276,72 @@ defmodule ViewConfig do
38925276 def encode_fill(value) when is_binary(value), do: value
38935277 def encode_fill(_), do: {:error, "Unexpected type when encoding ViewConfig.fill"}
38945278
5279+ def decode_fill_opacity(value) when is_float(value), do: value
5280+ def decode_fill_opacity(value) when is_integer(value), do: value
5281+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding ViewConfig.fill_opacity"}
5282+
5283+ def encode_fill_opacity(value) when is_float(value), do: value
5284+ def encode_fill_opacity(value) when is_integer(value), do: value
5285+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding ViewConfig.fill_opacity"}
5286+
5287+ def decode_height(value) when is_float(value), do: value
5288+ def decode_height(value) when is_integer(value), do: value
5289+ def decode_height(_), do: {:error, "Unexpected type when decoding ViewConfig.height"}
5290+
5291+ def encode_height(value) when is_float(value), do: value
5292+ def encode_height(value) when is_integer(value), do: value
5293+ def encode_height(_), do: {:error, "Unexpected type when encoding ViewConfig.height"}
5294+
38955295 def decode_stroke(value) when is_binary(value), do: value
38965296 def decode_stroke(_), do: {:error, "Unexpected type when decoding ViewConfig.stroke"}
38975297
38985298 def encode_stroke(value) when is_binary(value), do: value
38995299 def encode_stroke(_), do: {:error, "Unexpected type when encoding ViewConfig.stroke"}
39005300
5301+ def decode_stroke_dash_offset(value) when is_float(value), do: value
5302+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
5303+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding ViewConfig.stroke_dash_offset"}
5304+
5305+ def encode_stroke_dash_offset(value) when is_float(value), do: value
5306+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
5307+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding ViewConfig.stroke_dash_offset"}
5308+
5309+ def decode_stroke_opacity(value) when is_float(value), do: value
5310+ def decode_stroke_opacity(value) when is_integer(value), do: value
5311+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding ViewConfig.stroke_opacity"}
5312+
5313+ def encode_stroke_opacity(value) when is_float(value), do: value
5314+ def encode_stroke_opacity(value) when is_integer(value), do: value
5315+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding ViewConfig.stroke_opacity"}
5316+
5317+ def decode_stroke_width(value) when is_float(value), do: value
5318+ def decode_stroke_width(value) when is_integer(value), do: value
5319+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding ViewConfig.stroke_width"}
5320+
5321+ def encode_stroke_width(value) when is_float(value), do: value
5322+ def encode_stroke_width(value) when is_integer(value), do: value
5323+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding ViewConfig.stroke_width"}
5324+
5325+ def decode_width(value) when is_float(value), do: value
5326+ def decode_width(value) when is_integer(value), do: value
5327+ def decode_width(_), do: {:error, "Unexpected type when decoding ViewConfig.width"}
5328+
5329+ def encode_width(value) when is_float(value), do: value
5330+ def encode_width(value) when is_integer(value), do: value
5331+ def encode_width(_), do: {:error, "Unexpected type when encoding ViewConfig.width"}
5332+
39015333 def from_map(m) do
39025334 %ViewConfig{
39035335 clip: m["clip"],
39045336 fill: m["fill"] && decode_fill(m["fill"]),
3905- fill_opacity: m["fillOpacity"],
3906- height: m["height"],
5337+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
5338+ height: m["height"] && decode_height(m["height"]),
39075339 stroke: m["stroke"] && decode_stroke(m["stroke"]),
39085340 stroke_dash: m["strokeDash"],
3909- stroke_dash_offset: m["strokeDashOffset"],
3910- stroke_opacity: m["strokeOpacity"],
3911- stroke_width: m["strokeWidth"],
3912- width: m["width"],
5341+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
5342+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
5343+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
5344+ width: m["width"] && decode_width(m["width"]),
39135345 }
39145346 end
39155347
@@ -4550,15 +5982,47 @@ defmodule BinParams do
45505982 steps: [float()] | nil
45515983 }
45525984
5985+ def decode_base(value) when is_float(value), do: value
5986+ def decode_base(value) when is_integer(value), do: value
5987+ def decode_base(_), do: {:error, "Unexpected type when decoding BinParams.base"}
5988+
5989+ def encode_base(value) when is_float(value), do: value
5990+ def encode_base(value) when is_integer(value), do: value
5991+ def encode_base(_), do: {:error, "Unexpected type when encoding BinParams.base"}
5992+
5993+ def decode_maxbins(value) when is_float(value) and value >= 2, do: value
5994+ def decode_maxbins(value) when is_integer(value) and value >= 2, do: value
5995+ def decode_maxbins(_), do: {:error, "Unexpected type when decoding BinParams.maxbins"}
5996+
5997+ def encode_maxbins(value) when is_float(value), do: value
5998+ def encode_maxbins(value) when is_integer(value), do: value
5999+ def encode_maxbins(_), do: {:error, "Unexpected type when encoding BinParams.maxbins"}
6000+
6001+ def decode_minstep(value) when is_float(value), do: value
6002+ def decode_minstep(value) when is_integer(value), do: value
6003+ def decode_minstep(_), do: {:error, "Unexpected type when decoding BinParams.minstep"}
6004+
6005+ def encode_minstep(value) when is_float(value), do: value
6006+ def encode_minstep(value) when is_integer(value), do: value
6007+ def encode_minstep(_), do: {:error, "Unexpected type when encoding BinParams.minstep"}
6008+
6009+ def decode_step(value) when is_float(value), do: value
6010+ def decode_step(value) when is_integer(value), do: value
6011+ def decode_step(_), do: {:error, "Unexpected type when decoding BinParams.step"}
6012+
6013+ def encode_step(value) when is_float(value), do: value
6014+ def encode_step(value) when is_integer(value), do: value
6015+ def encode_step(_), do: {:error, "Unexpected type when encoding BinParams.step"}
6016+
45536017 def from_map(m) do
45546018 %BinParams{
4555- base: m["base"],
6019+ base: m["base"] && decode_base(m["base"]),
45566020 divide: m["divide"],
45576021 extent: m["extent"],
4558- maxbins: m["maxbins"],
4559- minstep: m["minstep"],
6022+ maxbins: m["maxbins"] && decode_maxbins(m["maxbins"]),
6023+ minstep: m["minstep"] && decode_minstep(m["minstep"]),
45606024 nice: m["nice"],
4561- step: m["step"],
6025+ step: m["step"] && decode_step(m["step"]),
45626026 steps: m["steps"],
45636027 }
45646028 end
@@ -4686,18 +6150,74 @@ defmodule DateTimeClass do
46866150 year: float() | nil
46876151 }
46886152
6153+ def decode_date(value) when is_float(value) and value >= 1 and value <= 31, do: value
6154+ def decode_date(value) when is_integer(value) and value >= 1 and value <= 31, do: value
6155+ def decode_date(_), do: {:error, "Unexpected type when decoding DateTimeClass.date"}
6156+
6157+ def encode_date(value) when is_float(value), do: value
6158+ def encode_date(value) when is_integer(value), do: value
6159+ def encode_date(_), do: {:error, "Unexpected type when encoding DateTimeClass.date"}
6160+
6161+ def decode_hours(value) when is_float(value) and value >= 0 and value <= 23, do: value
6162+ def decode_hours(value) when is_integer(value) and value >= 0 and value <= 23, do: value
6163+ def decode_hours(_), do: {:error, "Unexpected type when decoding DateTimeClass.hours"}
6164+
6165+ def encode_hours(value) when is_float(value), do: value
6166+ def encode_hours(value) when is_integer(value), do: value
6167+ def encode_hours(_), do: {:error, "Unexpected type when encoding DateTimeClass.hours"}
6168+
6169+ def decode_milliseconds(value) when is_float(value) and value >= 0 and value <= 999, do: value
6170+ def decode_milliseconds(value) when is_integer(value) and value >= 0 and value <= 999, do: value
6171+ def decode_milliseconds(_), do: {:error, "Unexpected type when decoding DateTimeClass.milliseconds"}
6172+
6173+ def encode_milliseconds(value) when is_float(value), do: value
6174+ def encode_milliseconds(value) when is_integer(value), do: value
6175+ def encode_milliseconds(_), do: {:error, "Unexpected type when encoding DateTimeClass.milliseconds"}
6176+
6177+ def decode_minutes(value) when is_float(value) and value >= 0 and value <= 59, do: value
6178+ def decode_minutes(value) when is_integer(value) and value >= 0 and value <= 59, do: value
6179+ def decode_minutes(_), do: {:error, "Unexpected type when decoding DateTimeClass.minutes"}
6180+
6181+ def encode_minutes(value) when is_float(value), do: value
6182+ def encode_minutes(value) when is_integer(value), do: value
6183+ def encode_minutes(_), do: {:error, "Unexpected type when encoding DateTimeClass.minutes"}
6184+
6185+ def decode_quarter(value) when is_float(value) and value >= 1 and value <= 4, do: value
6186+ def decode_quarter(value) when is_integer(value) and value >= 1 and value <= 4, do: value
6187+ def decode_quarter(_), do: {:error, "Unexpected type when decoding DateTimeClass.quarter"}
6188+
6189+ def encode_quarter(value) when is_float(value), do: value
6190+ def encode_quarter(value) when is_integer(value), do: value
6191+ def encode_quarter(_), do: {:error, "Unexpected type when encoding DateTimeClass.quarter"}
6192+
6193+ def decode_seconds(value) when is_float(value) and value >= 0 and value <= 59, do: value
6194+ def decode_seconds(value) when is_integer(value) and value >= 0 and value <= 59, do: value
6195+ def decode_seconds(_), do: {:error, "Unexpected type when decoding DateTimeClass.seconds"}
6196+
6197+ def encode_seconds(value) when is_float(value), do: value
6198+ def encode_seconds(value) when is_integer(value), do: value
6199+ def encode_seconds(_), do: {:error, "Unexpected type when encoding DateTimeClass.seconds"}
6200+
6201+ def decode_year(value) when is_float(value), do: value
6202+ def decode_year(value) when is_integer(value), do: value
6203+ def decode_year(_), do: {:error, "Unexpected type when decoding DateTimeClass.year"}
6204+
6205+ def encode_year(value) when is_float(value), do: value
6206+ def encode_year(value) when is_integer(value), do: value
6207+ def encode_year(_), do: {:error, "Unexpected type when encoding DateTimeClass.year"}
6208+
46896209 def from_map(m) do
46906210 %DateTimeClass{
4691- date: m["date"],
6211+ date: m["date"] && decode_date(m["date"]),
46926212 day: m["day"],
4693- hours: m["hours"],
4694- milliseconds: m["milliseconds"],
4695- minutes: m["minutes"],
6213+ hours: m["hours"] && decode_hours(m["hours"]),
6214+ milliseconds: m["milliseconds"] && decode_milliseconds(m["milliseconds"]),
6215+ minutes: m["minutes"] && decode_minutes(m["minutes"]),
46966216 month: m["month"],
4697- quarter: m["quarter"],
4698- seconds: m["seconds"],
6217+ quarter: m["quarter"] && decode_quarter(m["quarter"]),
6218+ seconds: m["seconds"] && decode_seconds(m["seconds"]),
46996219 utc: m["utc"],
4700- year: m["year"],
6220+ year: m["year"] && decode_year(m["year"]),
47016221 }
47026222 end
47036223
@@ -5208,12 +6728,44 @@ defmodule Legend do
52086728 zindex: float() | nil
52096729 }
52106730
6731+ def decode_entry_padding(value) when is_float(value), do: value
6732+ def decode_entry_padding(value) when is_integer(value), do: value
6733+ def decode_entry_padding(_), do: {:error, "Unexpected type when decoding Legend.entry_padding"}
6734+
6735+ def encode_entry_padding(value) when is_float(value), do: value
6736+ def encode_entry_padding(value) when is_integer(value), do: value
6737+ def encode_entry_padding(_), do: {:error, "Unexpected type when encoding Legend.entry_padding"}
6738+
52116739 def decode_format(value) when is_binary(value), do: value
52126740 def decode_format(_), do: {:error, "Unexpected type when decoding Legend.format"}
52136741
52146742 def encode_format(value) when is_binary(value), do: value
52156743 def encode_format(_), do: {:error, "Unexpected type when encoding Legend.format"}
52166744
6745+ def decode_offset(value) when is_float(value), do: value
6746+ def decode_offset(value) when is_integer(value), do: value
6747+ def decode_offset(_), do: {:error, "Unexpected type when decoding Legend.offset"}
6748+
6749+ def encode_offset(value) when is_float(value), do: value
6750+ def encode_offset(value) when is_integer(value), do: value
6751+ def encode_offset(_), do: {:error, "Unexpected type when encoding Legend.offset"}
6752+
6753+ def decode_padding(value) when is_float(value), do: value
6754+ def decode_padding(value) when is_integer(value), do: value
6755+ def decode_padding(_), do: {:error, "Unexpected type when decoding Legend.padding"}
6756+
6757+ def encode_padding(value) when is_float(value), do: value
6758+ def encode_padding(value) when is_integer(value), do: value
6759+ def encode_padding(_), do: {:error, "Unexpected type when encoding Legend.padding"}
6760+
6761+ def decode_tick_count(value) when is_float(value), do: value
6762+ def decode_tick_count(value) when is_integer(value), do: value
6763+ def decode_tick_count(_), do: {:error, "Unexpected type when decoding Legend.tick_count"}
6764+
6765+ def encode_tick_count(value) when is_float(value), do: value
6766+ def encode_tick_count(value) when is_integer(value), do: value
6767+ def encode_tick_count(_), do: {:error, "Unexpected type when encoding Legend.tick_count"}
6768+
52176769 def decode_values_element(%{} = value), do: DateTimeClass.from_map(value)
52186770 def decode_values_element(value) when is_float(value), do: value
52196771 def decode_values_element(value) when is_integer(value), do: value
@@ -5226,18 +6778,26 @@ defmodule Legend do
52266778 def encode_values_element(value) when is_binary(value), do: value
52276779 def encode_values_element(_), do: {:error, "Unexpected type when encoding Legend.values"}
52286780
6781+ def decode_zindex(value) when is_float(value) and value >= 0, do: value
6782+ def decode_zindex(value) when is_integer(value) and value >= 0, do: value
6783+ def decode_zindex(_), do: {:error, "Unexpected type when decoding Legend.zindex"}
6784+
6785+ def encode_zindex(value) when is_float(value), do: value
6786+ def encode_zindex(value) when is_integer(value), do: value
6787+ def encode_zindex(_), do: {:error, "Unexpected type when encoding Legend.zindex"}
6788+
52296789 def from_map(m) do
52306790 %Legend{
5231- entry_padding: m["entryPadding"],
6791+ entry_padding: m["entryPadding"] && decode_entry_padding(m["entryPadding"]),
52326792 format: m["format"] && decode_format(m["format"]),
5233- offset: m["offset"],
6793+ offset: m["offset"] && decode_offset(m["offset"]),
52346794 orient: m["orient"] && LegendOrient.decode(m["orient"]),
5235- padding: m["padding"],
5236- tick_count: m["tickCount"],
6795+ padding: m["padding"] && decode_padding(m["padding"]),
6796+ tick_count: m["tickCount"] && decode_tick_count(m["tickCount"]),
52376797 title: m["title"],
52386798 type: m["type"] && LegendType.decode(m["type"]),
52396799 values: m["values"] && Enum.map(m["values"], &decode_values_element/1),
5240- zindex: m["zindex"],
6800+ zindex: m["zindex"] && decode_zindex(m["zindex"]),
52416801 }
52426802 end
52436803
@@ -5433,9 +6993,17 @@ defmodule InterpolateParams do
54336993 type: InterpolateParamsType.t()
54346994 }
54356995
6996+ def decode_gamma(value) when is_float(value), do: value
6997+ def decode_gamma(value) when is_integer(value), do: value
6998+ def decode_gamma(_), do: {:error, "Unexpected type when decoding InterpolateParams.gamma"}
6999+
7000+ def encode_gamma(value) when is_float(value), do: value
7001+ def encode_gamma(value) when is_integer(value), do: value
7002+ def encode_gamma(_), do: {:error, "Unexpected type when encoding InterpolateParams.gamma"}
7003+
54367004 def from_map(m) do
54377005 %InterpolateParams{
5438- gamma: m["gamma"],
7006+ gamma: m["gamma"] && decode_gamma(m["gamma"]),
54397007 type: InterpolateParamsType.decode(m["type"]),
54407008 }
54417009 end
@@ -5726,6 +7294,14 @@ defmodule Scale do
57267294 zero: boolean() | nil
57277295 }
57287296
7297+ def decode_base(value) when is_float(value), do: value
7298+ def decode_base(value) when is_integer(value), do: value
7299+ def decode_base(_), do: {:error, "Unexpected type when decoding Scale.base"}
7300+
7301+ def encode_base(value) when is_float(value), do: value
7302+ def encode_base(value) when is_integer(value), do: value
7303+ def encode_base(_), do: {:error, "Unexpected type when encoding Scale.base"}
7304+
57297305 def decode_domain(%{"selection" => _,} = value), do: DomainClass.from_map(value)
57307306 def decode_domain(value) when is_binary(value), do: Domain.decode(value)
57317307 def decode_domain(value) when is_list(value), do: value
@@ -5738,6 +7314,14 @@ defmodule Scale do
57387314 def encode_domain(value) when is_nil(value), do: value
57397315 def encode_domain(_), do: {:error, "Unexpected type when encoding Scale.domain"}
57407316
7317+ def decode_exponent(value) when is_float(value), do: value
7318+ def decode_exponent(value) when is_integer(value), do: value
7319+ def decode_exponent(_), do: {:error, "Unexpected type when decoding Scale.exponent"}
7320+
7321+ def encode_exponent(value) when is_float(value), do: value
7322+ def encode_exponent(value) when is_integer(value), do: value
7323+ def encode_exponent(_), do: {:error, "Unexpected type when encoding Scale.exponent"}
7324+
57417325 def decode_interpolate(%{"type" => _,} = value), do: InterpolateParams.from_map(value)
57427326 def decode_interpolate(value) when is_binary(value), do: Interpolate.decode(value)
57437327 def decode_interpolate(value) when is_nil(value), do: value
@@ -5764,6 +7348,30 @@ defmodule Scale do
57647348 def encode_nice(value) when is_nil(value), do: value
57657349 def encode_nice(_), do: {:error, "Unexpected type when encoding Scale.nice"}
57667350
7351+ def decode_padding(value) when is_float(value) and value >= 0, do: value
7352+ def decode_padding(value) when is_integer(value) and value >= 0, do: value
7353+ def decode_padding(_), do: {:error, "Unexpected type when decoding Scale.padding"}
7354+
7355+ def encode_padding(value) when is_float(value), do: value
7356+ def encode_padding(value) when is_integer(value), do: value
7357+ def encode_padding(_), do: {:error, "Unexpected type when encoding Scale.padding"}
7358+
7359+ def decode_padding_inner(value) when is_float(value) and value >= 0 and value <= 1, do: value
7360+ def decode_padding_inner(value) when is_integer(value) and value >= 0 and value <= 1, do: value
7361+ def decode_padding_inner(_), do: {:error, "Unexpected type when decoding Scale.padding_inner"}
7362+
7363+ def encode_padding_inner(value) when is_float(value), do: value
7364+ def encode_padding_inner(value) when is_integer(value), do: value
7365+ def encode_padding_inner(_), do: {:error, "Unexpected type when encoding Scale.padding_inner"}
7366+
7367+ def decode_padding_outer(value) when is_float(value) and value >= 0 and value <= 1, do: value
7368+ def decode_padding_outer(value) when is_integer(value) and value >= 0 and value <= 1, do: value
7369+ def decode_padding_outer(_), do: {:error, "Unexpected type when decoding Scale.padding_outer"}
7370+
7371+ def encode_padding_outer(value) when is_float(value), do: value
7372+ def encode_padding_outer(value) when is_integer(value), do: value
7373+ def encode_padding_outer(_), do: {:error, "Unexpected type when encoding Scale.padding_outer"}
7374+
57677375 def decode_range(value) when is_binary(value), do: value
57687376 def decode_range(value) when is_list(value), do: value
57697377 def decode_range(value) when is_nil(value), do: value
@@ -5786,15 +7394,15 @@ defmodule Scale do
57867394
57877395 def from_map(m) do
57887396 %Scale{
5789- base: m["base"],
7397+ base: m["base"] && decode_base(m["base"]),
57907398 clamp: m["clamp"],
57917399 domain: decode_domain(m["domain"]),
5792- exponent: m["exponent"],
7400+ exponent: m["exponent"] && decode_exponent(m["exponent"]),
57937401 interpolate: decode_interpolate(m["interpolate"]),
57947402 nice: decode_nice(m["nice"]),
5795- padding: m["padding"],
5796- padding_inner: m["paddingInner"],
5797- padding_outer: m["paddingOuter"],
7403+ padding: m["padding"] && decode_padding(m["padding"]),
7404+ padding_inner: m["paddingInner"] && decode_padding_inner(m["paddingInner"]),
7405+ padding_outer: m["paddingOuter"] && decode_padding_outer(m["paddingOuter"]),
57987406 range: decode_range(m["range"]),
57997407 range_step: m["rangeStep"],
58007408 round: m["round"],
@@ -6300,10 +7908,18 @@ defmodule Header do
63007908 def encode_format(value) when is_binary(value), do: value
63017909 def encode_format(_), do: {:error, "Unexpected type when encoding Header.format"}
63027910
7911+ def decode_label_angle(value) when is_float(value) and value >= -360 and value <= 360, do: value
7912+ def decode_label_angle(value) when is_integer(value) and value >= -360 and value <= 360, do: value
7913+ def decode_label_angle(_), do: {:error, "Unexpected type when decoding Header.label_angle"}
7914+
7915+ def encode_label_angle(value) when is_float(value), do: value
7916+ def encode_label_angle(value) when is_integer(value), do: value
7917+ def encode_label_angle(_), do: {:error, "Unexpected type when encoding Header.label_angle"}
7918+
63037919 def from_map(m) do
63047920 %Header{
63057921 format: m["format"] && decode_format(m["format"]),
6306- label_angle: m["labelAngle"],
7922+ label_angle: m["labelAngle"] && decode_label_angle(m["labelAngle"]),
63077923 title: m["title"],
63087924 }
63097925 end
@@ -7059,6 +8675,14 @@ defmodule Axis do
70598675 def encode_format(value) when is_binary(value), do: value
70608676 def encode_format(_), do: {:error, "Unexpected type when encoding Axis.format"}
70618677
8678+ def decode_label_angle(value) when is_float(value) and value >= -360 and value <= 360, do: value
8679+ def decode_label_angle(value) when is_integer(value) and value >= -360 and value <= 360, do: value
8680+ def decode_label_angle(_), do: {:error, "Unexpected type when decoding Axis.label_angle"}
8681+
8682+ def encode_label_angle(value) when is_float(value), do: value
8683+ def encode_label_angle(value) when is_integer(value), do: value
8684+ def encode_label_angle(_), do: {:error, "Unexpected type when encoding Axis.label_angle"}
8685+
70628686 def decode_label_overlap(value) when is_boolean(value), do: value
70638687 def decode_label_overlap(value) when is_binary(value), do: LabelOverlapEnum.decode(value)
70648688 def decode_label_overlap(value) when is_nil(value), do: value
@@ -7069,6 +8693,78 @@ defmodule Axis do
70698693 def encode_label_overlap(value) when is_nil(value), do: value
70708694 def encode_label_overlap(_), do: {:error, "Unexpected type when encoding Axis.label_overlap"}
70718695
8696+ def decode_label_padding(value) when is_float(value), do: value
8697+ def decode_label_padding(value) when is_integer(value), do: value
8698+ def decode_label_padding(_), do: {:error, "Unexpected type when decoding Axis.label_padding"}
8699+
8700+ def encode_label_padding(value) when is_float(value), do: value
8701+ def encode_label_padding(value) when is_integer(value), do: value
8702+ def encode_label_padding(_), do: {:error, "Unexpected type when encoding Axis.label_padding"}
8703+
8704+ def decode_max_extent(value) when is_float(value), do: value
8705+ def decode_max_extent(value) when is_integer(value), do: value
8706+ def decode_max_extent(_), do: {:error, "Unexpected type when decoding Axis.max_extent"}
8707+
8708+ def encode_max_extent(value) when is_float(value), do: value
8709+ def encode_max_extent(value) when is_integer(value), do: value
8710+ def encode_max_extent(_), do: {:error, "Unexpected type when encoding Axis.max_extent"}
8711+
8712+ def decode_min_extent(value) when is_float(value), do: value
8713+ def decode_min_extent(value) when is_integer(value), do: value
8714+ def decode_min_extent(_), do: {:error, "Unexpected type when decoding Axis.min_extent"}
8715+
8716+ def encode_min_extent(value) when is_float(value), do: value
8717+ def encode_min_extent(value) when is_integer(value), do: value
8718+ def encode_min_extent(_), do: {:error, "Unexpected type when encoding Axis.min_extent"}
8719+
8720+ def decode_offset(value) when is_float(value), do: value
8721+ def decode_offset(value) when is_integer(value), do: value
8722+ def decode_offset(_), do: {:error, "Unexpected type when decoding Axis.offset"}
8723+
8724+ def encode_offset(value) when is_float(value), do: value
8725+ def encode_offset(value) when is_integer(value), do: value
8726+ def encode_offset(_), do: {:error, "Unexpected type when encoding Axis.offset"}
8727+
8728+ def decode_position(value) when is_float(value), do: value
8729+ def decode_position(value) when is_integer(value), do: value
8730+ def decode_position(_), do: {:error, "Unexpected type when decoding Axis.position"}
8731+
8732+ def encode_position(value) when is_float(value), do: value
8733+ def encode_position(value) when is_integer(value), do: value
8734+ def encode_position(_), do: {:error, "Unexpected type when encoding Axis.position"}
8735+
8736+ def decode_tick_count(value) when is_float(value), do: value
8737+ def decode_tick_count(value) when is_integer(value), do: value
8738+ def decode_tick_count(_), do: {:error, "Unexpected type when decoding Axis.tick_count"}
8739+
8740+ def encode_tick_count(value) when is_float(value), do: value
8741+ def encode_tick_count(value) when is_integer(value), do: value
8742+ def encode_tick_count(_), do: {:error, "Unexpected type when encoding Axis.tick_count"}
8743+
8744+ def decode_tick_size(value) when is_float(value) and value >= 0, do: value
8745+ def decode_tick_size(value) when is_integer(value) and value >= 0, do: value
8746+ def decode_tick_size(_), do: {:error, "Unexpected type when decoding Axis.tick_size"}
8747+
8748+ def encode_tick_size(value) when is_float(value), do: value
8749+ def encode_tick_size(value) when is_integer(value), do: value
8750+ def encode_tick_size(_), do: {:error, "Unexpected type when encoding Axis.tick_size"}
8751+
8752+ def decode_title_max_length(value) when is_float(value), do: value
8753+ def decode_title_max_length(value) when is_integer(value), do: value
8754+ def decode_title_max_length(_), do: {:error, "Unexpected type when decoding Axis.title_max_length"}
8755+
8756+ def encode_title_max_length(value) when is_float(value), do: value
8757+ def encode_title_max_length(value) when is_integer(value), do: value
8758+ def encode_title_max_length(_), do: {:error, "Unexpected type when encoding Axis.title_max_length"}
8759+
8760+ def decode_title_padding(value) when is_float(value), do: value
8761+ def decode_title_padding(value) when is_integer(value), do: value
8762+ def decode_title_padding(_), do: {:error, "Unexpected type when decoding Axis.title_padding"}
8763+
8764+ def encode_title_padding(value) when is_float(value), do: value
8765+ def encode_title_padding(value) when is_integer(value), do: value
8766+ def encode_title_padding(_), do: {:error, "Unexpected type when encoding Axis.title_padding"}
8767+
70728768 def decode_values_element(%{} = value), do: DateTimeClass.from_map(value)
70738769 def decode_values_element(value) when is_float(value), do: value
70748770 def decode_values_element(value) when is_integer(value), do: value
@@ -7079,30 +8775,38 @@ defmodule Axis do
70798775 def encode_values_element(value) when is_integer(value), do: value
70808776 def encode_values_element(_), do: {:error, "Unexpected type when encoding Axis.values"}
70818777
8778+ def decode_zindex(value) when is_float(value) and value >= 0, do: value
8779+ def decode_zindex(value) when is_integer(value) and value >= 0, do: value
8780+ def decode_zindex(_), do: {:error, "Unexpected type when decoding Axis.zindex"}
8781+
8782+ def encode_zindex(value) when is_float(value), do: value
8783+ def encode_zindex(value) when is_integer(value), do: value
8784+ def encode_zindex(_), do: {:error, "Unexpected type when encoding Axis.zindex"}
8785+
70828786 def from_map(m) do
70838787 %Axis{
70848788 domain: m["domain"],
70858789 format: m["format"] && decode_format(m["format"]),
70868790 grid: m["grid"],
7087- label_angle: m["labelAngle"],
8791+ label_angle: m["labelAngle"] && decode_label_angle(m["labelAngle"]),
70888792 label_bound: m["labelBound"],
70898793 label_flush: m["labelFlush"],
70908794 label_overlap: decode_label_overlap(m["labelOverlap"]),
7091- label_padding: m["labelPadding"],
8795+ label_padding: m["labelPadding"] && decode_label_padding(m["labelPadding"]),
70928796 labels: m["labels"],
7093- max_extent: m["maxExtent"],
7094- min_extent: m["minExtent"],
7095- offset: m["offset"],
8797+ max_extent: m["maxExtent"] && decode_max_extent(m["maxExtent"]),
8798+ min_extent: m["minExtent"] && decode_min_extent(m["minExtent"]),
8799+ offset: m["offset"] && decode_offset(m["offset"]),
70968800 orient: m["orient"] && TitleOrient.decode(m["orient"]),
7097- position: m["position"],
7098- tick_count: m["tickCount"],
8801+ position: m["position"] && decode_position(m["position"]),
8802+ tick_count: m["tickCount"] && decode_tick_count(m["tickCount"]),
70998803 ticks: m["ticks"],
7100- tick_size: m["tickSize"],
8804+ tick_size: m["tickSize"] && decode_tick_size(m["tickSize"]),
71018805 title: m["title"],
7102- title_max_length: m["titleMaxLength"],
7103- title_padding: m["titlePadding"],
8806+ title_max_length: m["titleMaxLength"] && decode_title_max_length(m["titleMaxLength"]),
8807+ title_padding: m["titlePadding"] && decode_title_padding(m["titlePadding"]),
71048808 values: m["values"] && Enum.map(m["values"], &decode_values_element/1),
7105- zindex: m["zindex"],
8809+ zindex: m["zindex"] && decode_zindex(m["zindex"]),
71068810 }
71078811 end
71088812
@@ -7734,27 +9438,67 @@ defmodule MarkDef do
77349438 type: Mark.t()
77359439 }
77369440
9441+ def decode_angle(value) when is_float(value) and value >= 0 and value <= 360, do: value
9442+ def decode_angle(value) when is_integer(value) and value >= 0 and value <= 360, do: value
9443+ def decode_angle(_), do: {:error, "Unexpected type when decoding MarkDef.angle"}
9444+
9445+ def encode_angle(value) when is_float(value), do: value
9446+ def encode_angle(value) when is_integer(value), do: value
9447+ def encode_angle(_), do: {:error, "Unexpected type when encoding MarkDef.angle"}
9448+
77379449 def decode_color(value) when is_binary(value), do: value
77389450 def decode_color(_), do: {:error, "Unexpected type when decoding MarkDef.color"}
77399451
77409452 def encode_color(value) when is_binary(value), do: value
77419453 def encode_color(_), do: {:error, "Unexpected type when encoding MarkDef.color"}
77429454
9455+ def decode_dx(value) when is_float(value), do: value
9456+ def decode_dx(value) when is_integer(value), do: value
9457+ def decode_dx(_), do: {:error, "Unexpected type when decoding MarkDef.dx"}
9458+
9459+ def encode_dx(value) when is_float(value), do: value
9460+ def encode_dx(value) when is_integer(value), do: value
9461+ def encode_dx(_), do: {:error, "Unexpected type when encoding MarkDef.dx"}
9462+
9463+ def decode_dy(value) when is_float(value), do: value
9464+ def decode_dy(value) when is_integer(value), do: value
9465+ def decode_dy(_), do: {:error, "Unexpected type when decoding MarkDef.dy"}
9466+
9467+ def encode_dy(value) when is_float(value), do: value
9468+ def encode_dy(value) when is_integer(value), do: value
9469+ def encode_dy(_), do: {:error, "Unexpected type when encoding MarkDef.dy"}
9470+
77439471 def decode_fill(value) when is_binary(value), do: value
77449472 def decode_fill(_), do: {:error, "Unexpected type when decoding MarkDef.fill"}
77459473
77469474 def encode_fill(value) when is_binary(value), do: value
77479475 def encode_fill(_), do: {:error, "Unexpected type when encoding MarkDef.fill"}
77489476
9477+ def decode_fill_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
9478+ def decode_fill_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
9479+ def decode_fill_opacity(_), do: {:error, "Unexpected type when decoding MarkDef.fill_opacity"}
9480+
9481+ def encode_fill_opacity(value) when is_float(value), do: value
9482+ def encode_fill_opacity(value) when is_integer(value), do: value
9483+ def encode_fill_opacity(_), do: {:error, "Unexpected type when encoding MarkDef.fill_opacity"}
9484+
77499485 def decode_font(value) when is_binary(value), do: value
77509486 def decode_font(_), do: {:error, "Unexpected type when decoding MarkDef.font"}
77519487
77529488 def encode_font(value) when is_binary(value), do: value
77539489 def encode_font(_), do: {:error, "Unexpected type when encoding MarkDef.font"}
77549490
9491+ def decode_font_size(value) when is_float(value) and value >= 0, do: value
9492+ def decode_font_size(value) when is_integer(value) and value >= 0, do: value
9493+ def decode_font_size(_), do: {:error, "Unexpected type when decoding MarkDef.font_size"}
9494+
9495+ def encode_font_size(value) when is_float(value), do: value
9496+ def encode_font_size(value) when is_integer(value), do: value
9497+ def encode_font_size(_), do: {:error, "Unexpected type when encoding MarkDef.font_size"}
9498+
77559499 def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
7756- def decode_font_weight(value) when is_float(value), do: value
7757- def decode_font_weight(value) when is_integer(value), do: value
9500+ def decode_font_weight(value) when is_float(value) and value >= 100 and value <= 900, do: value
9501+ def decode_font_weight(value) when is_integer(value) and value >= 100 and value <= 900, do: value
77589502 def decode_font_weight(value) when is_nil(value), do: value
77599503 def decode_font_weight(_), do: {:error, "Unexpected type when decoding MarkDef.font_weight"}
77609504
@@ -7770,18 +9514,74 @@ defmodule MarkDef do
77709514 def encode_href(value) when is_binary(value), do: value
77719515 def encode_href(_), do: {:error, "Unexpected type when encoding MarkDef.href"}
77729516
9517+ def decode_limit(value) when is_float(value), do: value
9518+ def decode_limit(value) when is_integer(value), do: value
9519+ def decode_limit(_), do: {:error, "Unexpected type when decoding MarkDef.limit"}
9520+
9521+ def encode_limit(value) when is_float(value), do: value
9522+ def encode_limit(value) when is_integer(value), do: value
9523+ def encode_limit(_), do: {:error, "Unexpected type when encoding MarkDef.limit"}
9524+
9525+ def decode_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
9526+ def decode_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
9527+ def decode_opacity(_), do: {:error, "Unexpected type when decoding MarkDef.opacity"}
9528+
9529+ def encode_opacity(value) when is_float(value), do: value
9530+ def encode_opacity(value) when is_integer(value), do: value
9531+ def encode_opacity(_), do: {:error, "Unexpected type when encoding MarkDef.opacity"}
9532+
9533+ def decode_radius(value) when is_float(value) and value >= 0, do: value
9534+ def decode_radius(value) when is_integer(value) and value >= 0, do: value
9535+ def decode_radius(_), do: {:error, "Unexpected type when decoding MarkDef.radius"}
9536+
9537+ def encode_radius(value) when is_float(value), do: value
9538+ def encode_radius(value) when is_integer(value), do: value
9539+ def encode_radius(_), do: {:error, "Unexpected type when encoding MarkDef.radius"}
9540+
77739541 def decode_shape(value) when is_binary(value), do: value
77749542 def decode_shape(_), do: {:error, "Unexpected type when decoding MarkDef.shape"}
77759543
77769544 def encode_shape(value) when is_binary(value), do: value
77779545 def encode_shape(_), do: {:error, "Unexpected type when encoding MarkDef.shape"}
77789546
9547+ def decode_size(value) when is_float(value) and value >= 0, do: value
9548+ def decode_size(value) when is_integer(value) and value >= 0, do: value
9549+ def decode_size(_), do: {:error, "Unexpected type when decoding MarkDef.size"}
9550+
9551+ def encode_size(value) when is_float(value), do: value
9552+ def encode_size(value) when is_integer(value), do: value
9553+ def encode_size(_), do: {:error, "Unexpected type when encoding MarkDef.size"}
9554+
77799555 def decode_stroke(value) when is_binary(value), do: value
77809556 def decode_stroke(_), do: {:error, "Unexpected type when decoding MarkDef.stroke"}
77819557
77829558 def encode_stroke(value) when is_binary(value), do: value
77839559 def encode_stroke(_), do: {:error, "Unexpected type when encoding MarkDef.stroke"}
77849560
9561+ def decode_stroke_dash_offset(value) when is_float(value), do: value
9562+ def decode_stroke_dash_offset(value) when is_integer(value), do: value
9563+ def decode_stroke_dash_offset(_), do: {:error, "Unexpected type when decoding MarkDef.stroke_dash_offset"}
9564+
9565+ def encode_stroke_dash_offset(value) when is_float(value), do: value
9566+ def encode_stroke_dash_offset(value) when is_integer(value), do: value
9567+ def encode_stroke_dash_offset(_), do: {:error, "Unexpected type when encoding MarkDef.stroke_dash_offset"}
9568+
9569+ def decode_stroke_opacity(value) when is_float(value) and value >= 0 and value <= 1, do: value
9570+ def decode_stroke_opacity(value) when is_integer(value) and value >= 0 and value <= 1, do: value
9571+ def decode_stroke_opacity(_), do: {:error, "Unexpected type when decoding MarkDef.stroke_opacity"}
9572+
9573+ def encode_stroke_opacity(value) when is_float(value), do: value
9574+ def encode_stroke_opacity(value) when is_integer(value), do: value
9575+ def encode_stroke_opacity(_), do: {:error, "Unexpected type when encoding MarkDef.stroke_opacity"}
9576+
9577+ def decode_stroke_width(value) when is_float(value) and value >= 0, do: value
9578+ def decode_stroke_width(value) when is_integer(value) and value >= 0, do: value
9579+ def decode_stroke_width(_), do: {:error, "Unexpected type when decoding MarkDef.stroke_width"}
9580+
9581+ def encode_stroke_width(value) when is_float(value), do: value
9582+ def encode_stroke_width(value) when is_integer(value), do: value
9583+ def encode_stroke_width(_), do: {:error, "Unexpected type when encoding MarkDef.stroke_width"}
9584+
77859585 def decode_style(value) when is_binary(value), do: value
77869586 def decode_style(value) when is_list(value), do: value
77879587 def decode_style(value) when is_nil(value), do: value
@@ -7792,46 +9592,62 @@ defmodule MarkDef do
77929592 def encode_style(value) when is_nil(value), do: value
77939593 def encode_style(_), do: {:error, "Unexpected type when encoding MarkDef.style"}
77949594
9595+ def decode_tension(value) when is_float(value) and value >= 0 and value <= 1, do: value
9596+ def decode_tension(value) when is_integer(value) and value >= 0 and value <= 1, do: value
9597+ def decode_tension(_), do: {:error, "Unexpected type when decoding MarkDef.tension"}
9598+
9599+ def encode_tension(value) when is_float(value), do: value
9600+ def encode_tension(value) when is_integer(value), do: value
9601+ def encode_tension(_), do: {:error, "Unexpected type when encoding MarkDef.tension"}
9602+
77959603 def decode_text(value) when is_binary(value), do: value
77969604 def decode_text(_), do: {:error, "Unexpected type when decoding MarkDef.text"}
77979605
77989606 def encode_text(value) when is_binary(value), do: value
77999607 def encode_text(_), do: {:error, "Unexpected type when encoding MarkDef.text"}
78009608
9609+ def decode_theta(value) when is_float(value), do: value
9610+ def decode_theta(value) when is_integer(value), do: value
9611+ def decode_theta(_), do: {:error, "Unexpected type when decoding MarkDef.theta"}
9612+
9613+ def encode_theta(value) when is_float(value), do: value
9614+ def encode_theta(value) when is_integer(value), do: value
9615+ def encode_theta(_), do: {:error, "Unexpected type when encoding MarkDef.theta"}
9616+
78019617 def from_map(m) do
78029618 %MarkDef{
78039619 align: m["align"] && HorizontalAlign.decode(m["align"]),
7804- angle: m["angle"],
9620+ angle: m["angle"] && decode_angle(m["angle"]),
78059621 baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
78069622 clip: m["clip"],
78079623 color: m["color"] && decode_color(m["color"]),
78089624 cursor: m["cursor"] && Cursor.decode(m["cursor"]),
7809- dx: m["dx"],
7810- dy: m["dy"],
9625+ dx: m["dx"] && decode_dx(m["dx"]),
9626+ dy: m["dy"] && decode_dy(m["dy"]),
78119627 fill: m["fill"] && decode_fill(m["fill"]),
78129628 filled: m["filled"],
7813- fill_opacity: m["fillOpacity"],
9629+ fill_opacity: m["fillOpacity"] && decode_fill_opacity(m["fillOpacity"]),
78149630 font: m["font"] && decode_font(m["font"]),
7815- font_size: m["fontSize"],
9631+ font_size: m["fontSize"] && decode_font_size(m["fontSize"]),
78169632 font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
78179633 font_weight: decode_font_weight(m["fontWeight"]),
78189634 href: m["href"] && decode_href(m["href"]),
78199635 interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
7820- limit: m["limit"],
7821- opacity: m["opacity"],
9636+ limit: m["limit"] && decode_limit(m["limit"]),
9637+ opacity: m["opacity"] && decode_opacity(m["opacity"]),
78229638 orient: m["orient"] && Orient.decode(m["orient"]),
7823- radius: m["radius"],
9639+ radius: m["radius"] && decode_radius(m["radius"]),
78249640 shape: m["shape"] && decode_shape(m["shape"]),
7825- size: m["size"],
9641+ size: m["size"] && decode_size(m["size"]),
78269642 stroke: m["stroke"] && decode_stroke(m["stroke"]),
78279643 stroke_dash: m["strokeDash"],
7828- stroke_dash_offset: m["strokeDashOffset"],
7829- stroke_opacity: m["strokeOpacity"],
7830- stroke_width: m["strokeWidth"],
9644+ stroke_dash_offset: m["strokeDashOffset"] && decode_stroke_dash_offset(m["strokeDashOffset"]),
9645+ stroke_opacity: m["strokeOpacity"] && decode_stroke_opacity(m["strokeOpacity"]),
9646+ stroke_width: m["strokeWidth"] && decode_stroke_width(m["strokeWidth"]),
78319647 style: decode_style(m["style"]),
7832- tension: m["tension"],
9648+ tension: m["tension"] && decode_tension(m["tension"]),
78339649 text: m["text"] && decode_text(m["text"]),
7834- theta: m["theta"],
9650+ theta: m["theta"] && decode_theta(m["theta"]),
78359651 type: Mark.decode(m["type"]),
78369652 }
78379653 end
@@ -7921,6 +9737,54 @@ defmodule Projection do
79219737 type: VGProjectionType.t() | nil
79229738 }
79239739
9740+ def decode_clip_angle(value) when is_float(value), do: value
9741+ def decode_clip_angle(value) when is_integer(value), do: value
9742+ def decode_clip_angle(_), do: {:error, "Unexpected type when decoding Projection.clip_angle"}
9743+
9744+ def encode_clip_angle(value) when is_float(value), do: value
9745+ def encode_clip_angle(value) when is_integer(value), do: value
9746+ def encode_clip_angle(_), do: {:error, "Unexpected type when encoding Projection.clip_angle"}
9747+
9748+ def decode_coefficient(value) when is_float(value), do: value
9749+ def decode_coefficient(value) when is_integer(value), do: value
9750+ def decode_coefficient(_), do: {:error, "Unexpected type when decoding Projection.coefficient"}
9751+
9752+ def encode_coefficient(value) when is_float(value), do: value
9753+ def encode_coefficient(value) when is_integer(value), do: value
9754+ def encode_coefficient(_), do: {:error, "Unexpected type when encoding Projection.coefficient"}
9755+
9756+ def decode_distance(value) when is_float(value), do: value
9757+ def decode_distance(value) when is_integer(value), do: value
9758+ def decode_distance(_), do: {:error, "Unexpected type when decoding Projection.distance"}
9759+
9760+ def encode_distance(value) when is_float(value), do: value
9761+ def encode_distance(value) when is_integer(value), do: value
9762+ def encode_distance(_), do: {:error, "Unexpected type when encoding Projection.distance"}
9763+
9764+ def decode_fraction(value) when is_float(value), do: value
9765+ def decode_fraction(value) when is_integer(value), do: value
9766+ def decode_fraction(_), do: {:error, "Unexpected type when decoding Projection.fraction"}
9767+
9768+ def encode_fraction(value) when is_float(value), do: value
9769+ def encode_fraction(value) when is_integer(value), do: value
9770+ def encode_fraction(_), do: {:error, "Unexpected type when encoding Projection.fraction"}
9771+
9772+ def decode_lobes(value) when is_float(value), do: value
9773+ def decode_lobes(value) when is_integer(value), do: value
9774+ def decode_lobes(_), do: {:error, "Unexpected type when decoding Projection.lobes"}
9775+
9776+ def encode_lobes(value) when is_float(value), do: value
9777+ def encode_lobes(value) when is_integer(value), do: value
9778+ def encode_lobes(_), do: {:error, "Unexpected type when encoding Projection.lobes"}
9779+
9780+ def decode_parallel(value) when is_float(value), do: value
9781+ def decode_parallel(value) when is_integer(value), do: value
9782+ def decode_parallel(_), do: {:error, "Unexpected type when decoding Projection.parallel"}
9783+
9784+ def encode_parallel(value) when is_float(value), do: value
9785+ def encode_parallel(value) when is_integer(value), do: value
9786+ def encode_parallel(_), do: {:error, "Unexpected type when encoding Projection.parallel"}
9787+
79249788 def decode_precision_value(value) when is_float(value), do: value
79259789 def decode_precision_value(value) when is_integer(value), do: value
79269790 def decode_precision_value(value) when is_binary(value), do: value
@@ -7931,23 +9795,55 @@ defmodule Projection do
79319795 def encode_precision_value(value) when is_binary(value), do: value
79329796 def encode_precision_value(_), do: {:error, "Unexpected type when encoding Projection.precision"}
79339797
9798+ def decode_radius(value) when is_float(value), do: value
9799+ def decode_radius(value) when is_integer(value), do: value
9800+ def decode_radius(_), do: {:error, "Unexpected type when decoding Projection.radius"}
9801+
9802+ def encode_radius(value) when is_float(value), do: value
9803+ def encode_radius(value) when is_integer(value), do: value
9804+ def encode_radius(_), do: {:error, "Unexpected type when encoding Projection.radius"}
9805+
9806+ def decode_ratio(value) when is_float(value), do: value
9807+ def decode_ratio(value) when is_integer(value), do: value
9808+ def decode_ratio(_), do: {:error, "Unexpected type when decoding Projection.ratio"}
9809+
9810+ def encode_ratio(value) when is_float(value), do: value
9811+ def encode_ratio(value) when is_integer(value), do: value
9812+ def encode_ratio(_), do: {:error, "Unexpected type when encoding Projection.ratio"}
9813+
9814+ def decode_spacing(value) when is_float(value), do: value
9815+ def decode_spacing(value) when is_integer(value), do: value
9816+ def decode_spacing(_), do: {:error, "Unexpected type when decoding Projection.spacing"}
9817+
9818+ def encode_spacing(value) when is_float(value), do: value
9819+ def encode_spacing(value) when is_integer(value), do: value
9820+ def encode_spacing(_), do: {:error, "Unexpected type when encoding Projection.spacing"}
9821+
9822+ def decode_tilt(value) when is_float(value), do: value
9823+ def decode_tilt(value) when is_integer(value), do: value
9824+ def decode_tilt(_), do: {:error, "Unexpected type when decoding Projection.tilt"}
9825+
9826+ def encode_tilt(value) when is_float(value), do: value
9827+ def encode_tilt(value) when is_integer(value), do: value
9828+ def encode_tilt(_), do: {:error, "Unexpected type when encoding Projection.tilt"}
9829+
79349830 def from_map(m) do
79359831 %Projection{
79369832 center: m["center"],
7937- clip_angle: m["clipAngle"],
9833+ clip_angle: m["clipAngle"] && decode_clip_angle(m["clipAngle"]),
79389834 clip_extent: m["clipExtent"],
7939- coefficient: m["coefficient"],
7940- distance: m["distance"],
7941- fraction: m["fraction"],
7942- lobes: m["lobes"],
7943- parallel: m["parallel"],
9835+ coefficient: m["coefficient"] && decode_coefficient(m["coefficient"]),
9836+ distance: m["distance"] && decode_distance(m["distance"]),
9837+ fraction: m["fraction"] && decode_fraction(m["fraction"]),
9838+ lobes: m["lobes"] && decode_lobes(m["lobes"]),
9839+ parallel: m["parallel"] && decode_parallel(m["parallel"]),
79449840 precision: m["precision"]
79459841 |> Map.new(fn {key, value} -> {key, decode_precision_value(value)} end),
7946- radius: m["radius"],
7947- ratio: m["ratio"],
9842+ radius: m["radius"] && decode_radius(m["radius"]),
9843+ ratio: m["ratio"] && decode_ratio(m["ratio"]),
79489844 rotate: m["rotate"],
7949- spacing: m["spacing"],
7950- tilt: m["tilt"],
9845+ spacing: m["spacing"] && decode_spacing(m["spacing"]),
9846+ tilt: m["tilt"] && decode_tilt(m["tilt"]),
79519847 type: m["type"] && VGProjectionType.decode(m["type"]),
79529848 }
79539849 end
@@ -8365,6 +10261,14 @@ defmodule TitleParams do
836510261 text: String.t()
836610262 }
836710263
10264+ def decode_offset(value) when is_float(value), do: value
10265+ def decode_offset(value) when is_integer(value), do: value
10266+ def decode_offset(_), do: {:error, "Unexpected type when decoding TitleParams.offset"}
10267+
10268+ def encode_offset(value) when is_float(value), do: value
10269+ def encode_offset(value) when is_integer(value), do: value
10270+ def encode_offset(_), do: {:error, "Unexpected type when encoding TitleParams.offset"}
10271+
836810272 def decode_style(value) when is_binary(value), do: value
836910273 def decode_style(value) when is_list(value), do: value
837010274 def decode_style(value) when is_nil(value), do: value
@@ -8384,7 +10288,7 @@ defmodule TitleParams do
838410288 def from_map(m) do
838510289 %TitleParams{
838610290 anchor: m["anchor"] && Anchor.decode(m["anchor"]),
8387- offset: m["offset"],
10291+ offset: m["offset"] && decode_offset(m["offset"]),
838810292 orient: m["orient"] && TitleOrient.decode(m["orient"]),
838910293 style: decode_style(m["style"]),
839010294 text: decode_text(m["text"]),
@@ -8695,6 +10599,14 @@ defmodule LayerSpec do
869510599 def encode_description(value) when is_binary(value), do: value
869610600 def encode_description(_), do: {:error, "Unexpected type when encoding LayerSpec.description"}
869710601
10602+ def decode_height(value) when is_float(value), do: value
10603+ def decode_height(value) when is_integer(value), do: value
10604+ def decode_height(_), do: {:error, "Unexpected type when decoding LayerSpec.height"}
10605+
10606+ def encode_height(value) when is_float(value), do: value
10607+ def encode_height(value) when is_integer(value), do: value
10608+ def encode_height(_), do: {:error, "Unexpected type when encoding LayerSpec.height"}
10609+
869810610 def decode_name(value) when is_binary(value), do: value
869910611 def decode_name(_), do: {:error, "Unexpected type when decoding LayerSpec.name"}
870010612
@@ -8711,6 +10623,14 @@ defmodule LayerSpec do
871110623 def encode_title(value) when is_nil(value), do: value
871210624 def encode_title(_), do: {:error, "Unexpected type when encoding LayerSpec.title"}
871310625
10626+ def decode_width(value) when is_float(value), do: value
10627+ def decode_width(value) when is_integer(value), do: value
10628+ def decode_width(_), do: {:error, "Unexpected type when decoding LayerSpec.width"}
10629+
10630+ def encode_width(value) when is_float(value), do: value
10631+ def encode_width(value) when is_integer(value), do: value
10632+ def encode_width(_), do: {:error, "Unexpected type when encoding LayerSpec.width"}
10633+
871410634 def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value)
871510635 def decode_mark(value) when is_binary(value), do: Mark.decode(value)
871610636 def decode_mark(value) when is_nil(value), do: value
@@ -8725,13 +10645,13 @@ defmodule LayerSpec do
872510645 %LayerSpec{
872610646 data: m["data"] && Data.from_map(m["data"]),
872710647 description: m["description"] && decode_description(m["description"]),
8728- height: m["height"],
10648+ height: m["height"] && decode_height(m["height"]),
872910649 layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
873010650 name: m["name"] && decode_name(m["name"]),
873110651 resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
873210652 title: decode_title(m["title"]),
873310653 transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
8734- width: m["width"],
10654+ width: m["width"] && decode_width(m["width"]),
873510655 encoding: m["encoding"] && Encoding.from_map(m["encoding"]),
873610656 mark: decode_mark(m["mark"]),
873710657 projection: m["projection"] && Projection.from_map(m["projection"]),
@@ -8866,6 +10786,14 @@ defmodule Spec do
886610786 def encode_description(value) when is_binary(value), do: value
886710787 def encode_description(_), do: {:error, "Unexpected type when encoding Spec.description"}
886810788
10789+ def decode_height(value) when is_float(value), do: value
10790+ def decode_height(value) when is_integer(value), do: value
10791+ def decode_height(_), do: {:error, "Unexpected type when decoding Spec.height"}
10792+
10793+ def encode_height(value) when is_float(value), do: value
10794+ def encode_height(value) when is_integer(value), do: value
10795+ def encode_height(_), do: {:error, "Unexpected type when encoding Spec.height"}
10796+
886910797 def decode_name(value) when is_binary(value), do: value
887010798 def decode_name(_), do: {:error, "Unexpected type when decoding Spec.name"}
887110799
@@ -8882,6 +10810,14 @@ defmodule Spec do
888210810 def encode_title(value) when is_nil(value), do: value
888310811 def encode_title(_), do: {:error, "Unexpected type when encoding Spec.title"}
888410812
10813+ def decode_width(value) when is_float(value), do: value
10814+ def decode_width(value) when is_integer(value), do: value
10815+ def decode_width(_), do: {:error, "Unexpected type when decoding Spec.width"}
10816+
10817+ def encode_width(value) when is_float(value), do: value
10818+ def encode_width(value) when is_integer(value), do: value
10819+ def encode_width(_), do: {:error, "Unexpected type when encoding Spec.width"}
10820+
888510821 def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value)
888610822 def decode_mark(value) when is_binary(value), do: Mark.decode(value)
888710823 def decode_mark(value) when is_nil(value), do: value
@@ -8896,13 +10832,13 @@ defmodule Spec do
889610832 %Spec{
889710833 data: m["data"] && Data.from_map(m["data"]),
889810834 description: m["description"] && decode_description(m["description"]),
8899- height: m["height"],
10835+ height: m["height"] && decode_height(m["height"]),
890010836 layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
890110837 name: m["name"] && decode_name(m["name"]),
890210838 resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
890310839 title: decode_title(m["title"]),
890410840 transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
8905- width: m["width"],
10841+ width: m["width"] && decode_width(m["width"]),
890610842 encoding: m["encoding"] && Encoding.from_map(m["encoding"]),
890710843 mark: decode_mark(m["mark"]),
890810844 projection: m["projection"] && Projection.from_map(m["projection"]),
@@ -9036,6 +10972,14 @@ defmodule TopLevel do
903610972 def encode_description(value) when is_binary(value), do: value
903710973 def encode_description(_), do: {:error, "Unexpected type when encoding TopLevel.description"}
903810974
10975+ def decode_height(value) when is_float(value), do: value
10976+ def decode_height(value) when is_integer(value), do: value
10977+ def decode_height(_), do: {:error, "Unexpected type when decoding TopLevel.height"}
10978+
10979+ def encode_height(value) when is_float(value), do: value
10980+ def encode_height(value) when is_integer(value), do: value
10981+ def encode_height(_), do: {:error, "Unexpected type when encoding TopLevel.height"}
10982+
903910983 def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value)
904010984 def decode_mark(value) when is_binary(value), do: Mark.decode(value)
904110985 def decode_mark(value) when is_nil(value), do: value
@@ -9074,6 +11018,14 @@ defmodule TopLevel do
907411018 def encode_title(value) when is_nil(value), do: value
907511019 def encode_title(_), do: {:error, "Unexpected type when encoding TopLevel.title"}
907611020
11021+ def decode_width(value) when is_float(value), do: value
11022+ def decode_width(value) when is_integer(value), do: value
11023+ def decode_width(_), do: {:error, "Unexpected type when decoding TopLevel.width"}
11024+
11025+ def encode_width(value) when is_float(value), do: value
11026+ def encode_width(value) when is_integer(value), do: value
11027+ def encode_width(_), do: {:error, "Unexpected type when encoding TopLevel.width"}
11028+
907711029 def from_map(m) do
907811030 %TopLevel{
907911031 schema: m["$schema"] && decode_schema(m["$schema"]),
@@ -9083,7 +11035,7 @@ defmodule TopLevel do
908311035 data: m["data"] && Data.from_map(m["data"]),
908411036 description: m["description"] && decode_description(m["description"]),
908511037 encoding: m["encoding"] && EncodingWithFacet.from_map(m["encoding"]),
9086- height: m["height"],
11038+ height: m["height"] && decode_height(m["height"]),
908711039 mark: decode_mark(m["mark"]),
908811040 name: m["name"] && decode_name(m["name"]),
908911041 padding: decode_padding(m["padding"]),
@@ -9092,7 +11044,7 @@ defmodule TopLevel do
909211044 |> Map.new(fn {key, value} -> {key, SelectionDef.from_map(value)} end),
909311045 title: decode_title(m["title"]),
909411046 transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
9095- width: m["width"],
11047+ width: m["width"] && decode_width(m["width"]),
909611048 layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
909711049 resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
909811050 facet: m["facet"] && FacetMapping.from_map(m["facet"]),
No generated files match these filters.