Test case
1 generated file · +5 −0test/inputs/schema/min-max-items.schema
Mschema-cjsondefault / TopLevel.c+5 −0
| @@ -65,6 +65,7 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 65 | 65 | if (!cJSON_HasObjectItem(j, "maxOnly")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 66 | 66 | if (cJSON_HasObjectItem(j, "maxOnly")) { |
| 67 | 67 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "maxOnly"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 68 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "maxOnly")) > 3) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 68 | 69 | list_t * x1 = list_create(false, NULL); |
| 69 | 70 | if (NULL != x1) { |
| 70 | 71 | cJSON * e1 = NULL; |
| @@ -85,6 +86,8 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 85 | 86 | if (!cJSON_HasObjectItem(j, "minAndMax")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 86 | 87 | if (cJSON_HasObjectItem(j, "minAndMax")) { |
| 87 | 88 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "minAndMax"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 89 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "minAndMax")) < 1) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 90 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "minAndMax")) > 4) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 88 | 91 | list_t * x1 = list_create(false, NULL); |
| 89 | 92 | if (NULL != x1) { |
| 90 | 93 | cJSON * e1 = NULL; |
| @@ -105,6 +108,7 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 105 | 108 | if (!cJSON_HasObjectItem(j, "minOnly")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 106 | 109 | if (cJSON_HasObjectItem(j, "minOnly")) { |
| 107 | 110 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "minOnly"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 111 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "minOnly")) < 2) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 108 | 112 | list_t * x1 = list_create(false, NULL); |
| 109 | 113 | if (NULL != x1) { |
| 110 | 114 | cJSON * e1 = NULL; |
| @@ -137,6 +141,7 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 137 | 141 | if (!cJSON_HasObjectItem(j, "unionItems")) { cJSON_DeleteTopLevel(x); return NULL; } |
| 138 | 142 | if (cJSON_HasObjectItem(j, "unionItems")) { |
| 139 | 143 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "unionItems"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 144 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "unionItems")) < 2) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 140 | 145 | list_t * x1 = list_create(false, NULL); |
| 141 | 146 | if (NULL != x1) { |
| 142 | 147 | cJSON * e1 = NULL; |
Test case
1 generated file · +6 −0test/inputs/schema/vega-lite.schema
Mschema-cjsondefault / TopLevel.c+6 −0
| @@ -9541,6 +9541,7 @@ struct BinParams * cJSON_GetBinParamsValue(const cJSON * j) { | ||
| 9541 | 9541 | } |
| 9542 | 9542 | if (cJSON_HasObjectItem(j, "divide")) { |
| 9543 | 9543 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "divide"))) { cJSON_DeleteBinParams(x); return NULL; } |
| 9544 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "divide")) < 1) { cJSON_DeleteBinParams(x); return NULL; } | |
| 9544 | 9545 | list_t * x1 = list_create(false, NULL); |
| 9545 | 9546 | if (NULL != x1) { |
| 9546 | 9547 | cJSON * e1 = NULL; |
| @@ -9557,6 +9558,8 @@ struct BinParams * cJSON_GetBinParamsValue(const cJSON * j) { | ||
| 9557 | 9558 | } |
| 9558 | 9559 | if (cJSON_HasObjectItem(j, "extent")) { |
| 9559 | 9560 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "extent"))) { cJSON_DeleteBinParams(x); return NULL; } |
| 9561 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "extent")) < 2) { cJSON_DeleteBinParams(x); return NULL; } | |
| 9562 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "extent")) > 2) { cJSON_DeleteBinParams(x); return NULL; } | |
| 9560 | 9563 | list_t * x1 = list_create(false, NULL); |
| 9561 | 9564 | if (NULL != x1) { |
| 9562 | 9565 | cJSON * e1 = NULL; |
| @@ -9597,6 +9600,7 @@ struct BinParams * cJSON_GetBinParamsValue(const cJSON * j) { | ||
| 9597 | 9600 | } |
| 9598 | 9601 | if (cJSON_HasObjectItem(j, "steps")) { |
| 9599 | 9602 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "steps"))) { cJSON_DeleteBinParams(x); return NULL; } |
| 9603 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "steps")) < 1) { cJSON_DeleteBinParams(x); return NULL; } | |
| 9600 | 9604 | list_t * x1 = list_create(false, NULL); |
| 9601 | 9605 | if (NULL != x1) { |
| 9602 | 9606 | cJSON * e1 = NULL; |
| @@ -10086,6 +10090,8 @@ struct Predicate * cJSON_GetPredicateValue(const cJSON * j) { | ||
| 10086 | 10090 | } |
| 10087 | 10091 | if (cJSON_HasObjectItem(j, "range")) { |
| 10088 | 10092 | if (!cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(j, "range"))) { cJSON_DeletePredicate(x); return NULL; } |
| 10093 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "range")) < 2) { cJSON_DeletePredicate(x); return NULL; } | |
| 10094 | + if (cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(j, "range")) > 2) { cJSON_DeletePredicate(x); return NULL; } | |
| 10089 | 10095 | list_t * x1 = list_create(false, NULL); |
| 10090 | 10096 | if (NULL != x1) { |
| 10091 | 10097 | cJSON * e1 = NULL; |
No generated files match these filters.