diff --git a/base/elixir/test/inputs/json/misc/0a91a.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/0a91a.json/default/QuickType.ex
index 107aa35..eb10b18 100644
--- a/base/elixir/test/inputs/json/misc/0a91a.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/0a91a.json/default/QuickType.ex
@@ -24,6 +24,12 @@ defmodule Actor do
   def encode_avatar_url(value) when is_binary(value), do: value
   def encode_avatar_url(_), do: {:error, "Unexpected type when encoding Actor.avatar_url"}
 
+  def decode_display_login(value) when is_binary(value), do: value
+  def decode_display_login(_), do: {:error, "Unexpected type when decoding Actor.display_login"}
+
+  def encode_display_login(value) when is_binary(value), do: value
+  def encode_display_login(_), do: {:error, "Unexpected type when encoding Actor.display_login"}
+
   def decode_gravatar_id(value) when is_binary(value), do: value
   def decode_gravatar_id(_), do: {:error, "Unexpected type when decoding Actor.gravatar_id"}
 
@@ -51,7 +57,7 @@ defmodule Actor do
   def from_map(m) do
     %Actor{
       avatar_url: decode_avatar_url(m["avatar_url"]),
-      display_login: m["display_login"],
+      display_login: m["display_login"] && decode_display_login(m["display_login"]),
       gravatar_id: decode_gravatar_id(m["gravatar_id"]),
       id: decode_id(m["id"]),
       login: decode_login(m["login"]),
@@ -1573,21 +1579,63 @@ defmodule Payload do
           size: integer() | nil
         }
 
+  def decode_action(value) when is_binary(value), do: value
+  def decode_action(_), do: {:error, "Unexpected type when decoding Payload.action"}
+
+  def encode_action(value) when is_binary(value), do: value
+  def encode_action(_), do: {:error, "Unexpected type when encoding Payload.action"}
+
+  def decode_before(value) when is_binary(value), do: value
+  def decode_before(_), do: {:error, "Unexpected type when decoding Payload.before"}
+
+  def encode_before(value) when is_binary(value), do: value
+  def encode_before(_), do: {:error, "Unexpected type when encoding Payload.before"}
+
+  def decode_head(value) when is_binary(value), do: value
+  def decode_head(_), do: {:error, "Unexpected type when decoding Payload.head"}
+
+  def encode_head(value) when is_binary(value), do: value
+  def encode_head(_), do: {:error, "Unexpected type when encoding Payload.head"}
+
+  def decode_master_branch(value) when is_binary(value), do: value
+  def decode_master_branch(_), do: {:error, "Unexpected type when decoding Payload.master_branch"}
+
+  def encode_master_branch(value) when is_binary(value), do: value
+  def encode_master_branch(_), do: {:error, "Unexpected type when encoding Payload.master_branch"}
+
+  def decode_pusher_type(value) when is_binary(value), do: value
+  def decode_pusher_type(_), do: {:error, "Unexpected type when decoding Payload.pusher_type"}
+
+  def encode_pusher_type(value) when is_binary(value), do: value
+  def encode_pusher_type(_), do: {:error, "Unexpected type when encoding Payload.pusher_type"}
+
+  def decode_ref(value) when is_binary(value), do: value
+  def decode_ref(_), do: {:error, "Unexpected type when decoding Payload.ref"}
+
+  def encode_ref(value) when is_binary(value), do: value
+  def encode_ref(_), do: {:error, "Unexpected type when encoding Payload.ref"}
+
+  def decode_ref_type(value) when is_binary(value), do: value
+  def decode_ref_type(_), do: {:error, "Unexpected type when decoding Payload.ref_type"}
+
+  def encode_ref_type(value) when is_binary(value), do: value
+  def encode_ref_type(_), do: {:error, "Unexpected type when encoding Payload.ref_type"}
+
   def from_map(m) do
     %Payload{
-      action: m["action"],
-      before: m["before"],
+      action: m["action"] && decode_action(m["action"]),
+      before: m["before"] && decode_before(m["before"]),
       commits: m["commits"] && Enum.map(m["commits"], &Commit.from_map/1),
       description: m["description"],
       distinct_size: m["distinct_size"],
-      head: m["head"],
-      master_branch: m["master_branch"],
+      head: m["head"] && decode_head(m["head"]),
+      master_branch: m["master_branch"] && decode_master_branch(m["master_branch"]),
       number: m["number"],
       pull_request: m["pull_request"] && PullRequest.from_map(m["pull_request"]),
       push_id: m["push_id"],
-      pusher_type: m["pusher_type"],
-      ref: m["ref"],
-      ref_type: m["ref_type"],
+      pusher_type: m["pusher_type"] && decode_pusher_type(m["pusher_type"]),
+      ref: m["ref"] && decode_ref(m["ref"]),
+      ref_type: m["ref_type"] && decode_ref_type(m["ref_type"]),
       size: m["size"],
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/0cffa.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/0cffa.json/default/QuickType.ex
index 683ea55..4065f31 100644
--- a/base/elixir/test/inputs/json/misc/0cffa.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/0cffa.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule The480_WStill do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding The480_WStill.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding The480_WStill.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding The480_WStill.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding The480_WStill.url"}
 
@@ -37,7 +43,7 @@ defmodule The480_WStill do
   def from_map(m) do
     %The480_WStill{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -148,12 +154,36 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
+  def decode_hash(value) when is_binary(value), do: value
+  def decode_hash(_), do: {:error, "Unexpected type when decoding FixedHeight.hash"}
+
+  def encode_hash(value) when is_binary(value), do: value
+  def encode_hash(_), do: {:error, "Unexpected type when encoding FixedHeight.hash"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -186,11 +216,11 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
-      hash: m["hash"],
+      frames: m["frames"] && decode_frames(m["frames"]),
+      hash: m["hash"] && decode_hash(m["hash"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
diff --git a/base/elixir/test/inputs/json/misc/127a1.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/127a1.json/default/QuickType.ex
index f204979..0152d9c 100644
--- a/base/elixir/test/inputs/json/misc/127a1.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/127a1.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule The480_WStill do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding The480_WStill.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding The480_WStill.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding The480_WStill.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding The480_WStill.url"}
 
@@ -37,7 +43,7 @@ defmodule The480_WStill do
   def from_map(m) do
     %The480_WStill{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -148,12 +154,36 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
+  def decode_hash(value) when is_binary(value), do: value
+  def decode_hash(_), do: {:error, "Unexpected type when decoding FixedHeight.hash"}
+
+  def encode_hash(value) when is_binary(value), do: value
+  def encode_hash(_), do: {:error, "Unexpected type when encoding FixedHeight.hash"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -186,11 +216,11 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
-      hash: m["hash"],
+      frames: m["frames"] && decode_frames(m["frames"]),
+      hash: m["hash"] && decode_hash(m["hash"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
@@ -549,13 +579,19 @@ defmodule User do
   def encode_profile_url(value) when is_binary(value), do: value
   def encode_profile_url(_), do: {:error, "Unexpected type when encoding User.profile_url"}
 
+  def decode_twitter(value) when is_binary(value), do: value
+  def decode_twitter(_), do: {:error, "Unexpected type when decoding User.twitter"}
+
+  def encode_twitter(value) when is_binary(value), do: value
+  def encode_twitter(_), do: {:error, "Unexpected type when encoding User.twitter"}
+
   def from_map(m) do
     %User{
       avatar_url: decode_avatar_url(m["avatar_url"]),
       banner_url: decode_banner_url(m["banner_url"]),
       display_name: decode_display_name(m["display_name"]),
       profile_url: decode_profile_url(m["profile_url"]),
-      twitter: m["twitter"],
+      twitter: m["twitter"] && decode_twitter(m["twitter"]),
       username: Username.decode(m["username"]),
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/176f1.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/176f1.json/default/QuickType.ex
index b988c51..9b68dfe 100644
--- a/base/elixir/test/inputs/json/misc/176f1.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/176f1.json/default/QuickType.ex
@@ -13,10 +13,22 @@ defmodule Footnote do
           text: String.t() | nil
         }
 
+  def decode_code(value) when is_binary(value), do: value
+  def decode_code(_), do: {:error, "Unexpected type when decoding Footnote.code"}
+
+  def encode_code(value) when is_binary(value), do: value
+  def encode_code(_), do: {:error, "Unexpected type when encoding Footnote.code"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding Footnote.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding Footnote.text"}
+
   def from_map(m) do
     %Footnote{
-      code: m["code"],
-      text: m["text"],
+      code: m["code"] && decode_code(m["code"]),
+      text: m["text"] && decode_text(m["text"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/1b409.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/1b409.json/default/QuickType.ex
index 7e199b3..4e2bd44 100644
--- a/base/elixir/test/inputs/json/misc/1b409.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/1b409.json/default/QuickType.ex
@@ -80,19 +80,31 @@ defmodule Extra do
   def encode_address(value) when is_binary(value), do: value
   def encode_address(_), do: {:error, "Unexpected type when encoding Extra.address"}
 
+  def decode_contact_form(value) when is_binary(value), do: value
+  def decode_contact_form(_), do: {:error, "Unexpected type when decoding Extra.contact_form"}
+
+  def encode_contact_form(value) when is_binary(value), do: value
+  def encode_contact_form(_), do: {:error, "Unexpected type when encoding Extra.contact_form"}
+
   def decode_office(value) when is_binary(value), do: value
   def decode_office(_), do: {:error, "Unexpected type when decoding Extra.office"}
 
   def encode_office(value) when is_binary(value), do: value
   def encode_office(_), do: {:error, "Unexpected type when encoding Extra.office"}
 
+  def decode_rss_url(value) when is_binary(value), do: value
+  def decode_rss_url(_), do: {:error, "Unexpected type when decoding Extra.rss_url"}
+
+  def encode_rss_url(value) when is_binary(value), do: value
+  def encode_rss_url(_), do: {:error, "Unexpected type when encoding Extra.rss_url"}
+
   def from_map(m) do
     %Extra{
       address: decode_address(m["address"]),
-      contact_form: m["contact_form"],
+      contact_form: m["contact_form"] && decode_contact_form(m["contact_form"]),
       fax: m["fax"],
       office: decode_office(m["office"]),
-      rss_url: m["rss_url"],
+      rss_url: m["rss_url"] && decode_rss_url(m["rss_url"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/26b49.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/26b49.json/default/QuickType.ex
index cad56db..375ff46 100644
--- a/base/elixir/test/inputs/json/misc/26b49.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/26b49.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule The480_WStill do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding The480_WStill.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding The480_WStill.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding The480_WStill.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding The480_WStill.url"}
 
@@ -37,7 +43,7 @@ defmodule The480_WStill do
   def from_map(m) do
     %The480_WStill{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -148,12 +154,36 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
+  def decode_hash(value) when is_binary(value), do: value
+  def decode_hash(_), do: {:error, "Unexpected type when decoding FixedHeight.hash"}
+
+  def encode_hash(value) when is_binary(value), do: value
+  def encode_hash(_), do: {:error, "Unexpected type when encoding FixedHeight.hash"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -186,11 +216,11 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
-      hash: m["hash"],
+      frames: m["frames"] && decode_frames(m["frames"]),
+      hash: m["hash"] && decode_hash(m["hash"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
@@ -507,6 +537,12 @@ defmodule User do
   def encode_profile_url(value) when is_binary(value), do: value
   def encode_profile_url(_), do: {:error, "Unexpected type when encoding User.profile_url"}
 
+  def decode_twitter(value) when is_binary(value), do: value
+  def decode_twitter(_), do: {:error, "Unexpected type when decoding User.twitter"}
+
+  def encode_twitter(value) when is_binary(value), do: value
+  def encode_twitter(_), do: {:error, "Unexpected type when encoding User.twitter"}
+
   def decode_username(value) when is_binary(value), do: value
   def decode_username(_), do: {:error, "Unexpected type when decoding User.username"}
 
@@ -519,7 +555,7 @@ defmodule User do
       banner_url: decode_banner_url(m["banner_url"]),
       display_name: decode_display_name(m["display_name"]),
       profile_url: decode_profile_url(m["profile_url"]),
-      twitter: m["twitter"],
+      twitter: m["twitter"] && decode_twitter(m["twitter"]),
       username: decode_username(m["username"]),
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/26c9c.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/26c9c.json/default/QuickType.ex
index b184dc8..f9bd201 100644
--- a/base/elixir/test/inputs/json/misc/26c9c.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/26c9c.json/default/QuickType.ex
@@ -67,6 +67,12 @@ defmodule CachedContents do
           top: [Top.t()]
         }
 
+  def decode_average(value) when is_binary(value), do: value
+  def decode_average(_), do: {:error, "Unexpected type when decoding CachedContents.average"}
+
+  def encode_average(value) when is_binary(value), do: value
+  def encode_average(_), do: {:error, "Unexpected type when encoding CachedContents.average"}
+
   def decode_largest(value) when is_binary(value), do: value
   def decode_largest(_), do: {:error, "Unexpected type when decoding CachedContents.largest"}
 
@@ -91,6 +97,12 @@ defmodule CachedContents do
   def encode_smallest(value) when is_binary(value), do: value
   def encode_smallest(_), do: {:error, "Unexpected type when encoding CachedContents.smallest"}
 
+  def decode_sum(value) when is_binary(value), do: value
+  def decode_sum(_), do: {:error, "Unexpected type when decoding CachedContents.sum"}
+
+  def encode_sum(value) when is_binary(value), do: value
+  def encode_sum(_), do: {:error, "Unexpected type when encoding CachedContents.sum"}
+
   def decode_top(value) when is_list(value), do: value
   def decode_top(_), do: {:error, "Unexpected type when decoding CachedContents.top"}
 
@@ -99,12 +111,12 @@ defmodule CachedContents do
 
   def from_map(m) do
     %CachedContents{
-      average: m["average"],
+      average: m["average"] && decode_average(m["average"]),
       largest: decode_largest(m["largest"]),
       non_null: decode_non_null(m["non_null"]),
       null: decode_null(m["null"]),
       smallest: decode_smallest(m["smallest"]),
-      sum: m["sum"],
+      sum: m["sum"] && decode_sum(m["sum"]),
       top: Enum.map(m["top"], &Top.from_map/1),
     }
   end
@@ -144,12 +156,36 @@ defmodule Format do
           view: String.t() | nil
         }
 
+  def decode_align(value) when is_binary(value), do: value
+  def decode_align(_), do: {:error, "Unexpected type when decoding Format.align"}
+
+  def encode_align(value) when is_binary(value), do: value
+  def encode_align(_), do: {:error, "Unexpected type when encoding Format.align"}
+
+  def decode_no_commas(value) when is_binary(value), do: value
+  def decode_no_commas(_), do: {:error, "Unexpected type when decoding Format.no_commas"}
+
+  def encode_no_commas(value) when is_binary(value), do: value
+  def encode_no_commas(_), do: {:error, "Unexpected type when encoding Format.no_commas"}
+
+  def decode_precision_style(value) when is_binary(value), do: value
+  def decode_precision_style(_), do: {:error, "Unexpected type when decoding Format.precision_style"}
+
+  def encode_precision_style(value) when is_binary(value), do: value
+  def encode_precision_style(_), do: {:error, "Unexpected type when encoding Format.precision_style"}
+
+  def decode_view(value) when is_binary(value), do: value
+  def decode_view(_), do: {:error, "Unexpected type when decoding Format.view"}
+
+  def encode_view(value) when is_binary(value), do: value
+  def encode_view(_), do: {:error, "Unexpected type when encoding Format.view"}
+
   def from_map(m) do
     %Format{
-      align: m["align"],
-      no_commas: m["noCommas"],
-      precision_style: m["precisionStyle"],
-      view: m["view"],
+      align: m["align"] && decode_align(m["align"]),
+      no_commas: m["noCommas"] && decode_no_commas(m["noCommas"]),
+      precision_style: m["precisionStyle"] && decode_precision_style(m["precisionStyle"]),
+      view: m["view"] && decode_view(m["view"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/27332.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/27332.json/default/QuickType.ex
index be06071..30588b1 100644
--- a/base/elixir/test/inputs/json/misc/27332.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/27332.json/default/QuickType.ex
@@ -237,9 +237,15 @@ defmodule MediaEmbed do
           width: integer() | nil
         }
 
+  def decode_content(value) when is_binary(value), do: value
+  def decode_content(_), do: {:error, "Unexpected type when decoding MediaEmbed.content"}
+
+  def encode_content(value) when is_binary(value), do: value
+  def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
+
   def from_map(m) do
     %MediaEmbed{
-      content: m["content"],
+      content: m["content"] && decode_content(m["content"]),
       height: m["height"],
       scrolling: m["scrolling"],
       width: m["width"],
diff --git a/base/elixir/test/inputs/json/misc/2d4e2.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/2d4e2.json/default/QuickType.ex
index 1c2e2fc..0451ecd 100644
--- a/base/elixir/test/inputs/json/misc/2d4e2.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/2d4e2.json/default/QuickType.ex
@@ -133,19 +133,31 @@ defmodule Extra do
   def encode_contact_form(value) when is_binary(value), do: value
   def encode_contact_form(_), do: {:error, "Unexpected type when encoding Extra.contact_form"}
 
+  def decode_fax(value) when is_binary(value), do: value
+  def decode_fax(_), do: {:error, "Unexpected type when decoding Extra.fax"}
+
+  def encode_fax(value) when is_binary(value), do: value
+  def encode_fax(_), do: {:error, "Unexpected type when encoding Extra.fax"}
+
   def decode_office(value) when is_binary(value), do: value
   def decode_office(_), do: {:error, "Unexpected type when decoding Extra.office"}
 
   def encode_office(value) when is_binary(value), do: value
   def encode_office(_), do: {:error, "Unexpected type when encoding Extra.office"}
 
+  def decode_rss_url(value) when is_binary(value), do: value
+  def decode_rss_url(_), do: {:error, "Unexpected type when decoding Extra.rss_url"}
+
+  def encode_rss_url(value) when is_binary(value), do: value
+  def encode_rss_url(_), do: {:error, "Unexpected type when encoding Extra.rss_url"}
+
   def from_map(m) do
     %Extra{
       address: decode_address(m["address"]),
       contact_form: decode_contact_form(m["contact_form"]),
-      fax: m["fax"],
+      fax: m["fax"] && decode_fax(m["fax"]),
       office: decode_office(m["office"]),
-      rss_url: m["rss_url"],
+      rss_url: m["rss_url"] && decode_rss_url(m["rss_url"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/33d2e.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/33d2e.json/default/QuickType.ex
index 4d1e705..d95793d 100644
--- a/base/elixir/test/inputs/json/misc/33d2e.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/33d2e.json/default/QuickType.ex
@@ -61,11 +61,29 @@ defmodule AffiliationClass do
           name: String.t() | nil
         }
 
+  def decode_city(value) when is_binary(value), do: value
+  def decode_city(_), do: {:error, "Unexpected type when decoding AffiliationClass.city"}
+
+  def encode_city(value) when is_binary(value), do: value
+  def encode_city(_), do: {:error, "Unexpected type when encoding AffiliationClass.city"}
+
+  def decode_country(value) when is_binary(value), do: value
+  def decode_country(_), do: {:error, "Unexpected type when decoding AffiliationClass.country"}
+
+  def encode_country(value) when is_binary(value), do: value
+  def encode_country(_), do: {:error, "Unexpected type when encoding AffiliationClass.country"}
+
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding AffiliationClass.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding AffiliationClass.name"}
+
   def from_map(m) do
     %AffiliationClass{
-      city: m["city"],
-      country: m["country"],
-      name: m["name"],
+      city: m["city"] && decode_city(m["city"]),
+      country: m["country"] && decode_country(m["country"]),
+      name: m["name"] && decode_name(m["name"]),
     }
   end
 
@@ -167,14 +185,38 @@ defmodule Prize do
   def encode_affiliations_element(value) when is_list(value), do: value
   def encode_affiliations_element(_), do: {:error, "Unexpected type when encoding Prize.affiliations"}
 
+  def decode_motivation(value) when is_binary(value), do: value
+  def decode_motivation(_), do: {:error, "Unexpected type when decoding Prize.motivation"}
+
+  def encode_motivation(value) when is_binary(value), do: value
+  def encode_motivation(_), do: {:error, "Unexpected type when encoding Prize.motivation"}
+
+  def decode_overall_motivation(value) when is_binary(value), do: value
+  def decode_overall_motivation(_), do: {:error, "Unexpected type when decoding Prize.overall_motivation"}
+
+  def encode_overall_motivation(value) when is_binary(value), do: value
+  def encode_overall_motivation(_), do: {:error, "Unexpected type when encoding Prize.overall_motivation"}
+
+  def decode_share(value) when is_binary(value), do: value
+  def decode_share(_), do: {:error, "Unexpected type when decoding Prize.share"}
+
+  def encode_share(value) when is_binary(value), do: value
+  def encode_share(_), do: {:error, "Unexpected type when encoding Prize.share"}
+
+  def decode_year(value) when is_binary(value), do: value
+  def decode_year(_), do: {:error, "Unexpected type when decoding Prize.year"}
+
+  def encode_year(value) when is_binary(value), do: value
+  def encode_year(_), do: {:error, "Unexpected type when encoding Prize.year"}
+
   def from_map(m) do
     %Prize{
       affiliations: Enum.map(m["affiliations"], &decode_affiliations_element/1),
       category: m["category"] && Category.decode(m["category"]),
-      motivation: m["motivation"],
-      overall_motivation: m["overallMotivation"],
-      share: m["share"],
-      year: m["year"],
+      motivation: m["motivation"] && decode_motivation(m["motivation"]),
+      overall_motivation: m["overallMotivation"] && decode_overall_motivation(m["overallMotivation"]),
+      share: m["share"] && decode_share(m["share"]),
+      year: m["year"] && decode_year(m["year"]),
     }
   end
 
@@ -228,12 +270,54 @@ defmodule Laureate do
   def encode_born(value) when is_binary(value), do: value
   def encode_born(_), do: {:error, "Unexpected type when encoding Laureate.born"}
 
+  def decode_born_city(value) when is_binary(value), do: value
+  def decode_born_city(_), do: {:error, "Unexpected type when decoding Laureate.born_city"}
+
+  def encode_born_city(value) when is_binary(value), do: value
+  def encode_born_city(_), do: {:error, "Unexpected type when encoding Laureate.born_city"}
+
+  def decode_born_country(value) when is_binary(value), do: value
+  def decode_born_country(_), do: {:error, "Unexpected type when decoding Laureate.born_country"}
+
+  def encode_born_country(value) when is_binary(value), do: value
+  def encode_born_country(_), do: {:error, "Unexpected type when encoding Laureate.born_country"}
+
+  def decode_born_country_code(value) when is_binary(value), do: value
+  def decode_born_country_code(_), do: {:error, "Unexpected type when decoding Laureate.born_country_code"}
+
+  def encode_born_country_code(value) when is_binary(value), do: value
+  def encode_born_country_code(_), do: {:error, "Unexpected type when encoding Laureate.born_country_code"}
+
   def decode_died(value) when is_binary(value), do: value
   def decode_died(_), do: {:error, "Unexpected type when decoding Laureate.died"}
 
   def encode_died(value) when is_binary(value), do: value
   def encode_died(_), do: {:error, "Unexpected type when encoding Laureate.died"}
 
+  def decode_died_city(value) when is_binary(value), do: value
+  def decode_died_city(_), do: {:error, "Unexpected type when decoding Laureate.died_city"}
+
+  def encode_died_city(value) when is_binary(value), do: value
+  def encode_died_city(_), do: {:error, "Unexpected type when encoding Laureate.died_city"}
+
+  def decode_died_country(value) when is_binary(value), do: value
+  def decode_died_country(_), do: {:error, "Unexpected type when decoding Laureate.died_country"}
+
+  def encode_died_country(value) when is_binary(value), do: value
+  def encode_died_country(_), do: {:error, "Unexpected type when encoding Laureate.died_country"}
+
+  def decode_died_country_code(value) when is_binary(value), do: value
+  def decode_died_country_code(_), do: {:error, "Unexpected type when decoding Laureate.died_country_code"}
+
+  def encode_died_country_code(value) when is_binary(value), do: value
+  def encode_died_country_code(_), do: {:error, "Unexpected type when encoding Laureate.died_country_code"}
+
+  def decode_firstname(value) when is_binary(value), do: value
+  def decode_firstname(_), do: {:error, "Unexpected type when decoding Laureate.firstname"}
+
+  def encode_firstname(value) when is_binary(value), do: value
+  def encode_firstname(_), do: {:error, "Unexpected type when encoding Laureate.firstname"}
+
   def decode_id(value) when is_binary(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Laureate.id"}
 
@@ -246,21 +330,27 @@ defmodule Laureate do
   def encode_prizes(value) when is_list(value), do: value
   def encode_prizes(_), do: {:error, "Unexpected type when encoding Laureate.prizes"}
 
+  def decode_surname(value) when is_binary(value), do: value
+  def decode_surname(_), do: {:error, "Unexpected type when decoding Laureate.surname"}
+
+  def encode_surname(value) when is_binary(value), do: value
+  def encode_surname(_), do: {:error, "Unexpected type when encoding Laureate.surname"}
+
   def from_map(m) do
     %Laureate{
       born: decode_born(m["born"]),
-      born_city: m["bornCity"],
-      born_country: m["bornCountry"],
-      born_country_code: m["bornCountryCode"],
+      born_city: m["bornCity"] && decode_born_city(m["bornCity"]),
+      born_country: m["bornCountry"] && decode_born_country(m["bornCountry"]),
+      born_country_code: m["bornCountryCode"] && decode_born_country_code(m["bornCountryCode"]),
       died: decode_died(m["died"]),
-      died_city: m["diedCity"],
-      died_country: m["diedCountry"],
-      died_country_code: m["diedCountryCode"],
-      firstname: m["firstname"],
+      died_city: m["diedCity"] && decode_died_city(m["diedCity"]),
+      died_country: m["diedCountry"] && decode_died_country(m["diedCountry"]),
+      died_country_code: m["diedCountryCode"] && decode_died_country_code(m["diedCountryCode"]),
+      firstname: m["firstname"] && decode_firstname(m["firstname"]),
       gender: Gender.decode(m["gender"]),
       id: decode_id(m["id"]),
       prizes: Enum.map(m["prizes"], &Prize.from_map/1),
-      surname: m["surname"],
+      surname: m["surname"] && decode_surname(m["surname"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/3e9a3.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/3e9a3.json/default/QuickType.ex
index b988c51..9b68dfe 100644
--- a/base/elixir/test/inputs/json/misc/3e9a3.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/3e9a3.json/default/QuickType.ex
@@ -13,10 +13,22 @@ defmodule Footnote do
           text: String.t() | nil
         }
 
+  def decode_code(value) when is_binary(value), do: value
+  def decode_code(_), do: {:error, "Unexpected type when decoding Footnote.code"}
+
+  def encode_code(value) when is_binary(value), do: value
+  def encode_code(_), do: {:error, "Unexpected type when encoding Footnote.code"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding Footnote.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding Footnote.text"}
+
   def from_map(m) do
     %Footnote{
-      code: m["code"],
-      text: m["text"],
+      code: m["code"] && decode_code(m["code"]),
+      text: m["text"] && decode_text(m["text"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/421d4.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/421d4.json/default/QuickType.ex
index 3db23cc..939160d 100644
--- a/base/elixir/test/inputs/json/misc/421d4.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/421d4.json/default/QuickType.ex
@@ -67,6 +67,18 @@ defmodule CachedContents do
           top: [Top.t()] | nil
         }
 
+  def decode_average(value) when is_binary(value), do: value
+  def decode_average(_), do: {:error, "Unexpected type when decoding CachedContents.average"}
+
+  def encode_average(value) when is_binary(value), do: value
+  def encode_average(_), do: {:error, "Unexpected type when encoding CachedContents.average"}
+
+  def decode_largest(value) when is_binary(value), do: value
+  def decode_largest(_), do: {:error, "Unexpected type when decoding CachedContents.largest"}
+
+  def encode_largest(value) when is_binary(value), do: value
+  def encode_largest(_), do: {:error, "Unexpected type when encoding CachedContents.largest"}
+
   def decode_non_null(value) when is_integer(value), do: value
   def decode_non_null(_), do: {:error, "Unexpected type when decoding CachedContents.non_null"}
 
@@ -79,14 +91,26 @@ defmodule CachedContents do
   def encode_null(value) when is_integer(value), do: value
   def encode_null(_), do: {:error, "Unexpected type when encoding CachedContents.null"}
 
+  def decode_smallest(value) when is_binary(value), do: value
+  def decode_smallest(_), do: {:error, "Unexpected type when decoding CachedContents.smallest"}
+
+  def encode_smallest(value) when is_binary(value), do: value
+  def encode_smallest(_), do: {:error, "Unexpected type when encoding CachedContents.smallest"}
+
+  def decode_sum(value) when is_binary(value), do: value
+  def decode_sum(_), do: {:error, "Unexpected type when decoding CachedContents.sum"}
+
+  def encode_sum(value) when is_binary(value), do: value
+  def encode_sum(_), do: {:error, "Unexpected type when encoding CachedContents.sum"}
+
   def from_map(m) do
     %CachedContents{
-      average: m["average"],
-      largest: m["largest"],
+      average: m["average"] && decode_average(m["average"]),
+      largest: m["largest"] && decode_largest(m["largest"]),
       non_null: decode_non_null(m["non_null"]),
       null: decode_null(m["null"]),
-      smallest: m["smallest"],
-      sum: m["sum"],
+      smallest: m["smallest"] && decode_smallest(m["smallest"]),
+      sum: m["sum"] && decode_sum(m["sum"]),
       top: m["top"] && Enum.map(m["top"], &Top.from_map/1),
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/437e7.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/437e7.json/default/QuickType.ex
index bfd9dd6..83728ed 100644
--- a/base/elixir/test/inputs/json/misc/437e7.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/437e7.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule Downsized do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding Downsized.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding Downsized.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding Downsized.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding Downsized.url"}
 
@@ -37,7 +43,7 @@ defmodule Downsized do
   def from_map(m) do
     %Downsized{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -147,12 +153,30 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -185,10 +209,10 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
+      frames: m["frames"] && decode_frames(m["frames"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
diff --git a/base/elixir/test/inputs/json/misc/4d6fb.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/4d6fb.json/default/QuickType.ex
index b7a21b8..22cc61d 100644
--- a/base/elixir/test/inputs/json/misc/4d6fb.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/4d6fb.json/default/QuickType.ex
@@ -204,9 +204,15 @@ defmodule MediaEmbed do
           width: integer() | nil
         }
 
+  def decode_content(value) when is_binary(value), do: value
+  def decode_content(_), do: {:error, "Unexpected type when decoding MediaEmbed.content"}
+
+  def encode_content(value) when is_binary(value), do: value
+  def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
+
   def from_map(m) do
     %MediaEmbed{
-      content: m["content"],
+      content: m["content"] && decode_content(m["content"]),
       height: m["height"],
       scrolling: m["scrolling"],
       width: m["width"],
diff --git a/base/elixir/test/inputs/json/misc/5f7fe.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/5f7fe.json/default/QuickType.ex
index 1e4bd0d..f5b0703 100644
--- a/base/elixir/test/inputs/json/misc/5f7fe.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/5f7fe.json/default/QuickType.ex
@@ -183,10 +183,22 @@ defmodule Format do
           view: String.t() | nil
         }
 
+  def decode_align(value) when is_binary(value), do: value
+  def decode_align(_), do: {:error, "Unexpected type when decoding Format.align"}
+
+  def encode_align(value) when is_binary(value), do: value
+  def encode_align(_), do: {:error, "Unexpected type when encoding Format.align"}
+
+  def decode_view(value) when is_binary(value), do: value
+  def decode_view(_), do: {:error, "Unexpected type when decoding Format.view"}
+
+  def encode_view(value) when is_binary(value), do: value
+  def encode_view(_), do: {:error, "Unexpected type when encoding Format.view"}
+
   def from_map(m) do
     %Format{
-      align: m["align"],
-      view: m["view"],
+      align: m["align"] && decode_align(m["align"]),
+      view: m["view"] && decode_view(m["view"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/617e8.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/617e8.json/default/QuickType.ex
index 40ef26c..e98e9ab 100644
--- a/base/elixir/test/inputs/json/misc/617e8.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/617e8.json/default/QuickType.ex
@@ -183,10 +183,22 @@ defmodule Format do
           view: String.t() | nil
         }
 
+  def decode_align(value) when is_binary(value), do: value
+  def decode_align(_), do: {:error, "Unexpected type when decoding Format.align"}
+
+  def encode_align(value) when is_binary(value), do: value
+  def encode_align(_), do: {:error, "Unexpected type when encoding Format.align"}
+
+  def decode_view(value) when is_binary(value), do: value
+  def decode_view(_), do: {:error, "Unexpected type when decoding Format.view"}
+
+  def encode_view(value) when is_binary(value), do: value
+  def encode_view(_), do: {:error, "Unexpected type when encoding Format.view"}
+
   def from_map(m) do
     %Format{
-      align: m["align"],
-      view: m["view"],
+      align: m["align"] && decode_align(m["align"]),
+      view: m["view"] && decode_view(m["view"]),
     }
   end
 
@@ -229,6 +241,12 @@ defmodule Column do
           width: integer() | nil
         }
 
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding Column.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding Column.description"}
+
   def decode_field_name(value) when is_binary(value), do: value
   def decode_field_name(_), do: {:error, "Unexpected type when decoding Column.field_name"}
 
@@ -257,7 +275,7 @@ defmodule Column do
     %Column{
       cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
       data_type_name: TypeName.decode(m["dataTypeName"]),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       field_name: decode_field_name(m["fieldName"]),
       flags: m["flags"],
       format: Format.from_map(m["format"]),
diff --git a/base/elixir/test/inputs/json/misc/65dec.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/65dec.json/default/QuickType.ex
index f7f8954..3c8d5e1 100644
--- a/base/elixir/test/inputs/json/misc/65dec.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/65dec.json/default/QuickType.ex
@@ -430,6 +430,12 @@ defmodule Card do
   def encode_cmc(value) when is_integer(value), do: value
   def encode_cmc(_), do: {:error, "Unexpected type when encoding Card.cmc"}
 
+  def decode_flavor(value) when is_binary(value), do: value
+  def decode_flavor(_), do: {:error, "Unexpected type when decoding Card.flavor"}
+
+  def encode_flavor(value) when is_binary(value), do: value
+  def encode_flavor(_), do: {:error, "Unexpected type when encoding Card.flavor"}
+
   def decode_id(value) when is_binary(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Card.id"}
 
@@ -448,6 +454,18 @@ defmodule Card do
   def encode_legalities(value) when is_list(value), do: value
   def encode_legalities(_), do: {:error, "Unexpected type when encoding Card.legalities"}
 
+  def decode_mana_cost(value) when is_binary(value), do: value
+  def decode_mana_cost(_), do: {:error, "Unexpected type when decoding Card.mana_cost"}
+
+  def encode_mana_cost(value) when is_binary(value), do: value
+  def encode_mana_cost(_), do: {:error, "Unexpected type when encoding Card.mana_cost"}
+
+  def decode_mci_number(value) when is_binary(value), do: value
+  def decode_mci_number(_), do: {:error, "Unexpected type when decoding Card.mci_number"}
+
+  def encode_mci_number(value) when is_binary(value), do: value
+  def encode_mci_number(_), do: {:error, "Unexpected type when encoding Card.mci_number"}
+
   def decode_multiverseid(value) when is_integer(value), do: value
   def decode_multiverseid(_), do: {:error, "Unexpected type when decoding Card.multiverseid"}
 
@@ -472,12 +490,30 @@ defmodule Card do
   def encode_original_type(value) when is_binary(value), do: value
   def encode_original_type(_), do: {:error, "Unexpected type when encoding Card.original_type"}
 
+  def decode_power(value) when is_binary(value), do: value
+  def decode_power(_), do: {:error, "Unexpected type when decoding Card.power"}
+
+  def encode_power(value) when is_binary(value), do: value
+  def encode_power(_), do: {:error, "Unexpected type when encoding Card.power"}
+
   def decode_printings(value) when is_list(value), do: value
   def decode_printings(_), do: {:error, "Unexpected type when decoding Card.printings"}
 
   def encode_printings(value) when is_list(value), do: value
   def encode_printings(_), do: {:error, "Unexpected type when encoding Card.printings"}
 
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding Card.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding Card.text"}
+
+  def decode_toughness(value) when is_binary(value), do: value
+  def decode_toughness(_), do: {:error, "Unexpected type when decoding Card.toughness"}
+
+  def encode_toughness(value) when is_binary(value), do: value
+  def encode_toughness(_), do: {:error, "Unexpected type when encoding Card.toughness"}
+
   def decode_type(value) when is_binary(value), do: value
   def decode_type(_), do: {:error, "Unexpected type when decoding Card.type"}
 
@@ -496,26 +532,26 @@ defmodule Card do
       cmc: decode_cmc(m["cmc"]),
       color_identity: m["colorIdentity"] && Enum.map(m["colorIdentity"], &ColorIdentity.decode/1),
       colors: m["colors"] && Enum.map(m["colors"], &Watermark.decode/1),
-      flavor: m["flavor"],
+      flavor: m["flavor"] && decode_flavor(m["flavor"]),
       id: decode_id(m["id"]),
       image_name: decode_image_name(m["imageName"]),
       layout: Layout.decode(m["layout"]),
       legalities: Enum.map(m["legalities"], &LegalityElement.from_map/1),
-      mana_cost: m["manaCost"],
-      mci_number: m["mciNumber"],
+      mana_cost: m["manaCost"] && decode_mana_cost(m["manaCost"]),
+      mci_number: m["mciNumber"] && decode_mci_number(m["mciNumber"]),
       multiverseid: decode_multiverseid(m["multiverseid"]),
       name: decode_name(m["name"]),
       original_text: decode_original_text(m["originalText"]),
       original_type: decode_original_type(m["originalType"]),
-      power: m["power"],
+      power: m["power"] && decode_power(m["power"]),
       printings: decode_printings(m["printings"]),
       rarity: Rarity.decode(m["rarity"]),
       reserved: m["reserved"],
       rulings: m["rulings"] && Enum.map(m["rulings"], &Ruling.from_map/1),
       subtypes: m["subtypes"],
       supertypes: m["supertypes"],
-      text: m["text"],
-      toughness: m["toughness"],
+      text: m["text"] && decode_text(m["text"]),
+      toughness: m["toughness"] && decode_toughness(m["toughness"]),
       type: decode_type(m["type"]),
       types: Enum.map(m["types"], &Type.decode/1),
       variations: m["variations"],
diff --git a/base/elixir/test/inputs/json/misc/6de06.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/6de06.json/default/QuickType.ex
index 0551342..fa35207 100644
--- a/base/elixir/test/inputs/json/misc/6de06.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/6de06.json/default/QuickType.ex
@@ -195,9 +195,15 @@ defmodule MediaEmbed do
           width: integer() | nil
         }
 
+  def decode_content(value) when is_binary(value), do: value
+  def decode_content(_), do: {:error, "Unexpected type when decoding MediaEmbed.content"}
+
+  def encode_content(value) when is_binary(value), do: value
+  def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
+
   def from_map(m) do
     %MediaEmbed{
-      content: m["content"],
+      content: m["content"] && decode_content(m["content"]),
       height: m["height"],
       scrolling: m["scrolling"],
       width: m["width"],
diff --git a/base/elixir/test/inputs/json/misc/734ad.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/734ad.json/default/QuickType.ex
index 2c0ef7a..5661f7b 100644
--- a/base/elixir/test/inputs/json/misc/734ad.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/734ad.json/default/QuickType.ex
@@ -187,6 +187,30 @@ defmodule Result do
   def encode_activity_relevant_comm(value) when is_binary(value), do: value
   def encode_activity_relevant_comm(_), do: {:error, "Unexpected type when encoding Result.activity_relevant_comm"}
 
+  def decode_be_office_country(value) when is_binary(value), do: value
+  def decode_be_office_country(_), do: {:error, "Unexpected type when decoding Result.be_office_country"}
+
+  def encode_be_office_country(value) when is_binary(value), do: value
+  def encode_be_office_country(_), do: {:error, "Unexpected type when encoding Result.be_office_country"}
+
+  def decode_be_office_phone(value) when is_binary(value), do: value
+  def decode_be_office_phone(_), do: {:error, "Unexpected type when decoding Result.be_office_phone"}
+
+  def encode_be_office_phone(value) when is_binary(value), do: value
+  def encode_be_office_phone(_), do: {:error, "Unexpected type when encoding Result.be_office_phone"}
+
+  def decode_be_office_street(value) when is_binary(value), do: value
+  def decode_be_office_street(_), do: {:error, "Unexpected type when decoding Result.be_office_street"}
+
+  def encode_be_office_street(value) when is_binary(value), do: value
+  def encode_be_office_street(_), do: {:error, "Unexpected type when encoding Result.be_office_street"}
+
+  def decode_be_office_town(value) when is_binary(value), do: value
+  def decode_be_office_town(_), do: {:error, "Unexpected type when decoding Result.be_office_town"}
+
+  def encode_be_office_town(value) when is_binary(value), do: value
+  def encode_be_office_town(_), do: {:error, "Unexpected type when encoding Result.be_office_town"}
+
   def decode_code_of_conduct(value) when is_binary(value), do: value
   def decode_code_of_conduct(_), do: {:error, "Unexpected type when decoding Result.code_of_conduct"}
 
@@ -368,14 +392,14 @@ defmodule Result do
       activity_inter_groups: decode_activity_inter_groups(m["activity_inter_groups"]),
       activity_other: Map.fetch!(m, "activity_other"),
       activity_relevant_comm: decode_activity_relevant_comm(m["activity_relevant_comm"]),
-      be_office_country: m["be_office_country"],
+      be_office_country: m["be_office_country"] && decode_be_office_country(m["be_office_country"]),
       be_office_lat: m["be_office_lat"],
       be_office_lon: m["be_office_lon"],
-      be_office_phone: m["be_office_phone"],
+      be_office_phone: m["be_office_phone"] && decode_be_office_phone(m["be_office_phone"]),
       be_office_post_code: m["be_office_post_code"],
       be_office_postbox: m["be_office_postbox"],
-      be_office_street: m["be_office_street"],
-      be_office_town: m["be_office_town"],
+      be_office_street: m["be_office_street"] && decode_be_office_street(m["be_office_street"]),
+      be_office_town: m["be_office_town"] && decode_be_office_town(m["be_office_town"]),
       code_of_conduct: decode_code_of_conduct(m["code_of_conduct"]),
       contact_country: decode_contact_country(m["contact_country"]),
       created_at: decode_created_at(m["created_at"]),
diff --git a/base/elixir/test/inputs/json/misc/7681c.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/7681c.json/default/QuickType.ex
index e6dde27..9d40024 100644
--- a/base/elixir/test/inputs/json/misc/7681c.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/7681c.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule The480_WStill do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding The480_WStill.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding The480_WStill.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding The480_WStill.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding The480_WStill.url"}
 
@@ -37,7 +43,7 @@ defmodule The480_WStill do
   def from_map(m) do
     %The480_WStill{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -148,12 +154,36 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
+  def decode_hash(value) when is_binary(value), do: value
+  def decode_hash(_), do: {:error, "Unexpected type when decoding FixedHeight.hash"}
+
+  def encode_hash(value) when is_binary(value), do: value
+  def encode_hash(_), do: {:error, "Unexpected type when encoding FixedHeight.hash"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -186,11 +216,11 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
-      hash: m["hash"],
+      frames: m["frames"] && decode_frames(m["frames"]),
+      hash: m["hash"] && decode_hash(m["hash"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
@@ -503,6 +533,12 @@ defmodule User do
   def encode_profile_url(value) when is_binary(value), do: value
   def encode_profile_url(_), do: {:error, "Unexpected type when encoding User.profile_url"}
 
+  def decode_twitter(value) when is_binary(value), do: value
+  def decode_twitter(_), do: {:error, "Unexpected type when decoding User.twitter"}
+
+  def encode_twitter(value) when is_binary(value), do: value
+  def encode_twitter(_), do: {:error, "Unexpected type when encoding User.twitter"}
+
   def decode_username(value) when is_binary(value), do: value
   def decode_username(_), do: {:error, "Unexpected type when decoding User.username"}
 
@@ -515,7 +551,7 @@ defmodule User do
       banner_url: decode_banner_url(m["banner_url"]),
       display_name: decode_display_name(m["display_name"]),
       profile_url: decode_profile_url(m["profile_url"]),
-      twitter: m["twitter"],
+      twitter: m["twitter"] && decode_twitter(m["twitter"]),
       username: decode_username(m["username"]),
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/77392.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/77392.json/default/QuickType.ex
index 3d5dfa7..25f482e 100644
--- a/base/elixir/test/inputs/json/misc/77392.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/77392.json/default/QuickType.ex
@@ -134,6 +134,12 @@ defmodule TopLevelElement do
   def encode_discovery_date(value) when is_binary(value), do: value
   def encode_discovery_date(_), do: {:error, "Unexpected type when encoding TopLevelElement.discovery_date"}
 
+  def decode_h_mag(value) when is_binary(value), do: value
+  def decode_h_mag(_), do: {:error, "Unexpected type when decoding TopLevelElement.h_mag"}
+
+  def encode_h_mag(value) when is_binary(value), do: value
+  def encode_h_mag(_), do: {:error, "Unexpected type when encoding TopLevelElement.h_mag"}
+
   def decode_i_deg(value) when is_binary(value), do: value
   def decode_i_deg(_), do: {:error, "Unexpected type when decoding TopLevelElement.i_deg"}
 
@@ -146,24 +152,36 @@ defmodule TopLevelElement do
   def encode_moid_au(value) when is_binary(value), do: value
   def encode_moid_au(_), do: {:error, "Unexpected type when encoding TopLevelElement.moid_au"}
 
+  def decode_period_yr(value) when is_binary(value), do: value
+  def decode_period_yr(_), do: {:error, "Unexpected type when decoding TopLevelElement.period_yr"}
+
+  def encode_period_yr(value) when is_binary(value), do: value
+  def encode_period_yr(_), do: {:error, "Unexpected type when encoding TopLevelElement.period_yr"}
+
   def decode_q_au_1(value) when is_binary(value), do: value
   def decode_q_au_1(_), do: {:error, "Unexpected type when decoding TopLevelElement.q_au_1"}
 
   def encode_q_au_1(value) when is_binary(value), do: value
   def encode_q_au_1(_), do: {:error, "Unexpected type when encoding TopLevelElement.q_au_1"}
 
+  def decode_q_au_2(value) when is_binary(value), do: value
+  def decode_q_au_2(_), do: {:error, "Unexpected type when decoding TopLevelElement.q_au_2"}
+
+  def encode_q_au_2(value) when is_binary(value), do: value
+  def encode_q_au_2(_), do: {:error, "Unexpected type when encoding TopLevelElement.q_au_2"}
+
   def from_map(m) do
     %TopLevelElement{
       designation: decode_designation(m["designation"]),
       discovery_date: decode_discovery_date(m["discovery_date"]),
-      h_mag: m["h_mag"],
+      h_mag: m["h_mag"] && decode_h_mag(m["h_mag"]),
       i_deg: decode_i_deg(m["i_deg"]),
       moid_au: decode_moid_au(m["moid_au"]),
       orbit_class: OrbitClass.decode(m["orbit_class"]),
-      period_yr: m["period_yr"],
+      period_yr: m["period_yr"] && decode_period_yr(m["period_yr"]),
       pha: Pha.decode(m["pha"]),
       q_au_1: decode_q_au_1(m["q_au_1"]),
-      q_au_2: m["q_au_2"],
+      q_au_2: m["q_au_2"] && decode_q_au_2(m["q_au_2"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/a3d8c.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/a3d8c.json/default/QuickType.ex
index 6b07b4b..c6809b7 100644
--- a/base/elixir/test/inputs/json/misc/a3d8c.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/a3d8c.json/default/QuickType.ex
@@ -67,6 +67,12 @@ defmodule CachedContents do
           top: [Top.t()]
         }
 
+  def decode_average(value) when is_binary(value), do: value
+  def decode_average(_), do: {:error, "Unexpected type when decoding CachedContents.average"}
+
+  def encode_average(value) when is_binary(value), do: value
+  def encode_average(_), do: {:error, "Unexpected type when encoding CachedContents.average"}
+
   def decode_largest(value) when is_binary(value), do: value
   def decode_largest(_), do: {:error, "Unexpected type when decoding CachedContents.largest"}
 
@@ -91,6 +97,12 @@ defmodule CachedContents do
   def encode_smallest(value) when is_binary(value), do: value
   def encode_smallest(_), do: {:error, "Unexpected type when encoding CachedContents.smallest"}
 
+  def decode_sum(value) when is_binary(value), do: value
+  def decode_sum(_), do: {:error, "Unexpected type when decoding CachedContents.sum"}
+
+  def encode_sum(value) when is_binary(value), do: value
+  def encode_sum(_), do: {:error, "Unexpected type when encoding CachedContents.sum"}
+
   def decode_top(value) when is_list(value), do: value
   def decode_top(_), do: {:error, "Unexpected type when decoding CachedContents.top"}
 
@@ -99,12 +111,12 @@ defmodule CachedContents do
 
   def from_map(m) do
     %CachedContents{
-      average: m["average"],
+      average: m["average"] && decode_average(m["average"]),
       largest: decode_largest(m["largest"]),
       non_null: decode_non_null(m["non_null"]),
       null: decode_null(m["null"]),
       smallest: decode_smallest(m["smallest"]),
-      sum: m["sum"],
+      sum: m["sum"] && decode_sum(m["sum"]),
       top: Enum.map(m["top"], &Top.from_map/1),
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/b4865.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/b4865.json/default/QuickType.ex
index b191784..0edd29b 100644
--- a/base/elixir/test/inputs/json/misc/b4865.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/b4865.json/default/QuickType.ex
@@ -202,12 +202,30 @@ defmodule TopLevelElement do
           year: String.t() | nil
         }
 
+  def decode_computed_region_cbhk_fwbd(value) when is_binary(value), do: value
+  def decode_computed_region_cbhk_fwbd(_), do: {:error, "Unexpected type when decoding TopLevelElement.computed_region_cbhk_fwbd"}
+
+  def encode_computed_region_cbhk_fwbd(value) when is_binary(value), do: value
+  def encode_computed_region_cbhk_fwbd(_), do: {:error, "Unexpected type when encoding TopLevelElement.computed_region_cbhk_fwbd"}
+
+  def decode_computed_region_nnqa_25_f4(value) when is_binary(value), do: value
+  def decode_computed_region_nnqa_25_f4(_), do: {:error, "Unexpected type when decoding TopLevelElement.computed_region_nnqa_25_f4"}
+
+  def encode_computed_region_nnqa_25_f4(value) when is_binary(value), do: value
+  def encode_computed_region_nnqa_25_f4(_), do: {:error, "Unexpected type when encoding TopLevelElement.computed_region_nnqa_25_f4"}
+
   def decode_id(value) when is_binary(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding TopLevelElement.id"}
 
   def encode_id(value) when is_binary(value), do: value
   def encode_id(_), do: {:error, "Unexpected type when encoding TopLevelElement.id"}
 
+  def decode_mass(value) when is_binary(value), do: value
+  def decode_mass(_), do: {:error, "Unexpected type when decoding TopLevelElement.mass"}
+
+  def encode_mass(value) when is_binary(value), do: value
+  def encode_mass(_), do: {:error, "Unexpected type when encoding TopLevelElement.mass"}
+
   def decode_name(value) when is_binary(value), do: value
   def decode_name(_), do: {:error, "Unexpected type when decoding TopLevelElement.name"}
 
@@ -220,20 +238,38 @@ defmodule TopLevelElement do
   def encode_recclass(value) when is_binary(value), do: value
   def encode_recclass(_), do: {:error, "Unexpected type when encoding TopLevelElement.recclass"}
 
+  def decode_reclat(value) when is_binary(value), do: value
+  def decode_reclat(_), do: {:error, "Unexpected type when decoding TopLevelElement.reclat"}
+
+  def encode_reclat(value) when is_binary(value), do: value
+  def encode_reclat(_), do: {:error, "Unexpected type when encoding TopLevelElement.reclat"}
+
+  def decode_reclong(value) when is_binary(value), do: value
+  def decode_reclong(_), do: {:error, "Unexpected type when decoding TopLevelElement.reclong"}
+
+  def encode_reclong(value) when is_binary(value), do: value
+  def encode_reclong(_), do: {:error, "Unexpected type when encoding TopLevelElement.reclong"}
+
+  def decode_year(value) when is_binary(value), do: value
+  def decode_year(_), do: {:error, "Unexpected type when decoding TopLevelElement.year"}
+
+  def encode_year(value) when is_binary(value), do: value
+  def encode_year(_), do: {:error, "Unexpected type when encoding TopLevelElement.year"}
+
   def from_map(m) do
     %TopLevelElement{
-      computed_region_cbhk_fwbd: m[":@computed_region_cbhk_fwbd"],
-      computed_region_nnqa_25_f4: m[":@computed_region_nnqa_25f4"],
+      computed_region_cbhk_fwbd: m[":@computed_region_cbhk_fwbd"] && decode_computed_region_cbhk_fwbd(m[":@computed_region_cbhk_fwbd"]),
+      computed_region_nnqa_25_f4: m[":@computed_region_nnqa_25f4"] && decode_computed_region_nnqa_25_f4(m[":@computed_region_nnqa_25f4"]),
       fall: Fall.decode(m["fall"]),
       geolocation: m["geolocation"] && Geolocation.from_map(m["geolocation"]),
       id: decode_id(m["id"]),
-      mass: m["mass"],
+      mass: m["mass"] && decode_mass(m["mass"]),
       name: decode_name(m["name"]),
       nametype: Nametype.decode(m["nametype"]),
       recclass: decode_recclass(m["recclass"]),
-      reclat: m["reclat"],
-      reclong: m["reclong"],
-      year: m["year"],
+      reclat: m["reclat"] && decode_reclat(m["reclat"]),
+      reclong: m["reclong"] && decode_reclong(m["reclong"]),
+      year: m["year"] && decode_year(m["year"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/misc/be234.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/be234.json/default/QuickType.ex
index 5949263..8c7e7da 100644
--- a/base/elixir/test/inputs/json/misc/be234.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/be234.json/default/QuickType.ex
@@ -238,9 +238,15 @@ defmodule MediaEmbed do
           width: integer() | nil
         }
 
+  def decode_content(value) when is_binary(value), do: value
+  def decode_content(_), do: {:error, "Unexpected type when decoding MediaEmbed.content"}
+
+  def encode_content(value) when is_binary(value), do: value
+  def encode_content(_), do: {:error, "Unexpected type when encoding MediaEmbed.content"}
+
   def from_map(m) do
     %MediaEmbed{
-      content: m["content"],
+      content: m["content"] && decode_content(m["content"]),
       height: m["height"],
       scrolling: m["scrolling"],
       width: m["width"],
diff --git a/base/elixir/test/inputs/json/misc/c3303.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/c3303.json/default/QuickType.ex
index 30f13b9..42eb49f 100644
--- a/base/elixir/test/inputs/json/misc/c3303.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/c3303.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule The480_WStill do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding The480_WStill.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding The480_WStill.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding The480_WStill.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding The480_WStill.url"}
 
@@ -37,7 +43,7 @@ defmodule The480_WStill do
   def from_map(m) do
     %The480_WStill{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -148,12 +154,36 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
+  def decode_hash(value) when is_binary(value), do: value
+  def decode_hash(_), do: {:error, "Unexpected type when decoding FixedHeight.hash"}
+
+  def encode_hash(value) when is_binary(value), do: value
+  def encode_hash(_), do: {:error, "Unexpected type when encoding FixedHeight.hash"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -186,11 +216,11 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
-      hash: m["hash"],
+      frames: m["frames"] && decode_frames(m["frames"]),
+      hash: m["hash"] && decode_hash(m["hash"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
diff --git a/base/elixir/test/inputs/json/misc/cb0cc.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/cb0cc.json/default/QuickType.ex
index 32d2359..9ee04a1 100644
--- a/base/elixir/test/inputs/json/misc/cb0cc.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/cb0cc.json/default/QuickType.ex
@@ -79,6 +79,12 @@ defmodule Laureate do
   def encode_id(value) when is_binary(value), do: value
   def encode_id(_), do: {:error, "Unexpected type when encoding Laureate.id"}
 
+  def decode_motivation(value) when is_binary(value), do: value
+  def decode_motivation(_), do: {:error, "Unexpected type when decoding Laureate.motivation"}
+
+  def encode_motivation(value) when is_binary(value), do: value
+  def encode_motivation(_), do: {:error, "Unexpected type when encoding Laureate.motivation"}
+
   def decode_share(value) when is_binary(value), do: value
   def decode_share(_), do: {:error, "Unexpected type when decoding Laureate.share"}
 
@@ -95,7 +101,7 @@ defmodule Laureate do
     %Laureate{
       firstname: decode_firstname(m["firstname"]),
       id: decode_id(m["id"]),
-      motivation: m["motivation"],
+      motivation: m["motivation"] && decode_motivation(m["motivation"]),
       share: decode_share(m["share"]),
       surname: decode_surname(m["surname"]),
     }
@@ -141,6 +147,12 @@ defmodule Prize do
   def encode_laureates(value) when is_list(value), do: value
   def encode_laureates(_), do: {:error, "Unexpected type when encoding Prize.laureates"}
 
+  def decode_overall_motivation(value) when is_binary(value), do: value
+  def decode_overall_motivation(_), do: {:error, "Unexpected type when decoding Prize.overall_motivation"}
+
+  def encode_overall_motivation(value) when is_binary(value), do: value
+  def encode_overall_motivation(_), do: {:error, "Unexpected type when encoding Prize.overall_motivation"}
+
   def decode_year(value) when is_binary(value), do: value
   def decode_year(_), do: {:error, "Unexpected type when decoding Prize.year"}
 
@@ -151,7 +163,7 @@ defmodule Prize do
     %Prize{
       category: Category.decode(m["category"]),
       laureates: Enum.map(m["laureates"], &Laureate.from_map/1),
-      overall_motivation: m["overallMotivation"],
+      overall_motivation: m["overallMotivation"] && decode_overall_motivation(m["overallMotivation"]),
       year: decode_year(m["year"]),
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/dc44f.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/dc44f.json/default/QuickType.ex
index 8660e75..06da7ff 100644
--- a/base/elixir/test/inputs/json/misc/dc44f.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/dc44f.json/default/QuickType.ex
@@ -589,6 +589,12 @@ defmodule Card do
   def encode_cmc(value) when is_integer(value), do: value
   def encode_cmc(_), do: {:error, "Unexpected type when encoding Card.cmc"}
 
+  def decode_flavor(value) when is_binary(value), do: value
+  def decode_flavor(_), do: {:error, "Unexpected type when decoding Card.flavor"}
+
+  def encode_flavor(value) when is_binary(value), do: value
+  def encode_flavor(_), do: {:error, "Unexpected type when encoding Card.flavor"}
+
   def decode_id(value) when is_binary(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Card.id"}
 
@@ -607,6 +613,18 @@ defmodule Card do
   def encode_legalities(value) when is_list(value), do: value
   def encode_legalities(_), do: {:error, "Unexpected type when encoding Card.legalities"}
 
+  def decode_mana_cost(value) when is_binary(value), do: value
+  def decode_mana_cost(_), do: {:error, "Unexpected type when decoding Card.mana_cost"}
+
+  def encode_mana_cost(value) when is_binary(value), do: value
+  def encode_mana_cost(_), do: {:error, "Unexpected type when encoding Card.mana_cost"}
+
+  def decode_mci_number(value) when is_binary(value), do: value
+  def decode_mci_number(_), do: {:error, "Unexpected type when decoding Card.mci_number"}
+
+  def encode_mci_number(value) when is_binary(value), do: value
+  def encode_mci_number(_), do: {:error, "Unexpected type when encoding Card.mci_number"}
+
   def decode_multiverseid(value) when is_integer(value), do: value
   def decode_multiverseid(_), do: {:error, "Unexpected type when decoding Card.multiverseid"}
 
@@ -619,18 +637,42 @@ defmodule Card do
   def encode_name(value) when is_binary(value), do: value
   def encode_name(_), do: {:error, "Unexpected type when encoding Card.name"}
 
+  def decode_original_text(value) when is_binary(value), do: value
+  def decode_original_text(_), do: {:error, "Unexpected type when decoding Card.original_text"}
+
+  def encode_original_text(value) when is_binary(value), do: value
+  def encode_original_text(_), do: {:error, "Unexpected type when encoding Card.original_text"}
+
   def decode_original_type(value) when is_binary(value), do: value
   def decode_original_type(_), do: {:error, "Unexpected type when decoding Card.original_type"}
 
   def encode_original_type(value) when is_binary(value), do: value
   def encode_original_type(_), do: {:error, "Unexpected type when encoding Card.original_type"}
 
+  def decode_power(value) when is_binary(value), do: value
+  def decode_power(_), do: {:error, "Unexpected type when decoding Card.power"}
+
+  def encode_power(value) when is_binary(value), do: value
+  def encode_power(_), do: {:error, "Unexpected type when encoding Card.power"}
+
   def decode_printings(value) when is_list(value), do: value
   def decode_printings(_), do: {:error, "Unexpected type when decoding Card.printings"}
 
   def encode_printings(value) when is_list(value), do: value
   def encode_printings(_), do: {:error, "Unexpected type when encoding Card.printings"}
 
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding Card.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding Card.text"}
+
+  def decode_toughness(value) when is_binary(value), do: value
+  def decode_toughness(_), do: {:error, "Unexpected type when decoding Card.toughness"}
+
+  def encode_toughness(value) when is_binary(value), do: value
+  def encode_toughness(_), do: {:error, "Unexpected type when encoding Card.toughness"}
+
   def decode_type(value) when is_binary(value), do: value
   def decode_type(_), do: {:error, "Unexpected type when decoding Card.type"}
 
@@ -649,26 +691,26 @@ defmodule Card do
       cmc: decode_cmc(m["cmc"]),
       color_identity: m["colorIdentity"] && Enum.map(m["colorIdentity"], &ColorIdentity.decode/1),
       colors: m["colors"] && Enum.map(m["colors"], &Color.decode/1),
-      flavor: m["flavor"],
+      flavor: m["flavor"] && decode_flavor(m["flavor"]),
       id: decode_id(m["id"]),
       image_name: decode_image_name(m["imageName"]),
       layout: Layout.decode(m["layout"]),
       legalities: Enum.map(m["legalities"], &LegalityElement.from_map/1),
-      mana_cost: m["manaCost"],
-      mci_number: m["mciNumber"],
+      mana_cost: m["manaCost"] && decode_mana_cost(m["manaCost"]),
+      mci_number: m["mciNumber"] && decode_mci_number(m["mciNumber"]),
       multiverseid: decode_multiverseid(m["multiverseid"]),
       name: decode_name(m["name"]),
-      original_text: m["originalText"],
+      original_text: m["originalText"] && decode_original_text(m["originalText"]),
       original_type: decode_original_type(m["originalType"]),
-      power: m["power"],
+      power: m["power"] && decode_power(m["power"]),
       printings: decode_printings(m["printings"]),
       rarity: Rarity.decode(m["rarity"]),
       reserved: m["reserved"],
       rulings: m["rulings"] && Enum.map(m["rulings"], &Ruling.from_map/1),
       subtypes: m["subtypes"],
       supertypes: m["supertypes"] && Enum.map(m["supertypes"], &Supertype.decode/1),
-      text: m["text"],
-      toughness: m["toughness"],
+      text: m["text"] && decode_text(m["text"]),
+      toughness: m["toughness"] && decode_toughness(m["toughness"]),
       type: decode_type(m["type"]),
       types: Enum.map(m["types"], &Type.decode/1),
       variations: m["variations"],
diff --git a/base/elixir/test/inputs/json/misc/dd1ce.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/dd1ce.json/default/QuickType.ex
index 8660e75..06da7ff 100644
--- a/base/elixir/test/inputs/json/misc/dd1ce.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/dd1ce.json/default/QuickType.ex
@@ -589,6 +589,12 @@ defmodule Card do
   def encode_cmc(value) when is_integer(value), do: value
   def encode_cmc(_), do: {:error, "Unexpected type when encoding Card.cmc"}
 
+  def decode_flavor(value) when is_binary(value), do: value
+  def decode_flavor(_), do: {:error, "Unexpected type when decoding Card.flavor"}
+
+  def encode_flavor(value) when is_binary(value), do: value
+  def encode_flavor(_), do: {:error, "Unexpected type when encoding Card.flavor"}
+
   def decode_id(value) when is_binary(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Card.id"}
 
@@ -607,6 +613,18 @@ defmodule Card do
   def encode_legalities(value) when is_list(value), do: value
   def encode_legalities(_), do: {:error, "Unexpected type when encoding Card.legalities"}
 
+  def decode_mana_cost(value) when is_binary(value), do: value
+  def decode_mana_cost(_), do: {:error, "Unexpected type when decoding Card.mana_cost"}
+
+  def encode_mana_cost(value) when is_binary(value), do: value
+  def encode_mana_cost(_), do: {:error, "Unexpected type when encoding Card.mana_cost"}
+
+  def decode_mci_number(value) when is_binary(value), do: value
+  def decode_mci_number(_), do: {:error, "Unexpected type when decoding Card.mci_number"}
+
+  def encode_mci_number(value) when is_binary(value), do: value
+  def encode_mci_number(_), do: {:error, "Unexpected type when encoding Card.mci_number"}
+
   def decode_multiverseid(value) when is_integer(value), do: value
   def decode_multiverseid(_), do: {:error, "Unexpected type when decoding Card.multiverseid"}
 
@@ -619,18 +637,42 @@ defmodule Card do
   def encode_name(value) when is_binary(value), do: value
   def encode_name(_), do: {:error, "Unexpected type when encoding Card.name"}
 
+  def decode_original_text(value) when is_binary(value), do: value
+  def decode_original_text(_), do: {:error, "Unexpected type when decoding Card.original_text"}
+
+  def encode_original_text(value) when is_binary(value), do: value
+  def encode_original_text(_), do: {:error, "Unexpected type when encoding Card.original_text"}
+
   def decode_original_type(value) when is_binary(value), do: value
   def decode_original_type(_), do: {:error, "Unexpected type when decoding Card.original_type"}
 
   def encode_original_type(value) when is_binary(value), do: value
   def encode_original_type(_), do: {:error, "Unexpected type when encoding Card.original_type"}
 
+  def decode_power(value) when is_binary(value), do: value
+  def decode_power(_), do: {:error, "Unexpected type when decoding Card.power"}
+
+  def encode_power(value) when is_binary(value), do: value
+  def encode_power(_), do: {:error, "Unexpected type when encoding Card.power"}
+
   def decode_printings(value) when is_list(value), do: value
   def decode_printings(_), do: {:error, "Unexpected type when decoding Card.printings"}
 
   def encode_printings(value) when is_list(value), do: value
   def encode_printings(_), do: {:error, "Unexpected type when encoding Card.printings"}
 
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding Card.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding Card.text"}
+
+  def decode_toughness(value) when is_binary(value), do: value
+  def decode_toughness(_), do: {:error, "Unexpected type when decoding Card.toughness"}
+
+  def encode_toughness(value) when is_binary(value), do: value
+  def encode_toughness(_), do: {:error, "Unexpected type when encoding Card.toughness"}
+
   def decode_type(value) when is_binary(value), do: value
   def decode_type(_), do: {:error, "Unexpected type when decoding Card.type"}
 
@@ -649,26 +691,26 @@ defmodule Card do
       cmc: decode_cmc(m["cmc"]),
       color_identity: m["colorIdentity"] && Enum.map(m["colorIdentity"], &ColorIdentity.decode/1),
       colors: m["colors"] && Enum.map(m["colors"], &Color.decode/1),
-      flavor: m["flavor"],
+      flavor: m["flavor"] && decode_flavor(m["flavor"]),
       id: decode_id(m["id"]),
       image_name: decode_image_name(m["imageName"]),
       layout: Layout.decode(m["layout"]),
       legalities: Enum.map(m["legalities"], &LegalityElement.from_map/1),
-      mana_cost: m["manaCost"],
-      mci_number: m["mciNumber"],
+      mana_cost: m["manaCost"] && decode_mana_cost(m["manaCost"]),
+      mci_number: m["mciNumber"] && decode_mci_number(m["mciNumber"]),
       multiverseid: decode_multiverseid(m["multiverseid"]),
       name: decode_name(m["name"]),
-      original_text: m["originalText"],
+      original_text: m["originalText"] && decode_original_text(m["originalText"]),
       original_type: decode_original_type(m["originalType"]),
-      power: m["power"],
+      power: m["power"] && decode_power(m["power"]),
       printings: decode_printings(m["printings"]),
       rarity: Rarity.decode(m["rarity"]),
       reserved: m["reserved"],
       rulings: m["rulings"] && Enum.map(m["rulings"], &Ruling.from_map/1),
       subtypes: m["subtypes"],
       supertypes: m["supertypes"] && Enum.map(m["supertypes"], &Supertype.decode/1),
-      text: m["text"],
-      toughness: m["toughness"],
+      text: m["text"] && decode_text(m["text"]),
+      toughness: m["toughness"] && decode_toughness(m["toughness"]),
       type: decode_type(m["type"]),
       types: Enum.map(m["types"], &Type.decode/1),
       variations: m["variations"],
diff --git a/base/elixir/test/inputs/json/misc/e0ac7.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/e0ac7.json/default/QuickType.ex
index 1da236b..3229568 100644
--- a/base/elixir/test/inputs/json/misc/e0ac7.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/e0ac7.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule Downsized do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding Downsized.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding Downsized.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding Downsized.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding Downsized.url"}
 
@@ -37,7 +43,7 @@ defmodule Downsized do
   def from_map(m) do
     %Downsized{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -148,12 +154,36 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
+  def decode_hash(value) when is_binary(value), do: value
+  def decode_hash(_), do: {:error, "Unexpected type when decoding FixedHeight.hash"}
+
+  def encode_hash(value) when is_binary(value), do: value
+  def encode_hash(_), do: {:error, "Unexpected type when encoding FixedHeight.hash"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -186,11 +216,11 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
-      hash: m["hash"],
+      frames: m["frames"] && decode_frames(m["frames"]),
+      hash: m["hash"] && decode_hash(m["hash"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
diff --git a/base/elixir/test/inputs/json/misc/e8b04.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/e8b04.json/default/QuickType.ex
index c5a40b7..d4ed30a 100644
--- a/base/elixir/test/inputs/json/misc/e8b04.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/e8b04.json/default/QuickType.ex
@@ -450,6 +450,12 @@ defmodule Select do
           column_field_name: String.t()
         }
 
+  def decode_aggregate(value) when is_binary(value), do: value
+  def decode_aggregate(_), do: {:error, "Unexpected type when decoding Select.aggregate"}
+
+  def encode_aggregate(value) when is_binary(value), do: value
+  def encode_aggregate(_), do: {:error, "Unexpected type when encoding Select.aggregate"}
+
   def decode_column_field_name(value) when is_binary(value), do: value
   def decode_column_field_name(_), do: {:error, "Unexpected type when decoding Select.column_field_name"}
 
@@ -458,7 +464,7 @@ defmodule Select do
 
   def from_map(m) do
     %Select{
-      aggregate: m["aggregate"],
+      aggregate: m["aggregate"] && decode_aggregate(m["aggregate"]),
       column_field_name: decode_column_field_name(m["columnFieldName"]),
     }
   end
@@ -720,12 +726,18 @@ defmodule Child do
           value: String.t() | nil
         }
 
+  def decode_value(value) when is_binary(value), do: value
+  def decode_value(_), do: {:error, "Unexpected type when decoding Child.value"}
+
+  def encode_value(value) when is_binary(value), do: value
+  def encode_value(_), do: {:error, "Unexpected type when encoding Child.value"}
+
   def from_map(m) do
     %Child{
       column_field_name: ChildColumnFieldName.decode(m["columnFieldName"]),
       metadata: m["metadata"] && ChildMetadata.from_map(m["metadata"]),
       operator: ChildOperator.decode(m["operator"]),
-      value: m["value"],
+      value: m["value"] && decode_value(m["value"]),
     }
   end
 
@@ -809,13 +821,19 @@ defmodule Where do
           value: String.t() | nil
         }
 
+  def decode_value(value) when is_binary(value), do: value
+  def decode_value(_), do: {:error, "Unexpected type when decoding Where.value"}
+
+  def encode_value(value) when is_binary(value), do: value
+  def encode_value(_), do: {:error, "Unexpected type when encoding Where.value"}
+
   def from_map(m) do
     %Where{
       children: m["children"] && Enum.map(m["children"], &Child.from_map/1),
       column_field_name: m["columnFieldName"] && ChildColumnFieldName.decode(m["columnFieldName"]),
       metadata: m["metadata"] && ChildMetadata.from_map(m["metadata"]),
       operator: WhereOperator.decode(m["operator"]),
-      value: m["value"],
+      value: m["value"] && decode_value(m["value"]),
     }
   end
 
@@ -1445,17 +1463,41 @@ defmodule TopLevelMetadata do
           v1_archived_properties: V1ArchivedProperties.t() | nil
         }
 
+  def decode_rdf_class(value) when is_binary(value), do: value
+  def decode_rdf_class(_), do: {:error, "Unexpected type when decoding TopLevelMetadata.rdf_class"}
+
+  def encode_rdf_class(value) when is_binary(value), do: value
+  def encode_rdf_class(_), do: {:error, "Unexpected type when encoding TopLevelMetadata.rdf_class"}
+
+  def decode_rdf_subject(value) when is_binary(value), do: value
+  def decode_rdf_subject(_), do: {:error, "Unexpected type when decoding TopLevelMetadata.rdf_subject"}
+
+  def encode_rdf_subject(value) when is_binary(value), do: value
+  def encode_rdf_subject(_), do: {:error, "Unexpected type when encoding TopLevelMetadata.rdf_subject"}
+
+  def decode_row_identifier(value) when is_binary(value), do: value
+  def decode_row_identifier(_), do: {:error, "Unexpected type when decoding TopLevelMetadata.row_identifier"}
+
+  def encode_row_identifier(value) when is_binary(value), do: value
+  def encode_row_identifier(_), do: {:error, "Unexpected type when encoding TopLevelMetadata.row_identifier"}
+
+  def decode_row_label(value) when is_binary(value), do: value
+  def decode_row_label(_), do: {:error, "Unexpected type when decoding TopLevelMetadata.row_label"}
+
+  def encode_row_label(value) when is_binary(value), do: value
+  def encode_row_label(_), do: {:error, "Unexpected type when encoding TopLevelMetadata.row_label"}
+
   def from_map(m) do
     %TopLevelMetadata{
       available_display_types: m["availableDisplayTypes"] && Enum.map(m["availableDisplayTypes"], &DisplayType.decode/1),
       custom_fields: m["custom_fields"] && CustomFields.from_map(m["custom_fields"]),
       json_query: m["jsonQuery"] && JSONQuery.from_map(m["jsonQuery"]),
-      rdf_class: m["rdfClass"],
-      rdf_subject: m["rdfSubject"],
+      rdf_class: m["rdfClass"] && decode_rdf_class(m["rdfClass"]),
+      rdf_subject: m["rdfSubject"] && decode_rdf_subject(m["rdfSubject"]),
       render_type_config: m["renderTypeConfig"] && MetadataRenderTypeConfig.from_map(m["renderTypeConfig"]),
       rich_renderer_configs: m["richRendererConfigs"] && RichRendererConfigs.from_map(m["richRendererConfigs"]),
-      row_identifier: m["rowIdentifier"],
-      row_label: m["rowLabel"],
+      row_identifier: m["rowIdentifier"] && decode_row_identifier(m["rowIdentifier"]),
+      row_label: m["rowLabel"] && decode_row_label(m["rowLabel"]),
       v1_archived_properties: m["v1_archived_properties"] && V1ArchivedProperties.from_map(m["v1_archived_properties"]),
     }
   end
@@ -1608,6 +1650,24 @@ defmodule Owner do
   def encode_id(value) when is_binary(value), do: value
   def encode_id(_), do: {:error, "Unexpected type when encoding Owner.id"}
 
+  def decode_profile_image_url_large(value) when is_binary(value), do: value
+  def decode_profile_image_url_large(_), do: {:error, "Unexpected type when decoding Owner.profile_image_url_large"}
+
+  def encode_profile_image_url_large(value) when is_binary(value), do: value
+  def encode_profile_image_url_large(_), do: {:error, "Unexpected type when encoding Owner.profile_image_url_large"}
+
+  def decode_profile_image_url_medium(value) when is_binary(value), do: value
+  def decode_profile_image_url_medium(_), do: {:error, "Unexpected type when decoding Owner.profile_image_url_medium"}
+
+  def encode_profile_image_url_medium(value) when is_binary(value), do: value
+  def encode_profile_image_url_medium(_), do: {:error, "Unexpected type when encoding Owner.profile_image_url_medium"}
+
+  def decode_profile_image_url_small(value) when is_binary(value), do: value
+  def decode_profile_image_url_small(_), do: {:error, "Unexpected type when decoding Owner.profile_image_url_small"}
+
+  def encode_profile_image_url_small(value) when is_binary(value), do: value
+  def encode_profile_image_url_small(_), do: {:error, "Unexpected type when encoding Owner.profile_image_url_small"}
+
   def decode_screen_name(value) when is_binary(value), do: value
   def decode_screen_name(_), do: {:error, "Unexpected type when decoding Owner.screen_name"}
 
@@ -1620,9 +1680,9 @@ defmodule Owner do
       flags: m["flags"],
       id: decode_id(m["id"]),
       last_notification_seen_at: m["lastNotificationSeenAt"],
-      profile_image_url_large: m["profileImageUrlLarge"],
-      profile_image_url_medium: m["profileImageUrlMedium"],
-      profile_image_url_small: m["profileImageUrlSmall"],
+      profile_image_url_large: m["profileImageUrlLarge"] && decode_profile_image_url_large(m["profileImageUrlLarge"]),
+      profile_image_url_medium: m["profileImageUrlMedium"] && decode_profile_image_url_medium(m["profileImageUrlMedium"]),
+      profile_image_url_small: m["profileImageUrlSmall"] && decode_profile_image_url_small(m["profileImageUrlSmall"]),
       rights: m["rights"],
       role_name: m["roleName"] && RoleName.decode(m["roleName"]),
       screen_name: decode_screen_name(m["screenName"]),
@@ -2040,12 +2100,24 @@ defmodule TopLevelElement do
   def encode_average_rating(value) when is_integer(value), do: value
   def encode_average_rating(_), do: {:error, "Unexpected type when encoding TopLevelElement.average_rating"}
 
+  def decode_category(value) when is_binary(value), do: value
+  def decode_category(_), do: {:error, "Unexpected type when decoding TopLevelElement.category"}
+
+  def encode_category(value) when is_binary(value), do: value
+  def encode_category(_), do: {:error, "Unexpected type when encoding TopLevelElement.category"}
+
   def decode_created_at(value) when is_integer(value), do: value
   def decode_created_at(_), do: {:error, "Unexpected type when decoding TopLevelElement.created_at"}
 
   def encode_created_at(value) when is_integer(value), do: value
   def encode_created_at(_), do: {:error, "Unexpected type when encoding TopLevelElement.created_at"}
 
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding TopLevelElement.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding TopLevelElement.description"}
+
   def decode_download_count(value) when is_integer(value), do: value
   def decode_download_count(_), do: {:error, "Unexpected type when decoding TopLevelElement.download_count"}
 
@@ -2118,12 +2190,24 @@ defmodule TopLevelElement do
   def encode_publication_group(value) when is_integer(value), do: value
   def encode_publication_group(_), do: {:error, "Unexpected type when encoding TopLevelElement.publication_group"}
 
+  def decode_resource_name(value) when is_binary(value), do: value
+  def decode_resource_name(_), do: {:error, "Unexpected type when decoding TopLevelElement.resource_name"}
+
+  def encode_resource_name(value) when is_binary(value), do: value
+  def encode_resource_name(_), do: {:error, "Unexpected type when encoding TopLevelElement.resource_name"}
+
   def decode_rights(value) when is_list(value), do: value
   def decode_rights(_), do: {:error, "Unexpected type when decoding TopLevelElement.rights"}
 
   def encode_rights(value) when is_list(value), do: value
   def encode_rights(_), do: {:error, "Unexpected type when encoding TopLevelElement.rights"}
 
+  def decode_row_class(value) when is_binary(value), do: value
+  def decode_row_class(_), do: {:error, "Unexpected type when decoding TopLevelElement.row_class"}
+
+  def encode_row_class(value) when is_binary(value), do: value
+  def encode_row_class(_), do: {:error, "Unexpected type when encoding TopLevelElement.row_class"}
+
   def decode_table_id(value) when is_integer(value), do: value
   def decode_table_id(_), do: {:error, "Unexpected type when decoding TopLevelElement.table_id"}
 
@@ -2151,9 +2235,9 @@ defmodule TopLevelElement do
   def from_map(m) do
     %TopLevelElement{
       average_rating: decode_average_rating(m["averageRating"]),
-      category: m["category"],
+      category: m["category"] && decode_category(m["category"]),
       created_at: decode_created_at(m["createdAt"]),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       display_type: m["displayType"] && DisplayType.decode(m["displayType"]),
       download_count: decode_download_count(m["downloadCount"]),
       flags: m["flags"] && Enum.map(m["flags"], &TopLevelFlag.decode/1),
@@ -2177,9 +2261,9 @@ defmodule TopLevelElement do
       publication_group: decode_publication_group(m["publicationGroup"]),
       publication_stage: PublicationStage.decode(m["publicationStage"]),
       ratings: m["ratings"] && Ratings.from_map(m["ratings"]),
-      resource_name: m["resourceName"],
+      resource_name: m["resourceName"] && decode_resource_name(m["resourceName"]),
       rights: Enum.map(m["rights"], &Right.decode/1),
-      row_class: m["rowClass"],
+      row_class: m["rowClass"] && decode_row_class(m["rowClass"]),
       row_identifier_column_id: m["rowIdentifierColumnId"],
       rows_updated_at: m["rowsUpdatedAt"],
       rows_updated_by: m["rowsUpdatedBy"] && RowsUpdatedBy.decode(m["rowsUpdatedBy"]),
diff --git a/base/elixir/test/inputs/json/misc/f6a65.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/f6a65.json/default/QuickType.ex
index 86b7911..76364a9 100644
--- a/base/elixir/test/inputs/json/misc/f6a65.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/f6a65.json/default/QuickType.ex
@@ -22,6 +22,12 @@ defmodule The480_WStill do
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding The480_WStill.height"}
 
+  def decode_size(value) when is_binary(value), do: value
+  def decode_size(_), do: {:error, "Unexpected type when decoding The480_WStill.size"}
+
+  def encode_size(value) when is_binary(value), do: value
+  def encode_size(_), do: {:error, "Unexpected type when encoding The480_WStill.size"}
+
   def decode_url(value) when is_binary(value), do: value
   def decode_url(_), do: {:error, "Unexpected type when decoding The480_WStill.url"}
 
@@ -37,7 +43,7 @@ defmodule The480_WStill do
   def from_map(m) do
     %The480_WStill{
       height: decode_height(m["height"]),
-      size: m["size"],
+      size: m["size"] && decode_size(m["size"]),
       url: decode_url(m["url"]),
       width: decode_width(m["width"]),
     }
@@ -148,12 +154,36 @@ defmodule FixedHeight do
           width: String.t()
         }
 
+  def decode_frames(value) when is_binary(value), do: value
+  def decode_frames(_), do: {:error, "Unexpected type when decoding FixedHeight.frames"}
+
+  def encode_frames(value) when is_binary(value), do: value
+  def encode_frames(_), do: {:error, "Unexpected type when encoding FixedHeight.frames"}
+
+  def decode_hash(value) when is_binary(value), do: value
+  def decode_hash(_), do: {:error, "Unexpected type when decoding FixedHeight.hash"}
+
+  def encode_hash(value) when is_binary(value), do: value
+  def encode_hash(_), do: {:error, "Unexpected type when encoding FixedHeight.hash"}
+
   def decode_height(value) when is_binary(value), do: value
   def decode_height(_), do: {:error, "Unexpected type when decoding FixedHeight.height"}
 
   def encode_height(value) when is_binary(value), do: value
   def encode_height(_), do: {:error, "Unexpected type when encoding FixedHeight.height"}
 
+  def decode_mp4(value) when is_binary(value), do: value
+  def decode_mp4(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4"}
+
+  def encode_mp4(value) when is_binary(value), do: value
+  def encode_mp4(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4"}
+
+  def decode_mp4_size(value) when is_binary(value), do: value
+  def decode_mp4_size(_), do: {:error, "Unexpected type when decoding FixedHeight.mp4_size"}
+
+  def encode_mp4_size(value) when is_binary(value), do: value
+  def encode_mp4_size(_), do: {:error, "Unexpected type when encoding FixedHeight.mp4_size"}
+
   def decode_size(value) when is_binary(value), do: value
   def decode_size(_), do: {:error, "Unexpected type when decoding FixedHeight.size"}
 
@@ -186,11 +216,11 @@ defmodule FixedHeight do
 
   def from_map(m) do
     %FixedHeight{
-      frames: m["frames"],
-      hash: m["hash"],
+      frames: m["frames"] && decode_frames(m["frames"]),
+      hash: m["hash"] && decode_hash(m["hash"]),
       height: decode_height(m["height"]),
-      mp4: m["mp4"],
-      mp4_size: m["mp4_size"],
+      mp4: m["mp4"] && decode_mp4(m["mp4"]),
+      mp4_size: m["mp4_size"] && decode_mp4_size(m["mp4_size"]),
       size: decode_size(m["size"]),
       url: decode_url(m["url"]),
       webp: decode_webp(m["webp"]),
diff --git a/base/elixir/test/inputs/json/misc/f74d5.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/f74d5.json/default/QuickType.ex
index 91f9e42..8ab9125 100644
--- a/base/elixir/test/inputs/json/misc/f74d5.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/f74d5.json/default/QuickType.ex
@@ -67,6 +67,12 @@ defmodule CachedContents do
           top: [Top.t()]
         }
 
+  def decode_average(value) when is_binary(value), do: value
+  def decode_average(_), do: {:error, "Unexpected type when decoding CachedContents.average"}
+
+  def encode_average(value) when is_binary(value), do: value
+  def encode_average(_), do: {:error, "Unexpected type when encoding CachedContents.average"}
+
   def decode_largest(value) when is_binary(value), do: value
   def decode_largest(_), do: {:error, "Unexpected type when decoding CachedContents.largest"}
 
@@ -91,6 +97,12 @@ defmodule CachedContents do
   def encode_smallest(value) when is_binary(value), do: value
   def encode_smallest(_), do: {:error, "Unexpected type when encoding CachedContents.smallest"}
 
+  def decode_sum(value) when is_binary(value), do: value
+  def decode_sum(_), do: {:error, "Unexpected type when decoding CachedContents.sum"}
+
+  def encode_sum(value) when is_binary(value), do: value
+  def encode_sum(_), do: {:error, "Unexpected type when encoding CachedContents.sum"}
+
   def decode_top(value) when is_list(value), do: value
   def decode_top(_), do: {:error, "Unexpected type when decoding CachedContents.top"}
 
@@ -99,12 +111,12 @@ defmodule CachedContents do
 
   def from_map(m) do
     %CachedContents{
-      average: m["average"],
+      average: m["average"] && decode_average(m["average"]),
       largest: decode_largest(m["largest"]),
       non_null: decode_non_null(m["non_null"]),
       null: decode_null(m["null"]),
       smallest: decode_smallest(m["smallest"]),
-      sum: m["sum"],
+      sum: m["sum"] && decode_sum(m["sum"]),
       top: Enum.map(m["top"], &Top.from_map/1),
     }
   end
diff --git a/base/elixir/test/inputs/json/misc/fcca3.json/default/QuickType.ex b/head/elixir/test/inputs/json/misc/fcca3.json/default/QuickType.ex
index 512aa25..2be7d94 100644
--- a/base/elixir/test/inputs/json/misc/fcca3.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/misc/fcca3.json/default/QuickType.ex
@@ -67,6 +67,12 @@ defmodule CachedContents do
           top: [Top.t()]
         }
 
+  def decode_average(value) when is_binary(value), do: value
+  def decode_average(_), do: {:error, "Unexpected type when decoding CachedContents.average"}
+
+  def encode_average(value) when is_binary(value), do: value
+  def encode_average(_), do: {:error, "Unexpected type when encoding CachedContents.average"}
+
   def decode_largest(value) when is_binary(value), do: value
   def decode_largest(_), do: {:error, "Unexpected type when decoding CachedContents.largest"}
 
@@ -91,6 +97,12 @@ defmodule CachedContents do
   def encode_smallest(value) when is_binary(value), do: value
   def encode_smallest(_), do: {:error, "Unexpected type when encoding CachedContents.smallest"}
 
+  def decode_sum(value) when is_binary(value), do: value
+  def decode_sum(_), do: {:error, "Unexpected type when decoding CachedContents.sum"}
+
+  def encode_sum(value) when is_binary(value), do: value
+  def encode_sum(_), do: {:error, "Unexpected type when encoding CachedContents.sum"}
+
   def decode_top(value) when is_list(value), do: value
   def decode_top(_), do: {:error, "Unexpected type when decoding CachedContents.top"}
 
@@ -99,12 +111,12 @@ defmodule CachedContents do
 
   def from_map(m) do
     %CachedContents{
-      average: m["average"],
+      average: m["average"] && decode_average(m["average"]),
       largest: decode_largest(m["largest"]),
       non_null: decode_non_null(m["non_null"]),
       null: decode_null(m["null"]),
       smallest: decode_smallest(m["smallest"]),
-      sum: m["sum"],
+      sum: m["sum"] && decode_sum(m["sum"]),
       top: Enum.map(m["top"], &Top.from_map/1),
     }
   end
@@ -190,11 +202,29 @@ defmodule Format do
           precision_style: String.t() | nil
         }
 
+  def decode_align(value) when is_binary(value), do: value
+  def decode_align(_), do: {:error, "Unexpected type when decoding Format.align"}
+
+  def encode_align(value) when is_binary(value), do: value
+  def encode_align(_), do: {:error, "Unexpected type when encoding Format.align"}
+
+  def decode_no_commas(value) when is_binary(value), do: value
+  def decode_no_commas(_), do: {:error, "Unexpected type when decoding Format.no_commas"}
+
+  def encode_no_commas(value) when is_binary(value), do: value
+  def encode_no_commas(_), do: {:error, "Unexpected type when encoding Format.no_commas"}
+
+  def decode_precision_style(value) when is_binary(value), do: value
+  def decode_precision_style(_), do: {:error, "Unexpected type when decoding Format.precision_style"}
+
+  def encode_precision_style(value) when is_binary(value), do: value
+  def encode_precision_style(_), do: {:error, "Unexpected type when encoding Format.precision_style"}
+
   def from_map(m) do
     %Format{
-      align: m["align"],
-      no_commas: m["noCommas"],
-      precision_style: m["precisionStyle"],
+      align: m["align"] && decode_align(m["align"]),
+      no_commas: m["noCommas"] && decode_no_commas(m["noCommas"]),
+      precision_style: m["precisionStyle"] && decode_precision_style(m["precisionStyle"]),
     }
   end
 
@@ -238,6 +268,12 @@ defmodule Column do
           width: integer() | nil
         }
 
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding Column.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding Column.description"}
+
   def decode_field_name(value) when is_binary(value), do: value
   def decode_field_name(_), do: {:error, "Unexpected type when decoding Column.field_name"}
 
@@ -266,7 +302,7 @@ defmodule Column do
     %Column{
       cached_contents: m["cachedContents"] && CachedContents.from_map(m["cachedContents"]),
       data_type_name: TypeName.decode(m["dataTypeName"]),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       field_name: decode_field_name(m["fieldName"]),
       flags: m["flags"],
       format: Format.from_map(m["format"]),
diff --git a/base/elixir/test/inputs/json/priority/bug2521.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/bug2521.json/default/QuickType.ex
index 18cff7f..23f6c89 100644
--- a/base/elixir/test/inputs/json/priority/bug2521.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/bug2521.json/default/QuickType.ex
@@ -14,6 +14,12 @@ defmodule Option do
           name: String.t()
         }
 
+  def decode_foo(value) when is_binary(value), do: value
+  def decode_foo(_), do: {:error, "Unexpected type when decoding Option.foo"}
+
+  def encode_foo(value) when is_binary(value), do: value
+  def encode_foo(_), do: {:error, "Unexpected type when encoding Option.foo"}
+
   def decode_name(value) when is_binary(value), do: value
   def decode_name(_), do: {:error, "Unexpected type when decoding Option.name"}
 
@@ -22,7 +28,7 @@ defmodule Option do
 
   def from_map(m) do
     %Option{
-      foo: m["foo"],
+      foo: m["foo"] && decode_foo(m["foo"]),
       name: decode_name(m["name"]),
     }
   end
diff --git a/base/elixir/test/inputs/json/priority/bug427.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/bug427.json/default/QuickType.ex
index 9a98e55..c2835ca 100644
--- a/base/elixir/test/inputs/json/priority/bug427.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/bug427.json/default/QuickType.ex
@@ -533,11 +533,29 @@ defmodule GetSignatureComment do
           text: String.t() | nil
         }
 
+  def decode_returns(value) when is_binary(value), do: value
+  def decode_returns(_), do: {:error, "Unexpected type when decoding GetSignatureComment.returns"}
+
+  def encode_returns(value) when is_binary(value), do: value
+  def encode_returns(_), do: {:error, "Unexpected type when encoding GetSignatureComment.returns"}
+
+  def decode_short_text(value) when is_binary(value), do: value
+  def decode_short_text(_), do: {:error, "Unexpected type when decoding GetSignatureComment.short_text"}
+
+  def encode_short_text(value) when is_binary(value), do: value
+  def encode_short_text(_), do: {:error, "Unexpected type when encoding GetSignatureComment.short_text"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding GetSignatureComment.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding GetSignatureComment.text"}
+
   def from_map(m) do
     %GetSignatureComment{
-      returns: m["returns"],
-      short_text: m["shortText"],
-      text: m["text"],
+      returns: m["returns"] && decode_returns(m["returns"]),
+      short_text: m["shortText"] && decode_short_text(m["shortText"]),
+      text: m["text"] && decode_text(m["text"]),
     }
   end
 
@@ -627,10 +645,22 @@ defmodule Comment3 do
           text: String.t() | nil
         }
 
+  def decode_short_text(value) when is_binary(value), do: value
+  def decode_short_text(_), do: {:error, "Unexpected type when decoding Comment3.short_text"}
+
+  def encode_short_text(value) when is_binary(value), do: value
+  def encode_short_text(_), do: {:error, "Unexpected type when encoding Comment3.short_text"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding Comment3.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding Comment3.text"}
+
   def from_map(m) do
     %Comment3{
-      short_text: m["shortText"],
-      text: m["text"],
+      short_text: m["shortText"] && decode_short_text(m["shortText"]),
+      text: m["text"] && decode_text(m["text"]),
     }
   end
 
@@ -1100,6 +1130,12 @@ defmodule GetSignature do
           type_parameter: [GetSignature.t()] | nil
         }
 
+  def decode_default_value(value) when is_binary(value), do: value
+  def decode_default_value(_), do: {:error, "Unexpected type when decoding GetSignature.default_value"}
+
+  def encode_default_value(value) when is_binary(value), do: value
+  def encode_default_value(_), do: {:error, "Unexpected type when encoding GetSignature.default_value"}
+
   def decode_id(value) when is_integer(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding GetSignature.id"}
 
@@ -1128,7 +1164,7 @@ defmodule GetSignature do
     %GetSignature{
       children: m["children"] && Enum.map(m["children"], &GetSignatureChild.from_map/1),
       comment: m["comment"] && GetSignatureComment.from_map(m["comment"]),
-      default_value: m["defaultValue"],
+      default_value: m["defaultValue"] && decode_default_value(m["defaultValue"]),
       flags: GetSignatureFlags.from_map(m["flags"]),
       groups: m["groups"] && Enum.map(m["groups"], &Group.from_map/1),
       id: decode_id(m["id"]),
@@ -1441,6 +1477,12 @@ defmodule Child3 do
           type: TypeElement.t() | nil
         }
 
+  def decode_default_value(value) when is_binary(value), do: value
+  def decode_default_value(_), do: {:error, "Unexpected type when decoding Child3.default_value"}
+
+  def encode_default_value(value) when is_binary(value), do: value
+  def encode_default_value(_), do: {:error, "Unexpected type when encoding Child3.default_value"}
+
   def decode_id(value) when is_integer(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Child3.id"}
 
@@ -1468,7 +1510,7 @@ defmodule Child3 do
   def from_map(m) do
     %Child3{
       comment: m["comment"] && Comment1.from_map(m["comment"]),
-      default_value: m["defaultValue"],
+      default_value: m["defaultValue"] && decode_default_value(m["defaultValue"]),
       flags: Flags1.from_map(m["flags"]),
       id: decode_id(m["id"]),
       kind: decode_kind(m["kind"]),
@@ -1566,12 +1608,30 @@ defmodule Comment4 do
           text: String.t() | nil
         }
 
+  def decode_returns(value) when is_binary(value), do: value
+  def decode_returns(_), do: {:error, "Unexpected type when decoding Comment4.returns"}
+
+  def encode_returns(value) when is_binary(value), do: value
+  def encode_returns(_), do: {:error, "Unexpected type when encoding Comment4.returns"}
+
+  def decode_short_text(value) when is_binary(value), do: value
+  def decode_short_text(_), do: {:error, "Unexpected type when decoding Comment4.short_text"}
+
+  def encode_short_text(value) when is_binary(value), do: value
+  def encode_short_text(_), do: {:error, "Unexpected type when encoding Comment4.short_text"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding Comment4.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding Comment4.text"}
+
   def from_map(m) do
     %Comment4{
-      returns: m["returns"],
-      short_text: m["shortText"],
+      returns: m["returns"] && decode_returns(m["returns"]),
+      short_text: m["shortText"] && decode_short_text(m["shortText"]),
       tags: m["tags"] && Enum.map(m["tags"], &Tag.from_map/1),
-      text: m["text"],
+      text: m["text"] && decode_text(m["text"]),
     }
   end
 
@@ -1748,6 +1808,12 @@ defmodule Type4 do
           type_arguments: [ElementType.t()] | nil
         }
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding Type4.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Type4.name"}
+
   def from_map(m) do
     %Type4{
       constraint: m["constraint"] && ExtendedBy.from_map(m["constraint"]),
@@ -1755,7 +1821,7 @@ defmodule Type4 do
       element_type: m["elementType"] && ElementType.from_map(m["elementType"]),
       elements: m["elements"] && Enum.map(m["elements"], &ExtendedBy.from_map/1),
       id: m["id"],
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       type: TypeEnum.decode(m["type"]),
       type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &ElementType.from_map/1),
     }
@@ -2532,6 +2598,12 @@ defmodule Type5 do
           types: [TypeElement.t()] | nil
         }
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding Type5.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Type5.name"}
+
   def from_map(m) do
     %Type5{
       constraint: m["constraint"] && ExtendedBy.from_map(m["constraint"]),
@@ -2539,7 +2611,7 @@ defmodule Type5 do
       element_type: m["elementType"] && ExtendedBy.from_map(m["elementType"]),
       elements: m["elements"] && Enum.map(m["elements"], &ElementType.from_map/1),
       id: m["id"],
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       type: TypeEnum.decode(m["type"]),
       type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &TypeArgument1.from_map/1),
       types: m["types"] && Enum.map(m["types"], &TypeElement.from_map/1),
@@ -2597,6 +2669,12 @@ defmodule Child2 do
           type: Type5.t() | nil
         }
 
+  def decode_default_value(value) when is_binary(value), do: value
+  def decode_default_value(_), do: {:error, "Unexpected type when decoding Child2.default_value"}
+
+  def encode_default_value(value) when is_binary(value), do: value
+  def encode_default_value(_), do: {:error, "Unexpected type when encoding Child2.default_value"}
+
   def decode_id(value) when is_integer(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Child2.id"}
 
@@ -2625,7 +2703,7 @@ defmodule Child2 do
     %Child2{
       children: m["children"] && Enum.map(m["children"], &Child3.from_map/1),
       comment: m["comment"] && Comment4.from_map(m["comment"]),
-      default_value: m["defaultValue"],
+      default_value: m["defaultValue"] && decode_default_value(m["defaultValue"]),
       flags: Flags4.from_map(m["flags"]),
       get_signature: m["getSignature"] && GetSignature.from_map(m["getSignature"]),
       groups: m["groups"] && Enum.map(m["groups"], &Group.from_map/1),
@@ -2796,6 +2874,12 @@ defmodule Child5 do
           type: Type6.t()
         }
 
+  def decode_default_value(value) when is_binary(value), do: value
+  def decode_default_value(_), do: {:error, "Unexpected type when decoding Child5.default_value"}
+
+  def encode_default_value(value) when is_binary(value), do: value
+  def encode_default_value(_), do: {:error, "Unexpected type when encoding Child5.default_value"}
+
   def decode_id(value) when is_integer(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Child5.id"}
 
@@ -2823,7 +2907,7 @@ defmodule Child5 do
   def from_map(m) do
     %Child5{
       comment: Comment2.from_map(m["comment"]),
-      default_value: m["defaultValue"],
+      default_value: m["defaultValue"] && decode_default_value(m["defaultValue"]),
       flags: Flags2.from_map(m["flags"]),
       id: decode_id(m["id"]),
       kind: decode_kind(m["kind"]),
@@ -2964,12 +3048,18 @@ defmodule Type8 do
           type_arguments: [ElementType.t()] | nil
         }
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding Type8.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Type8.name"}
+
   def from_map(m) do
     %Type8{
       declaration: m["declaration"] && Declaration3.from_map(m["declaration"]),
       element_type: m["elementType"] && ElementType.from_map(m["elementType"]),
       id: m["id"],
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       type: TypeEnum.decode(m["type"]),
       type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &ElementType.from_map/1),
     }
@@ -3015,6 +3105,12 @@ defmodule Parameter3 do
           type: Type8.t()
         }
 
+  def decode_default_value(value) when is_binary(value), do: value
+  def decode_default_value(_), do: {:error, "Unexpected type when decoding Parameter3.default_value"}
+
+  def encode_default_value(value) when is_binary(value), do: value
+  def encode_default_value(_), do: {:error, "Unexpected type when encoding Parameter3.default_value"}
+
   def decode_id(value) when is_integer(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Parameter3.id"}
 
@@ -3033,16 +3129,22 @@ defmodule Parameter3 do
   def encode_name(value) when is_binary(value), do: value
   def encode_name(_), do: {:error, "Unexpected type when encoding Parameter3.name"}
 
+  def decode_original_name(value) when is_binary(value), do: value
+  def decode_original_name(_), do: {:error, "Unexpected type when decoding Parameter3.original_name"}
+
+  def encode_original_name(value) when is_binary(value), do: value
+  def encode_original_name(_), do: {:error, "Unexpected type when encoding Parameter3.original_name"}
+
   def from_map(m) do
     %Parameter3{
       comment: m["comment"] && Comment3.from_map(m["comment"]),
-      default_value: m["defaultValue"],
+      default_value: m["defaultValue"] && decode_default_value(m["defaultValue"]),
       flags: Flags3.from_map(m["flags"]),
       id: decode_id(m["id"]),
       kind: decode_kind(m["kind"]),
       kind_string: ParameterKindString.decode(m["kindString"]),
       name: decode_name(m["name"]),
-      original_name: m["originalName"],
+      original_name: m["originalName"] && decode_original_name(m["originalName"]),
       type: Type8.from_map(m["type"]),
     }
   end
@@ -3546,17 +3648,29 @@ defmodule Type10 do
           value: String.t() | nil
         }
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding Type10.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Type10.name"}
+
+  def decode_value(value) when is_binary(value), do: value
+  def decode_value(_), do: {:error, "Unexpected type when decoding Type10.value"}
+
+  def encode_value(value) when is_binary(value), do: value
+  def encode_value(_), do: {:error, "Unexpected type when encoding Type10.value"}
+
   def from_map(m) do
     %Type10{
       declaration: m["declaration"] && Declaration4.from_map(m["declaration"]),
       element_type: m["elementType"] && ElementType.from_map(m["elementType"]),
       elements: m["elements"] && Enum.map(m["elements"], &ExtendedBy.from_map/1),
       id: m["id"],
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       type: TypeEnum.decode(m["type"]),
       type_arguments: m["typeArguments"] && Enum.map(m["typeArguments"], &TypeArgument2.from_map/1),
       types: m["types"] && Enum.map(m["types"], &ExtendedBy.from_map/1),
-      value: m["value"],
+      value: m["value"] && decode_value(m["value"]),
     }
   end
 
@@ -3599,6 +3713,12 @@ defmodule Type12 do
           type: String.t()
         }
 
+  def decode_operator(value) when is_binary(value), do: value
+  def decode_operator(_), do: {:error, "Unexpected type when decoding Type12.operator"}
+
+  def encode_operator(value) when is_binary(value), do: value
+  def encode_operator(_), do: {:error, "Unexpected type when encoding Type12.operator"}
+
   def decode_type(value) when is_binary(value), do: value
   def decode_type(_), do: {:error, "Unexpected type when decoding Type12.type"}
 
@@ -3609,7 +3729,7 @@ defmodule Type12 do
     %Type12{
       id: m["id"],
       name: m["name"] && Name.decode(m["name"]),
-      operator: m["operator"],
+      operator: m["operator"] && decode_operator(m["operator"]),
       target: m["target"] && ElementType.from_map(m["target"]),
       type: decode_type(m["type"]),
     }
@@ -3737,6 +3857,12 @@ defmodule Child1 do
           type_parameter: [TypeParameter.t()] | nil
         }
 
+  def decode_default_value(value) when is_binary(value), do: value
+  def decode_default_value(_), do: {:error, "Unexpected type when decoding Child1.default_value"}
+
+  def encode_default_value(value) when is_binary(value), do: value
+  def encode_default_value(_), do: {:error, "Unexpected type when encoding Child1.default_value"}
+
   def decode_id(value) when is_integer(value), do: value
   def decode_id(_), do: {:error, "Unexpected type when decoding Child1.id"}
 
@@ -3765,7 +3891,7 @@ defmodule Child1 do
     %Child1{
       children: m["children"] && Enum.map(m["children"], &Child2.from_map/1),
       comment: m["comment"] && Comment4.from_map(m["comment"]),
-      default_value: m["defaultValue"],
+      default_value: m["defaultValue"] && decode_default_value(m["defaultValue"]),
       extended_by: m["extendedBy"] && Enum.map(m["extendedBy"], &ExtendedBy.from_map/1),
       extended_types: m["extendedTypes"] && Enum.map(m["extendedTypes"], &ExtendedBy.from_map/1),
       flags: Flags6.from_map(m["flags"]),
diff --git a/base/elixir/test/inputs/json/priority/combinations1.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/combinations1.json/default/QuickType.ex
index b594d36..1a398a5 100644
--- a/base/elixir/test/inputs/json/priority/combinations1.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/combinations1.json/default/QuickType.ex
@@ -246,6 +246,12 @@ defmodule ChemotherapeuticClass do
           unshy: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding ChemotherapeuticClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding ChemotherapeuticClass.disdiapason"}
+
   def from_map(m) do
     %ChemotherapeuticClass{
       angioneurotic: m["angioneurotic"],
@@ -255,7 +261,7 @@ defmodule ChemotherapeuticClass do
       caulis: m["caulis"],
       chalcus: m["chalcus"],
       chirotherium: m["Chirotherium"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       enteradenological: m["enteradenological"],
       homocerc: m["homocerc"],
       imporosity: m["imporosity"],
@@ -427,13 +433,19 @@ defmodule CoadjustClass do
           unchargeable: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding CoadjustClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding CoadjustClass.disdiapason"}
+
   def from_map(m) do
     %CoadjustClass{
       amidosulphonal: m["amidosulphonal"],
       benny: m["Benny"],
       catharticalness: m["catharticalness"],
       chirotherium: m["Chirotherium"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       ensnare: m["ensnare"],
       homocerc: m["homocerc"],
       hybridizer: m["hybridizer"],
@@ -2001,6 +2013,12 @@ defmodule HemocoeleClass do
           walt: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding HemocoeleClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding HemocoeleClass.disdiapason"}
+
   def from_map(m) do
     %HemocoeleClass{
       acrogamy: m["acrogamy"],
@@ -2009,7 +2027,7 @@ defmodule HemocoeleClass do
       berat: m["berat"],
       catharticalness: m["catharticalness"],
       chirotherium: m["Chirotherium"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       disproportionably: m["disproportionably"],
       erythrite: m["erythrite"],
       graphic: m["graphic"],
diff --git a/base/elixir/test/inputs/json/priority/combinations2.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/combinations2.json/default/QuickType.ex
index 9a52006..93c7d8e 100644
--- a/base/elixir/test/inputs/json/priority/combinations2.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/combinations2.json/default/QuickType.ex
@@ -323,6 +323,12 @@ defmodule Amphithyron do
           undecimal: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Amphithyron.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Amphithyron.disdiapason"}
+
   def from_map(m) do
     %Amphithyron{
       akroasis: m["akroasis"],
@@ -331,7 +337,7 @@ defmodule Amphithyron do
       catharticalness: m["catharticalness"],
       chirotherium: m["Chirotherium"],
       conductometric: m["conductometric"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       ensilation: m["ensilation"],
       eyebolt: m["eyebolt"],
       fistulated: m["fistulated"],
@@ -1057,6 +1063,12 @@ defmodule DiscordiaClass do
           wingle: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding DiscordiaClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding DiscordiaClass.disdiapason"}
+
   def from_map(m) do
     %DiscordiaClass{
       altaic: m["Altaic"],
@@ -1065,7 +1077,7 @@ defmodule DiscordiaClass do
       catharticalness: m["catharticalness"],
       chirotherium: m["Chirotherium"],
       disciplinability: m["disciplinability"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       goofer: m["goofer"],
       homocerc: m["homocerc"],
       laryngograph: m["laryngograph"],
@@ -1371,6 +1383,12 @@ defmodule LaviniaClass do
           uproute: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding LaviniaClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding LaviniaClass.disdiapason"}
+
   def from_map(m) do
     %LaviniaClass{
       agitable: m["agitable"],
@@ -1381,7 +1399,7 @@ defmodule LaviniaClass do
       chirotherium: m["Chirotherium"],
       cholesteatomatous: m["cholesteatomatous"],
       deprivement: m["deprivement"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       flippantness: m["flippantness"],
       fogproof: m["fogproof"],
       homocerc: m["homocerc"],
diff --git a/base/elixir/test/inputs/json/priority/combinations3.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/combinations3.json/default/QuickType.ex
index e45a2c2..7b155b6 100644
--- a/base/elixir/test/inputs/json/priority/combinations3.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/combinations3.json/default/QuickType.ex
@@ -666,6 +666,12 @@ defmodule LupusClass do
           vendible: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding LupusClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding LupusClass.disdiapason"}
+
   def from_map(m) do
     %LupusClass{
       catharticalness: m["catharticalness"],
@@ -673,7 +679,7 @@ defmodule LupusClass do
       chlorioninae: m["Chlorioninae"],
       corvinae: m["Corvinae"],
       crassina: m["Crassina"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       exiguity: m["exiguity"],
       farcist: m["farcist"],
       holographical: m["holographical"],
@@ -790,6 +796,12 @@ defmodule Maslin do
           unjudiciously: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Maslin.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Maslin.disdiapason"}
+
   def from_map(m) do
     %Maslin{
       alicant: m["Alicant"],
@@ -805,7 +817,7 @@ defmodule Maslin do
       curtailedly: m["curtailedly"],
       dellenite: m["dellenite"],
       dimitry: m["Dimitry"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       edifying: m["edifying"],
       ethmoiditis: m["ethmoiditis"],
       gastralgy: m["gastralgy"],
@@ -1011,6 +1023,12 @@ defmodule MonotheisticallyClass do
           whitestone: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding MonotheisticallyClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding MonotheisticallyClass.disdiapason"}
+
   def from_map(m) do
     %MonotheisticallyClass{
       blaspheme: m["blaspheme"],
@@ -1018,7 +1036,7 @@ defmodule MonotheisticallyClass do
       celiosalpingectomy: m["celiosalpingectomy"],
       chirotherium: m["Chirotherium"],
       consummativeness: m["consummativeness"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       egestive: m["egestive"],
       enchylema: m["enchylema"],
       gasconade: m["gasconade"],
@@ -1612,6 +1630,12 @@ defmodule PiaculumClass do
           zipper: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding PiaculumClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding PiaculumClass.disdiapason"}
+
   def from_map(m) do
     %PiaculumClass{
       alada: m["alada"],
@@ -1621,7 +1645,7 @@ defmodule PiaculumClass do
       chirotherium: m["Chirotherium"],
       decardinalize: m["decardinalize"],
       discouragement: m["discouragement"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       doitrified: m["doitrified"],
       hexaspermous: m["hexaspermous"],
       homocerc: m["homocerc"],
@@ -1716,6 +1740,12 @@ defmodule Pneumocele do
           visitorial: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Pneumocele.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Pneumocele.disdiapason"}
+
   def from_map(m) do
     %Pneumocele{
       carbonarism: m["Carbonarism"],
@@ -1725,7 +1755,7 @@ defmodule Pneumocele do
       cobbly: m["cobbly"],
       conchyliferous: m["conchyliferous"],
       congregation: m["congregation"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       enterotomy: m["enterotomy"],
       entophytal: m["entophytal"],
       fewtrils: m["fewtrils"],
diff --git a/base/elixir/test/inputs/json/priority/combinations4.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/combinations4.json/default/QuickType.ex
index 7c031fc..323ed8a 100644
--- a/base/elixir/test/inputs/json/priority/combinations4.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/combinations4.json/default/QuickType.ex
@@ -533,6 +533,12 @@ defmodule Reimagine do
           waltzlike: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Reimagine.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Reimagine.disdiapason"}
+
   def from_map(m) do
     %Reimagine{
       adducible: m["adducible"],
@@ -541,7 +547,7 @@ defmodule Reimagine do
       catharticalness: m["catharticalness"],
       chirotherium: m["Chirotherium"],
       chrysamine: m["chrysamine"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       fluxweed: m["fluxweed"],
       glaucine: m["glaucine"],
       grobianism: m["grobianism"],
@@ -1267,6 +1273,12 @@ defmodule SaxtenClass do
           withdrawnness: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding SaxtenClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding SaxtenClass.disdiapason"}
+
   def from_map(m) do
     %SaxtenClass{
       algarrobilla: m["algarrobilla"],
@@ -1274,7 +1286,7 @@ defmodule SaxtenClass do
       catharticalness: m["catharticalness"],
       centaurid: m["Centaurid"],
       chirotherium: m["Chirotherium"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       flix: m["flix"],
       germanely: m["germanely"],
       homocerc: m["homocerc"],
@@ -1791,13 +1803,19 @@ defmodule Staghunting do
           ungirlish: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding Staghunting.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding Staghunting.disdiapason"}
+
   def from_map(m) do
     %Staghunting{
       calorimetric: m["calorimetric"],
       canid: m["canid"],
       catharticalness: m["catharticalness"],
       chirotherium: m["Chirotherium"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       ditriglyphic: m["ditriglyphic"],
       floriferousness: m["floriferousness"],
       gamelike: m["gamelike"],
@@ -1895,6 +1913,12 @@ defmodule StrenuosityClass do
           yankeeist: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding StrenuosityClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding StrenuosityClass.disdiapason"}
+
   def from_map(m) do
     %StrenuosityClass{
       bliss: m["bliss"],
@@ -1903,7 +1927,7 @@ defmodule StrenuosityClass do
       catharticalness: m["catharticalness"],
       chirotherium: m["Chirotherium"],
       crumblingness: m["crumblingness"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       engagedly: m["engagedly"],
       fightable: m["fightable"],
       hoariness: m["hoariness"],
@@ -1999,6 +2023,12 @@ defmodule TruantcyClass do
           yuman: nil | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding TruantcyClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding TruantcyClass.disdiapason"}
+
   def from_map(m) do
     %TruantcyClass{
       alfiona: m["alfiona"],
@@ -2008,7 +2038,7 @@ defmodule TruantcyClass do
       ceroxyle: m["ceroxyle"],
       chirotherium: m["Chirotherium"],
       chorology: m["chorology"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       enmarble: m["enmarble"],
       epeira: m["Epeira"],
       eurylaimi: m["Eurylaimi"],
@@ -2103,6 +2133,12 @@ defmodule UnimpeachablyClass do
           unsuggestedness: integer() | nil
         }
 
+  def decode_disdiapason(value) when is_binary(value), do: value
+  def decode_disdiapason(_), do: {:error, "Unexpected type when decoding UnimpeachablyClass.disdiapason"}
+
+  def encode_disdiapason(value) when is_binary(value), do: value
+  def encode_disdiapason(_), do: {:error, "Unexpected type when encoding UnimpeachablyClass.disdiapason"}
+
   def from_map(m) do
     %UnimpeachablyClass{
       acerin: m["acerin"],
@@ -2112,7 +2148,7 @@ defmodule UnimpeachablyClass do
       chlorophylligenous: m["chlorophylligenous"],
       conversational: m["conversational"],
       demiowl: m["demiowl"],
-      disdiapason: m["disdiapason"],
+      disdiapason: m["disdiapason"] && decode_disdiapason(m["disdiapason"]),
       ectorhinal: m["ectorhinal"],
       gamblesomeness: m["gamblesomeness"],
       homocerc: m["homocerc"],
diff --git a/base/elixir/test/inputs/json/priority/empty-enum.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/empty-enum.json/default/QuickType.ex
index 2dcdce4..a06e05c 100644
--- a/base/elixir/test/inputs/json/priority/empty-enum.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/empty-enum.json/default/QuickType.ex
@@ -12,9 +12,15 @@ defmodule Foo do
           bar: String.t() | nil
         }
 
+  def decode_bar(value) when is_binary(value), do: value
+  def decode_bar(_), do: {:error, "Unexpected type when decoding Foo.bar"}
+
+  def encode_bar(value) when is_binary(value), do: value
+  def encode_bar(_), do: {:error, "Unexpected type when encoding Foo.bar"}
+
   def from_map(m) do
     %Foo{
-      bar: m["bar"],
+      bar: m["bar"] && decode_bar(m["bar"]),
     }
   end
 
diff --git a/base/elixir/test/inputs/json/priority/nbl-stats.json/default/QuickType.ex b/head/elixir/test/inputs/json/priority/nbl-stats.json/default/QuickType.ex
index 2578a48..b9b9eb4 100644
--- a/base/elixir/test/inputs/json/priority/nbl-stats.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/priority/nbl-stats.json/default/QuickType.ex
@@ -529,12 +529,36 @@ defmodule Pbp do
           tno: integer()
         }
 
+  def decode_family_name(value) when is_binary(value), do: value
+  def decode_family_name(_), do: {:error, "Unexpected type when decoding Pbp.family_name"}
+
+  def encode_family_name(value) when is_binary(value), do: value
+  def encode_family_name(_), do: {:error, "Unexpected type when encoding Pbp.family_name"}
+
+  def decode_first_name(value) when is_binary(value), do: value
+  def decode_first_name(_), do: {:error, "Unexpected type when decoding Pbp.first_name"}
+
+  def encode_first_name(value) when is_binary(value), do: value
+  def encode_first_name(_), do: {:error, "Unexpected type when encoding Pbp.first_name"}
+
   def decode_gt(value) when is_binary(value), do: value
   def decode_gt(_), do: {:error, "Unexpected type when decoding Pbp.gt"}
 
   def encode_gt(value) when is_binary(value), do: value
   def encode_gt(_), do: {:error, "Unexpected type when encoding Pbp.gt"}
 
+  def decode_international_family_name(value) when is_binary(value), do: value
+  def decode_international_family_name(_), do: {:error, "Unexpected type when decoding Pbp.international_family_name"}
+
+  def encode_international_family_name(value) when is_binary(value), do: value
+  def encode_international_family_name(_), do: {:error, "Unexpected type when encoding Pbp.international_family_name"}
+
+  def decode_international_first_name(value) when is_binary(value), do: value
+  def decode_international_first_name(_), do: {:error, "Unexpected type when decoding Pbp.international_first_name"}
+
+  def encode_international_first_name(value) when is_binary(value), do: value
+  def encode_international_first_name(_), do: {:error, "Unexpected type when encoding Pbp.international_first_name"}
+
   def decode_lead(value) when is_integer(value), do: value
   def decode_lead(_), do: {:error, "Unexpected type when decoding Pbp.lead"}
 
@@ -610,14 +634,14 @@ defmodule Pbp do
   def from_map(m) do
     %Pbp{
       action_type: ActionType.decode(m["actionType"]),
-      family_name: m["familyName"],
+      family_name: m["familyName"] && decode_family_name(m["familyName"]),
       family_name_initial: m["familyNameInitial"] && FamilyNameInitial.decode(m["familyNameInitial"]),
-      first_name: m["firstName"],
+      first_name: m["firstName"] && decode_first_name(m["firstName"]),
       first_name_initial: m["firstNameInitial"] && FirstNameInitial.decode(m["firstNameInitial"]),
       gt: decode_gt(m["gt"]),
-      international_family_name: m["internationalFamilyName"],
+      international_family_name: m["internationalFamilyName"] && decode_international_family_name(m["internationalFamilyName"]),
       international_family_name_initial: m["internationalFamilyNameInitial"] && FamilyNameInitial.decode(m["internationalFamilyNameInitial"]),
-      international_first_name: m["internationalFirstName"],
+      international_first_name: m["internationalFirstName"] && decode_international_first_name(m["internationalFirstName"]),
       international_first_name_initial: m["internationalFirstNameInitial"] && FirstNameInitial.decode(m["internationalFirstNameInitial"]),
       lead: decode_lead(m["lead"]),
       period: decode_period(m["period"]),
@@ -756,6 +780,48 @@ defmodule Scorer do
           tot: integer() | nil
         }
 
+  def decode_family_name(value) when is_binary(value), do: value
+  def decode_family_name(_), do: {:error, "Unexpected type when decoding Scorer.family_name"}
+
+  def encode_family_name(value) when is_binary(value), do: value
+  def encode_family_name(_), do: {:error, "Unexpected type when encoding Scorer.family_name"}
+
+  def decode_first_name(value) when is_binary(value), do: value
+  def decode_first_name(_), do: {:error, "Unexpected type when decoding Scorer.first_name"}
+
+  def encode_first_name(value) when is_binary(value), do: value
+  def encode_first_name(_), do: {:error, "Unexpected type when encoding Scorer.first_name"}
+
+  def decode_gt(value) when is_binary(value), do: value
+  def decode_gt(_), do: {:error, "Unexpected type when decoding Scorer.gt"}
+
+  def encode_gt(value) when is_binary(value), do: value
+  def encode_gt(_), do: {:error, "Unexpected type when encoding Scorer.gt"}
+
+  def decode_international_family_name(value) when is_binary(value), do: value
+  def decode_international_family_name(_), do: {:error, "Unexpected type when decoding Scorer.international_family_name"}
+
+  def encode_international_family_name(value) when is_binary(value), do: value
+  def encode_international_family_name(_), do: {:error, "Unexpected type when encoding Scorer.international_family_name"}
+
+  def decode_international_first_name(value) when is_binary(value), do: value
+  def decode_international_first_name(_), do: {:error, "Unexpected type when decoding Scorer.international_first_name"}
+
+  def encode_international_first_name(value) when is_binary(value), do: value
+  def encode_international_first_name(_), do: {:error, "Unexpected type when encoding Scorer.international_first_name"}
+
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding Scorer.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Scorer.name"}
+
+  def decode_player(value) when is_binary(value), do: value
+  def decode_player(_), do: {:error, "Unexpected type when decoding Scorer.player"}
+
+  def encode_player(value) when is_binary(value), do: value
+  def encode_player(_), do: {:error, "Unexpected type when encoding Scorer.player"}
+
   def decode_pno(value) when is_integer(value), do: value
   def decode_pno(_), do: {:error, "Unexpected type when decoding Scorer.pno"}
 
@@ -768,6 +834,12 @@ defmodule Scorer do
   def encode_shirt_number(value) when is_binary(value), do: value
   def encode_shirt_number(_), do: {:error, "Unexpected type when encoding Scorer.shirt_number"}
 
+  def decode_summary(value) when is_binary(value), do: value
+  def decode_summary(_), do: {:error, "Unexpected type when decoding Scorer.summary"}
+
+  def encode_summary(value) when is_binary(value), do: value
+  def encode_summary(_), do: {:error, "Unexpected type when encoding Scorer.summary"}
+
   def decode_tno(value) when is_integer(value), do: value
   def decode_tno(_), do: {:error, "Unexpected type when decoding Scorer.tno"}
 
@@ -776,23 +848,23 @@ defmodule Scorer do
 
   def from_map(m) do
     %Scorer{
-      family_name: m["familyName"],
+      family_name: m["familyName"] && decode_family_name(m["familyName"]),
       family_name_initial: m["familyNameInitial"] && FamilyNameInitial.decode(m["familyNameInitial"]),
-      first_name: m["firstName"],
+      first_name: m["firstName"] && decode_first_name(m["firstName"]),
       first_name_initial: m["firstNameInitial"] && FirstNameInitial.decode(m["firstNameInitial"]),
-      gt: m["gt"],
-      international_family_name: m["internationalFamilyName"],
+      gt: m["gt"] && decode_gt(m["gt"]),
+      international_family_name: m["internationalFamilyName"] && decode_international_family_name(m["internationalFamilyName"]),
       international_family_name_initial: m["internationalFamilyNameInitial"] && FamilyNameInitial.decode(m["internationalFamilyNameInitial"]),
-      international_first_name: m["internationalFirstName"],
+      international_first_name: m["internationalFirstName"] && decode_international_first_name(m["internationalFirstName"]),
       international_first_name_initial: m["internationalFirstNameInitial"] && FirstNameInitial.decode(m["internationalFirstNameInitial"]),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       per: m["per"],
       per_type: m["perType"] && PerType.decode(m["perType"]),
-      player: m["player"],
+      player: m["player"] && decode_player(m["player"]),
       pno: decode_pno(m["pno"]),
       scoreboard_name: m["scoreboardName"] && ScoreboardName.decode(m["scoreboardName"]),
       shirt_number: decode_shirt_number(m["shirtNumber"]),
-      summary: m["summary"],
+      summary: m["summary"] && decode_summary(m["summary"]),
       times: m["times"] && Enum.map(m["times"], &TimeElement.from_map/1),
       tno: decode_tno(m["tno"]),
       tot: m["tot"],
diff --git a/base/elixir/test/inputs/json/samples/github-events.json/default/QuickType.ex b/head/elixir/test/inputs/json/samples/github-events.json/default/QuickType.ex
index 1b3e6b2..de5128c 100644
--- a/base/elixir/test/inputs/json/samples/github-events.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/samples/github-events.json/default/QuickType.ex
@@ -24,6 +24,12 @@ defmodule Actor do
   def encode_avatar_url(value) when is_binary(value), do: value
   def encode_avatar_url(_), do: {:error, "Unexpected type when encoding Actor.avatar_url"}
 
+  def decode_display_login(value) when is_binary(value), do: value
+  def decode_display_login(_), do: {:error, "Unexpected type when decoding Actor.display_login"}
+
+  def encode_display_login(value) when is_binary(value), do: value
+  def encode_display_login(_), do: {:error, "Unexpected type when encoding Actor.display_login"}
+
   def decode_gravatar_id(value) when is_binary(value), do: value
   def decode_gravatar_id(_), do: {:error, "Unexpected type when decoding Actor.gravatar_id"}
 
@@ -51,7 +57,7 @@ defmodule Actor do
   def from_map(m) do
     %Actor{
       avatar_url: decode_avatar_url(m["avatar_url"]),
-      display_login: m["display_login"],
+      display_login: m["display_login"] && decode_display_login(m["display_login"]),
       gravatar_id: decode_gravatar_id(m["gravatar_id"]),
       id: decode_id(m["id"]),
       login: decode_login(m["login"]),
@@ -2209,23 +2215,71 @@ defmodule Payload do
           size: integer() | nil
         }
 
+  def decode_action(value) when is_binary(value), do: value
+  def decode_action(_), do: {:error, "Unexpected type when decoding Payload.action"}
+
+  def encode_action(value) when is_binary(value), do: value
+  def encode_action(_), do: {:error, "Unexpected type when encoding Payload.action"}
+
+  def decode_before(value) when is_binary(value), do: value
+  def decode_before(_), do: {:error, "Unexpected type when decoding Payload.before"}
+
+  def encode_before(value) when is_binary(value), do: value
+  def encode_before(_), do: {:error, "Unexpected type when encoding Payload.before"}
+
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding Payload.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding Payload.description"}
+
+  def decode_head(value) when is_binary(value), do: value
+  def decode_head(_), do: {:error, "Unexpected type when decoding Payload.head"}
+
+  def encode_head(value) when is_binary(value), do: value
+  def encode_head(_), do: {:error, "Unexpected type when encoding Payload.head"}
+
+  def decode_master_branch(value) when is_binary(value), do: value
+  def decode_master_branch(_), do: {:error, "Unexpected type when decoding Payload.master_branch"}
+
+  def encode_master_branch(value) when is_binary(value), do: value
+  def encode_master_branch(_), do: {:error, "Unexpected type when encoding Payload.master_branch"}
+
+  def decode_pusher_type(value) when is_binary(value), do: value
+  def decode_pusher_type(_), do: {:error, "Unexpected type when decoding Payload.pusher_type"}
+
+  def encode_pusher_type(value) when is_binary(value), do: value
+  def encode_pusher_type(_), do: {:error, "Unexpected type when encoding Payload.pusher_type"}
+
+  def decode_ref(value) when is_binary(value), do: value
+  def decode_ref(_), do: {:error, "Unexpected type when decoding Payload.ref"}
+
+  def encode_ref(value) when is_binary(value), do: value
+  def encode_ref(_), do: {:error, "Unexpected type when encoding Payload.ref"}
+
+  def decode_ref_type(value) when is_binary(value), do: value
+  def decode_ref_type(_), do: {:error, "Unexpected type when decoding Payload.ref_type"}
+
+  def encode_ref_type(value) when is_binary(value), do: value
+  def encode_ref_type(_), do: {:error, "Unexpected type when encoding Payload.ref_type"}
+
   def from_map(m) do
     %Payload{
-      action: m["action"],
-      before: m["before"],
+      action: m["action"] && decode_action(m["action"]),
+      before: m["before"] && decode_before(m["before"]),
       comment: m["comment"] && Comment.from_map(m["comment"]),
       commits: m["commits"] && Enum.map(m["commits"], &Commit.from_map/1),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       distinct_size: m["distinct_size"],
-      head: m["head"],
+      head: m["head"] && decode_head(m["head"]),
       issue: m["issue"] && Issue.from_map(m["issue"]),
-      master_branch: m["master_branch"],
+      master_branch: m["master_branch"] && decode_master_branch(m["master_branch"]),
       number: m["number"],
       pull_request: m["pull_request"] && PayloadPullRequest.from_map(m["pull_request"]),
       push_id: m["push_id"],
-      pusher_type: m["pusher_type"],
-      ref: m["ref"],
-      ref_type: m["ref_type"],
+      pusher_type: m["pusher_type"] && decode_pusher_type(m["pusher_type"]),
+      ref: m["ref"] && decode_ref(m["ref"]),
+      ref_type: m["ref_type"] && decode_ref_type(m["ref_type"]),
       size: m["size"],
     }
   end
diff --git a/base/elixir/test/inputs/json/samples/null-safe.json/default/QuickType.ex b/head/elixir/test/inputs/json/samples/null-safe.json/default/QuickType.ex
index 2cf6821..f3a9682 100644
--- a/base/elixir/test/inputs/json/samples/null-safe.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/samples/null-safe.json/default/QuickType.ex
@@ -73,6 +73,12 @@ defmodule Item do
           sex: integer() | nil
         }
 
+  def decode_created_at(value) when is_binary(value), do: value
+  def decode_created_at(_), do: {:error, "Unexpected type when decoding Item.created_at"}
+
+  def encode_created_at(value) when is_binary(value), do: value
+  def encode_created_at(_), do: {:error, "Unexpected type when encoding Item.created_at"}
+
   def decode_name(value) when is_binary(value), do: value
   def decode_name(_), do: {:error, "Unexpected type when decoding Item.name"}
 
@@ -82,7 +88,7 @@ defmodule Item do
   def from_map(m) do
     %Item{
       address: m["address"] && Address.from_map(m["address"]),
-      created_at: m["created_at"],
+      created_at: m["created_at"] && decode_created_at(m["created_at"]),
       name: decode_name(m["name"]),
       sex: Map.fetch!(m, "sex"),
     }
diff --git a/base/elixir/test/inputs/json/samples/us-senators.json/default/QuickType.ex b/head/elixir/test/inputs/json/samples/us-senators.json/default/QuickType.ex
index 7afc185..cc32c60 100644
--- a/base/elixir/test/inputs/json/samples/us-senators.json/default/QuickType.ex
+++ b/head/elixir/test/inputs/json/samples/us-senators.json/default/QuickType.ex
@@ -133,19 +133,31 @@ defmodule Extra do
   def encode_contact_form(value) when is_binary(value), do: value
   def encode_contact_form(_), do: {:error, "Unexpected type when encoding Extra.contact_form"}
 
+  def decode_fax(value) when is_binary(value), do: value
+  def decode_fax(_), do: {:error, "Unexpected type when decoding Extra.fax"}
+
+  def encode_fax(value) when is_binary(value), do: value
+  def encode_fax(_), do: {:error, "Unexpected type when encoding Extra.fax"}
+
   def decode_office(value) when is_binary(value), do: value
   def decode_office(_), do: {:error, "Unexpected type when decoding Extra.office"}
 
   def encode_office(value) when is_binary(value), do: value
   def encode_office(_), do: {:error, "Unexpected type when encoding Extra.office"}
 
+  def decode_rss_url(value) when is_binary(value), do: value
+  def decode_rss_url(_), do: {:error, "Unexpected type when decoding Extra.rss_url"}
+
+  def encode_rss_url(value) when is_binary(value), do: value
+  def encode_rss_url(_), do: {:error, "Unexpected type when encoding Extra.rss_url"}
+
   def from_map(m) do
     %Extra{
       address: decode_address(m["address"]),
       contact_form: decode_contact_form(m["contact_form"]),
-      fax: m["fax"],
+      fax: m["fax"] && decode_fax(m["fax"]),
       office: decode_office(m["office"]),
-      rss_url: m["rss_url"],
+      rss_url: m["rss_url"] && decode_rss_url(m["rss_url"]),
     }
   end
 
diff --git a/base/graphql-elixir/test/inputs/graphql/github6.graphql/default/QuickType.ex b/head/graphql-elixir/test/inputs/graphql/github6.graphql/default/QuickType.ex
index 4be2413..a20052c 100644
--- a/base/graphql-elixir/test/inputs/graphql/github6.graphql/default/QuickType.ex
+++ b/head/graphql-elixir/test/inputs/graphql/github6.graphql/default/QuickType.ex
@@ -20,10 +20,16 @@ defmodule UniformResourceLocatable do
   def encode_url(value) when is_binary(value), do: value
   def encode_url(_), do: {:error, "Unexpected type when encoding UniformResourceLocatable.url"}
 
+  def decode_login(value) when is_binary(value), do: value
+  def decode_login(_), do: {:error, "Unexpected type when decoding UniformResourceLocatable.login"}
+
+  def encode_login(value) when is_binary(value), do: value
+  def encode_login(_), do: {:error, "Unexpected type when encoding UniformResourceLocatable.login"}
+
   def from_map(m) do
     %UniformResourceLocatable{
       url: decode_url(m["url"]),
-      login: m["login"],
+      login: m["login"] && decode_login(m["login"]),
     }
   end
 
diff --git a/base/graphql-elixir/test/inputs/graphql/github8.graphql/default/QuickType.ex b/head/graphql-elixir/test/inputs/graphql/github8.graphql/default/QuickType.ex
index 6231fe6..0fc4d97 100644
--- a/base/graphql-elixir/test/inputs/graphql/github8.graphql/default/QuickType.ex
+++ b/head/graphql-elixir/test/inputs/graphql/github8.graphql/default/QuickType.ex
@@ -60,9 +60,15 @@ defmodule IssueOrPullRequest do
           merged: boolean() | nil
         }
 
+  def decode_title(value) when is_binary(value), do: value
+  def decode_title(_), do: {:error, "Unexpected type when decoding IssueOrPullRequest.title"}
+
+  def encode_title(value) when is_binary(value), do: value
+  def encode_title(_), do: {:error, "Unexpected type when encoding IssueOrPullRequest.title"}
+
   def from_map(m) do
     %IssueOrPullRequest{
-      title: m["title"],
+      title: m["title"] && decode_title(m["title"]),
       state: m["state"] && IssueState.decode(m["state"]),
       merged: m["merged"],
     }
diff --git a/base/schema-elixir/test/inputs/schema/all-of-additional-properties-false.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/all-of-additional-properties-false.schema/default/QuickType.ex
index 9125750..667751f 100644
--- a/base/schema-elixir/test/inputs/schema/all-of-additional-properties-false.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/all-of-additional-properties-false.schema/default/QuickType.ex
@@ -117,11 +117,17 @@ defmodule TopLevel do
   def encode_amount(value) when is_integer(value), do: value
   def encode_amount(_), do: {:error, "Unexpected type when encoding TopLevel.amount"}
 
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding TopLevel.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding TopLevel.description"}
+
   def from_map(m) do
     %TopLevel{
       amount: decode_amount(m["amount"]),
       frequency: Frequency.decode(m["frequency"]),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       type: Type.decode(m["type"]),
     }
   end
diff --git a/base/schema-elixir/test/inputs/schema/bool-string.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/bool-string.schema/default/QuickType.ex
index 63cb009..bb19197 100644
--- a/base/schema-elixir/test/inputs/schema/bool-string.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/bool-string.schema/default/QuickType.ex
@@ -33,13 +33,19 @@ defmodule TopLevel do
   def encode_one(value) when is_binary(value), do: value
   def encode_one(_), do: {:error, "Unexpected type when encoding TopLevel.one"}
 
+  def decode_optional(value) when is_binary(value), do: value
+  def decode_optional(_), do: {:error, "Unexpected type when decoding TopLevel.optional"}
+
+  def encode_optional(value) when is_binary(value), do: value
+  def encode_optional(_), do: {:error, "Unexpected type when encoding TopLevel.optional"}
+
   def from_map(m) do
     %TopLevel{
       arr_nullable: m["arrNullable"] && Enum.map(m["arrNullable"], &decode_arr_nullable_element/1),
       arr_one: m["arrOne"],
       nullable: Map.fetch!(m, "nullable"),
       one: decode_one(m["one"]),
-      optional: m["optional"],
+      optional: m["optional"] && decode_optional(m["optional"]),
       union_with_bool: Map.fetch!(m, "unionWithBool"),
       union_with_bool_and_enum: Map.fetch!(m, "unionWithBoolAndEnum"),
     }
diff --git a/base/schema-elixir/test/inputs/schema/camelCase.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/camelCase.schema/default/QuickType.ex
index 56c39c1..95b835e 100644
--- a/base/schema-elixir/test/inputs/schema/camelCase.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/camelCase.schema/default/QuickType.ex
@@ -13,10 +13,22 @@ defmodule TopLevel do
           second_property: String.t() | nil
         }
 
+  def decode_my_property(value) when is_binary(value), do: value
+  def decode_my_property(_), do: {:error, "Unexpected type when decoding TopLevel.my_property"}
+
+  def encode_my_property(value) when is_binary(value), do: value
+  def encode_my_property(_), do: {:error, "Unexpected type when encoding TopLevel.my_property"}
+
+  def decode_second_property(value) when is_binary(value), do: value
+  def decode_second_property(_), do: {:error, "Unexpected type when decoding TopLevel.second_property"}
+
+  def encode_second_property(value) when is_binary(value), do: value
+  def encode_second_property(_), do: {:error, "Unexpected type when encoding TopLevel.second_property"}
+
   def from_map(m) do
     %TopLevel{
-      my_property: m["myProperty"],
-      second_property: m["secondProperty"],
+      my_property: m["myProperty"] && decode_my_property(m["myProperty"]),
+      second_property: m["secondProperty"] && decode_second_property(m["secondProperty"]),
     }
   end
 
diff --git a/base/schema-elixir/test/inputs/schema/comment-injection.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/comment-injection.schema/default/QuickType.ex
index 568bd38..4c03ada 100644
--- a/base/schema-elixir/test/inputs/schema/comment-injection.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/comment-injection.schema/default/QuickType.ex
@@ -35,6 +35,24 @@ defmodule TopLevel do
           value: String.t()
         }
 
+  def decode_trailing_backslash(value) when is_binary(value), do: value
+  def decode_trailing_backslash(_), do: {:error, "Unexpected type when decoding TopLevel.trailing_backslash"}
+
+  def encode_trailing_backslash(value) when is_binary(value), do: value
+  def encode_trailing_backslash(_), do: {:error, "Unexpected type when encoding TopLevel.trailing_backslash"}
+
+  def decode_trailing_quote(value) when is_binary(value), do: value
+  def decode_trailing_quote(_), do: {:error, "Unexpected type when decoding TopLevel.trailing_quote"}
+
+  def encode_trailing_quote(value) when is_binary(value), do: value
+  def encode_trailing_quote(_), do: {:error, "Unexpected type when encoding TopLevel.trailing_quote"}
+
+  def decode_trailing_triple_quote(value) when is_binary(value), do: value
+  def decode_trailing_triple_quote(_), do: {:error, "Unexpected type when decoding TopLevel.trailing_triple_quote"}
+
+  def encode_trailing_triple_quote(value) when is_binary(value), do: value
+  def encode_trailing_triple_quote(_), do: {:error, "Unexpected type when encoding TopLevel.trailing_triple_quote"}
+
   def decode_value(value) when is_binary(value), do: value
   def decode_value(_), do: {:error, "Unexpected type when decoding TopLevel.value"}
 
@@ -43,9 +61,9 @@ defmodule TopLevel do
 
   def from_map(m) do
     %TopLevel{
-      trailing_backslash: m["trailingBackslash"],
-      trailing_quote: m["trailingQuote"],
-      trailing_triple_quote: m["trailingTripleQuote"],
+      trailing_backslash: m["trailingBackslash"] && decode_trailing_backslash(m["trailingBackslash"]),
+      trailing_quote: m["trailingQuote"] && decode_trailing_quote(m["trailingQuote"]),
+      trailing_triple_quote: m["trailingTripleQuote"] && decode_trailing_triple_quote(m["trailingTripleQuote"]),
       value: decode_value(m["value"]),
     }
   end
diff --git a/base/schema-elixir/test/inputs/schema/enum.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/enum.schema/default/QuickType.ex
index ad3cb12..f91043c 100644
--- a/base/schema-elixir/test/inputs/schema/enum.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/enum.schema/default/QuickType.ex
@@ -166,10 +166,16 @@ defmodule TopLevel do
   def encode_arr_element(value) when is_integer(value), do: value
   def encode_arr_element(_), do: {:error, "Unexpected type when encoding TopLevel.arr"}
 
+  def decode_for(value) when is_binary(value), do: value
+  def decode_for(_), do: {:error, "Unexpected type when decoding TopLevel.for"}
+
+  def encode_for(value) when is_binary(value), do: value
+  def encode_for(_), do: {:error, "Unexpected type when encoding TopLevel.for"}
+
   def from_map(m) do
     %TopLevel{
       arr: m["arr"] && Enum.map(m["arr"], &decode_arr_element/1),
-      for: m["for"],
+      for: m["for"] && decode_for(m["for"]),
       gve: Gve.decode(m["gve"]),
       lvc: m["lvc"] && Lvc.decode(m["lvc"]),
       other_arr: m["otherArr"] && Enum.map(m["otherArr"], &OtherArr.decode/1),
diff --git a/base/schema-elixir/test/inputs/schema/implicit-one-of.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/implicit-one-of.schema/default/QuickType.ex
index 799ebf6..fd8e991 100644
--- a/base/schema-elixir/test/inputs/schema/implicit-one-of.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/implicit-one-of.schema/default/QuickType.ex
@@ -21,11 +21,17 @@ defmodule TopLevel do
   def encode_foo(value) when is_integer(value), do: value
   def encode_foo(_), do: {:error, "Unexpected type when encoding TopLevel.foo"}
 
+  def decode_quux(value) when is_binary(value), do: value
+  def decode_quux(_), do: {:error, "Unexpected type when decoding TopLevel.quux"}
+
+  def encode_quux(value) when is_binary(value), do: value
+  def encode_quux(_), do: {:error, "Unexpected type when encoding TopLevel.quux"}
+
   def from_map(m) do
     %TopLevel{
       foo: decode_foo(m["foo"]),
       bar: m["bar"],
-      quux: m["quux"],
+      quux: m["quux"] && decode_quux(m["quux"]),
     }
   end
 
diff --git a/base/schema-elixir/test/inputs/schema/integer-string.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/integer-string.schema/default/QuickType.ex
index c5b4a64..e1a0253 100644
--- a/base/schema-elixir/test/inputs/schema/integer-string.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/integer-string.schema/default/QuickType.ex
@@ -33,13 +33,19 @@ defmodule TopLevel do
   def encode_one(value) when is_binary(value), do: value
   def encode_one(_), do: {:error, "Unexpected type when encoding TopLevel.one"}
 
+  def decode_optional(value) when is_binary(value), do: value
+  def decode_optional(_), do: {:error, "Unexpected type when decoding TopLevel.optional"}
+
+  def encode_optional(value) when is_binary(value), do: value
+  def encode_optional(_), do: {:error, "Unexpected type when encoding TopLevel.optional"}
+
   def from_map(m) do
     %TopLevel{
       arr_nullable: m["arrNullable"] && Enum.map(m["arrNullable"], &decode_arr_nullable_element/1),
       arr_one: m["arrOne"],
       nullable: Map.fetch!(m, "nullable"),
       one: decode_one(m["one"]),
-      optional: m["optional"],
+      optional: m["optional"] && decode_optional(m["optional"]),
       union_with_int: Map.fetch!(m, "unionWithInt"),
       union_with_int_and_enum: Map.fetch!(m, "unionWithIntAndEnum"),
     }
diff --git a/base/schema-elixir/test/inputs/schema/intersection.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/intersection.schema/default/QuickType.ex
index 8e35c58..b4b0b45 100644
--- a/base/schema-elixir/test/inputs/schema/intersection.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/intersection.schema/default/QuickType.ex
@@ -22,10 +22,16 @@ defmodule Intersection do
   def encode_foo(value) when is_integer(value), do: value
   def encode_foo(_), do: {:error, "Unexpected type when encoding Intersection.foo"}
 
+  def decode_bar(value) when is_binary(value), do: value
+  def decode_bar(_), do: {:error, "Unexpected type when decoding Intersection.bar"}
+
+  def encode_bar(value) when is_binary(value), do: value
+  def encode_bar(_), do: {:error, "Unexpected type when encoding Intersection.bar"}
+
   def from_map(m) do
     %Intersection{
       foo: decode_foo(m["foo"]),
-      bar: m["bar"],
+      bar: m["bar"] && decode_bar(m["bar"]),
     }
   end
 
diff --git a/base/schema-elixir/test/inputs/schema/minmaxlength.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/minmaxlength.schema/default/QuickType.ex
index 07bbd65..b3990c2 100644
--- a/base/schema-elixir/test/inputs/schema/minmaxlength.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/minmaxlength.schema/default/QuickType.ex
@@ -20,31 +20,41 @@ defmodule TopLevel do
           union: String.t()
         }
 
-  def decode_intersection(value) when is_binary(value), do: value
+  def decode_intersection(value) when is_binary(value) do
+    if String.length(value) >= 4 and String.length(value) <= 5, do: value, else: raise(ArgumentError)
+  end
   def decode_intersection(_), do: {:error, "Unexpected type when decoding TopLevel.intersection"}
 
   def encode_intersection(value) when is_binary(value), do: value
   def encode_intersection(_), do: {:error, "Unexpected type when encoding TopLevel.intersection"}
 
-  def decode_maxlength(value) when is_binary(value), do: value
+  def decode_maxlength(value) when is_binary(value) do
+    if String.length(value) <= 5, do: value, else: raise(ArgumentError)
+  end
   def decode_maxlength(_), do: {:error, "Unexpected type when decoding TopLevel.maxlength"}
 
   def encode_maxlength(value) when is_binary(value), do: value
   def encode_maxlength(_), do: {:error, "Unexpected type when encoding TopLevel.maxlength"}
 
-  def decode_minlength(value) when is_binary(value), do: value
+  def decode_minlength(value) when is_binary(value) do
+    if String.length(value) >= 3, do: value, else: raise(ArgumentError)
+  end
   def decode_minlength(_), do: {:error, "Unexpected type when decoding TopLevel.minlength"}
 
   def encode_minlength(value) when is_binary(value), do: value
   def encode_minlength(_), do: {:error, "Unexpected type when encoding TopLevel.minlength"}
 
-  def decode_min_max_intersection(value) when is_binary(value), do: value
+  def decode_min_max_intersection(value) when is_binary(value) do
+    if String.length(value) >= 3 and String.length(value) <= 5, do: value, else: raise(ArgumentError)
+  end
   def decode_min_max_intersection(_), do: {:error, "Unexpected type when decoding TopLevel.min_max_intersection"}
 
   def encode_min_max_intersection(value) when is_binary(value), do: value
   def encode_min_max_intersection(_), do: {:error, "Unexpected type when encoding TopLevel.min_max_intersection"}
 
-  def decode_minmaxlength(value) when is_binary(value), do: value
+  def decode_minmaxlength(value) when is_binary(value) do
+    if String.length(value) >= 3 and String.length(value) <= 5, do: value, else: raise(ArgumentError)
+  end
   def decode_minmaxlength(_), do: {:error, "Unexpected type when decoding TopLevel.minmaxlength"}
 
   def encode_minmaxlength(value) when is_binary(value), do: value
@@ -56,7 +66,9 @@ defmodule TopLevel do
   def encode_min_max_union(value) when is_binary(value), do: value
   def encode_min_max_union(_), do: {:error, "Unexpected type when encoding TopLevel.min_max_union"}
 
-  def decode_union(value) when is_binary(value), do: value
+  def decode_union(value) when is_binary(value) do
+    if String.length(value) >= 3 and String.length(value) <= 6, do: value, else: raise(ArgumentError)
+  end
   def decode_union(_), do: {:error, "Unexpected type when decoding TopLevel.union"}
 
   def encode_union(value) when is_binary(value), do: value
diff --git a/base/schema-elixir/test/inputs/schema/nested-intersection-union.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/nested-intersection-union.schema/default/QuickType.ex
index 92e1629..899731f 100644
--- a/base/schema-elixir/test/inputs/schema/nested-intersection-union.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/nested-intersection-union.schema/default/QuickType.ex
@@ -15,12 +15,36 @@ defmodule Item do
           summary: String.t() | nil
         }
 
+  def decode_content(value) when is_binary(value), do: value
+  def decode_content(_), do: {:error, "Unexpected type when decoding Item.content"}
+
+  def encode_content(value) when is_binary(value), do: value
+  def encode_content(_), do: {:error, "Unexpected type when encoding Item.content"}
+
+  def decode_id(value) when is_binary(value), do: value
+  def decode_id(_), do: {:error, "Unexpected type when decoding Item.id"}
+
+  def encode_id(value) when is_binary(value), do: value
+  def encode_id(_), do: {:error, "Unexpected type when encoding Item.id"}
+
+  def decode_output(value) when is_binary(value), do: value
+  def decode_output(_), do: {:error, "Unexpected type when decoding Item.output"}
+
+  def encode_output(value) when is_binary(value), do: value
+  def encode_output(_), do: {:error, "Unexpected type when encoding Item.output"}
+
+  def decode_summary(value) when is_binary(value), do: value
+  def decode_summary(_), do: {:error, "Unexpected type when decoding Item.summary"}
+
+  def encode_summary(value) when is_binary(value), do: value
+  def encode_summary(_), do: {:error, "Unexpected type when encoding Item.summary"}
+
   def from_map(m) do
     %Item{
-      content: m["content"],
-      id: m["id"],
-      output: m["output"],
-      summary: m["summary"],
+      content: m["content"] && decode_content(m["content"]),
+      id: m["id"] && decode_id(m["id"]),
+      output: m["output"] && decode_output(m["output"]),
+      summary: m["summary"] && decode_summary(m["summary"]),
     }
   end
 
diff --git a/base/schema-elixir/test/inputs/schema/object-type-required.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/object-type-required.schema/default/QuickType.ex
index 2627628..ec697e4 100644
--- a/base/schema-elixir/test/inputs/schema/object-type-required.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/object-type-required.schema/default/QuickType.ex
@@ -20,10 +20,16 @@ defmodule TopLevel do
   def encode_foo(value) when is_binary(value), do: value
   def encode_foo(_), do: {:error, "Unexpected type when encoding TopLevel.foo"}
 
+  def decode_bar(value) when is_binary(value), do: value
+  def decode_bar(_), do: {:error, "Unexpected type when decoding TopLevel.bar"}
+
+  def encode_bar(value) when is_binary(value), do: value
+  def encode_bar(_), do: {:error, "Unexpected type when encoding TopLevel.bar"}
+
   def from_map(m) do
     %TopLevel{
       foo: decode_foo(m["foo"]),
-      bar: m["bar"],
+      bar: m["bar"] && decode_bar(m["bar"]),
     }
   end
 
diff --git a/base/schema-elixir/test/inputs/schema/optional-const-ref.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/optional-const-ref.schema/default/QuickType.ex
index 0542ed9..145fa38 100644
--- a/base/schema-elixir/test/inputs/schema/optional-const-ref.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/optional-const-ref.schema/default/QuickType.ex
@@ -71,6 +71,14 @@ defmodule TopLevel do
           weight: float() | nil
         }
 
+  def decode_label(value) when is_binary(value) do
+    if String.length(value) >= 2 and String.length(value) <= 16, do: value, else: raise(ArgumentError)
+  end
+  def decode_label(_), do: {:error, "Unexpected type when decoding TopLevel.label"}
+
+  def encode_label(value) when is_binary(value), do: value
+  def encode_label(_), do: {:error, "Unexpected type when encoding TopLevel.label"}
+
   def decode_required_coordinates(value) when is_list(value), do: value
   def decode_required_coordinates(_), do: {:error, "Unexpected type when decoding TopLevel.required_coordinates"}
 
@@ -83,7 +91,9 @@ defmodule TopLevel do
   def encode_required_count(value) when is_integer(value), do: value
   def encode_required_count(_), do: {:error, "Unexpected type when encoding TopLevel.required_count"}
 
-  def decode_required_label(value) when is_binary(value), do: value
+  def decode_required_label(value) when is_binary(value) do
+    if String.length(value) >= 2 and String.length(value) <= 16, do: value, else: raise(ArgumentError)
+  end
   def decode_required_label(_), do: {:error, "Unexpected type when decoding TopLevel.required_label"}
 
   def encode_required_label(value) when is_binary(value), do: value
@@ -93,7 +103,7 @@ defmodule TopLevel do
     %TopLevel{
       coordinates: m["coordinates"] && Enum.map(m["coordinates"], &Coordinate.from_map/1),
       count: m["count"],
-      label: m["label"],
+      label: m["label"] && decode_label(m["label"]),
       required_coordinates: Enum.map(m["requiredCoordinates"], &Coordinate.from_map/1),
       required_count: decode_required_count(m["requiredCount"]),
       required_label: decode_required_label(m["requiredLabel"]),
diff --git a/base/schema-elixir/test/inputs/schema/optional-constraints.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/optional-constraints.schema/default/QuickType.ex
index 151b91e..b9aae34 100644
--- a/base/schema-elixir/test/inputs/schema/optional-constraints.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/optional-constraints.schema/default/QuickType.ex
@@ -17,6 +17,20 @@ defmodule TopLevel do
           req_zero_min: integer()
         }
 
+  def decode_opt_pattern(value) when is_binary(value), do: value
+  def decode_opt_pattern(_), do: {:error, "Unexpected type when decoding TopLevel.opt_pattern"}
+
+  def encode_opt_pattern(value) when is_binary(value), do: value
+  def encode_opt_pattern(_), do: {:error, "Unexpected type when encoding TopLevel.opt_pattern"}
+
+  def decode_opt_string(value) when is_binary(value) do
+    if String.length(value) >= 3 and String.length(value) <= 10, do: value, else: raise(ArgumentError)
+  end
+  def decode_opt_string(_), do: {:error, "Unexpected type when decoding TopLevel.opt_string"}
+
+  def encode_opt_string(value) when is_binary(value), do: value
+  def encode_opt_string(_), do: {:error, "Unexpected type when encoding TopLevel.opt_string"}
+
   def decode_req_zero_min(value) when is_integer(value), do: value
   def decode_req_zero_min(_), do: {:error, "Unexpected type when decoding TopLevel.req_zero_min"}
 
@@ -27,8 +41,8 @@ defmodule TopLevel do
     %TopLevel{
       opt_double: m["optDouble"],
       opt_int: m["optInt"],
-      opt_pattern: m["optPattern"],
-      opt_string: m["optString"],
+      opt_pattern: m["optPattern"] && decode_opt_pattern(m["optPattern"]),
+      opt_string: m["optString"] && decode_opt_string(m["optString"]),
       req_zero_min: decode_req_zero_min(m["reqZeroMin"]),
     }
   end
diff --git a/base/schema-elixir/test/inputs/schema/optional-date-time.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/optional-date-time.schema/default/QuickType.ex
index e4180fb..1ae1575 100644
--- a/base/schema-elixir/test/inputs/schema/optional-date-time.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/optional-date-time.schema/default/QuickType.ex
@@ -18,6 +18,24 @@ defmodule TopLevel do
           required_time: String.t()
         }
 
+  def decode_optional_date(value) when is_binary(value), do: value
+  def decode_optional_date(_), do: {:error, "Unexpected type when decoding TopLevel.optional_date"}
+
+  def encode_optional_date(value) when is_binary(value), do: value
+  def encode_optional_date(_), do: {:error, "Unexpected type when encoding TopLevel.optional_date"}
+
+  def decode_optional_date_time(value) when is_binary(value), do: value
+  def decode_optional_date_time(_), do: {:error, "Unexpected type when decoding TopLevel.optional_date_time"}
+
+  def encode_optional_date_time(value) when is_binary(value), do: value
+  def encode_optional_date_time(_), do: {:error, "Unexpected type when encoding TopLevel.optional_date_time"}
+
+  def decode_optional_time(value) when is_binary(value), do: value
+  def decode_optional_time(_), do: {:error, "Unexpected type when decoding TopLevel.optional_time"}
+
+  def encode_optional_time(value) when is_binary(value), do: value
+  def encode_optional_time(_), do: {:error, "Unexpected type when encoding TopLevel.optional_time"}
+
   def decode_required_date(value) when is_binary(value), do: value
   def decode_required_date(_), do: {:error, "Unexpected type when decoding TopLevel.required_date"}
 
@@ -38,9 +56,9 @@ defmodule TopLevel do
 
   def from_map(m) do
     %TopLevel{
-      optional_date: m["optional-date"],
-      optional_date_time: m["optional-date-time"],
-      optional_time: m["optional-time"],
+      optional_date: m["optional-date"] && decode_optional_date(m["optional-date"]),
+      optional_date_time: m["optional-date-time"] && decode_optional_date_time(m["optional-date-time"]),
+      optional_time: m["optional-time"] && decode_optional_time(m["optional-time"]),
       required_date: decode_required_date(m["required-date"]),
       required_date_time: decode_required_date_time(m["required-date-time"]),
       required_time: decode_required_time(m["required-time"]),
diff --git a/base/schema-elixir/test/inputs/schema/postman-collection.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/postman-collection.schema/default/QuickType.ex
index 706c098..dda888c 100644
--- a/base/schema-elixir/test/inputs/schema/postman-collection.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/postman-collection.schema/default/QuickType.ex
@@ -12,9 +12,15 @@ defmodule Response do
           body: String.t() | nil
         }
 
+  def decode_body(value) when is_binary(value), do: value
+  def decode_body(_), do: {:error, "Unexpected type when decoding Response.body"}
+
+  def encode_body(value) when is_binary(value), do: value
+  def encode_body(_), do: {:error, "Unexpected type when encoding Response.body"}
+
   def from_map(m) do
     %Response{
-      body: m["body"],
+      body: m["body"] && decode_body(m["body"]),
     }
   end
 
@@ -50,10 +56,16 @@ defmodule TopLevel do
           response: [Response.t()] | nil
         }
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding TopLevel.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding TopLevel.name"}
+
   def from_map(m) do
     %TopLevel{
       item: m["item"] && Enum.map(m["item"], &TopLevel.from_map/1),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       response: m["response"] && Enum.map(m["response"], &Response.from_map/1),
     }
   end
diff --git a/base/schema-elixir/test/inputs/schema/renaming-bug.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/renaming-bug.schema/default/QuickType.ex
index b13cdbf..e54c4b4 100644
--- a/base/schema-elixir/test/inputs/schema/renaming-bug.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/renaming-bug.schema/default/QuickType.ex
@@ -44,9 +44,15 @@ defmodule CircularShape do
           shape_name: String.t() | nil
         }
 
+  def decode_shape_name(value) when is_binary(value), do: value
+  def decode_shape_name(_), do: {:error, "Unexpected type when decoding CircularShape.shape_name"}
+
+  def encode_shape_name(value) when is_binary(value), do: value
+  def encode_shape_name(_), do: {:error, "Unexpected type when encoding CircularShape.shape_name"}
+
   def from_map(m) do
     %CircularShape{
-      shape_name: m["shapeName"],
+      shape_name: m["shapeName"] && decode_shape_name(m["shapeName"]),
     }
   end
 
@@ -78,11 +84,29 @@ defmodule Part do
           width: String.t() | nil
         }
 
+  def decode_depth(value) when is_binary(value), do: value
+  def decode_depth(_), do: {:error, "Unexpected type when decoding Part.depth"}
+
+  def encode_depth(value) when is_binary(value), do: value
+  def encode_depth(_), do: {:error, "Unexpected type when encoding Part.depth"}
+
+  def decode_length(value) when is_binary(value), do: value
+  def decode_length(_), do: {:error, "Unexpected type when decoding Part.length"}
+
+  def encode_length(value) when is_binary(value), do: value
+  def encode_length(_), do: {:error, "Unexpected type when encoding Part.length"}
+
+  def decode_width(value) when is_binary(value), do: value
+  def decode_width(_), do: {:error, "Unexpected type when decoding Part.width"}
+
+  def encode_width(value) when is_binary(value), do: value
+  def encode_width(_), do: {:error, "Unexpected type when encoding Part.width"}
+
   def from_map(m) do
     %Part{
-      depth: m["depth"],
-      length: m["length"],
-      width: m["width"],
+      depth: m["depth"] && decode_depth(m["depth"]),
+      length: m["length"] && decode_length(m["length"]),
+      width: m["width"] && decode_width(m["width"]),
     }
   end
 
@@ -181,9 +205,15 @@ defmodule History do
           class: String.t() | nil
         }
 
+  def decode_class(value) when is_binary(value), do: value
+  def decode_class(_), do: {:error, "Unexpected type when decoding History.class"}
+
+  def encode_class(value) when is_binary(value), do: value
+  def encode_class(_), do: {:error, "Unexpected type when encoding History.class"}
+
   def from_map(m) do
     %History{
-      class: m["class"],
+      class: m["class"] && decode_class(m["class"]),
     }
   end
 
@@ -250,10 +280,18 @@ defmodule Berry do
           shapes: [Shape.t()] | nil
         }
 
+  def decode_name(value) when is_binary(value) do
+    if String.length(value) >= 1, do: value, else: raise(ArgumentError)
+  end
+  def decode_name(_), do: {:error, "Unexpected type when decoding Berry.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Berry.name"}
+
   def from_map(m) do
     %Berry{
       color: m["color"] && Color.from_map(m["color"]),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       shapes: m["shapes"] && Enum.map(m["shapes"], &Shape.from_map/1),
     }
   end
@@ -537,14 +575,34 @@ defmodule Vehicle do
           year: String.t() | nil
         }
 
+  def decode_brand(value) when is_binary(value), do: value
+  def decode_brand(_), do: {:error, "Unexpected type when decoding Vehicle.brand"}
+
+  def encode_brand(value) when is_binary(value), do: value
+  def encode_brand(_), do: {:error, "Unexpected type when encoding Vehicle.brand"}
+
+  def decode_id(value) when is_binary(value) do
+    if String.length(value) >= 1, do: value, else: raise(ArgumentError)
+  end
+  def decode_id(_), do: {:error, "Unexpected type when decoding Vehicle.id"}
+
+  def encode_id(value) when is_binary(value), do: value
+  def encode_id(_), do: {:error, "Unexpected type when encoding Vehicle.id"}
+
+  def decode_year(value) when is_binary(value), do: value
+  def decode_year(_), do: {:error, "Unexpected type when decoding Vehicle.year"}
+
+  def encode_year(value) when is_binary(value), do: value
+  def encode_year(_), do: {:error, "Unexpected type when encoding Vehicle.year"}
+
   def from_map(m) do
     %Vehicle{
-      brand: m["brand"],
-      id: m["id"],
+      brand: m["brand"] && decode_brand(m["brand"]),
+      id: m["id"] && decode_id(m["id"]),
       speed: m["speed"] && Speed.from_map(m["speed"]),
       sub_module: m["subModule"],
       type: m["type"] && VehicleType.from_map(m["type"]),
-      year: m["year"],
+      year: m["year"] && decode_year(m["year"]),
     }
   end
 
@@ -581,9 +639,15 @@ defmodule TopLevel do
           vehicles: [Vehicle.t()] | nil
         }
 
+  def decode_version(value) when is_binary(value), do: value
+  def decode_version(_), do: {:error, "Unexpected type when decoding TopLevel.version"}
+
+  def encode_version(value) when is_binary(value), do: value
+  def encode_version(_), do: {:error, "Unexpected type when encoding TopLevel.version"}
+
   def from_map(m) do
     %TopLevel{
-      version: m["version"],
+      version: m["version"] && decode_version(m["version"]),
       fruits: m["fruits"] && Enum.map(m["fruits"], &Fruit.from_map/1),
       vehicles: m["vehicles"] && Enum.map(m["vehicles"], &Vehicle.from_map/1),
     }
diff --git a/base/schema-elixir/test/inputs/schema/schema-constraints.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/schema-constraints.schema/default/QuickType.ex
index 6d909f1..154049c 100644
--- a/base/schema-elixir/test/inputs/schema/schema-constraints.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/schema-constraints.schema/default/QuickType.ex
@@ -14,7 +14,9 @@ defmodule TopLevel do
           percent: float()
         }
 
-  def decode_min_max_length(value) when is_binary(value), do: value
+  def decode_min_max_length(value) when is_binary(value) do
+    if String.length(value) >= 5 and String.length(value) <= 5, do: value, else: raise(ArgumentError)
+  end
   def decode_min_max_length(_), do: {:error, "Unexpected type when decoding TopLevel.min_max_length"}
 
   def encode_min_max_length(value) when is_binary(value), do: value
diff --git a/base/schema-elixir/test/inputs/schema/unevaluated-properties.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/unevaluated-properties.schema/default/QuickType.ex
index e259c0b..2a2724b 100644
--- a/base/schema-elixir/test/inputs/schema/unevaluated-properties.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/unevaluated-properties.schema/default/QuickType.ex
@@ -109,10 +109,16 @@ defmodule ConfigClass do
   def encode_closed(value) when is_list(value), do: value
   def encode_closed(_), do: {:error, "Unexpected type when encoding ConfigClass.closed"}
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding ConfigClass.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding ConfigClass.name"}
+
   def from_map(m) do
     %ConfigClass{
       closed: decode_closed(m["closed"]),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       settings: m["settings"]
       |> Map.new(fn {key, value} -> {key, (fn value -> Enum.map(value, &Item.from_map/1) end).(value)} end),
     }
diff --git a/base/schema-elixir/test/inputs/schema/uuid.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/uuid.schema/default/QuickType.ex
index 1ea6e51..7c56255 100644
--- a/base/schema-elixir/test/inputs/schema/uuid.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/uuid.schema/default/QuickType.ex
@@ -32,6 +32,12 @@ defmodule TopLevel do
   def encode_one(value) when is_binary(value), do: value
   def encode_one(_), do: {:error, "Unexpected type when encoding TopLevel.one"}
 
+  def decode_optional(value) when is_binary(value), do: value
+  def decode_optional(_), do: {:error, "Unexpected type when decoding TopLevel.optional"}
+
+  def encode_optional(value) when is_binary(value), do: value
+  def encode_optional(_), do: {:error, "Unexpected type when encoding TopLevel.optional"}
+
   def decode_union_with_enum(value) when is_binary(value), do: value
   def decode_union_with_enum(_), do: {:error, "Unexpected type when decoding TopLevel.union_with_enum"}
 
@@ -44,7 +50,7 @@ defmodule TopLevel do
       arr_one: m["arrOne"],
       nullable: Map.fetch!(m, "nullable"),
       one: decode_one(m["one"]),
-      optional: m["optional"],
+      optional: m["optional"] && decode_optional(m["optional"]),
       union_with_enum: decode_union_with_enum(m["unionWithEnum"]),
     }
   end
diff --git a/base/schema-elixir/test/inputs/schema/vega-lite.schema/default/QuickType.ex b/head/schema-elixir/test/inputs/schema/vega-lite.schema/default/QuickType.ex
index ea48c77..3785892 100644
--- a/base/schema-elixir/test/inputs/schema/vega-lite.schema/default/QuickType.ex
+++ b/head/schema-elixir/test/inputs/schema/vega-lite.schema/default/QuickType.ex
@@ -661,6 +661,24 @@ defmodule MarkConfig do
           theta: float() | nil
         }
 
+  def decode_color(value) when is_binary(value), do: value
+  def decode_color(_), do: {:error, "Unexpected type when decoding MarkConfig.color"}
+
+  def encode_color(value) when is_binary(value), do: value
+  def encode_color(_), do: {:error, "Unexpected type when encoding MarkConfig.color"}
+
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding MarkConfig.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding MarkConfig.fill"}
+
+  def decode_font(value) when is_binary(value), do: value
+  def decode_font(_), do: {:error, "Unexpected type when decoding MarkConfig.font"}
+
+  def encode_font(value) when is_binary(value), do: value
+  def encode_font(_), do: {:error, "Unexpected type when encoding MarkConfig.font"}
+
   def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
   def decode_font_weight(value) when is_float(value), do: value
   def decode_font_weight(value) when is_integer(value), do: value
@@ -673,37 +691,61 @@ defmodule MarkConfig do
   def encode_font_weight(value) when is_nil(value), do: value
   def encode_font_weight(_), do: {:error, "Unexpected type when encoding MarkConfig.font_weight"}
 
+  def decode_href(value) when is_binary(value), do: value
+  def decode_href(_), do: {:error, "Unexpected type when decoding MarkConfig.href"}
+
+  def encode_href(value) when is_binary(value), do: value
+  def encode_href(_), do: {:error, "Unexpected type when encoding MarkConfig.href"}
+
+  def decode_shape(value) when is_binary(value), do: value
+  def decode_shape(_), do: {:error, "Unexpected type when decoding MarkConfig.shape"}
+
+  def encode_shape(value) when is_binary(value), do: value
+  def encode_shape(_), do: {:error, "Unexpected type when encoding MarkConfig.shape"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding MarkConfig.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding MarkConfig.stroke"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding MarkConfig.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding MarkConfig.text"}
+
   def from_map(m) do
     %MarkConfig{
       align: m["align"] && HorizontalAlign.decode(m["align"]),
       angle: m["angle"],
       baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
-      color: m["color"],
+      color: m["color"] && decode_color(m["color"]),
       cursor: m["cursor"] && Cursor.decode(m["cursor"]),
       dx: m["dx"],
       dy: m["dy"],
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       filled: m["filled"],
       fill_opacity: m["fillOpacity"],
-      font: m["font"],
+      font: m["font"] && decode_font(m["font"]),
       font_size: m["fontSize"],
       font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
       font_weight: decode_font_weight(m["fontWeight"]),
-      href: m["href"],
+      href: m["href"] && decode_href(m["href"]),
       interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
       limit: m["limit"],
       opacity: m["opacity"],
       orient: m["orient"] && Orient.decode(m["orient"]),
       radius: m["radius"],
-      shape: m["shape"],
+      shape: m["shape"] && decode_shape(m["shape"]),
       size: m["size"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
       stroke_width: m["strokeWidth"],
       tension: m["tension"],
-      text: m["text"],
+      text: m["text"] && decode_text(m["text"]),
       theta: m["theta"],
     }
   end
@@ -892,6 +934,30 @@ defmodule AxisConfig do
           title_y: float() | nil
         }
 
+  def decode_domain_color(value) when is_binary(value), do: value
+  def decode_domain_color(_), do: {:error, "Unexpected type when decoding AxisConfig.domain_color"}
+
+  def encode_domain_color(value) when is_binary(value), do: value
+  def encode_domain_color(_), do: {:error, "Unexpected type when encoding AxisConfig.domain_color"}
+
+  def decode_grid_color(value) when is_binary(value), do: value
+  def decode_grid_color(_), do: {:error, "Unexpected type when decoding AxisConfig.grid_color"}
+
+  def encode_grid_color(value) when is_binary(value), do: value
+  def encode_grid_color(_), do: {:error, "Unexpected type when encoding AxisConfig.grid_color"}
+
+  def decode_label_color(value) when is_binary(value), do: value
+  def decode_label_color(_), do: {:error, "Unexpected type when decoding AxisConfig.label_color"}
+
+  def encode_label_color(value) when is_binary(value), do: value
+  def encode_label_color(_), do: {:error, "Unexpected type when encoding AxisConfig.label_color"}
+
+  def decode_label_font(value) when is_binary(value), do: value
+  def decode_label_font(_), do: {:error, "Unexpected type when decoding AxisConfig.label_font"}
+
+  def encode_label_font(value) when is_binary(value), do: value
+  def encode_label_font(_), do: {:error, "Unexpected type when encoding AxisConfig.label_font"}
+
   def decode_label_overlap(value) when is_boolean(value), do: value
   def decode_label_overlap(value) when is_binary(value), do: LabelOverlapEnum.decode(value)
   def decode_label_overlap(value) when is_nil(value), do: value
@@ -902,22 +968,52 @@ defmodule AxisConfig do
   def encode_label_overlap(value) when is_nil(value), do: value
   def encode_label_overlap(_), do: {:error, "Unexpected type when encoding AxisConfig.label_overlap"}
 
+  def decode_tick_color(value) when is_binary(value), do: value
+  def decode_tick_color(_), do: {:error, "Unexpected type when decoding AxisConfig.tick_color"}
+
+  def encode_tick_color(value) when is_binary(value), do: value
+  def encode_tick_color(_), do: {:error, "Unexpected type when encoding AxisConfig.tick_color"}
+
+  def decode_title_align(value) when is_binary(value), do: value
+  def decode_title_align(_), do: {:error, "Unexpected type when decoding AxisConfig.title_align"}
+
+  def encode_title_align(value) when is_binary(value), do: value
+  def encode_title_align(_), do: {:error, "Unexpected type when encoding AxisConfig.title_align"}
+
+  def decode_title_baseline(value) when is_binary(value), do: value
+  def decode_title_baseline(_), do: {:error, "Unexpected type when decoding AxisConfig.title_baseline"}
+
+  def encode_title_baseline(value) when is_binary(value), do: value
+  def encode_title_baseline(_), do: {:error, "Unexpected type when encoding AxisConfig.title_baseline"}
+
+  def decode_title_color(value) when is_binary(value), do: value
+  def decode_title_color(_), do: {:error, "Unexpected type when decoding AxisConfig.title_color"}
+
+  def encode_title_color(value) when is_binary(value), do: value
+  def encode_title_color(_), do: {:error, "Unexpected type when encoding AxisConfig.title_color"}
+
+  def decode_title_font(value) when is_binary(value), do: value
+  def decode_title_font(_), do: {:error, "Unexpected type when decoding AxisConfig.title_font"}
+
+  def encode_title_font(value) when is_binary(value), do: value
+  def encode_title_font(_), do: {:error, "Unexpected type when encoding AxisConfig.title_font"}
+
   def from_map(m) do
     %AxisConfig{
       band_position: m["bandPosition"],
       domain: m["domain"],
-      domain_color: m["domainColor"],
+      domain_color: m["domainColor"] && decode_domain_color(m["domainColor"]),
       domain_width: m["domainWidth"],
       grid: m["grid"],
-      grid_color: m["gridColor"],
+      grid_color: m["gridColor"] && decode_grid_color(m["gridColor"]),
       grid_dash: m["gridDash"],
       grid_opacity: m["gridOpacity"],
       grid_width: m["gridWidth"],
       label_angle: m["labelAngle"],
       label_bound: m["labelBound"],
-      label_color: m["labelColor"],
+      label_color: m["labelColor"] && decode_label_color(m["labelColor"]),
       label_flush: m["labelFlush"],
-      label_font: m["labelFont"],
+      label_font: m["labelFont"] && decode_label_font(m["labelFont"]),
       label_font_size: m["labelFontSize"],
       label_limit: m["labelLimit"],
       label_overlap: decode_label_overlap(m["labelOverlap"]),
@@ -926,16 +1022,16 @@ defmodule AxisConfig do
       max_extent: m["maxExtent"],
       min_extent: m["minExtent"],
       short_time_labels: m["shortTimeLabels"],
-      tick_color: m["tickColor"],
+      tick_color: m["tickColor"] && decode_tick_color(m["tickColor"]),
       tick_round: m["tickRound"],
       ticks: m["ticks"],
       tick_size: m["tickSize"],
       tick_width: m["tickWidth"],
-      title_align: m["titleAlign"],
+      title_align: m["titleAlign"] && decode_title_align(m["titleAlign"]),
       title_angle: m["titleAngle"],
-      title_baseline: m["titleBaseline"],
-      title_color: m["titleColor"],
-      title_font: m["titleFont"],
+      title_baseline: m["titleBaseline"] && decode_title_baseline(m["titleBaseline"]),
+      title_color: m["titleColor"] && decode_title_color(m["titleColor"]),
+      title_font: m["titleFont"] && decode_title_font(m["titleFont"]),
       title_font_size: m["titleFontSize"],
       title_font_weight: m["titleFontWeight"],
       title_limit: m["titleLimit"],
@@ -1101,6 +1197,30 @@ defmodule VGAxisConfig do
           title_y: float() | nil
         }
 
+  def decode_domain_color(value) when is_binary(value), do: value
+  def decode_domain_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.domain_color"}
+
+  def encode_domain_color(value) when is_binary(value), do: value
+  def encode_domain_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.domain_color"}
+
+  def decode_grid_color(value) when is_binary(value), do: value
+  def decode_grid_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.grid_color"}
+
+  def encode_grid_color(value) when is_binary(value), do: value
+  def encode_grid_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.grid_color"}
+
+  def decode_label_color(value) when is_binary(value), do: value
+  def decode_label_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.label_color"}
+
+  def encode_label_color(value) when is_binary(value), do: value
+  def encode_label_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_color"}
+
+  def decode_label_font(value) when is_binary(value), do: value
+  def decode_label_font(_), do: {:error, "Unexpected type when decoding VGAxisConfig.label_font"}
+
+  def encode_label_font(value) when is_binary(value), do: value
+  def encode_label_font(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_font"}
+
   def decode_label_overlap(value) when is_boolean(value), do: value
   def decode_label_overlap(value) when is_binary(value), do: LabelOverlapEnum.decode(value)
   def decode_label_overlap(value) when is_nil(value), do: value
@@ -1111,22 +1231,52 @@ defmodule VGAxisConfig do
   def encode_label_overlap(value) when is_nil(value), do: value
   def encode_label_overlap(_), do: {:error, "Unexpected type when encoding VGAxisConfig.label_overlap"}
 
+  def decode_tick_color(value) when is_binary(value), do: value
+  def decode_tick_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.tick_color"}
+
+  def encode_tick_color(value) when is_binary(value), do: value
+  def encode_tick_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.tick_color"}
+
+  def decode_title_align(value) when is_binary(value), do: value
+  def decode_title_align(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_align"}
+
+  def encode_title_align(value) when is_binary(value), do: value
+  def encode_title_align(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_align"}
+
+  def decode_title_baseline(value) when is_binary(value), do: value
+  def decode_title_baseline(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_baseline"}
+
+  def encode_title_baseline(value) when is_binary(value), do: value
+  def encode_title_baseline(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_baseline"}
+
+  def decode_title_color(value) when is_binary(value), do: value
+  def decode_title_color(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_color"}
+
+  def encode_title_color(value) when is_binary(value), do: value
+  def encode_title_color(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_color"}
+
+  def decode_title_font(value) when is_binary(value), do: value
+  def decode_title_font(_), do: {:error, "Unexpected type when decoding VGAxisConfig.title_font"}
+
+  def encode_title_font(value) when is_binary(value), do: value
+  def encode_title_font(_), do: {:error, "Unexpected type when encoding VGAxisConfig.title_font"}
+
   def from_map(m) do
     %VGAxisConfig{
       band_position: m["bandPosition"],
       domain: m["domain"],
-      domain_color: m["domainColor"],
+      domain_color: m["domainColor"] && decode_domain_color(m["domainColor"]),
       domain_width: m["domainWidth"],
       grid: m["grid"],
-      grid_color: m["gridColor"],
+      grid_color: m["gridColor"] && decode_grid_color(m["gridColor"]),
       grid_dash: m["gridDash"],
       grid_opacity: m["gridOpacity"],
       grid_width: m["gridWidth"],
       label_angle: m["labelAngle"],
       label_bound: m["labelBound"],
-      label_color: m["labelColor"],
+      label_color: m["labelColor"] && decode_label_color(m["labelColor"]),
       label_flush: m["labelFlush"],
-      label_font: m["labelFont"],
+      label_font: m["labelFont"] && decode_label_font(m["labelFont"]),
       label_font_size: m["labelFontSize"],
       label_limit: m["labelLimit"],
       label_overlap: decode_label_overlap(m["labelOverlap"]),
@@ -1134,16 +1284,16 @@ defmodule VGAxisConfig do
       labels: m["labels"],
       max_extent: m["maxExtent"],
       min_extent: m["minExtent"],
-      tick_color: m["tickColor"],
+      tick_color: m["tickColor"] && decode_tick_color(m["tickColor"]),
       tick_round: m["tickRound"],
       ticks: m["ticks"],
       tick_size: m["tickSize"],
       tick_width: m["tickWidth"],
-      title_align: m["titleAlign"],
+      title_align: m["titleAlign"] && decode_title_align(m["titleAlign"]),
       title_angle: m["titleAngle"],
-      title_baseline: m["titleBaseline"],
-      title_color: m["titleColor"],
-      title_font: m["titleFont"],
+      title_baseline: m["titleBaseline"] && decode_title_baseline(m["titleBaseline"]),
+      title_color: m["titleColor"] && decode_title_color(m["titleColor"]),
+      title_font: m["titleFont"] && decode_title_font(m["titleFont"]),
       title_font_size: m["titleFontSize"],
       title_font_weight: m["titleFontWeight"],
       title_limit: m["titleLimit"],
@@ -1286,6 +1436,24 @@ defmodule BarConfig do
           theta: float() | nil
         }
 
+  def decode_color(value) when is_binary(value), do: value
+  def decode_color(_), do: {:error, "Unexpected type when decoding BarConfig.color"}
+
+  def encode_color(value) when is_binary(value), do: value
+  def encode_color(_), do: {:error, "Unexpected type when encoding BarConfig.color"}
+
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding BarConfig.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding BarConfig.fill"}
+
+  def decode_font(value) when is_binary(value), do: value
+  def decode_font(_), do: {:error, "Unexpected type when decoding BarConfig.font"}
+
+  def encode_font(value) when is_binary(value), do: value
+  def encode_font(_), do: {:error, "Unexpected type when encoding BarConfig.font"}
+
   def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
   def decode_font_weight(value) when is_float(value), do: value
   def decode_font_weight(value) when is_integer(value), do: value
@@ -1298,40 +1466,64 @@ defmodule BarConfig do
   def encode_font_weight(value) when is_nil(value), do: value
   def encode_font_weight(_), do: {:error, "Unexpected type when encoding BarConfig.font_weight"}
 
+  def decode_href(value) when is_binary(value), do: value
+  def decode_href(_), do: {:error, "Unexpected type when decoding BarConfig.href"}
+
+  def encode_href(value) when is_binary(value), do: value
+  def encode_href(_), do: {:error, "Unexpected type when encoding BarConfig.href"}
+
+  def decode_shape(value) when is_binary(value), do: value
+  def decode_shape(_), do: {:error, "Unexpected type when decoding BarConfig.shape"}
+
+  def encode_shape(value) when is_binary(value), do: value
+  def encode_shape(_), do: {:error, "Unexpected type when encoding BarConfig.shape"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding BarConfig.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding BarConfig.stroke"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding BarConfig.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding BarConfig.text"}
+
   def from_map(m) do
     %BarConfig{
       align: m["align"] && HorizontalAlign.decode(m["align"]),
       angle: m["angle"],
       baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
       bin_spacing: m["binSpacing"],
-      color: m["color"],
+      color: m["color"] && decode_color(m["color"]),
       continuous_band_size: m["continuousBandSize"],
       cursor: m["cursor"] && Cursor.decode(m["cursor"]),
       discrete_band_size: m["discreteBandSize"],
       dx: m["dx"],
       dy: m["dy"],
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       filled: m["filled"],
       fill_opacity: m["fillOpacity"],
-      font: m["font"],
+      font: m["font"] && decode_font(m["font"]),
       font_size: m["fontSize"],
       font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
       font_weight: decode_font_weight(m["fontWeight"]),
-      href: m["href"],
+      href: m["href"] && decode_href(m["href"]),
       interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
       limit: m["limit"],
       opacity: m["opacity"],
       orient: m["orient"] && Orient.decode(m["orient"]),
       radius: m["radius"],
-      shape: m["shape"],
+      shape: m["shape"] && decode_shape(m["shape"]),
       size: m["size"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
       stroke_width: m["strokeWidth"],
       tension: m["tension"],
-      text: m["text"],
+      text: m["text"] && decode_text(m["text"]),
       theta: m["theta"],
     }
   end
@@ -1637,22 +1829,106 @@ defmodule LegendConfig do
           title_padding: float() | nil
         }
 
+  def decode_fill_color(value) when is_binary(value), do: value
+  def decode_fill_color(_), do: {:error, "Unexpected type when decoding LegendConfig.fill_color"}
+
+  def encode_fill_color(value) when is_binary(value), do: value
+  def encode_fill_color(_), do: {:error, "Unexpected type when encoding LegendConfig.fill_color"}
+
+  def decode_gradient_label_baseline(value) when is_binary(value), do: value
+  def decode_gradient_label_baseline(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_label_baseline"}
+
+  def encode_gradient_label_baseline(value) when is_binary(value), do: value
+  def encode_gradient_label_baseline(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_label_baseline"}
+
+  def decode_gradient_stroke_color(value) when is_binary(value), do: value
+  def decode_gradient_stroke_color(_), do: {:error, "Unexpected type when decoding LegendConfig.gradient_stroke_color"}
+
+  def encode_gradient_stroke_color(value) when is_binary(value), do: value
+  def encode_gradient_stroke_color(_), do: {:error, "Unexpected type when encoding LegendConfig.gradient_stroke_color"}
+
+  def decode_label_align(value) when is_binary(value), do: value
+  def decode_label_align(_), do: {:error, "Unexpected type when decoding LegendConfig.label_align"}
+
+  def encode_label_align(value) when is_binary(value), do: value
+  def encode_label_align(_), do: {:error, "Unexpected type when encoding LegendConfig.label_align"}
+
+  def decode_label_baseline(value) when is_binary(value), do: value
+  def decode_label_baseline(_), do: {:error, "Unexpected type when decoding LegendConfig.label_baseline"}
+
+  def encode_label_baseline(value) when is_binary(value), do: value
+  def encode_label_baseline(_), do: {:error, "Unexpected type when encoding LegendConfig.label_baseline"}
+
+  def decode_label_color(value) when is_binary(value), do: value
+  def decode_label_color(_), do: {:error, "Unexpected type when decoding LegendConfig.label_color"}
+
+  def encode_label_color(value) when is_binary(value), do: value
+  def encode_label_color(_), do: {:error, "Unexpected type when encoding LegendConfig.label_color"}
+
+  def decode_label_font(value) when is_binary(value), do: value
+  def decode_label_font(_), do: {:error, "Unexpected type when decoding LegendConfig.label_font"}
+
+  def encode_label_font(value) when is_binary(value), do: value
+  def encode_label_font(_), do: {:error, "Unexpected type when encoding LegendConfig.label_font"}
+
+  def decode_stroke_color(value) when is_binary(value), do: value
+  def decode_stroke_color(_), do: {:error, "Unexpected type when decoding LegendConfig.stroke_color"}
+
+  def encode_stroke_color(value) when is_binary(value), do: value
+  def encode_stroke_color(_), do: {:error, "Unexpected type when encoding LegendConfig.stroke_color"}
+
+  def decode_symbol_color(value) when is_binary(value), do: value
+  def decode_symbol_color(_), do: {:error, "Unexpected type when decoding LegendConfig.symbol_color"}
+
+  def encode_symbol_color(value) when is_binary(value), do: value
+  def encode_symbol_color(_), do: {:error, "Unexpected type when encoding LegendConfig.symbol_color"}
+
+  def decode_symbol_type(value) when is_binary(value), do: value
+  def decode_symbol_type(_), do: {:error, "Unexpected type when decoding LegendConfig.symbol_type"}
+
+  def encode_symbol_type(value) when is_binary(value), do: value
+  def encode_symbol_type(_), do: {:error, "Unexpected type when encoding LegendConfig.symbol_type"}
+
+  def decode_title_align(value) when is_binary(value), do: value
+  def decode_title_align(_), do: {:error, "Unexpected type when decoding LegendConfig.title_align"}
+
+  def encode_title_align(value) when is_binary(value), do: value
+  def encode_title_align(_), do: {:error, "Unexpected type when encoding LegendConfig.title_align"}
+
+  def decode_title_baseline(value) when is_binary(value), do: value
+  def decode_title_baseline(_), do: {:error, "Unexpected type when decoding LegendConfig.title_baseline"}
+
+  def encode_title_baseline(value) when is_binary(value), do: value
+  def encode_title_baseline(_), do: {:error, "Unexpected type when encoding LegendConfig.title_baseline"}
+
+  def decode_title_color(value) when is_binary(value), do: value
+  def decode_title_color(_), do: {:error, "Unexpected type when decoding LegendConfig.title_color"}
+
+  def encode_title_color(value) when is_binary(value), do: value
+  def encode_title_color(_), do: {:error, "Unexpected type when encoding LegendConfig.title_color"}
+
+  def decode_title_font(value) when is_binary(value), do: value
+  def decode_title_font(_), do: {:error, "Unexpected type when decoding LegendConfig.title_font"}
+
+  def encode_title_font(value) when is_binary(value), do: value
+  def encode_title_font(_), do: {:error, "Unexpected type when encoding LegendConfig.title_font"}
+
   def from_map(m) do
     %LegendConfig{
       corner_radius: m["cornerRadius"],
       entry_padding: m["entryPadding"],
-      fill_color: m["fillColor"],
+      fill_color: m["fillColor"] && decode_fill_color(m["fillColor"]),
       gradient_height: m["gradientHeight"],
-      gradient_label_baseline: m["gradientLabelBaseline"],
+      gradient_label_baseline: m["gradientLabelBaseline"] && decode_gradient_label_baseline(m["gradientLabelBaseline"]),
       gradient_label_limit: m["gradientLabelLimit"],
       gradient_label_offset: m["gradientLabelOffset"],
-      gradient_stroke_color: m["gradientStrokeColor"],
+      gradient_stroke_color: m["gradientStrokeColor"] && decode_gradient_stroke_color(m["gradientStrokeColor"]),
       gradient_stroke_width: m["gradientStrokeWidth"],
       gradient_width: m["gradientWidth"],
-      label_align: m["labelAlign"],
-      label_baseline: m["labelBaseline"],
-      label_color: m["labelColor"],
-      label_font: m["labelFont"],
+      label_align: m["labelAlign"] && decode_label_align(m["labelAlign"]),
+      label_baseline: m["labelBaseline"] && decode_label_baseline(m["labelBaseline"]),
+      label_color: m["labelColor"] && decode_label_color(m["labelColor"]),
+      label_font: m["labelFont"] && decode_label_font(m["labelFont"]),
       label_font_size: m["labelFontSize"],
       label_limit: m["labelLimit"],
       label_offset: m["labelOffset"],
@@ -1660,17 +1936,17 @@ defmodule LegendConfig do
       orient: m["orient"] && LegendOrient.decode(m["orient"]),
       padding: m["padding"],
       short_time_labels: m["shortTimeLabels"],
-      stroke_color: m["strokeColor"],
+      stroke_color: m["strokeColor"] && decode_stroke_color(m["strokeColor"]),
       stroke_dash: m["strokeDash"],
       stroke_width: m["strokeWidth"],
-      symbol_color: m["symbolColor"],
+      symbol_color: m["symbolColor"] && decode_symbol_color(m["symbolColor"]),
       symbol_size: m["symbolSize"],
       symbol_stroke_width: m["symbolStrokeWidth"],
-      symbol_type: m["symbolType"],
-      title_align: m["titleAlign"],
-      title_baseline: m["titleBaseline"],
-      title_color: m["titleColor"],
-      title_font: m["titleFont"],
+      symbol_type: m["symbolType"] && decode_symbol_type(m["symbolType"]),
+      title_align: m["titleAlign"] && decode_title_align(m["titleAlign"]),
+      title_baseline: m["titleBaseline"] && decode_title_baseline(m["titleBaseline"]),
+      title_color: m["titleColor"] && decode_title_color(m["titleColor"]),
+      title_font: m["titleFont"] && decode_title_font(m["titleFont"]),
       title_font_size: m["titleFontSize"],
       title_font_weight: m["titleFontWeight"],
       title_limit: m["titleLimit"],
@@ -1949,11 +2225,17 @@ defmodule VGScheme do
           step: float() | nil
         }
 
+  def decode_scheme(value) when is_binary(value), do: value
+  def decode_scheme(_), do: {:error, "Unexpected type when decoding VGScheme.scheme"}
+
+  def encode_scheme(value) when is_binary(value), do: value
+  def encode_scheme(_), do: {:error, "Unexpected type when encoding VGScheme.scheme"}
+
   def from_map(m) do
     %VGScheme{
       count: m["count"],
       extent: m["extent"],
-      scheme: m["scheme"],
+      scheme: m["scheme"] && decode_scheme(m["scheme"]),
       step: m["step"],
     }
   end
@@ -2274,11 +2556,23 @@ defmodule BrushConfig do
           stroke_width: float() | nil
         }
 
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding BrushConfig.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding BrushConfig.fill"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding BrushConfig.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding BrushConfig.stroke"}
+
   def from_map(m) do
     %BrushConfig{
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       fill_opacity: m["fillOpacity"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
@@ -2516,6 +2810,12 @@ defmodule VGBinding do
           step: float() | nil
         }
 
+  def decode_element(value) when is_binary(value), do: value
+  def decode_element(_), do: {:error, "Unexpected type when decoding VGBinding.element"}
+
+  def encode_element(value) when is_binary(value), do: value
+  def encode_element(_), do: {:error, "Unexpected type when encoding VGBinding.element"}
+
   def decode_input(value) when is_binary(value), do: value
   def decode_input(_), do: {:error, "Unexpected type when decoding VGBinding.input"}
 
@@ -2524,7 +2824,7 @@ defmodule VGBinding do
 
   def from_map(m) do
     %VGBinding{
-      element: m["element"],
+      element: m["element"] && decode_element(m["element"]),
       input: decode_input(m["input"]),
       options: m["options"],
       max: m["max"],
@@ -2785,6 +3085,18 @@ defmodule VGMarkConfig do
           theta: float() | nil
         }
 
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding VGMarkConfig.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding VGMarkConfig.fill"}
+
+  def decode_font(value) when is_binary(value), do: value
+  def decode_font(_), do: {:error, "Unexpected type when decoding VGMarkConfig.font"}
+
+  def encode_font(value) when is_binary(value), do: value
+  def encode_font(_), do: {:error, "Unexpected type when encoding VGMarkConfig.font"}
+
   def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
   def decode_font_weight(value) when is_float(value), do: value
   def decode_font_weight(value) when is_integer(value), do: value
@@ -2797,6 +3109,30 @@ defmodule VGMarkConfig do
   def encode_font_weight(value) when is_nil(value), do: value
   def encode_font_weight(_), do: {:error, "Unexpected type when encoding VGMarkConfig.font_weight"}
 
+  def decode_href(value) when is_binary(value), do: value
+  def decode_href(_), do: {:error, "Unexpected type when decoding VGMarkConfig.href"}
+
+  def encode_href(value) when is_binary(value), do: value
+  def encode_href(_), do: {:error, "Unexpected type when encoding VGMarkConfig.href"}
+
+  def decode_shape(value) when is_binary(value), do: value
+  def decode_shape(_), do: {:error, "Unexpected type when decoding VGMarkConfig.shape"}
+
+  def encode_shape(value) when is_binary(value), do: value
+  def encode_shape(_), do: {:error, "Unexpected type when encoding VGMarkConfig.shape"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding VGMarkConfig.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding VGMarkConfig.stroke"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding VGMarkConfig.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding VGMarkConfig.text"}
+
   def from_map(m) do
     %VGMarkConfig{
       align: m["align"] && HorizontalAlign.decode(m["align"]),
@@ -2805,27 +3141,27 @@ defmodule VGMarkConfig do
       cursor: m["cursor"] && Cursor.decode(m["cursor"]),
       dx: m["dx"],
       dy: m["dy"],
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       fill_opacity: m["fillOpacity"],
-      font: m["font"],
+      font: m["font"] && decode_font(m["font"]),
       font_size: m["fontSize"],
       font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
       font_weight: decode_font_weight(m["fontWeight"]),
-      href: m["href"],
+      href: m["href"] && decode_href(m["href"]),
       interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
       limit: m["limit"],
       opacity: m["opacity"],
       orient: m["orient"] && Orient.decode(m["orient"]),
       radius: m["radius"],
-      shape: m["shape"],
+      shape: m["shape"] && decode_shape(m["shape"]),
       size: m["size"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
       stroke_width: m["strokeWidth"],
       tension: m["tension"],
-      text: m["text"],
+      text: m["text"] && decode_text(m["text"]),
       theta: m["theta"],
     }
   end
@@ -2948,6 +3284,24 @@ defmodule TextConfig do
           theta: float() | nil
         }
 
+  def decode_color(value) when is_binary(value), do: value
+  def decode_color(_), do: {:error, "Unexpected type when decoding TextConfig.color"}
+
+  def encode_color(value) when is_binary(value), do: value
+  def encode_color(_), do: {:error, "Unexpected type when encoding TextConfig.color"}
+
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding TextConfig.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding TextConfig.fill"}
+
+  def decode_font(value) when is_binary(value), do: value
+  def decode_font(_), do: {:error, "Unexpected type when decoding TextConfig.font"}
+
+  def encode_font(value) when is_binary(value), do: value
+  def encode_font(_), do: {:error, "Unexpected type when encoding TextConfig.font"}
+
   def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
   def decode_font_weight(value) when is_float(value), do: value
   def decode_font_weight(value) when is_integer(value), do: value
@@ -2960,38 +3314,62 @@ defmodule TextConfig do
   def encode_font_weight(value) when is_nil(value), do: value
   def encode_font_weight(_), do: {:error, "Unexpected type when encoding TextConfig.font_weight"}
 
+  def decode_href(value) when is_binary(value), do: value
+  def decode_href(_), do: {:error, "Unexpected type when decoding TextConfig.href"}
+
+  def encode_href(value) when is_binary(value), do: value
+  def encode_href(_), do: {:error, "Unexpected type when encoding TextConfig.href"}
+
+  def decode_shape(value) when is_binary(value), do: value
+  def decode_shape(_), do: {:error, "Unexpected type when decoding TextConfig.shape"}
+
+  def encode_shape(value) when is_binary(value), do: value
+  def encode_shape(_), do: {:error, "Unexpected type when encoding TextConfig.shape"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding TextConfig.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding TextConfig.stroke"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding TextConfig.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding TextConfig.text"}
+
   def from_map(m) do
     %TextConfig{
       align: m["align"] && HorizontalAlign.decode(m["align"]),
       angle: m["angle"],
       baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
-      color: m["color"],
+      color: m["color"] && decode_color(m["color"]),
       cursor: m["cursor"] && Cursor.decode(m["cursor"]),
       dx: m["dx"],
       dy: m["dy"],
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       filled: m["filled"],
       fill_opacity: m["fillOpacity"],
-      font: m["font"],
+      font: m["font"] && decode_font(m["font"]),
       font_size: m["fontSize"],
       font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
       font_weight: decode_font_weight(m["fontWeight"]),
-      href: m["href"],
+      href: m["href"] && decode_href(m["href"]),
       interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
       limit: m["limit"],
       opacity: m["opacity"],
       orient: m["orient"] && Orient.decode(m["orient"]),
       radius: m["radius"],
-      shape: m["shape"],
+      shape: m["shape"] && decode_shape(m["shape"]),
       short_time_labels: m["shortTimeLabels"],
       size: m["size"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
       stroke_width: m["strokeWidth"],
       tension: m["tension"],
-      text: m["text"],
+      text: m["text"] && decode_text(m["text"]),
       theta: m["theta"],
     }
   end
@@ -3119,6 +3497,24 @@ defmodule TickConfig do
           thickness: float() | nil
         }
 
+  def decode_color(value) when is_binary(value), do: value
+  def decode_color(_), do: {:error, "Unexpected type when decoding TickConfig.color"}
+
+  def encode_color(value) when is_binary(value), do: value
+  def encode_color(_), do: {:error, "Unexpected type when encoding TickConfig.color"}
+
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding TickConfig.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding TickConfig.fill"}
+
+  def decode_font(value) when is_binary(value), do: value
+  def decode_font(_), do: {:error, "Unexpected type when decoding TickConfig.font"}
+
+  def encode_font(value) when is_binary(value), do: value
+  def encode_font(_), do: {:error, "Unexpected type when encoding TickConfig.font"}
+
   def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
   def decode_font_weight(value) when is_float(value), do: value
   def decode_font_weight(value) when is_integer(value), do: value
@@ -3131,38 +3527,62 @@ defmodule TickConfig do
   def encode_font_weight(value) when is_nil(value), do: value
   def encode_font_weight(_), do: {:error, "Unexpected type when encoding TickConfig.font_weight"}
 
+  def decode_href(value) when is_binary(value), do: value
+  def decode_href(_), do: {:error, "Unexpected type when decoding TickConfig.href"}
+
+  def encode_href(value) when is_binary(value), do: value
+  def encode_href(_), do: {:error, "Unexpected type when encoding TickConfig.href"}
+
+  def decode_shape(value) when is_binary(value), do: value
+  def decode_shape(_), do: {:error, "Unexpected type when decoding TickConfig.shape"}
+
+  def encode_shape(value) when is_binary(value), do: value
+  def encode_shape(_), do: {:error, "Unexpected type when encoding TickConfig.shape"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding TickConfig.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding TickConfig.stroke"}
+
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding TickConfig.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding TickConfig.text"}
+
   def from_map(m) do
     %TickConfig{
       align: m["align"] && HorizontalAlign.decode(m["align"]),
       angle: m["angle"],
       band_size: m["bandSize"],
       baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
-      color: m["color"],
+      color: m["color"] && decode_color(m["color"]),
       cursor: m["cursor"] && Cursor.decode(m["cursor"]),
       dx: m["dx"],
       dy: m["dy"],
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       filled: m["filled"],
       fill_opacity: m["fillOpacity"],
-      font: m["font"],
+      font: m["font"] && decode_font(m["font"]),
       font_size: m["fontSize"],
       font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
       font_weight: decode_font_weight(m["fontWeight"]),
-      href: m["href"],
+      href: m["href"] && decode_href(m["href"]),
       interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
       limit: m["limit"],
       opacity: m["opacity"],
       orient: m["orient"] && Orient.decode(m["orient"]),
       radius: m["radius"],
-      shape: m["shape"],
+      shape: m["shape"] && decode_shape(m["shape"]),
       size: m["size"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
       stroke_width: m["strokeWidth"],
       tension: m["tension"],
-      text: m["text"],
+      text: m["text"] && decode_text(m["text"]),
       theta: m["theta"],
       thickness: m["thickness"],
     }
@@ -3369,6 +3789,18 @@ defmodule VGTitleConfig do
           orient: TitleOrient.t() | nil
         }
 
+  def decode_color(value) when is_binary(value), do: value
+  def decode_color(_), do: {:error, "Unexpected type when decoding VGTitleConfig.color"}
+
+  def encode_color(value) when is_binary(value), do: value
+  def encode_color(_), do: {:error, "Unexpected type when encoding VGTitleConfig.color"}
+
+  def decode_font(value) when is_binary(value), do: value
+  def decode_font(_), do: {:error, "Unexpected type when decoding VGTitleConfig.font"}
+
+  def encode_font(value) when is_binary(value), do: value
+  def encode_font(_), do: {:error, "Unexpected type when encoding VGTitleConfig.font"}
+
   def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
   def decode_font_weight(value) when is_float(value), do: value
   def decode_font_weight(value) when is_integer(value), do: value
@@ -3386,8 +3818,8 @@ defmodule VGTitleConfig do
       anchor: m["anchor"] && Anchor.decode(m["anchor"]),
       angle: m["angle"],
       baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
-      color: m["color"],
-      font: m["font"],
+      color: m["color"] && decode_color(m["color"]),
+      font: m["font"] && decode_font(m["font"]),
       font_size: m["fontSize"],
       font_weight: decode_font_weight(m["fontWeight"]),
       limit: m["limit"],
@@ -3454,13 +3886,25 @@ defmodule ViewConfig do
           width: float() | nil
         }
 
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding ViewConfig.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding ViewConfig.fill"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding ViewConfig.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding ViewConfig.stroke"}
+
   def from_map(m) do
     %ViewConfig{
       clip: m["clip"],
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       fill_opacity: m["fillOpacity"],
       height: m["height"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
@@ -3592,6 +4036,24 @@ defmodule ConfigClass do
   def encode_autosize(value) when is_nil(value), do: value
   def encode_autosize(_), do: {:error, "Unexpected type when encoding ConfigClass.autosize"}
 
+  def decode_background(value) when is_binary(value), do: value
+  def decode_background(_), do: {:error, "Unexpected type when decoding ConfigClass.background"}
+
+  def encode_background(value) when is_binary(value), do: value
+  def encode_background(_), do: {:error, "Unexpected type when encoding ConfigClass.background"}
+
+  def decode_count_title(value) when is_binary(value), do: value
+  def decode_count_title(_), do: {:error, "Unexpected type when decoding ConfigClass.count_title"}
+
+  def encode_count_title(value) when is_binary(value), do: value
+  def encode_count_title(_), do: {:error, "Unexpected type when encoding ConfigClass.count_title"}
+
+  def decode_number_format(value) when is_binary(value), do: value
+  def decode_number_format(_), do: {:error, "Unexpected type when decoding ConfigClass.number_format"}
+
+  def encode_number_format(value) when is_binary(value), do: value
+  def encode_number_format(_), do: {:error, "Unexpected type when encoding ConfigClass.number_format"}
+
   def decode_padding(%{} = value), do: PaddingClass.from_map(value)
   def decode_padding(value) when is_float(value), do: value
   def decode_padding(value) when is_integer(value), do: value
@@ -3612,6 +4074,12 @@ defmodule ConfigClass do
   def encode_range_value(value) when is_list(value), do: value
   def encode_range_value(_), do: {:error, "Unexpected type when encoding ConfigClass.range"}
 
+  def decode_time_format(value) when is_binary(value), do: value
+  def decode_time_format(_), do: {:error, "Unexpected type when decoding ConfigClass.time_format"}
+
+  def encode_time_format(value) when is_binary(value), do: value
+  def encode_time_format(_), do: {:error, "Unexpected type when encoding ConfigClass.time_format"}
+
   def from_map(m) do
     %ConfigClass{
       area: m["area"] && MarkConfig.from_map(m["area"]),
@@ -3624,17 +4092,17 @@ defmodule ConfigClass do
       axis_top: m["axisTop"] && VGAxisConfig.from_map(m["axisTop"]),
       axis_x: m["axisX"] && VGAxisConfig.from_map(m["axisX"]),
       axis_y: m["axisY"] && VGAxisConfig.from_map(m["axisY"]),
-      background: m["background"],
+      background: m["background"] && decode_background(m["background"]),
       bar: m["bar"] && BarConfig.from_map(m["bar"]),
       circle: m["circle"] && MarkConfig.from_map(m["circle"]),
-      count_title: m["countTitle"],
+      count_title: m["countTitle"] && decode_count_title(m["countTitle"]),
       field_title: m["fieldTitle"] && FieldTitle.decode(m["fieldTitle"]),
       geoshape: m["geoshape"] && MarkConfig.from_map(m["geoshape"]),
       invalid_values: m["invalidValues"] && InvalidValues.decode(m["invalidValues"]),
       legend: m["legend"] && LegendConfig.from_map(m["legend"]),
       line: m["line"] && MarkConfig.from_map(m["line"]),
       mark: m["mark"] && MarkConfig.from_map(m["mark"]),
-      number_format: m["numberFormat"],
+      number_format: m["numberFormat"] && decode_number_format(m["numberFormat"]),
       padding: decode_padding(m["padding"]),
       point: m["point"] && MarkConfig.from_map(m["point"]),
       projection: m["projection"] && ProjectionConfig.from_map(m["projection"]),
@@ -3650,7 +4118,7 @@ defmodule ConfigClass do
       |> Map.new(fn {key, value} -> {key, VGMarkConfig.from_map(value)} end),
       text: m["text"] && TextConfig.from_map(m["text"]),
       tick: m["tick"] && TickConfig.from_map(m["tick"]),
-      time_format: m["timeFormat"],
+      time_format: m["timeFormat"] && decode_time_format(m["timeFormat"]),
       title: m["title"] && VGTitleConfig.from_map(m["title"]),
       view: m["view"] && ViewConfig.from_map(m["view"]),
     }
@@ -3845,13 +4313,31 @@ defmodule DataFormat do
   def encode_parse(value) when is_nil(value), do: value
   def encode_parse(_), do: {:error, "Unexpected type when encoding DataFormat.parse"}
 
+  def decode_property(value) when is_binary(value), do: value
+  def decode_property(_), do: {:error, "Unexpected type when decoding DataFormat.property"}
+
+  def encode_property(value) when is_binary(value), do: value
+  def encode_property(_), do: {:error, "Unexpected type when encoding DataFormat.property"}
+
+  def decode_feature(value) when is_binary(value), do: value
+  def decode_feature(_), do: {:error, "Unexpected type when decoding DataFormat.feature"}
+
+  def encode_feature(value) when is_binary(value), do: value
+  def encode_feature(_), do: {:error, "Unexpected type when encoding DataFormat.feature"}
+
+  def decode_mesh(value) when is_binary(value), do: value
+  def decode_mesh(_), do: {:error, "Unexpected type when decoding DataFormat.mesh"}
+
+  def encode_mesh(value) when is_binary(value), do: value
+  def encode_mesh(_), do: {:error, "Unexpected type when encoding DataFormat.mesh"}
+
   def from_map(m) do
     %DataFormat{
       parse: decode_parse(m["parse"]),
       type: m["type"] && DataFormatType.decode(m["type"]),
-      property: m["property"],
-      feature: m["feature"],
-      mesh: m["mesh"],
+      property: m["property"] && decode_property(m["property"]),
+      feature: m["feature"] && decode_feature(m["feature"]),
+      mesh: m["mesh"] && decode_mesh(m["mesh"]),
     }
   end
 
@@ -3898,6 +4384,12 @@ defmodule Data do
           name: String.t() | nil
         }
 
+  def decode_url(value) when is_binary(value), do: value
+  def decode_url(_), do: {:error, "Unexpected type when decoding Data.url"}
+
+  def encode_url(value) when is_binary(value), do: value
+  def encode_url(_), do: {:error, "Unexpected type when encoding Data.url"}
+
   def decode_values(value) when is_binary(value), do: value
   def decode_values(value) when is_list(value), do: value
   def decode_values(value) when is_map(value), do: value
@@ -3910,12 +4402,18 @@ defmodule Data do
   def encode_values(value) when is_nil(value), do: value
   def encode_values(_), do: {:error, "Unexpected type when encoding Data.values"}
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding Data.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Data.name"}
+
   def from_map(m) do
     %Data{
       format: m["format"] && DataFormat.from_map(m["format"]),
-      url: m["url"],
+      url: m["url"] && decode_url(m["url"]),
       values: decode_values(m["values"]),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
     }
   end
 
@@ -4397,6 +4895,12 @@ defmodule Predicate do
   def encode_equal(value) when is_nil(value), do: value
   def encode_equal(_), do: {:error, "Unexpected type when encoding Predicate.equal"}
 
+  def decode_field(value) when is_binary(value), do: value
+  def decode_field(_), do: {:error, "Unexpected type when decoding Predicate.field"}
+
+  def encode_field(value) when is_binary(value), do: value
+  def encode_field(_), do: {:error, "Unexpected type when encoding Predicate.field"}
+
   def decode_range_element(%{} = value), do: DateTimeClass.from_map(value)
   def decode_range_element(value) when is_float(value), do: value
   def decode_range_element(value) when is_integer(value), do: value
@@ -4439,7 +4943,7 @@ defmodule Predicate do
       predicate_and: m["and"] && Enum.map(m["and"], &decode_predicate_and_element/1),
       predicate_or: m["or"] && Enum.map(m["or"], &decode_predicate_or_element/1),
       equal: decode_equal(m["equal"]),
-      field: m["field"],
+      field: m["field"] && decode_field(m["field"]),
       time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
       range: m["range"] && Enum.map(m["range"], &decode_range_element/1),
       one_of: m["oneOf"] && Enum.map(m["oneOf"], &decode_one_of_element/1),
@@ -4704,6 +5208,12 @@ defmodule Legend do
           zindex: float() | nil
         }
 
+  def decode_format(value) when is_binary(value), do: value
+  def decode_format(_), do: {:error, "Unexpected type when decoding Legend.format"}
+
+  def encode_format(value) when is_binary(value), do: value
+  def encode_format(_), do: {:error, "Unexpected type when encoding Legend.format"}
+
   def decode_values_element(%{} = value), do: DateTimeClass.from_map(value)
   def decode_values_element(value) when is_float(value), do: value
   def decode_values_element(value) when is_integer(value), do: value
@@ -4719,7 +5229,7 @@ defmodule Legend do
   def from_map(m) do
     %Legend{
       entry_padding: m["entryPadding"],
-      format: m["format"],
+      format: m["format"] && decode_format(m["format"]),
       offset: m["offset"],
       orient: m["orient"] && LegendOrient.decode(m["orient"]),
       padding: m["padding"],
@@ -4775,17 +5285,29 @@ defmodule DomainClass do
           encoding: String.t() | nil
         }
 
+  def decode_field(value) when is_binary(value), do: value
+  def decode_field(_), do: {:error, "Unexpected type when decoding DomainClass.field"}
+
+  def encode_field(value) when is_binary(value), do: value
+  def encode_field(_), do: {:error, "Unexpected type when encoding DomainClass.field"}
+
   def decode_selection(value) when is_binary(value), do: value
   def decode_selection(_), do: {:error, "Unexpected type when decoding DomainClass.selection"}
 
   def encode_selection(value) when is_binary(value), do: value
   def encode_selection(_), do: {:error, "Unexpected type when encoding DomainClass.selection"}
 
+  def decode_encoding(value) when is_binary(value), do: value
+  def decode_encoding(_), do: {:error, "Unexpected type when decoding DomainClass.encoding"}
+
+  def encode_encoding(value) when is_binary(value), do: value
+  def encode_encoding(_), do: {:error, "Unexpected type when encoding DomainClass.encoding"}
+
   def from_map(m) do
     %DomainClass{
-      field: m["field"],
+      field: m["field"] && decode_field(m["field"]),
       selection: decode_selection(m["selection"]),
-      encoding: m["encoding"],
+      encoding: m["encoding"] && decode_encoding(m["encoding"]),
     }
   end
 
@@ -5772,9 +6294,15 @@ defmodule Header do
           title: nil | String.t() | nil
         }
 
+  def decode_format(value) when is_binary(value), do: value
+  def decode_format(_), do: {:error, "Unexpected type when decoding Header.format"}
+
+  def encode_format(value) when is_binary(value), do: value
+  def encode_format(_), do: {:error, "Unexpected type when encoding Header.format"}
+
   def from_map(m) do
     %Header{
-      format: m["format"],
+      format: m["format"] && decode_format(m["format"]),
       label_angle: m["labelAngle"],
       title: m["title"],
     }
@@ -6309,6 +6837,12 @@ defmodule ConditionalPredicateTextFieldDefClass do
   def encode_field(value) when is_nil(value), do: value
   def encode_field(_), do: {:error, "Unexpected type when encoding ConditionalPredicateTextFieldDefClass.field"}
 
+  def decode_format(value) when is_binary(value), do: value
+  def decode_format(_), do: {:error, "Unexpected type when decoding ConditionalPredicateTextFieldDefClass.format"}
+
+  def encode_format(value) when is_binary(value), do: value
+  def encode_format(_), do: {:error, "Unexpected type when encoding ConditionalPredicateTextFieldDefClass.format"}
+
   def from_map(m) do
     %ConditionalPredicateTextFieldDefClass{
       test: decode_test(m["test"]),
@@ -6317,7 +6851,7 @@ defmodule ConditionalPredicateTextFieldDefClass do
       aggregate: m["aggregate"] && AggregateOp.decode(m["aggregate"]),
       bin: decode_bin(m["bin"]),
       field: decode_field(m["field"]),
-      format: m["format"],
+      format: m["format"] && decode_format(m["format"]),
       time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
       type: m["type"] && Type.decode(m["type"]),
     }
@@ -6421,13 +6955,19 @@ defmodule TextDefWithCondition do
   def encode_field(value) when is_nil(value), do: value
   def encode_field(_), do: {:error, "Unexpected type when encoding TextDefWithCondition.field"}
 
+  def decode_format(value) when is_binary(value), do: value
+  def decode_format(_), do: {:error, "Unexpected type when decoding TextDefWithCondition.format"}
+
+  def encode_format(value) when is_binary(value), do: value
+  def encode_format(_), do: {:error, "Unexpected type when encoding TextDefWithCondition.format"}
+
   def from_map(m) do
     %TextDefWithCondition{
       aggregate: m["aggregate"] && AggregateOp.decode(m["aggregate"]),
       bin: decode_bin(m["bin"]),
       condition: decode_condition(m["condition"]),
       field: decode_field(m["field"]),
-      format: m["format"],
+      format: m["format"] && decode_format(m["format"]),
       time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
       type: m["type"] && Type.decode(m["type"]),
       value: m["value"],
@@ -6513,6 +7053,12 @@ defmodule Axis do
           zindex: float() | nil
         }
 
+  def decode_format(value) when is_binary(value), do: value
+  def decode_format(_), do: {:error, "Unexpected type when decoding Axis.format"}
+
+  def encode_format(value) when is_binary(value), do: value
+  def encode_format(_), do: {:error, "Unexpected type when encoding Axis.format"}
+
   def decode_label_overlap(value) when is_boolean(value), do: value
   def decode_label_overlap(value) when is_binary(value), do: LabelOverlapEnum.decode(value)
   def decode_label_overlap(value) when is_nil(value), do: value
@@ -6536,7 +7082,7 @@ defmodule Axis do
   def from_map(m) do
     %Axis{
       domain: m["domain"],
-      format: m["format"],
+      format: m["format"] && decode_format(m["format"]),
       grid: m["grid"],
       label_angle: m["labelAngle"],
       label_bound: m["labelBound"],
@@ -7188,6 +7734,24 @@ defmodule MarkDef do
           type: Mark.t()
         }
 
+  def decode_color(value) when is_binary(value), do: value
+  def decode_color(_), do: {:error, "Unexpected type when decoding MarkDef.color"}
+
+  def encode_color(value) when is_binary(value), do: value
+  def encode_color(_), do: {:error, "Unexpected type when encoding MarkDef.color"}
+
+  def decode_fill(value) when is_binary(value), do: value
+  def decode_fill(_), do: {:error, "Unexpected type when decoding MarkDef.fill"}
+
+  def encode_fill(value) when is_binary(value), do: value
+  def encode_fill(_), do: {:error, "Unexpected type when encoding MarkDef.fill"}
+
+  def decode_font(value) when is_binary(value), do: value
+  def decode_font(_), do: {:error, "Unexpected type when decoding MarkDef.font"}
+
+  def encode_font(value) when is_binary(value), do: value
+  def encode_font(_), do: {:error, "Unexpected type when encoding MarkDef.font"}
+
   def decode_font_weight(value) when is_binary(value), do: FontWeight.decode(value)
   def decode_font_weight(value) when is_float(value), do: value
   def decode_font_weight(value) when is_integer(value), do: value
@@ -7200,6 +7764,24 @@ defmodule MarkDef do
   def encode_font_weight(value) when is_nil(value), do: value
   def encode_font_weight(_), do: {:error, "Unexpected type when encoding MarkDef.font_weight"}
 
+  def decode_href(value) when is_binary(value), do: value
+  def decode_href(_), do: {:error, "Unexpected type when decoding MarkDef.href"}
+
+  def encode_href(value) when is_binary(value), do: value
+  def encode_href(_), do: {:error, "Unexpected type when encoding MarkDef.href"}
+
+  def decode_shape(value) when is_binary(value), do: value
+  def decode_shape(_), do: {:error, "Unexpected type when decoding MarkDef.shape"}
+
+  def encode_shape(value) when is_binary(value), do: value
+  def encode_shape(_), do: {:error, "Unexpected type when encoding MarkDef.shape"}
+
+  def decode_stroke(value) when is_binary(value), do: value
+  def decode_stroke(_), do: {:error, "Unexpected type when decoding MarkDef.stroke"}
+
+  def encode_stroke(value) when is_binary(value), do: value
+  def encode_stroke(_), do: {:error, "Unexpected type when encoding MarkDef.stroke"}
+
   def decode_style(value) when is_binary(value), do: value
   def decode_style(value) when is_list(value), do: value
   def decode_style(value) when is_nil(value), do: value
@@ -7210,39 +7792,45 @@ defmodule MarkDef do
   def encode_style(value) when is_nil(value), do: value
   def encode_style(_), do: {:error, "Unexpected type when encoding MarkDef.style"}
 
+  def decode_text(value) when is_binary(value), do: value
+  def decode_text(_), do: {:error, "Unexpected type when decoding MarkDef.text"}
+
+  def encode_text(value) when is_binary(value), do: value
+  def encode_text(_), do: {:error, "Unexpected type when encoding MarkDef.text"}
+
   def from_map(m) do
     %MarkDef{
       align: m["align"] && HorizontalAlign.decode(m["align"]),
       angle: m["angle"],
       baseline: m["baseline"] && VerticalAlign.decode(m["baseline"]),
       clip: m["clip"],
-      color: m["color"],
+      color: m["color"] && decode_color(m["color"]),
       cursor: m["cursor"] && Cursor.decode(m["cursor"]),
       dx: m["dx"],
       dy: m["dy"],
-      fill: m["fill"],
+      fill: m["fill"] && decode_fill(m["fill"]),
       filled: m["filled"],
       fill_opacity: m["fillOpacity"],
-      font: m["font"],
+      font: m["font"] && decode_font(m["font"]),
       font_size: m["fontSize"],
       font_style: m["fontStyle"] && FontStyle.decode(m["fontStyle"]),
       font_weight: decode_font_weight(m["fontWeight"]),
-      href: m["href"],
+      href: m["href"] && decode_href(m["href"]),
       interpolate: m["interpolate"] && Interpolate.decode(m["interpolate"]),
       limit: m["limit"],
       opacity: m["opacity"],
       orient: m["orient"] && Orient.decode(m["orient"]),
       radius: m["radius"],
-      shape: m["shape"],
+      shape: m["shape"] && decode_shape(m["shape"]),
       size: m["size"],
-      stroke: m["stroke"],
+      stroke: m["stroke"] && decode_stroke(m["stroke"]),
       stroke_dash: m["strokeDash"],
       stroke_dash_offset: m["strokeDashOffset"],
       stroke_opacity: m["strokeOpacity"],
       stroke_width: m["strokeWidth"],
       style: decode_style(m["style"]),
       tension: m["tension"],
-      text: m["text"],
+      text: m["text"] && decode_text(m["text"]),
       theta: m["theta"],
       type: Mark.decode(m["type"]),
     }
@@ -7986,6 +8574,24 @@ defmodule Transform do
   def encode_as(value) when is_nil(value), do: value
   def encode_as(_), do: {:error, "Unexpected type when encoding Transform.as"}
 
+  def decode_calculate(value) when is_binary(value), do: value
+  def decode_calculate(_), do: {:error, "Unexpected type when decoding Transform.calculate"}
+
+  def encode_calculate(value) when is_binary(value), do: value
+  def encode_calculate(_), do: {:error, "Unexpected type when encoding Transform.calculate"}
+
+  def decode_default(value) when is_binary(value), do: value
+  def decode_default(_), do: {:error, "Unexpected type when decoding Transform.default"}
+
+  def encode_default(value) when is_binary(value), do: value
+  def encode_default(_), do: {:error, "Unexpected type when encoding Transform.default"}
+
+  def decode_lookup(value) when is_binary(value), do: value
+  def decode_lookup(_), do: {:error, "Unexpected type when decoding Transform.lookup"}
+
+  def encode_lookup(value) when is_binary(value), do: value
+  def encode_lookup(_), do: {:error, "Unexpected type when encoding Transform.lookup"}
+
   def decode_bin(%{} = value), do: BinParams.from_map(value)
   def decode_bin(value) when is_boolean(value), do: value
   def decode_bin(value) when is_nil(value), do: value
@@ -7996,16 +8602,22 @@ defmodule Transform do
   def encode_bin(value) when is_nil(value), do: value
   def encode_bin(_), do: {:error, "Unexpected type when encoding Transform.bin"}
 
+  def decode_field(value) when is_binary(value), do: value
+  def decode_field(_), do: {:error, "Unexpected type when decoding Transform.field"}
+
+  def encode_field(value) when is_binary(value), do: value
+  def encode_field(_), do: {:error, "Unexpected type when encoding Transform.field"}
+
   def from_map(m) do
     %Transform{
       filter: decode_filter(m["filter"]),
       as: decode_as(m["as"]),
-      calculate: m["calculate"],
-      default: m["default"],
+      calculate: m["calculate"] && decode_calculate(m["calculate"]),
+      default: m["default"] && decode_default(m["default"]),
       from: m["from"] && LookupData.from_map(m["from"]),
-      lookup: m["lookup"],
+      lookup: m["lookup"] && decode_lookup(m["lookup"]),
       bin: decode_bin(m["bin"]),
-      field: m["field"],
+      field: m["field"] && decode_field(m["field"]),
       time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
       aggregate: m["aggregate"] && Enum.map(m["aggregate"], &AggregatedFieldDef.from_map/1),
       groupby: m["groupby"],
@@ -8077,6 +8689,18 @@ defmodule LayerSpec do
           selection: %{String.t() => SelectionDef.t()} | nil
         }
 
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding LayerSpec.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding LayerSpec.description"}
+
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding LayerSpec.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding LayerSpec.name"}
+
   def decode_title(%{"text" => _,} = value), do: TitleParams.from_map(value)
   def decode_title(value) when is_binary(value), do: value
   def decode_title(value) when is_nil(value), do: value
@@ -8100,10 +8724,10 @@ defmodule LayerSpec do
   def from_map(m) do
     %LayerSpec{
       data: m["data"] && Data.from_map(m["data"]),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       height: m["height"],
       layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
       title: decode_title(m["title"]),
       transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
@@ -8236,6 +8860,18 @@ defmodule Spec do
           hconcat: [Spec.t()] | nil
         }
 
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding Spec.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding Spec.description"}
+
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding Spec.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding Spec.name"}
+
   def decode_title(%{"text" => _,} = value), do: TitleParams.from_map(value)
   def decode_title(value) when is_binary(value), do: value
   def decode_title(value) when is_nil(value), do: value
@@ -8259,10 +8895,10 @@ defmodule Spec do
   def from_map(m) do
     %Spec{
       data: m["data"] && Data.from_map(m["data"]),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       height: m["height"],
       layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
       title: decode_title(m["title"]),
       transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
@@ -8372,6 +9008,12 @@ defmodule TopLevel do
           hconcat: [Spec.t()] | nil
         }
 
+  def decode_schema(value) when is_binary(value), do: value
+  def decode_schema(_), do: {:error, "Unexpected type when decoding TopLevel.schema"}
+
+  def encode_schema(value) when is_binary(value), do: value
+  def encode_schema(_), do: {:error, "Unexpected type when encoding TopLevel.schema"}
+
   def decode_autosize(%{} = value), do: AutoSizeParams.from_map(value)
   def decode_autosize(value) when is_binary(value), do: AutosizeType.decode(value)
   def decode_autosize(value) when is_nil(value), do: value
@@ -8382,6 +9024,18 @@ defmodule TopLevel do
   def encode_autosize(value) when is_nil(value), do: value
   def encode_autosize(_), do: {:error, "Unexpected type when encoding TopLevel.autosize"}
 
+  def decode_background(value) when is_binary(value), do: value
+  def decode_background(_), do: {:error, "Unexpected type when decoding TopLevel.background"}
+
+  def encode_background(value) when is_binary(value), do: value
+  def encode_background(_), do: {:error, "Unexpected type when encoding TopLevel.background"}
+
+  def decode_description(value) when is_binary(value), do: value
+  def decode_description(_), do: {:error, "Unexpected type when decoding TopLevel.description"}
+
+  def encode_description(value) when is_binary(value), do: value
+  def encode_description(_), do: {:error, "Unexpected type when encoding TopLevel.description"}
+
   def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value)
   def decode_mark(value) when is_binary(value), do: Mark.decode(value)
   def decode_mark(value) when is_nil(value), do: value
@@ -8392,6 +9046,12 @@ defmodule TopLevel do
   def encode_mark(value) when is_nil(value), do: value
   def encode_mark(_), do: {:error, "Unexpected type when encoding TopLevel.mark"}
 
+  def decode_name(value) when is_binary(value), do: value
+  def decode_name(_), do: {:error, "Unexpected type when decoding TopLevel.name"}
+
+  def encode_name(value) when is_binary(value), do: value
+  def encode_name(_), do: {:error, "Unexpected type when encoding TopLevel.name"}
+
   def decode_padding(%{} = value), do: PaddingClass.from_map(value)
   def decode_padding(value) when is_float(value), do: value
   def decode_padding(value) when is_integer(value), do: value
@@ -8416,16 +9076,16 @@ defmodule TopLevel do
 
   def from_map(m) do
     %TopLevel{
-      schema: m["$schema"],
+      schema: m["$schema"] && decode_schema(m["$schema"]),
       autosize: decode_autosize(m["autosize"]),
-      background: m["background"],
+      background: m["background"] && decode_background(m["background"]),
       config: m["config"] && ConfigClass.from_map(m["config"]),
       data: m["data"] && Data.from_map(m["data"]),
-      description: m["description"],
+      description: m["description"] && decode_description(m["description"]),
       encoding: m["encoding"] && EncodingWithFacet.from_map(m["encoding"]),
       height: m["height"],
       mark: decode_mark(m["mark"]),
-      name: m["name"],
+      name: m["name"] && decode_name(m["name"]),
       padding: decode_padding(m["padding"]),
       projection: m["projection"] && Projection.from_map(m["projection"]),
       selection: m["selection"]
