Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
45test cases
45files differ
44modified
1new
0deleted
295changed lines
+167 −128insertions / deletions
Base d3014aaec4f7ed11fb83168f39211b755deeeb1d · PR merge cf625a52c5e02812fb3405e67692a9d3e6d0e8d9 · Head c1d0464dde692f83f0bf2ffae44113d9a399723c · raw patch
Test case

test/inputs/graphql/github1.graphql

1 generated file · +1 −1
Mgraphql-elixirdefault / QuickType.ex+1 −1
@@ -17,7 +17,7 @@ defmodule User do
1717 def from_map(m) do
1818 %User{
1919 login: m["login"],
20- real_name: m["realName"],
20+ real_name: Map.fetch!(m, "realName"),
2121 }
2222 end
Test case

test/inputs/graphql/github4.graphql

1 generated file · +1 −1
Mgraphql-elixirdefault / QuickType.ex+1 −1
@@ -172,7 +172,7 @@ defmodule User do
172172 def from_map(m) do
173173 %User{
174174 login: m["login"],
175- name: m["name"],
175+ name: Map.fetch!(m, "name"),
176176 repository: m["repository"] && Repository.from_map(m["repository"]),
177177 }
178178 end
Test case

test/inputs/graphql/github9.graphql

1 generated file · +1 −1
Mgraphql-elixirdefault / QuickType.ex+1 −1
@@ -136,7 +136,7 @@ defmodule AddReactionPayload do
136136
137137 def from_map(m) do
138138 %AddReactionPayload{
139- client_mutation_id: m["clientMutationId"],
139+ client_mutation_id: Map.fetch!(m, "clientMutationId"),
140140 reaction: Reaction.from_map(m["reaction"]),
141141 subject: Reactable.from_map(m["subject"]),
142142 }
Test case

test/inputs/json/misc/050b0.json

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -233,7 +233,7 @@ defmodule OtherName do
233233 def from_map(m) do
234234 %OtherName{
235235 name: m["name"],
236- note: m["note"],
236+ note: Map.fetch!(m, "note"),
237237 }
238238 end
239239
@@ -411,7 +411,7 @@ defmodule TopLevelElement do
411411 links: Enum.map(m["links"], &Link.from_map/1),
412412 name: m["name"],
413413 other_names: Enum.map(m["other_names"], &OtherName.from_map/1),
414- superseded_by: m["superseded_by"],
414+ superseded_by: Map.fetch!(m, "superseded_by"),
415415 text: Enum.map(m["text"], &Text.from_map/1),
416416 }
417417 end
Test case

test/inputs/json/misc/10be4.json

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -242,7 +242,7 @@ defmodule OtherName do
242242 def from_map(m) do
243243 %OtherName{
244244 name: m["name"],
245- note: m["note"],
245+ note: Map.fetch!(m, "note"),
246246 }
247247 end
248248
@@ -422,7 +422,7 @@ defmodule TopLevelElement do
422422 links: Enum.map(m["links"], &Link.from_map/1),
423423 name: m["name"],
424424 other_names: Enum.map(m["other_names"], &OtherName.from_map/1),
425- superseded_by: m["superseded_by"],
425+ superseded_by: Map.fetch!(m, "superseded_by"),
426426 text: Enum.map(m["text"], &Text.from_map/1),
427427 }
428428 end
Test case

test/inputs/json/misc/1b409.json

1 generated file · +4 −4
Melixirdefault / QuickType.ex+4 −4
@@ -317,10 +317,10 @@ defmodule Person do
317317 namemod: Namemod.decode(m["namemod"]),
318318 nickname: m["nickname"],
319319 osid: m["osid"],
320- pvsid: m["pvsid"],
320+ pvsid: Map.fetch!(m, "pvsid"),
321321 sortname: m["sortname"],
322- twitterid: m["twitterid"],
323- youtubeid: m["youtubeid"],
322+ twitterid: Map.fetch!(m, "twitterid"),
323+ youtubeid: Map.fetch!(m, "youtubeid"),
324324 }
325325 end
326326
@@ -536,7 +536,7 @@ defmodule Object do
536536 enddate: m["enddate"],
537537 extra: Extra.from_map(m["extra"]),
538538 id: m["id"],
539- leadership_title: m["leadership_title"],
539+ leadership_title: Map.fetch!(m, "leadership_title"),
540540 party: Party.decode(m["party"]),
541541 person: Person.from_map(m["person"]),
542542 phone: m["phone"],
Test case

test/inputs/json/misc/27332.json

1 generated file · +8 −8
Melixirdefault / QuickType.ex+8 −8
@@ -645,8 +645,8 @@ defmodule ChildData do
645645 approved_by: m["approved_by"],
646646 archived: m["archived"],
647647 author: m["author"],
648- author_flair_css_class: m["author_flair_css_class"],
649- author_flair_text: m["author_flair_text"],
648+ author_flair_css_class: Map.fetch!(m, "author_flair_css_class"),
649+ author_flair_text: Map.fetch!(m, "author_flair_text"),
650650 banned_at_utc: m["banned_at_utc"],
651651 banned_by: m["banned_by"],
652652 brand_safe: m["brand_safe"],
@@ -656,7 +656,7 @@ defmodule ChildData do
656656 contest_mode: m["contest_mode"],
657657 created: m["created"],
658658 created_utc: m["created_utc"],
659- distinguished: m["distinguished"],
659+ distinguished: Map.fetch!(m, "distinguished"),
660660 domain: Domain.decode(m["domain"]),
661661 downs: m["downs"],
662662 edited: m["edited"],
@@ -667,8 +667,8 @@ defmodule ChildData do
667667 is_self: m["is_self"],
668668 is_video: m["is_video"],
669669 likes: m["likes"],
670- link_flair_css_class: m["link_flair_css_class"],
671- link_flair_text: m["link_flair_text"],
670+ link_flair_css_class: Map.fetch!(m, "link_flair_css_class"),
671+ link_flair_text: Map.fetch!(m, "link_flair_text"),
672672 locked: m["locked"],
673673 media: m["media"] && Media.from_map(m["media"]),
674674 media_embed: MediaEmbed.from_map(m["media_embed"]),
@@ -688,7 +688,7 @@ defmodule ChildData do
688688 secure_media: m["secure_media"] && Media.from_map(m["secure_media"]),
689689 secure_media_embed: MediaEmbed.from_map(m["secure_media_embed"]),
690690 selftext: m["selftext"],
691- selftext_html: m["selftext_html"],
691+ selftext_html: Map.fetch!(m, "selftext_html"),
692692 spoiler: m["spoiler"],
693693 stickied: m["stickied"],
694694 subreddit: Subreddit.decode(m["subreddit"]),
@@ -697,8 +697,8 @@ defmodule ChildData do
697697 subreddit_type: SubredditType.decode(m["subreddit_type"]),
698698 suggested_sort: m["suggested_sort"],
699699 thumbnail: m["thumbnail"],
700- thumbnail_height: m["thumbnail_height"],
701- thumbnail_width: m["thumbnail_width"],
700+ thumbnail_height: Map.fetch!(m, "thumbnail_height"),
701+ thumbnail_width: Map.fetch!(m, "thumbnail_width"),
702702 title: m["title"],
703703 ups: m["ups"],
704704 url: m["url"],
Test case

test/inputs/json/misc/29f47.json

1 generated file · +5 −5
Melixirdefault / QuickType.ex+5 −5
@@ -630,7 +630,7 @@ defmodule ChildData do
630630 distinguished: Distinguished.decode(m["distinguished"]),
631631 domain: Domain.decode(m["domain"]),
632632 downs: m["downs"],
633- edited: m["edited"],
633+ edited: Map.fetch!(m, "edited"),
634634 gilded: m["gilded"],
635635 hidden: m["hidden"],
636636 hide_score: m["hide_score"],
@@ -659,17 +659,17 @@ defmodule ChildData do
659659 secure_media: m["secure_media"],
660660 secure_media_embed: MediaEmbed.from_map(m["secure_media_embed"]),
661661 selftext: m["selftext"],
662- selftext_html: m["selftext_html"],
662+ selftext_html: Map.fetch!(m, "selftext_html"),
663663 spoiler: m["spoiler"],
664664 stickied: m["stickied"],
665665 subreddit: Subreddit.decode(m["subreddit"]),
666666 subreddit_id: SubredditID.decode(m["subreddit_id"]),
667667 subreddit_name_prefixed: SubredditNamePrefixed.decode(m["subreddit_name_prefixed"]),
668668 subreddit_type: SubredditType.decode(m["subreddit_type"]),
669- suggested_sort: m["suggested_sort"],
669+ suggested_sort: Map.fetch!(m, "suggested_sort"),
670670 thumbnail: m["thumbnail"],
671- thumbnail_height: m["thumbnail_height"],
672- thumbnail_width: m["thumbnail_width"],
671+ thumbnail_height: Map.fetch!(m, "thumbnail_height"),
672+ thumbnail_width: Map.fetch!(m, "thumbnail_width"),
673673 title: m["title"],
674674 ups: m["ups"],
675675 url: m["url"],
Test case

test/inputs/json/misc/2d4e2.json

1 generated file · +3 −3
Melixirdefault / QuickType.ex+3 −3
@@ -318,8 +318,8 @@ defmodule Person do
318318 osid: m["osid"],
319319 pvsid: m["pvsid"],
320320 sortname: m["sortname"],
321- twitterid: m["twitterid"],
322- youtubeid: m["youtubeid"],
321+ twitterid: Map.fetch!(m, "twitterid"),
322+ youtubeid: Map.fetch!(m, "youtubeid"),
323323 }
324324 end
325325
@@ -720,7 +720,7 @@ defmodule Object do
720720 enddate: m["enddate"],
721721 extra: Extra.from_map(m["extra"]),
722722 id: m["id"],
723- leadership_title: m["leadership_title"],
723+ leadership_title: Map.fetch!(m, "leadership_title"),
724724 party: Party.decode(m["party"]),
725725 person: Person.from_map(m["person"]),
726726 phone: m["phone"],
Test case

test/inputs/json/misc/32431.json

1 generated file · +3 −3
Melixirdefault / QuickType.ex+3 −3
@@ -263,15 +263,15 @@ defmodule Properties do
263263 cdi: m["cdi"],
264264 code: m["code"],
265265 detail: m["detail"],
266- dmin: m["dmin"],
266+ dmin: Map.fetch!(m, "dmin"),
267267 felt: m["felt"],
268- gap: m["gap"],
268+ gap: Map.fetch!(m, "gap"),
269269 ids: m["ids"],
270270 mag: m["mag"],
271271 mag_type: MagType.decode(m["magType"]),
272272 mmi: m["mmi"],
273273 net: m["net"],
274- nst: m["nst"],
274+ nst: Map.fetch!(m, "nst"),
275275 place: m["place"],
276276 rms: m["rms"],
277277 sig: m["sig"],
Test case

test/inputs/json/misc/32d5c.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -22,7 +22,7 @@ defmodule TopLevelElement do
2222
2323 def from_map(m) do
2424 %TopLevelElement{
25- birth_date: m["BirthDate"],
25+ birth_date: Map.fetch!(m, "BirthDate"),
2626 birth_date_is_protected: m["BirthDateIsProtected"],
2727 gender_type_id: m["GenderTypeID"],
2828 notes: m["Notes"],
Test case

test/inputs/json/misc/337ed.json

1 generated file · +17 −17
Melixirdefault / QuickType.ex+17 −17
@@ -268,35 +268,35 @@ defmodule Result do
268268
269269 def from_map(m) do
270270 %Result{
271- cost_absolute: m["cost_absolute"],
272- cost_max: m["cost_max"],
273- cost_min: m["cost_min"],
271+ cost_absolute: Map.fetch!(m, "cost_absolute"),
272+ cost_max: Map.fetch!(m, "cost_max"),
273+ cost_min: Map.fetch!(m, "cost_min"),
274274 created_at: m["created_at"],
275275 custom_incomes: Enum.map(m["customIncomes"], &CustomIncome.from_map/1),
276276 direct_rep_costs_max: m["direct_rep_costs_max"],
277277 direct_rep_costs_min: m["direct_rep_costs_min"],
278278 end_date: m["end_date"],
279279 eur_sources_grants: m["eur_sources_grants"],
280- eur_sources_grants_src: m["eur_sources_grants_src"],
280+ eur_sources_grants_src: Map.fetch!(m, "eur_sources_grants_src"),
281281 eur_sources_procurement: m["eur_sources_procurement"],
282- eur_sources_procurement_src: m["eur_sources_procurement_src"],
282+ eur_sources_procurement_src: Map.fetch!(m, "eur_sources_procurement_src"),
283283 id: m["id"],
284284 new_organisation: m["new_organisation"],
285- no_clients: m["no_clients"],
286- other_financial_information: m["other_financial_information"],
287- other_sources_contributions: m["other_sources_contributions"],
288- other_sources_donation: m["other_sources_donation"],
289- other_sources_total: m["other_sources_total"],
290- public_financing_infranational: m["public_financing_infranational"],
291- public_financing_national: m["public_financing_national"],
292- public_financing_total: m["public_financing_total"],
285+ no_clients: Map.fetch!(m, "no_clients"),
286+ other_financial_information: Map.fetch!(m, "other_financial_information"),
287+ other_sources_contributions: Map.fetch!(m, "other_sources_contributions"),
288+ other_sources_donation: Map.fetch!(m, "other_sources_donation"),
289+ other_sources_total: Map.fetch!(m, "other_sources_total"),
290+ public_financing_infranational: Map.fetch!(m, "public_financing_infranational"),
291+ public_financing_national: Map.fetch!(m, "public_financing_national"),
292+ public_financing_total: Map.fetch!(m, "public_financing_total"),
293293 representative: m["representative"],
294294 start_date: m["start_date"],
295295 status: Status.decode(m["status"]),
296- total_budget: m["total_budget"],
297- turnover_absolute: m["turnover_absolute"],
298- turnover_max: m["turnover_max"],
299- turnover_min: m["turnover_min"],
296+ total_budget: Map.fetch!(m, "total_budget"),
297+ turnover_absolute: Map.fetch!(m, "turnover_absolute"),
298+ turnover_max: Map.fetch!(m, "turnover_max"),
299+ turnover_min: Map.fetch!(m, "turnover_min"),
300300 type: ResultType.decode(m["type"]),
301301 updated_at: m["updated_at"],
302302 uri: m["uri"],
Test case

test/inputs/json/misc/34702.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -392,7 +392,7 @@ defmodule FeatureProperties do
392392 latitude: m["latitude"],
393393 local_govt: m["local_govt"],
394394 longitude: m["longitude"],
395- no: m["no"],
395+ no: Map.fetch!(m, "no"),
396396 phone: m["phone"],
397397 postcode: m["postcode"],
398398 psa: m["psa"],
Test case

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

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -652,8 +652,8 @@ defmodule ChildData do
652652 subreddit_type: SubredditType.decode(m["subreddit_type"]),
653653 suggested_sort: m["suggested_sort"],
654654 thumbnail: m["thumbnail"],
655- thumbnail_height: m["thumbnail_height"],
656- thumbnail_width: m["thumbnail_width"],
655+ thumbnail_height: Map.fetch!(m, "thumbnail_height"),
656+ thumbnail_width: Map.fetch!(m, "thumbnail_width"),
657657 title: m["title"],
658658 ups: m["ups"],
659659 url: m["url"],
Test case

test/inputs/json/misc/570ec.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -136,7 +136,7 @@ defmodule OtherName do
136136 def from_map(m) do
137137 %OtherName{
138138 name: m["name"],
139- note: m["note"],
139+ note: Map.fetch!(m, "note"),
140140 }
141141 end
Test case

test/inputs/json/misc/66121.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -368,7 +368,7 @@ defmodule TopLevelElement do
368368 links: Enum.map(m["links"], &Link.from_map/1),
369369 name: m["name"],
370370 other_names: m["other_names"],
371- superseded_by: m["superseded_by"],
371+ superseded_by: Map.fetch!(m, "superseded_by"),
372372 text: Enum.map(m["text"], &Text.from_map/1),
373373 }
374374 end
Test case

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

1 generated file · +8 −8
Melixirdefault / QuickType.ex+8 −8
@@ -511,8 +511,8 @@ defmodule ChildData do
511511 approved_by: m["approved_by"],
512512 archived: m["archived"],
513513 author: m["author"],
514- author_flair_css_class: m["author_flair_css_class"],
515- author_flair_text: m["author_flair_text"],
514+ author_flair_css_class: Map.fetch!(m, "author_flair_css_class"),
515+ author_flair_text: Map.fetch!(m, "author_flair_text"),
516516 banned_at_utc: m["banned_at_utc"],
517517 banned_by: m["banned_by"],
518518 brand_safe: m["brand_safe"],
@@ -533,8 +533,8 @@ defmodule ChildData do
533533 is_self: m["is_self"],
534534 is_video: m["is_video"],
535535 likes: m["likes"],
536- link_flair_css_class: m["link_flair_css_class"],
537- link_flair_text: m["link_flair_text"],
536+ link_flair_css_class: Map.fetch!(m, "link_flair_css_class"),
537+ link_flair_text: Map.fetch!(m, "link_flair_text"),
538538 locked: m["locked"],
539539 media: m["media"] && Media.from_map(m["media"]),
540540 media_embed: MediaEmbed.from_map(m["media_embed"]),
@@ -554,17 +554,17 @@ defmodule ChildData do
554554 secure_media: m["secure_media"] && Media.from_map(m["secure_media"]),
555555 secure_media_embed: MediaEmbed.from_map(m["secure_media_embed"]),
556556 selftext: m["selftext"],
557- selftext_html: m["selftext_html"],
557+ selftext_html: Map.fetch!(m, "selftext_html"),
558558 spoiler: m["spoiler"],
559559 stickied: m["stickied"],
560560 subreddit: m["subreddit"],
561561 subreddit_id: m["subreddit_id"],
562562 subreddit_name_prefixed: m["subreddit_name_prefixed"],
563563 subreddit_type: SubredditType.decode(m["subreddit_type"]),
564- suggested_sort: m["suggested_sort"],
564+ suggested_sort: Map.fetch!(m, "suggested_sort"),
565565 thumbnail: m["thumbnail"],
566- thumbnail_height: m["thumbnail_height"],
567- thumbnail_width: m["thumbnail_width"],
566+ thumbnail_height: Map.fetch!(m, "thumbnail_height"),
567+ thumbnail_width: Map.fetch!(m, "thumbnail_width"),
568568 title: m["title"],
569569 ups: m["ups"],
570570 url: m["url"],
Test case

test/inputs/json/misc/734ad.json

1 generated file · +14 −14
Melixirdefault / QuickType.ex+14 −14
@@ -147,14 +147,14 @@ defmodule Result do
147147
148148 def from_map(m) do
149149 %Result{
150- acronym: m["acronym"],
150+ acronym: Map.fetch!(m, "acronym"),
151151 activity_consult_committees: m["activity_consult_committees"],
152152 activity_eu_legislative: m["activity_eu_legislative"],
153153 activity_expert_groups: m["activity_expert_groups"],
154154 activity_high_level_groups: m["activity_high_level_groups"],
155155 activity_industry_forums: m["activity_industry_forums"],
156156 activity_inter_groups: m["activity_inter_groups"],
157- activity_other: m["activity_other"],
157+ activity_other: Map.fetch!(m, "activity_other"),
158158 activity_relevant_comm: m["activity_relevant_comm"],
159159 be_office_country: m["be_office_country"],
160160 be_office_lat: m["be_office_lat"],
@@ -171,11 +171,11 @@ defmodule Result do
171171 goals: m["goals"],
172172 head: m["head"],
173173 head_office_country: m["head_office_country"],
174- head_office_lat: m["head_office_lat"],
175- head_office_lon: m["head_office_lon"],
174+ head_office_lat: Map.fetch!(m, "head_office_lat"),
175+ head_office_lon: Map.fetch!(m, "head_office_lon"),
176176 head_office_phone: m["head_office_phone"],
177- head_office_post_code: m["head_office_post_code"],
178- head_office_postbox: m["head_office_postbox"],
177+ head_office_post_code: Map.fetch!(m, "head_office_post_code"),
178+ head_office_postbox: Map.fetch!(m, "head_office_postbox"),
179179 head_office_street: m["head_office_street"],
180180 head_office_town: m["head_office_town"],
181181 id: m["id"],
@@ -187,16 +187,16 @@ defmodule Result do
187187 main_category: m["main_category"],
188188 main_category_title: m["main_category_title"],
189189 members: m["members"],
190- members_100: m["members_100"],
191- members_25: m["members_25"],
192- members_50: m["members_50"],
193- members_75: m["members_75"],
190+ members_100: Map.fetch!(m, "members_100"),
191+ members_25: Map.fetch!(m, "members_25"),
192+ members_50: Map.fetch!(m, "members_50"),
193+ members_75: Map.fetch!(m, "members_75"),
194194 members_fte: m["members_fte"],
195195 name: m["name"],
196196 native_name: m["native_name"],
197- networking: m["networking"],
198- number_of_natural_persons: m["number_of_natural_persons"],
199- other_code_of_conduct: m["other_code_of_conduct"],
197+ networking: Map.fetch!(m, "networking"),
198+ number_of_natural_persons: Map.fetch!(m, "number_of_natural_persons"),
199+ other_code_of_conduct: Map.fetch!(m, "other_code_of_conduct"),
200200 registration_date: m["registration_date"],
201201 status: Status.decode(m["status"]),
202202 structure_members: m["structure_members"],
@@ -204,7 +204,7 @@ defmodule Result do
204204 sub_category_title: m["sub_category_title"],
205205 updated_at: m["updated_at"],
206206 uri: m["uri"],
207- web_site_url: m["web_site_url"],
207+ web_site_url: Map.fetch!(m, "web_site_url"),
208208 }
209209 end
Test case

test/inputs/json/misc/7f568.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -169,7 +169,7 @@ defmodule TopLevelElement do
169169 comments_url: m["comments_url"],
170170 commits_url: m["commits_url"],
171171 created_at: m["created_at"],
172- description: m["description"],
172+ description: Map.fetch!(m, "description"),
173173 files: m["files"]
174174 |> Map.new(fn {key, value} -> {key, FileValue.from_map(value)} end),
175175 forks_url: m["forks_url"],
Test case

test/inputs/json/misc/80aff.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -54,7 +54,7 @@ defmodule Result do
5454 id: m["id"],
5555 items: m["items"],
5656 name: m["name"],
57- parent: m["parent"],
57+ parent: Map.fetch!(m, "parent"),
5858 updated_at: m["updated_at"],
5959 uri: m["uri"],
6060 }
Test case

test/inputs/json/misc/8592b.json

1 generated file · +5 −5
Melixirdefault / QuickType.ex+5 −5
@@ -499,8 +499,8 @@ defmodule ChildData do
499499 approved_by: m["approved_by"],
500500 archived: m["archived"],
501501 author: m["author"],
502- author_flair_css_class: m["author_flair_css_class"],
503- author_flair_text: m["author_flair_text"],
502+ author_flair_css_class: Map.fetch!(m, "author_flair_css_class"),
503+ author_flair_text: Map.fetch!(m, "author_flair_text"),
504504 banned_at_utc: m["banned_at_utc"],
505505 banned_by: m["banned_by"],
506506 brand_safe: m["brand_safe"],
@@ -542,7 +542,7 @@ defmodule ChildData do
542542 secure_media: m["secure_media"],
543543 secure_media_embed: MediaEmbed.from_map(m["secure_media_embed"]),
544544 selftext: m["selftext"],
545- selftext_html: m["selftext_html"],
545+ selftext_html: Map.fetch!(m, "selftext_html"),
546546 spoiler: m["spoiler"],
547547 stickied: m["stickied"],
548548 subreddit: Subreddit.decode(m["subreddit"]),
@@ -551,8 +551,8 @@ defmodule ChildData do
551551 subreddit_type: SubredditType.decode(m["subreddit_type"]),
552552 suggested_sort: SuggestedSort.decode(m["suggested_sort"]),
553553 thumbnail: m["thumbnail"],
554- thumbnail_height: m["thumbnail_height"],
555- thumbnail_width: m["thumbnail_width"],
554+ thumbnail_height: Map.fetch!(m, "thumbnail_height"),
555+ thumbnail_width: Map.fetch!(m, "thumbnail_width"),
556556 title: m["title"],
557557 ups: m["ups"],
558558 url: m["url"],
Test case

test/inputs/json/misc/996bd.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -326,7 +326,7 @@ defmodule TopLevelElement do
326326 links: Enum.map(m["links"], &Link.from_map/1),
327327 name: m["name"],
328328 other_names: m["other_names"],
329- superseded_by: m["superseded_by"],
329+ superseded_by: Map.fetch!(m, "superseded_by"),
330330 text: Enum.map(m["text"], &Text.from_map/1),
331331 }
332332 end
Test case

test/inputs/json/misc/9ac3b.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -152,7 +152,7 @@ defmodule Result do
152152 id: m["id"],
153153 last_name: m["last_name"],
154154 name: m["name"],
155- position: m["position"],
155+ position: Map.fetch!(m, "position"),
156156 status: Status.decode(m["status"]),
157157 title: m["title"] && Title.decode(m["title"]),
158158 updated_at: m["updated_at"],
Test case

test/inputs/json/misc/ad8be.json

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -242,7 +242,7 @@ defmodule OtherName do
242242 def from_map(m) do
243243 %OtherName{
244244 name: m["name"],
245- note: m["note"],
245+ note: Map.fetch!(m, "note"),
246246 }
247247 end
248248
@@ -422,7 +422,7 @@ defmodule TopLevelElement do
422422 links: Enum.map(m["links"], &Link.from_map/1),
423423 name: m["name"],
424424 other_names: Enum.map(m["other_names"], &OtherName.from_map/1),
425- superseded_by: m["superseded_by"],
425+ superseded_by: Map.fetch!(m, "superseded_by"),
426426 text: Enum.map(m["text"], &Text.from_map/1),
427427 }
428428 end
Test case

test/inputs/json/misc/ae7f0.json

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -354,8 +354,8 @@ defmodule ChildData do
354354 is_self: m["is_self"],
355355 is_video: m["is_video"],
356356 likes: m["likes"],
357- link_flair_css_class: m["link_flair_css_class"],
358- link_flair_text: m["link_flair_text"],
357+ link_flair_css_class: Map.fetch!(m, "link_flair_css_class"),
358+ link_flair_text: Map.fetch!(m, "link_flair_text"),
359359 locked: m["locked"],
360360 media: m["media"],
361361 media_embed: MediaEmbed.from_map(m["media_embed"]),
Test case

test/inputs/json/misc/af2d1.json

1 generated file · +8 −8
Melixirdefault / QuickType.ex+8 −8
@@ -577,16 +577,16 @@ defmodule FeatureProperties do
577577 add_improv: m["add_improv"] && AddImprov.decode(m["add_improv"]),
578578 area: m["area_"],
579579 asset_numb: m["asset_numb"],
580- comments: m["comments"],
580+ comments: Map.fetch!(m, "comments"),
581581 condition: m["condition"],
582- constructi: m["constructi"],
582+ constructi: Map.fetch!(m, "constructi"),
583583 createdate: m["createdate"],
584584 createuser: m["createuser"],
585585 disposal_d: m["disposal_d"],
586586 documents: m["documents"],
587- drawing_nu: m["drawing_nu"],
588- file_numbe: m["file_numbe"],
589- folder_num: m["folder_num"],
587+ drawing_nu: Map.fetch!(m, "drawing_nu"),
588+ file_numbe: Map.fetch!(m, "file_numbe"),
589+ folder_num: Map.fetch!(m, "folder_num"),
590590 funding_ba: m["funding_ba"] && FundingBa.decode(m["funding_ba"]),
591591 historic_c: m["historic_c"],
592592 inspection: m["inspection"],
@@ -597,11 +597,11 @@ defmodule FeatureProperties do
597597 mi_prinx: m["mi_prinx"],
598598 mi_symbolo: MiSymbolo.decode(m["mi_symbolo"]),
599599 number_lan: m["number_lan"],
600- owner: m["owner"],
600+ owner: Map.fetch!(m, "owner"),
601601 positional: m["positional"] && LevelAccu.decode(m["positional"]),
602- project_nu: m["project_nu"],
602+ project_nu: Map.fetch!(m, "project_nu"),
603603 rec_id: m["rec_id"],
604- record_cre: m["record_cre"],
604+ record_cre: Map.fetch!(m, "record_cre"),
605605 shape_area: m["shape_area"],
606606 shape_leng: m["shape_leng"],
607607 status: Status.decode(m["status"]),
Test case

test/inputs/json/misc/be234.json

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -690,7 +690,7 @@ defmodule ChildData do
690690 archived: m["archived"],
691691 author: m["author"],
692692 author_flair_css_class: m["author_flair_css_class"],
693- author_flair_text: m["author_flair_text"],
693+ author_flair_text: Map.fetch!(m, "author_flair_text"),
694694 banned_at_utc: m["banned_at_utc"],
695695 banned_by: m["banned_by"],
696696 brand_safe: m["brand_safe"],
@@ -700,7 +700,7 @@ defmodule ChildData do
700700 contest_mode: m["contest_mode"],
701701 created: m["created"],
702702 created_utc: m["created_utc"],
703- distinguished: m["distinguished"],
703+ distinguished: Map.fetch!(m, "distinguished"),
704704 domain: Domain.decode(m["domain"]),
705705 downs: m["downs"],
706706 edited: m["edited"],
Test case

test/inputs/json/misc/d23d5.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -49,7 +49,7 @@ defmodule Result do
4949
5050 def from_map(m) do
5151 %Result{
52- acronym: m["acronym"],
52+ acronym: Map.fetch!(m, "acronym"),
5353 created_at: m["created_at"],
5454 id: m["id"],
5555 name: m["name"],
Test case

test/inputs/json/misc/f22f5.json

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -309,8 +309,8 @@ defmodule ChildData do
309309 is_self: m["is_self"],
310310 is_video: m["is_video"],
311311 likes: m["likes"],
312- link_flair_css_class: m["link_flair_css_class"],
313- link_flair_text: m["link_flair_text"],
312+ link_flair_css_class: Map.fetch!(m, "link_flair_css_class"),
313+ link_flair_text: Map.fetch!(m, "link_flair_text"),
314314 locked: m["locked"],
315315 media: m["media"],
316316 media_embed: MediaEmbed.from_map(m["media_embed"]),
Test case

test/inputs/json/priority/bug2590.json

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -17,8 +17,8 @@ defmodule Invoice do
1717
1818 def from_map(m) do
1919 %Invoice{
20- created_at: m["createdAt"],
21- due_date: m["dueDate"],
20+ created_at: Map.fetch!(m, "createdAt"),
21+ due_date: Map.fetch!(m, "dueDate"),
2222 name: m["name"],
2323 }
2424 end
Test case

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

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -875,7 +875,7 @@ defmodule Pl do
875875 s_free_throws_attempted: m["sFreeThrowsAttempted"],
876876 s_free_throws_made: m["sFreeThrowsMade"],
877877 s_free_throws_percentage: m["sFreeThrowsPercentage"],
878- s_minutes: m["sMinutes"],
878+ s_minutes: Map.fetch!(m, "sMinutes"),
879879 s_plus_minus_points: m["sPlusMinusPoints"],
880880 s_points: m["sPoints"],
881881 s_points_fast_break: m["sPointsFastBreak"],
Test case

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

1 generated file · +2 −2
Melixirdefault / QuickType.ex+2 −2
@@ -389,7 +389,7 @@ defmodule Milestone do
389389 created_at: m["created_at"],
390390 creator: User.from_map(m["creator"]),
391391 description: m["description"],
392- due_on: m["due_on"],
392+ due_on: Map.fetch!(m, "due_on"),
393393 html_url: m["html_url"],
394394 id: m["id"],
395395 labels_url: m["labels_url"],
@@ -511,7 +511,7 @@ defmodule Issue do
511511 assignee: m["assignee"],
512512 assignees: m["assignees"],
513513 body: m["body"],
514- closed_at: m["closed_at"],
514+ closed_at: Map.fetch!(m, "closed_at"),
515515 comments: m["comments"],
516516 comments_url: m["comments_url"],
517517 created_at: m["created_at"],
Test case

test/inputs/json/samples/kitchen-sink.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -50,7 +50,7 @@ defmodule PersonElement do
5050
5151 def from_map(m) do
5252 %PersonElement{
53- int_or_string: m["intOrString"],
53+ int_or_string: Map.fetch!(m, "intOrString"),
5454 name: m["name"],
5555 optional_value: m["optionalValue"],
5656 }
Test case

test/inputs/json/samples/null-safe.json

1 generated file · +1 −1
Melixirdefault / QuickType.ex+1 −1
@@ -60,7 +60,7 @@ defmodule Item do
6060 address: m["address"] && Address.from_map(m["address"]),
6161 created_at: m["created_at"],
6262 name: m["name"],
63- sex: m["sex"],
63+ sex: Map.fetch!(m, "sex"),
6464 }
6565 end
Test case

test/inputs/json/samples/reddit.json

1 generated file · +5 −5
Melixirdefault / QuickType.ex+5 −5
@@ -620,8 +620,8 @@ defmodule ChildData do
620620 approved_by: m["approved_by"],
621621 archived: m["archived"],
622622 author: m["author"],
623- author_flair_css_class: m["author_flair_css_class"],
624- author_flair_text: m["author_flair_text"],
623+ author_flair_css_class: Map.fetch!(m, "author_flair_css_class"),
624+ author_flair_text: Map.fetch!(m, "author_flair_text"),
625625 banned_at_utc: m["banned_at_utc"],
626626 banned_by: m["banned_by"],
627627 brand_safe: m["brand_safe"],
@@ -631,7 +631,7 @@ defmodule ChildData do
631631 contest_mode: m["contest_mode"],
632632 created: m["created"],
633633 created_utc: m["created_utc"],
634- distinguished: m["distinguished"],
634+ distinguished: Map.fetch!(m, "distinguished"),
635635 domain: Domain.decode(m["domain"]),
636636 downs: m["downs"],
637637 edited: m["edited"],
@@ -642,8 +642,8 @@ defmodule ChildData do
642642 is_self: m["is_self"],
643643 is_video: m["is_video"],
644644 likes: m["likes"],
645- link_flair_css_class: m["link_flair_css_class"],
646- link_flair_text: m["link_flair_text"],
645+ link_flair_css_class: Map.fetch!(m, "link_flair_css_class"),
646+ link_flair_text: Map.fetch!(m, "link_flair_text"),
647647 locked: m["locked"],
648648 media: m["media"],
649649 media_embed: MediaEmbed.from_map(m["media_embed"]),
Test case

test/inputs/json/samples/us-senators.json

1 generated file · +3 −3
Melixirdefault / QuickType.ex+3 −3
@@ -316,8 +316,8 @@ defmodule Person do
316316 osid: m["osid"],
317317 pvsid: m["pvsid"],
318318 sortname: m["sortname"],
319- twitterid: m["twitterid"],
320- youtubeid: m["youtubeid"],
319+ twitterid: Map.fetch!(m, "twitterid"),
320+ youtubeid: Map.fetch!(m, "youtubeid"),
321321 }
322322 end
323323
@@ -715,7 +715,7 @@ defmodule Object do
715715 district: m["district"],
716716 enddate: m["enddate"],
717717 extra: Extra.from_map(m["extra"]),
718- leadership_title: m["leadership_title"],
718+ leadership_title: Map.fetch!(m, "leadership_title"),
719719 party: Party.decode(m["party"]),
720720 person: Person.from_map(m["person"]),
721721 phone: m["phone"],
Test case

test/inputs/schema/accessors.schema

1 generated file · +1 −1
Mschema-elixirdefault / QuickType.ex+1 −1
@@ -68,7 +68,7 @@ defmodule TopLevel do
6868 barre: m["bar"],
6969 enumerification: EnumEnum.decode(m["enum"]),
7070 foo: m["foo"],
71- unionization: m["union"],
71+ unionization: Map.fetch!(m, "union"),
7272 }
7373 end
Test case

test/inputs/schema/bool-string.schema

1 generated file · +3 −3
Mschema-elixirdefault / QuickType.ex+3 −3
@@ -31,11 +31,11 @@ defmodule TopLevel do
3131 %TopLevel{
3232 arr_nullable: m["arrNullable"] && Enum.map(m["arrNullable"], &decode_arr_nullable_element/1),
3333 arr_one: m["arrOne"],
34- nullable: m["nullable"],
34+ nullable: Map.fetch!(m, "nullable"),
3535 one: m["one"],
3636 optional: m["optional"],
37- union_with_bool: m["unionWithBool"],
38- union_with_bool_and_enum: m["unionWithBoolAndEnum"],
37+ union_with_bool: Map.fetch!(m, "unionWithBool"),
38+ union_with_bool_and_enum: Map.fetch!(m, "unionWithBoolAndEnum"),
3939 }
4040 end
Test case

test/inputs/schema/description.schema

1 generated file · +1 −1
Mschema-elixirdefault / QuickType.ex+1 −1
@@ -125,7 +125,7 @@ defmodule TopLevel do
125125 enum: EnumEnum.decode(m["enum"]),
126126 foo: m["foo"],
127127 object_or_string: decode_object_or_string(m["object-or-string"]),
128- union: m["union"],
128+ union: Map.fetch!(m, "union"),
129129 }
130130 end
Test case

test/inputs/schema/integer-string.schema

1 generated file · +3 −3
Mschema-elixirdefault / QuickType.ex+3 −3
@@ -31,11 +31,11 @@ defmodule TopLevel do
3131 %TopLevel{
3232 arr_nullable: m["arrNullable"] && Enum.map(m["arrNullable"], &decode_arr_nullable_element/1),
3333 arr_one: m["arrOne"],
34- nullable: m["nullable"],
34+ nullable: Map.fetch!(m, "nullable"),
3535 one: m["one"],
3636 optional: m["optional"],
37- union_with_int: m["unionWithInt"],
38- union_with_int_and_enum: m["unionWithIntAndEnum"],
37+ union_with_int: Map.fetch!(m, "unionWithInt"),
38+ union_with_int_and_enum: Map.fetch!(m, "unionWithIntAndEnum"),
3939 }
4040 end
Test case

test/inputs/schema/minmaxlength.schema

1 generated file · +1 −1
Mschema-elixirdefault / QuickType.ex+1 −1
@@ -23,7 +23,7 @@ defmodule TopLevel do
2323 def from_map(m) do
2424 %TopLevel{
2525 intersection: m["intersection"],
26- in_union: m["inUnion"],
26+ in_union: Map.fetch!(m, "inUnion"),
2727 maxlength: m["maxlength"],
2828 minlength: m["minlength"],
2929 min_max_intersection: m["minMaxIntersection"],
Test case

test/inputs/schema/strict-optional.schema

1 generated file · +39 −0
Aschema-elixirdefault / QuickType.ex+39 −0
@@ -0,0 +1,39 @@
1+# This file was autogenerated using quicktype https://github.com/quicktype/quicktype
2+#
3+# Add Jason to your mix.exs
4+#
5+# Decode a JSON string: TopLevel.from_json(data)
6+# Encode into a JSON string: TopLevel.to_json(struct)
7+
8+defmodule TopLevel do
9+ @enforce_keys [:foo]
10+ defstruct [:foo]
11+
12+ @type t :: %__MODULE__{
13+ foo: float() | nil
14+ }
15+
16+ def from_map(m) do
17+ %TopLevel{
18+ foo: Map.fetch!(m, "foo"),
19+ }
20+ end
21+
22+ def from_json(json) do
23+ json
24+ |> Jason.decode!()
25+ |> from_map()
26+ end
27+
28+ def to_map(struct) do
29+ %{
30+ "foo" => struct.foo,
31+ }
32+ end
33+
34+ def to_json(struct) do
35+ struct
36+ |> to_map()
37+ |> Jason.encode!()
38+ end
39+end
Test case

test/inputs/schema/union-int-double.schema

1 generated file · +1 −1
Mschema-elixirdefault / QuickType.ex+1 −1
@@ -15,7 +15,7 @@ defmodule TopLevel do
1515
1616 def from_map(m) do
1717 %TopLevel{
18- value: m["value"],
18+ value: Map.fetch!(m, "value"),
1919 }
2020 end
Test case

test/inputs/schema/uuid.schema

1 generated file · +1 −1
Mschema-elixirdefault / QuickType.ex+1 −1
@@ -30,7 +30,7 @@ defmodule TopLevel do
3030 %TopLevel{
3131 arr_nullable: m["arrNullable"] && Enum.map(m["arrNullable"], &decode_arr_nullable_element/1),
3232 arr_one: m["arrOne"],
33- nullable: m["nullable"],
33+ nullable: Map.fetch!(m, "nullable"),
3434 one: m["one"],
3535 optional: m["optional"],
3636 union_with_enum: m["unionWithEnum"],
Test case

test/inputs/schema/vega-lite.schema

1 generated file · +1 −1
Mschema-elixirdefault / QuickType.ex+1 −1
@@ -4504,7 +4504,7 @@ defmodule ConditionalValueDef do
45044504 def from_map(m) do
45054505 %ConditionalValueDef{
45064506 test: decode_test(m["test"]),
4507- value: m["value"],
4507+ value: Map.fetch!(m, "value"),
45084508 selection: decode_selection(m["selection"]),
45094509 }
45104510 end
No generated files match these filters.