Test case
1 generated file · +10 −0test/inputs/schema/minmaxlength.schema
Mschema-objective-cdefault / QTTopLevel.m+10 −0
| @@ -83,6 +83,16 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 83 | 83 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 84 | 84 | { |
| 85 | 85 | if (self = [super init]) { |
| 86 | + if (dict[@"intersection"] && [dict[@"intersection"] length] < 4) return nil; | |
| 87 | + if ([dict[@"intersection"] length] > 5) return nil; | |
| 88 | + if ([dict[@"maxlength"] length] > 5) return nil; | |
| 89 | + if (dict[@"minlength"] && [dict[@"minlength"] length] < 3) return nil; | |
| 90 | + if (dict[@"minMaxIntersection"] && [dict[@"minMaxIntersection"] length] < 3) return nil; | |
| 91 | + if ([dict[@"minMaxIntersection"] length] > 5) return nil; | |
| 92 | + if (dict[@"minmaxlength"] && [dict[@"minmaxlength"] length] < 3) return nil; | |
| 93 | + if ([dict[@"minmaxlength"] length] > 5) return nil; | |
| 94 | + if (dict[@"union"] && [dict[@"union"] length] < 3) return nil; | |
| 95 | + if ([dict[@"union"] length] > 6) return nil; | |
| 86 | 96 | [self setValuesForKeysWithDictionary:dict]; |
| 87 | 97 | } |
| 88 | 98 | return self; |
Test case
1 generated file · +4 −0test/inputs/schema/optional-const-ref.schema
Mschema-objective-cdefault / QTTopLevel.m+4 −0
| @@ -99,7 +99,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 99 | 99 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 100 | 100 | { |
| 101 | 101 | if (self = [super init]) { |
| 102 | + if (dict[@"label"] && [dict[@"label"] length] < 2) return nil; | |
| 103 | + if ([dict[@"label"] length] > 16) return nil; | |
| 102 | 104 | if (![dict[@"requiredCoordinates"] isKindOfClass:NSArray.class]) return nil; |
| 105 | + if (dict[@"requiredLabel"] && [dict[@"requiredLabel"] length] < 2) return nil; | |
| 106 | + if ([dict[@"requiredLabel"] length] > 16) return nil; | |
| 103 | 107 | [self setValuesForKeysWithDictionary:dict]; |
| 104 | 108 | _coordinates = map(_coordinates, λ(id x, [QTCoordinate fromJSONDictionary:x])); |
| 105 | 109 | _requiredCoordinates = map(_requiredCoordinates, λ(id x, [QTCoordinate fromJSONDictionary:x])); |
Test case
1 generated file · +2 −0test/inputs/schema/optional-constraints.schema
Mschema-objective-cdefault / QTTopLevel.m+2 −0
| @@ -80,6 +80,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 80 | 80 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 81 | 81 | { |
| 82 | 82 | if (self = [super init]) { |
| 83 | + if (dict[@"optString"] && [dict[@"optString"] length] < 3) return nil; | |
| 84 | + if ([dict[@"optString"] length] > 10) return nil; | |
| 83 | 85 | [self setValuesForKeysWithDictionary:dict]; |
| 84 | 86 | } |
| 85 | 87 | return self; |
Test case
1 generated file · +2 −0test/inputs/schema/renaming-bug.schema
Mschema-objective-cdefault / QTTopLevel.m+2 −0
| @@ -341,6 +341,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 341 | 341 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 342 | 342 | { |
| 343 | 343 | if (self = [super init]) { |
| 344 | + if (dict[@"name"] && [dict[@"name"] length] < 1) return nil; | |
| 344 | 345 | [self setValuesForKeysWithDictionary:dict]; |
| 345 | 346 | _color = [QTColor fromJSONDictionary:(id)_color]; |
| 346 | 347 | _shapes = map(_shapes, λ(id x, [QTShape fromJSONDictionary:x])); |
| @@ -704,6 +705,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 704 | 705 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 705 | 706 | { |
| 706 | 707 | if (self = [super init]) { |
| 708 | + if (dict[@"id"] && [dict[@"id"] length] < 1) return nil; | |
| 707 | 709 | [self setValuesForKeysWithDictionary:dict]; |
| 708 | 710 | _speed = [QTSpeed fromJSONDictionary:(id)_speed]; |
| 709 | 711 | _type = [QTVehicleType fromJSONDictionary:(id)_type]; |
Test case
1 generated file · +2 −0test/inputs/schema/schema-constraints.schema
Mschema-objective-cdefault / QTTopLevel.m+2 −0
| @@ -77,6 +77,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 77 | 77 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 78 | 78 | { |
| 79 | 79 | if (self = [super init]) { |
| 80 | + if (dict[@"minMaxLength"] && [dict[@"minMaxLength"] length] < 5) return nil; | |
| 81 | + if ([dict[@"minMaxLength"] length] > 5) return nil; | |
| 80 | 82 | [self setValuesForKeysWithDictionary:dict]; |
| 81 | 83 | } |
| 82 | 84 | return self; |
No generated files match these filters.