diff --git a/head/schema-cjson/test/inputs/schema/minmaxlength.schema/default/TopLevel.c b/head/schema-cjson/test/inputs/schema/minmaxlength.schema/default/TopLevel.c
new file mode 100644
index 0000000..fa7e441
--- /dev/null
+++ b/head/schema-cjson/test/inputs/schema/minmaxlength.schema/default/TopLevel.c
@@ -0,0 +1,248 @@
+/**
+ * TopLevel.c
+ * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT
+ */
+
+#include "TopLevel.h"
+
+struct InUnion * cJSON_GetInUnionValue(const cJSON * j) {
+    struct InUnion * x = cJSON_malloc(sizeof(struct InUnion));
+    if (NULL != x) {
+        memset(x, 0, sizeof(struct InUnion));
+        if (cJSON_IsNumber(j)) {
+            x->type = cJSON_Number;
+            x->value.number = cJSON_GetNumberValue(j);
+        }
+        else if (cJSON_IsString(j)) {
+            x->type = cJSON_String;
+            x->value.string = strdup(cJSON_GetStringValue(j));
+        }
+    }
+    return x;
+}
+
+cJSON * cJSON_CreateInUnion(const struct InUnion * x) {
+    cJSON * j = NULL;
+    if (NULL != x) {
+        if (cJSON_Number == x->type) {
+            j = cJSON_CreateNumber(x->value.number);
+        }
+        else if (cJSON_String == x->type) {
+            j = cJSON_CreateString(x->value.string);
+        }
+    }
+    return j;
+}
+
+void cJSON_DeleteInUnion(struct InUnion * x) {
+    if (NULL != x) {
+        if (cJSON_Number == x->type) {
+        }
+        else if (cJSON_String == x->type) {
+            cJSON_free(x->value.string);
+        }
+        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, "intersection")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "intersection")) {
+                if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "intersection"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "intersection")->valuestring) < 4) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "intersection")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->intersection = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "intersection")));
+            }
+            else {
+                if (NULL != (x->intersection = cJSON_malloc(sizeof(char)))) {
+                    x->intersection[0] = '\0';
+                }
+            }
+            if (!cJSON_HasObjectItem(j, "inUnion")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "inUnion")) {
+                if (!cJSON_IsInUnion(cJSON_GetObjectItemCaseSensitive(j, "inUnion"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->in_union = cJSON_GetInUnionValue(cJSON_GetObjectItemCaseSensitive(j, "inUnion"));
+                if (NULL == x->in_union) { cJSON_DeleteTopLevel(x); return NULL; }
+            }
+            if (!cJSON_HasObjectItem(j, "maxlength")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "maxlength")) {
+                if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "maxlength"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "maxlength")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->maxlength = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "maxlength")));
+            }
+            else {
+                if (NULL != (x->maxlength = cJSON_malloc(sizeof(char)))) {
+                    x->maxlength[0] = '\0';
+                }
+            }
+            if (!cJSON_HasObjectItem(j, "minlength")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "minlength")) {
+                if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minlength"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minlength")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->minlength = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minlength")));
+            }
+            else {
+                if (NULL != (x->minlength = cJSON_malloc(sizeof(char)))) {
+                    x->minlength[0] = '\0';
+                }
+            }
+            if (!cJSON_HasObjectItem(j, "minMaxIntersection")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "minMaxIntersection")) {
+                if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->min_max_intersection = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minMaxIntersection")));
+            }
+            else {
+                if (NULL != (x->min_max_intersection = cJSON_malloc(sizeof(char)))) {
+                    x->min_max_intersection[0] = '\0';
+                }
+            }
+            if (!cJSON_HasObjectItem(j, "minmaxlength")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "minmaxlength")) {
+                if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength")->valuestring) > 5) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->minmaxlength = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minmaxlength")));
+            }
+            else {
+                if (NULL != (x->minmaxlength = cJSON_malloc(sizeof(char)))) {
+                    x->minmaxlength[0] = '\0';
+                }
+            }
+            if (!cJSON_HasObjectItem(j, "minMaxUnion")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "minMaxUnion")) {
+                if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "minMaxUnion"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->min_max_union = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "minMaxUnion")));
+            }
+            else {
+                if (NULL != (x->min_max_union = cJSON_malloc(sizeof(char)))) {
+                    x->min_max_union[0] = '\0';
+                }
+            }
+            if (!cJSON_HasObjectItem(j, "union")) { cJSON_DeleteTopLevel(x); return NULL; }
+            if (cJSON_HasObjectItem(j, "union")) {
+                if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "union"))) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "union")->valuestring) < 3) { cJSON_DeleteTopLevel(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "union")->valuestring) > 6) { cJSON_DeleteTopLevel(x); return NULL; }
+                x->top_level_union = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "union")));
+            }
+            else {
+                if (NULL != (x->top_level_union = cJSON_malloc(sizeof(char)))) {
+                    x->top_level_union[0] = '\0';
+                }
+            }
+        }
+    }
+    return x;
+}
+
+cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
+    cJSON * j = NULL;
+    if (NULL != x) {
+        if (NULL != (j = cJSON_CreateObject())) {
+            if (NULL != x->intersection) {
+                cJSON_AddStringToObject(j, "intersection", x->intersection);
+            }
+            else {
+                cJSON_AddStringToObject(j, "intersection", "");
+            }
+            cJSON_AddItemToObject(j, "inUnion", cJSON_CreateInUnion(x->in_union));
+            if (NULL != x->maxlength) {
+                cJSON_AddStringToObject(j, "maxlength", x->maxlength);
+            }
+            else {
+                cJSON_AddStringToObject(j, "maxlength", "");
+            }
+            if (NULL != x->minlength) {
+                cJSON_AddStringToObject(j, "minlength", x->minlength);
+            }
+            else {
+                cJSON_AddStringToObject(j, "minlength", "");
+            }
+            if (NULL != x->min_max_intersection) {
+                cJSON_AddStringToObject(j, "minMaxIntersection", x->min_max_intersection);
+            }
+            else {
+                cJSON_AddStringToObject(j, "minMaxIntersection", "");
+            }
+            if (NULL != x->minmaxlength) {
+                cJSON_AddStringToObject(j, "minmaxlength", x->minmaxlength);
+            }
+            else {
+                cJSON_AddStringToObject(j, "minmaxlength", "");
+            }
+            if (NULL != x->min_max_union) {
+                cJSON_AddStringToObject(j, "minMaxUnion", x->min_max_union);
+            }
+            else {
+                cJSON_AddStringToObject(j, "minMaxUnion", "");
+            }
+            if (NULL != x->top_level_union) {
+                cJSON_AddStringToObject(j, "union", x->top_level_union);
+            }
+            else {
+                cJSON_AddStringToObject(j, "union", "");
+            }
+        }
+    }
+    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->intersection) {
+            cJSON_free(x->intersection);
+        }
+        if (NULL != x->in_union) {
+            cJSON_DeleteInUnion(x->in_union);
+        }
+        if (NULL != x->maxlength) {
+            cJSON_free(x->maxlength);
+        }
+        if (NULL != x->minlength) {
+            cJSON_free(x->minlength);
+        }
+        if (NULL != x->min_max_intersection) {
+            cJSON_free(x->min_max_intersection);
+        }
+        if (NULL != x->minmaxlength) {
+            cJSON_free(x->minmaxlength);
+        }
+        if (NULL != x->min_max_union) {
+            cJSON_free(x->min_max_union);
+        }
+        if (NULL != x->top_level_union) {
+            cJSON_free(x->top_level_union);
+        }
+        cJSON_free(x);
+    }
+}
diff --git a/head/schema-cjson/test/inputs/schema/minmaxlength.schema/default/TopLevel.h b/head/schema-cjson/test/inputs/schema/minmaxlength.schema/default/TopLevel.h
new file mode 100644
index 0000000..0aa1a52
--- /dev/null
+++ b/head/schema-cjson/test/inputs/schema/minmaxlength.schema/default/TopLevel.h
@@ -0,0 +1,71 @@
+/**
+ * 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 <cJSON.h>
+#include <hashtable.h>
+#include <list.h>
+
+#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 InUnion {
+    int type;
+    union {
+        double number;
+        char * string;
+    } value;
+};
+
+struct TopLevel {
+    char * intersection;
+    struct InUnion * in_union;
+    char * maxlength;
+    char * minlength;
+    char * min_max_intersection;
+    char * minmaxlength;
+    char * min_max_union;
+    char * top_level_union;
+};
+
+#define cJSON_IsInUnion(j) (cJSON_IsNumber(j) || cJSON_IsString(j))
+struct InUnion * cJSON_GetInUnionValue(const cJSON * j);
+cJSON * cJSON_CreateInUnion(const struct InUnion * x);
+void cJSON_DeleteInUnion(struct InUnion * 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/renaming-bug.schema/default/TopLevel.c b/head/schema-cjson/test/inputs/schema/renaming-bug.schema/default/TopLevel.c
index 9c0ff9d..527f88d 100644
--- a/base/schema-cjson/test/inputs/schema/renaming-bug.schema/default/TopLevel.c
+++ b/head/schema-cjson/test/inputs/schema/renaming-bug.schema/default/TopLevel.c
@@ -591,6 +591,7 @@ struct Berry * cJSON_GetBerryValue(const cJSON * j) {
             }
             if (cJSON_HasObjectItem(j, "name")) {
                 if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "name"))) { cJSON_DeleteBerry(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "name")->valuestring) < 1) { cJSON_DeleteBerry(x); return NULL; }
                 x->name = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "name")));
             }
             if (cJSON_HasObjectItem(j, "shapes")) {
@@ -1020,6 +1021,7 @@ struct Vehicle * cJSON_GetVehicleValue(const cJSON * j) {
             }
             if (cJSON_HasObjectItem(j, "id")) {
                 if (!cJSON_IsString(cJSON_GetObjectItemCaseSensitive(j, "id"))) { cJSON_DeleteVehicle(x); return NULL; }
+                if (strlen(cJSON_GetObjectItemCaseSensitive(j, "id")->valuestring) < 1) { cJSON_DeleteVehicle(x); return NULL; }
                 x->id = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "id")));
             }
             if (cJSON_HasObjectItem(j, "speed")) {
