Test case
1 generated file · +14 −0test/inputs/schema/integer-type.schema
Mschema-pikedefault / TopLevel.pmod+14 −0
| @@ -43,13 +43,27 @@ class TopLevel { | ||
| 43 | 43 | TopLevel TopLevel_from_JSON(mixed json) { |
| 44 | 44 | TopLevel retval = TopLevel(); |
| 45 | 45 | |
| 46 | + if (json["above_i32_max"] < 0) error("Value below minimum"); | |
| 47 | + if (json["above_i32_max"] > 2147483648) error("Value above maximum"); | |
| 46 | 48 | retval.above_i32_max = json["above_i32_max"]; |
| 49 | + if (json["below_i32_min"] < -2147483649) error("Value below minimum"); | |
| 50 | + if (json["below_i32_min"] > 0) error("Value above maximum"); | |
| 47 | 51 | retval.below_i32_min = json["below_i32_min"]; |
| 52 | + if (json["i32_range"] < -2147483648) error("Value below minimum"); | |
| 53 | + if (json["i32_range"] > 2147483647) error("Value above maximum"); | |
| 48 | 54 | retval.i32_range = json["i32_range"]; |
| 55 | + if (json["large_bounds"] < -9007199254740991) error("Value below minimum"); | |
| 56 | + if (json["large_bounds"] > 9007199254740991) error("Value above maximum"); | |
| 49 | 57 | retval.large_bounds = json["large_bounds"]; |
| 58 | + if (json["only_maximum"] > 0) error("Value above maximum"); | |
| 50 | 59 | retval.only_maximum = json["only_maximum"]; |
| 60 | + if (json["only_minimum"] < 0) error("Value below minimum"); | |
| 51 | 61 | retval.only_minimum = json["only_minimum"]; |
| 62 | + if (json["small_negative"] < -100) error("Value below minimum"); | |
| 63 | + if (json["small_negative"] > 0) error("Value above maximum"); | |
| 52 | 64 | retval.small_negative = json["small_negative"]; |
| 65 | + if (json["small_positive"] < 0) error("Value below minimum"); | |
| 66 | + if (json["small_positive"] > 100) error("Value above maximum"); | |
| 53 | 67 | retval.small_positive = json["small_positive"]; |
| 54 | 68 | retval.unbounded = json["unbounded"]; |
Test case
1 generated file · +10 −0test/inputs/schema/minmax-integer.schema
Mschema-pikedefault / TopLevel.pmod+10 −0
| @@ -42,12 +42,22 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 42 | 42 | TopLevel retval = TopLevel(); |
| 43 | 43 | |
| 44 | 44 | retval.free = json["free"]; |
| 45 | + if (json["intersection"] < 4) error("Value below minimum"); | |
| 46 | + if (json["intersection"] > 5) error("Value above maximum"); | |
| 45 | 47 | retval.intersection = json["intersection"]; |
| 48 | + if (json["max"] > 5) error("Value above maximum"); | |
| 46 | 49 | retval.max = json["max"]; |
| 50 | + if (json["min"] < 3) error("Value below minimum"); | |
| 47 | 51 | retval.min = json["min"]; |
| 52 | + if (json["minmax"] < 3) error("Value below minimum"); | |
| 53 | + if (json["minmax"] > 5) error("Value above maximum"); | |
| 48 | 54 | retval.minmax = json["minmax"]; |
| 55 | + if (json["minMaxIntersection"] < 3) error("Value below minimum"); | |
| 56 | + if (json["minMaxIntersection"] > 5) error("Value above maximum"); | |
| 49 | 57 | retval.min_max_intersection = json["minMaxIntersection"]; |
| 50 | 58 | retval.min_max_union = json["minMaxUnion"]; |
| 59 | + if (json["union"] < 3) error("Value below minimum"); | |
| 60 | + if (json["union"] > 6) error("Value above maximum"); | |
| 51 | 61 | retval.union = json["union"]; |
| 52 | 62 | |
| 53 | 63 | return retval; |
Test case
1 generated file · +64 −0test/inputs/schema/minmax.schema
Aschema-pikedefault / TopLevel.pmod+64 −0
| @@ -0,0 +1,64 @@ | ||
| 1 | +// This source has been automatically generated by quicktype. | |
| 2 | +// ( https://github.com/quicktype/quicktype ) | |
| 3 | +// | |
| 4 | +// To use this code, simply import it into your project as a Pike module. | |
| 5 | +// To JSON-encode your object, you can pass it to `Standards.JSON.encode` | |
| 6 | +// or call `encode_json` on it. | |
| 7 | +// | |
| 8 | +// To decode a JSON string, first pass it to `Standards.JSON.decode`, | |
| 9 | +// and then pass the result to `<YourClass>_from_JSON`. | |
| 10 | +// It will return an instance of <YourClass>. | |
| 11 | +// Bear in mind that these functions have unexpected behavior, | |
| 12 | +// and will likely throw an error, if the JSON string does not | |
| 13 | +// match the expected interface, even if the JSON itself is valid. | |
| 14 | + | |
| 15 | +class TopLevel { | |
| 16 | + float free; // json: "free" | |
| 17 | + float intersection; // json: "intersection" | |
| 18 | + float max; // json: "max" | |
| 19 | + float min; // json: "min" | |
| 20 | + float minmax; // json: "minmax" | |
| 21 | + float min_max_intersection; // json: "minMaxIntersection" | |
| 22 | + float min_max_union; // json: "minMaxUnion" | |
| 23 | + float union; // json: "union" | |
| 24 | + | |
| 25 | + string encode_json() { | |
| 26 | + mapping(string:mixed) json = ([ | |
| 27 | + "free" : free, | |
| 28 | + "intersection" : intersection, | |
| 29 | + "max" : max, | |
| 30 | + "min" : min, | |
| 31 | + "minmax" : minmax, | |
| 32 | + "minMaxIntersection" : min_max_intersection, | |
| 33 | + "minMaxUnion" : min_max_union, | |
| 34 | + "union" : union, | |
| 35 | + ]); | |
| 36 | + | |
| 37 | + return Standards.JSON.encode(json); | |
| 38 | + } | |
| 39 | +} | |
| 40 | + | |
| 41 | +TopLevel TopLevel_from_JSON(mixed json) { | |
| 42 | + TopLevel retval = TopLevel(); | |
| 43 | + | |
| 44 | + retval.free = (float)json["free"]; | |
| 45 | + if (json["intersection"] < 4) error("Value below minimum"); | |
| 46 | + if (json["intersection"] > 5) error("Value above maximum"); | |
| 47 | + retval.intersection = (float)json["intersection"]; | |
| 48 | + if (json["max"] > 5) error("Value above maximum"); | |
| 49 | + retval.max = (float)json["max"]; | |
| 50 | + if (json["min"] < 3) error("Value below minimum"); | |
| 51 | + retval.min = (float)json["min"]; | |
| 52 | + if (json["minmax"] < 3) error("Value below minimum"); | |
| 53 | + if (json["minmax"] > 5) error("Value above maximum"); | |
| 54 | + retval.minmax = (float)json["minmax"]; | |
| 55 | + if (json["minMaxIntersection"] < 3) error("Value below minimum"); | |
| 56 | + if (json["minMaxIntersection"] > 5) error("Value above maximum"); | |
| 57 | + retval.min_max_intersection = (float)json["minMaxIntersection"]; | |
| 58 | + retval.min_max_union = (float)json["minMaxUnion"]; | |
| 59 | + if (json["union"] < 3) error("Value below minimum"); | |
| 60 | + if (json["union"] > 6) error("Value above maximum"); | |
| 61 | + retval.union = (float)json["union"]; | |
| 62 | + | |
| 63 | + return retval; | |
| 64 | +} |
Test case
1 generated file · +6 −0test/inputs/schema/optional-const-ref.schema
Mschema-pikedefault / TopLevel.pmod+6 −0
| @@ -40,11 +40,17 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | 42 | retval.coordinates = json["coordinates"]; |
| 43 | + if (json["count"] < 1) error("Value below minimum"); | |
| 44 | + if (json["count"] > 100) error("Value above maximum"); | |
| 43 | 45 | retval.count = json["count"]; |
| 44 | 46 | retval.label = json["label"]; |
| 45 | 47 | retval.required_coordinates = json["requiredCoordinates"]; |
| 48 | + if (json["requiredCount"] < 1) error("Value below minimum"); | |
| 49 | + if (json["requiredCount"] > 100) error("Value above maximum"); | |
| 46 | 50 | retval.required_count = json["requiredCount"]; |
| 47 | 51 | retval.required_label = json["requiredLabel"]; |
| 52 | + if (json["weight"] < 0.5) error("Value below minimum"); | |
| 53 | + if (json["weight"] > 99.5) error("Value above maximum"); | |
| 48 | 54 | retval.weight = json["weight"]; |
| 49 | 55 | |
| 50 | 56 | return retval; |
Test case
1 generated file · +6 −0test/inputs/schema/optional-constraints.schema
Mschema-pikedefault / TopLevel.pmod+6 −0
| @@ -35,10 +35,16 @@ class TopLevel { | ||
| 35 | 35 | TopLevel TopLevel_from_JSON(mixed json) { |
| 36 | 36 | TopLevel retval = TopLevel(); |
| 37 | 37 | |
| 38 | + if (json["optDouble"] < 0.5) error("Value below minimum"); | |
| 39 | + if (json["optDouble"] > 99.5) error("Value above maximum"); | |
| 38 | 40 | retval.opt_double = json["optDouble"]; |
| 41 | + if (json["optInt"] < 0) error("Value below minimum"); | |
| 42 | + if (json["optInt"] > 100) error("Value above maximum"); | |
| 39 | 43 | retval.opt_int = json["optInt"]; |
| 40 | 44 | retval.opt_pattern = json["optPattern"]; |
| 41 | 45 | retval.opt_string = json["optString"]; |
| 46 | + if (json["reqZeroMin"] < 0) error("Value below minimum"); | |
| 47 | + if (json["reqZeroMin"] > 100) error("Value above maximum"); | |
| 42 | 48 | retval.req_zero_min = json["reqZeroMin"]; |
| 43 | 49 | |
| 44 | 50 | return retval; |
Test case
1 generated file · +2 −0test/inputs/schema/schema-constraints.schema
Mschema-pikedefault / TopLevel.pmod+2 −0
| @@ -30,6 +30,8 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 30 | 30 | TopLevel retval = TopLevel(); |
| 31 | 31 | |
| 32 | 32 | retval.min_max_length = json["minMaxLength"]; |
| 33 | + if (json["percent"] < 0) error("Value below minimum"); | |
| 34 | + if (json["percent"] > 1) error("Value above maximum"); | |
| 33 | 35 | retval.percent = (float)json["percent"]; |
| 34 | 36 | |
| 35 | 37 | return retval; |
Test case
1 generated file · +161 −0test/inputs/schema/vega-lite.schema
Mschema-pikedefault / TopLevel.pmod+161 −0
| @@ -384,6 +384,8 @@ MarkConfig MarkConfig_from_JSON(mixed json) { | ||
| 384 | 384 | MarkConfig retval = MarkConfig(); |
| 385 | 385 | |
| 386 | 386 | retval.align = HorizontalAlign_from_JSON(json["align"]); |
| 387 | + if (json["angle"] < 0) error("Value below minimum"); | |
| 388 | + if (json["angle"] > 360) error("Value above maximum"); | |
| 387 | 389 | retval.angle = json["angle"]; |
| 388 | 390 | retval.baseline = VerticalAlign_from_JSON(json["baseline"]); |
| 389 | 391 | retval.color = json["color"]; |
| @@ -392,8 +394,11 @@ MarkConfig MarkConfig_from_JSON(mixed json) { | ||
| 392 | 394 | retval.dy = json["dy"]; |
| 393 | 395 | retval.fill = json["fill"]; |
| 394 | 396 | retval.filled = json["filled"]; |
| 397 | + if (json["fillOpacity"] < 0) error("Value below minimum"); | |
| 398 | + if (json["fillOpacity"] > 1) error("Value above maximum"); | |
| 395 | 399 | retval.fill_opacity = json["fillOpacity"]; |
| 396 | 400 | retval.font = json["font"]; |
| 401 | + if (json["fontSize"] < 0) error("Value below minimum"); | |
| 397 | 402 | retval.font_size = json["fontSize"]; |
| 398 | 403 | retval.font_style = FontStyle_from_JSON(json["fontStyle"]); |
| 399 | 404 | if (arrayp(json["fontWeight"])) error("Unexpected array"); |
| @@ -401,16 +406,25 @@ MarkConfig MarkConfig_from_JSON(mixed json) { | ||
| 401 | 406 | retval.href = json["href"]; |
| 402 | 407 | retval.interpolate = Interpolate_from_JSON(json["interpolate"]); |
| 403 | 408 | retval.limit = json["limit"]; |
| 409 | + if (json["opacity"] < 0) error("Value below minimum"); | |
| 410 | + if (json["opacity"] > 1) error("Value above maximum"); | |
| 404 | 411 | retval.opacity = json["opacity"]; |
| 405 | 412 | retval.orient = Orient_from_JSON(json["orient"]); |
| 413 | + if (json["radius"] < 0) error("Value below minimum"); | |
| 406 | 414 | retval.radius = json["radius"]; |
| 407 | 415 | retval.shape = json["shape"]; |
| 416 | + if (json["size"] < 0) error("Value below minimum"); | |
| 408 | 417 | retval.size = json["size"]; |
| 409 | 418 | retval.stroke = json["stroke"]; |
| 410 | 419 | retval.stroke_dash = json["strokeDash"]; |
| 411 | 420 | retval.stroke_dash_offset = json["strokeDashOffset"]; |
| 421 | + if (json["strokeOpacity"] < 0) error("Value below minimum"); | |
| 422 | + if (json["strokeOpacity"] > 1) error("Value above maximum"); | |
| 412 | 423 | retval.stroke_opacity = json["strokeOpacity"]; |
| 424 | + if (json["strokeWidth"] < 0) error("Value below minimum"); | |
| 413 | 425 | retval.stroke_width = json["strokeWidth"]; |
| 426 | + if (json["tension"] < 0) error("Value below minimum"); | |
| 427 | + if (json["tension"] > 1) error("Value above maximum"); | |
| 414 | 428 | retval.tension = json["tension"]; |
| 415 | 429 | retval.text = json["text"]; |
| 416 | 430 | retval.theta = json["theta"]; |
| @@ -638,8 +652,13 @@ AxisConfig AxisConfig_from_JSON(mixed json) { | ||
| 638 | 652 | retval.grid = json["grid"]; |
| 639 | 653 | retval.grid_color = json["gridColor"]; |
| 640 | 654 | retval.grid_dash = json["gridDash"]; |
| 655 | + if (json["gridOpacity"] < 0) error("Value below minimum"); | |
| 656 | + if (json["gridOpacity"] > 1) error("Value above maximum"); | |
| 641 | 657 | retval.grid_opacity = json["gridOpacity"]; |
| 658 | + if (json["gridWidth"] < 0) error("Value below minimum"); | |
| 642 | 659 | retval.grid_width = json["gridWidth"]; |
| 660 | + if (json["labelAngle"] < -360) error("Value below minimum"); | |
| 661 | + if (json["labelAngle"] > 360) error("Value above maximum"); | |
| 643 | 662 | retval.label_angle = json["labelAngle"]; |
| 644 | 663 | if (arrayp(json["labelBound"])) error("Unexpected array"); |
| 645 | 664 | retval.label_bound = json["labelBound"]; |
| @@ -647,6 +666,7 @@ AxisConfig AxisConfig_from_JSON(mixed json) { | ||
| 647 | 666 | if (arrayp(json["labelFlush"])) error("Unexpected array"); |
| 648 | 667 | retval.label_flush = json["labelFlush"]; |
| 649 | 668 | retval.label_font = json["labelFont"]; |
| 669 | + if (json["labelFontSize"] < 0) error("Value below minimum"); | |
| 650 | 670 | retval.label_font_size = json["labelFontSize"]; |
| 651 | 671 | retval.label_limit = json["labelLimit"]; |
| 652 | 672 | if (arrayp(json["labelOverlap"])) error("Unexpected array"); |
| @@ -659,13 +679,16 @@ AxisConfig AxisConfig_from_JSON(mixed json) { | ||
| 659 | 679 | retval.tick_color = json["tickColor"]; |
| 660 | 680 | retval.tick_round = json["tickRound"]; |
| 661 | 681 | retval.ticks = json["ticks"]; |
| 682 | + if (json["tickSize"] < 0) error("Value below minimum"); | |
| 662 | 683 | retval.tick_size = json["tickSize"]; |
| 684 | + if (json["tickWidth"] < 0) error("Value below minimum"); | |
| 663 | 685 | retval.tick_width = json["tickWidth"]; |
| 664 | 686 | retval.title_align = json["titleAlign"]; |
| 665 | 687 | retval.title_angle = json["titleAngle"]; |
| 666 | 688 | retval.title_baseline = json["titleBaseline"]; |
| 667 | 689 | retval.title_color = json["titleColor"]; |
| 668 | 690 | retval.title_font = json["titleFont"]; |
| 691 | + if (json["titleFontSize"] < 0) error("Value below minimum"); | |
| 669 | 692 | retval.title_font_size = json["titleFontSize"]; |
| 670 | 693 | if (arrayp(json["titleFontWeight"])) error("Unexpected array"); |
| 671 | 694 | retval.title_font_weight = json["titleFontWeight"]; |
| @@ -834,8 +857,13 @@ VgAxisConfig VgAxisConfig_from_JSON(mixed json) { | ||
| 834 | 857 | retval.grid = json["grid"]; |
| 835 | 858 | retval.grid_color = json["gridColor"]; |
| 836 | 859 | retval.grid_dash = json["gridDash"]; |
| 860 | + if (json["gridOpacity"] < 0) error("Value below minimum"); | |
| 861 | + if (json["gridOpacity"] > 1) error("Value above maximum"); | |
| 837 | 862 | retval.grid_opacity = json["gridOpacity"]; |
| 863 | + if (json["gridWidth"] < 0) error("Value below minimum"); | |
| 838 | 864 | retval.grid_width = json["gridWidth"]; |
| 865 | + if (json["labelAngle"] < -360) error("Value below minimum"); | |
| 866 | + if (json["labelAngle"] > 360) error("Value above maximum"); | |
| 839 | 867 | retval.label_angle = json["labelAngle"]; |
| 840 | 868 | if (arrayp(json["labelBound"])) error("Unexpected array"); |
| 841 | 869 | retval.label_bound = json["labelBound"]; |
| @@ -843,6 +871,7 @@ VgAxisConfig VgAxisConfig_from_JSON(mixed json) { | ||
| 843 | 871 | if (arrayp(json["labelFlush"])) error("Unexpected array"); |
| 844 | 872 | retval.label_flush = json["labelFlush"]; |
| 845 | 873 | retval.label_font = json["labelFont"]; |
| 874 | + if (json["labelFontSize"] < 0) error("Value below minimum"); | |
| 846 | 875 | retval.label_font_size = json["labelFontSize"]; |
| 847 | 876 | retval.label_limit = json["labelLimit"]; |
| 848 | 877 | if (arrayp(json["labelOverlap"])) error("Unexpected array"); |
| @@ -854,13 +883,16 @@ VgAxisConfig VgAxisConfig_from_JSON(mixed json) { | ||
| 854 | 883 | retval.tick_color = json["tickColor"]; |
| 855 | 884 | retval.tick_round = json["tickRound"]; |
| 856 | 885 | retval.ticks = json["ticks"]; |
| 886 | + if (json["tickSize"] < 0) error("Value below minimum"); | |
| 857 | 887 | retval.tick_size = json["tickSize"]; |
| 888 | + if (json["tickWidth"] < 0) error("Value below minimum"); | |
| 858 | 889 | retval.tick_width = json["tickWidth"]; |
| 859 | 890 | retval.title_align = json["titleAlign"]; |
| 860 | 891 | retval.title_angle = json["titleAngle"]; |
| 861 | 892 | retval.title_baseline = json["titleBaseline"]; |
| 862 | 893 | retval.title_color = json["titleColor"]; |
| 863 | 894 | retval.title_font = json["titleFont"]; |
| 895 | + if (json["titleFontSize"] < 0) error("Value below minimum"); | |
| 864 | 896 | retval.title_font_size = json["titleFontSize"]; |
| 865 | 897 | if (arrayp(json["titleFontWeight"])) error("Unexpected array"); |
| 866 | 898 | retval.title_font_weight = json["titleFontWeight"]; |
| @@ -954,19 +986,27 @@ BarConfig BarConfig_from_JSON(mixed json) { | ||
| 954 | 986 | BarConfig retval = BarConfig(); |
| 955 | 987 | |
| 956 | 988 | retval.align = HorizontalAlign_from_JSON(json["align"]); |
| 989 | + if (json["angle"] < 0) error("Value below minimum"); | |
| 990 | + if (json["angle"] > 360) error("Value above maximum"); | |
| 957 | 991 | retval.angle = json["angle"]; |
| 958 | 992 | retval.baseline = VerticalAlign_from_JSON(json["baseline"]); |
| 993 | + if (json["binSpacing"] < 0) error("Value below minimum"); | |
| 959 | 994 | retval.bin_spacing = json["binSpacing"]; |
| 960 | 995 | retval.color = json["color"]; |
| 996 | + if (json["continuousBandSize"] < 0) error("Value below minimum"); | |
| 961 | 997 | retval.continuous_band_size = json["continuousBandSize"]; |
| 962 | 998 | retval.cursor = Cursor_from_JSON(json["cursor"]); |
| 999 | + if (json["discreteBandSize"] < 0) error("Value below minimum"); | |
| 963 | 1000 | retval.discrete_band_size = json["discreteBandSize"]; |
| 964 | 1001 | retval.dx = json["dx"]; |
| 965 | 1002 | retval.dy = json["dy"]; |
| 966 | 1003 | retval.fill = json["fill"]; |
| 967 | 1004 | retval.filled = json["filled"]; |
| 1005 | + if (json["fillOpacity"] < 0) error("Value below minimum"); | |
| 1006 | + if (json["fillOpacity"] > 1) error("Value above maximum"); | |
| 968 | 1007 | retval.fill_opacity = json["fillOpacity"]; |
| 969 | 1008 | retval.font = json["font"]; |
| 1009 | + if (json["fontSize"] < 0) error("Value below minimum"); | |
| 970 | 1010 | retval.font_size = json["fontSize"]; |
| 971 | 1011 | retval.font_style = FontStyle_from_JSON(json["fontStyle"]); |
| 972 | 1012 | if (arrayp(json["fontWeight"])) error("Unexpected array"); |
| @@ -974,16 +1014,25 @@ BarConfig BarConfig_from_JSON(mixed json) { | ||
| 974 | 1014 | retval.href = json["href"]; |
| 975 | 1015 | retval.interpolate = Interpolate_from_JSON(json["interpolate"]); |
| 976 | 1016 | retval.limit = json["limit"]; |
| 1017 | + if (json["opacity"] < 0) error("Value below minimum"); | |
| 1018 | + if (json["opacity"] > 1) error("Value above maximum"); | |
| 977 | 1019 | retval.opacity = json["opacity"]; |
| 978 | 1020 | retval.orient = Orient_from_JSON(json["orient"]); |
| 1021 | + if (json["radius"] < 0) error("Value below minimum"); | |
| 979 | 1022 | retval.radius = json["radius"]; |
| 980 | 1023 | retval.shape = json["shape"]; |
| 1024 | + if (json["size"] < 0) error("Value below minimum"); | |
| 981 | 1025 | retval.size = json["size"]; |
| 982 | 1026 | retval.stroke = json["stroke"]; |
| 983 | 1027 | retval.stroke_dash = json["strokeDash"]; |
| 984 | 1028 | retval.stroke_dash_offset = json["strokeDashOffset"]; |
| 1029 | + if (json["strokeOpacity"] < 0) error("Value below minimum"); | |
| 1030 | + if (json["strokeOpacity"] > 1) error("Value above maximum"); | |
| 985 | 1031 | retval.stroke_opacity = json["strokeOpacity"]; |
| 1032 | + if (json["strokeWidth"] < 0) error("Value below minimum"); | |
| 986 | 1033 | retval.stroke_width = json["strokeWidth"]; |
| 1034 | + if (json["tension"] < 0) error("Value below minimum"); | |
| 1035 | + if (json["tension"] > 1) error("Value above maximum"); | |
| 987 | 1036 | retval.tension = json["tension"]; |
| 988 | 1037 | retval.text = json["text"]; |
| 989 | 1038 | retval.theta = json["theta"]; |
| @@ -1100,19 +1149,24 @@ LegendConfig LegendConfig_from_JSON(mixed json) { | ||
| 1100 | 1149 | retval.corner_radius = json["cornerRadius"]; |
| 1101 | 1150 | retval.entry_padding = json["entryPadding"]; |
| 1102 | 1151 | retval.fill_color = json["fillColor"]; |
| 1152 | + if (json["gradientHeight"] < 0) error("Value below minimum"); | |
| 1103 | 1153 | retval.gradient_height = json["gradientHeight"]; |
| 1104 | 1154 | retval.gradient_label_baseline = json["gradientLabelBaseline"]; |
| 1105 | 1155 | retval.gradient_label_limit = json["gradientLabelLimit"]; |
| 1106 | 1156 | retval.gradient_label_offset = json["gradientLabelOffset"]; |
| 1107 | 1157 | retval.gradient_stroke_color = json["gradientStrokeColor"]; |
| 1158 | + if (json["gradientStrokeWidth"] < 0) error("Value below minimum"); | |
| 1108 | 1159 | retval.gradient_stroke_width = json["gradientStrokeWidth"]; |
| 1160 | + if (json["gradientWidth"] < 0) error("Value below minimum"); | |
| 1109 | 1161 | retval.gradient_width = json["gradientWidth"]; |
| 1110 | 1162 | retval.label_align = json["labelAlign"]; |
| 1111 | 1163 | retval.label_baseline = json["labelBaseline"]; |
| 1112 | 1164 | retval.label_color = json["labelColor"]; |
| 1113 | 1165 | retval.label_font = json["labelFont"]; |
| 1166 | + if (json["labelFontSize"] < 0) error("Value below minimum"); | |
| 1114 | 1167 | retval.label_font_size = json["labelFontSize"]; |
| 1115 | 1168 | retval.label_limit = json["labelLimit"]; |
| 1169 | + if (json["labelOffset"] < 0) error("Value below minimum"); | |
| 1116 | 1170 | retval.label_offset = json["labelOffset"]; |
| 1117 | 1171 | retval.offset = json["offset"]; |
| 1118 | 1172 | retval.orient = LegendOrient_from_JSON(json["orient"]); |
| @@ -1122,7 +1176,9 @@ LegendConfig LegendConfig_from_JSON(mixed json) { | ||
| 1122 | 1176 | retval.stroke_dash = json["strokeDash"]; |
| 1123 | 1177 | retval.stroke_width = json["strokeWidth"]; |
| 1124 | 1178 | retval.symbol_color = json["symbolColor"]; |
| 1179 | + if (json["symbolSize"] < 0) error("Value below minimum"); | |
| 1125 | 1180 | retval.symbol_size = json["symbolSize"]; |
| 1181 | + if (json["symbolStrokeWidth"] < 0) error("Value below minimum"); | |
| 1126 | 1182 | retval.symbol_stroke_width = json["symbolStrokeWidth"]; |
| 1127 | 1183 | retval.symbol_type = json["symbolType"]; |
| 1128 | 1184 | retval.title_align = json["titleAlign"]; |
| @@ -1379,23 +1435,43 @@ class ScaleConfig { | ||
| 1379 | 1435 | ScaleConfig ScaleConfig_from_JSON(mixed json) { |
| 1380 | 1436 | ScaleConfig retval = ScaleConfig(); |
| 1381 | 1437 | |
| 1438 | + if (json["bandPaddingInner"] < 0) error("Value below minimum"); | |
| 1439 | + if (json["bandPaddingInner"] > 1) error("Value above maximum"); | |
| 1382 | 1440 | retval.band_padding_inner = json["bandPaddingInner"]; |
| 1441 | + if (json["bandPaddingOuter"] < 0) error("Value below minimum"); | |
| 1442 | + if (json["bandPaddingOuter"] > 1) error("Value above maximum"); | |
| 1383 | 1443 | retval.band_padding_outer = json["bandPaddingOuter"]; |
| 1384 | 1444 | retval.clamp = json["clamp"]; |
| 1445 | + if (json["continuousPadding"] < 0) error("Value below minimum"); | |
| 1385 | 1446 | retval.continuous_padding = json["continuousPadding"]; |
| 1447 | + if (json["maxBandSize"] < 0) error("Value below minimum"); | |
| 1386 | 1448 | retval.max_band_size = json["maxBandSize"]; |
| 1449 | + if (json["maxFontSize"] < 0) error("Value below minimum"); | |
| 1387 | 1450 | retval.max_font_size = json["maxFontSize"]; |
| 1451 | + if (json["maxOpacity"] < 0) error("Value below minimum"); | |
| 1452 | + if (json["maxOpacity"] > 1) error("Value above maximum"); | |
| 1388 | 1453 | retval.max_opacity = json["maxOpacity"]; |
| 1454 | + if (json["maxSize"] < 0) error("Value below minimum"); | |
| 1389 | 1455 | retval.max_size = json["maxSize"]; |
| 1456 | + if (json["maxStrokeWidth"] < 0) error("Value below minimum"); | |
| 1390 | 1457 | retval.max_stroke_width = json["maxStrokeWidth"]; |
| 1458 | + if (json["minBandSize"] < 0) error("Value below minimum"); | |
| 1391 | 1459 | retval.min_band_size = json["minBandSize"]; |
| 1460 | + if (json["minFontSize"] < 0) error("Value below minimum"); | |
| 1392 | 1461 | retval.min_font_size = json["minFontSize"]; |
| 1462 | + if (json["minOpacity"] < 0) error("Value below minimum"); | |
| 1463 | + if (json["minOpacity"] > 1) error("Value above maximum"); | |
| 1393 | 1464 | retval.min_opacity = json["minOpacity"]; |
| 1465 | + if (json["minSize"] < 0) error("Value below minimum"); | |
| 1394 | 1466 | retval.min_size = json["minSize"]; |
| 1467 | + if (json["minStrokeWidth"] < 0) error("Value below minimum"); | |
| 1395 | 1468 | retval.min_stroke_width = json["minStrokeWidth"]; |
| 1469 | + if (json["pointPadding"] < 0) error("Value below minimum"); | |
| 1470 | + if (json["pointPadding"] > 1) error("Value above maximum"); | |
| 1396 | 1471 | retval.point_padding = json["pointPadding"]; |
| 1397 | 1472 | retval.range_step = json["rangeStep"]; |
| 1398 | 1473 | retval.round = json["round"]; |
| 1474 | + if (json["textXRangeStep"] < 0) error("Value below minimum"); | |
| 1399 | 1475 | retval.text_x_range_step = json["textXRangeStep"]; |
| 1400 | 1476 | retval.use_unaggregated_domain = json["useUnaggregatedDomain"]; |
| 1401 | 1477 | |
| @@ -1804,14 +1880,19 @@ VgMarkConfig VgMarkConfig_from_JSON(mixed json) { | ||
| 1804 | 1880 | VgMarkConfig retval = VgMarkConfig(); |
| 1805 | 1881 | |
| 1806 | 1882 | retval.align = HorizontalAlign_from_JSON(json["align"]); |
| 1883 | + if (json["angle"] < 0) error("Value below minimum"); | |
| 1884 | + if (json["angle"] > 360) error("Value above maximum"); | |
| 1807 | 1885 | retval.angle = json["angle"]; |
| 1808 | 1886 | retval.baseline = VerticalAlign_from_JSON(json["baseline"]); |
| 1809 | 1887 | retval.cursor = Cursor_from_JSON(json["cursor"]); |
| 1810 | 1888 | retval.dx = json["dx"]; |
| 1811 | 1889 | retval.dy = json["dy"]; |
| 1812 | 1890 | retval.fill = json["fill"]; |
| 1891 | + if (json["fillOpacity"] < 0) error("Value below minimum"); | |
| 1892 | + if (json["fillOpacity"] > 1) error("Value above maximum"); | |
| 1813 | 1893 | retval.fill_opacity = json["fillOpacity"]; |
| 1814 | 1894 | retval.font = json["font"]; |
| 1895 | + if (json["fontSize"] < 0) error("Value below minimum"); | |
| 1815 | 1896 | retval.font_size = json["fontSize"]; |
| 1816 | 1897 | retval.font_style = FontStyle_from_JSON(json["fontStyle"]); |
| 1817 | 1898 | if (arrayp(json["fontWeight"])) error("Unexpected array"); |
| @@ -1819,16 +1900,25 @@ VgMarkConfig VgMarkConfig_from_JSON(mixed json) { | ||
| 1819 | 1900 | retval.href = json["href"]; |
| 1820 | 1901 | retval.interpolate = Interpolate_from_JSON(json["interpolate"]); |
| 1821 | 1902 | retval.limit = json["limit"]; |
| 1903 | + if (json["opacity"] < 0) error("Value below minimum"); | |
| 1904 | + if (json["opacity"] > 1) error("Value above maximum"); | |
| 1822 | 1905 | retval.opacity = json["opacity"]; |
| 1823 | 1906 | retval.orient = Orient_from_JSON(json["orient"]); |
| 1907 | + if (json["radius"] < 0) error("Value below minimum"); | |
| 1824 | 1908 | retval.radius = json["radius"]; |
| 1825 | 1909 | retval.shape = json["shape"]; |
| 1910 | + if (json["size"] < 0) error("Value below minimum"); | |
| 1826 | 1911 | retval.size = json["size"]; |
| 1827 | 1912 | retval.stroke = json["stroke"]; |
| 1828 | 1913 | retval.stroke_dash = json["strokeDash"]; |
| 1829 | 1914 | retval.stroke_dash_offset = json["strokeDashOffset"]; |
| 1915 | + if (json["strokeOpacity"] < 0) error("Value below minimum"); | |
| 1916 | + if (json["strokeOpacity"] > 1) error("Value above maximum"); | |
| 1830 | 1917 | retval.stroke_opacity = json["strokeOpacity"]; |
| 1918 | + if (json["strokeWidth"] < 0) error("Value below minimum"); | |
| 1831 | 1919 | retval.stroke_width = json["strokeWidth"]; |
| 1920 | + if (json["tension"] < 0) error("Value below minimum"); | |
| 1921 | + if (json["tension"] > 1) error("Value above maximum"); | |
| 1832 | 1922 | retval.tension = json["tension"]; |
| 1833 | 1923 | retval.text = json["text"]; |
| 1834 | 1924 | retval.theta = json["theta"]; |
| @@ -1913,6 +2003,8 @@ TextConfig TextConfig_from_JSON(mixed json) { | ||
| 1913 | 2003 | TextConfig retval = TextConfig(); |
| 1914 | 2004 | |
| 1915 | 2005 | retval.align = HorizontalAlign_from_JSON(json["align"]); |
| 2006 | + if (json["angle"] < 0) error("Value below minimum"); | |
| 2007 | + if (json["angle"] > 360) error("Value above maximum"); | |
| 1916 | 2008 | retval.angle = json["angle"]; |
| 1917 | 2009 | retval.baseline = VerticalAlign_from_JSON(json["baseline"]); |
| 1918 | 2010 | retval.color = json["color"]; |
| @@ -1921,8 +2013,11 @@ TextConfig TextConfig_from_JSON(mixed json) { | ||
| 1921 | 2013 | retval.dy = json["dy"]; |
| 1922 | 2014 | retval.fill = json["fill"]; |
| 1923 | 2015 | retval.filled = json["filled"]; |
| 2016 | + if (json["fillOpacity"] < 0) error("Value below minimum"); | |
| 2017 | + if (json["fillOpacity"] > 1) error("Value above maximum"); | |
| 1924 | 2018 | retval.fill_opacity = json["fillOpacity"]; |
| 1925 | 2019 | retval.font = json["font"]; |
| 2020 | + if (json["fontSize"] < 0) error("Value below minimum"); | |
| 1926 | 2021 | retval.font_size = json["fontSize"]; |
| 1927 | 2022 | retval.font_style = FontStyle_from_JSON(json["fontStyle"]); |
| 1928 | 2023 | if (arrayp(json["fontWeight"])) error("Unexpected array"); |
| @@ -1930,17 +2025,26 @@ TextConfig TextConfig_from_JSON(mixed json) { | ||
| 1930 | 2025 | retval.href = json["href"]; |
| 1931 | 2026 | retval.interpolate = Interpolate_from_JSON(json["interpolate"]); |
| 1932 | 2027 | retval.limit = json["limit"]; |
| 2028 | + if (json["opacity"] < 0) error("Value below minimum"); | |
| 2029 | + if (json["opacity"] > 1) error("Value above maximum"); | |
| 1933 | 2030 | retval.opacity = json["opacity"]; |
| 1934 | 2031 | retval.orient = Orient_from_JSON(json["orient"]); |
| 2032 | + if (json["radius"] < 0) error("Value below minimum"); | |
| 1935 | 2033 | retval.radius = json["radius"]; |
| 1936 | 2034 | retval.shape = json["shape"]; |
| 1937 | 2035 | retval.short_time_labels = json["shortTimeLabels"]; |
| 2036 | + if (json["size"] < 0) error("Value below minimum"); | |
| 1938 | 2037 | retval.size = json["size"]; |
| 1939 | 2038 | retval.stroke = json["stroke"]; |
| 1940 | 2039 | retval.stroke_dash = json["strokeDash"]; |
| 1941 | 2040 | retval.stroke_dash_offset = json["strokeDashOffset"]; |
| 2041 | + if (json["strokeOpacity"] < 0) error("Value below minimum"); | |
| 2042 | + if (json["strokeOpacity"] > 1) error("Value above maximum"); | |
| 1942 | 2043 | retval.stroke_opacity = json["strokeOpacity"]; |
| 2044 | + if (json["strokeWidth"] < 0) error("Value below minimum"); | |
| 1943 | 2045 | retval.stroke_width = json["strokeWidth"]; |
| 2046 | + if (json["tension"] < 0) error("Value below minimum"); | |
| 2047 | + if (json["tension"] > 1) error("Value above maximum"); | |
| 1944 | 2048 | retval.tension = json["tension"]; |
| 1945 | 2049 | retval.text = json["text"]; |
| 1946 | 2050 | retval.theta = json["theta"]; |
| @@ -2027,7 +2131,10 @@ TickConfig TickConfig_from_JSON(mixed json) { | ||
| 2027 | 2131 | TickConfig retval = TickConfig(); |
| 2028 | 2132 | |
| 2029 | 2133 | retval.align = HorizontalAlign_from_JSON(json["align"]); |
| 2134 | + if (json["angle"] < 0) error("Value below minimum"); | |
| 2135 | + if (json["angle"] > 360) error("Value above maximum"); | |
| 2030 | 2136 | retval.angle = json["angle"]; |
| 2137 | + if (json["bandSize"] < 0) error("Value below minimum"); | |
| 2031 | 2138 | retval.band_size = json["bandSize"]; |
| 2032 | 2139 | retval.baseline = VerticalAlign_from_JSON(json["baseline"]); |
| 2033 | 2140 | retval.color = json["color"]; |
| @@ -2036,8 +2143,11 @@ TickConfig TickConfig_from_JSON(mixed json) { | ||
| 2036 | 2143 | retval.dy = json["dy"]; |
| 2037 | 2144 | retval.fill = json["fill"]; |
| 2038 | 2145 | retval.filled = json["filled"]; |
| 2146 | + if (json["fillOpacity"] < 0) error("Value below minimum"); | |
| 2147 | + if (json["fillOpacity"] > 1) error("Value above maximum"); | |
| 2039 | 2148 | retval.fill_opacity = json["fillOpacity"]; |
| 2040 | 2149 | retval.font = json["font"]; |
| 2150 | + if (json["fontSize"] < 0) error("Value below minimum"); | |
| 2041 | 2151 | retval.font_size = json["fontSize"]; |
| 2042 | 2152 | retval.font_style = FontStyle_from_JSON(json["fontStyle"]); |
| 2043 | 2153 | if (arrayp(json["fontWeight"])) error("Unexpected array"); |
| @@ -2045,19 +2155,29 @@ TickConfig TickConfig_from_JSON(mixed json) { | ||
| 2045 | 2155 | retval.href = json["href"]; |
| 2046 | 2156 | retval.interpolate = Interpolate_from_JSON(json["interpolate"]); |
| 2047 | 2157 | retval.limit = json["limit"]; |
| 2158 | + if (json["opacity"] < 0) error("Value below minimum"); | |
| 2159 | + if (json["opacity"] > 1) error("Value above maximum"); | |
| 2048 | 2160 | retval.opacity = json["opacity"]; |
| 2049 | 2161 | retval.orient = Orient_from_JSON(json["orient"]); |
| 2162 | + if (json["radius"] < 0) error("Value below minimum"); | |
| 2050 | 2163 | retval.radius = json["radius"]; |
| 2051 | 2164 | retval.shape = json["shape"]; |
| 2165 | + if (json["size"] < 0) error("Value below minimum"); | |
| 2052 | 2166 | retval.size = json["size"]; |
| 2053 | 2167 | retval.stroke = json["stroke"]; |
| 2054 | 2168 | retval.stroke_dash = json["strokeDash"]; |
| 2055 | 2169 | retval.stroke_dash_offset = json["strokeDashOffset"]; |
| 2170 | + if (json["strokeOpacity"] < 0) error("Value below minimum"); | |
| 2171 | + if (json["strokeOpacity"] > 1) error("Value above maximum"); | |
| 2056 | 2172 | retval.stroke_opacity = json["strokeOpacity"]; |
| 2173 | + if (json["strokeWidth"] < 0) error("Value below minimum"); | |
| 2057 | 2174 | retval.stroke_width = json["strokeWidth"]; |
| 2175 | + if (json["tension"] < 0) error("Value below minimum"); | |
| 2176 | + if (json["tension"] > 1) error("Value above maximum"); | |
| 2058 | 2177 | retval.tension = json["tension"]; |
| 2059 | 2178 | retval.text = json["text"]; |
| 2060 | 2179 | retval.theta = json["theta"]; |
| 2180 | + if (json["thickness"] < 0) error("Value below minimum"); | |
| 2061 | 2181 | retval.thickness = json["thickness"]; |
| 2062 | 2182 | |
| 2063 | 2183 | return retval; |
| @@ -2104,9 +2224,11 @@ VgTitleConfig VgTitleConfig_from_JSON(mixed json) { | ||
| 2104 | 2224 | retval.baseline = VerticalAlign_from_JSON(json["baseline"]); |
| 2105 | 2225 | retval.color = json["color"]; |
| 2106 | 2226 | retval.font = json["font"]; |
| 2227 | + if (json["fontSize"] < 0) error("Value below minimum"); | |
| 2107 | 2228 | retval.font_size = json["fontSize"]; |
| 2108 | 2229 | if (arrayp(json["fontWeight"])) error("Unexpected array"); |
| 2109 | 2230 | retval.font_weight = json["fontWeight"]; |
| 2231 | + if (json["limit"] < 0) error("Value below minimum"); | |
| 2110 | 2232 | retval.limit = json["limit"]; |
| 2111 | 2233 | retval.offset = json["offset"]; |
| 2112 | 2234 | retval.orient = TitleOrient_from_JSON(json["orient"]); |
| @@ -2516,6 +2638,7 @@ BinParams BinParams_from_JSON(mixed json) { | ||
| 2516 | 2638 | retval.base = json["base"]; |
| 2517 | 2639 | retval.divide = json["divide"]; |
| 2518 | 2640 | retval.extent = json["extent"]; |
| 2641 | + if (json["maxbins"] < 2) error("Value below minimum"); | |
| 2519 | 2642 | retval.maxbins = json["maxbins"]; |
| 2520 | 2643 | retval.minstep = json["minstep"]; |
| 2521 | 2644 | retval.nice = json["nice"]; |
| @@ -2726,15 +2849,27 @@ class DateTime { | ||
| 2726 | 2849 | DateTime DateTime_from_JSON(mixed json) { |
| 2727 | 2850 | DateTime retval = DateTime(); |
| 2728 | 2851 | |
| 2852 | + if (json["date"] < 1) error("Value below minimum"); | |
| 2853 | + if (json["date"] > 31) error("Value above maximum"); | |
| 2729 | 2854 | retval.date = json["date"]; |
| 2730 | 2855 | if (arrayp(json["day"])) error("Unexpected array"); |
| 2731 | 2856 | retval.day = json["day"]; |
| 2857 | + if (json["hours"] < 0) error("Value below minimum"); | |
| 2858 | + if (json["hours"] > 23) error("Value above maximum"); | |
| 2732 | 2859 | retval.hours = json["hours"]; |
| 2860 | + if (json["milliseconds"] < 0) error("Value below minimum"); | |
| 2861 | + if (json["milliseconds"] > 999) error("Value above maximum"); | |
| 2733 | 2862 | retval.milliseconds = json["milliseconds"]; |
| 2863 | + if (json["minutes"] < 0) error("Value below minimum"); | |
| 2864 | + if (json["minutes"] > 59) error("Value above maximum"); | |
| 2734 | 2865 | retval.minutes = json["minutes"]; |
| 2735 | 2866 | if (arrayp(json["month"])) error("Unexpected array"); |
| 2736 | 2867 | retval.month = json["month"]; |
| 2868 | + if (json["quarter"] < 1) error("Value below minimum"); | |
| 2869 | + if (json["quarter"] > 4) error("Value above maximum"); | |
| 2737 | 2870 | retval.quarter = json["quarter"]; |
| 2871 | + if (json["seconds"] < 0) error("Value below minimum"); | |
| 2872 | + if (json["seconds"] > 59) error("Value above maximum"); | |
| 2738 | 2873 | retval.seconds = json["seconds"]; |
| 2739 | 2874 | retval.utc = json["utc"]; |
| 2740 | 2875 | retval.year = json["year"]; |
| @@ -2971,6 +3106,7 @@ Legend Legend_from_JSON(mixed json) { | ||
| 2971 | 3106 | retval.title = json["title"]; |
| 2972 | 3107 | retval.type = LegendType_from_JSON(json["type"]); |
| 2973 | 3108 | retval.values = json["values"]; |
| 3109 | + if (json["zindex"] < 0) error("Value below minimum"); | |
| 2974 | 3110 | retval.zindex = json["zindex"]; |
| 2975 | 3111 | |
| 2976 | 3112 | return retval; |
| @@ -3047,8 +3183,13 @@ Scale Scale_from_JSON(mixed json) { | ||
| 3047 | 3183 | retval.interpolate = json["interpolate"]; |
| 3048 | 3184 | if (arrayp(json["nice"])) error("Unexpected array"); |
| 3049 | 3185 | retval.nice = json["nice"]; |
| 3186 | + if (json["padding"] < 0) error("Value below minimum"); | |
| 3050 | 3187 | retval.padding = json["padding"]; |
| 3188 | + if (json["paddingInner"] < 0) error("Value below minimum"); | |
| 3189 | + if (json["paddingInner"] > 1) error("Value above maximum"); | |
| 3051 | 3190 | retval.padding_inner = json["paddingInner"]; |
| 3191 | + if (json["paddingOuter"] < 0) error("Value below minimum"); | |
| 3192 | + if (json["paddingOuter"] > 1) error("Value above maximum"); | |
| 3052 | 3193 | retval.padding_outer = json["paddingOuter"]; |
| 3053 | 3194 | retval.range = json["range"]; |
| 3054 | 3195 | retval.range_step = json["rangeStep"]; |
| @@ -3448,6 +3589,8 @@ Header Header_from_JSON(mixed json) { | ||
| 3448 | 3589 | Header retval = Header(); |
| 3449 | 3590 | |
| 3450 | 3591 | retval.format = json["format"]; |
| 3592 | + if (json["labelAngle"] < -360) error("Value below minimum"); | |
| 3593 | + if (json["labelAngle"] > 360) error("Value above maximum"); | |
| 3451 | 3594 | retval.label_angle = json["labelAngle"]; |
| 3452 | 3595 | retval.title = json["title"]; |
| 3453 | 3596 | |
| @@ -3876,6 +4019,8 @@ Axis Axis_from_JSON(mixed json) { | ||
| 3876 | 4019 | retval.domain = json["domain"]; |
| 3877 | 4020 | retval.format = json["format"]; |
| 3878 | 4021 | retval.grid = json["grid"]; |
| 4022 | + if (json["labelAngle"] < -360) error("Value below minimum"); | |
| 4023 | + if (json["labelAngle"] > 360) error("Value above maximum"); | |
| 3879 | 4024 | retval.label_angle = json["labelAngle"]; |
| 3880 | 4025 | if (arrayp(json["labelBound"])) error("Unexpected array"); |
| 3881 | 4026 | retval.label_bound = json["labelBound"]; |
| @@ -3892,11 +4037,13 @@ Axis Axis_from_JSON(mixed json) { | ||
| 3892 | 4037 | retval.position = json["position"]; |
| 3893 | 4038 | retval.tick_count = json["tickCount"]; |
| 3894 | 4039 | retval.ticks = json["ticks"]; |
| 4040 | + if (json["tickSize"] < 0) error("Value below minimum"); | |
| 3895 | 4041 | retval.tick_size = json["tickSize"]; |
| 3896 | 4042 | retval.title = json["title"]; |
| 3897 | 4043 | retval.title_max_length = json["titleMaxLength"]; |
| 3898 | 4044 | retval.title_padding = json["titlePadding"]; |
| 3899 | 4045 | retval.values = json["values"]; |
| 4046 | + if (json["zindex"] < 0) error("Value below minimum"); | |
| 3900 | 4047 | retval.zindex = json["zindex"]; |
| 3901 | 4048 | |
| 3902 | 4049 | return retval; |
| @@ -4258,6 +4405,8 @@ MarkDef MarkDef_from_JSON(mixed json) { | ||
| 4258 | 4405 | MarkDef retval = MarkDef(); |
| 4259 | 4406 | |
| 4260 | 4407 | retval.align = HorizontalAlign_from_JSON(json["align"]); |
| 4408 | + if (json["angle"] < 0) error("Value below minimum"); | |
| 4409 | + if (json["angle"] > 360) error("Value above maximum"); | |
| 4261 | 4410 | retval.angle = json["angle"]; |
| 4262 | 4411 | retval.baseline = VerticalAlign_from_JSON(json["baseline"]); |
| 4263 | 4412 | retval.clip = json["clip"]; |
| @@ -4267,8 +4416,11 @@ MarkDef MarkDef_from_JSON(mixed json) { | ||
| 4267 | 4416 | retval.dy = json["dy"]; |
| 4268 | 4417 | retval.fill = json["fill"]; |
| 4269 | 4418 | retval.filled = json["filled"]; |
| 4419 | + if (json["fillOpacity"] < 0) error("Value below minimum"); | |
| 4420 | + if (json["fillOpacity"] > 1) error("Value above maximum"); | |
| 4270 | 4421 | retval.fill_opacity = json["fillOpacity"]; |
| 4271 | 4422 | retval.font = json["font"]; |
| 4423 | + if (json["fontSize"] < 0) error("Value below minimum"); | |
| 4272 | 4424 | retval.font_size = json["fontSize"]; |
| 4273 | 4425 | retval.font_style = FontStyle_from_JSON(json["fontStyle"]); |
| 4274 | 4426 | if (arrayp(json["fontWeight"])) error("Unexpected array"); |
| @@ -4276,17 +4428,26 @@ MarkDef MarkDef_from_JSON(mixed json) { | ||
| 4276 | 4428 | retval.href = json["href"]; |
| 4277 | 4429 | retval.interpolate = Interpolate_from_JSON(json["interpolate"]); |
| 4278 | 4430 | retval.limit = json["limit"]; |
| 4431 | + if (json["opacity"] < 0) error("Value below minimum"); | |
| 4432 | + if (json["opacity"] > 1) error("Value above maximum"); | |
| 4279 | 4433 | retval.opacity = json["opacity"]; |
| 4280 | 4434 | retval.orient = Orient_from_JSON(json["orient"]); |
| 4435 | + if (json["radius"] < 0) error("Value below minimum"); | |
| 4281 | 4436 | retval.radius = json["radius"]; |
| 4282 | 4437 | retval.shape = json["shape"]; |
| 4438 | + if (json["size"] < 0) error("Value below minimum"); | |
| 4283 | 4439 | retval.size = json["size"]; |
| 4284 | 4440 | retval.stroke = json["stroke"]; |
| 4285 | 4441 | retval.stroke_dash = json["strokeDash"]; |
| 4286 | 4442 | retval.stroke_dash_offset = json["strokeDashOffset"]; |
| 4443 | + if (json["strokeOpacity"] < 0) error("Value below minimum"); | |
| 4444 | + if (json["strokeOpacity"] > 1) error("Value above maximum"); | |
| 4287 | 4445 | retval.stroke_opacity = json["strokeOpacity"]; |
| 4446 | + if (json["strokeWidth"] < 0) error("Value below minimum"); | |
| 4288 | 4447 | retval.stroke_width = json["strokeWidth"]; |
| 4289 | 4448 | retval.style = json["style"]; |
| 4449 | + if (json["tension"] < 0) error("Value below minimum"); | |
| 4450 | + if (json["tension"] > 1) error("Value above maximum"); | |
| 4290 | 4451 | retval.tension = json["tension"]; |
| 4291 | 4452 | retval.text = json["text"]; |
| 4292 | 4453 | retval.theta = json["theta"]; |
No generated files match these filters.