diff --git a/base/cjson/test/inputs/json/misc/26c9c.json/default/TopLevel.h b/head/cjson/test/inputs/json/misc/26c9c.json/default/TopLevel.h
index 3040a6b..707d595 100644
--- a/base/cjson/test/inputs/json/misc/26c9c.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/misc/26c9c.json/default/TopLevel.h
@@ -235,7 +235,7 @@ struct TopLevel {
     struct Meta * meta;
 };
 
-#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Datum * cJSON_GetDatumValue(const cJSON * j);
 cJSON * cJSON_CreateDatum(const struct Datum * x);
 void cJSON_DeleteDatum(struct Datum * x);
diff --git a/base/cjson/test/inputs/json/misc/421d4.json/default/TopLevel.h b/head/cjson/test/inputs/json/misc/421d4.json/default/TopLevel.h
index d4c732f..05187b0 100644
--- a/base/cjson/test/inputs/json/misc/421d4.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/misc/421d4.json/default/TopLevel.h
@@ -162,7 +162,7 @@ struct TopLevel {
     struct Meta * meta;
 };
 
-#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Datum * cJSON_GetDatumValue(const cJSON * j);
 cJSON * cJSON_CreateDatum(const struct Datum * x);
 void cJSON_DeleteDatum(struct Datum * x);
diff --git a/base/cjson/test/inputs/json/misc/5f7fe.json/default/TopLevel.h b/head/cjson/test/inputs/json/misc/5f7fe.json/default/TopLevel.h
index eb78451..a8b1cda 100644
--- a/base/cjson/test/inputs/json/misc/5f7fe.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/misc/5f7fe.json/default/TopLevel.h
@@ -240,7 +240,7 @@ struct TopLevel {
 enum TypeName cJSON_GetTypeNameValue(const cJSON * j);
 cJSON * cJSON_CreateTypeName(const enum TypeName x);
 
-#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Datum * cJSON_GetDatumValue(const cJSON * j);
 cJSON * cJSON_CreateDatum(const struct Datum * x);
 void cJSON_DeleteDatum(struct Datum * x);
diff --git a/base/cjson/test/inputs/json/misc/617e8.json/default/TopLevel.h b/head/cjson/test/inputs/json/misc/617e8.json/default/TopLevel.h
index 6a9b372..2f8c3bb 100644
--- a/base/cjson/test/inputs/json/misc/617e8.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/misc/617e8.json/default/TopLevel.h
@@ -239,7 +239,7 @@ struct TopLevel {
 enum TypeName cJSON_GetTypeNameValue(const cJSON * j);
 cJSON * cJSON_CreateTypeName(const enum TypeName x);
 
-#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Datum * cJSON_GetDatumValue(const cJSON * j);
 cJSON * cJSON_CreateDatum(const struct Datum * x);
 void cJSON_DeleteDatum(struct Datum * x);
diff --git a/base/cjson/test/inputs/json/misc/a0496.json/default/TopLevel.h b/head/cjson/test/inputs/json/misc/a0496.json/default/TopLevel.h
index 8080cb5..4752c7b 100644
--- a/base/cjson/test/inputs/json/misc/a0496.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/misc/a0496.json/default/TopLevel.h
@@ -69,7 +69,7 @@ struct TopLevel {
     char * urlize_name;
 };
 
-#define cJSON_IsDatum(j) (cJSON_IsNumber(j) || cJSON_IsString(j))
+#define cJSON_IsDatum(j) (cJSON_IsNumber(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Datum * cJSON_GetDatumValue(const cJSON * j);
 cJSON * cJSON_CreateDatum(const struct Datum * x);
 void cJSON_DeleteDatum(struct Datum * x);
diff --git a/base/cjson/test/inputs/json/misc/a3d8c.json/default/TopLevel.h b/head/cjson/test/inputs/json/misc/a3d8c.json/default/TopLevel.h
index 6bec61b..906e5ce 100644
--- a/base/cjson/test/inputs/json/misc/a3d8c.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/misc/a3d8c.json/default/TopLevel.h
@@ -168,7 +168,7 @@ struct TopLevel {
 enum TypeName cJSON_GetTypeNameValue(const cJSON * j);
 cJSON * cJSON_CreateTypeName(const enum TypeName x);
 
-#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Datum * cJSON_GetDatumValue(const cJSON * j);
 cJSON * cJSON_CreateDatum(const struct Datum * x);
 void cJSON_DeleteDatum(struct Datum * x);
diff --git a/base/cjson/test/inputs/json/misc/fcca3.json/default/TopLevel.h b/head/cjson/test/inputs/json/misc/fcca3.json/default/TopLevel.h
index fc8267e..7e066cd 100644
--- a/base/cjson/test/inputs/json/misc/fcca3.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/misc/fcca3.json/default/TopLevel.h
@@ -265,7 +265,7 @@ struct TopLevel {
 enum TypeName cJSON_GetTypeNameValue(const cJSON * j);
 cJSON * cJSON_CreateTypeName(const enum TypeName x);
 
-#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsDatum(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Datum * cJSON_GetDatumValue(const cJSON * j);
 cJSON * cJSON_CreateDatum(const struct Datum * x);
 void cJSON_DeleteDatum(struct Datum * x);
diff --git a/base/cjson/test/inputs/json/priority/combinations4.json/default/TopLevel.h b/head/cjson/test/inputs/json/priority/combinations4.json/default/TopLevel.h
index 20ef957..fae552a 100644
--- a/base/cjson/test/inputs/json/priority/combinations4.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/priority/combinations4.json/default/TopLevel.h
@@ -847,7 +847,7 @@ void cJSON_DeletePyodermiaElement(struct PyodermiaElement * x);
 struct PyodermiaElement * cJSON_ParsePyodermiaElement(const char * s);
 char * cJSON_PrintPyodermiaElement(const struct PyodermiaElement * x);
 
-#define cJSON_IsQuebrachineElement(j) (cJSON_IsBool(j) || cJSON_IsObject(j))
+#define cJSON_IsQuebrachineElement(j) (cJSON_IsBool(j) || cJSON_IsObject(j) || cJSON_IsNull(j))
 struct QuebrachineElement * cJSON_GetQuebrachineElementValue(const cJSON * j);
 cJSON * cJSON_CreateQuebrachineElement(const struct QuebrachineElement * x);
 void cJSON_DeleteQuebrachineElement(struct QuebrachineElement * x);
@@ -889,7 +889,7 @@ void cJSON_DeleteRewriteElement(struct RewriteElement * x);
 struct RewriteElement * cJSON_ParseRewriteElement(const char * s);
 char * cJSON_PrintRewriteElement(const struct RewriteElement * x);
 
-#define cJSON_IsSaccoderm(j) (cJSON_IsArray(j) || cJSON_IsString(j))
+#define cJSON_IsSaccoderm(j) (cJSON_IsArray(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Saccoderm * cJSON_GetSaccodermValue(const cJSON * j);
 cJSON * cJSON_CreateSaccoderm(const struct Saccoderm * x);
 void cJSON_DeleteSaccoderm(struct Saccoderm * x);
@@ -903,7 +903,7 @@ void cJSON_DeleteSantirElement(struct SantirElement * x);
 struct SantirElement * cJSON_ParseSantirElement(const char * s);
 char * cJSON_PrintSantirElement(const struct SantirElement * x);
 
-#define cJSON_IsSaprophilous(j) (cJSON_IsObject(j) || cJSON_IsString(j))
+#define cJSON_IsSaprophilous(j) (cJSON_IsObject(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Saprophilous * cJSON_GetSaprophilousValue(const cJSON * j);
 cJSON * cJSON_CreateSaprophilous(const struct Saprophilous * x);
 void cJSON_DeleteSaprophilous(struct Saprophilous * x);
@@ -917,14 +917,14 @@ void cJSON_DeleteSaxtenElement(struct SaxtenElement * x);
 struct SaxtenElement * cJSON_ParseSaxtenElement(const char * s);
 char * cJSON_PrintSaxtenElement(const struct SaxtenElement * x);
 
-#define cJSON_IsScoffer(j) (cJSON_IsArray(j) || cJSON_IsObject(j))
+#define cJSON_IsScoffer(j) (cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsNull(j))
 struct Scoffer * cJSON_GetScofferValue(const cJSON * j);
 cJSON * cJSON_CreateScoffer(const struct Scoffer * x);
 void cJSON_DeleteScoffer(struct Scoffer * x);
 struct Scoffer * cJSON_ParseScoffer(const char * s);
 char * cJSON_PrintScoffer(const struct Scoffer * x);
 
-#define cJSON_IsScrampum(j) (cJSON_IsArray(j) || cJSON_IsBool(j))
+#define cJSON_IsScrampum(j) (cJSON_IsArray(j) || cJSON_IsBool(j) || cJSON_IsNull(j))
 struct Scrampum * cJSON_GetScrampumValue(const cJSON * j);
 cJSON * cJSON_CreateScrampum(const struct Scrampum * x);
 void cJSON_DeleteScrampum(struct Scrampum * x);
@@ -987,7 +987,7 @@ void cJSON_DeleteTabaxir(struct Tabaxir * x);
 struct Tabaxir * cJSON_ParseTabaxir(const char * s);
 char * cJSON_PrintTabaxir(const struct Tabaxir * x);
 
-#define cJSON_IsTalpiform(j) (cJSON_IsObject(j) || cJSON_IsNumber(j))
+#define cJSON_IsTalpiform(j) (cJSON_IsObject(j) || cJSON_IsNumber(j) || cJSON_IsNull(j))
 struct Talpiform * cJSON_GetTalpiformValue(const cJSON * j);
 cJSON * cJSON_CreateTalpiform(const struct Talpiform * x);
 void cJSON_DeleteTalpiform(struct Talpiform * x);
@@ -1036,7 +1036,7 @@ void cJSON_DeleteUnerasing(struct Unerasing * x);
 struct Unerasing * cJSON_ParseUnerasing(const char * s);
 char * cJSON_PrintUnerasing(const struct Unerasing * x);
 
-#define cJSON_IsUnguentarium(j) (cJSON_IsArray(j) || quicktype_cJSON_IsInteger(j))
+#define cJSON_IsUnguentarium(j) (cJSON_IsArray(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j))
 struct Unguentarium * cJSON_GetUnguentariumValue(const cJSON * j);
 cJSON * cJSON_CreateUnguentarium(const struct Unguentarium * x);
 void cJSON_DeleteUnguentarium(struct Unguentarium * x);
@@ -1050,14 +1050,14 @@ void cJSON_DeleteUnimpeachablyElement(struct UnimpeachablyElement * x);
 struct UnimpeachablyElement * cJSON_ParseUnimpeachablyElement(const char * s);
 char * cJSON_PrintUnimpeachablyElement(const struct UnimpeachablyElement * x);
 
-#define cJSON_IsUnmortgaged(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
+#define cJSON_IsUnmortgaged(j) (cJSON_IsNumber(j) || cJSON_IsObject(j) || cJSON_IsNull(j))
 struct Unmortgaged * cJSON_GetUnmortgagedValue(const cJSON * j);
 cJSON * cJSON_CreateUnmortgaged(const struct Unmortgaged * x);
 void cJSON_DeleteUnmortgaged(struct Unmortgaged * x);
 struct Unmortgaged * cJSON_ParseUnmortgaged(const char * s);
 char * cJSON_PrintUnmortgaged(const struct Unmortgaged * x);
 
-#define cJSON_IsUnobstructed(j) (cJSON_IsObject(j) || quicktype_cJSON_IsInteger(j))
+#define cJSON_IsUnobstructed(j) (cJSON_IsObject(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j))
 struct Unobstructed * cJSON_GetUnobstructedValue(const cJSON * j);
 cJSON * cJSON_CreateUnobstructed(const struct Unobstructed * x);
 void cJSON_DeleteUnobstructed(struct Unobstructed * x);
@@ -1099,7 +1099,7 @@ void cJSON_DeleteUnvarying(struct Unvarying * x);
 struct Unvarying * cJSON_ParseUnvarying(const char * s);
 char * cJSON_PrintUnvarying(const struct Unvarying * x);
 
-#define cJSON_IsVehemently(j) (cJSON_IsArray(j) || cJSON_IsBool(j))
+#define cJSON_IsVehemently(j) (cJSON_IsArray(j) || cJSON_IsBool(j) || cJSON_IsNull(j))
 struct Vehemently * cJSON_GetVehementlyValue(const cJSON * j);
 cJSON * cJSON_CreateVehemently(const struct Vehemently * x);
 void cJSON_DeleteVehemently(struct Vehemently * x);
diff --git a/base/cjson/test/inputs/json/priority/combinations4.json/header-only-false__source-style-single-source--491b617045b9/TopLevel.h b/head/cjson/test/inputs/json/priority/combinations4.json/header-only-false__source-style-single-source--491b617045b9/TopLevel.h
index 20ef957..fae552a 100644
--- a/base/cjson/test/inputs/json/priority/combinations4.json/header-only-false__source-style-single-source--491b617045b9/TopLevel.h
+++ b/head/cjson/test/inputs/json/priority/combinations4.json/header-only-false__source-style-single-source--491b617045b9/TopLevel.h
@@ -847,7 +847,7 @@ void cJSON_DeletePyodermiaElement(struct PyodermiaElement * x);
 struct PyodermiaElement * cJSON_ParsePyodermiaElement(const char * s);
 char * cJSON_PrintPyodermiaElement(const struct PyodermiaElement * x);
 
-#define cJSON_IsQuebrachineElement(j) (cJSON_IsBool(j) || cJSON_IsObject(j))
+#define cJSON_IsQuebrachineElement(j) (cJSON_IsBool(j) || cJSON_IsObject(j) || cJSON_IsNull(j))
 struct QuebrachineElement * cJSON_GetQuebrachineElementValue(const cJSON * j);
 cJSON * cJSON_CreateQuebrachineElement(const struct QuebrachineElement * x);
 void cJSON_DeleteQuebrachineElement(struct QuebrachineElement * x);
@@ -889,7 +889,7 @@ void cJSON_DeleteRewriteElement(struct RewriteElement * x);
 struct RewriteElement * cJSON_ParseRewriteElement(const char * s);
 char * cJSON_PrintRewriteElement(const struct RewriteElement * x);
 
-#define cJSON_IsSaccoderm(j) (cJSON_IsArray(j) || cJSON_IsString(j))
+#define cJSON_IsSaccoderm(j) (cJSON_IsArray(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Saccoderm * cJSON_GetSaccodermValue(const cJSON * j);
 cJSON * cJSON_CreateSaccoderm(const struct Saccoderm * x);
 void cJSON_DeleteSaccoderm(struct Saccoderm * x);
@@ -903,7 +903,7 @@ void cJSON_DeleteSantirElement(struct SantirElement * x);
 struct SantirElement * cJSON_ParseSantirElement(const char * s);
 char * cJSON_PrintSantirElement(const struct SantirElement * x);
 
-#define cJSON_IsSaprophilous(j) (cJSON_IsObject(j) || cJSON_IsString(j))
+#define cJSON_IsSaprophilous(j) (cJSON_IsObject(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Saprophilous * cJSON_GetSaprophilousValue(const cJSON * j);
 cJSON * cJSON_CreateSaprophilous(const struct Saprophilous * x);
 void cJSON_DeleteSaprophilous(struct Saprophilous * x);
@@ -917,14 +917,14 @@ void cJSON_DeleteSaxtenElement(struct SaxtenElement * x);
 struct SaxtenElement * cJSON_ParseSaxtenElement(const char * s);
 char * cJSON_PrintSaxtenElement(const struct SaxtenElement * x);
 
-#define cJSON_IsScoffer(j) (cJSON_IsArray(j) || cJSON_IsObject(j))
+#define cJSON_IsScoffer(j) (cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsNull(j))
 struct Scoffer * cJSON_GetScofferValue(const cJSON * j);
 cJSON * cJSON_CreateScoffer(const struct Scoffer * x);
 void cJSON_DeleteScoffer(struct Scoffer * x);
 struct Scoffer * cJSON_ParseScoffer(const char * s);
 char * cJSON_PrintScoffer(const struct Scoffer * x);
 
-#define cJSON_IsScrampum(j) (cJSON_IsArray(j) || cJSON_IsBool(j))
+#define cJSON_IsScrampum(j) (cJSON_IsArray(j) || cJSON_IsBool(j) || cJSON_IsNull(j))
 struct Scrampum * cJSON_GetScrampumValue(const cJSON * j);
 cJSON * cJSON_CreateScrampum(const struct Scrampum * x);
 void cJSON_DeleteScrampum(struct Scrampum * x);
@@ -987,7 +987,7 @@ void cJSON_DeleteTabaxir(struct Tabaxir * x);
 struct Tabaxir * cJSON_ParseTabaxir(const char * s);
 char * cJSON_PrintTabaxir(const struct Tabaxir * x);
 
-#define cJSON_IsTalpiform(j) (cJSON_IsObject(j) || cJSON_IsNumber(j))
+#define cJSON_IsTalpiform(j) (cJSON_IsObject(j) || cJSON_IsNumber(j) || cJSON_IsNull(j))
 struct Talpiform * cJSON_GetTalpiformValue(const cJSON * j);
 cJSON * cJSON_CreateTalpiform(const struct Talpiform * x);
 void cJSON_DeleteTalpiform(struct Talpiform * x);
@@ -1036,7 +1036,7 @@ void cJSON_DeleteUnerasing(struct Unerasing * x);
 struct Unerasing * cJSON_ParseUnerasing(const char * s);
 char * cJSON_PrintUnerasing(const struct Unerasing * x);
 
-#define cJSON_IsUnguentarium(j) (cJSON_IsArray(j) || quicktype_cJSON_IsInteger(j))
+#define cJSON_IsUnguentarium(j) (cJSON_IsArray(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j))
 struct Unguentarium * cJSON_GetUnguentariumValue(const cJSON * j);
 cJSON * cJSON_CreateUnguentarium(const struct Unguentarium * x);
 void cJSON_DeleteUnguentarium(struct Unguentarium * x);
@@ -1050,14 +1050,14 @@ void cJSON_DeleteUnimpeachablyElement(struct UnimpeachablyElement * x);
 struct UnimpeachablyElement * cJSON_ParseUnimpeachablyElement(const char * s);
 char * cJSON_PrintUnimpeachablyElement(const struct UnimpeachablyElement * x);
 
-#define cJSON_IsUnmortgaged(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
+#define cJSON_IsUnmortgaged(j) (cJSON_IsNumber(j) || cJSON_IsObject(j) || cJSON_IsNull(j))
 struct Unmortgaged * cJSON_GetUnmortgagedValue(const cJSON * j);
 cJSON * cJSON_CreateUnmortgaged(const struct Unmortgaged * x);
 void cJSON_DeleteUnmortgaged(struct Unmortgaged * x);
 struct Unmortgaged * cJSON_ParseUnmortgaged(const char * s);
 char * cJSON_PrintUnmortgaged(const struct Unmortgaged * x);
 
-#define cJSON_IsUnobstructed(j) (cJSON_IsObject(j) || quicktype_cJSON_IsInteger(j))
+#define cJSON_IsUnobstructed(j) (cJSON_IsObject(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j))
 struct Unobstructed * cJSON_GetUnobstructedValue(const cJSON * j);
 cJSON * cJSON_CreateUnobstructed(const struct Unobstructed * x);
 void cJSON_DeleteUnobstructed(struct Unobstructed * x);
@@ -1099,7 +1099,7 @@ void cJSON_DeleteUnvarying(struct Unvarying * x);
 struct Unvarying * cJSON_ParseUnvarying(const char * s);
 char * cJSON_PrintUnvarying(const struct Unvarying * x);
 
-#define cJSON_IsVehemently(j) (cJSON_IsArray(j) || cJSON_IsBool(j))
+#define cJSON_IsVehemently(j) (cJSON_IsArray(j) || cJSON_IsBool(j) || cJSON_IsNull(j))
 struct Vehemently * cJSON_GetVehementlyValue(const cJSON * j);
 cJSON * cJSON_CreateVehemently(const struct Vehemently * x);
 void cJSON_DeleteVehemently(struct Vehemently * x);
diff --git a/base/cjson/test/inputs/json/priority/php-mixed-union.json/default/TopLevel.h b/head/cjson/test/inputs/json/priority/php-mixed-union.json/default/TopLevel.h
index 940a0f5..b243ffe 100644
--- a/base/cjson/test/inputs/json/priority/php-mixed-union.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/priority/php-mixed-union.json/default/TopLevel.h
@@ -56,7 +56,7 @@ struct TopLevel {
     list_t * mixed;
 };
 
-#define cJSON_IsMixedElement(j) (cJSON_IsBool(j) || cJSON_IsObject(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsMixedElement(j) (cJSON_IsBool(j) || cJSON_IsObject(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct MixedElement * cJSON_GetMixedElementValue(const cJSON * j);
 cJSON * cJSON_CreateMixedElement(const struct MixedElement * x);
 void cJSON_DeleteMixedElement(struct MixedElement * x);
diff --git a/base/cjson/test/inputs/json/priority/unions.json/default/TopLevel.h b/head/cjson/test/inputs/json/priority/unions.json/default/TopLevel.h
index 9a0c14f..cb596a0 100644
--- a/base/cjson/test/inputs/json/priority/unions.json/default/TopLevel.h
+++ b/head/cjson/test/inputs/json/priority/unions.json/default/TopLevel.h
@@ -65,7 +65,7 @@ struct TopLevel {
     list_t * z;
 };
 
-#define cJSON_IsX(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsString(j))
+#define cJSON_IsX(j) (quicktype_cJSON_IsInteger(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct X * cJSON_GetXValue(const cJSON * j);
 cJSON * cJSON_CreateX(const struct X * x);
 void cJSON_DeleteX(struct X * x);
diff --git a/head/schema-cjson/test/inputs/schema/direct-union.schema/default/TopLevel.c b/head/schema-cjson/test/inputs/schema/direct-union.schema/default/TopLevel.c
new file mode 100644
index 0000000..cf1574c
--- /dev/null
+++ b/head/schema-cjson/test/inputs/schema/direct-union.schema/default/TopLevel.c
@@ -0,0 +1,312 @@
+/**
+ * TopLevel.c
+ * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT
+ */
+
+#include "TopLevel.h"
+
+struct Anything * cJSON_GetAnythingValue(const cJSON * j) {
+    struct Anything * x = cJSON_malloc(sizeof(struct Anything));
+    if (NULL != x) {
+        memset(x, 0, sizeof(struct Anything));
+        if (cJSON_IsNull(j)) {
+            x->type = cJSON_NULL;
+        }
+        else if (cJSON_IsNumber(j)) {
+            x->type = cJSON_Number;
+            x->value.number = cJSON_GetNumberValue(j);
+        }
+        else if (quicktype_cJSON_IsInteger(j)) {
+            x->type = cJSON_Integer;
+            x->value.integer = cJSON_GetNumberValue(j);
+        }
+        else if (cJSON_IsBool(j)) {
+            x->type = cJSON_Bool;
+            x->value.boolean = cJSON_IsTrue(j);
+        }
+        else if (cJSON_IsString(j)) {
+            x->type = cJSON_String;
+            x->value.string = strdup(cJSON_GetStringValue(j));
+        }
+        else if (cJSON_IsArray(j)) {
+            x->type = cJSON_Array;
+            list_t * x1 = list_create(false, NULL);
+            if (NULL != x1) {
+                cJSON * e1 = NULL;
+                cJSON_ArrayForEach(e1, j) {
+                    list_add_tail(x1, quicktype_cJSON_Duplicate(e1), sizeof(cJSON *));
+                }
+                x->value.anything_array = x1;
+            }
+        }
+        else if (cJSON_IsObject(j)) {
+            x->type = cJSON_Map;
+            hashtable_t * x1 = hashtable_create(64, false);
+            if (NULL != x1) {
+                cJSON * e1 = NULL;
+                cJSON_ArrayForEach(e1, j) {
+                    hashtable_add(x1, e1->string, quicktype_cJSON_Duplicate(e1), sizeof(cJSON *));
+                }
+                x->value.anything_map = x1;
+            }
+        }
+        if (0 == x->type) { cJSON_free(x); return NULL; }
+    }
+    return x;
+}
+struct Anything * cJSON_ParseAnything(const char * s) { cJSON * j = cJSON_Parse(s); struct Anything * x = j ? cJSON_GetAnythingValue(j) : NULL; cJSON_Delete(j); return x; }
+char * cJSON_PrintAnything(const struct Anything * x) { cJSON * j = cJSON_CreateAnything(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; }
+
+cJSON * cJSON_CreateAnything(const struct Anything * x) {
+    cJSON * j = NULL;
+    if (NULL != x) {
+        if (cJSON_NULL == x->type) {
+            j = cJSON_CreateNull();
+        }
+        else if (cJSON_Number == x->type) {
+            j = cJSON_CreateNumber(x->value.number);
+        }
+        else if (cJSON_Integer == x->type) {
+            j = cJSON_CreateNumber(x->value.integer);
+        }
+        else if (cJSON_Bool == x->type) {
+            j = cJSON_CreateBool(x->value.boolean);
+        }
+        else if (cJSON_String == x->type) {
+            j = cJSON_CreateString(x->value.string);
+        }
+        else if (cJSON_Array == x->type) {
+            cJSON * j1 = cJSON_CreateArray();
+            if (NULL != j1) {
+                cJSON * x1 = list_get_head(x->value.anything_array);
+                while (NULL != x1) {
+                    cJSON_AddItemToArray(j1, quicktype_cJSON_Duplicate(x1));
+                    x1 = list_get_next(x->value.anything_array);
+                }
+                j = j1;
+            }
+        }
+        else if (cJSON_Map == x->type) {
+            cJSON * j1 = cJSON_CreateObject();
+            if (NULL != j1) {
+                char **keys1 = NULL;
+                size_t count1 = hashtable_get_keys(x->value.anything_map, &keys1);
+                if (NULL != keys1) {
+                    for (size_t index1 = 0; index1 < count1; index1++) {
+                        cJSON *x1 = hashtable_lookup(x->value.anything_map, keys1[index1]);
+                        cJSON_AddItemToObject(j1, keys1[index1], quicktype_cJSON_Duplicate(x1));
+                    }
+                    cJSON_free(keys1);
+                }
+                j = j1;
+            }
+        }
+    }
+    return j;
+}
+
+void cJSON_DeleteAnything(struct Anything * x) {
+    if (NULL != x) {
+        if (cJSON_Number == x->type) {
+        }
+        else if (cJSON_Integer == x->type) {
+        }
+        else if (cJSON_Bool == x->type) {
+        }
+        else if (cJSON_String == x->type) {
+            cJSON_free(x->value.string);
+        }
+        else if (cJSON_Array == x->type) {
+            if (NULL != x->value.anything_array) {
+                cJSON * x1 = list_get_head(x->value.anything_array);
+                while (NULL != x1) {
+                    cJSON_Delete(x1);
+                    x1 = list_get_next(x->value.anything_array);
+                }
+                list_release(x->value.anything_array);
+            }
+        }
+        else if (cJSON_Map == x->type) {
+            if (NULL != x->value.anything_map) {
+                char **keys1 = NULL;
+                size_t count1 = hashtable_get_keys(x->value.anything_map, &keys1);
+                if (NULL != keys1) {
+                    for (size_t index1 = 0; index1 < count1; index1++) {
+                        cJSON *x1 = hashtable_lookup(x->value.anything_map, keys1[index1]);
+                        if (NULL != x1) {
+                            cJSON_Delete(x1);
+                        }
+                    }
+                    cJSON_free(keys1);
+                }
+                hashtable_release(x->value.anything_map);
+            }
+        }
+        cJSON_free(x);
+    }
+}
+
+struct Thing * cJSON_ParseThing(const char * s) {
+    struct Thing * x = NULL;
+    if (NULL != s) {
+        cJSON * j = cJSON_Parse(s);
+        if (NULL != j) {
+            x = cJSON_GetThingValue(j);
+            cJSON_Delete(j);
+        }
+    }
+    return x;
+}
+
+struct Thing * cJSON_GetThingValue(const cJSON * j) {
+    struct Thing * x = NULL;
+    if (NULL != j) {
+        if (NULL != (x = cJSON_malloc(sizeof(struct Thing)))) {
+            memset(x, 0, sizeof(struct Thing));
+            if (cJSON_HasObjectItem(j, "optional")) {
+                if (!cJSON_IsAnything(cJSON_GetObjectItemCaseSensitive(j, "optional"))) { cJSON_DeleteThing(x); return NULL; }
+                x->optional = cJSON_GetAnythingValue(cJSON_GetObjectItemCaseSensitive(j, "optional"));
+                if (NULL == x->optional) { cJSON_DeleteThing(x); return NULL; }
+            }
+            if (!cJSON_HasObjectItem(j, "required")) { cJSON_DeleteThing(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "required")) {
+                if (!cJSON_IsAnything(cJSON_GetObjectItemCaseSensitive(j, "required"))) { cJSON_DeleteThing(x); return NULL; }
+                x->required = cJSON_GetAnythingValue(cJSON_GetObjectItemCaseSensitive(j, "required"));
+                if (NULL == x->required) { cJSON_DeleteThing(x); return NULL; }
+            }
+        }
+    }
+    return x;
+}
+
+cJSON * cJSON_CreateThing(const struct Thing * x) {
+    cJSON * j = NULL;
+    if (NULL != x) {
+        if (NULL != (j = cJSON_CreateObject())) {
+            if (NULL != x->optional) {
+                cJSON_AddItemToObject(j, "optional", cJSON_CreateAnything(x->optional));
+            }
+            cJSON_AddItemToObject(j, "required", cJSON_CreateAnything(x->required));
+        }
+    }
+    return j;
+}
+
+char * cJSON_PrintThing(const struct Thing * x) {
+    char * s = NULL;
+    if (NULL != x) {
+        cJSON * j = cJSON_CreateThing(x);
+        if (NULL != j) {
+            s = cJSON_Print(j);
+            cJSON_Delete(j);
+        }
+    }
+    return s;
+}
+
+void cJSON_DeleteThing(struct Thing * x) {
+    if (NULL != x) {
+        if (NULL != x->optional) {
+            cJSON_DeleteAnything(x->optional);
+        }
+        if (NULL != x->required) {
+            cJSON_DeleteAnything(x->required);
+        }
+        cJSON_free(x);
+    }
+}
+
+struct TopLevel * cJSON_ParseTopLevel(const char * s) {
+    struct TopLevel * x = NULL;
+    if (NULL != s) {
+        cJSON * j = cJSON_Parse(s);
+        if (NULL != j) {
+            x = cJSON_GetTopLevelValue(j);
+            cJSON_Delete(j);
+        }
+    }
+    return x;
+}
+
+struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
+    struct TopLevel * x = NULL;
+    if (NULL != j) {
+        if (NULL != (x = cJSON_malloc(sizeof(struct TopLevel)))) {
+            memset(x, 0, sizeof(struct TopLevel));
+            if (!cJSON_HasObjectItem(j, "stuff")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "stuff")) {
+                if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "stuff"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                hashtable_t * x1 = hashtable_create(64, false);
+                if (NULL != x1) {
+                    cJSON * e1 = NULL;
+                    cJSON * j1 = cJSON_GetObjectItemCaseSensitive(j, "stuff");
+                    cJSON_ArrayForEach(e1, j1) {
+                        if (!cJSON_IsObject(e1)) { cJSON_DeleteTopLevel(x); return NULL; }
+                        hashtable_add(x1, e1->string, cJSON_GetThingValue(e1), sizeof(struct Thing *));
+                    }
+                    x->stuff = x1;
+                }
+            }
+            else {
+                x->stuff = hashtable_create(64, false);
+            }
+        }
+    }
+    return x;
+}
+
+cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
+    cJSON * j = NULL;
+    if (NULL != x) {
+        if (NULL != (j = cJSON_CreateObject())) {
+            if (NULL != x->stuff) {
+                cJSON * j1 = cJSON_CreateObject();
+                if (NULL != j1) {
+                    char **keys1 = NULL;
+                    size_t count1 = hashtable_get_keys(x->stuff, &keys1);
+                    if (NULL != keys1) {
+                        for (size_t index1 = 0; index1 < count1; index1++) {
+                            struct Thing *x1 = hashtable_lookup(x->stuff, keys1[index1]);
+                            cJSON_AddItemToObject(j1, keys1[index1], cJSON_CreateThing(x1));
+                        }
+                        cJSON_free(keys1);
+                    }
+                    cJSON_AddItemToObject(j, "stuff", j1);
+                }
+            }
+        }
+    }
+    return j;
+}
+
+char * cJSON_PrintTopLevel(const struct TopLevel * x) {
+    char * s = NULL;
+    if (NULL != x) {
+        cJSON * j = cJSON_CreateTopLevel(x);
+        if (NULL != j) {
+            s = cJSON_Print(j);
+            cJSON_Delete(j);
+        }
+    }
+    return s;
+}
+
+void cJSON_DeleteTopLevel(struct TopLevel * x) {
+    if (NULL != x) {
+        if (NULL != x->stuff) {
+            char **keys1 = NULL;
+            size_t count1 = hashtable_get_keys(x->stuff, &keys1);
+            if (NULL != keys1) {
+                for (size_t index1 = 0; index1 < count1; index1++) {
+                    struct Thing *x1 = hashtable_lookup(x->stuff, keys1[index1]);
+                    if (NULL != x1) {
+                        cJSON_DeleteThing(x1);
+                    }
+                }
+                cJSON_free(keys1);
+            }
+            hashtable_release(x->stuff);
+        }
+        cJSON_free(x);
+    }
+}
diff --git a/head/schema-cjson/test/inputs/schema/direct-union.schema/default/TopLevel.h b/head/schema-cjson/test/inputs/schema/direct-union.schema/default/TopLevel.h
new file mode 100644
index 0000000..138eecf
--- /dev/null
+++ b/head/schema-cjson/test/inputs/schema/direct-union.schema/default/TopLevel.h
@@ -0,0 +1,85 @@
+/**
+ * TopLevel.h
+ * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT
+ * This file depends of https://github.com/DaveGamble/cJSON, https://github.com/joelguittet/c-list and https://github.com/joelguittet/c-hashtable
+ * To parse json data from json string use the following: struct <type> * data = cJSON_Parse<type>(<string>);
+ * To get json data from cJSON object use the following: struct <type> * data = cJSON_Get<type>Value(<cjson>);
+ * To get cJSON object from json data use the following: cJSON * cjson = cJSON_Create<type>(<data>);
+ * To print json string from json data use the following: char * string = cJSON_Print<type>(<data>);
+ * To delete json data use the following: cJSON_Delete<type>(<data>);
+ */
+
+#ifndef __TOPLEVEL_H__
+#define __TOPLEVEL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <regex.h>
+#include <cJSON.h>
+#include <hashtable.h>
+#include <list.h>
+
+#define quicktype_cJSON_Duplicate(j) cJSON_Duplicate(j, true)
+#define cJSON_Integer (1 << 18)
+#define quicktype_cJSON_IsInteger(j) (cJSON_IsNumber(j) && (j)->valuedouble == (int64_t)(j)->valuedouble)
+#ifndef cJSON_Bool
+#define cJSON_Bool (cJSON_True | cJSON_False)
+#endif
+#ifndef cJSON_Map
+#define cJSON_Map (1 << 16)
+#endif
+#ifndef cJSON_Enum
+#define cJSON_Enum (1 << 17)
+#endif
+
+struct Anything {
+    int type;
+    union {
+        double number;
+        int64_t integer;
+        bool boolean;
+        char * string;
+        list_t * anything_array;
+        hashtable_t * anything_map;
+    } value;
+};
+
+struct Thing {
+    struct Anything * optional;
+    struct Anything * required;
+};
+
+struct TopLevel {
+    hashtable_t * stuff;
+};
+
+#define cJSON_IsAnything(j) (cJSON_IsNull(j) || cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsString(j) || cJSON_IsArray(j) || cJSON_IsObject(j))
+struct Anything * cJSON_GetAnythingValue(const cJSON * j);
+cJSON * cJSON_CreateAnything(const struct Anything * x);
+void cJSON_DeleteAnything(struct Anything * x);
+struct Anything * cJSON_ParseAnything(const char * s);
+char * cJSON_PrintAnything(const struct Anything * x);
+
+struct Thing * cJSON_ParseThing(const char * s);
+struct Thing * cJSON_GetThingValue(const cJSON * j);
+cJSON * cJSON_CreateThing(const struct Thing * x);
+char * cJSON_PrintThing(const struct Thing * x);
+void cJSON_DeleteThing(struct Thing * x);
+
+struct TopLevel * cJSON_ParseTopLevel(const char * s);
+struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j);
+cJSON * cJSON_CreateTopLevel(const struct TopLevel * x);
+char * cJSON_PrintTopLevel(const struct TopLevel * x);
+void cJSON_DeleteTopLevel(struct TopLevel * x);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TOPLEVEL_H__ */
diff --git a/base/schema-cjson/test/inputs/schema/recursive-union-flattening.schema/default/TopLevel.h b/head/schema-cjson/test/inputs/schema/recursive-union-flattening.schema/default/TopLevel.h
index d905c03..61902bb 100644
--- a/base/schema-cjson/test/inputs/schema/recursive-union-flattening.schema/default/TopLevel.h
+++ b/head/schema-cjson/test/inputs/schema/recursive-union-flattening.schema/default/TopLevel.h
@@ -96,28 +96,28 @@ struct TopLevel {
     } value;
 };
 
-#define cJSON_IsX(j) (cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsString(j))
+#define cJSON_IsX(j) (cJSON_IsNull(j) || cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsString(j))
 struct X * cJSON_GetXValue(const cJSON * j);
 cJSON * cJSON_CreateX(const struct X * x);
 void cJSON_DeleteX(struct X * x);
 struct X * cJSON_ParseX(const char * s);
 char * cJSON_PrintX(const struct X * x);
 
-#define cJSON_IsXElement(j) (cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsString(j))
+#define cJSON_IsXElement(j) (cJSON_IsNull(j) || cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsString(j))
 struct XElement * cJSON_GetXElementValue(const cJSON * j);
 cJSON * cJSON_CreateXElement(const struct XElement * x);
 void cJSON_DeleteXElement(struct XElement * x);
 struct XElement * cJSON_ParseXElement(const char * s);
 char * cJSON_PrintXElement(const struct XElement * x);
 
-#define cJSON_IsTopLevelElement(j) (cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsString(j))
+#define cJSON_IsTopLevelElement(j) (cJSON_IsNull(j) || cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsArray(j) || cJSON_IsObject(j) || cJSON_IsString(j))
 struct TopLevelElement * cJSON_GetTopLevelElementValue(const cJSON * j);
 cJSON * cJSON_CreateTopLevelElement(const struct TopLevelElement * x);
 void cJSON_DeleteTopLevelElement(struct TopLevelElement * x);
 struct TopLevelElement * cJSON_ParseTopLevelElement(const char * s);
 char * cJSON_PrintTopLevelElement(const struct TopLevelElement * x);
 
-#define cJSON_IsTopLevel(j) (cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsString(j) || cJSON_IsArray(j) || cJSON_IsObject(j))
+#define cJSON_IsTopLevel(j) (cJSON_IsNull(j) || cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsString(j) || cJSON_IsArray(j) || cJSON_IsObject(j))
 struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j);
 cJSON * cJSON_CreateTopLevel(const struct TopLevel * x);
 void cJSON_DeleteTopLevel(struct TopLevel * x);
diff --git a/base/schema-cjson/test/inputs/schema/rust-cycle-breaker-union.schema/default/TopLevel.h b/head/schema-cjson/test/inputs/schema/rust-cycle-breaker-union.schema/default/TopLevel.h
index 23d1bc8..63984be 100644
--- a/base/schema-cjson/test/inputs/schema/rust-cycle-breaker-union.schema/default/TopLevel.h
+++ b/head/schema-cjson/test/inputs/schema/rust-cycle-breaker-union.schema/default/TopLevel.h
@@ -58,7 +58,7 @@ struct TopLevel {
     char * value;
 };
 
-#define cJSON_IsNext(j) (cJSON_IsObject(j) || cJSON_IsString(j))
+#define cJSON_IsNext(j) (cJSON_IsObject(j) || cJSON_IsNull(j) || cJSON_IsString(j))
 struct Next * cJSON_GetNextValue(const cJSON * j);
 cJSON * cJSON_CreateNext(const struct Next * x);
 void cJSON_DeleteNext(struct Next * x);
diff --git a/base/schema-cjson/test/inputs/schema/unevaluated-properties.schema/default/TopLevel.h b/head/schema-cjson/test/inputs/schema/unevaluated-properties.schema/default/TopLevel.h
index 20df0f8..01f771d 100644
--- a/base/schema-cjson/test/inputs/schema/unevaluated-properties.schema/default/TopLevel.h
+++ b/head/schema-cjson/test/inputs/schema/unevaluated-properties.schema/default/TopLevel.h
@@ -68,7 +68,7 @@ struct TopLevel {
     struct Config * config;
 };
 
-#define cJSON_IsClosed(j) (cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsString(j) || cJSON_IsArray(j) || cJSON_IsObject(j))
+#define cJSON_IsClosed(j) (cJSON_IsNull(j) || cJSON_IsNumber(j) || quicktype_cJSON_IsInteger(j) || cJSON_IsBool(j) || cJSON_IsString(j) || cJSON_IsArray(j) || cJSON_IsObject(j))
 struct Closed * cJSON_GetClosedValue(const cJSON * j);
 cJSON * cJSON_CreateClosed(const struct Closed * x);
 void cJSON_DeleteClosed(struct Closed * x);
diff --git a/base/schema-cjson/test/inputs/schema/vega-lite.schema/default/TopLevel.h b/head/schema-cjson/test/inputs/schema/vega-lite.schema/default/TopLevel.h
index 8cc910e..4a32503 100644
--- a/base/schema-cjson/test/inputs/schema/vega-lite.schema/default/TopLevel.h
+++ b/head/schema-cjson/test/inputs/schema/vega-lite.schema/default/TopLevel.h
@@ -6542,7 +6542,7 @@ void cJSON_DeleteEqual(struct Equal * x);
 struct Equal * cJSON_ParseEqual(const char * s);
 char * cJSON_PrintEqual(const struct Equal * x);
 
-#define cJSON_IsRangeElement(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
+#define cJSON_IsRangeElement(j) (cJSON_IsNumber(j) || cJSON_IsObject(j) || cJSON_IsNull(j))
 struct RangeElement * cJSON_GetRangeElementValue(const cJSON * j);
 cJSON * cJSON_CreateRangeElement(const struct RangeElement * x);
 void cJSON_DeleteRangeElement(struct RangeElement * x);
@@ -6612,7 +6612,7 @@ void cJSON_DeleteScheme(struct Scheme * x);
 struct Scheme * cJSON_ParseScheme(const char * s);
 char * cJSON_PrintScheme(const struct Scheme * x);
 
-#define cJSON_IsSortUnion(j) (cJSON_IsObject(j) || cJSON_IsString(j))
+#define cJSON_IsSortUnion(j) (cJSON_IsNull(j) || cJSON_IsObject(j) || cJSON_IsString(j))
 struct SortUnion * cJSON_GetSortUnionValue(const cJSON * j);
 cJSON * cJSON_CreateSortUnion(const struct SortUnion * x);
 void cJSON_DeleteSortUnion(struct SortUnion * x);
