Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
3test cases
154files differ
77modified
53new
24deleted
14,504changed lines
+8,094 −6,410insertions / deletions
Base a49b94e8f6f1b319a4da9fb15d57ef13ba316ddc · PR merge 7f28c08ab64152fcbd7d443523b60e6ba5e59de5 · Head 668570e5427a56dc8d9aff75f34892adfebf2744 · raw patch
Test case

test/inputs/json/priority/bug427.json

1 generated file · +10 −10
Mcplusplusdefault / quicktype.hpp+10 −10
@@ -1067,7 +1067,7 @@ namespace quicktype {
10671067 std::string name;
10681068 std::shared_ptr<ExtendedBy> overwrites;
10691069 std::optional<std::vector<PurpleParameter>> parameters;
1070- ExtendedBy type;
1070+ std::shared_ptr<ExtendedBy> type;
10711071 std::optional<std::vector<GetSignature>> type_parameter;
10721072
10731073 public:
@@ -1111,9 +1111,9 @@ namespace quicktype {
11111111 std::optional<std::vector<PurpleParameter>> & get_mutable_parameters() { return parameters; }
11121112 void set_parameters(const std::optional<std::vector<PurpleParameter>> & value) { this->parameters = value; }
11131113
1114- const ExtendedBy & get_type() const { return type; }
1115- ExtendedBy & get_mutable_type() { return type; }
1116- void set_type(const ExtendedBy & value) { this->type = value; }
1114+ const std::shared_ptr<ExtendedBy> & get_type() const { return type; }
1115+ std::shared_ptr<ExtendedBy> & get_mutable_type() { return type; }
1116+ void set_type(const std::shared_ptr<ExtendedBy> & value) { this->type = value; }
11171117
11181118 const std::optional<std::vector<GetSignature>> & get_type_parameter() const { return type_parameter; }
11191119 std::optional<std::vector<GetSignature>> & get_mutable_type_parameter() { return type_parameter; }
@@ -1342,7 +1342,7 @@ namespace quicktype {
13421342 SignatureKindString kind_string;
13431343 std::string name;
13441344 std::optional<std::vector<FluffyParameter>> parameters;
1345- ExtendedBy type;
1345+ std::shared_ptr<ExtendedBy> type;
13461346
13471347 public:
13481348 const std::optional<IndigoComment> & get_comment() const { return comment; }
@@ -1373,9 +1373,9 @@ namespace quicktype {
13731373 std::optional<std::vector<FluffyParameter>> & get_mutable_parameters() { return parameters; }
13741374 void set_parameters(const std::optional<std::vector<FluffyParameter>> & value) { this->parameters = value; }
13751375
1376- const ExtendedBy & get_type() const { return type; }
1377- ExtendedBy & get_mutable_type() { return type; }
1378- void set_type(const ExtendedBy & value) { this->type = value; }
1376+ const std::shared_ptr<ExtendedBy> & get_type() const { return type; }
1377+ std::shared_ptr<ExtendedBy> & get_mutable_type() { return type; }
1378+ void set_type(const std::shared_ptr<ExtendedBy> & value) { this->type = value; }
13791379 };
13801380
13811381 class FluffyDeclaration {
@@ -3190,7 +3190,7 @@ namespace quicktype {
31903190 x.set_name(j.at("name").get<std::string>());
31913191 x.set_overwrites(get_heap_optional<ExtendedBy>(j, "overwrites"));
31923192 x.set_parameters(get_stack_optional<std::vector<PurpleParameter>>(j, "parameters"));
3193- x.set_type(j.at("type").get<ExtendedBy>());
3193+ x.set_type(j.at("type").get<std::shared_ptr<ExtendedBy>>());
31943194 x.set_type_parameter(get_stack_optional<std::vector<GetSignature>>(j, "typeParameter"));
31953195 }
31963196
@@ -3322,7 +3322,7 @@ namespace quicktype {
33223322 x.set_kind_string(j.at("kindString").get<SignatureKindString>());
33233323 x.set_name(j.at("name").get<std::string>());
33243324 x.set_parameters(get_stack_optional<std::vector<FluffyParameter>>(j, "parameters"));
3325- x.set_type(j.at("type").get<ExtendedBy>());
3325+ x.set_type(j.at("type").get<std::shared_ptr<ExtendedBy>>());
33263326 }
33273327
33283328 inline void to_json(json & j, const TentacledSignature & x) {
Test case

test/inputs/schema/required-in-any-of.schema

35 generated files · +2,694 −0
Aschema-cjsondefault / TopLevel.c+137 −0
@@ -0,0 +1,137 @@
1+/**
2+ * TopLevel.c
3+ * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT
4+ */
5+
6+#include "TopLevel.h"
7+
8+struct Anyof * cJSON_ParseAnyof(const char * s) {
9+ struct Anyof * x = NULL;
10+ if (NULL != s) {
11+ cJSON * j = cJSON_Parse(s);
12+ if (NULL != j) {
13+ x = cJSON_GetAnyofValue(j);
14+ cJSON_Delete(j);
15+ }
16+ }
17+ return x;
18+}
19+
20+struct Anyof * cJSON_GetAnyofValue(const cJSON * j) {
21+ struct Anyof * x = NULL;
22+ if (NULL != j) {
23+ if (NULL != (x = cJSON_malloc(sizeof(struct Anyof)))) {
24+ memset(x, 0, sizeof(struct Anyof));
25+ if (cJSON_HasObjectItem(j, "name")) {
26+ x->name = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "name")));
27+ }
28+ else {
29+ if (NULL != (x->name = cJSON_malloc(sizeof(char)))) {
30+ x->name[0] = '\0';
31+ }
32+ }
33+ if (cJSON_HasObjectItem(j, "size")) {
34+ x->size = strdup(cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(j, "size")));
35+ }
36+ }
37+ }
38+ return x;
39+}
40+
41+cJSON * cJSON_CreateAnyof(const struct Anyof * x) {
42+ cJSON * j = NULL;
43+ if (NULL != x) {
44+ if (NULL != (j = cJSON_CreateObject())) {
45+ if (NULL != x->name) {
46+ cJSON_AddStringToObject(j, "name", x->name);
47+ }
48+ else {
49+ cJSON_AddStringToObject(j, "name", "");
50+ }
51+ if (NULL != x->size) {
52+ cJSON_AddStringToObject(j, "size", x->size);
53+ }
54+ }
55+ }
56+ return j;
57+}
58+
59+char * cJSON_PrintAnyof(const struct Anyof * x) {
60+ char * s = NULL;
61+ if (NULL != x) {
62+ cJSON * j = cJSON_CreateAnyof(x);
63+ if (NULL != j) {
64+ s = cJSON_Print(j);
65+ cJSON_Delete(j);
66+ }
67+ }
68+ return s;
69+}
70+
71+void cJSON_DeleteAnyof(struct Anyof * x) {
72+ if (NULL != x) {
73+ if (NULL != x->name) {
74+ cJSON_free(x->name);
75+ }
76+ if (NULL != x->size) {
77+ cJSON_free(x->size);
78+ }
79+ cJSON_free(x);
80+ }
81+}
82+
83+struct TopLevel * cJSON_ParseTopLevel(const char * s) {
84+ struct TopLevel * x = NULL;
85+ if (NULL != s) {
86+ cJSON * j = cJSON_Parse(s);
87+ if (NULL != j) {
88+ x = cJSON_GetTopLevelValue(j);
89+ cJSON_Delete(j);
90+ }
91+ }
92+ return x;
93+}
94+
95+struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
96+ struct TopLevel * x = NULL;
97+ if (NULL != j) {
98+ if (NULL != (x = cJSON_malloc(sizeof(struct TopLevel)))) {
99+ memset(x, 0, sizeof(struct TopLevel));
100+ if (cJSON_HasObjectItem(j, "anyof")) {
101+ x->anyof = cJSON_GetAnyofValue(cJSON_GetObjectItemCaseSensitive(j, "anyof"));
102+ }
103+ }
104+ }
105+ return x;
106+}
107+
108+cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
109+ cJSON * j = NULL;
110+ if (NULL != x) {
111+ if (NULL != (j = cJSON_CreateObject())) {
112+ cJSON_AddItemToObject(j, "anyof", cJSON_CreateAnyof(x->anyof));
113+ }
114+ }
115+ return j;
116+}
117+
118+char * cJSON_PrintTopLevel(const struct TopLevel * x) {
119+ char * s = NULL;
120+ if (NULL != x) {
121+ cJSON * j = cJSON_CreateTopLevel(x);
122+ if (NULL != j) {
123+ s = cJSON_Print(j);
124+ cJSON_Delete(j);
125+ }
126+ }
127+ return s;
128+}
129+
130+void cJSON_DeleteTopLevel(struct TopLevel * x) {
131+ if (NULL != x) {
132+ if (NULL != x->anyof) {
133+ cJSON_DeleteAnyof(x->anyof);
134+ }
135+ cJSON_free(x);
136+ }
137+}
Aschema-cjsondefault / TopLevel.h+62 −0
@@ -0,0 +1,62 @@
1+/**
2+ * TopLevel.h
3+ * This file has been autogenerated using quicktype https://github.com/quicktype/quicktype - DO NOT EDIT
4+ * This file depends of https://github.com/DaveGamble/cJSON, https://github.com/joelguittet/c-list and https://github.com/joelguittet/c-hashtable
5+ * To parse json data from json string use the following: struct <type> * data = cJSON_Parse<type>(<string>);
6+ * To get json data from cJSON object use the following: struct <type> * data = cJSON_Get<type>Value(<cjson>);
7+ * To get cJSON object from json data use the following: cJSON * cjson = cJSON_Create<type>(<data>);
8+ * To print json string from json data use the following: char * string = cJSON_Print<type>(<data>);
9+ * To delete json data use the following: cJSON_Delete<type>(<data>);
10+ */
11+
12+#ifndef __TOPLEVEL_H__
13+#define __TOPLEVEL_H__
14+
15+#ifdef __cplusplus
16+extern "C" {
17+#endif
18+
19+#include <stdint.h>
20+#include <stdbool.h>
21+#include <stdlib.h>
22+#include <string.h>
23+#include <cJSON.h>
24+#include <hashtable.h>
25+#include <list.h>
26+
27+#ifndef cJSON_Bool
28+#define cJSON_Bool (cJSON_True | cJSON_False)
29+#endif
30+#ifndef cJSON_Map
31+#define cJSON_Map (1 << 16)
32+#endif
33+#ifndef cJSON_Enum
34+#define cJSON_Enum (1 << 17)
35+#endif
36+
37+struct Anyof {
38+ char * name;
39+ char * size;
40+};
41+
42+struct TopLevel {
43+ struct Anyof * anyof;
44+};
45+
46+struct Anyof * cJSON_ParseAnyof(const char * s);
47+struct Anyof * cJSON_GetAnyofValue(const cJSON * j);
48+cJSON * cJSON_CreateAnyof(const struct Anyof * x);
49+char * cJSON_PrintAnyof(const struct Anyof * x);
50+void cJSON_DeleteAnyof(struct Anyof * x);
51+
52+struct TopLevel * cJSON_ParseTopLevel(const char * s);
53+struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j);
54+cJSON * cJSON_CreateTopLevel(const struct TopLevel * x);
55+char * cJSON_PrintTopLevel(const struct TopLevel * x);
56+void cJSON_DeleteTopLevel(struct TopLevel * x);
57+
58+#ifdef __cplusplus
59+}
60+#endif
61+
62+#endif /* __TOPLEVEL_H__ */
Aschema-cplusplusdefault / quicktype.hpp+151 −0
@@ -0,0 +1,151 @@
1+// To parse this JSON data, first install
2+//
3+// json.hpp https://github.com/nlohmann/json
4+//
5+// Then include this file, and then do
6+//
7+// TopLevel data = nlohmann::json::parse(jsonString);
8+
9+#pragma once
10+
11+#include <optional>
12+#include "json.hpp"
13+
14+#include <optional>
15+#include <stdexcept>
16+#include <regex>
17+
18+#ifndef NLOHMANN_OPT_HELPER
19+#define NLOHMANN_OPT_HELPER
20+namespace nlohmann {
21+ template <typename T>
22+ struct adl_serializer<std::shared_ptr<T>> {
23+ static void to_json(json & j, const std::shared_ptr<T> & opt) {
24+ if (!opt) j = nullptr; else j = *opt;
25+ }
26+
27+ static std::shared_ptr<T> from_json(const json & j) {
28+ if (j.is_null()) return std::shared_ptr<T>(); else return std::make_shared<T>(j.get<T>());
29+ }
30+ };
31+ template <typename T>
32+ struct adl_serializer<std::optional<T>> {
33+ static void to_json(json & j, const std::optional<T> & opt) {
34+ if (!opt) j = nullptr; else j = *opt;
35+ }
36+
37+ static std::optional<T> from_json(const json & j) {
38+ if (j.is_null()) return std::optional<T>(); else return std::make_optional<T>(j.get<T>());
39+ }
40+ };
41+}
42+#endif
43+
44+namespace quicktype {
45+ using nlohmann::json;
46+
47+ #ifndef NLOHMANN_UNTYPED_quicktype_HELPER
48+ #define NLOHMANN_UNTYPED_quicktype_HELPER
49+ inline json get_untyped(const json & j, const char * property) {
50+ if (j.find(property) != j.end()) {
51+ return j.at(property).get<json>();
52+ }
53+ return json();
54+ }
55+
56+ inline json get_untyped(const json & j, std::string property) {
57+ return get_untyped(j, property.data());
58+ }
59+ #endif
60+
61+ #ifndef NLOHMANN_OPTIONAL_quicktype_HELPER
62+ #define NLOHMANN_OPTIONAL_quicktype_HELPER
63+ template <typename T>
64+ inline std::shared_ptr<T> get_heap_optional(const json & j, const char * property) {
65+ auto it = j.find(property);
66+ if (it != j.end() && !it->is_null()) {
67+ return j.at(property).get<std::shared_ptr<T>>();
68+ }
69+ return std::shared_ptr<T>();
70+ }
71+
72+ template <typename T>
73+ inline std::shared_ptr<T> get_heap_optional(const json & j, std::string property) {
74+ return get_heap_optional<T>(j, property.data());
75+ }
76+ template <typename T>
77+ inline std::optional<T> get_stack_optional(const json & j, const char * property) {
78+ auto it = j.find(property);
79+ if (it != j.end() && !it->is_null()) {
80+ return j.at(property).get<std::optional<T>>();
81+ }
82+ return std::optional<T>();
83+ }
84+
85+ template <typename T>
86+ inline std::optional<T> get_stack_optional(const json & j, std::string property) {
87+ return get_stack_optional<T>(j, property.data());
88+ }
89+ #endif
90+
91+ class Anyof {
92+ public:
93+ Anyof() = default;
94+ virtual ~Anyof() = default;
95+
96+ private:
97+ std::string name;
98+ std::optional<std::string> size;
99+
100+ public:
101+ const std::string & get_name() const { return name; }
102+ std::string & get_mutable_name() { return name; }
103+ void set_name(const std::string & value) { this->name = value; }
104+
105+ const std::optional<std::string> & get_size() const { return size; }
106+ std::optional<std::string> & get_mutable_size() { return size; }
107+ void set_size(const std::optional<std::string> & value) { this->size = value; }
108+ };
109+
110+ class TopLevel {
111+ public:
112+ TopLevel() = default;
113+ virtual ~TopLevel() = default;
114+
115+ private:
116+ Anyof anyof;
117+
118+ public:
119+ const Anyof & get_anyof() const { return anyof; }
120+ Anyof & get_mutable_anyof() { return anyof; }
121+ void set_anyof(const Anyof & value) { this->anyof = value; }
122+ };
123+}
124+
125+namespace quicktype {
126+ void from_json(const json & j, Anyof & x);
127+ void to_json(json & j, const Anyof & x);
128+
129+ void from_json(const json & j, TopLevel & x);
130+ void to_json(json & j, const TopLevel & x);
131+
132+ inline void from_json(const json & j, Anyof& x) {
133+ x.set_name(j.at("name").get<std::string>());
134+ x.set_size(get_stack_optional<std::string>(j, "size"));
135+ }
136+
137+ inline void to_json(json & j, const Anyof & x) {
138+ j = json::object();
139+ j["name"] = x.get_name();
140+ j["size"] = x.get_size();
141+ }
142+
143+ inline void from_json(const json & j, TopLevel& x) {
144+ x.set_anyof(j.at("anyof").get<Anyof>());
145+ }
146+
147+ inline void to_json(json & j, const TopLevel & x) {
148+ j = json::object();
149+ j["anyof"] = x.get_anyof();
150+ }
151+}
Aschema-csharp-recordsdefault / QuickType.cs+70 −0
@@ -0,0 +1,70 @@
1+// <auto-generated />
2+//
3+// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
4+//
5+// using QuickType;
6+//
7+// var topLevel = TopLevel.FromJson(jsonString);
8+#nullable enable
9+#pragma warning disable CS8618
10+#pragma warning disable CS8601
11+#pragma warning disable CS8602
12+#pragma warning disable CS8603
13+#pragma warning disable CS8604
14+#pragma warning disable CS8625
15+#pragma warning disable CS8765
16+
17+namespace QuickType
18+{
19+ using System;
20+ using System.Collections.Generic;
21+
22+ using System.Globalization;
23+ using Newtonsoft.Json;
24+ using Newtonsoft.Json.Converters;
25+
26+ public partial record TopLevel
27+ {
28+ [JsonProperty("anyof", Required = Required.Always)]
29+ public Anyof Anyof { get; set; }
30+ }
31+
32+ public partial record Anyof
33+ {
34+ [JsonProperty("name", Required = Required.Always)]
35+ public string Name { get; set; }
36+
37+ [JsonProperty("size", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
38+ public string? Size { get; set; }
39+ }
40+
41+ public partial record TopLevel
42+ {
43+ public static TopLevel FromJson(string json) => JsonConvert.DeserializeObject<TopLevel>(json, QuickType.Converter.Settings);
44+ }
45+
46+ public static partial class Serialize
47+ {
48+ public static string ToJson(this TopLevel self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
49+ }
50+
51+ internal static partial class Converter
52+ {
53+ public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
54+ {
55+ MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
56+ DateParseHandling = DateParseHandling.None,
57+ Converters =
58+ {
59+ new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
60+ },
61+ };
62+ }
63+}
64+#pragma warning restore CS8618
65+#pragma warning restore CS8601
66+#pragma warning restore CS8602
67+#pragma warning restore CS8603
68+#pragma warning restore CS8604
69+#pragma warning restore CS8625
70+#pragma warning restore CS8765
Aschema-csharp-SystemTextJsondefault / QuickType.cs+177 −0
@@ -0,0 +1,177 @@
1+// <auto-generated />
2+//
3+// To parse this JSON data, add NuGet 'System.Text.Json' then do:
4+//
5+// using QuickType;
6+//
7+// var topLevel = TopLevel.FromJson(jsonString);
8+#nullable enable
9+#pragma warning disable CS8618
10+#pragma warning disable CS8601
11+#pragma warning disable CS8602
12+#pragma warning disable CS8603
13+
14+namespace QuickType
15+{
16+ using System;
17+ using System.Collections.Generic;
18+
19+ using System.Text.Json;
20+ using System.Text.Json.Serialization;
21+ using System.Globalization;
22+
23+ public partial class TopLevel
24+ {
25+ [JsonRequired]
26+ [JsonPropertyName("anyof")]
27+ public Anyof Anyof { get; set; }
28+ }
29+
30+ public partial class Anyof
31+ {
32+ [JsonRequired]
33+ [JsonPropertyName("name")]
34+ public string Name { get; set; }
35+
36+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
37+ [JsonPropertyName("size")]
38+ public string? Size { get; set; }
39+ }
40+
41+ public partial class TopLevel
42+ {
43+ public static TopLevel FromJson(string json) => JsonSerializer.Deserialize<TopLevel>(json, QuickType.Converter.Settings);
44+ }
45+
46+ public static partial class Serialize
47+ {
48+ public static string ToJson(this TopLevel self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
49+ }
50+
51+ internal static partial class Converter
52+ {
53+ public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
54+ {
55+ Converters =
56+ {
57+ new DateOnlyConverter(),
58+ new TimeOnlyConverter(),
59+ IsoDateTimeOffsetConverter.Singleton
60+ },
61+ };
62+ }
63+
64+ public class DateOnlyConverter : JsonConverter<DateOnly>
65+ {
66+ private readonly string serializationFormat;
67+ public DateOnlyConverter() : this(null) { }
68+
69+ public DateOnlyConverter(string? serializationFormat)
70+ {
71+ this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
72+ }
73+
74+ public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
75+ {
76+ var value = reader.GetString();
77+ return DateOnly.Parse(value!);
78+ }
79+
80+ public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
81+ => writer.WriteStringValue(value.ToString(serializationFormat));
82+ }
83+
84+ public class TimeOnlyConverter : JsonConverter<TimeOnly>
85+ {
86+ private readonly string serializationFormat;
87+
88+ public TimeOnlyConverter() : this(null) { }
89+
90+ public TimeOnlyConverter(string? serializationFormat)
91+ {
92+ this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
93+ }
94+
95+ public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
96+ {
97+ var value = reader.GetString();
98+ return TimeOnly.Parse(value!);
99+ }
100+
101+ public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
102+ => writer.WriteStringValue(value.ToString(serializationFormat));
103+ }
104+
105+ internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
106+ {
107+ public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
108+
109+ private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
110+
111+ private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
112+ private string? _dateTimeFormat;
113+ private CultureInfo? _culture;
114+
115+ public DateTimeStyles DateTimeStyles
116+ {
117+ get => _dateTimeStyles;
118+ set => _dateTimeStyles = value;
119+ }
120+
121+ public string? DateTimeFormat
122+ {
123+ get => _dateTimeFormat ?? string.Empty;
124+ set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
125+ }
126+
127+ public CultureInfo Culture
128+ {
129+ get => _culture ?? CultureInfo.CurrentCulture;
130+ set => _culture = value;
131+ }
132+
133+ public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
134+ {
135+ string text;
136+
137+
138+ if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
139+ || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
140+ {
141+ value = value.ToUniversalTime();
142+ }
143+
144+ text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
145+
146+ writer.WriteStringValue(text);
147+ }
148+
149+ public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
150+ {
151+ string? dateText = reader.GetString();
152+
153+ if (string.IsNullOrEmpty(dateText) == false)
154+ {
155+ if (!string.IsNullOrEmpty(_dateTimeFormat))
156+ {
157+ return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
158+ }
159+ else
160+ {
161+ return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
162+ }
163+ }
164+ else
165+ {
166+ return default(DateTimeOffset);
167+ }
168+ }
169+
170+
171+ public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
172+ }
173+}
174+#pragma warning restore CS8618
175+#pragma warning restore CS8601
176+#pragma warning restore CS8602
177+#pragma warning restore CS8603
Aschema-csharpdefault / QuickType.cs+70 −0
@@ -0,0 +1,70 @@
1+// <auto-generated />
2+//
3+// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
4+//
5+// using QuickType;
6+//
7+// var topLevel = TopLevel.FromJson(jsonString);
8+#nullable enable
9+#pragma warning disable CS8618
10+#pragma warning disable CS8601
11+#pragma warning disable CS8602
12+#pragma warning disable CS8603
13+#pragma warning disable CS8604
14+#pragma warning disable CS8625
15+#pragma warning disable CS8765
16+
17+namespace QuickType
18+{
19+ using System;
20+ using System.Collections.Generic;
21+
22+ using System.Globalization;
23+ using Newtonsoft.Json;
24+ using Newtonsoft.Json.Converters;
25+
26+ public partial class TopLevel
27+ {
28+ [JsonProperty("anyof", Required = Required.Always)]
29+ public Anyof Anyof { get; set; }
30+ }
31+
32+ public partial class Anyof
33+ {
34+ [JsonProperty("name", Required = Required.Always)]
35+ public string Name { get; set; }
36+
37+ [JsonProperty("size", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
38+ public string? Size { get; set; }
39+ }
40+
41+ public partial class TopLevel
42+ {
43+ public static TopLevel FromJson(string json) => JsonConvert.DeserializeObject<TopLevel>(json, QuickType.Converter.Settings);
44+ }
45+
46+ public static partial class Serialize
47+ {
48+ public static string ToJson(this TopLevel self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
49+ }
50+
51+ internal static partial class Converter
52+ {
53+ public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
54+ {
55+ MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
56+ DateParseHandling = DateParseHandling.None,
57+ Converters =
58+ {
59+ new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
60+ },
61+ };
62+ }
63+}
64+#pragma warning restore CS8618
65+#pragma warning restore CS8601
66+#pragma warning restore CS8602
67+#pragma warning restore CS8603
68+#pragma warning restore CS8604
69+#pragma warning restore CS8625
70+#pragma warning restore CS8765
Aschema-dartdefault / TopLevel.dart+45 −0
@@ -0,0 +1,45 @@
1+// To parse this JSON data, do
2+//
3+// final topLevel = topLevelFromJson(jsonString);
4+
5+import 'dart:convert';
6+
7+TopLevel topLevelFromJson(String str) => TopLevel.fromJson(json.decode(str));
8+
9+String topLevelToJson(TopLevel data) => json.encode(data.toJson());
10+
11+class TopLevel {
12+ final Anyof anyof;
13+
14+ TopLevel({
15+ required this.anyof,
16+ });
17+
18+ factory TopLevel.fromJson(Map<String, dynamic> json) => TopLevel(
19+ anyof: Anyof.fromJson(json["anyof"]),
20+ );
21+
22+ Map<String, dynamic> toJson() => {
23+ "anyof": anyof.toJson(),
24+ };
25+}
26+
27+class Anyof {
28+ final String name;
29+ final String? size;
30+
31+ Anyof({
32+ required this.name,
33+ this.size,
34+ });
35+
36+ factory Anyof.fromJson(Map<String, dynamic> json) => Anyof(
37+ name: json["name"],
38+ size: json["size"],
39+ );
40+
41+ Map<String, dynamic> toJson() => {
42+ "name": name,
43+ "size": size,
44+ };
45+}
Aschema-elmdefault / QuickType.elm+70 −0
@@ -0,0 +1,70 @@
1+-- To decode the JSON data, add this file to your project, run
2+--
3+-- elm install NoRedInk/elm-json-decode-pipeline
4+--
5+-- add these imports
6+--
7+-- import Json.Decode exposing (decodeString)
8+-- import QuickType exposing (quickType)
9+--
10+-- and you're off to the races with
11+--
12+-- decodeString quickType myJsonString
13+
14+module QuickType exposing
15+ ( QuickType
16+ , quickTypeToString
17+ , quickType
18+ , Anyof
19+ )
20+
21+import Json.Decode as Jdec
22+import Json.Decode.Pipeline as Jpipe
23+import Json.Encode as Jenc
24+import Dict exposing (Dict)
25+
26+type alias QuickType =
27+ { anyof : Anyof
28+ }
29+
30+type alias Anyof =
31+ { name : String
32+ , size : Maybe String
33+ }
34+
35+-- decoders and encoders
36+
37+quickTypeToString : QuickType -> String
38+quickTypeToString r = Jenc.encode 0 (encodeQuickType r)
39+
40+quickType : Jdec.Decoder QuickType
41+quickType =
42+ Jdec.succeed QuickType
43+ |> Jpipe.required "anyof" anyof
44+
45+encodeQuickType : QuickType -> Jenc.Value
46+encodeQuickType x =
47+ Jenc.object
48+ [ ("anyof", encodeAnyof x.anyof)
49+ ]
50+
51+anyof : Jdec.Decoder Anyof
52+anyof =
53+ Jdec.succeed Anyof
54+ |> Jpipe.required "name" Jdec.string
55+ |> Jpipe.optional "size" (Jdec.nullable Jdec.string) Nothing
56+
57+encodeAnyof : Anyof -> Jenc.Value
58+encodeAnyof x =
59+ Jenc.object
60+ [ ("name", Jenc.string x.name)
61+ , ("size", makeNullableEncoder Jenc.string x.size)
62+ ]
63+
64+--- encoder helpers
65+
66+makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
67+makeNullableEncoder f m =
68+ case m of
69+ Just x -> f x
70+ Nothing -> Jenc.null
Aschema-flowdefault / TopLevel.js+197 −0
@@ -0,0 +1,197 @@
1+// @flow
2+
3+// To parse this data:
4+//
5+// const Convert = require("./TopLevel");
6+//
7+// const topLevel = Convert.toTopLevel(json);
8+//
9+// These functions will throw an error if the JSON doesn't
10+// match the expected interface, even if the JSON is valid.
11+
12+export type TopLevel = {
13+ anyof: Anyof;
14+};
15+
16+export type Anyof = {
17+ name: string;
18+ size?: string;
19+};
20+
21+// Converts JSON strings to/from your types
22+// and asserts the results of JSON.parse at runtime
23+function toTopLevel(json: string): TopLevel {
24+ return cast(JSON.parse(json), r("TopLevel"));
25+}
26+
27+function topLevelToJson(value: TopLevel): string {
28+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
29+}
30+
31+function invalidValue(typ: any, val: any, key: any, parent: any = '') {
32+ const prettyTyp = prettyTypeName(typ);
33+ const parentText = parent ? ` on ${parent}` : '';
34+ const keyText = key ? ` for key "${key}"` : '';
35+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
36+}
37+
38+function prettyTypeName(typ: any): string {
39+ if (Array.isArray(typ)) {
40+ if (typ.length === 2 && typ[0] === undefined) {
41+ return `an optional ${prettyTypeName(typ[1])}`;
42+ } else {
43+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
44+ }
45+ } else if (typeof typ === "object" && typ.literal !== undefined) {
46+ return typ.literal;
47+ } else {
48+ return typeof typ;
49+ }
50+}
51+
52+function jsonToJSProps(typ: any): any {
53+ if (typ.jsonToJS === undefined) {
54+ const map: any = {};
55+ typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
56+ typ.jsonToJS = map;
57+ }
58+ return typ.jsonToJS;
59+}
60+
61+function jsToJSONProps(typ: any): any {
62+ if (typ.jsToJSON === undefined) {
63+ const map: any = {};
64+ typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
65+ typ.jsToJSON = map;
66+ }
67+ return typ.jsToJSON;
68+}
69+
70+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
71+ function transformPrimitive(typ: string, val: any): any {
72+ if (typeof typ === typeof val) return val;
73+ return invalidValue(typ, val, key, parent);
74+ }
75+
76+ function transformUnion(typs: any[], val: any): any {
77+ // val must validate against one typ in typs
78+ const l = typs.length;
79+ for (let i = 0; i < l; i++) {
80+ const typ = typs[i];
81+ try {
82+ return transform(val, typ, getProps);
83+ } catch (_) {}
84+ }
85+ return invalidValue(typs, val, key, parent);
86+ }
87+
88+ function transformEnum(cases: string[], val: any): any {
89+ if (cases.indexOf(val) !== -1) return val;
90+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
91+ }
92+
93+ function transformArray(typ: any, val: any): any {
94+ // val must be an array with no invalid elements
95+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
96+ return val.map(el => transform(el, typ, getProps));
97+ }
98+
99+ function transformDate(val: any): any {
100+ if (val === null) {
101+ return null;
102+ }
103+ const d = new Date(val);
104+ if (isNaN(d.valueOf())) {
105+ return invalidValue(l("Date"), val, key, parent);
106+ }
107+ return d;
108+ }
109+
110+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
111+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
112+ return invalidValue(l(ref || "object"), val, key, parent);
113+ }
114+ const result: any = {};
115+ Object.getOwnPropertyNames(props).forEach(key => {
116+ const prop = props[key];
117+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
118+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
119+ });
120+ Object.getOwnPropertyNames(val).forEach(key => {
121+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
122+ result[key] = transform(val[key], additional, getProps, key, ref);
123+ }
124+ });
125+ return result;
126+ }
127+
128+ if (typ === "any") return val;
129+ if (typ === null) {
130+ if (val === null) return val;
131+ return invalidValue(typ, val, key, parent);
132+ }
133+ if (typ === false) return invalidValue(typ, val, key, parent);
134+ let ref: any = undefined;
135+ while (typeof typ === "object" && typ.ref !== undefined) {
136+ ref = typ.ref;
137+ typ = typeMap[typ.ref];
138+ }
139+ if (Array.isArray(typ)) return transformEnum(typ, val);
140+ if (typeof typ === "object") {
141+ return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
142+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
143+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
144+ : invalidValue(typ, val, key, parent);
145+ }
146+ // Numbers can be parsed by Date but shouldn't be.
147+ if (typ === Date && typeof val !== "number") return transformDate(val);
148+ return transformPrimitive(typ, val);
149+}
150+
151+function cast<T>(val: any, typ: any): T {
152+ return transform(val, typ, jsonToJSProps);
153+}
154+
155+function uncast<T>(val: T, typ: any): any {
156+ return transform(val, typ, jsToJSONProps);
157+}
158+
159+function l(typ: any) {
160+ return { literal: typ };
161+}
162+
163+function a(typ: any) {
164+ return { arrayItems: typ };
165+}
166+
167+function u(...typs: any[]) {
168+ return { unionMembers: typs };
169+}
170+
171+function o(props: any[], additional: any) {
172+ return { props, additional };
173+}
174+
175+function m(additional: any) {
176+ const props: any[] = [];
177+ return { props, additional };
178+}
179+
180+function r(name: string) {
181+ return { ref: name };
182+}
183+
184+const typeMap: any = {
185+ "TopLevel": o([
186+ { json: "anyof", js: "anyof", typ: r("Anyof") },
187+ ], false),
188+ "Anyof": o([
189+ { json: "name", js: "name", typ: "" },
190+ { json: "size", js: "size", typ: u(undefined, "") },
191+ ], false),
192+};
193+
194+module.exports = {
195+ "topLevelToJson": topLevelToJson,
196+ "toTopLevel": toTopLevel,
197+};
Aschema-golangdefault / quicktype.go+28 −0
@@ -0,0 +1,28 @@
1+// Code generated from JSON Schema using quicktype. DO NOT EDIT.
2+// To parse and unparse this JSON data, add this code to your project and do:
3+//
4+// topLevel, err := UnmarshalTopLevel(bytes)
5+// bytes, err = topLevel.Marshal()
6+
7+package main
8+
9+import "encoding/json"
10+
11+func UnmarshalTopLevel(data []byte) (TopLevel, error) {
12+ var r TopLevel
13+ err := json.Unmarshal(data, &r)
14+ return r, err
15+}
16+
17+func (r *TopLevel) Marshal() ([]byte, error) {
18+ return json.Marshal(r)
19+}
20+
21+type TopLevel struct {
22+ Anyof Anyof `json:"anyof"`
23+}
24+
25+type Anyof struct {
26+ Name string `json:"name"`
27+ Size *string `json:"size,omitempty"`
28+}
Aschema-haskelldefault / QuickType.hs+48 −0
@@ -0,0 +1,48 @@
1+{-# LANGUAGE StrictData #-}
2+{-# LANGUAGE OverloadedStrings #-}
3+
4+module QuickType
5+ ( QuickType (..)
6+ , Anyof (..)
7+ , decodeTopLevel
8+ ) where
9+
10+import Data.Aeson
11+import Data.Aeson.Types (emptyObject)
12+import Data.ByteString.Lazy (ByteString)
13+import Data.HashMap.Strict (HashMap)
14+import Data.Text (Text)
15+
16+data QuickType = QuickType
17+ { anyofQuickType :: Anyof
18+ } deriving (Show)
19+
20+data Anyof = Anyof
21+ { nameAnyof :: Text
22+ , sizeAnyof :: Maybe Text
23+ } deriving (Show)
24+
25+decodeTopLevel :: ByteString -> Maybe QuickType
26+decodeTopLevel = decode
27+
28+instance ToJSON QuickType where
29+ toJSON (QuickType anyofQuickType) =
30+ object
31+ [ "anyof" .= anyofQuickType
32+ ]
33+
34+instance FromJSON QuickType where
35+ parseJSON (Object v) = QuickType
36+ <$> v .: "anyof"
37+
38+instance ToJSON Anyof where
39+ toJSON (Anyof nameAnyof sizeAnyof) =
40+ object
41+ [ "name" .= nameAnyof
42+ , "size" .= sizeAnyof
43+ ]
44+
45+instance FromJSON Anyof where
46+ parseJSON (Object v) = Anyof
47+ <$> v .: "name"
48+ <*> v .:? "size"
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / Anyof.java+18 −0
@@ -0,0 +1,18 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class Anyof {
6+ private String name;
7+ private String size;
8+
9+ @JsonProperty("name")
10+ public String getName() { return name; }
11+ @JsonProperty("name")
12+ public void setName(String value) { this.name = value; }
13+
14+ @JsonProperty("size")
15+ public String getSize() { return size; }
16+ @JsonProperty("size")
17+ public void setSize(String value) { this.size = value; }
18+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / Converter.java+121 −0
@@ -0,0 +1,121 @@
1+// To use this code, add the following Maven dependency to your project:
2+//
3+//
4+// com.fasterxml.jackson.core : jackson-databind : 2.9.0
5+//
6+//
7+// Import this package:
8+//
9+// import io.quicktype.Converter;
10+//
11+// Then you can deserialize a JSON string with
12+//
13+// TopLevel data = Converter.fromJsonString(jsonString);
14+
15+package io.quicktype;
16+
17+import java.io.IOException;
18+import com.fasterxml.jackson.databind.*;
19+import com.fasterxml.jackson.databind.module.SimpleModule;
20+import com.fasterxml.jackson.core.JsonParser;
21+import com.fasterxml.jackson.core.JsonProcessingException;
22+import java.util.*;
23+import java.util.Date;
24+import java.text.SimpleDateFormat;
25+
26+public class Converter {
27+ // Date-time helpers
28+
29+ private static final String[] DATE_TIME_FORMATS = {
30+ "yyyy-MM-dd'T'HH:mm:ss.SX",
31+ "yyyy-MM-dd'T'HH:mm:ss.S",
32+ "yyyy-MM-dd'T'HH:mm:ssX",
33+ "yyyy-MM-dd'T'HH:mm:ss",
34+ "yyyy-MM-dd HH:mm:ss.SX",
35+ "yyyy-MM-dd HH:mm:ss.S",
36+ "yyyy-MM-dd HH:mm:ssX",
37+ "yyyy-MM-dd HH:mm:ss",
38+ "HH:mm:ss.SZ",
39+ "HH:mm:ss.S",
40+ "HH:mm:ssZ",
41+ "HH:mm:ss",
42+ "yyyy-MM-dd",
43+ };
44+
45+ public static Date parseAllDateTimeString(String str) {
46+ for (String format : DATE_TIME_FORMATS) {
47+ try {
48+ return new SimpleDateFormat(format).parse(str);
49+ } catch (Exception ex) {
50+ // Ignored
51+ }
52+ }
53+ return null;
54+ }
55+
56+ public static String serializeDateTime(Date datetime) {
57+ return new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ").format(datetime);
58+ }
59+
60+ public static String serializeDate(Date datetime) {
61+ return new SimpleDateFormat("yyyy-MM-dd").format(datetime);
62+ }
63+
64+ public static String serializeTime(Date datetime) {
65+ return new SimpleDateFormat("hh:mm:ssZ").format(datetime);
66+ }
67+ // Serialize/deserialize helpers
68+
69+ public static TopLevel fromJsonString(String json) throws IOException {
70+ return getObjectReader().readValue(json);
71+ }
72+
73+ public static String toJsonString(TopLevel obj) throws JsonProcessingException {
74+ return getObjectWriter().writeValueAsString(obj);
75+ }
76+
77+ private static ObjectReader reader;
78+ private static ObjectWriter writer;
79+
80+ private static void instantiateMapper() {
81+ ObjectMapper mapper = new ObjectMapper();
82+ mapper.findAndRegisterModules();
83+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
84+ mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
85+ SimpleModule module = new SimpleModule();
86+ module.addDeserializer(Date.class, new JsonDeserializer<Date>() {
87+ @Override
88+ public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
89+ String value = jsonParser.getText();
90+ return Converter.parseAllDateTimeString(value);
91+ }
92+ });
93+ module.addDeserializer(Date.class, new JsonDeserializer<Date>() {
94+ @Override
95+ public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
96+ String value = jsonParser.getText();
97+ return Converter.parseAllDateTimeString(value);
98+ }
99+ });
100+ module.addDeserializer(Date.class, new JsonDeserializer<Date>() {
101+ @Override
102+ public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
103+ String value = jsonParser.getText();
104+ return Converter.parseAllDateTimeString(value);
105+ }
106+ });
107+ mapper.registerModule(module);
108+ reader = mapper.readerFor(TopLevel.class);
109+ writer = mapper.writerFor(TopLevel.class);
110+ }
111+
112+ private static ObjectReader getObjectReader() {
113+ if (reader == null) instantiateMapper();
114+ return reader;
115+ }
116+
117+ private static ObjectWriter getObjectWriter() {
118+ if (writer == null) instantiateMapper();
119+ return writer;
120+ }
121+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / TopLevel.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class TopLevel {
6+ private Anyof anyof;
7+
8+ @JsonProperty("anyof")
9+ public Anyof getAnyof() { return anyof; }
10+ @JsonProperty("anyof")
11+ public void setAnyof(Anyof value) { this.anyof = value; }
12+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / Anyof.java+18 −0
@@ -0,0 +1,18 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class Anyof {
6+ private String name;
7+ private String size;
8+
9+ @JsonProperty("name")
10+ public String getName() { return name; }
11+ @JsonProperty("name")
12+ public void setName(String value) { this.name = value; }
13+
14+ @JsonProperty("size")
15+ public String getSize() { return size; }
16+ @JsonProperty("size")
17+ public void setSize(String value) { this.size = value; }
18+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / Converter.java+101 −0
@@ -0,0 +1,101 @@
1+// To use this code, add the following Maven dependency to your project:
2+//
3+//
4+// com.fasterxml.jackson.core : jackson-databind : 2.9.0
5+// com.fasterxml.jackson.datatype : jackson-datatype-jsr310 : 2.9.0
6+//
7+// Import this package:
8+//
9+// import io.quicktype.Converter;
10+//
11+// Then you can deserialize a JSON string with
12+//
13+// TopLevel data = Converter.fromJsonString(jsonString);
14+
15+package io.quicktype;
16+
17+import java.io.IOException;
18+import com.fasterxml.jackson.databind.*;
19+import com.fasterxml.jackson.databind.module.SimpleModule;
20+import com.fasterxml.jackson.core.JsonParser;
21+import com.fasterxml.jackson.core.JsonProcessingException;
22+import java.util.*;
23+import java.time.LocalDate;
24+import java.time.OffsetDateTime;
25+import java.time.OffsetTime;
26+import java.time.ZoneOffset;
27+import java.time.ZonedDateTime;
28+import java.time.format.DateTimeFormatter;
29+import java.time.format.DateTimeFormatterBuilder;
30+import java.time.temporal.ChronoField;
31+
32+public class Converter {
33+ // Date-time helpers
34+
35+ private static final DateTimeFormatter DATE_TIME_FORMATTER = new DateTimeFormatterBuilder()
36+ .appendOptional(DateTimeFormatter.ISO_DATE_TIME)
37+ .appendOptional(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
38+ .appendOptional(DateTimeFormatter.ISO_INSTANT)
39+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SX"))
40+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssX"))
41+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
42+ .toFormatter()
43+ .withZone(ZoneOffset.UTC);
44+
45+ public static OffsetDateTime parseDateTimeString(String str) {
46+ return ZonedDateTime.from(Converter.DATE_TIME_FORMATTER.parse(str)).toOffsetDateTime();
47+ }
48+
49+ private static final DateTimeFormatter TIME_FORMATTER = new DateTimeFormatterBuilder()
50+ .appendOptional(DateTimeFormatter.ISO_TIME)
51+ .appendOptional(DateTimeFormatter.ISO_OFFSET_TIME)
52+ .parseDefaulting(ChronoField.YEAR, 2020)
53+ .parseDefaulting(ChronoField.MONTH_OF_YEAR, 1)
54+ .parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
55+ .toFormatter()
56+ .withZone(ZoneOffset.UTC);
57+
58+ public static OffsetTime parseTimeString(String str) {
59+ return ZonedDateTime.from(Converter.TIME_FORMATTER.parse(str)).toOffsetDateTime().toOffsetTime();
60+ }
61+ // Serialize/deserialize helpers
62+
63+ public static TopLevel fromJsonString(String json) throws IOException {
64+ return getObjectReader().readValue(json);
65+ }
66+
67+ public static String toJsonString(TopLevel obj) throws JsonProcessingException {
68+ return getObjectWriter().writeValueAsString(obj);
69+ }
70+
71+ private static ObjectReader reader;
72+ private static ObjectWriter writer;
73+
74+ private static void instantiateMapper() {
75+ ObjectMapper mapper = new ObjectMapper();
76+ mapper.findAndRegisterModules();
77+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
78+ mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
79+ SimpleModule module = new SimpleModule();
80+ module.addDeserializer(OffsetDateTime.class, new JsonDeserializer<OffsetDateTime>() {
81+ @Override
82+ public OffsetDateTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
83+ String value = jsonParser.getText();
84+ return Converter.parseDateTimeString(value);
85+ }
86+ });
87+ mapper.registerModule(module);
88+ reader = mapper.readerFor(TopLevel.class);
89+ writer = mapper.writerFor(TopLevel.class);
90+ }
91+
92+ private static ObjectReader getObjectReader() {
93+ if (reader == null) instantiateMapper();
94+ return reader;
95+ }
96+
97+ private static ObjectWriter getObjectWriter() {
98+ if (writer == null) instantiateMapper();
99+ return writer;
100+ }
101+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / TopLevel.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class TopLevel {
6+ private Anyof anyof;
7+
8+ @JsonProperty("anyof")
9+ public Anyof getAnyof() { return anyof; }
10+ @JsonProperty("anyof")
11+ public void setAnyof(Anyof value) { this.anyof = value; }
12+}
Aschema-javadefault / src / main / java / io / quicktype / Anyof.java+18 −0
@@ -0,0 +1,18 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class Anyof {
6+ private String name;
7+ private String size;
8+
9+ @JsonProperty("name")
10+ public String getName() { return name; }
11+ @JsonProperty("name")
12+ public void setName(String value) { this.name = value; }
13+
14+ @JsonProperty("size")
15+ public String getSize() { return size; }
16+ @JsonProperty("size")
17+ public void setSize(String value) { this.size = value; }
18+}
Aschema-javadefault / src / main / java / io / quicktype / Converter.java+101 −0
@@ -0,0 +1,101 @@
1+// To use this code, add the following Maven dependency to your project:
2+//
3+//
4+// com.fasterxml.jackson.core : jackson-databind : 2.9.0
5+// com.fasterxml.jackson.datatype : jackson-datatype-jsr310 : 2.9.0
6+//
7+// Import this package:
8+//
9+// import io.quicktype.Converter;
10+//
11+// Then you can deserialize a JSON string with
12+//
13+// TopLevel data = Converter.fromJsonString(jsonString);
14+
15+package io.quicktype;
16+
17+import java.io.IOException;
18+import com.fasterxml.jackson.databind.*;
19+import com.fasterxml.jackson.databind.module.SimpleModule;
20+import com.fasterxml.jackson.core.JsonParser;
21+import com.fasterxml.jackson.core.JsonProcessingException;
22+import java.util.*;
23+import java.time.LocalDate;
24+import java.time.OffsetDateTime;
25+import java.time.OffsetTime;
26+import java.time.ZoneOffset;
27+import java.time.ZonedDateTime;
28+import java.time.format.DateTimeFormatter;
29+import java.time.format.DateTimeFormatterBuilder;
30+import java.time.temporal.ChronoField;
31+
32+public class Converter {
33+ // Date-time helpers
34+
35+ private static final DateTimeFormatter DATE_TIME_FORMATTER = new DateTimeFormatterBuilder()
36+ .appendOptional(DateTimeFormatter.ISO_DATE_TIME)
37+ .appendOptional(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
38+ .appendOptional(DateTimeFormatter.ISO_INSTANT)
39+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SX"))
40+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssX"))
41+ .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
42+ .toFormatter()
43+ .withZone(ZoneOffset.UTC);
44+
45+ public static OffsetDateTime parseDateTimeString(String str) {
46+ return ZonedDateTime.from(Converter.DATE_TIME_FORMATTER.parse(str)).toOffsetDateTime();
47+ }
48+
49+ private static final DateTimeFormatter TIME_FORMATTER = new DateTimeFormatterBuilder()
50+ .appendOptional(DateTimeFormatter.ISO_TIME)
51+ .appendOptional(DateTimeFormatter.ISO_OFFSET_TIME)
52+ .parseDefaulting(ChronoField.YEAR, 2020)
53+ .parseDefaulting(ChronoField.MONTH_OF_YEAR, 1)
54+ .parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
55+ .toFormatter()
56+ .withZone(ZoneOffset.UTC);
57+
58+ public static OffsetTime parseTimeString(String str) {
59+ return ZonedDateTime.from(Converter.TIME_FORMATTER.parse(str)).toOffsetDateTime().toOffsetTime();
60+ }
61+ // Serialize/deserialize helpers
62+
63+ public static TopLevel fromJsonString(String json) throws IOException {
64+ return getObjectReader().readValue(json);
65+ }
66+
67+ public static String toJsonString(TopLevel obj) throws JsonProcessingException {
68+ return getObjectWriter().writeValueAsString(obj);
69+ }
70+
71+ private static ObjectReader reader;
72+ private static ObjectWriter writer;
73+
74+ private static void instantiateMapper() {
75+ ObjectMapper mapper = new ObjectMapper();
76+ mapper.findAndRegisterModules();
77+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
78+ mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
79+ SimpleModule module = new SimpleModule();
80+ module.addDeserializer(OffsetDateTime.class, new JsonDeserializer<OffsetDateTime>() {
81+ @Override
82+ public OffsetDateTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
83+ String value = jsonParser.getText();
84+ return Converter.parseDateTimeString(value);
85+ }
86+ });
87+ mapper.registerModule(module);
88+ reader = mapper.readerFor(TopLevel.class);
89+ writer = mapper.writerFor(TopLevel.class);
90+ }
91+
92+ private static ObjectReader getObjectReader() {
93+ if (reader == null) instantiateMapper();
94+ return reader;
95+ }
96+
97+ private static ObjectWriter getObjectWriter() {
98+ if (writer == null) instantiateMapper();
99+ return writer;
100+ }
101+}
Aschema-javadefault / src / main / java / io / quicktype / TopLevel.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class TopLevel {
6+ private Anyof anyof;
7+
8+ @JsonProperty("anyof")
9+ public Anyof getAnyof() { return anyof; }
10+ @JsonProperty("anyof")
11+ public void setAnyof(Anyof value) { this.anyof = value; }
12+}
Aschema-javascriptdefault / TopLevel.js+186 −0
@@ -0,0 +1,186 @@
1+// To parse this data:
2+//
3+// const Convert = require("./TopLevel");
4+//
5+// const topLevel = Convert.toTopLevel(json);
6+//
7+// These functions will throw an error if the JSON doesn't
8+// match the expected interface, even if the JSON is valid.
9+
10+// Converts JSON strings to/from your types
11+// and asserts the results of JSON.parse at runtime
12+function toTopLevel(json) {
13+ return cast(JSON.parse(json), r("TopLevel"));
14+}
15+
16+function topLevelToJson(value) {
17+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
18+}
19+
20+function invalidValue(typ, val, key, parent = '') {
21+ const prettyTyp = prettyTypeName(typ);
22+ const parentText = parent ? ` on ${parent}` : '';
23+ const keyText = key ? ` for key "${key}"` : '';
24+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
25+}
26+
27+function prettyTypeName(typ) {
28+ if (Array.isArray(typ)) {
29+ if (typ.length === 2 && typ[0] === undefined) {
30+ return `an optional ${prettyTypeName(typ[1])}`;
31+ } else {
32+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
33+ }
34+ } else if (typeof typ === "object" && typ.literal !== undefined) {
35+ return typ.literal;
36+ } else {
37+ return typeof typ;
38+ }
39+}
40+
41+function jsonToJSProps(typ) {
42+ if (typ.jsonToJS === undefined) {
43+ const map = {};
44+ typ.props.forEach((p) => map[p.json] = { key: p.js, typ: p.typ });
45+ typ.jsonToJS = map;
46+ }
47+ return typ.jsonToJS;
48+}
49+
50+function jsToJSONProps(typ) {
51+ if (typ.jsToJSON === undefined) {
52+ const map = {};
53+ typ.props.forEach((p) => map[p.js] = { key: p.json, typ: p.typ });
54+ typ.jsToJSON = map;
55+ }
56+ return typ.jsToJSON;
57+}
58+
59+function transform(val, typ, getProps, key = '', parent = '') {
60+ function transformPrimitive(typ, val) {
61+ if (typeof typ === typeof val) return val;
62+ return invalidValue(typ, val, key, parent);
63+ }
64+
65+ function transformUnion(typs, val) {
66+ // val must validate against one typ in typs
67+ const l = typs.length;
68+ for (let i = 0; i < l; i++) {
69+ const typ = typs[i];
70+ try {
71+ return transform(val, typ, getProps);
72+ } catch (_) {}
73+ }
74+ return invalidValue(typs, val, key, parent);
75+ }
76+
77+ function transformEnum(cases, val) {
78+ if (cases.indexOf(val) !== -1) return val;
79+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
80+ }
81+
82+ function transformArray(typ, val) {
83+ // val must be an array with no invalid elements
84+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
85+ return val.map(el => transform(el, typ, getProps));
86+ }
87+
88+ function transformDate(val) {
89+ if (val === null) {
90+ return null;
91+ }
92+ const d = new Date(val);
93+ if (isNaN(d.valueOf())) {
94+ return invalidValue(l("Date"), val, key, parent);
95+ }
96+ return d;
97+ }
98+
99+ function transformObject(props, additional, val) {
100+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
101+ return invalidValue(l(ref || "object"), val, key, parent);
102+ }
103+ const result = {};
104+ Object.getOwnPropertyNames(props).forEach(key => {
105+ const prop = props[key];
106+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
107+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
108+ });
109+ Object.getOwnPropertyNames(val).forEach(key => {
110+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
111+ result[key] = transform(val[key], additional, getProps, key, ref);
112+ }
113+ });
114+ return result;
115+ }
116+
117+ if (typ === "any") return val;
118+ if (typ === null) {
119+ if (val === null) return val;
120+ return invalidValue(typ, val, key, parent);
121+ }
122+ if (typ === false) return invalidValue(typ, val, key, parent);
123+ let ref = undefined;
124+ while (typeof typ === "object" && typ.ref !== undefined) {
125+ ref = typ.ref;
126+ typ = typeMap[typ.ref];
127+ }
128+ if (Array.isArray(typ)) return transformEnum(typ, val);
129+ if (typeof typ === "object") {
130+ return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
131+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
132+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
133+ : invalidValue(typ, val, key, parent);
134+ }
135+ // Numbers can be parsed by Date but shouldn't be.
136+ if (typ === Date && typeof val !== "number") return transformDate(val);
137+ return transformPrimitive(typ, val);
138+}
139+
140+function cast(val, typ) {
141+ return transform(val, typ, jsonToJSProps);
142+}
143+
144+function uncast(val, typ) {
145+ return transform(val, typ, jsToJSONProps);
146+}
147+
148+function l(typ) {
149+ return { literal: typ };
150+}
151+
152+function a(typ) {
153+ return { arrayItems: typ };
154+}
155+
156+function u(...typs) {
157+ return { unionMembers: typs };
158+}
159+
160+function o(props, additional) {
161+ return { props, additional };
162+}
163+
164+function m(additional) {
165+ const props = [];
166+ return { props, additional };
167+}
168+
169+function r(name) {
170+ return { ref: name };
171+}
172+
173+const typeMap = {
174+ "TopLevel": o([
175+ { json: "anyof", js: "anyof", typ: r("Anyof") },
176+ ], false),
177+ "Anyof": o([
178+ { json: "name", js: "name", typ: "" },
179+ { json: "size", js: "size", typ: u(undefined, "") },
180+ ], false),
181+};
182+
183+module.exports = {
184+ "topLevelToJson": topLevelToJson,
185+ "toTopLevel": toTopLevel,
186+};
Aschema-kotlin-jacksondefault / TopLevel.kt+37 −0
@@ -0,0 +1,37 @@
1+// To parse the JSON, install jackson-module-kotlin and do:
2+//
3+// val topLevel = TopLevel.fromJson(jsonString)
4+
5+package quicktype
6+
7+import com.fasterxml.jackson.annotation.*
8+import com.fasterxml.jackson.core.*
9+import com.fasterxml.jackson.databind.*
10+import com.fasterxml.jackson.databind.deser.std.StdDeserializer
11+import com.fasterxml.jackson.databind.module.SimpleModule
12+import com.fasterxml.jackson.databind.node.*
13+import com.fasterxml.jackson.databind.ser.std.StdSerializer
14+import com.fasterxml.jackson.module.kotlin.*
15+
16+val mapper = jacksonObjectMapper().apply {
17+ propertyNamingStrategy = PropertyNamingStrategy.LOWER_CAMEL_CASE
18+ setSerializationInclusion(JsonInclude.Include.NON_NULL)
19+}
20+
21+data class TopLevel (
22+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
23+ val anyof: Anyof
24+) {
25+ fun toJson() = mapper.writeValueAsString(this)
26+
27+ companion object {
28+ fun fromJson(json: String) = mapper.readValue<TopLevel>(json)
29+ }
30+}
31+
32+data class Anyof (
33+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
34+ val name: String,
35+
36+ val size: String? = null
37+)
Aschema-kotlindefault / TopLevel.kt+24 −0
@@ -0,0 +1,24 @@
1+// To parse the JSON, install Klaxon and do:
2+//
3+// val topLevel = TopLevel.fromJson(jsonString)
4+
5+package quicktype
6+
7+import com.beust.klaxon.*
8+
9+private val klaxon = Klaxon()
10+
11+data class TopLevel (
12+ val anyof: Anyof
13+) {
14+ public fun toJson() = klaxon.toJsonString(this)
15+
16+ companion object {
17+ public fun fromJson(json: String) = klaxon.parse<TopLevel>(json)
18+ }
19+}
20+
21+data class Anyof (
22+ val name: String,
23+ val size: String? = null
24+)
Aschema-kotlinxdefault / TopLevel.kt+22 −0
@@ -0,0 +1,22 @@
1+// To parse the JSON, install kotlin's serialization plugin and do:
2+//
3+// val json = Json { allowStructuredMapKeys = true }
4+// val topLevel = json.parse(TopLevel.serializer(), jsonString)
5+
6+package quicktype
7+
8+import kotlinx.serialization.*
9+import kotlinx.serialization.json.*
10+import kotlinx.serialization.descriptors.*
11+import kotlinx.serialization.encoding.*
12+
13+@Serializable
14+data class TopLevel (
15+ val anyof: Anyof
16+)
17+
18+@Serializable
19+data class Anyof (
20+ val name: String,
21+ val size: String? = null
22+)
Aschema-phpdefault / TopLevel.php+263 −0
@@ -0,0 +1,263 @@
1+<?php
2+declare(strict_types=1);
3+
4+// This is an autogenerated file:TopLevel
5+
6+class TopLevel {
7+ private Anyof $anyof; // json:anyof Required
8+
9+ /**
10+ * @param Anyof $anyof
11+ */
12+ public function __construct(Anyof $anyof) {
13+ $this->anyof = $anyof;
14+ }
15+
16+ /**
17+ * @param stdClass $value
18+ * @throws Exception
19+ * @return Anyof
20+ */
21+ public static function fromAnyof(stdClass $value): Anyof {
22+ return Anyof::from($value); /*class*/
23+ }
24+
25+ /**
26+ * @throws Exception
27+ * @return stdClass
28+ */
29+ public function toAnyof(): stdClass {
30+ if (TopLevel::validateAnyof($this->anyof)) {
31+ return $this->anyof->to(); /*class*/
32+ }
33+ throw new Exception('never get to this TopLevel::anyof');
34+ }
35+
36+ /**
37+ * @param Anyof
38+ * @return bool
39+ * @throws Exception
40+ */
41+ public static function validateAnyof(Anyof $value): bool {
42+ $value->validate();
43+ return true;
44+ }
45+
46+ /**
47+ * @throws Exception
48+ * @return Anyof
49+ */
50+ public function getAnyof(): Anyof {
51+ if (TopLevel::validateAnyof($this->anyof)) {
52+ return $this->anyof;
53+ }
54+ throw new Exception('never get to getAnyof TopLevel::anyof');
55+ }
56+
57+ /**
58+ * @return Anyof
59+ */
60+ public static function sampleAnyof(): Anyof {
61+ return Anyof::sample(); /*31:anyof*/
62+ }
63+
64+ /**
65+ * @throws Exception
66+ * @return bool
67+ */
68+ public function validate(): bool {
69+ return TopLevel::validateAnyof($this->anyof);
70+ }
71+
72+ /**
73+ * @return stdClass
74+ * @throws Exception
75+ */
76+ public function to(): stdClass {
77+ $out = new stdClass();
78+ $out->{'anyof'} = $this->toAnyof();
79+ return $out;
80+ }
81+
82+ /**
83+ * @param stdClass $obj
84+ * @return TopLevel
85+ * @throws Exception
86+ */
87+ public static function from(stdClass $obj): TopLevel {
88+ return new TopLevel(
89+ TopLevel::fromAnyof($obj->{'anyof'})
90+ );
91+ }
92+
93+ /**
94+ * @return TopLevel
95+ */
96+ public static function sample(): TopLevel {
97+ return new TopLevel(
98+ TopLevel::sampleAnyof()
99+ );
100+ }
101+}
102+
103+// This is an autogenerated file:Anyof
104+
105+class Anyof {
106+ private string $name; // json:name Required
107+ private ?string $size; // json:size Optional
108+
109+ /**
110+ * @param string $name
111+ * @param string|null $size
112+ */
113+ public function __construct(string $name, ?string $size) {
114+ $this->name = $name;
115+ $this->size = $size;
116+ }
117+
118+ /**
119+ * @param string $value
120+ * @throws Exception
121+ * @return string
122+ */
123+ public static function fromName(string $value): string {
124+ return $value; /*string*/
125+ }
126+
127+ /**
128+ * @throws Exception
129+ * @return string
130+ */
131+ public function toName(): string {
132+ if (Anyof::validateName($this->name)) {
133+ return $this->name; /*string*/
134+ }
135+ throw new Exception('never get to this Anyof::name');
136+ }
137+
138+ /**
139+ * @param string
140+ * @return bool
141+ * @throws Exception
142+ */
143+ public static function validateName(string $value): bool {
144+ return true;
145+ }
146+
147+ /**
148+ * @throws Exception
149+ * @return string
150+ */
151+ public function getName(): string {
152+ if (Anyof::validateName($this->name)) {
153+ return $this->name;
154+ }
155+ throw new Exception('never get to getName Anyof::name');
156+ }
157+
158+ /**
159+ * @return string
160+ */
161+ public static function sampleName(): string {
162+ return 'Anyof::name::31'; /*31:name*/
163+ }
164+
165+ /**
166+ * @param ?string $value
167+ * @throws Exception
168+ * @return ?string
169+ */
170+ public static function fromSize(?string $value): ?string {
171+ if (!is_null($value)) {
172+ return $value; /*string*/
173+ } else {
174+ return null;
175+ }
176+ }
177+
178+ /**
179+ * @throws Exception
180+ * @return ?string
181+ */
182+ public function toSize(): ?string {
183+ if (Anyof::validateSize($this->size)) {
184+ if (!is_null($this->size)) {
185+ return $this->size; /*string*/
186+ } else {
187+ return null;
188+ }
189+ }
190+ throw new Exception('never get to this Anyof::size');
191+ }
192+
193+ /**
194+ * @param string|null
195+ * @return bool
196+ * @throws Exception
197+ */
198+ public static function validateSize(?string $value): bool {
199+ if (!is_null($value)) {
200+ }
201+ return true;
202+ }
203+
204+ /**
205+ * @throws Exception
206+ * @return ?string
207+ */
208+ public function getSize(): ?string {
209+ if (Anyof::validateSize($this->size)) {
210+ return $this->size;
211+ }
212+ throw new Exception('never get to getSize Anyof::size');
213+ }
214+
215+ /**
216+ * @return ?string
217+ */
218+ public static function sampleSize(): ?string {
219+ return 'Anyof::size::32'; /*32:size*/
220+ }
221+
222+ /**
223+ * @throws Exception
224+ * @return bool
225+ */
226+ public function validate(): bool {
227+ return Anyof::validateName($this->name)
228+ || Anyof::validateSize($this->size);
229+ }
230+
231+ /**
232+ * @return stdClass
233+ * @throws Exception
234+ */
235+ public function to(): stdClass {
236+ $out = new stdClass();
237+ $out->{'name'} = $this->toName();
238+ $out->{'size'} = $this->toSize();
239+ return $out;
240+ }
241+
242+ /**
243+ * @param stdClass $obj
244+ * @return Anyof
245+ * @throws Exception
246+ */
247+ public static function from(stdClass $obj): Anyof {
248+ return new Anyof(
249+ Anyof::fromName($obj->{'name'})
250+ ,Anyof::fromSize($obj->{'size'})
251+ );
252+ }
253+
254+ /**
255+ * @return Anyof
256+ */
257+ public static function sample(): Anyof {
258+ return new Anyof(
259+ Anyof::sampleName()
260+ ,Anyof::sampleSize()
261+ );
262+ }
263+}
Aschema-pikedefault / TopLevel.pmod+56 −0
@@ -0,0 +1,56 @@
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+ Anyof anyof; // json: "anyof"
17+
18+ string encode_json() {
19+ mapping(string:mixed) json = ([
20+ "anyof" : anyof,
21+ ]);
22+
23+ return Standards.JSON.encode(json);
24+ }
25+}
26+
27+TopLevel TopLevel_from_JSON(mixed json) {
28+ TopLevel retval = TopLevel();
29+
30+ retval.anyof = json["anyof"];
31+
32+ return retval;
33+}
34+
35+class Anyof {
36+ string name; // json: "name"
37+ mixed|string size; // json: "size"
38+
39+ string encode_json() {
40+ mapping(string:mixed) json = ([
41+ "name" : name,
42+ "size" : size,
43+ ]);
44+
45+ return Standards.JSON.encode(json);
46+ }
47+}
48+
49+Anyof Anyof_from_JSON(mixed json) {
50+ Anyof retval = Anyof();
51+
52+ retval.name = json["name"];
53+ retval.size = json["size"];
54+
55+ return retval;
56+}
Aschema-pythondefault / quicktype.py+73 −0
@@ -0,0 +1,73 @@
1+from dataclasses import dataclass
2+from typing import Any, TypeVar, Type, cast
3+
4+
5+T = TypeVar("T")
6+
7+
8+def from_str(x: Any) -> str:
9+ assert isinstance(x, str)
10+ return x
11+
12+
13+def from_none(x: Any) -> Any:
14+ assert x is None
15+ return x
16+
17+
18+def from_union(fs, x):
19+ for f in fs:
20+ try:
21+ return f(x)
22+ except:
23+ pass
24+ assert False
25+
26+
27+def to_class(c: Type[T], x: Any) -> dict:
28+ assert isinstance(x, c)
29+ return cast(Any, x).to_dict()
30+
31+
32+@dataclass
33+class Anyof:
34+ name: str
35+ size: str | None = None
36+
37+ @staticmethod
38+ def from_dict(obj: Any) -> 'Anyof':
39+ assert isinstance(obj, dict)
40+ name = from_str(obj.get("name"))
41+ size = from_union([from_str, from_none], obj.get("size"))
42+ return Anyof(name, size)
43+
44+ def to_dict(self) -> dict:
45+ result: dict = {}
46+ result["name"] = from_str(self.name)
47+ if self.size is not None:
48+ result["size"] = from_union([from_str, from_none], self.size)
49+ return result
50+
51+
52+@dataclass
53+class TopLevel:
54+ anyof: Anyof
55+
56+ @staticmethod
57+ def from_dict(obj: Any) -> 'TopLevel':
58+ assert isinstance(obj, dict)
59+ anyof = Anyof.from_dict(obj.get("anyof"))
60+ return TopLevel(anyof)
61+
62+ def to_dict(self) -> dict:
63+ result: dict = {}
64+ result["anyof"] = to_class(Anyof, self.anyof)
65+ return result
66+
67+
68+def top_level_from_dict(s: Any) -> TopLevel:
69+ return TopLevel.from_dict(s)
70+
71+
72+def top_level_to_dict(x: TopLevel) -> Any:
73+ return to_class(TopLevel, x)
Aschema-rubydefault / TopLevel.rb+73 −0
@@ -0,0 +1,73 @@
1+# This code may look unusually verbose for Ruby (and it is), but
2+# it performs some subtle and complex validation of JSON data.
3+#
4+# To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do:
5+#
6+# top_level = TopLevel.from_json! "{…}"
7+# puts top_level.anyof.anyof_name
8+#
9+# If from_json! succeeds, the value returned matches the schema.
10+
11+require 'json'
12+require 'dry-types'
13+require 'dry-struct'
14+
15+module Types
16+ include Dry.Types(default: :nominal)
17+
18+ Hash = Strict::Hash
19+ String = Strict::String
20+end
21+
22+class Anyof < Dry::Struct
23+ attribute :anyof_name, Types::String
24+ attribute :size, Types::String.optional
25+
26+ def self.from_dynamic!(d)
27+ d = Types::Hash[d]
28+ new(
29+ anyof_name: d.fetch("name"),
30+ size: d["size"],
31+ )
32+ end
33+
34+ def self.from_json!(json)
35+ from_dynamic!(JSON.parse(json))
36+ end
37+
38+ def to_dynamic
39+ {
40+ "name" => anyof_name,
41+ "size" => size,
42+ }
43+ end
44+
45+ def to_json(options = nil)
46+ JSON.generate(to_dynamic, options)
47+ end
48+end
49+
50+class TopLevel < Dry::Struct
51+ attribute :anyof, Anyof
52+
53+ def self.from_dynamic!(d)
54+ d = Types::Hash[d]
55+ new(
56+ anyof: Anyof.from_dynamic!(d.fetch("anyof")),
57+ )
58+ end
59+
60+ def self.from_json!(json)
61+ from_dynamic!(JSON.parse(json))
62+ end
63+
64+ def to_dynamic
65+ {
66+ "anyof" => anyof.to_dynamic,
67+ }
68+ end
69+
70+ def to_json(options = nil)
71+ JSON.generate(to_dynamic, options)
72+ end
73+end
Aschema-rustdefault / module_under_test.rs+26 −0
@@ -0,0 +1,26 @@
1+// Example code that deserializes and serializes the model.
2+// extern crate serde;
3+// #[macro_use]
4+// extern crate serde_derive;
5+// extern crate serde_json;
6+//
7+// use generated_module::TopLevel;
8+//
9+// fn main() {
10+// let json = r#"{"answer": 42}"#;
11+// let model: TopLevel = serde_json::from_str(&json).unwrap();
12+// }
13+
14+use serde::{Serialize, Deserialize};
15+
16+#[derive(Debug, Clone, Serialize, Deserialize)]
17+pub struct TopLevel {
18+ pub anyof: Anyof,
19+}
20+
21+#[derive(Debug, Clone, Serialize, Deserialize)]
22+pub struct Anyof {
23+ pub name: String,
24+
25+ pub size: Option<String>,
26+}
Aschema-scala3-upickledefault / TopLevel.scala+75 −0
@@ -0,0 +1,75 @@
1+package quicktype
2+
3+// Custom pickler so that missing keys and JSON nulls both read as None,
4+// and None is left out when writing (upickle's default for Option is a
5+// JSON array).
6+object OptionPickler extends upickle.AttributeTagged:
7+ import upickle.default.Writer
8+ import upickle.default.Reader
9+ override implicit def OptionWriter[T: Writer]: Writer[Option[T]] =
10+ implicitly[Writer[T]].comap[Option[T]] {
11+ case None => null.asInstanceOf[T]
12+ case Some(x) => x
13+ }
14+
15+ override implicit def OptionReader[T: Reader]: Reader[Option[T]] = {
16+ new Reader.Delegate[Any, Option[T]](implicitly[Reader[T]].map(Some(_))){
17+ override def visitNull(index: Int) = None
18+ }
19+ }
20+end OptionPickler
21+
22+// If a union has a null in, then we'll need this too...
23+type NullValue = None.type
24+given OptionPickler.ReadWriter[NullValue] = OptionPickler.readwriter[ujson.Value].bimap[NullValue](
25+ _ => ujson.Null,
26+ json => if json.isNull then None else throw new upickle.core.Abort("not null")
27+)
28+
29+object JsonExt:
30+ val valueReader = OptionPickler.readwriter[ujson.Value]
31+
32+ // upickle's built-in primitive readers are lenient -- the numeric and
33+ // boolean readers accept strings, and the string reader accepts
34+ // numbers and booleans -- so untagged unions need strict readers to
35+ // pick the right member.
36+ val strictString: OptionPickler.Reader[String] = valueReader.map {
37+ case ujson.Str(s) => s
38+ case json => throw new upickle.core.Abort("expected string, got " + json)
39+ }
40+ val strictLong: OptionPickler.Reader[Long] = valueReader.map {
41+ case ujson.Num(n) if n.isWhole => n.toLong
42+ case json => throw new upickle.core.Abort("expected integer, got " + json)
43+ }
44+ val strictDouble: OptionPickler.Reader[Double] = valueReader.map {
45+ case ujson.Num(n) => n
46+ case json => throw new upickle.core.Abort("expected number, got " + json)
47+ }
48+ val strictBoolean: OptionPickler.Reader[Boolean] = valueReader.map {
49+ case ujson.Bool(b) => b
50+ case json => throw new upickle.core.Abort("expected boolean, got " + json)
51+ }
52+
53+ def badMerge[T](r1: => OptionPickler.Reader[?], rest: OptionPickler.Reader[?]*): OptionPickler.Reader[T] = valueReader.map { json =>
54+ var t: T | Null = null
55+ val stack = Vector.newBuilder[Throwable]
56+ (r1 +: rest).foreach { reader =>
57+ if t == null then
58+ try
59+ t = OptionPickler.read[T](json, trace = true)(using reader.asInstanceOf[OptionPickler.Reader[T]])
60+ catch
61+ case exc => stack += exc
62+ }
63+ if t != null then t.nn else throw new Exception(json.toString(), stack.result().headOption.getOrElse(null))
64+ }
65+end JsonExt
66+
67+
68+case class TopLevel (
69+ val anyof : Anyof
70+) derives OptionPickler.ReadWriter
71+
72+case class Anyof (
73+ val name : String,
74+ val size : Option[String] = None
75+) derives OptionPickler.ReadWriter
Aschema-scala3default / TopLevel.scala+17 −0
@@ -0,0 +1,17 @@
1+package quicktype
2+
3+import io.circe.syntax._
4+import io.circe._
5+import cats.syntax.functor._
6+
7+// If a union has a null in, then we'll need this too...
8+type NullValue = None.type
9+
10+case class TopLevel (
11+ val anyof : Anyof
12+) derives Encoder.AsObject, Decoder
13+
14+case class Anyof (
15+ val name : String,
16+ val size : Option[String] = None
17+) derives Encoder.AsObject, Decoder
Aschema-schemadefault / TopLevel.schema+35 −0
@@ -0,0 +1,35 @@
1+{
2+ "$schema": "http://json-schema.org/draft-06/schema#",
3+ "$ref": "#/definitions/TopLevel",
4+ "definitions": {
5+ "TopLevel": {
6+ "type": "object",
7+ "additionalProperties": false,
8+ "properties": {
9+ "anyof": {
10+ "$ref": "#/definitions/Anyof"
11+ }
12+ },
13+ "required": [
14+ "anyof"
15+ ],
16+ "title": "TopLevel"
17+ },
18+ "Anyof": {
19+ "type": "object",
20+ "additionalProperties": false,
21+ "properties": {
22+ "name": {
23+ "type": "string"
24+ },
25+ "size": {
26+ "type": "string"
27+ }
28+ },
29+ "required": [
30+ "name"
31+ ],
32+ "title": "Anyof"
33+ }
34+ }
35+}
Aschema-swiftdefault / quicktype.swift+134 −0
@@ -0,0 +1,134 @@
1+// This file was generated from JSON Schema using quicktype, do not modify it directly.
2+// To parse the JSON, add this file to your project and do:
3+//
4+// let topLevel = try TopLevel(json)
5+
6+import Foundation
7+
8+// MARK: - TopLevel
9+struct TopLevel: Codable {
10+ let anyof: Anyof
11+
12+ enum CodingKeys: String, CodingKey {
13+ case anyof = "anyof"
14+ }
15+}
16+
17+// MARK: TopLevel convenience initializers and mutators
18+
19+extension TopLevel {
20+ init(data: Data) throws {
21+ self = try newJSONDecoder().decode(TopLevel.self, from: data)
22+ }
23+
24+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
25+ guard let data = json.data(using: encoding) else {
26+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
27+ }
28+ try self.init(data: data)
29+ }
30+
31+ init(fromURL url: URL) throws {
32+ try self.init(data: try Data(contentsOf: url))
33+ }
34+
35+ func with(
36+ anyof: Anyof? = nil
37+ ) -> TopLevel {
38+ return TopLevel(
39+ anyof: anyof ?? self.anyof
40+ )
41+ }
42+
43+ func jsonData() throws -> Data {
44+ return try newJSONEncoder().encode(self)
45+ }
46+
47+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
48+ return String(data: try self.jsonData(), encoding: encoding)
49+ }
50+}
51+
52+// MARK: - Anyof
53+struct Anyof: Codable {
54+ let name: String
55+ let size: String?
56+
57+ enum CodingKeys: String, CodingKey {
58+ case name = "name"
59+ case size = "size"
60+ }
61+}
62+
63+// MARK: Anyof convenience initializers and mutators
64+
65+extension Anyof {
66+ init(data: Data) throws {
67+ self = try newJSONDecoder().decode(Anyof.self, from: data)
68+ }
69+
70+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
71+ guard let data = json.data(using: encoding) else {
72+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
73+ }
74+ try self.init(data: data)
75+ }
76+
77+ init(fromURL url: URL) throws {
78+ try self.init(data: try Data(contentsOf: url))
79+ }
80+
81+ func with(
82+ name: String? = nil,
83+ size: String?? = nil
84+ ) -> Anyof {
85+ return Anyof(
86+ name: name ?? self.name,
87+ size: size ?? self.size
88+ )
89+ }
90+
91+ func jsonData() throws -> Data {
92+ return try newJSONEncoder().encode(self)
93+ }
94+
95+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
96+ return String(data: try self.jsonData(), encoding: encoding)
97+ }
98+}
99+
100+// MARK: - Helper functions for creating encoders and decoders
101+
102+func newJSONDecoder() -> JSONDecoder {
103+ let decoder = JSONDecoder()
104+ decoder.dateDecodingStrategy = .custom({ (decoder) -> Date in
105+ let container = try decoder.singleValueContainer()
106+ let dateStr = try container.decode(String.self)
107+
108+ let formatter = DateFormatter()
109+ formatter.calendar = Calendar(identifier: .iso8601)
110+ formatter.locale = Locale(identifier: "en_US_POSIX")
111+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
112+ formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"
113+ if let date = formatter.date(from: dateStr) {
114+ return date
115+ }
116+ formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX"
117+ if let date = formatter.date(from: dateStr) {
118+ return date
119+ }
120+ throw DecodingError.typeMismatch(Date.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Could not decode date"))
121+ })
122+ return decoder
123+}
124+
125+func newJSONEncoder() -> JSONEncoder {
126+ let encoder = JSONEncoder()
127+ let formatter = DateFormatter()
128+ formatter.calendar = Calendar(identifier: .iso8601)
129+ formatter.locale = Locale(identifier: "en_US_POSIX")
130+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
131+ formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX"
132+ encoder.dateEncodingStrategy = .formatted(formatter)
133+ return encoder
134+}
Aschema-typescript-zoddefault / TopLevel.ts+13 −0
@@ -0,0 +1,13 @@
1+import * as z from "zod";
2+
3+
4+export const AnyofSchema = z.object({
5+ "name": z.string(),
6+ "size": z.string().optional(),
7+});
8+export type Anyof = z.infer<typeof AnyofSchema>;
9+
10+export const TopLevelSchema = z.object({
11+ "anyof": AnyofSchema,
12+});
13+export type TopLevel = z.infer<typeof TopLevelSchema>;
Aschema-typescriptdefault / TopLevel.ts+192 −0
@@ -0,0 +1,192 @@
1+// To parse this data:
2+//
3+// import { Convert, TopLevel } from "./TopLevel";
4+//
5+// const topLevel = Convert.toTopLevel(json);
6+//
7+// These functions will throw an error if the JSON doesn't
8+// match the expected interface, even if the JSON is valid.
9+
10+export interface TopLevel {
11+ anyof: Anyof;
12+}
13+
14+export interface Anyof {
15+ name: string;
16+ size?: string;
17+}
18+
19+// Converts JSON strings to/from your types
20+// and asserts the results of JSON.parse at runtime
21+export class Convert {
22+ public static toTopLevel(json: string): TopLevel {
23+ return cast(JSON.parse(json), r("TopLevel"));
24+ }
25+
26+ public static topLevelToJson(value: TopLevel): string {
27+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
28+ }
29+}
30+
31+function invalidValue(typ: any, val: any, key: any, parent: any = ''): never {
32+ const prettyTyp = prettyTypeName(typ);
33+ const parentText = parent ? ` on ${parent}` : '';
34+ const keyText = key ? ` for key "${key}"` : '';
35+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
36+}
37+
38+function prettyTypeName(typ: any): string {
39+ if (Array.isArray(typ)) {
40+ if (typ.length === 2 && typ[0] === undefined) {
41+ return `an optional ${prettyTypeName(typ[1])}`;
42+ } else {
43+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
44+ }
45+ } else if (typeof typ === "object" && typ.literal !== undefined) {
46+ return typ.literal;
47+ } else {
48+ return typeof typ;
49+ }
50+}
51+
52+function jsonToJSProps(typ: any): any {
53+ if (typ.jsonToJS === undefined) {
54+ const map: any = {};
55+ typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
56+ typ.jsonToJS = map;
57+ }
58+ return typ.jsonToJS;
59+}
60+
61+function jsToJSONProps(typ: any): any {
62+ if (typ.jsToJSON === undefined) {
63+ const map: any = {};
64+ typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
65+ typ.jsToJSON = map;
66+ }
67+ return typ.jsToJSON;
68+}
69+
70+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
71+ function transformPrimitive(typ: string, val: any): any {
72+ if (typeof typ === typeof val) return val;
73+ return invalidValue(typ, val, key, parent);
74+ }
75+
76+ function transformUnion(typs: any[], val: any): any {
77+ // val must validate against one typ in typs
78+ const l = typs.length;
79+ for (let i = 0; i < l; i++) {
80+ const typ = typs[i];
81+ try {
82+ return transform(val, typ, getProps);
83+ } catch (_) {}
84+ }
85+ return invalidValue(typs, val, key, parent);
86+ }
87+
88+ function transformEnum(cases: string[], val: any): any {
89+ if (cases.indexOf(val) !== -1) return val;
90+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
91+ }
92+
93+ function transformArray(typ: any, val: any): any {
94+ // val must be an array with no invalid elements
95+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
96+ return val.map(el => transform(el, typ, getProps));
97+ }
98+
99+ function transformDate(val: any): any {
100+ if (val === null) {
101+ return null;
102+ }
103+ const d = new Date(val);
104+ if (isNaN(d.valueOf())) {
105+ return invalidValue(l("Date"), val, key, parent);
106+ }
107+ return d;
108+ }
109+
110+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
111+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
112+ return invalidValue(l(ref || "object"), val, key, parent);
113+ }
114+ const result: any = {};
115+ Object.getOwnPropertyNames(props).forEach(key => {
116+ const prop = props[key];
117+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
118+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
119+ });
120+ Object.getOwnPropertyNames(val).forEach(key => {
121+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
122+ result[key] = transform(val[key], additional, getProps, key, ref);
123+ }
124+ });
125+ return result;
126+ }
127+
128+ if (typ === "any") return val;
129+ if (typ === null) {
130+ if (val === null) return val;
131+ return invalidValue(typ, val, key, parent);
132+ }
133+ if (typ === false) return invalidValue(typ, val, key, parent);
134+ let ref: any = undefined;
135+ while (typeof typ === "object" && typ.ref !== undefined) {
136+ ref = typ.ref;
137+ typ = typeMap[typ.ref];
138+ }
139+ if (Array.isArray(typ)) return transformEnum(typ, val);
140+ if (typeof typ === "object") {
141+ return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
142+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
143+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
144+ : invalidValue(typ, val, key, parent);
145+ }
146+ // Numbers can be parsed by Date but shouldn't be.
147+ if (typ === Date && typeof val !== "number") return transformDate(val);
148+ return transformPrimitive(typ, val);
149+}
150+
151+function cast<T>(val: any, typ: any): T {
152+ return transform(val, typ, jsonToJSProps);
153+}
154+
155+function uncast<T>(val: T, typ: any): any {
156+ return transform(val, typ, jsToJSONProps);
157+}
158+
159+function l(typ: any) {
160+ return { literal: typ };
161+}
162+
163+function a(typ: any) {
164+ return { arrayItems: typ };
165+}
166+
167+function u(...typs: any[]) {
168+ return { unionMembers: typs };
169+}
170+
171+function o(props: any[], additional: any) {
172+ return { props, additional };
173+}
174+
175+function m(additional: any) {
176+ const props: any[] = [];
177+ return { props, additional };
178+}
179+
180+function r(name: string) {
181+ return { ref: name };
182+}
183+
184+const typeMap: any = {
185+ "TopLevel": o([
186+ { json: "anyof", js: "anyof", typ: r("Anyof") },
187+ ], false),
188+ "Anyof": o([
189+ { json: "name", js: "name", typ: "" },
190+ { json: "size", js: "size", typ: u(undefined, "") },
191+ ], false),
192+};
Test case

test/inputs/schema/vega-lite.schema

118 generated files · +5,390 −6,400
Mschema-cplusplusdefault / quicktype.hpp+312 −312
@@ -2399,7 +2399,7 @@ namespace quicktype {
23992399 private:
24002400 std::optional<double> count;
24012401 std::optional<std::vector<double>> extent;
2402- std::optional<std::string> scheme;
2402+ std::string scheme;
24032403 std::optional<double> step;
24042404
24052405 public:
@@ -2411,9 +2411,9 @@ namespace quicktype {
24112411 std::optional<std::vector<double>> & get_mutable_extent() { return extent; }
24122412 void set_extent(const std::optional<std::vector<double>> & value) { this->extent = value; }
24132413
2414- const std::optional<std::string> & get_scheme() const { return scheme; }
2415- std::optional<std::string> & get_mutable_scheme() { return scheme; }
2416- void set_scheme(const std::optional<std::string> & value) { this->scheme = value; }
2414+ const std::string & get_scheme() const { return scheme; }
2415+ std::string & get_mutable_scheme() { return scheme; }
2416+ void set_scheme(const std::string & value) { this->scheme = value; }
24172417
24182418 const std::optional<double> & get_step() const { return step; }
24192419 std::optional<double> & get_mutable_step() { return step; }
@@ -2979,7 +2979,7 @@ namespace quicktype {
29792979 private:
29802980 std::optional<std::string> element;
29812981 std::string input;
2982- std::optional<std::vector<std::string>> options;
2982+ std::vector<std::string> options;
29832983 std::optional<double> max;
29842984 std::optional<double> min;
29852985 std::optional<double> step;
@@ -2993,9 +2993,9 @@ namespace quicktype {
29932993 std::string & get_mutable_input() { return input; }
29942994 void set_input(const std::string & value) { this->input = value; }
29952995
2996- const std::optional<std::vector<std::string>> & get_options() const { return options; }
2997- std::optional<std::vector<std::string>> & get_mutable_options() { return options; }
2998- void set_options(const std::optional<std::vector<std::string>> & value) { this->options = value; }
2996+ const std::vector<std::string> & get_options() const { return options; }
2997+ std::vector<std::string> & get_mutable_options() { return options; }
2998+ void set_options(const std::vector<std::string> & value) { this->options = value; }
29992999
30003000 const std::optional<double> & get_max() const { return max; }
30013001 std::optional<double> & get_mutable_max() { return max; }
@@ -4879,9 +4879,9 @@ namespace quicktype {
48794879
48804880 private:
48814881 std::optional<DataFormat> format;
4882- std::optional<std::string> url;
4883- std::optional<Values> values;
4884- std::optional<std::string> name;
4882+ std::string url;
4883+ Values values;
4884+ std::string name;
48854885
48864886 public:
48874887 /**
@@ -4899,9 +4899,9 @@ namespace quicktype {
48994899 * An URL from which to load the data set. Use the `format.type` property
49004900 * to ensure the loaded data is correctly parsed.
49014901 */
4902- const std::optional<std::string> & get_url() const { return url; }
4903- std::optional<std::string> & get_mutable_url() { return url; }
4904- void set_url(const std::optional<std::string> & value) { this->url = value; }
4902+ const std::string & get_url() const { return url; }
4903+ std::string & get_mutable_url() { return url; }
4904+ void set_url(const std::string & value) { this->url = value; }
49054905
49064906 /**
49074907 * The full data set, included inline. This can be an array of objects or primitive values
@@ -4909,16 +4909,16 @@ namespace quicktype {
49094909 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
49104910 * parsed according to the specified format type.
49114911 */
4912- const std::optional<Values> & get_values() const { return values; }
4913- std::optional<Values> & get_mutable_values() { return values; }
4914- void set_values(const std::optional<Values> & value) { this->values = value; }
4912+ const Values & get_values() const { return values; }
4913+ Values & get_mutable_values() { return values; }
4914+ void set_values(const Values & value) { this->values = value; }
49154915
49164916 /**
49174917 * Provide a placeholder name and bind data at runtime.
49184918 */
4919- const std::optional<std::string> & get_name() const { return name; }
4920- std::optional<std::string> & get_mutable_name() { return name; }
4921- void set_name(const std::optional<std::string> & value) { this->name = value; }
4919+ const std::string & get_name() const { return name; }
4920+ std::string & get_mutable_name() { return name; }
4921+ void set_name(const std::string & value) { this->name = value; }
49224922 };
49234923
49244924 /**
@@ -5047,22 +5047,22 @@ namespace quicktype {
50475047 virtual ~Selection() = default;
50485048
50495049 private:
5050- std::shared_ptr<SelectionOperand> selection_not;
5051- std::optional<std::vector<SelectionOperand>> selection_and;
5052- std::optional<std::vector<SelectionOperand>> selection_or;
5050+ SelectionOperand selection_not;
5051+ std::vector<SelectionOperand> selection_and;
5052+ std::vector<SelectionOperand> selection_or;
50535053
50545054 public:
5055- const std::shared_ptr<SelectionOperand> & get_selection_not() const { return selection_not; }
5056- std::shared_ptr<SelectionOperand> & get_mutable_selection_not() { return selection_not; }
5057- void set_selection_not(const std::shared_ptr<SelectionOperand> & value) { this->selection_not = value; }
5055+ const SelectionOperand & get_selection_not() const { return selection_not; }
5056+ SelectionOperand & get_mutable_selection_not() { return selection_not; }
5057+ void set_selection_not(const SelectionOperand & value) { this->selection_not = value; }
50585058
5059- const std::optional<std::vector<SelectionOperand>> & get_selection_and() const { return selection_and; }
5060- std::optional<std::vector<SelectionOperand>> & get_mutable_selection_and() { return selection_and; }
5061- void set_selection_and(const std::optional<std::vector<SelectionOperand>> & value) { this->selection_and = value; }
5059+ const std::vector<SelectionOperand> & get_selection_and() const { return selection_and; }
5060+ std::vector<SelectionOperand> & get_mutable_selection_and() { return selection_and; }
5061+ void set_selection_and(const std::vector<SelectionOperand> & value) { this->selection_and = value; }
50625062
5063- const std::optional<std::vector<SelectionOperand>> & get_selection_or() const { return selection_or; }
5064- std::optional<std::vector<SelectionOperand>> & get_mutable_selection_or() { return selection_or; }
5065- void set_selection_or(const std::optional<std::vector<SelectionOperand>> & value) { this->selection_or = value; }
5063+ const std::vector<SelectionOperand> & get_selection_or() const { return selection_or; }
5064+ std::vector<SelectionOperand> & get_mutable_selection_or() { return selection_or; }
5065+ void set_selection_or(const std::vector<SelectionOperand> & value) { this->selection_or = value; }
50665066 };
50675067
50685068 using Day = std::variant<double, std::string>;
@@ -5212,44 +5212,44 @@ namespace quicktype {
52125212 virtual ~Predicate() = default;
52135213
52145214 private:
5215- std::shared_ptr<LogicalOperandPredicate> predicate_not;
5216- std::optional<std::vector<LogicalOperandPredicate>> predicate_and;
5217- std::optional<std::vector<LogicalOperandPredicate>> predicate_or;
5218- std::optional<Equal> equal;
5219- std::optional<std::string> field;
5215+ LogicalOperandPredicate predicate_not;
5216+ std::vector<LogicalOperandPredicate> predicate_and;
5217+ std::vector<LogicalOperandPredicate> predicate_or;
5218+ Equal equal;
5219+ std::string field;
52205220 std::optional<TimeUnit> time_unit;
5221- std::optional<std::vector<RangeElement>> range;
5222- std::optional<std::vector<Equal>> one_of;
5223- std::shared_ptr<SelectionOperand> selection;
5221+ std::vector<RangeElement> range;
5222+ std::vector<Equal> one_of;
5223+ SelectionOperand selection;
52245224
52255225 public:
5226- const std::shared_ptr<LogicalOperandPredicate> & get_predicate_not() const { return predicate_not; }
5227- std::shared_ptr<LogicalOperandPredicate> & get_mutable_predicate_not() { return predicate_not; }
5228- void set_predicate_not(const std::shared_ptr<LogicalOperandPredicate> & value) { this->predicate_not = value; }
5226+ const LogicalOperandPredicate & get_predicate_not() const { return predicate_not; }
5227+ LogicalOperandPredicate & get_mutable_predicate_not() { return predicate_not; }
5228+ void set_predicate_not(const LogicalOperandPredicate & value) { this->predicate_not = value; }
52295229
5230- const std::optional<std::vector<LogicalOperandPredicate>> & get_predicate_and() const { return predicate_and; }
5231- std::optional<std::vector<LogicalOperandPredicate>> & get_mutable_predicate_and() { return predicate_and; }
5232- void set_predicate_and(const std::optional<std::vector<LogicalOperandPredicate>> & value) { this->predicate_and = value; }
5230+ const std::vector<LogicalOperandPredicate> & get_predicate_and() const { return predicate_and; }
5231+ std::vector<LogicalOperandPredicate> & get_mutable_predicate_and() { return predicate_and; }
5232+ void set_predicate_and(const std::vector<LogicalOperandPredicate> & value) { this->predicate_and = value; }
52335233
5234- const std::optional<std::vector<LogicalOperandPredicate>> & get_predicate_or() const { return predicate_or; }
5235- std::optional<std::vector<LogicalOperandPredicate>> & get_mutable_predicate_or() { return predicate_or; }
5236- void set_predicate_or(const std::optional<std::vector<LogicalOperandPredicate>> & value) { this->predicate_or = value; }
5234+ const std::vector<LogicalOperandPredicate> & get_predicate_or() const { return predicate_or; }
5235+ std::vector<LogicalOperandPredicate> & get_mutable_predicate_or() { return predicate_or; }
5236+ void set_predicate_or(const std::vector<LogicalOperandPredicate> & value) { this->predicate_or = value; }
52375237
52385238 /**
52395239 * The value that the field should be equal to.
52405240 */
5241- const std::optional<Equal> & get_equal() const { return equal; }
5242- std::optional<Equal> & get_mutable_equal() { return equal; }
5243- void set_equal(const std::optional<Equal> & value) { this->equal = value; }
5241+ const Equal & get_equal() const { return equal; }
5242+ Equal & get_mutable_equal() { return equal; }
5243+ void set_equal(const Equal & value) { this->equal = value; }
52445244
52455245 /**
52465246 * Field to be filtered.
52475247 *
52485248 * Field to be filtered
52495249 */
5250- const std::optional<std::string> & get_field() const { return field; }
5251- std::optional<std::string> & get_mutable_field() { return field; }
5252- void set_field(const std::optional<std::string> & value) { this->field = value; }
5250+ const std::string & get_field() const { return field; }
5251+ std::string & get_mutable_field() { return field; }
5252+ void set_field(const std::string & value) { this->field = value; }
52535253
52545254 /**
52555255 * Time unit for the field to be filtered.
@@ -5264,24 +5264,24 @@ namespace quicktype {
52645264 * An array of inclusive minimum and maximum values
52655265 * for a field value of a data item to be included in the filtered data.
52665266 */
5267- const std::optional<std::vector<RangeElement>> & get_range() const { return range; }
5268- std::optional<std::vector<RangeElement>> & get_mutable_range() { return range; }
5269- void set_range(const std::optional<std::vector<RangeElement>> & value) { this->range = value; }
5267+ const std::vector<RangeElement> & get_range() const { return range; }
5268+ std::vector<RangeElement> & get_mutable_range() { return range; }
5269+ void set_range(const std::vector<RangeElement> & value) { this->range = value; }
52705270
52715271 /**
52725272 * A set of values that the `field`'s value should be a member of,
52735273 * for a data item included in the filtered data.
52745274 */
5275- const std::optional<std::vector<Equal>> & get_one_of() const { return one_of; }
5276- std::optional<std::vector<Equal>> & get_mutable_one_of() { return one_of; }
5277- void set_one_of(const std::optional<std::vector<Equal>> & value) { this->one_of = value; }
5275+ const std::vector<Equal> & get_one_of() const { return one_of; }
5276+ std::vector<Equal> & get_mutable_one_of() { return one_of; }
5277+ void set_one_of(const std::vector<Equal> & value) { this->one_of = value; }
52785278
52795279 /**
52805280 * Filter using a selection name.
52815281 */
5282- const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; }
5283- std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; }
5284- void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; }
5282+ const SelectionOperand & get_selection() const { return selection; }
5283+ SelectionOperand & get_mutable_selection() { return selection; }
5284+ void set_selection(const SelectionOperand & value) { this->selection = value; }
52855285 };
52865286
52875287 using ConditionalValueDefValue = std::variant<bool, double, std::string>;
@@ -5292,14 +5292,14 @@ namespace quicktype {
52925292 virtual ~ConditionalValueDef() = default;
52935293
52945294 private:
5295- std::shared_ptr<LogicalOperandPredicate> test;
5295+ LogicalOperandPredicate test;
52965296 ConditionalValueDefValue value;
5297- std::shared_ptr<SelectionOperand> selection;
5297+ SelectionOperand selection;
52985298
52995299 public:
5300- const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; }
5301- std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; }
5302- void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; }
5300+ const LogicalOperandPredicate & get_test() const { return test; }
5301+ LogicalOperandPredicate & get_mutable_test() { return test; }
5302+ void set_test(const LogicalOperandPredicate & value) { this->test = value; }
53035303
53045304 /**
53055305 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -5313,9 +5313,9 @@ namespace quicktype {
53135313 * A [selection name](selection.html), or a series of [composed
53145314 * selections](selection.html#compose).
53155315 */
5316- const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; }
5317- std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; }
5318- void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; }
5316+ const SelectionOperand & get_selection() const { return selection; }
5317+ SelectionOperand & get_mutable_selection() { return selection; }
5318+ void set_selection(const SelectionOperand & value) { this->selection = value; }
53195319 };
53205320
53215321 enum class RepeatEnum : int { ROW, COLUMN };
@@ -5960,9 +5960,9 @@ namespace quicktype {
59605960 virtual ~ConditionalPredicateMarkPropFieldDefClass() = default;
59615961
59625962 private:
5963- std::shared_ptr<LogicalOperandPredicate> test;
5964- std::optional<ConditionalValueDefValue> value;
5965- std::shared_ptr<SelectionOperand> selection;
5963+ LogicalOperandPredicate test;
5964+ ConditionalValueDefValue value;
5965+ SelectionOperand selection;
59665966 std::optional<AggregateOp> aggregate;
59675967 std::optional<Bin> bin;
59685968 std::optional<Field> field;
@@ -5970,28 +5970,28 @@ namespace quicktype {
59705970 std::optional<Scale> scale;
59715971 SortUnion sort;
59725972 std::optional<TimeUnit> time_unit;
5973- std::optional<Type> type;
5973+ Type type;
59745974
59755975 public:
5976- const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; }
5977- std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; }
5978- void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; }
5976+ const LogicalOperandPredicate & get_test() const { return test; }
5977+ LogicalOperandPredicate & get_mutable_test() { return test; }
5978+ void set_test(const LogicalOperandPredicate & value) { this->test = value; }
59795979
59805980 /**
59815981 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
59825982 * `0` to `1` for opacity).
59835983 */
5984- const std::optional<ConditionalValueDefValue> & get_value() const { return value; }
5985- std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; }
5986- void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; }
5984+ const ConditionalValueDefValue & get_value() const { return value; }
5985+ ConditionalValueDefValue & get_mutable_value() { return value; }
5986+ void set_value(const ConditionalValueDefValue & value) { this->value = value; }
59875987
59885988 /**
59895989 * A [selection name](selection.html), or a series of [composed
59905990 * selections](selection.html#compose).
59915991 */
5992- const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; }
5993- std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; }
5994- void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; }
5992+ const SelectionOperand & get_selection() const { return selection; }
5993+ SelectionOperand & get_mutable_selection() { return selection; }
5994+ void set_selection(const SelectionOperand & value) { this->selection = value; }
59955995
59965996 /**
59975997 * Aggregation function for the field
@@ -6077,9 +6077,9 @@ namespace quicktype {
60776077 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
60786078 * [geographic projection](projection.html) is applied.
60796079 */
6080- const std::optional<Type> & get_type() const { return type; }
6081- std::optional<Type> & get_mutable_type() { return type; }
6082- void set_type(const std::optional<Type> & value) { this->type = value; }
6080+ const Type & get_type() const { return type; }
6081+ Type & get_mutable_type() { return type; }
6082+ void set_type(const Type & value) { this->type = value; }
60836083 };
60846084
60856085 using ColorCondition = std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateMarkPropFieldDefClass>;
@@ -6141,7 +6141,7 @@ namespace quicktype {
61416141 std::optional<Scale> scale;
61426142 SortUnion sort;
61436143 std::optional<TimeUnit> time_unit;
6144- std::optional<Type> type;
6144+ Type type;
61456145 std::optional<ConditionalValueDefValue> value;
61466146
61476147 public:
@@ -6242,9 +6242,9 @@ namespace quicktype {
62426242 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
62436243 * [geographic projection](projection.html) is applied.
62446244 */
6245- const std::optional<Type> & get_type() const { return type; }
6246- std::optional<Type> & get_mutable_type() { return type; }
6247- void set_type(const std::optional<Type> & value) { this->type = value; }
6245+ const Type & get_type() const { return type; }
6246+ Type & get_mutable_type() { return type; }
6247+ void set_type(const Type & value) { this->type = value; }
62486248
62496249 /**
62506250 * A constant value in visual domain.
@@ -6489,35 +6489,35 @@ namespace quicktype {
64896489 virtual ~ConditionalPredicateFieldDefClass() = default;
64906490
64916491 private:
6492- std::shared_ptr<LogicalOperandPredicate> test;
6493- std::optional<ConditionalValueDefValue> value;
6494- std::shared_ptr<SelectionOperand> selection;
6492+ LogicalOperandPredicate test;
6493+ ConditionalValueDefValue value;
6494+ SelectionOperand selection;
64956495 std::optional<AggregateOp> aggregate;
64966496 std::optional<Bin> bin;
64976497 std::optional<Field> field;
64986498 std::optional<TimeUnit> time_unit;
6499- std::optional<Type> type;
6499+ Type type;
65006500
65016501 public:
6502- const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; }
6503- std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; }
6504- void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; }
6502+ const LogicalOperandPredicate & get_test() const { return test; }
6503+ LogicalOperandPredicate & get_mutable_test() { return test; }
6504+ void set_test(const LogicalOperandPredicate & value) { this->test = value; }
65056505
65066506 /**
65076507 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
65086508 * `0` to `1` for opacity).
65096509 */
6510- const std::optional<ConditionalValueDefValue> & get_value() const { return value; }
6511- std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; }
6512- void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; }
6510+ const ConditionalValueDefValue & get_value() const { return value; }
6511+ ConditionalValueDefValue & get_mutable_value() { return value; }
6512+ void set_value(const ConditionalValueDefValue & value) { this->value = value; }
65136513
65146514 /**
65156515 * A [selection name](selection.html), or a series of [composed
65166516 * selections](selection.html#compose).
65176517 */
6518- const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; }
6519- std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; }
6520- void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; }
6518+ const SelectionOperand & get_selection() const { return selection; }
6519+ SelectionOperand & get_mutable_selection() { return selection; }
6520+ void set_selection(const SelectionOperand & value) { this->selection = value; }
65216521
65226522 /**
65236523 * Aggregation function for the field
@@ -6572,9 +6572,9 @@ namespace quicktype {
65726572 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
65736573 * [geographic projection](projection.html) is applied.
65746574 */
6575- const std::optional<Type> & get_type() const { return type; }
6576- std::optional<Type> & get_mutable_type() { return type; }
6577- void set_type(const std::optional<Type> & value) { this->type = value; }
6575+ const Type & get_type() const { return type; }
6576+ Type & get_mutable_type() { return type; }
6577+ void set_type(const Type & value) { this->type = value; }
65786578 };
65796579
65806580 using HrefCondition = std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateFieldDefClass>;
@@ -6606,7 +6606,7 @@ namespace quicktype {
66066606 std::optional<HrefCondition> condition;
66076607 std::optional<Field> field;
66086608 std::optional<TimeUnit> time_unit;
6609- std::optional<Type> type;
6609+ Type type;
66106610 std::optional<ConditionalValueDefValue> value;
66116611
66126612 public:
@@ -6676,9 +6676,9 @@ namespace quicktype {
66766676 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
66776677 * [geographic projection](projection.html) is applied.
66786678 */
6679- const std::optional<Type> & get_type() const { return type; }
6680- std::optional<Type> & get_mutable_type() { return type; }
6681- void set_type(const std::optional<Type> & value) { this->type = value; }
6679+ const Type & get_type() const { return type; }
6680+ Type & get_mutable_type() { return type; }
6681+ void set_type(const Type & value) { this->type = value; }
66826682
66836683 /**
66846684 * A constant value in visual domain.
@@ -6774,36 +6774,36 @@ namespace quicktype {
67746774 virtual ~ConditionalPredicateTextFieldDefClass() = default;
67756775
67766776 private:
6777- std::shared_ptr<LogicalOperandPredicate> test;
6778- std::optional<ConditionalValueDefValue> value;
6779- std::shared_ptr<SelectionOperand> selection;
6777+ LogicalOperandPredicate test;
6778+ ConditionalValueDefValue value;
6779+ SelectionOperand selection;
67806780 std::optional<AggregateOp> aggregate;
67816781 std::optional<Bin> bin;
67826782 std::optional<Field> field;
67836783 std::optional<std::string> format;
67846784 std::optional<TimeUnit> time_unit;
6785- std::optional<Type> type;
6785+ Type type;
67866786
67876787 public:
6788- const std::shared_ptr<LogicalOperandPredicate> & get_test() const { return test; }
6789- std::shared_ptr<LogicalOperandPredicate> & get_mutable_test() { return test; }
6790- void set_test(const std::shared_ptr<LogicalOperandPredicate> & value) { this->test = value; }
6788+ const LogicalOperandPredicate & get_test() const { return test; }
6789+ LogicalOperandPredicate & get_mutable_test() { return test; }
6790+ void set_test(const LogicalOperandPredicate & value) { this->test = value; }
67916791
67926792 /**
67936793 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
67946794 * `0` to `1` for opacity).
67956795 */
6796- const std::optional<ConditionalValueDefValue> & get_value() const { return value; }
6797- std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; }
6798- void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; }
6796+ const ConditionalValueDefValue & get_value() const { return value; }
6797+ ConditionalValueDefValue & get_mutable_value() { return value; }
6798+ void set_value(const ConditionalValueDefValue & value) { this->value = value; }
67996799
68006800 /**
68016801 * A [selection name](selection.html), or a series of [composed
68026802 * selections](selection.html#compose).
68036803 */
6804- const std::shared_ptr<SelectionOperand> & get_selection() const { return selection; }
6805- std::shared_ptr<SelectionOperand> & get_mutable_selection() { return selection; }
6806- void set_selection(const std::shared_ptr<SelectionOperand> & value) { this->selection = value; }
6804+ const SelectionOperand & get_selection() const { return selection; }
6805+ SelectionOperand & get_mutable_selection() { return selection; }
6806+ void set_selection(const SelectionOperand & value) { this->selection = value; }
68076807
68086808 /**
68096809 * Aggregation function for the field
@@ -6866,9 +6866,9 @@ namespace quicktype {
68666866 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
68676867 * [geographic projection](projection.html) is applied.
68686868 */
6869- const std::optional<Type> & get_type() const { return type; }
6870- std::optional<Type> & get_mutable_type() { return type; }
6871- void set_type(const std::optional<Type> & value) { this->type = value; }
6869+ const Type & get_type() const { return type; }
6870+ Type & get_mutable_type() { return type; }
6871+ void set_type(const Type & value) { this->type = value; }
68726872 };
68736873
68746874 using TextCondition = std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateTextFieldDefClass>;
@@ -6903,7 +6903,7 @@ namespace quicktype {
69036903 std::optional<Field> field;
69046904 std::optional<std::string> format;
69056905 std::optional<TimeUnit> time_unit;
6906- std::optional<Type> type;
6906+ Type type;
69076907 std::optional<ConditionalValueDefValue> value;
69086908
69096909 public:
@@ -6981,9 +6981,9 @@ namespace quicktype {
69816981 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
69826982 * [geographic projection](projection.html) is applied.
69836983 */
6984- const std::optional<Type> & get_type() const { return type; }
6985- std::optional<Type> & get_mutable_type() { return type; }
6986- void set_type(const std::optional<Type> & value) { this->type = value; }
6984+ const Type & get_type() const { return type; }
6985+ Type & get_mutable_type() { return type; }
6986+ void set_type(const Type & value) { this->type = value; }
69876987
69886988 /**
69896989 * A constant value in visual domain.
@@ -7283,8 +7283,8 @@ namespace quicktype {
72837283 SortUnion sort;
72847284 std::optional<StackOffset> stack;
72857285 std::optional<TimeUnit> time_unit;
7286- std::optional<Type> type;
7287- std::optional<ConditionalValueDefValue> value;
7286+ Type type;
7287+ ConditionalValueDefValue value;
72887288
72897289 public:
72907290 /**
@@ -7396,17 +7396,17 @@ namespace quicktype {
73967396 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
73977397 * [geographic projection](projection.html) is applied.
73987398 */
7399- const std::optional<Type> & get_type() const { return type; }
7400- std::optional<Type> & get_mutable_type() { return type; }
7401- void set_type(const std::optional<Type> & value) { this->type = value; }
7399+ const Type & get_type() const { return type; }
7400+ Type & get_mutable_type() { return type; }
7401+ void set_type(const Type & value) { this->type = value; }
74027402
74037403 /**
74047404 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
74057405 * `0` to `1` for opacity).
74067406 */
7407- const std::optional<ConditionalValueDefValue> & get_value() const { return value; }
7408- std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; }
7409- void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; }
7407+ const ConditionalValueDefValue & get_value() const { return value; }
7408+ ConditionalValueDefValue & get_mutable_value() { return value; }
7409+ void set_value(const ConditionalValueDefValue & value) { this->value = value; }
74107410 };
74117411
74127412 /**
@@ -7428,8 +7428,8 @@ namespace quicktype {
74287428 std::optional<Bin> bin;
74297429 std::optional<Field> field;
74307430 std::optional<TimeUnit> time_unit;
7431- std::optional<Type> type;
7432- std::optional<ConditionalValueDefValue> value;
7431+ Type type;
7432+ ConditionalValueDefValue value;
74337433
74347434 public:
74357435 /**
@@ -7485,17 +7485,17 @@ namespace quicktype {
74857485 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
74867486 * [geographic projection](projection.html) is applied.
74877487 */
7488- const std::optional<Type> & get_type() const { return type; }
7489- std::optional<Type> & get_mutable_type() { return type; }
7490- void set_type(const std::optional<Type> & value) { this->type = value; }
7488+ const Type & get_type() const { return type; }
7489+ Type & get_mutable_type() { return type; }
7490+ void set_type(const Type & value) { this->type = value; }
74917491
74927492 /**
74937493 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
74947494 * `0` to `1` for opacity).
74957495 */
7496- const std::optional<ConditionalValueDefValue> & get_value() const { return value; }
7497- std::optional<ConditionalValueDefValue> & get_mutable_value() { return value; }
7498- void set_value(const std::optional<ConditionalValueDefValue> & value) { this->value = value; }
7496+ const ConditionalValueDefValue & get_value() const { return value; }
7497+ ConditionalValueDefValue & get_mutable_value() { return value; }
7498+ void set_value(const ConditionalValueDefValue & value) { this->value = value; }
74997499 };
75007500
75017501 /**
@@ -8756,16 +8756,16 @@ namespace quicktype {
87568756 virtual ~Transform() = default;
87578757
87588758 private:
8759- std::shared_ptr<LogicalOperandPredicate> filter;
8759+ LogicalOperandPredicate filter;
87608760 std::optional<Style> as;
8761- std::optional<std::string> calculate;
8761+ std::string calculate;
87628762 std::optional<std::string> transform_default;
8763- std::optional<LookupData> from;
8764- std::optional<std::string> lookup;
8765- std::optional<Bin> bin;
8766- std::optional<std::string> field;
8767- std::optional<TimeUnit> time_unit;
8768- std::optional<std::vector<AggregatedFieldDef>> aggregate;
8763+ LookupData from;
8764+ std::string lookup;
8765+ Bin bin;
8766+ std::string field;
8767+ TimeUnit time_unit;
8768+ std::vector<AggregatedFieldDef> aggregate;
87698769 std::optional<std::vector<std::string>> groupby;
87708770
87718771 public:
@@ -8779,9 +8779,9 @@ namespace quicktype {
87798779 * (3) a [selection predicate](filter.html#selection-predicate);
87808780 * or (4) a logical operand that combines (1), (2), or (3).
87818781 */
8782- const std::shared_ptr<LogicalOperandPredicate> & get_filter() const { return filter; }
8783- std::shared_ptr<LogicalOperandPredicate> & get_mutable_filter() { return filter; }
8784- void set_filter(const std::shared_ptr<LogicalOperandPredicate> & value) { this->filter = value; }
8782+ const LogicalOperandPredicate & get_filter() const { return filter; }
8783+ LogicalOperandPredicate & get_mutable_filter() { return filter; }
8784+ void set_filter(const LogicalOperandPredicate & value) { this->filter = value; }
87858785
87868786 /**
87878787 * The field for storing the computed formula value.
@@ -8803,9 +8803,9 @@ namespace quicktype {
88038803 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
88048804 * current data object.
88058805 */
8806- const std::optional<std::string> & get_calculate() const { return calculate; }
8807- std::optional<std::string> & get_mutable_calculate() { return calculate; }
8808- void set_calculate(const std::optional<std::string> & value) { this->calculate = value; }
8806+ const std::string & get_calculate() const { return calculate; }
8807+ std::string & get_mutable_calculate() { return calculate; }
8808+ void set_calculate(const std::string & value) { this->calculate = value; }
88098809
88108810 /**
88118811 * The default value to use if lookup fails.
@@ -8819,46 +8819,46 @@ namespace quicktype {
88198819 /**
88208820 * Secondary data reference.
88218821 */
8822- const std::optional<LookupData> & get_from() const { return from; }
8823- std::optional<LookupData> & get_mutable_from() { return from; }
8824- void set_from(const std::optional<LookupData> & value) { this->from = value; }
8822+ const LookupData & get_from() const { return from; }
8823+ LookupData & get_mutable_from() { return from; }
8824+ void set_from(const LookupData & value) { this->from = value; }
88258825
88268826 /**
88278827 * Key in primary data source.
88288828 */
8829- const std::optional<std::string> & get_lookup() const { return lookup; }
8830- std::optional<std::string> & get_mutable_lookup() { return lookup; }
8831- void set_lookup(const std::optional<std::string> & value) { this->lookup = value; }
8829+ const std::string & get_lookup() const { return lookup; }
8830+ std::string & get_mutable_lookup() { return lookup; }
8831+ void set_lookup(const std::string & value) { this->lookup = value; }
88328832
88338833 /**
88348834 * An object indicating bin properties, or simply `true` for using default bin parameters.
88358835 */
8836- const std::optional<Bin> & get_bin() const { return bin; }
8837- std::optional<Bin> & get_mutable_bin() { return bin; }
8838- void set_bin(const std::optional<Bin> & value) { this->bin = value; }
8836+ const Bin & get_bin() const { return bin; }
8837+ Bin & get_mutable_bin() { return bin; }
8838+ void set_bin(const Bin & value) { this->bin = value; }
88398839
88408840 /**
88418841 * The data field to bin.
88428842 *
88438843 * The data field to apply time unit.
88448844 */
8845- const std::optional<std::string> & get_field() const { return field; }
8846- std::optional<std::string> & get_mutable_field() { return field; }
8847- void set_field(const std::optional<std::string> & value) { this->field = value; }
8845+ const std::string & get_field() const { return field; }
8846+ std::string & get_mutable_field() { return field; }
8847+ void set_field(const std::string & value) { this->field = value; }
88488848
88498849 /**
88508850 * The timeUnit.
88518851 */
8852- const std::optional<TimeUnit> & get_time_unit() const { return time_unit; }
8853- std::optional<TimeUnit> & get_mutable_time_unit() { return time_unit; }
8854- void set_time_unit(const std::optional<TimeUnit> & value) { this->time_unit = value; }
8852+ const TimeUnit & get_time_unit() const { return time_unit; }
8853+ TimeUnit & get_mutable_time_unit() { return time_unit; }
8854+ void set_time_unit(const TimeUnit & value) { this->time_unit = value; }
88558855
88568856 /**
88578857 * Array of objects that define fields to aggregate.
88588858 */
8859- const std::optional<std::vector<AggregatedFieldDef>> & get_aggregate() const { return aggregate; }
8860- std::optional<std::vector<AggregatedFieldDef>> & get_mutable_aggregate() { return aggregate; }
8861- void set_aggregate(const std::optional<std::vector<AggregatedFieldDef>> & value) { this->aggregate = value; }
8859+ const std::vector<AggregatedFieldDef> & get_aggregate() const { return aggregate; }
8860+ std::vector<AggregatedFieldDef> & get_mutable_aggregate() { return aggregate; }
8861+ void set_aggregate(const std::vector<AggregatedFieldDef> & value) { this->aggregate = value; }
88628862
88638863 /**
88648864 * The data fields to group by. If not specified, a single group containing all data objects
@@ -8881,14 +8881,14 @@ namespace quicktype {
88818881 std::optional<Data> data;
88828882 std::optional<std::string> description;
88838883 std::optional<double> height;
8884- std::optional<std::vector<LayerSpec>> layer;
8884+ std::vector<LayerSpec> layer;
88858885 std::optional<std::string> name;
88868886 std::optional<Resolve> resolve;
88878887 std::optional<Title> title;
88888888 std::optional<std::vector<Transform>> transform;
88898889 std::optional<double> width;
8890- std::optional<Encoding> encoding;
8891- std::optional<AnyMark> mark;
8890+ Encoding encoding;
8891+ AnyMark mark;
88928892 std::optional<Projection> projection;
88938893 std::optional<std::map<std::string, SelectionDef>> selection;
88948894
@@ -8936,9 +8936,9 @@ namespace quicktype {
89368936 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
89378937 * layering facet specifications is not allowed.
89388938 */
8939- const std::optional<std::vector<LayerSpec>> & get_layer() const { return layer; }
8940- std::optional<std::vector<LayerSpec>> & get_mutable_layer() { return layer; }
8941- void set_layer(const std::optional<std::vector<LayerSpec>> & value) { this->layer = value; }
8939+ const std::vector<LayerSpec> & get_layer() const { return layer; }
8940+ std::vector<LayerSpec> & get_mutable_layer() { return layer; }
8941+ void set_layer(const std::vector<LayerSpec> & value) { this->layer = value; }
89428942
89438943 /**
89448944 * Name of the visualization for later reference.
@@ -8997,9 +8997,9 @@ namespace quicktype {
89978997 /**
89988998 * A key-value mapping between encoding channels and definition of fields.
89998999 */
9000- const std::optional<Encoding> & get_encoding() const { return encoding; }
9001- std::optional<Encoding> & get_mutable_encoding() { return encoding; }
9002- void set_encoding(const std::optional<Encoding> & value) { this->encoding = value; }
9000+ const Encoding & get_encoding() const { return encoding; }
9001+ Encoding & get_mutable_encoding() { return encoding; }
9002+ void set_encoding(const Encoding & value) { this->encoding = value; }
90039003
90049004 /**
90059005 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -9007,9 +9007,9 @@ namespace quicktype {
90079007 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
90089008 * object](mark.html#mark-def).
90099009 */
9010- const std::optional<AnyMark> & get_mark() const { return mark; }
9011- std::optional<AnyMark> & get_mutable_mark() { return mark; }
9012- void set_mark(const std::optional<AnyMark> & value) { this->mark = value; }
9010+ const AnyMark & get_mark() const { return mark; }
9011+ AnyMark & get_mutable_mark() { return mark; }
9012+ void set_mark(const AnyMark & value) { this->mark = value; }
90139013
90149014 /**
90159015 * An object defining properties of geographic projection.
@@ -9070,21 +9070,21 @@ namespace quicktype {
90709070 std::optional<Data> data;
90719071 std::optional<std::string> description;
90729072 std::optional<double> height;
9073- std::optional<std::vector<LayerSpec>> layer;
9073+ std::vector<LayerSpec> layer;
90749074 std::optional<std::string> name;
90759075 std::optional<Resolve> resolve;
90769076 std::optional<Title> title;
90779077 std::optional<std::vector<Transform>> transform;
90789078 std::optional<double> width;
9079- std::optional<Encoding> encoding;
9080- std::optional<AnyMark> mark;
9079+ Encoding encoding;
9080+ AnyMark mark;
90819081 std::optional<Projection> projection;
90829082 std::optional<std::map<std::string, SelectionDef>> selection;
9083- std::optional<FacetMapping> facet;
9083+ FacetMapping facet;
90849084 std::shared_ptr<Spec> spec;
9085- std::optional<Repeat> repeat;
9086- std::optional<std::vector<Spec>> vconcat;
9087- std::optional<std::vector<Spec>> hconcat;
9085+ Repeat repeat;
9086+ std::vector<Spec> vconcat;
9087+ std::vector<Spec> hconcat;
90889088
90899089 public:
90909090 /**
@@ -9130,9 +9130,9 @@ namespace quicktype {
91309130 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
91319131 * layering facet specifications is not allowed.
91329132 */
9133- const std::optional<std::vector<LayerSpec>> & get_layer() const { return layer; }
9134- std::optional<std::vector<LayerSpec>> & get_mutable_layer() { return layer; }
9135- void set_layer(const std::optional<std::vector<LayerSpec>> & value) { this->layer = value; }
9133+ const std::vector<LayerSpec> & get_layer() const { return layer; }
9134+ std::vector<LayerSpec> & get_mutable_layer() { return layer; }
9135+ void set_layer(const std::vector<LayerSpec> & value) { this->layer = value; }
91369136
91379137 /**
91389138 * Name of the visualization for later reference.
@@ -9199,9 +9199,9 @@ namespace quicktype {
91999199 /**
92009200 * A key-value mapping between encoding channels and definition of fields.
92019201 */
9202- const std::optional<Encoding> & get_encoding() const { return encoding; }
9203- std::optional<Encoding> & get_mutable_encoding() { return encoding; }
9204- void set_encoding(const std::optional<Encoding> & value) { this->encoding = value; }
9202+ const Encoding & get_encoding() const { return encoding; }
9203+ Encoding & get_mutable_encoding() { return encoding; }
9204+ void set_encoding(const Encoding & value) { this->encoding = value; }
92059205
92069206 /**
92079207 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -9209,9 +9209,9 @@ namespace quicktype {
92099209 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
92109210 * object](mark.html#mark-def).
92119211 */
9212- const std::optional<AnyMark> & get_mark() const { return mark; }
9213- std::optional<AnyMark> & get_mutable_mark() { return mark; }
9214- void set_mark(const std::optional<AnyMark> & value) { this->mark = value; }
9212+ const AnyMark & get_mark() const { return mark; }
9213+ AnyMark & get_mutable_mark() { return mark; }
9214+ void set_mark(const AnyMark & value) { this->mark = value; }
92159215
92169216 /**
92179217 * An object defining properties of geographic projection.
@@ -9234,9 +9234,9 @@ namespace quicktype {
92349234 * An object that describes mappings between `row` and `column` channels and their field
92359235 * definitions.
92369236 */
9237- const std::optional<FacetMapping> & get_facet() const { return facet; }
9238- std::optional<FacetMapping> & get_mutable_facet() { return facet; }
9239- void set_facet(const std::optional<FacetMapping> & value) { this->facet = value; }
9237+ const FacetMapping & get_facet() const { return facet; }
9238+ FacetMapping & get_mutable_facet() { return facet; }
9239+ void set_facet(const FacetMapping & value) { this->facet = value; }
92409240
92419241 /**
92429242 * A specification of the view that gets faceted.
@@ -9249,23 +9249,23 @@ namespace quicktype {
92499249 * An object that describes what fields should be repeated into views that are laid out as a
92509250 * `row` or `column`.
92519251 */
9252- const std::optional<Repeat> & get_repeat() const { return repeat; }
9253- std::optional<Repeat> & get_mutable_repeat() { return repeat; }
9254- void set_repeat(const std::optional<Repeat> & value) { this->repeat = value; }
9252+ const Repeat & get_repeat() const { return repeat; }
9253+ Repeat & get_mutable_repeat() { return repeat; }
9254+ void set_repeat(const Repeat & value) { this->repeat = value; }
92559255
92569256 /**
92579257 * A list of views that should be concatenated and put into a column.
92589258 */
9259- const std::optional<std::vector<Spec>> & get_vconcat() const { return vconcat; }
9260- std::optional<std::vector<Spec>> & get_mutable_vconcat() { return vconcat; }
9261- void set_vconcat(const std::optional<std::vector<Spec>> & value) { this->vconcat = value; }
9259+ const std::vector<Spec> & get_vconcat() const { return vconcat; }
9260+ std::vector<Spec> & get_mutable_vconcat() { return vconcat; }
9261+ void set_vconcat(const std::vector<Spec> & value) { this->vconcat = value; }
92629262
92639263 /**
92649264 * A list of views that should be concatenated and put into a row.
92659265 */
9266- const std::optional<std::vector<Spec>> & get_hconcat() const { return hconcat; }
9267- std::optional<std::vector<Spec>> & get_mutable_hconcat() { return hconcat; }
9268- void set_hconcat(const std::optional<std::vector<Spec>> & value) { this->hconcat = value; }
9266+ const std::vector<Spec> & get_hconcat() const { return hconcat; }
9267+ std::vector<Spec> & get_mutable_hconcat() { return hconcat; }
9268+ void set_hconcat(const std::vector<Spec> & value) { this->hconcat = value; }
92699269 };
92709270
92719271 class TopLevel {
@@ -9280,9 +9280,9 @@ namespace quicktype {
92809280 std::optional<Config> config;
92819281 std::optional<Data> data;
92829282 std::optional<std::string> description;
9283- std::optional<EncodingWithFacet> encoding;
9283+ EncodingWithFacet encoding;
92849284 std::optional<double> height;
9285- std::optional<AnyMark> mark;
9285+ AnyMark mark;
92869286 std::optional<std::string> name;
92879287 std::optional<Padding> padding;
92889288 std::optional<Projection> projection;
@@ -9290,13 +9290,13 @@ namespace quicktype {
92909290 std::optional<Title> title;
92919291 std::optional<std::vector<Transform>> transform;
92929292 std::optional<double> width;
9293- std::optional<std::vector<LayerSpec>> layer;
9293+ std::vector<LayerSpec> layer;
92949294 std::optional<Resolve> resolve;
9295- std::optional<FacetMapping> facet;
9295+ FacetMapping facet;
92969296 std::shared_ptr<Spec> spec;
9297- std::optional<Repeat> repeat;
9298- std::optional<std::vector<Spec>> vconcat;
9299- std::optional<std::vector<Spec>> hconcat;
9297+ Repeat repeat;
9298+ std::vector<Spec> vconcat;
9299+ std::vector<Spec> hconcat;
93009300
93019301 public:
93029302 /**
@@ -9356,9 +9356,9 @@ namespace quicktype {
93569356 /**
93579357 * A key-value mapping between encoding channels and definition of fields.
93589358 */
9359- const std::optional<EncodingWithFacet> & get_encoding() const { return encoding; }
9360- std::optional<EncodingWithFacet> & get_mutable_encoding() { return encoding; }
9361- void set_encoding(const std::optional<EncodingWithFacet> & value) { this->encoding = value; }
9359+ const EncodingWithFacet & get_encoding() const { return encoding; }
9360+ EncodingWithFacet & get_mutable_encoding() { return encoding; }
9361+ void set_encoding(const EncodingWithFacet & value) { this->encoding = value; }
93629362
93639363 /**
93649364 * The height of a visualization.
@@ -9389,9 +9389,9 @@ namespace quicktype {
93899389 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
93909390 * object](mark.html#mark-def).
93919391 */
9392- const std::optional<AnyMark> & get_mark() const { return mark; }
9393- std::optional<AnyMark> & get_mutable_mark() { return mark; }
9394- void set_mark(const std::optional<AnyMark> & value) { this->mark = value; }
9392+ const AnyMark & get_mark() const { return mark; }
9393+ AnyMark & get_mutable_mark() { return mark; }
9394+ void set_mark(const AnyMark & value) { this->mark = value; }
93959395
93969396 /**
93979397 * Name of the visualization for later reference.
@@ -9475,9 +9475,9 @@ namespace quicktype {
94759475 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
94769476 * layering facet specifications is not allowed.
94779477 */
9478- const std::optional<std::vector<LayerSpec>> & get_layer() const { return layer; }
9479- std::optional<std::vector<LayerSpec>> & get_mutable_layer() { return layer; }
9480- void set_layer(const std::optional<std::vector<LayerSpec>> & value) { this->layer = value; }
9478+ const std::vector<LayerSpec> & get_layer() const { return layer; }
9479+ std::vector<LayerSpec> & get_mutable_layer() { return layer; }
9480+ void set_layer(const std::vector<LayerSpec> & value) { this->layer = value; }
94819481
94829482 /**
94839483 * Scale, axis, and legend resolutions for layers.
@@ -9498,9 +9498,9 @@ namespace quicktype {
94989498 * An object that describes mappings between `row` and `column` channels and their field
94999499 * definitions.
95009500 */
9501- const std::optional<FacetMapping> & get_facet() const { return facet; }
9502- std::optional<FacetMapping> & get_mutable_facet() { return facet; }
9503- void set_facet(const std::optional<FacetMapping> & value) { this->facet = value; }
9501+ const FacetMapping & get_facet() const { return facet; }
9502+ FacetMapping & get_mutable_facet() { return facet; }
9503+ void set_facet(const FacetMapping & value) { this->facet = value; }
95049504
95059505 /**
95069506 * A specification of the view that gets faceted.
@@ -9513,23 +9513,23 @@ namespace quicktype {
95139513 * An object that describes what fields should be repeated into views that are laid out as a
95149514 * `row` or `column`.
95159515 */
9516- const std::optional<Repeat> & get_repeat() const { return repeat; }
9517- std::optional<Repeat> & get_mutable_repeat() { return repeat; }
9518- void set_repeat(const std::optional<Repeat> & value) { this->repeat = value; }
9516+ const Repeat & get_repeat() const { return repeat; }
9517+ Repeat & get_mutable_repeat() { return repeat; }
9518+ void set_repeat(const Repeat & value) { this->repeat = value; }
95199519
95209520 /**
95219521 * A list of views that should be concatenated and put into a column.
95229522 */
9523- const std::optional<std::vector<Spec>> & get_vconcat() const { return vconcat; }
9524- std::optional<std::vector<Spec>> & get_mutable_vconcat() { return vconcat; }
9525- void set_vconcat(const std::optional<std::vector<Spec>> & value) { this->vconcat = value; }
9523+ const std::vector<Spec> & get_vconcat() const { return vconcat; }
9524+ std::vector<Spec> & get_mutable_vconcat() { return vconcat; }
9525+ void set_vconcat(const std::vector<Spec> & value) { this->vconcat = value; }
95269526
95279527 /**
95289528 * A list of views that should be concatenated and put into a row.
95299529 */
9530- const std::optional<std::vector<Spec>> & get_hconcat() const { return hconcat; }
9531- std::optional<std::vector<Spec>> & get_mutable_hconcat() { return hconcat; }
9532- void set_hconcat(const std::optional<std::vector<Spec>> & value) { this->hconcat = value; }
9530+ const std::vector<Spec> & get_hconcat() const { return hconcat; }
9531+ std::vector<Spec> & get_mutable_hconcat() { return hconcat; }
9532+ void set_hconcat(const std::vector<Spec> & value) { this->hconcat = value; }
95339533 };
95349534 }
95359535
@@ -10507,7 +10507,7 @@ namespace quicktype {
1050710507 inline void from_json(const json & j, VgScheme& x) {
1050810508 x.set_count(get_stack_optional<double>(j, "count"));
1050910509 x.set_extent(get_stack_optional<std::vector<double>>(j, "extent"));
10510- x.set_scheme(get_stack_optional<std::string>(j, "scheme"));
10510+ x.set_scheme(j.at("scheme").get<std::string>());
1051110511 x.set_step(get_stack_optional<double>(j, "step"));
1051210512 }
1051310513
@@ -10634,7 +10634,7 @@ namespace quicktype {
1063410634 inline void from_json(const json & j, VgBinding& x) {
1063510635 x.set_element(get_stack_optional<std::string>(j, "element"));
1063610636 x.set_input(j.at("input").get<std::string>());
10637- x.set_options(get_stack_optional<std::vector<std::string>>(j, "options"));
10637+ x.set_options(j.at("options").get<std::vector<std::string>>());
1063810638 x.set_max(get_stack_optional<double>(j, "max"));
1063910639 x.set_min(get_stack_optional<double>(j, "min"));
1064010640 x.set_step(get_stack_optional<double>(j, "step"));
@@ -11041,9 +11041,9 @@ namespace quicktype {
1104111041
1104211042 inline void from_json(const json & j, Data& x) {
1104311043 x.set_format(get_stack_optional<DataFormat>(j, "format"));
11044- x.set_url(get_stack_optional<std::string>(j, "url"));
11045- x.set_values(get_stack_optional<std::variant<std::vector<ValuesValue>, std::map<std::string, nlohmann::json>, std::string>>(j, "values"));
11046- x.set_name(get_stack_optional<std::string>(j, "name"));
11044+ x.set_url(j.at("url").get<std::string>());
11045+ x.set_values(j.at("values").get<Values>());
11046+ x.set_name(j.at("name").get<std::string>());
1104711047 }
1104811048
1104911049 inline void to_json(json & j, const Data & x) {
@@ -11078,9 +11078,9 @@ namespace quicktype {
1107811078 }
1107911079
1108011080 inline void from_json(const json & j, Selection& x) {
11081- x.set_selection_not(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "not"));
11082- x.set_selection_and(get_stack_optional<std::vector<SelectionOperand>>(j, "and"));
11083- x.set_selection_or(get_stack_optional<std::vector<SelectionOperand>>(j, "or"));
11081+ x.set_selection_not(j.at("not").get<SelectionOperand>());
11082+ x.set_selection_and(j.at("and").get<std::vector<SelectionOperand>>());
11083+ x.set_selection_or(j.at("or").get<std::vector<SelectionOperand>>());
1108411084 }
1108511085
1108611086 inline void to_json(json & j, const Selection & x) {
@@ -11118,15 +11118,15 @@ namespace quicktype {
1111811118 }
1111911119
1112011120 inline void from_json(const json & j, Predicate& x) {
11121- x.set_predicate_not(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "not"));
11122- x.set_predicate_and(get_stack_optional<std::vector<LogicalOperandPredicate>>(j, "and"));
11123- x.set_predicate_or(get_stack_optional<std::vector<LogicalOperandPredicate>>(j, "or"));
11124- x.set_equal(get_stack_optional<std::variant<bool, DateTime, double, std::string>>(j, "equal"));
11125- x.set_field(get_stack_optional<std::string>(j, "field"));
11121+ x.set_predicate_not(j.at("not").get<LogicalOperandPredicate>());
11122+ x.set_predicate_and(j.at("and").get<std::vector<LogicalOperandPredicate>>());
11123+ x.set_predicate_or(j.at("or").get<std::vector<LogicalOperandPredicate>>());
11124+ x.set_equal(j.at("equal").get<Equal>());
11125+ x.set_field(j.at("field").get<std::string>());
1112611126 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11127- x.set_range(get_stack_optional<std::vector<RangeElement>>(j, "range"));
11128- x.set_one_of(get_stack_optional<std::vector<Equal>>(j, "oneOf"));
11129- x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection"));
11127+ x.set_range(j.at("range").get<std::vector<RangeElement>>());
11128+ x.set_one_of(j.at("oneOf").get<std::vector<Equal>>());
11129+ x.set_selection(j.at("selection").get<SelectionOperand>());
1113011130 }
1113111131
1113211132 inline void to_json(json & j, const Predicate & x) {
@@ -11143,9 +11143,9 @@ namespace quicktype {
1114311143 }
1114411144
1114511145 inline void from_json(const json & j, ConditionalValueDef& x) {
11146- x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test"));
11146+ x.set_test(j.at("test").get<LogicalOperandPredicate>());
1114711147 x.set_value(j.at("value").get<ConditionalValueDefValue>());
11148- x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection"));
11148+ x.set_selection(j.at("selection").get<SelectionOperand>());
1114911149 }
1115011150
1115111151 inline void to_json(json & j, const ConditionalValueDef & x) {
@@ -11288,9 +11288,9 @@ namespace quicktype {
1128811288 }
1128911289
1129011290 inline void from_json(const json & j, ConditionalPredicateMarkPropFieldDefClass& x) {
11291- x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test"));
11292- x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
11293- x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection"));
11291+ x.set_test(j.at("test").get<LogicalOperandPredicate>());
11292+ x.set_value(j.at("value").get<ConditionalValueDefValue>());
11293+ x.set_selection(j.at("selection").get<SelectionOperand>());
1129411294 x.set_aggregate(get_stack_optional<AggregateOp>(j, "aggregate"));
1129511295 x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin"));
1129611296 x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field"));
@@ -11298,7 +11298,7 @@ namespace quicktype {
1129811298 x.set_scale(get_stack_optional<Scale>(j, "scale"));
1129911299 x.set_sort(get_stack_optional<std::variant<SortField, SortEnum>>(j, "sort"));
1130011300 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11301- x.set_type(get_stack_optional<Type>(j, "type"));
11301+ x.set_type(j.at("type").get<Type>());
1130211302 }
1130311303
1130411304 inline void to_json(json & j, const ConditionalPredicateMarkPropFieldDefClass & x) {
@@ -11325,7 +11325,7 @@ namespace quicktype {
1132511325 x.set_scale(get_stack_optional<Scale>(j, "scale"));
1132611326 x.set_sort(get_stack_optional<std::variant<SortField, SortEnum>>(j, "sort"));
1132711327 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11328- x.set_type(get_stack_optional<Type>(j, "type"));
11328+ x.set_type(j.at("type").get<Type>());
1132911329 x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
1133011330 }
1133111331
@@ -11395,14 +11395,14 @@ namespace quicktype {
1139511395 }
1139611396
1139711397 inline void from_json(const json & j, ConditionalPredicateFieldDefClass& x) {
11398- x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test"));
11399- x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
11400- x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection"));
11398+ x.set_test(j.at("test").get<LogicalOperandPredicate>());
11399+ x.set_value(j.at("value").get<ConditionalValueDefValue>());
11400+ x.set_selection(j.at("selection").get<SelectionOperand>());
1140111401 x.set_aggregate(get_stack_optional<AggregateOp>(j, "aggregate"));
1140211402 x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin"));
1140311403 x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field"));
1140411404 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11405- x.set_type(get_stack_optional<Type>(j, "type"));
11405+ x.set_type(j.at("type").get<Type>());
1140611406 }
1140711407
1140811408 inline void to_json(json & j, const ConditionalPredicateFieldDefClass & x) {
@@ -11423,7 +11423,7 @@ namespace quicktype {
1142311423 x.set_condition(get_stack_optional<std::variant<std::vector<ConditionalValueDef>, ConditionalPredicateFieldDefClass>>(j, "condition"));
1142411424 x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field"));
1142511425 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11426- x.set_type(get_stack_optional<Type>(j, "type"));
11426+ x.set_type(j.at("type").get<Type>());
1142711427 x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
1142811428 }
1142911429
@@ -11458,15 +11458,15 @@ namespace quicktype {
1145811458 }
1145911459
1146011460 inline void from_json(const json & j, ConditionalPredicateTextFieldDefClass& x) {
11461- x.set_test(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "test"));
11462- x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
11463- x.set_selection(get_heap_optional<std::variant<std::shared_ptr<Selection>, std::string>>(j, "selection"));
11461+ x.set_test(j.at("test").get<LogicalOperandPredicate>());
11462+ x.set_value(j.at("value").get<ConditionalValueDefValue>());
11463+ x.set_selection(j.at("selection").get<SelectionOperand>());
1146411464 x.set_aggregate(get_stack_optional<AggregateOp>(j, "aggregate"));
1146511465 x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin"));
1146611466 x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field"));
1146711467 x.set_format(get_stack_optional<std::string>(j, "format"));
1146811468 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11469- x.set_type(get_stack_optional<Type>(j, "type"));
11469+ x.set_type(j.at("type").get<Type>());
1147011470 }
1147111471
1147211472 inline void to_json(json & j, const ConditionalPredicateTextFieldDefClass & x) {
@@ -11489,7 +11489,7 @@ namespace quicktype {
1148911489 x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field"));
1149011490 x.set_format(get_stack_optional<std::string>(j, "format"));
1149111491 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11492- x.set_type(get_stack_optional<Type>(j, "type"));
11492+ x.set_type(j.at("type").get<Type>());
1149311493 x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
1149411494 }
1149511495
@@ -11565,8 +11565,8 @@ namespace quicktype {
1156511565 x.set_sort(get_stack_optional<std::variant<SortField, SortEnum>>(j, "sort"));
1156611566 x.set_stack(get_stack_optional<StackOffset>(j, "stack"));
1156711567 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11568- x.set_type(get_stack_optional<Type>(j, "type"));
11569- x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
11568+ x.set_type(j.at("type").get<Type>());
11569+ x.set_value(j.at("value").get<ConditionalValueDefValue>());
1157011570 }
1157111571
1157211572 inline void to_json(json & j, const XClass & x) {
@@ -11588,8 +11588,8 @@ namespace quicktype {
1158811588 x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin"));
1158911589 x.set_field(get_stack_optional<std::variant<RepeatRef, std::string>>(j, "field"));
1159011590 x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11591- x.set_type(get_stack_optional<Type>(j, "type"));
11592- x.set_value(get_stack_optional<std::variant<bool, double, std::string>>(j, "value"));
11591+ x.set_type(j.at("type").get<Type>());
11592+ x.set_value(j.at("value").get<ConditionalValueDefValue>());
1159311593 }
1159411594
1159511595 inline void to_json(json & j, const X2Class & x) {
@@ -11926,16 +11926,16 @@ namespace quicktype {
1192611926 }
1192711927
1192811928 inline void from_json(const json & j, Transform& x) {
11929- x.set_filter(get_heap_optional<std::variant<std::shared_ptr<Predicate>, std::string>>(j, "filter"));
11929+ x.set_filter(j.at("filter").get<LogicalOperandPredicate>());
1193011930 x.set_as(get_stack_optional<std::variant<std::vector<std::string>, std::string>>(j, "as"));
11931- x.set_calculate(get_stack_optional<std::string>(j, "calculate"));
11931+ x.set_calculate(j.at("calculate").get<std::string>());
1193211932 x.set_transform_default(get_stack_optional<std::string>(j, "default"));
11933- x.set_from(get_stack_optional<LookupData>(j, "from"));
11934- x.set_lookup(get_stack_optional<std::string>(j, "lookup"));
11935- x.set_bin(get_stack_optional<std::variant<bool, BinParams>>(j, "bin"));
11936- x.set_field(get_stack_optional<std::string>(j, "field"));
11937- x.set_time_unit(get_stack_optional<TimeUnit>(j, "timeUnit"));
11938- x.set_aggregate(get_stack_optional<std::vector<AggregatedFieldDef>>(j, "aggregate"));
11933+ x.set_from(j.at("from").get<LookupData>());
11934+ x.set_lookup(j.at("lookup").get<std::string>());
11935+ x.set_bin(j.at("bin").get<Bin>());
11936+ x.set_field(j.at("field").get<std::string>());
11937+ x.set_time_unit(j.at("timeUnit").get<TimeUnit>());
11938+ x.set_aggregate(j.at("aggregate").get<std::vector<AggregatedFieldDef>>());
1193911939 x.set_groupby(get_stack_optional<std::vector<std::string>>(j, "groupby"));
1194011940 }
1194111941
@@ -11958,14 +11958,14 @@ namespace quicktype {
1195811958 x.set_data(get_stack_optional<Data>(j, "data"));
1195911959 x.set_description(get_stack_optional<std::string>(j, "description"));
1196011960 x.set_height(get_stack_optional<double>(j, "height"));
11961- x.set_layer(get_stack_optional<std::vector<LayerSpec>>(j, "layer"));
11961+ x.set_layer(j.at("layer").get<std::vector<LayerSpec>>());
1196211962 x.set_name(get_stack_optional<std::string>(j, "name"));
1196311963 x.set_resolve(get_stack_optional<Resolve>(j, "resolve"));
1196411964 x.set_title(get_stack_optional<std::variant<TitleParams, std::string>>(j, "title"));
1196511965 x.set_transform(get_stack_optional<std::vector<Transform>>(j, "transform"));
1196611966 x.set_width(get_stack_optional<double>(j, "width"));
11967- x.set_encoding(get_stack_optional<Encoding>(j, "encoding"));
11968- x.set_mark(get_stack_optional<std::variant<MarkDef, Mark>>(j, "mark"));
11967+ x.set_encoding(j.at("encoding").get<Encoding>());
11968+ x.set_mark(j.at("mark").get<AnyMark>());
1196911969 x.set_projection(get_stack_optional<Projection>(j, "projection"));
1197011970 x.set_selection(get_stack_optional<std::map<std::string, SelectionDef>>(j, "selection"));
1197111971 }
@@ -12002,21 +12002,21 @@ namespace quicktype {
1200212002 x.set_data(get_stack_optional<Data>(j, "data"));
1200312003 x.set_description(get_stack_optional<std::string>(j, "description"));
1200412004 x.set_height(get_stack_optional<double>(j, "height"));
12005- x.set_layer(get_stack_optional<std::vector<LayerSpec>>(j, "layer"));
12005+ x.set_layer(j.at("layer").get<std::vector<LayerSpec>>());
1200612006 x.set_name(get_stack_optional<std::string>(j, "name"));
1200712007 x.set_resolve(get_stack_optional<Resolve>(j, "resolve"));
1200812008 x.set_title(get_stack_optional<std::variant<TitleParams, std::string>>(j, "title"));
1200912009 x.set_transform(get_stack_optional<std::vector<Transform>>(j, "transform"));
1201012010 x.set_width(get_stack_optional<double>(j, "width"));
12011- x.set_encoding(get_stack_optional<Encoding>(j, "encoding"));
12012- x.set_mark(get_stack_optional<std::variant<MarkDef, Mark>>(j, "mark"));
12011+ x.set_encoding(j.at("encoding").get<Encoding>());
12012+ x.set_mark(j.at("mark").get<AnyMark>());
1201312013 x.set_projection(get_stack_optional<Projection>(j, "projection"));
1201412014 x.set_selection(get_stack_optional<std::map<std::string, SelectionDef>>(j, "selection"));
12015- x.set_facet(get_stack_optional<FacetMapping>(j, "facet"));
12016- x.set_spec(get_heap_optional<Spec>(j, "spec"));
12017- x.set_repeat(get_stack_optional<Repeat>(j, "repeat"));
12018- x.set_vconcat(get_stack_optional<std::vector<Spec>>(j, "vconcat"));
12019- x.set_hconcat(get_stack_optional<std::vector<Spec>>(j, "hconcat"));
12015+ x.set_facet(j.at("facet").get<FacetMapping>());
12016+ x.set_spec(j.at("spec").get<std::shared_ptr<Spec>>());
12017+ x.set_repeat(j.at("repeat").get<Repeat>());
12018+ x.set_vconcat(j.at("vconcat").get<std::vector<Spec>>());
12019+ x.set_hconcat(j.at("hconcat").get<std::vector<Spec>>());
1202012020 }
1202112021
1202212022 inline void to_json(json & j, const Spec & x) {
@@ -12048,9 +12048,9 @@ namespace quicktype {
1204812048 x.set_config(get_stack_optional<Config>(j, "config"));
1204912049 x.set_data(get_stack_optional<Data>(j, "data"));
1205012050 x.set_description(get_stack_optional<std::string>(j, "description"));
12051- x.set_encoding(get_stack_optional<EncodingWithFacet>(j, "encoding"));
12051+ x.set_encoding(j.at("encoding").get<EncodingWithFacet>());
1205212052 x.set_height(get_stack_optional<double>(j, "height"));
12053- x.set_mark(get_stack_optional<std::variant<MarkDef, Mark>>(j, "mark"));
12053+ x.set_mark(j.at("mark").get<AnyMark>());
1205412054 x.set_name(get_stack_optional<std::string>(j, "name"));
1205512055 x.set_padding(get_stack_optional<std::variant<PaddingClass, double>>(j, "padding"));
1205612056 x.set_projection(get_stack_optional<Projection>(j, "projection"));
@@ -12058,13 +12058,13 @@ namespace quicktype {
1205812058 x.set_title(get_stack_optional<std::variant<TitleParams, std::string>>(j, "title"));
1205912059 x.set_transform(get_stack_optional<std::vector<Transform>>(j, "transform"));
1206012060 x.set_width(get_stack_optional<double>(j, "width"));
12061- x.set_layer(get_stack_optional<std::vector<LayerSpec>>(j, "layer"));
12061+ x.set_layer(j.at("layer").get<std::vector<LayerSpec>>());
1206212062 x.set_resolve(get_stack_optional<Resolve>(j, "resolve"));
12063- x.set_facet(get_stack_optional<FacetMapping>(j, "facet"));
12064- x.set_spec(get_heap_optional<Spec>(j, "spec"));
12065- x.set_repeat(get_stack_optional<Repeat>(j, "repeat"));
12066- x.set_vconcat(get_stack_optional<std::vector<Spec>>(j, "vconcat"));
12067- x.set_hconcat(get_stack_optional<std::vector<Spec>>(j, "hconcat"));
12063+ x.set_facet(j.at("facet").get<FacetMapping>());
12064+ x.set_spec(j.at("spec").get<std::shared_ptr<Spec>>());
12065+ x.set_repeat(j.at("repeat").get<Repeat>());
12066+ x.set_vconcat(j.at("vconcat").get<std::vector<Spec>>());
12067+ x.set_hconcat(j.at("hconcat").get<std::vector<Spec>>());
1206812068 }
1206912069
1207012070 inline void to_json(json & j, const TopLevel & x) {
Mschema-csharp-recordsdefault / QuickType.cs+128 −128
@@ -76,8 +76,8 @@ namespace QuickType
7676 /// <summary>
7777 /// A key-value mapping between encoding channels and definition of fields.
7878 /// </summary>
79- [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
80- public EncodingWithFacet? Encoding { get; set; }
79+ [JsonProperty("encoding", Required = Required.Always)]
80+ public EncodingWithFacet Encoding { get; set; }
8181
8282 /// <summary>
8383 /// The height of a visualization.
@@ -107,8 +107,8 @@ namespace QuickType
107107 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
108108 /// object](mark.html#mark-def).
109109 /// </summary>
110- [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
111- public AnyMark? Mark { get; set; }
110+ [JsonProperty("mark", Required = Required.Always)]
111+ public AnyMark Mark { get; set; }
112112
113113 /// <summary>
114114 /// Name of the visualization for later reference.
@@ -185,8 +185,8 @@ namespace QuickType
185185 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
186186 /// layering facet specifications is not allowed.
187187 /// </summary>
188- [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
189- public LayerSpec[]? Layer { get; set; }
188+ [JsonProperty("layer", Required = Required.Always)]
189+ public LayerSpec[] Layer { get; set; }
190190
191191 /// <summary>
192192 /// Scale, axis, and legend resolutions for layers.
@@ -206,33 +206,33 @@ namespace QuickType
206206 /// An object that describes mappings between `row` and `column` channels and their field
207207 /// definitions.
208208 /// </summary>
209- [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
210- public FacetMapping? Facet { get; set; }
209+ [JsonProperty("facet", Required = Required.Always)]
210+ public FacetMapping Facet { get; set; }
211211
212212 /// <summary>
213213 /// A specification of the view that gets faceted.
214214 /// </summary>
215- [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
216- public Spec? Spec { get; set; }
215+ [JsonProperty("spec", Required = Required.Always)]
216+ public Spec Spec { get; set; }
217217
218218 /// <summary>
219219 /// An object that describes what fields should be repeated into views that are laid out as a
220220 /// `row` or `column`.
221221 /// </summary>
222- [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
223- public Repeat? Repeat { get; set; }
222+ [JsonProperty("repeat", Required = Required.Always)]
223+ public Repeat Repeat { get; set; }
224224
225225 /// <summary>
226226 /// A list of views that should be concatenated and put into a column.
227227 /// </summary>
228- [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
229- public Spec[]? Vconcat { get; set; }
228+ [JsonProperty("vconcat", Required = Required.Always)]
229+ public Spec[] Vconcat { get; set; }
230230
231231 /// <summary>
232232 /// A list of views that should be concatenated and put into a row.
233233 /// </summary>
234- [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
235- public Spec[]? Hconcat { get; set; }
234+ [JsonProperty("hconcat", Required = Required.Always)]
235+ public Spec[] Hconcat { get; set; }
236236 }
237237
238238 public partial record AutoSizeParams
@@ -2061,8 +2061,8 @@ namespace QuickType
20612061 [JsonProperty("extent", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
20622062 public double[]? Extent { get; set; }
20632063
2064- [JsonProperty("scheme", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
2065- public string? Scheme { get; set; }
2064+ [JsonProperty("scheme", Required = Required.Always)]
2065+ public string Scheme { get; set; }
20662066
20672067 [JsonProperty("step", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
20682068 public double? Step { get; set; }
@@ -2587,8 +2587,8 @@ namespace QuickType
25872587 [JsonProperty("input", Required = Required.Always)]
25882588 public string Input { get; set; }
25892589
2590- [JsonProperty("options", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
2591- public string[]? Options { get; set; }
2590+ [JsonProperty("options", Required = Required.Always)]
2591+ public string[] Options { get; set; }
25922592
25932593 [JsonProperty("max", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
25942594 public double? Max { get; set; }
@@ -3564,8 +3564,8 @@ namespace QuickType
35643564 /// An URL from which to load the data set. Use the `format.type` property
35653565 /// to ensure the loaded data is correctly parsed.
35663566 /// </summary>
3567- [JsonProperty("url", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3568- public string? Url { get; set; }
3567+ [JsonProperty("url", Required = Required.Always)]
3568+ public string Url { get; set; }
35693569
35703570 /// <summary>
35713571 /// The full data set, included inline. This can be an array of objects or primitive values
@@ -3573,14 +3573,14 @@ namespace QuickType
35733573 /// Arrays of primitive values are ingested as objects with a `data` property. Strings are
35743574 /// parsed according to the specified format type.
35753575 /// </summary>
3576- [JsonProperty("values", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3577- public Values? Values { get; set; }
3576+ [JsonProperty("values", Required = Required.Always)]
3577+ public Values Values { get; set; }
35783578
35793579 /// <summary>
35803580 /// Provide a placeholder name and bind data at runtime.
35813581 /// </summary>
3582- [JsonProperty("name", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3583- public string? Name { get; set; }
3582+ [JsonProperty("name", Required = Required.Always)]
3583+ public string Name { get; set; }
35843584 }
35853585
35863586 /// <summary>
@@ -3910,8 +3910,8 @@ namespace QuickType
39103910 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
39113911 /// [geographic projection](projection.html) is applied.
39123912 /// </summary>
3913- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3914- public ConditionalPredicateValueDefType? Type { get; set; }
3913+ [JsonProperty("type", Required = Required.Always)]
3914+ public ConditionalPredicateValueDefType Type { get; set; }
39153915
39163916 /// <summary>
39173917 /// A constant value in visual domain.
@@ -3990,8 +3990,8 @@ namespace QuickType
39903990
39913991 public partial record ConditionalValueDef
39923992 {
3993- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3994- public LogicalOperandPredicate? Test { get; set; }
3993+ [JsonProperty("test", Required = Required.Always)]
3994+ public LogicalOperandPredicate Test { get; set; }
39953995
39963996 /// <summary>
39973997 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -4004,46 +4004,46 @@ namespace QuickType
40044004 /// A [selection name](selection.html), or a series of [composed
40054005 /// selections](selection.html#compose).
40064006 /// </summary>
4007- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4008- public SelectionOperand? Selection { get; set; }
4007+ [JsonProperty("selection", Required = Required.Always)]
4008+ public SelectionOperand Selection { get; set; }
40094009 }
40104010
40114011 public partial record Selection
40124012 {
4013- [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4014- public SelectionOperand? Not { get; set; }
4013+ [JsonProperty("not", Required = Required.Always)]
4014+ public SelectionOperand Not { get; set; }
40154015
4016- [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4017- public SelectionOperand[]? And { get; set; }
4016+ [JsonProperty("and", Required = Required.Always)]
4017+ public SelectionOperand[] And { get; set; }
40184018
4019- [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4020- public SelectionOperand[]? Or { get; set; }
4019+ [JsonProperty("or", Required = Required.Always)]
4020+ public SelectionOperand[] Or { get; set; }
40214021 }
40224022
40234023 public partial record Predicate
40244024 {
4025- [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4026- public LogicalOperandPredicate? Not { get; set; }
4025+ [JsonProperty("not", Required = Required.Always)]
4026+ public LogicalOperandPredicate Not { get; set; }
40274027
4028- [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4029- public LogicalOperandPredicate[]? And { get; set; }
4028+ [JsonProperty("and", Required = Required.Always)]
4029+ public LogicalOperandPredicate[] And { get; set; }
40304030
4031- [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4032- public LogicalOperandPredicate[]? Or { get; set; }
4031+ [JsonProperty("or", Required = Required.Always)]
4032+ public LogicalOperandPredicate[] Or { get; set; }
40334033
40344034 /// <summary>
40354035 /// The value that the field should be equal to.
40364036 /// </summary>
4037- [JsonProperty("equal", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4038- public Equal? Equal { get; set; }
4037+ [JsonProperty("equal", Required = Required.Always)]
4038+ public Equal Equal { get; set; }
40394039
40404040 /// <summary>
40414041 /// Field to be filtered.
40424042 ///
40434043 /// Field to be filtered
40444044 /// </summary>
4045- [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4046- public string? Field { get; set; }
4045+ [JsonProperty("field", Required = Required.Always)]
4046+ public string Field { get; set; }
40474047
40484048 /// <summary>
40494049 /// Time unit for the field to be filtered.
@@ -4057,21 +4057,21 @@ namespace QuickType
40574057 /// An array of inclusive minimum and maximum values
40584058 /// for a field value of a data item to be included in the filtered data.
40594059 /// </summary>
4060- [JsonProperty("range", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4061- public RangeElement[]? Range { get; set; }
4060+ [JsonProperty("range", Required = Required.Always)]
4061+ public RangeElement[] Range { get; set; }
40624062
40634063 /// <summary>
40644064 /// A set of values that the `field`'s value should be a member of,
40654065 /// for a data item included in the filtered data.
40664066 /// </summary>
4067- [JsonProperty("oneOf", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4068- public Equal[]? OneOf { get; set; }
4067+ [JsonProperty("oneOf", Required = Required.Always)]
4068+ public Equal[] OneOf { get; set; }
40694069
40704070 /// <summary>
40714071 /// Filter using a selection name.
40724072 /// </summary>
4073- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4074- public SelectionOperand? Selection { get; set; }
4073+ [JsonProperty("selection", Required = Required.Always)]
4074+ public SelectionOperand Selection { get; set; }
40754075 }
40764076
40774077 /// <summary>
@@ -4158,22 +4158,22 @@ namespace QuickType
41584158
41594159 public partial record ConditionalPredicateMarkPropFieldDefClass
41604160 {
4161- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4162- public LogicalOperandPredicate? Test { get; set; }
4161+ [JsonProperty("test", Required = Required.Always)]
4162+ public LogicalOperandPredicate Test { get; set; }
41634163
41644164 /// <summary>
41654165 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
41664166 /// `0` to `1` for opacity).
41674167 /// </summary>
4168- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4169- public ConditionalValueDefValue? Value { get; set; }
4168+ [JsonProperty("value", Required = Required.Always)]
4169+ public ConditionalValueDefValue Value { get; set; }
41704170
41714171 /// <summary>
41724172 /// A [selection name](selection.html), or a series of [composed
41734173 /// selections](selection.html#compose).
41744174 /// </summary>
4175- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4176- public SelectionOperand? Selection { get; set; }
4175+ [JsonProperty("selection", Required = Required.Always)]
4176+ public SelectionOperand Selection { get; set; }
41774177
41784178 /// <summary>
41794179 /// Aggregation function for the field
@@ -4254,8 +4254,8 @@ namespace QuickType
42544254 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
42554255 /// [geographic projection](projection.html) is applied.
42564256 /// </summary>
4257- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4258- public ConditionalPredicateValueDefType? Type { get; set; }
4257+ [JsonProperty("type", Required = Required.Always)]
4258+ public ConditionalPredicateValueDefType Type { get; set; }
42594259 }
42604260
42614261 /// <summary>
@@ -4960,8 +4960,8 @@ namespace QuickType
49604960 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
49614961 /// [geographic projection](projection.html) is applied.
49624962 /// </summary>
4963- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4964- public ConditionalPredicateValueDefType? Type { get; set; }
4963+ [JsonProperty("type", Required = Required.Always)]
4964+ public ConditionalPredicateValueDefType Type { get; set; }
49654965
49664966 /// <summary>
49674967 /// A constant value in visual domain.
@@ -4972,22 +4972,22 @@ namespace QuickType
49724972
49734973 public partial record ConditionalPredicateFieldDefClass
49744974 {
4975- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4976- public LogicalOperandPredicate? Test { get; set; }
4975+ [JsonProperty("test", Required = Required.Always)]
4976+ public LogicalOperandPredicate Test { get; set; }
49774977
49784978 /// <summary>
49794979 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
49804980 /// `0` to `1` for opacity).
49814981 /// </summary>
4982- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4983- public ConditionalValueDefValue? Value { get; set; }
4982+ [JsonProperty("value", Required = Required.Always)]
4983+ public ConditionalValueDefValue Value { get; set; }
49844984
49854985 /// <summary>
49864986 /// A [selection name](selection.html), or a series of [composed
49874987 /// selections](selection.html#compose).
49884988 /// </summary>
4989- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4990- public SelectionOperand? Selection { get; set; }
4989+ [JsonProperty("selection", Required = Required.Always)]
4990+ public SelectionOperand Selection { get; set; }
49914991
49924992 /// <summary>
49934993 /// Aggregation function for the field
@@ -5038,8 +5038,8 @@ namespace QuickType
50385038 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
50395039 /// [geographic projection](projection.html) is applied.
50405040 /// </summary>
5041- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5042- public ConditionalPredicateValueDefType? Type { get; set; }
5041+ [JsonProperty("type", Required = Required.Always)]
5042+ public ConditionalPredicateValueDefType Type { get; set; }
50435043 }
50445044
50455045 public partial record OrderFieldDef
@@ -5191,8 +5191,8 @@ namespace QuickType
51915191 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
51925192 /// [geographic projection](projection.html) is applied.
51935193 /// </summary>
5194- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5195- public ConditionalPredicateValueDefType? Type { get; set; }
5194+ [JsonProperty("type", Required = Required.Always)]
5195+ public ConditionalPredicateValueDefType Type { get; set; }
51965196
51975197 /// <summary>
51985198 /// A constant value in visual domain.
@@ -5203,22 +5203,22 @@ namespace QuickType
52035203
52045204 public partial record ConditionalPredicateTextFieldDefClass
52055205 {
5206- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5207- public LogicalOperandPredicate? Test { get; set; }
5206+ [JsonProperty("test", Required = Required.Always)]
5207+ public LogicalOperandPredicate Test { get; set; }
52085208
52095209 /// <summary>
52105210 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
52115211 /// `0` to `1` for opacity).
52125212 /// </summary>
5213- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5214- public ConditionalValueDefValue? Value { get; set; }
5213+ [JsonProperty("value", Required = Required.Always)]
5214+ public ConditionalValueDefValue Value { get; set; }
52155215
52165216 /// <summary>
52175217 /// A [selection name](selection.html), or a series of [composed
52185218 /// selections](selection.html#compose).
52195219 /// </summary>
5220- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5221- public SelectionOperand? Selection { get; set; }
5220+ [JsonProperty("selection", Required = Required.Always)]
5221+ public SelectionOperand Selection { get; set; }
52225222
52235223 /// <summary>
52245224 /// Aggregation function for the field
@@ -5276,8 +5276,8 @@ namespace QuickType
52765276 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
52775277 /// [geographic projection](projection.html) is applied.
52785278 /// </summary>
5279- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5280- public ConditionalPredicateValueDefType? Type { get; set; }
5279+ [JsonProperty("type", Required = Required.Always)]
5280+ public ConditionalPredicateValueDefType Type { get; set; }
52815281 }
52825282
52835283 /// <summary>
@@ -5393,15 +5393,15 @@ namespace QuickType
53935393 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
53945394 /// [geographic projection](projection.html) is applied.
53955395 /// </summary>
5396- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5397- public ConditionalPredicateValueDefType? Type { get; set; }
5396+ [JsonProperty("type", Required = Required.Always)]
5397+ public ConditionalPredicateValueDefType Type { get; set; }
53985398
53995399 /// <summary>
54005400 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
54015401 /// `0` to `1` for opacity).
54025402 /// </summary>
5403- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5404- public ConditionalValueDefValue? Value { get; set; }
5403+ [JsonProperty("value", Required = Required.Always)]
5404+ public ConditionalValueDefValue Value { get; set; }
54055405 }
54065406
54075407 public partial record Axis
@@ -5678,15 +5678,15 @@ namespace QuickType
56785678 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
56795679 /// [geographic projection](projection.html) is applied.
56805680 /// </summary>
5681- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5682- public ConditionalPredicateValueDefType? Type { get; set; }
5681+ [JsonProperty("type", Required = Required.Always)]
5682+ public ConditionalPredicateValueDefType Type { get; set; }
56835683
56845684 /// <summary>
56855685 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
56865686 /// `0` to `1` for opacity).
56875687 /// </summary>
5688- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5689- public ConditionalValueDefValue? Value { get; set; }
5688+ [JsonProperty("value", Required = Required.Always)]
5689+ public ConditionalValueDefValue Value { get; set; }
56905690 }
56915691
56925692 /// <summary>
@@ -5753,8 +5753,8 @@ namespace QuickType
57535753 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
57545754 /// layering facet specifications is not allowed.
57555755 /// </summary>
5756- [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5757- public LayerSpec[]? Layer { get; set; }
5756+ [JsonProperty("layer", Required = Required.Always)]
5757+ public LayerSpec[] Layer { get; set; }
57585758
57595759 /// <summary>
57605760 /// Name of the visualization for later reference.
@@ -5816,8 +5816,8 @@ namespace QuickType
58165816 /// <summary>
58175817 /// A key-value mapping between encoding channels and definition of fields.
58185818 /// </summary>
5819- [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5820- public Encoding? Encoding { get; set; }
5819+ [JsonProperty("encoding", Required = Required.Always)]
5820+ public Encoding Encoding { get; set; }
58215821
58225822 /// <summary>
58235823 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -5825,8 +5825,8 @@ namespace QuickType
58255825 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
58265826 /// object](mark.html#mark-def).
58275827 /// </summary>
5828- [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5829- public AnyMark? Mark { get; set; }
5828+ [JsonProperty("mark", Required = Required.Always)]
5829+ public AnyMark Mark { get; set; }
58305830
58315831 /// <summary>
58325832 /// An object defining properties of geographic projection.
@@ -5847,33 +5847,33 @@ namespace QuickType
58475847 /// An object that describes mappings between `row` and `column` channels and their field
58485848 /// definitions.
58495849 /// </summary>
5850- [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5851- public FacetMapping? Facet { get; set; }
5850+ [JsonProperty("facet", Required = Required.Always)]
5851+ public FacetMapping Facet { get; set; }
58525852
58535853 /// <summary>
58545854 /// A specification of the view that gets faceted.
58555855 /// </summary>
5856- [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5857- public Spec? SpecSpec { get; set; }
5856+ [JsonProperty("spec", Required = Required.Always)]
5857+ public Spec SpecSpec { get; set; }
58585858
58595859 /// <summary>
58605860 /// An object that describes what fields should be repeated into views that are laid out as a
58615861 /// `row` or `column`.
58625862 /// </summary>
5863- [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5864- public Repeat? Repeat { get; set; }
5863+ [JsonProperty("repeat", Required = Required.Always)]
5864+ public Repeat Repeat { get; set; }
58655865
58665866 /// <summary>
58675867 /// A list of views that should be concatenated and put into a column.
58685868 /// </summary>
5869- [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5870- public Spec[]? Vconcat { get; set; }
5869+ [JsonProperty("vconcat", Required = Required.Always)]
5870+ public Spec[] Vconcat { get; set; }
58715871
58725872 /// <summary>
58735873 /// A list of views that should be concatenated and put into a row.
58745874 /// </summary>
5875- [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5876- public Spec[]? Hconcat { get; set; }
5875+ [JsonProperty("hconcat", Required = Required.Always)]
5876+ public Spec[] Hconcat { get; set; }
58775877 }
58785878
58795879 /// <summary>
@@ -6031,8 +6031,8 @@ namespace QuickType
60316031 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
60326032 /// layering facet specifications is not allowed.
60336033 /// </summary>
6034- [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6035- public LayerSpec[]? Layer { get; set; }
6034+ [JsonProperty("layer", Required = Required.Always)]
6035+ public LayerSpec[] Layer { get; set; }
60366036
60376037 /// <summary>
60386038 /// Name of the visualization for later reference.
@@ -6086,8 +6086,8 @@ namespace QuickType
60866086 /// <summary>
60876087 /// A key-value mapping between encoding channels and definition of fields.
60886088 /// </summary>
6089- [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6090- public Encoding? Encoding { get; set; }
6089+ [JsonProperty("encoding", Required = Required.Always)]
6090+ public Encoding Encoding { get; set; }
60916091
60926092 /// <summary>
60936093 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6095,8 +6095,8 @@ namespace QuickType
60956095 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
60966096 /// object](mark.html#mark-def).
60976097 /// </summary>
6098- [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6099- public AnyMark? Mark { get; set; }
6098+ [JsonProperty("mark", Required = Required.Always)]
6099+ public AnyMark Mark { get; set; }
61006100
61016101 /// <summary>
61026102 /// An object defining properties of geographic projection.
@@ -6737,8 +6737,8 @@ namespace QuickType
67376737 /// (3) a [selection predicate](filter.html#selection-predicate);
67386738 /// or (4) a logical operand that combines (1), (2), or (3).
67396739 /// </summary>
6740- [JsonProperty("filter", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6741- public LogicalOperandPredicate? Filter { get; set; }
6740+ [JsonProperty("filter", Required = Required.Always)]
6741+ public LogicalOperandPredicate Filter { get; set; }
67426742
67436743 /// <summary>
67446744 /// The field for storing the computed formula value.
@@ -6759,8 +6759,8 @@ namespace QuickType
67596759 /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the
67606760 /// current data object.
67616761 /// </summary>
6762- [JsonProperty("calculate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6763- public string? Calculate { get; set; }
6762+ [JsonProperty("calculate", Required = Required.Always)]
6763+ public string Calculate { get; set; }
67646764
67656765 /// <summary>
67666766 /// The default value to use if lookup fails.
@@ -6773,40 +6773,40 @@ namespace QuickType
67736773 /// <summary>
67746774 /// Secondary data reference.
67756775 /// </summary>
6776- [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6777- public LookupData? From { get; set; }
6776+ [JsonProperty("from", Required = Required.Always)]
6777+ public LookupData From { get; set; }
67786778
67796779 /// <summary>
67806780 /// Key in primary data source.
67816781 /// </summary>
6782- [JsonProperty("lookup", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6783- public string? Lookup { get; set; }
6782+ [JsonProperty("lookup", Required = Required.Always)]
6783+ public string Lookup { get; set; }
67846784
67856785 /// <summary>
67866786 /// An object indicating bin properties, or simply `true` for using default bin parameters.
67876787 /// </summary>
6788- [JsonProperty("bin", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6789- public Bin? Bin { get; set; }
6788+ [JsonProperty("bin", Required = Required.Always)]
6789+ public Bin Bin { get; set; }
67906790
67916791 /// <summary>
67926792 /// The data field to bin.
67936793 ///
67946794 /// The data field to apply time unit.
67956795 /// </summary>
6796- [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6797- public string? Field { get; set; }
6796+ [JsonProperty("field", Required = Required.Always)]
6797+ public string Field { get; set; }
67986798
67996799 /// <summary>
68006800 /// The timeUnit.
68016801 /// </summary>
6802- [JsonProperty("timeUnit", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6803- public TimeUnit? TimeUnit { get; set; }
6802+ [JsonProperty("timeUnit", Required = Required.Always)]
6803+ public TimeUnit TimeUnit { get; set; }
68046804
68056805 /// <summary>
68066806 /// Array of objects that define fields to aggregate.
68076807 /// </summary>
6808- [JsonProperty("aggregate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6809- public AggregatedFieldDef[]? Aggregate { get; set; }
6808+ [JsonProperty("aggregate", Required = Required.Always)]
6809+ public AggregatedFieldDef[] Aggregate { get; set; }
68106810
68116811 /// <summary>
68126812 /// The data fields to group by. If not specified, a single group containing all data objects
Mschema-csharp-SystemTextJsondefault / QuickType.cs+128 −128
@@ -79,9 +79,9 @@ namespace QuickType
7979 /// <summary>
8080 /// A key-value mapping between encoding channels and definition of fields.
8181 /// </summary>
82- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
82+ [JsonRequired]
8383 [JsonPropertyName("encoding")]
84- public EncodingWithFacet? Encoding { get; set; }
84+ public EncodingWithFacet Encoding { get; set; }
8585
8686 /// <summary>
8787 /// The height of a visualization.
@@ -112,9 +112,9 @@ namespace QuickType
112112 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
113113 /// object](mark.html#mark-def).
114114 /// </summary>
115- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
115+ [JsonRequired]
116116 [JsonPropertyName("mark")]
117- public AnyMark? Mark { get; set; }
117+ public AnyMark Mark { get; set; }
118118
119119 /// <summary>
120120 /// Name of the visualization for later reference.
@@ -198,9 +198,9 @@ namespace QuickType
198198 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
199199 /// layering facet specifications is not allowed.
200200 /// </summary>
201- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
201+ [JsonRequired]
202202 [JsonPropertyName("layer")]
203- public LayerSpec[]? Layer { get; set; }
203+ public LayerSpec[] Layer { get; set; }
204204
205205 /// <summary>
206206 /// Scale, axis, and legend resolutions for layers.
@@ -221,38 +221,38 @@ namespace QuickType
221221 /// An object that describes mappings between `row` and `column` channels and their field
222222 /// definitions.
223223 /// </summary>
224- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
224+ [JsonRequired]
225225 [JsonPropertyName("facet")]
226- public FacetMapping? Facet { get; set; }
226+ public FacetMapping Facet { get; set; }
227227
228228 /// <summary>
229229 /// A specification of the view that gets faceted.
230230 /// </summary>
231- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
231+ [JsonRequired]
232232 [JsonPropertyName("spec")]
233- public Spec? Spec { get; set; }
233+ public Spec Spec { get; set; }
234234
235235 /// <summary>
236236 /// An object that describes what fields should be repeated into views that are laid out as a
237237 /// `row` or `column`.
238238 /// </summary>
239- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
239+ [JsonRequired]
240240 [JsonPropertyName("repeat")]
241- public Repeat? Repeat { get; set; }
241+ public Repeat Repeat { get; set; }
242242
243243 /// <summary>
244244 /// A list of views that should be concatenated and put into a column.
245245 /// </summary>
246- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
246+ [JsonRequired]
247247 [JsonPropertyName("vconcat")]
248- public Spec[]? Vconcat { get; set; }
248+ public Spec[] Vconcat { get; set; }
249249
250250 /// <summary>
251251 /// A list of views that should be concatenated and put into a row.
252252 /// </summary>
253- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
253+ [JsonRequired]
254254 [JsonPropertyName("hconcat")]
255- public Spec[]? Hconcat { get; set; }
255+ public Spec[] Hconcat { get; set; }
256256 }
257257
258258 public partial class AutoSizeParams
@@ -2318,9 +2318,9 @@ namespace QuickType
23182318 [JsonPropertyName("extent")]
23192319 public double[]? Extent { get; set; }
23202320
2321- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
2321+ [JsonRequired]
23222322 [JsonPropertyName("scheme")]
2323- public string? Scheme { get; set; }
2323+ public string Scheme { get; set; }
23242324
23252325 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
23262326 [JsonPropertyName("step")]
@@ -2896,9 +2896,9 @@ namespace QuickType
28962896 [JsonPropertyName("input")]
28972897 public string Input { get; set; }
28982898
2899- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
2899+ [JsonRequired]
29002900 [JsonPropertyName("options")]
2901- public string[]? Options { get; set; }
2901+ public string[] Options { get; set; }
29022902
29032903 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
29042904 [JsonPropertyName("max")]
@@ -3989,9 +3989,9 @@ namespace QuickType
39893989 /// An URL from which to load the data set. Use the `format.type` property
39903990 /// to ensure the loaded data is correctly parsed.
39913991 /// </summary>
3992- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
3992+ [JsonRequired]
39933993 [JsonPropertyName("url")]
3994- public string? Url { get; set; }
3994+ public string Url { get; set; }
39953995
39963996 /// <summary>
39973997 /// The full data set, included inline. This can be an array of objects or primitive values
@@ -3999,16 +3999,16 @@ namespace QuickType
39993999 /// Arrays of primitive values are ingested as objects with a `data` property. Strings are
40004000 /// parsed according to the specified format type.
40014001 /// </summary>
4002- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4002+ [JsonRequired]
40034003 [JsonPropertyName("values")]
4004- public Values? Values { get; set; }
4004+ public Values Values { get; set; }
40054005
40064006 /// <summary>
40074007 /// Provide a placeholder name and bind data at runtime.
40084008 /// </summary>
4009- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4009+ [JsonRequired]
40104010 [JsonPropertyName("name")]
4011- public string? Name { get; set; }
4011+ public string Name { get; set; }
40124012 }
40134013
40144014 /// <summary>
@@ -4364,9 +4364,9 @@ namespace QuickType
43644364 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
43654365 /// [geographic projection](projection.html) is applied.
43664366 /// </summary>
4367- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4367+ [JsonRequired]
43684368 [JsonPropertyName("type")]
4369- public ConditionalPredicateValueDefType? Type { get; set; }
4369+ public ConditionalPredicateValueDefType Type { get; set; }
43704370
43714371 /// <summary>
43724372 /// A constant value in visual domain.
@@ -4454,9 +4454,9 @@ namespace QuickType
44544454
44554455 public partial class ConditionalValueDef
44564456 {
4457- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4457+ [JsonRequired]
44584458 [JsonPropertyName("test")]
4459- public LogicalOperandPredicate? Test { get; set; }
4459+ public LogicalOperandPredicate Test { get; set; }
44604460
44614461 /// <summary>
44624462 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -4470,55 +4470,55 @@ namespace QuickType
44704470 /// A [selection name](selection.html), or a series of [composed
44714471 /// selections](selection.html#compose).
44724472 /// </summary>
4473- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4473+ [JsonRequired]
44744474 [JsonPropertyName("selection")]
4475- public SelectionOperand? Selection { get; set; }
4475+ public SelectionOperand Selection { get; set; }
44764476 }
44774477
44784478 public partial class Selection
44794479 {
4480- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4480+ [JsonRequired]
44814481 [JsonPropertyName("not")]
4482- public SelectionOperand? Not { get; set; }
4482+ public SelectionOperand Not { get; set; }
44834483
4484- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4484+ [JsonRequired]
44854485 [JsonPropertyName("and")]
4486- public SelectionOperand[]? And { get; set; }
4486+ public SelectionOperand[] And { get; set; }
44874487
4488- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4488+ [JsonRequired]
44894489 [JsonPropertyName("or")]
4490- public SelectionOperand[]? Or { get; set; }
4490+ public SelectionOperand[] Or { get; set; }
44914491 }
44924492
44934493 public partial class Predicate
44944494 {
4495- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4495+ [JsonRequired]
44964496 [JsonPropertyName("not")]
4497- public LogicalOperandPredicate? Not { get; set; }
4497+ public LogicalOperandPredicate Not { get; set; }
44984498
4499- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4499+ [JsonRequired]
45004500 [JsonPropertyName("and")]
4501- public LogicalOperandPredicate[]? And { get; set; }
4501+ public LogicalOperandPredicate[] And { get; set; }
45024502
4503- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4503+ [JsonRequired]
45044504 [JsonPropertyName("or")]
4505- public LogicalOperandPredicate[]? Or { get; set; }
4505+ public LogicalOperandPredicate[] Or { get; set; }
45064506
45074507 /// <summary>
45084508 /// The value that the field should be equal to.
45094509 /// </summary>
4510- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4510+ [JsonRequired]
45114511 [JsonPropertyName("equal")]
4512- public Equal? Equal { get; set; }
4512+ public Equal Equal { get; set; }
45134513
45144514 /// <summary>
45154515 /// Field to be filtered.
45164516 ///
45174517 /// Field to be filtered
45184518 /// </summary>
4519- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4519+ [JsonRequired]
45204520 [JsonPropertyName("field")]
4521- public string? Field { get; set; }
4521+ public string Field { get; set; }
45224522
45234523 /// <summary>
45244524 /// Time unit for the field to be filtered.
@@ -4533,24 +4533,24 @@ namespace QuickType
45334533 /// An array of inclusive minimum and maximum values
45344534 /// for a field value of a data item to be included in the filtered data.
45354535 /// </summary>
4536- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4536+ [JsonRequired]
45374537 [JsonPropertyName("range")]
4538- public RangeElement[]? Range { get; set; }
4538+ public RangeElement[] Range { get; set; }
45394539
45404540 /// <summary>
45414541 /// A set of values that the `field`'s value should be a member of,
45424542 /// for a data item included in the filtered data.
45434543 /// </summary>
4544- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4544+ [JsonRequired]
45454545 [JsonPropertyName("oneOf")]
4546- public Equal[]? OneOf { get; set; }
4546+ public Equal[] OneOf { get; set; }
45474547
45484548 /// <summary>
45494549 /// Filter using a selection name.
45504550 /// </summary>
4551- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4551+ [JsonRequired]
45524552 [JsonPropertyName("selection")]
4553- public SelectionOperand? Selection { get; set; }
4553+ public SelectionOperand Selection { get; set; }
45544554 }
45554555
45564556 /// <summary>
@@ -4647,25 +4647,25 @@ namespace QuickType
46474647
46484648 public partial class ConditionalPredicateMarkPropFieldDefClass
46494649 {
4650- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4650+ [JsonRequired]
46514651 [JsonPropertyName("test")]
4652- public LogicalOperandPredicate? Test { get; set; }
4652+ public LogicalOperandPredicate Test { get; set; }
46534653
46544654 /// <summary>
46554655 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
46564656 /// `0` to `1` for opacity).
46574657 /// </summary>
4658- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4658+ [JsonRequired]
46594659 [JsonPropertyName("value")]
4660- public ConditionalValueDefValue? Value { get; set; }
4660+ public ConditionalValueDefValue Value { get; set; }
46614661
46624662 /// <summary>
46634663 /// A [selection name](selection.html), or a series of [composed
46644664 /// selections](selection.html#compose).
46654665 /// </summary>
4666- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4666+ [JsonRequired]
46674667 [JsonPropertyName("selection")]
4668- public SelectionOperand? Selection { get; set; }
4668+ public SelectionOperand Selection { get; set; }
46694669
46704670 /// <summary>
46714671 /// Aggregation function for the field
@@ -4751,9 +4751,9 @@ namespace QuickType
47514751 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
47524752 /// [geographic projection](projection.html) is applied.
47534753 /// </summary>
4754- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4754+ [JsonRequired]
47554755 [JsonPropertyName("type")]
4756- public ConditionalPredicateValueDefType? Type { get; set; }
4756+ public ConditionalPredicateValueDefType Type { get; set; }
47574757 }
47584758
47594759 /// <summary>
@@ -5511,9 +5511,9 @@ namespace QuickType
55115511 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
55125512 /// [geographic projection](projection.html) is applied.
55135513 /// </summary>
5514- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5514+ [JsonRequired]
55155515 [JsonPropertyName("type")]
5516- public ConditionalPredicateValueDefType? Type { get; set; }
5516+ public ConditionalPredicateValueDefType Type { get; set; }
55175517
55185518 /// <summary>
55195519 /// A constant value in visual domain.
@@ -5525,25 +5525,25 @@ namespace QuickType
55255525
55265526 public partial class ConditionalPredicateFieldDefClass
55275527 {
5528- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5528+ [JsonRequired]
55295529 [JsonPropertyName("test")]
5530- public LogicalOperandPredicate? Test { get; set; }
5530+ public LogicalOperandPredicate Test { get; set; }
55315531
55325532 /// <summary>
55335533 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
55345534 /// `0` to `1` for opacity).
55355535 /// </summary>
5536- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5536+ [JsonRequired]
55375537 [JsonPropertyName("value")]
5538- public ConditionalValueDefValue? Value { get; set; }
5538+ public ConditionalValueDefValue Value { get; set; }
55395539
55405540 /// <summary>
55415541 /// A [selection name](selection.html), or a series of [composed
55425542 /// selections](selection.html#compose).
55435543 /// </summary>
5544- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5544+ [JsonRequired]
55455545 [JsonPropertyName("selection")]
5546- public SelectionOperand? Selection { get; set; }
5546+ public SelectionOperand Selection { get; set; }
55475547
55485548 /// <summary>
55495549 /// Aggregation function for the field
@@ -5598,9 +5598,9 @@ namespace QuickType
55985598 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
55995599 /// [geographic projection](projection.html) is applied.
56005600 /// </summary>
5601- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5601+ [JsonRequired]
56025602 [JsonPropertyName("type")]
5603- public ConditionalPredicateValueDefType? Type { get; set; }
5603+ public ConditionalPredicateValueDefType Type { get; set; }
56045604 }
56055605
56065606 public partial class OrderFieldDef
@@ -5763,9 +5763,9 @@ namespace QuickType
57635763 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
57645764 /// [geographic projection](projection.html) is applied.
57655765 /// </summary>
5766- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5766+ [JsonRequired]
57675767 [JsonPropertyName("type")]
5768- public ConditionalPredicateValueDefType? Type { get; set; }
5768+ public ConditionalPredicateValueDefType Type { get; set; }
57695769
57705770 /// <summary>
57715771 /// A constant value in visual domain.
@@ -5777,25 +5777,25 @@ namespace QuickType
57775777
57785778 public partial class ConditionalPredicateTextFieldDefClass
57795779 {
5780- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5780+ [JsonRequired]
57815781 [JsonPropertyName("test")]
5782- public LogicalOperandPredicate? Test { get; set; }
5782+ public LogicalOperandPredicate Test { get; set; }
57835783
57845784 /// <summary>
57855785 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
57865786 /// `0` to `1` for opacity).
57875787 /// </summary>
5788- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5788+ [JsonRequired]
57895789 [JsonPropertyName("value")]
5790- public ConditionalValueDefValue? Value { get; set; }
5790+ public ConditionalValueDefValue Value { get; set; }
57915791
57925792 /// <summary>
57935793 /// A [selection name](selection.html), or a series of [composed
57945794 /// selections](selection.html#compose).
57955795 /// </summary>
5796- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5796+ [JsonRequired]
57975797 [JsonPropertyName("selection")]
5798- public SelectionOperand? Selection { get; set; }
5798+ public SelectionOperand Selection { get; set; }
57995799
58005800 /// <summary>
58015801 /// Aggregation function for the field
@@ -5858,9 +5858,9 @@ namespace QuickType
58585858 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
58595859 /// [geographic projection](projection.html) is applied.
58605860 /// </summary>
5861- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5861+ [JsonRequired]
58625862 [JsonPropertyName("type")]
5863- public ConditionalPredicateValueDefType? Type { get; set; }
5863+ public ConditionalPredicateValueDefType Type { get; set; }
58645864 }
58655865
58665866 /// <summary>
@@ -5981,17 +5981,17 @@ namespace QuickType
59815981 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
59825982 /// [geographic projection](projection.html) is applied.
59835983 /// </summary>
5984- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5984+ [JsonRequired]
59855985 [JsonPropertyName("type")]
5986- public ConditionalPredicateValueDefType? Type { get; set; }
5986+ public ConditionalPredicateValueDefType Type { get; set; }
59875987
59885988 /// <summary>
59895989 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
59905990 /// `0` to `1` for opacity).
59915991 /// </summary>
5992- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5992+ [JsonRequired]
59935993 [JsonPropertyName("value")]
5994- public ConditionalValueDefValue? Value { get; set; }
5994+ public ConditionalValueDefValue Value { get; set; }
59955995 }
59965996
59975997 public partial class Axis
@@ -6293,17 +6293,17 @@ namespace QuickType
62936293 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
62946294 /// [geographic projection](projection.html) is applied.
62956295 /// </summary>
6296- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6296+ [JsonRequired]
62976297 [JsonPropertyName("type")]
6298- public ConditionalPredicateValueDefType? Type { get; set; }
6298+ public ConditionalPredicateValueDefType Type { get; set; }
62996299
63006300 /// <summary>
63016301 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
63026302 /// `0` to `1` for opacity).
63036303 /// </summary>
6304- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6304+ [JsonRequired]
63056305 [JsonPropertyName("value")]
6306- public ConditionalValueDefValue? Value { get; set; }
6306+ public ConditionalValueDefValue Value { get; set; }
63076307 }
63086308
63096309 /// <summary>
@@ -6375,9 +6375,9 @@ namespace QuickType
63756375 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
63766376 /// layering facet specifications is not allowed.
63776377 /// </summary>
6378- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6378+ [JsonRequired]
63796379 [JsonPropertyName("layer")]
6380- public LayerSpec[]? Layer { get; set; }
6380+ public LayerSpec[] Layer { get; set; }
63816381
63826382 /// <summary>
63836383 /// Name of the visualization for later reference.
@@ -6444,9 +6444,9 @@ namespace QuickType
64446444 /// <summary>
64456445 /// A key-value mapping between encoding channels and definition of fields.
64466446 /// </summary>
6447- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6447+ [JsonRequired]
64486448 [JsonPropertyName("encoding")]
6449- public Encoding? Encoding { get; set; }
6449+ public Encoding Encoding { get; set; }
64506450
64516451 /// <summary>
64526452 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6454,9 +6454,9 @@ namespace QuickType
64546454 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
64556455 /// object](mark.html#mark-def).
64566456 /// </summary>
6457- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6457+ [JsonRequired]
64586458 [JsonPropertyName("mark")]
6459- public AnyMark? Mark { get; set; }
6459+ public AnyMark Mark { get; set; }
64606460
64616461 /// <summary>
64626462 /// An object defining properties of geographic projection.
@@ -6479,38 +6479,38 @@ namespace QuickType
64796479 /// An object that describes mappings between `row` and `column` channels and their field
64806480 /// definitions.
64816481 /// </summary>
6482- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6482+ [JsonRequired]
64836483 [JsonPropertyName("facet")]
6484- public FacetMapping? Facet { get; set; }
6484+ public FacetMapping Facet { get; set; }
64856485
64866486 /// <summary>
64876487 /// A specification of the view that gets faceted.
64886488 /// </summary>
6489- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6489+ [JsonRequired]
64906490 [JsonPropertyName("spec")]
6491- public Spec? SpecSpec { get; set; }
6491+ public Spec SpecSpec { get; set; }
64926492
64936493 /// <summary>
64946494 /// An object that describes what fields should be repeated into views that are laid out as a
64956495 /// `row` or `column`.
64966496 /// </summary>
6497- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6497+ [JsonRequired]
64986498 [JsonPropertyName("repeat")]
6499- public Repeat? Repeat { get; set; }
6499+ public Repeat Repeat { get; set; }
65006500
65016501 /// <summary>
65026502 /// A list of views that should be concatenated and put into a column.
65036503 /// </summary>
6504- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6504+ [JsonRequired]
65056505 [JsonPropertyName("vconcat")]
6506- public Spec[]? Vconcat { get; set; }
6506+ public Spec[] Vconcat { get; set; }
65076507
65086508 /// <summary>
65096509 /// A list of views that should be concatenated and put into a row.
65106510 /// </summary>
6511- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6511+ [JsonRequired]
65126512 [JsonPropertyName("hconcat")]
6513- public Spec[]? Hconcat { get; set; }
6513+ public Spec[] Hconcat { get; set; }
65146514 }
65156515
65166516 /// <summary>
@@ -6684,9 +6684,9 @@ namespace QuickType
66846684 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
66856685 /// layering facet specifications is not allowed.
66866686 /// </summary>
6687- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6687+ [JsonRequired]
66886688 [JsonPropertyName("layer")]
6689- public LayerSpec[]? Layer { get; set; }
6689+ public LayerSpec[] Layer { get; set; }
66906690
66916691 /// <summary>
66926692 /// Name of the visualization for later reference.
@@ -6745,9 +6745,9 @@ namespace QuickType
67456745 /// <summary>
67466746 /// A key-value mapping between encoding channels and definition of fields.
67476747 /// </summary>
6748- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6748+ [JsonRequired]
67496749 [JsonPropertyName("encoding")]
6750- public Encoding? Encoding { get; set; }
6750+ public Encoding Encoding { get; set; }
67516751
67526752 /// <summary>
67536753 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6755,9 +6755,9 @@ namespace QuickType
67556755 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
67566756 /// object](mark.html#mark-def).
67576757 /// </summary>
6758- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6758+ [JsonRequired]
67596759 [JsonPropertyName("mark")]
6760- public AnyMark? Mark { get; set; }
6760+ public AnyMark Mark { get; set; }
67616761
67626762 /// <summary>
67636763 /// An object defining properties of geographic projection.
@@ -7479,9 +7479,9 @@ namespace QuickType
74797479 /// (3) a [selection predicate](filter.html#selection-predicate);
74807480 /// or (4) a logical operand that combines (1), (2), or (3).
74817481 /// </summary>
7482- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7482+ [JsonRequired]
74837483 [JsonPropertyName("filter")]
7484- public LogicalOperandPredicate? Filter { get; set; }
7484+ public LogicalOperandPredicate Filter { get; set; }
74857485
74867486 /// <summary>
74877487 /// The field for storing the computed formula value.
@@ -7503,9 +7503,9 @@ namespace QuickType
75037503 /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the
75047504 /// current data object.
75057505 /// </summary>
7506- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7506+ [JsonRequired]
75077507 [JsonPropertyName("calculate")]
7508- public string? Calculate { get; set; }
7508+ public string Calculate { get; set; }
75097509
75107510 /// <summary>
75117511 /// The default value to use if lookup fails.
@@ -7519,46 +7519,46 @@ namespace QuickType
75197519 /// <summary>
75207520 /// Secondary data reference.
75217521 /// </summary>
7522- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7522+ [JsonRequired]
75237523 [JsonPropertyName("from")]
7524- public LookupData? From { get; set; }
7524+ public LookupData From { get; set; }
75257525
75267526 /// <summary>
75277527 /// Key in primary data source.
75287528 /// </summary>
7529- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7529+ [JsonRequired]
75307530 [JsonPropertyName("lookup")]
7531- public string? Lookup { get; set; }
7531+ public string Lookup { get; set; }
75327532
75337533 /// <summary>
75347534 /// An object indicating bin properties, or simply `true` for using default bin parameters.
75357535 /// </summary>
7536- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7536+ [JsonRequired]
75377537 [JsonPropertyName("bin")]
7538- public Bin? Bin { get; set; }
7538+ public Bin Bin { get; set; }
75397539
75407540 /// <summary>
75417541 /// The data field to bin.
75427542 ///
75437543 /// The data field to apply time unit.
75447544 /// </summary>
7545- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7545+ [JsonRequired]
75467546 [JsonPropertyName("field")]
7547- public string? Field { get; set; }
7547+ public string Field { get; set; }
75487548
75497549 /// <summary>
75507550 /// The timeUnit.
75517551 /// </summary>
7552- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7552+ [JsonRequired]
75537553 [JsonPropertyName("timeUnit")]
7554- public TimeUnit? TimeUnit { get; set; }
7554+ public TimeUnit TimeUnit { get; set; }
75557555
75567556 /// <summary>
75577557 /// Array of objects that define fields to aggregate.
75587558 /// </summary>
7559- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
7559+ [JsonRequired]
75607560 [JsonPropertyName("aggregate")]
7561- public AggregatedFieldDef[]? Aggregate { get; set; }
7561+ public AggregatedFieldDef[] Aggregate { get; set; }
75627562
75637563 /// <summary>
75647564 /// The data fields to group by. If not specified, a single group containing all data objects
Mschema-csharpdefault / QuickType.cs+128 −128
@@ -76,8 +76,8 @@ namespace QuickType
7676 /// <summary>
7777 /// A key-value mapping between encoding channels and definition of fields.
7878 /// </summary>
79- [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
80- public EncodingWithFacet? Encoding { get; set; }
79+ [JsonProperty("encoding", Required = Required.Always)]
80+ public EncodingWithFacet Encoding { get; set; }
8181
8282 /// <summary>
8383 /// The height of a visualization.
@@ -107,8 +107,8 @@ namespace QuickType
107107 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
108108 /// object](mark.html#mark-def).
109109 /// </summary>
110- [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
111- public AnyMark? Mark { get; set; }
110+ [JsonProperty("mark", Required = Required.Always)]
111+ public AnyMark Mark { get; set; }
112112
113113 /// <summary>
114114 /// Name of the visualization for later reference.
@@ -185,8 +185,8 @@ namespace QuickType
185185 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
186186 /// layering facet specifications is not allowed.
187187 /// </summary>
188- [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
189- public LayerSpec[]? Layer { get; set; }
188+ [JsonProperty("layer", Required = Required.Always)]
189+ public LayerSpec[] Layer { get; set; }
190190
191191 /// <summary>
192192 /// Scale, axis, and legend resolutions for layers.
@@ -206,33 +206,33 @@ namespace QuickType
206206 /// An object that describes mappings between `row` and `column` channels and their field
207207 /// definitions.
208208 /// </summary>
209- [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
210- public FacetMapping? Facet { get; set; }
209+ [JsonProperty("facet", Required = Required.Always)]
210+ public FacetMapping Facet { get; set; }
211211
212212 /// <summary>
213213 /// A specification of the view that gets faceted.
214214 /// </summary>
215- [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
216- public Spec? Spec { get; set; }
215+ [JsonProperty("spec", Required = Required.Always)]
216+ public Spec Spec { get; set; }
217217
218218 /// <summary>
219219 /// An object that describes what fields should be repeated into views that are laid out as a
220220 /// `row` or `column`.
221221 /// </summary>
222- [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
223- public Repeat? Repeat { get; set; }
222+ [JsonProperty("repeat", Required = Required.Always)]
223+ public Repeat Repeat { get; set; }
224224
225225 /// <summary>
226226 /// A list of views that should be concatenated and put into a column.
227227 /// </summary>
228- [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
229- public Spec[]? Vconcat { get; set; }
228+ [JsonProperty("vconcat", Required = Required.Always)]
229+ public Spec[] Vconcat { get; set; }
230230
231231 /// <summary>
232232 /// A list of views that should be concatenated and put into a row.
233233 /// </summary>
234- [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
235- public Spec[]? Hconcat { get; set; }
234+ [JsonProperty("hconcat", Required = Required.Always)]
235+ public Spec[] Hconcat { get; set; }
236236 }
237237
238238 public partial class AutoSizeParams
@@ -2061,8 +2061,8 @@ namespace QuickType
20612061 [JsonProperty("extent", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
20622062 public double[]? Extent { get; set; }
20632063
2064- [JsonProperty("scheme", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
2065- public string? Scheme { get; set; }
2064+ [JsonProperty("scheme", Required = Required.Always)]
2065+ public string Scheme { get; set; }
20662066
20672067 [JsonProperty("step", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
20682068 public double? Step { get; set; }
@@ -2587,8 +2587,8 @@ namespace QuickType
25872587 [JsonProperty("input", Required = Required.Always)]
25882588 public string Input { get; set; }
25892589
2590- [JsonProperty("options", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
2591- public string[]? Options { get; set; }
2590+ [JsonProperty("options", Required = Required.Always)]
2591+ public string[] Options { get; set; }
25922592
25932593 [JsonProperty("max", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
25942594 public double? Max { get; set; }
@@ -3564,8 +3564,8 @@ namespace QuickType
35643564 /// An URL from which to load the data set. Use the `format.type` property
35653565 /// to ensure the loaded data is correctly parsed.
35663566 /// </summary>
3567- [JsonProperty("url", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3568- public string? Url { get; set; }
3567+ [JsonProperty("url", Required = Required.Always)]
3568+ public string Url { get; set; }
35693569
35703570 /// <summary>
35713571 /// The full data set, included inline. This can be an array of objects or primitive values
@@ -3573,14 +3573,14 @@ namespace QuickType
35733573 /// Arrays of primitive values are ingested as objects with a `data` property. Strings are
35743574 /// parsed according to the specified format type.
35753575 /// </summary>
3576- [JsonProperty("values", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3577- public Values? Values { get; set; }
3576+ [JsonProperty("values", Required = Required.Always)]
3577+ public Values Values { get; set; }
35783578
35793579 /// <summary>
35803580 /// Provide a placeholder name and bind data at runtime.
35813581 /// </summary>
3582- [JsonProperty("name", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3583- public string? Name { get; set; }
3582+ [JsonProperty("name", Required = Required.Always)]
3583+ public string Name { get; set; }
35843584 }
35853585
35863586 /// <summary>
@@ -3910,8 +3910,8 @@ namespace QuickType
39103910 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
39113911 /// [geographic projection](projection.html) is applied.
39123912 /// </summary>
3913- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3914- public ConditionalPredicateValueDefType? Type { get; set; }
3913+ [JsonProperty("type", Required = Required.Always)]
3914+ public ConditionalPredicateValueDefType Type { get; set; }
39153915
39163916 /// <summary>
39173917 /// A constant value in visual domain.
@@ -3990,8 +3990,8 @@ namespace QuickType
39903990
39913991 public partial class ConditionalValueDef
39923992 {
3993- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
3994- public LogicalOperandPredicate? Test { get; set; }
3993+ [JsonProperty("test", Required = Required.Always)]
3994+ public LogicalOperandPredicate Test { get; set; }
39953995
39963996 /// <summary>
39973997 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -4004,46 +4004,46 @@ namespace QuickType
40044004 /// A [selection name](selection.html), or a series of [composed
40054005 /// selections](selection.html#compose).
40064006 /// </summary>
4007- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4008- public SelectionOperand? Selection { get; set; }
4007+ [JsonProperty("selection", Required = Required.Always)]
4008+ public SelectionOperand Selection { get; set; }
40094009 }
40104010
40114011 public partial class Selection
40124012 {
4013- [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4014- public SelectionOperand? Not { get; set; }
4013+ [JsonProperty("not", Required = Required.Always)]
4014+ public SelectionOperand Not { get; set; }
40154015
4016- [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4017- public SelectionOperand[]? And { get; set; }
4016+ [JsonProperty("and", Required = Required.Always)]
4017+ public SelectionOperand[] And { get; set; }
40184018
4019- [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4020- public SelectionOperand[]? Or { get; set; }
4019+ [JsonProperty("or", Required = Required.Always)]
4020+ public SelectionOperand[] Or { get; set; }
40214021 }
40224022
40234023 public partial class Predicate
40244024 {
4025- [JsonProperty("not", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4026- public LogicalOperandPredicate? Not { get; set; }
4025+ [JsonProperty("not", Required = Required.Always)]
4026+ public LogicalOperandPredicate Not { get; set; }
40274027
4028- [JsonProperty("and", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4029- public LogicalOperandPredicate[]? And { get; set; }
4028+ [JsonProperty("and", Required = Required.Always)]
4029+ public LogicalOperandPredicate[] And { get; set; }
40304030
4031- [JsonProperty("or", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4032- public LogicalOperandPredicate[]? Or { get; set; }
4031+ [JsonProperty("or", Required = Required.Always)]
4032+ public LogicalOperandPredicate[] Or { get; set; }
40334033
40344034 /// <summary>
40354035 /// The value that the field should be equal to.
40364036 /// </summary>
4037- [JsonProperty("equal", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4038- public Equal? Equal { get; set; }
4037+ [JsonProperty("equal", Required = Required.Always)]
4038+ public Equal Equal { get; set; }
40394039
40404040 /// <summary>
40414041 /// Field to be filtered.
40424042 ///
40434043 /// Field to be filtered
40444044 /// </summary>
4045- [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4046- public string? Field { get; set; }
4045+ [JsonProperty("field", Required = Required.Always)]
4046+ public string Field { get; set; }
40474047
40484048 /// <summary>
40494049 /// Time unit for the field to be filtered.
@@ -4057,21 +4057,21 @@ namespace QuickType
40574057 /// An array of inclusive minimum and maximum values
40584058 /// for a field value of a data item to be included in the filtered data.
40594059 /// </summary>
4060- [JsonProperty("range", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4061- public RangeElement[]? Range { get; set; }
4060+ [JsonProperty("range", Required = Required.Always)]
4061+ public RangeElement[] Range { get; set; }
40624062
40634063 /// <summary>
40644064 /// A set of values that the `field`'s value should be a member of,
40654065 /// for a data item included in the filtered data.
40664066 /// </summary>
4067- [JsonProperty("oneOf", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4068- public Equal[]? OneOf { get; set; }
4067+ [JsonProperty("oneOf", Required = Required.Always)]
4068+ public Equal[] OneOf { get; set; }
40694069
40704070 /// <summary>
40714071 /// Filter using a selection name.
40724072 /// </summary>
4073- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4074- public SelectionOperand? Selection { get; set; }
4073+ [JsonProperty("selection", Required = Required.Always)]
4074+ public SelectionOperand Selection { get; set; }
40754075 }
40764076
40774077 /// <summary>
@@ -4158,22 +4158,22 @@ namespace QuickType
41584158
41594159 public partial class ConditionalPredicateMarkPropFieldDefClass
41604160 {
4161- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4162- public LogicalOperandPredicate? Test { get; set; }
4161+ [JsonProperty("test", Required = Required.Always)]
4162+ public LogicalOperandPredicate Test { get; set; }
41634163
41644164 /// <summary>
41654165 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
41664166 /// `0` to `1` for opacity).
41674167 /// </summary>
4168- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4169- public ConditionalValueDefValue? Value { get; set; }
4168+ [JsonProperty("value", Required = Required.Always)]
4169+ public ConditionalValueDefValue Value { get; set; }
41704170
41714171 /// <summary>
41724172 /// A [selection name](selection.html), or a series of [composed
41734173 /// selections](selection.html#compose).
41744174 /// </summary>
4175- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4176- public SelectionOperand? Selection { get; set; }
4175+ [JsonProperty("selection", Required = Required.Always)]
4176+ public SelectionOperand Selection { get; set; }
41774177
41784178 /// <summary>
41794179 /// Aggregation function for the field
@@ -4254,8 +4254,8 @@ namespace QuickType
42544254 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
42554255 /// [geographic projection](projection.html) is applied.
42564256 /// </summary>
4257- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4258- public ConditionalPredicateValueDefType? Type { get; set; }
4257+ [JsonProperty("type", Required = Required.Always)]
4258+ public ConditionalPredicateValueDefType Type { get; set; }
42594259 }
42604260
42614261 /// <summary>
@@ -4960,8 +4960,8 @@ namespace QuickType
49604960 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
49614961 /// [geographic projection](projection.html) is applied.
49624962 /// </summary>
4963- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4964- public ConditionalPredicateValueDefType? Type { get; set; }
4963+ [JsonProperty("type", Required = Required.Always)]
4964+ public ConditionalPredicateValueDefType Type { get; set; }
49654965
49664966 /// <summary>
49674967 /// A constant value in visual domain.
@@ -4972,22 +4972,22 @@ namespace QuickType
49724972
49734973 public partial class ConditionalPredicateFieldDefClass
49744974 {
4975- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4976- public LogicalOperandPredicate? Test { get; set; }
4975+ [JsonProperty("test", Required = Required.Always)]
4976+ public LogicalOperandPredicate Test { get; set; }
49774977
49784978 /// <summary>
49794979 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
49804980 /// `0` to `1` for opacity).
49814981 /// </summary>
4982- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4983- public ConditionalValueDefValue? Value { get; set; }
4982+ [JsonProperty("value", Required = Required.Always)]
4983+ public ConditionalValueDefValue Value { get; set; }
49844984
49854985 /// <summary>
49864986 /// A [selection name](selection.html), or a series of [composed
49874987 /// selections](selection.html#compose).
49884988 /// </summary>
4989- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
4990- public SelectionOperand? Selection { get; set; }
4989+ [JsonProperty("selection", Required = Required.Always)]
4990+ public SelectionOperand Selection { get; set; }
49914991
49924992 /// <summary>
49934993 /// Aggregation function for the field
@@ -5038,8 +5038,8 @@ namespace QuickType
50385038 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
50395039 /// [geographic projection](projection.html) is applied.
50405040 /// </summary>
5041- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5042- public ConditionalPredicateValueDefType? Type { get; set; }
5041+ [JsonProperty("type", Required = Required.Always)]
5042+ public ConditionalPredicateValueDefType Type { get; set; }
50435043 }
50445044
50455045 public partial class OrderFieldDef
@@ -5191,8 +5191,8 @@ namespace QuickType
51915191 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
51925192 /// [geographic projection](projection.html) is applied.
51935193 /// </summary>
5194- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5195- public ConditionalPredicateValueDefType? Type { get; set; }
5194+ [JsonProperty("type", Required = Required.Always)]
5195+ public ConditionalPredicateValueDefType Type { get; set; }
51965196
51975197 /// <summary>
51985198 /// A constant value in visual domain.
@@ -5203,22 +5203,22 @@ namespace QuickType
52035203
52045204 public partial class ConditionalPredicateTextFieldDefClass
52055205 {
5206- [JsonProperty("test", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5207- public LogicalOperandPredicate? Test { get; set; }
5206+ [JsonProperty("test", Required = Required.Always)]
5207+ public LogicalOperandPredicate Test { get; set; }
52085208
52095209 /// <summary>
52105210 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
52115211 /// `0` to `1` for opacity).
52125212 /// </summary>
5213- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5214- public ConditionalValueDefValue? Value { get; set; }
5213+ [JsonProperty("value", Required = Required.Always)]
5214+ public ConditionalValueDefValue Value { get; set; }
52155215
52165216 /// <summary>
52175217 /// A [selection name](selection.html), or a series of [composed
52185218 /// selections](selection.html#compose).
52195219 /// </summary>
5220- [JsonProperty("selection", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5221- public SelectionOperand? Selection { get; set; }
5220+ [JsonProperty("selection", Required = Required.Always)]
5221+ public SelectionOperand Selection { get; set; }
52225222
52235223 /// <summary>
52245224 /// Aggregation function for the field
@@ -5276,8 +5276,8 @@ namespace QuickType
52765276 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
52775277 /// [geographic projection](projection.html) is applied.
52785278 /// </summary>
5279- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5280- public ConditionalPredicateValueDefType? Type { get; set; }
5279+ [JsonProperty("type", Required = Required.Always)]
5280+ public ConditionalPredicateValueDefType Type { get; set; }
52815281 }
52825282
52835283 /// <summary>
@@ -5393,15 +5393,15 @@ namespace QuickType
53935393 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
53945394 /// [geographic projection](projection.html) is applied.
53955395 /// </summary>
5396- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5397- public ConditionalPredicateValueDefType? Type { get; set; }
5396+ [JsonProperty("type", Required = Required.Always)]
5397+ public ConditionalPredicateValueDefType Type { get; set; }
53985398
53995399 /// <summary>
54005400 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
54015401 /// `0` to `1` for opacity).
54025402 /// </summary>
5403- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5404- public ConditionalValueDefValue? Value { get; set; }
5403+ [JsonProperty("value", Required = Required.Always)]
5404+ public ConditionalValueDefValue Value { get; set; }
54055405 }
54065406
54075407 public partial class Axis
@@ -5678,15 +5678,15 @@ namespace QuickType
56785678 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
56795679 /// [geographic projection](projection.html) is applied.
56805680 /// </summary>
5681- [JsonProperty("type", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5682- public ConditionalPredicateValueDefType? Type { get; set; }
5681+ [JsonProperty("type", Required = Required.Always)]
5682+ public ConditionalPredicateValueDefType Type { get; set; }
56835683
56845684 /// <summary>
56855685 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
56865686 /// `0` to `1` for opacity).
56875687 /// </summary>
5688- [JsonProperty("value", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5689- public ConditionalValueDefValue? Value { get; set; }
5688+ [JsonProperty("value", Required = Required.Always)]
5689+ public ConditionalValueDefValue Value { get; set; }
56905690 }
56915691
56925692 /// <summary>
@@ -5753,8 +5753,8 @@ namespace QuickType
57535753 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
57545754 /// layering facet specifications is not allowed.
57555755 /// </summary>
5756- [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5757- public LayerSpec[]? Layer { get; set; }
5756+ [JsonProperty("layer", Required = Required.Always)]
5757+ public LayerSpec[] Layer { get; set; }
57585758
57595759 /// <summary>
57605760 /// Name of the visualization for later reference.
@@ -5816,8 +5816,8 @@ namespace QuickType
58165816 /// <summary>
58175817 /// A key-value mapping between encoding channels and definition of fields.
58185818 /// </summary>
5819- [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5820- public Encoding? Encoding { get; set; }
5819+ [JsonProperty("encoding", Required = Required.Always)]
5820+ public Encoding Encoding { get; set; }
58215821
58225822 /// <summary>
58235823 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -5825,8 +5825,8 @@ namespace QuickType
58255825 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
58265826 /// object](mark.html#mark-def).
58275827 /// </summary>
5828- [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5829- public AnyMark? Mark { get; set; }
5828+ [JsonProperty("mark", Required = Required.Always)]
5829+ public AnyMark Mark { get; set; }
58305830
58315831 /// <summary>
58325832 /// An object defining properties of geographic projection.
@@ -5847,33 +5847,33 @@ namespace QuickType
58475847 /// An object that describes mappings between `row` and `column` channels and their field
58485848 /// definitions.
58495849 /// </summary>
5850- [JsonProperty("facet", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5851- public FacetMapping? Facet { get; set; }
5850+ [JsonProperty("facet", Required = Required.Always)]
5851+ public FacetMapping Facet { get; set; }
58525852
58535853 /// <summary>
58545854 /// A specification of the view that gets faceted.
58555855 /// </summary>
5856- [JsonProperty("spec", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5857- public Spec? SpecSpec { get; set; }
5856+ [JsonProperty("spec", Required = Required.Always)]
5857+ public Spec SpecSpec { get; set; }
58585858
58595859 /// <summary>
58605860 /// An object that describes what fields should be repeated into views that are laid out as a
58615861 /// `row` or `column`.
58625862 /// </summary>
5863- [JsonProperty("repeat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5864- public Repeat? Repeat { get; set; }
5863+ [JsonProperty("repeat", Required = Required.Always)]
5864+ public Repeat Repeat { get; set; }
58655865
58665866 /// <summary>
58675867 /// A list of views that should be concatenated and put into a column.
58685868 /// </summary>
5869- [JsonProperty("vconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5870- public Spec[]? Vconcat { get; set; }
5869+ [JsonProperty("vconcat", Required = Required.Always)]
5870+ public Spec[] Vconcat { get; set; }
58715871
58725872 /// <summary>
58735873 /// A list of views that should be concatenated and put into a row.
58745874 /// </summary>
5875- [JsonProperty("hconcat", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
5876- public Spec[]? Hconcat { get; set; }
5875+ [JsonProperty("hconcat", Required = Required.Always)]
5876+ public Spec[] Hconcat { get; set; }
58775877 }
58785878
58795879 /// <summary>
@@ -6031,8 +6031,8 @@ namespace QuickType
60316031 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
60326032 /// layering facet specifications is not allowed.
60336033 /// </summary>
6034- [JsonProperty("layer", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6035- public LayerSpec[]? Layer { get; set; }
6034+ [JsonProperty("layer", Required = Required.Always)]
6035+ public LayerSpec[] Layer { get; set; }
60366036
60376037 /// <summary>
60386038 /// Name of the visualization for later reference.
@@ -6086,8 +6086,8 @@ namespace QuickType
60866086 /// <summary>
60876087 /// A key-value mapping between encoding channels and definition of fields.
60886088 /// </summary>
6089- [JsonProperty("encoding", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6090- public Encoding? Encoding { get; set; }
6089+ [JsonProperty("encoding", Required = Required.Always)]
6090+ public Encoding Encoding { get; set; }
60916091
60926092 /// <summary>
60936093 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6095,8 +6095,8 @@ namespace QuickType
60956095 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
60966096 /// object](mark.html#mark-def).
60976097 /// </summary>
6098- [JsonProperty("mark", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6099- public AnyMark? Mark { get; set; }
6098+ [JsonProperty("mark", Required = Required.Always)]
6099+ public AnyMark Mark { get; set; }
61006100
61016101 /// <summary>
61026102 /// An object defining properties of geographic projection.
@@ -6737,8 +6737,8 @@ namespace QuickType
67376737 /// (3) a [selection predicate](filter.html#selection-predicate);
67386738 /// or (4) a logical operand that combines (1), (2), or (3).
67396739 /// </summary>
6740- [JsonProperty("filter", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6741- public LogicalOperandPredicate? Filter { get; set; }
6740+ [JsonProperty("filter", Required = Required.Always)]
6741+ public LogicalOperandPredicate Filter { get; set; }
67426742
67436743 /// <summary>
67446744 /// The field for storing the computed formula value.
@@ -6759,8 +6759,8 @@ namespace QuickType
67596759 /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the
67606760 /// current data object.
67616761 /// </summary>
6762- [JsonProperty("calculate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6763- public string? Calculate { get; set; }
6762+ [JsonProperty("calculate", Required = Required.Always)]
6763+ public string Calculate { get; set; }
67646764
67656765 /// <summary>
67666766 /// The default value to use if lookup fails.
@@ -6773,40 +6773,40 @@ namespace QuickType
67736773 /// <summary>
67746774 /// Secondary data reference.
67756775 /// </summary>
6776- [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6777- public LookupData? From { get; set; }
6776+ [JsonProperty("from", Required = Required.Always)]
6777+ public LookupData From { get; set; }
67786778
67796779 /// <summary>
67806780 /// Key in primary data source.
67816781 /// </summary>
6782- [JsonProperty("lookup", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6783- public string? Lookup { get; set; }
6782+ [JsonProperty("lookup", Required = Required.Always)]
6783+ public string Lookup { get; set; }
67846784
67856785 /// <summary>
67866786 /// An object indicating bin properties, or simply `true` for using default bin parameters.
67876787 /// </summary>
6788- [JsonProperty("bin", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6789- public Bin? Bin { get; set; }
6788+ [JsonProperty("bin", Required = Required.Always)]
6789+ public Bin Bin { get; set; }
67906790
67916791 /// <summary>
67926792 /// The data field to bin.
67936793 ///
67946794 /// The data field to apply time unit.
67956795 /// </summary>
6796- [JsonProperty("field", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6797- public string? Field { get; set; }
6796+ [JsonProperty("field", Required = Required.Always)]
6797+ public string Field { get; set; }
67986798
67996799 /// <summary>
68006800 /// The timeUnit.
68016801 /// </summary>
6802- [JsonProperty("timeUnit", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6803- public TimeUnit? TimeUnit { get; set; }
6802+ [JsonProperty("timeUnit", Required = Required.Always)]
6803+ public TimeUnit TimeUnit { get; set; }
68046804
68056805 /// <summary>
68066806 /// Array of objects that define fields to aggregate.
68076807 /// </summary>
6808- [JsonProperty("aggregate", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
6809- public AggregatedFieldDef[]? Aggregate { get; set; }
6808+ [JsonProperty("aggregate", Required = Required.Always)]
6809+ public AggregatedFieldDef[] Aggregate { get; set; }
68106810
68116811 /// <summary>
68126812 /// The data fields to group by. If not specified, a single group containing all data objects
Mschema-dartdefault / TopLevel.dart+164 −164
@@ -41,7 +41,7 @@ class TopLevel {
4141 final String? description;
4242
4343 ///A key-value mapping between encoding channels and definition of fields.
44- final EncodingWithFacet? encoding;
44+ final EncodingWithFacet encoding;
4545
4646 ///The height of a visualization.
4747 ///
@@ -120,7 +120,7 @@ class TopLevel {
120120 ///
121121 ///__Note__: Specifications inside `layer` cannot use `row` and `column` channels as
122122 ///layering facet specifications is not allowed.
123- final List<LayerSpec>? layer;
123+ final List<LayerSpec> layer;
124124
125125 ///Scale, axis, and legend resolutions for layers.
126126 ///
@@ -135,20 +135,20 @@ class TopLevel {
135135
136136 ///An object that describes mappings between `row` and `column` channels and their field
137137 ///definitions.
138- final FacetMapping? facet;
138+ final FacetMapping facet;
139139
140140 ///A specification of the view that gets faceted.
141- final Spec? spec;
141+ final Spec spec;
142142
143143 ///An object that describes what fields should be repeated into views that are laid out as a
144144 ///`row` or `column`.
145- final Repeat? repeat;
145+ final Repeat repeat;
146146
147147 ///A list of views that should be concatenated and put into a column.
148- final List<Spec>? vconcat;
148+ final List<Spec> vconcat;
149149
150150 ///A list of views that should be concatenated and put into a row.
151- final List<Spec>? hconcat;
151+ final List<Spec> hconcat;
152152
153153 TopLevel({
154154 this.schema,
@@ -157,9 +157,9 @@ class TopLevel {
157157 this.config,
158158 this.data,
159159 this.description,
160- this.encoding,
160+ required this.encoding,
161161 this.height,
162- this.mark,
162+ required this.mark,
163163 this.name,
164164 this.padding,
165165 this.projection,
@@ -167,13 +167,13 @@ class TopLevel {
167167 this.title,
168168 this.transform,
169169 this.width,
170- this.layer,
170+ required this.layer,
171171 this.resolve,
172- this.facet,
173- this.spec,
174- this.repeat,
175- this.vconcat,
176- this.hconcat,
172+ required this.facet,
173+ required this.spec,
174+ required this.repeat,
175+ required this.vconcat,
176+ required this.hconcat,
177177 });
178178
179179 factory TopLevel.fromJson(Map<String, dynamic> json) => TopLevel(
@@ -183,7 +183,7 @@ class TopLevel {
183183 config: json["config"] == null ? null : Config.fromJson(json["config"]),
184184 data: json["data"] == null ? null : Data.fromJson(json["data"]),
185185 description: json["description"],
186- encoding: json["encoding"] == null ? null : EncodingWithFacet.fromJson(json["encoding"]),
186+ encoding: EncodingWithFacet.fromJson(json["encoding"]),
187187 height: json["height"]?.toDouble(),
188188 mark: json["mark"],
189189 name: json["name"],
@@ -193,13 +193,13 @@ class TopLevel {
193193 title: json["title"],
194194 transform: json["transform"] == null ? null : List<Transform>.from(json["transform"]!.map((x) => Transform.fromJson(x))),
195195 width: json["width"]?.toDouble(),
196- layer: json["layer"] == null ? null : List<LayerSpec>.from(json["layer"]!.map((x) => LayerSpec.fromJson(x))),
196+ layer: List<LayerSpec>.from(json["layer"].map((x) => LayerSpec.fromJson(x))),
197197 resolve: json["resolve"] == null ? null : Resolve.fromJson(json["resolve"]),
198- facet: json["facet"] == null ? null : FacetMapping.fromJson(json["facet"]),
199- spec: json["spec"] == null ? null : Spec.fromJson(json["spec"]),
200- repeat: json["repeat"] == null ? null : Repeat.fromJson(json["repeat"]),
201- vconcat: json["vconcat"] == null ? null : List<Spec>.from(json["vconcat"]!.map((x) => Spec.fromJson(x))),
202- hconcat: json["hconcat"] == null ? null : List<Spec>.from(json["hconcat"]!.map((x) => Spec.fromJson(x))),
198+ facet: FacetMapping.fromJson(json["facet"]),
199+ spec: Spec.fromJson(json["spec"]),
200+ repeat: Repeat.fromJson(json["repeat"]),
201+ vconcat: List<Spec>.from(json["vconcat"].map((x) => Spec.fromJson(x))),
202+ hconcat: List<Spec>.from(json["hconcat"].map((x) => Spec.fromJson(x))),
203203 );
204204
205205 Map<String, dynamic> toJson() => {
@@ -209,7 +209,7 @@ class TopLevel {
209209 "config": config?.toJson(),
210210 "data": data?.toJson(),
211211 "description": description,
212- "encoding": encoding?.toJson(),
212+ "encoding": encoding.toJson(),
213213 "height": height,
214214 "mark": mark,
215215 "name": name,
@@ -219,13 +219,13 @@ class TopLevel {
219219 "title": title,
220220 "transform": transform == null ? null : List<dynamic>.from(transform!.map((x) => x.toJson())),
221221 "width": width,
222- "layer": layer == null ? null : List<dynamic>.from(layer!.map((x) => x.toJson())),
222+ "layer": List<dynamic>.from(layer.map((x) => x.toJson())),
223223 "resolve": resolve?.toJson(),
224- "facet": facet?.toJson(),
225- "spec": spec?.toJson(),
226- "repeat": repeat?.toJson(),
227- "vconcat": vconcat == null ? null : List<dynamic>.from(vconcat!.map((x) => x.toJson())),
228- "hconcat": hconcat == null ? null : List<dynamic>.from(hconcat!.map((x) => x.toJson())),
224+ "facet": facet.toJson(),
225+ "spec": spec.toJson(),
226+ "repeat": repeat.toJson(),
227+ "vconcat": List<dynamic>.from(vconcat.map((x) => x.toJson())),
228+ "hconcat": List<dynamic>.from(hconcat.map((x) => x.toJson())),
229229 };
230230 }
231231
@@ -2446,13 +2446,13 @@ final vgProjectionTypeValues = EnumValues({
24462446 class VgScheme {
24472447 final double? count;
24482448 final List<double>? extent;
2449- final String? scheme;
2449+ final String scheme;
24502450 final double? step;
24512451
24522452 VgScheme({
24532453 this.count,
24542454 this.extent,
2455- this.scheme,
2455+ required this.scheme,
24562456 this.step,
24572457 });
24582458
@@ -3090,7 +3090,7 @@ class SingleSelectionConfig {
30903090 class VgBinding {
30913091 final String? element;
30923092 final String input;
3093- final List<String>? options;
3093+ final List<String> options;
30943094 final double? max;
30953095 final double? min;
30963096 final double? step;
@@ -3098,7 +3098,7 @@ class VgBinding {
30983098 VgBinding({
30993099 this.element,
31003100 required this.input,
3101- this.options,
3101+ required this.options,
31023102 this.max,
31033103 this.min,
31043104 this.step,
@@ -3107,7 +3107,7 @@ class VgBinding {
31073107 factory VgBinding.fromJson(Map<String, dynamic> json) => VgBinding(
31083108 element: json["element"],
31093109 input: json["input"],
3110- options: json["options"] == null ? null : List<String>.from(json["options"]!.map((x) => x)),
3110+ options: List<String>.from(json["options"].map((x) => x)),
31113111 max: json["max"]?.toDouble(),
31123112 min: json["min"]?.toDouble(),
31133113 step: json["step"]?.toDouble(),
@@ -3116,7 +3116,7 @@ class VgBinding {
31163116 Map<String, dynamic> toJson() => {
31173117 "element": element,
31183118 "input": input,
3119- "options": options == null ? null : List<dynamic>.from(options!.map((x) => x)),
3119+ "options": List<dynamic>.from(options.map((x) => x)),
31203120 "max": max,
31213121 "min": min,
31223122 "step": step,
@@ -4153,7 +4153,7 @@ class Data {
41534153
41544154 ///An URL from which to load the data set. Use the `format.type` property
41554155 ///to ensure the loaded data is correctly parsed.
4156- final String? url;
4156+ final String url;
41574157
41584158 ///The full data set, included inline. This can be an array of objects or primitive values
41594159 ///or a string.
@@ -4162,13 +4162,13 @@ class Data {
41624162 final dynamic values;
41634163
41644164 ///Provide a placeholder name and bind data at runtime.
4165- final String? name;
4165+ final String name;
41664166
41674167 Data({
41684168 this.format,
4169- this.url,
4170- this.values,
4171- this.name,
4169+ required this.url,
4170+ required this.values,
4171+ required this.name,
41724172 });
41734173
41744174 factory Data.fromJson(Map<String, dynamic> json) => Data(
@@ -4528,7 +4528,7 @@ class MarkPropDefWithCondition {
45284528 ///`"nominal"`).
45294529 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
45304530 ///[geographic projection](projection.html) is applied.
4531- final Type? type;
4531+ final Type type;
45324532
45334533 ///A constant value in visual domain.
45344534 final dynamic value;
@@ -4542,7 +4542,7 @@ class MarkPropDefWithCondition {
45424542 this.scale,
45434543 this.sort,
45444544 this.timeUnit,
4545- this.type,
4545+ required this.type,
45464546 this.value,
45474547 });
45484548
@@ -4555,7 +4555,7 @@ class MarkPropDefWithCondition {
45554555 scale: json["scale"] == null ? null : Scale.fromJson(json["scale"]),
45564556 sort: json["sort"],
45574557 timeUnit: timeUnitValues.map[json["timeUnit"]],
4558- type: typeValues.map[json["type"]],
4558+ type: typeValues.map[json["type"]]!,
45594559 value: json["value"],
45604560 );
45614561
@@ -4727,9 +4727,9 @@ class ConditionalValueDef {
47274727 final dynamic selection;
47284728
47294729 ConditionalValueDef({
4730- this.test,
4730+ required this.test,
47314731 required this.value,
4732- this.selection,
4732+ required this.selection,
47334733 });
47344734
47354735 factory ConditionalValueDef.fromJson(Map<String, dynamic> json) => ConditionalValueDef(
@@ -4747,32 +4747,32 @@ class ConditionalValueDef {
47474747
47484748 class Selection {
47494749 final dynamic not;
4750- final List<dynamic>? and;
4751- final List<dynamic>? or;
4750+ final List<dynamic> and;
4751+ final List<dynamic> or;
47524752
47534753 Selection({
4754- this.not,
4755- this.and,
4756- this.or,
4754+ required this.not,
4755+ required this.and,
4756+ required this.or,
47574757 });
47584758
47594759 factory Selection.fromJson(Map<String, dynamic> json) => Selection(
47604760 not: json["not"],
4761- and: json["and"] == null ? null : List<dynamic>.from(json["and"]!.map((x) => x)),
4762- or: json["or"] == null ? null : List<dynamic>.from(json["or"]!.map((x) => x)),
4761+ and: List<dynamic>.from(json["and"].map((x) => x)),
4762+ or: List<dynamic>.from(json["or"].map((x) => x)),
47634763 );
47644764
47654765 Map<String, dynamic> toJson() => {
47664766 "not": not,
4767- "and": and == null ? null : List<dynamic>.from(and!.map((x) => x)),
4768- "or": or == null ? null : List<dynamic>.from(or!.map((x) => x)),
4767+ "and": List<dynamic>.from(and.map((x) => x)),
4768+ "or": List<dynamic>.from(or.map((x) => x)),
47694769 };
47704770 }
47714771
47724772 class Predicate {
47734773 final dynamic not;
4774- final List<dynamic>? and;
4775- final List<dynamic>? or;
4774+ final List<dynamic> and;
4775+ final List<dynamic> or;
47764776
47774777 ///The value that the field should be equal to.
47784778 final dynamic equal;
@@ -4780,7 +4780,7 @@ class Predicate {
47804780 ///Field to be filtered.
47814781 ///
47824782 ///Field to be filtered
4783- final String? field;
4783+ final String field;
47844784
47854785 ///Time unit for the field to be filtered.
47864786 ///
@@ -4789,48 +4789,48 @@ class Predicate {
47894789
47904790 ///An array of inclusive minimum and maximum values
47914791 ///for a field value of a data item to be included in the filtered data.
4792- final List<dynamic>? range;
4792+ final List<dynamic> range;
47934793
47944794 ///A set of values that the `field`'s value should be a member of,
47954795 ///for a data item included in the filtered data.
4796- final List<dynamic>? oneOf;
4796+ final List<dynamic> oneOf;
47974797
47984798 ///Filter using a selection name.
47994799 final dynamic selection;
48004800
48014801 Predicate({
4802- this.not,
4803- this.and,
4804- this.or,
4805- this.equal,
4806- this.field,
4802+ required this.not,
4803+ required this.and,
4804+ required this.or,
4805+ required this.equal,
4806+ required this.field,
48074807 this.timeUnit,
4808- this.range,
4809- this.oneOf,
4810- this.selection,
4808+ required this.range,
4809+ required this.oneOf,
4810+ required this.selection,
48114811 });
48124812
48134813 factory Predicate.fromJson(Map<String, dynamic> json) => Predicate(
48144814 not: json["not"],
4815- and: json["and"] == null ? null : List<dynamic>.from(json["and"]!.map((x) => x)),
4816- or: json["or"] == null ? null : List<dynamic>.from(json["or"]!.map((x) => x)),
4815+ and: List<dynamic>.from(json["and"].map((x) => x)),
4816+ or: List<dynamic>.from(json["or"].map((x) => x)),
48174817 equal: json["equal"],
48184818 field: json["field"],
48194819 timeUnit: timeUnitValues.map[json["timeUnit"]],
4820- range: json["range"] == null ? null : List<dynamic>.from(json["range"]!.map((x) => x)),
4821- oneOf: json["oneOf"] == null ? null : List<dynamic>.from(json["oneOf"]!.map((x) => x)),
4820+ range: List<dynamic>.from(json["range"].map((x) => x)),
4821+ oneOf: List<dynamic>.from(json["oneOf"].map((x) => x)),
48224822 selection: json["selection"],
48234823 );
48244824
48254825 Map<String, dynamic> toJson() => {
48264826 "not": not,
4827- "and": and == null ? null : List<dynamic>.from(and!.map((x) => x)),
4828- "or": or == null ? null : List<dynamic>.from(or!.map((x) => x)),
4827+ "and": List<dynamic>.from(and.map((x) => x)),
4828+ "or": List<dynamic>.from(or.map((x) => x)),
48294829 "equal": equal,
48304830 "field": field,
48314831 "timeUnit": timeUnitValues.reverse[timeUnit],
4832- "range": range == null ? null : List<dynamic>.from(range!.map((x) => x)),
4833- "oneOf": oneOf == null ? null : List<dynamic>.from(oneOf!.map((x) => x)),
4832+ "range": List<dynamic>.from(range.map((x) => x)),
4833+ "oneOf": List<dynamic>.from(oneOf.map((x) => x)),
48344834 "selection": selection,
48354835 };
48364836 }
@@ -5091,12 +5091,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
50915091 ///`"nominal"`).
50925092 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
50935093 ///[geographic projection](projection.html) is applied.
5094- final Type? type;
5094+ final Type type;
50955095
50965096 ConditionalPredicateMarkPropFieldDefClass({
5097- this.test,
5098- this.value,
5099- this.selection,
5097+ required this.test,
5098+ required this.value,
5099+ required this.selection,
51005100 this.aggregate,
51015101 this.bin,
51025102 this.field,
@@ -5104,7 +5104,7 @@ class ConditionalPredicateMarkPropFieldDefClass {
51045104 this.scale,
51055105 this.sort,
51065106 this.timeUnit,
5107- this.type,
5107+ required this.type,
51085108 });
51095109
51105110 factory ConditionalPredicateMarkPropFieldDefClass.fromJson(Map<String, dynamic> json) => ConditionalPredicateMarkPropFieldDefClass(
@@ -5118,7 +5118,7 @@ class ConditionalPredicateMarkPropFieldDefClass {
51185118 scale: json["scale"] == null ? null : Scale.fromJson(json["scale"]),
51195119 sort: json["sort"],
51205120 timeUnit: timeUnitValues.map[json["timeUnit"]],
5121- type: typeValues.map[json["type"]],
5121+ type: typeValues.map[json["type"]]!,
51225122 );
51235123
51245124 Map<String, dynamic> toJson() => {
@@ -6063,7 +6063,7 @@ class DefWithCondition {
60636063 ///`"nominal"`).
60646064 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
60656065 ///[geographic projection](projection.html) is applied.
6066- final Type? type;
6066+ final Type type;
60676067
60686068 ///A constant value in visual domain.
60696069 final dynamic value;
@@ -6074,7 +6074,7 @@ class DefWithCondition {
60746074 this.condition,
60756075 this.field,
60766076 this.timeUnit,
6077- this.type,
6077+ required this.type,
60786078 this.value,
60796079 });
60806080
@@ -6084,7 +6084,7 @@ class DefWithCondition {
60846084 condition: json["condition"],
60856085 field: json["field"],
60866086 timeUnit: timeUnitValues.map[json["timeUnit"]],
6087- type: typeValues.map[json["type"]],
6087+ type: typeValues.map[json["type"]]!,
60886088 value: json["value"],
60896089 );
60906090
@@ -6145,17 +6145,17 @@ class ConditionalPredicateFieldDefClass {
61456145 ///`"nominal"`).
61466146 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
61476147 ///[geographic projection](projection.html) is applied.
6148- final Type? type;
6148+ final Type type;
61496149
61506150 ConditionalPredicateFieldDefClass({
6151- this.test,
6152- this.value,
6153- this.selection,
6151+ required this.test,
6152+ required this.value,
6153+ required this.selection,
61546154 this.aggregate,
61556155 this.bin,
61566156 this.field,
61576157 this.timeUnit,
6158- this.type,
6158+ required this.type,
61596159 });
61606160
61616161 factory ConditionalPredicateFieldDefClass.fromJson(Map<String, dynamic> json) => ConditionalPredicateFieldDefClass(
@@ -6166,7 +6166,7 @@ class ConditionalPredicateFieldDefClass {
61666166 bin: json["bin"],
61676167 field: json["field"],
61686168 timeUnit: timeUnitValues.map[json["timeUnit"]],
6169- type: typeValues.map[json["type"]],
6169+ type: typeValues.map[json["type"]]!,
61706170 );
61716171
61726172 Map<String, dynamic> toJson() => {
@@ -6318,7 +6318,7 @@ class TextDefWithCondition {
63186318 ///`"nominal"`).
63196319 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
63206320 ///[geographic projection](projection.html) is applied.
6321- final Type? type;
6321+ final Type type;
63226322
63236323 ///A constant value in visual domain.
63246324 final dynamic value;
@@ -6330,7 +6330,7 @@ class TextDefWithCondition {
63306330 this.field,
63316331 this.format,
63326332 this.timeUnit,
6333- this.type,
6333+ required this.type,
63346334 this.value,
63356335 });
63366336
@@ -6341,7 +6341,7 @@ class TextDefWithCondition {
63416341 field: json["field"],
63426342 format: json["format"],
63436343 timeUnit: timeUnitValues.map[json["timeUnit"]],
6344- type: typeValues.map[json["type"]],
6344+ type: typeValues.map[json["type"]]!,
63456345 value: json["value"],
63466346 );
63476347
@@ -6407,18 +6407,18 @@ class ConditionalPredicateTextFieldDefClass {
64076407 ///`"nominal"`).
64086408 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
64096409 ///[geographic projection](projection.html) is applied.
6410- final Type? type;
6410+ final Type type;
64116411
64126412 ConditionalPredicateTextFieldDefClass({
6413- this.test,
6414- this.value,
6415- this.selection,
6413+ required this.test,
6414+ required this.value,
6415+ required this.selection,
64166416 this.aggregate,
64176417 this.bin,
64186418 this.field,
64196419 this.format,
64206420 this.timeUnit,
6421- this.type,
6421+ required this.type,
64226422 });
64236423
64246424 factory ConditionalPredicateTextFieldDefClass.fromJson(Map<String, dynamic> json) => ConditionalPredicateTextFieldDefClass(
@@ -6430,7 +6430,7 @@ class ConditionalPredicateTextFieldDefClass {
64306430 field: json["field"],
64316431 format: json["format"],
64326432 timeUnit: timeUnitValues.map[json["timeUnit"]],
6433- type: typeValues.map[json["type"]],
6433+ type: typeValues.map[json["type"]]!,
64346434 );
64356435
64366436 Map<String, dynamic> toJson() => {
@@ -6532,7 +6532,7 @@ class XClass {
65326532 ///`"nominal"`).
65336533 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
65346534 ///[geographic projection](projection.html) is applied.
6535- final Type? type;
6535+ final Type type;
65366536
65376537 ///A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
65386538 ///`0` to `1` for opacity).
@@ -6547,8 +6547,8 @@ class XClass {
65476547 this.sort,
65486548 this.stack,
65496549 this.timeUnit,
6550- this.type,
6551- this.value,
6550+ required this.type,
6551+ required this.value,
65526552 });
65536553
65546554 factory XClass.fromJson(Map<String, dynamic> json) => XClass(
@@ -6560,7 +6560,7 @@ class XClass {
65606560 sort: json["sort"],
65616561 stack: stackOffsetValues.map[json["stack"]],
65626562 timeUnit: timeUnitValues.map[json["timeUnit"]],
6563- type: typeValues.map[json["type"]],
6563+ type: typeValues.map[json["type"]]!,
65646564 value: json["value"],
65656565 );
65666566
@@ -6843,7 +6843,7 @@ class X2Class {
68436843 ///`"nominal"`).
68446844 ///It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
68456845 ///[geographic projection](projection.html) is applied.
6846- final Type? type;
6846+ final Type type;
68476847
68486848 ///A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
68496849 ///`0` to `1` for opacity).
@@ -6854,8 +6854,8 @@ class X2Class {
68546854 this.bin,
68556855 this.field,
68566856 this.timeUnit,
6857- this.type,
6858- this.value,
6857+ required this.type,
6858+ required this.value,
68596859 });
68606860
68616861 factory X2Class.fromJson(Map<String, dynamic> json) => X2Class(
@@ -6863,7 +6863,7 @@ class X2Class {
68636863 bin: json["bin"],
68646864 field: json["field"],
68656865 timeUnit: timeUnitValues.map[json["timeUnit"]],
6866- type: typeValues.map[json["type"]],
6866+ type: typeValues.map[json["type"]]!,
68676867 value: json["value"],
68686868 );
68696869
@@ -6937,7 +6937,7 @@ class Spec {
69376937 ///
69386938 ///__Note__: Specifications inside `layer` cannot use `row` and `column` channels as
69396939 ///layering facet specifications is not allowed.
6940- final List<LayerSpec>? layer;
6940+ final List<LayerSpec> layer;
69416941
69426942 ///Name of the visualization for later reference.
69436943 final String? name;
@@ -6982,7 +6982,7 @@ class Spec {
69826982 final double? width;
69836983
69846984 ///A key-value mapping between encoding channels and definition of fields.
6985- final Encoding? encoding;
6985+ final Encoding encoding;
69866986
69876987 ///A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
69886988 ///`"line"`,
@@ -7001,82 +7001,82 @@ class Spec {
70017001
70027002 ///An object that describes mappings between `row` and `column` channels and their field
70037003 ///definitions.
7004- final FacetMapping? facet;
7004+ final FacetMapping facet;
70057005
70067006 ///A specification of the view that gets faceted.
7007- final Spec? spec;
7007+ final Spec spec;
70087008
70097009 ///An object that describes what fields should be repeated into views that are laid out as a
70107010 ///`row` or `column`.
7011- final Repeat? repeat;
7011+ final Repeat repeat;
70127012
70137013 ///A list of views that should be concatenated and put into a column.
7014- final List<Spec>? vconcat;
7014+ final List<Spec> vconcat;
70157015
70167016 ///A list of views that should be concatenated and put into a row.
7017- final List<Spec>? hconcat;
7017+ final List<Spec> hconcat;
70187018
70197019 Spec({
70207020 this.data,
70217021 this.description,
70227022 this.height,
7023- this.layer,
7023+ required this.layer,
70247024 this.name,
70257025 this.resolve,
70267026 this.title,
70277027 this.transform,
70287028 this.width,
7029- this.encoding,
7030- this.mark,
7029+ required this.encoding,
7030+ required this.mark,
70317031 this.projection,
70327032 this.selection,
7033- this.facet,
7034- this.spec,
7035- this.repeat,
7036- this.vconcat,
7037- this.hconcat,
7033+ required this.facet,
7034+ required this.spec,
7035+ required this.repeat,
7036+ required this.vconcat,
7037+ required this.hconcat,
70387038 });
70397039
70407040 factory Spec.fromJson(Map<String, dynamic> json) => Spec(
70417041 data: json["data"] == null ? null : Data.fromJson(json["data"]),
70427042 description: json["description"],
70437043 height: json["height"]?.toDouble(),
7044- layer: json["layer"] == null ? null : List<LayerSpec>.from(json["layer"]!.map((x) => LayerSpec.fromJson(x))),
7044+ layer: List<LayerSpec>.from(json["layer"].map((x) => LayerSpec.fromJson(x))),
70457045 name: json["name"],
70467046 resolve: json["resolve"] == null ? null : Resolve.fromJson(json["resolve"]),
70477047 title: json["title"],
70487048 transform: json["transform"] == null ? null : List<Transform>.from(json["transform"]!.map((x) => Transform.fromJson(x))),
70497049 width: json["width"]?.toDouble(),
7050- encoding: json["encoding"] == null ? null : Encoding.fromJson(json["encoding"]),
7050+ encoding: Encoding.fromJson(json["encoding"]),
70517051 mark: json["mark"],
70527052 projection: json["projection"] == null ? null : Projection.fromJson(json["projection"]),
70537053 selection: Map.from(json["selection"]!).map((k, v) => MapEntry<String, SelectionDef>(k, SelectionDef.fromJson(v))),
7054- facet: json["facet"] == null ? null : FacetMapping.fromJson(json["facet"]),
7055- spec: json["spec"] == null ? null : Spec.fromJson(json["spec"]),
7056- repeat: json["repeat"] == null ? null : Repeat.fromJson(json["repeat"]),
7057- vconcat: json["vconcat"] == null ? null : List<Spec>.from(json["vconcat"]!.map((x) => Spec.fromJson(x))),
7058- hconcat: json["hconcat"] == null ? null : List<Spec>.from(json["hconcat"]!.map((x) => Spec.fromJson(x))),
7054+ facet: FacetMapping.fromJson(json["facet"]),
7055+ spec: Spec.fromJson(json["spec"]),
7056+ repeat: Repeat.fromJson(json["repeat"]),
7057+ vconcat: List<Spec>.from(json["vconcat"].map((x) => Spec.fromJson(x))),
7058+ hconcat: List<Spec>.from(json["hconcat"].map((x) => Spec.fromJson(x))),
70597059 );
70607060
70617061 Map<String, dynamic> toJson() => {
70627062 "data": data?.toJson(),
70637063 "description": description,
70647064 "height": height,
7065- "layer": layer == null ? null : List<dynamic>.from(layer!.map((x) => x.toJson())),
7065+ "layer": List<dynamic>.from(layer.map((x) => x.toJson())),
70667066 "name": name,
70677067 "resolve": resolve?.toJson(),
70687068 "title": title,
70697069 "transform": transform == null ? null : List<dynamic>.from(transform!.map((x) => x.toJson())),
70707070 "width": width,
7071- "encoding": encoding?.toJson(),
7071+ "encoding": encoding.toJson(),
70727072 "mark": mark,
70737073 "projection": projection?.toJson(),
70747074 "selection": Map.from(selection!).map((k, v) => MapEntry<String, dynamic>(k, v.toJson())),
7075- "facet": facet?.toJson(),
7076- "spec": spec?.toJson(),
7077- "repeat": repeat?.toJson(),
7078- "vconcat": vconcat == null ? null : List<dynamic>.from(vconcat!.map((x) => x.toJson())),
7079- "hconcat": hconcat == null ? null : List<dynamic>.from(hconcat!.map((x) => x.toJson())),
7075+ "facet": facet.toJson(),
7076+ "spec": spec.toJson(),
7077+ "repeat": repeat.toJson(),
7078+ "vconcat": List<dynamic>.from(vconcat.map((x) => x.toJson())),
7079+ "hconcat": List<dynamic>.from(hconcat.map((x) => x.toJson())),
70807080 };
70817081 }
70827082
@@ -7231,7 +7231,7 @@ class LayerSpec {
72317231 ///
72327232 ///__Note__: Specifications inside `layer` cannot use `row` and `column` channels as
72337233 ///layering facet specifications is not allowed.
7234- final List<LayerSpec>? layer;
7234+ final List<LayerSpec> layer;
72357235
72367236 ///Name of the visualization for later reference.
72377237 final String? name;
@@ -7268,7 +7268,7 @@ class LayerSpec {
72687268 final double? width;
72697269
72707270 ///A key-value mapping between encoding channels and definition of fields.
7271- final Encoding? encoding;
7271+ final Encoding encoding;
72727272
72737273 ///A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
72747274 ///`"line"`,
@@ -7289,14 +7289,14 @@ class LayerSpec {
72897289 this.data,
72907290 this.description,
72917291 this.height,
7292- this.layer,
7292+ required this.layer,
72937293 this.name,
72947294 this.resolve,
72957295 this.title,
72967296 this.transform,
72977297 this.width,
7298- this.encoding,
7299- this.mark,
7298+ required this.encoding,
7299+ required this.mark,
73007300 this.projection,
73017301 this.selection,
73027302 });
@@ -7305,13 +7305,13 @@ class LayerSpec {
73057305 data: json["data"] == null ? null : Data.fromJson(json["data"]),
73067306 description: json["description"],
73077307 height: json["height"]?.toDouble(),
7308- layer: json["layer"] == null ? null : List<LayerSpec>.from(json["layer"]!.map((x) => LayerSpec.fromJson(x))),
7308+ layer: List<LayerSpec>.from(json["layer"].map((x) => LayerSpec.fromJson(x))),
73097309 name: json["name"],
73107310 resolve: json["resolve"] == null ? null : Resolve.fromJson(json["resolve"]),
73117311 title: json["title"],
73127312 transform: json["transform"] == null ? null : List<Transform>.from(json["transform"]!.map((x) => Transform.fromJson(x))),
73137313 width: json["width"]?.toDouble(),
7314- encoding: json["encoding"] == null ? null : Encoding.fromJson(json["encoding"]),
7314+ encoding: Encoding.fromJson(json["encoding"]),
73157315 mark: json["mark"],
73167316 projection: json["projection"] == null ? null : Projection.fromJson(json["projection"]),
73177317 selection: Map.from(json["selection"]!).map((k, v) => MapEntry<String, SelectionDef>(k, SelectionDef.fromJson(v))),
@@ -7321,13 +7321,13 @@ class LayerSpec {
73217321 "data": data?.toJson(),
73227322 "description": description,
73237323 "height": height,
7324- "layer": layer == null ? null : List<dynamic>.from(layer!.map((x) => x.toJson())),
7324+ "layer": List<dynamic>.from(layer.map((x) => x.toJson())),
73257325 "name": name,
73267326 "resolve": resolve?.toJson(),
73277327 "title": title,
73287328 "transform": transform == null ? null : List<dynamic>.from(transform!.map((x) => x.toJson())),
73297329 "width": width,
7330- "encoding": encoding?.toJson(),
7330+ "encoding": encoding.toJson(),
73317331 "mark": mark,
73327332 "projection": projection?.toJson(),
73337333 "selection": Map.from(selection!).map((k, v) => MapEntry<String, dynamic>(k, v.toJson())),
@@ -8113,7 +8113,7 @@ class Transform {
81138113
81148114 ///A [expression](types.html#expression) string. Use the variable `datum` to refer to the
81158115 ///current data object.
8116- final String? calculate;
8116+ final String calculate;
81178117
81188118 ///The default value to use if lookup fails.
81198119 ///
@@ -8121,10 +8121,10 @@ class Transform {
81218121 final String? transformDefault;
81228122
81238123 ///Secondary data reference.
8124- final LookupData? from;
8124+ final LookupData from;
81258125
81268126 ///Key in primary data source.
8127- final String? lookup;
8127+ final String lookup;
81288128
81298129 ///An object indicating bin properties, or simply `true` for using default bin parameters.
81308130 final dynamic bin;
@@ -8132,29 +8132,29 @@ class Transform {
81328132 ///The data field to bin.
81338133 ///
81348134 ///The data field to apply time unit.
8135- final String? field;
8135+ final String field;
81368136
81378137 ///The timeUnit.
8138- final TimeUnit? timeUnit;
8138+ final TimeUnit timeUnit;
81398139
81408140 ///Array of objects that define fields to aggregate.
8141- final List<AggregatedFieldDef>? aggregate;
8141+ final List<AggregatedFieldDef> aggregate;
81428142
81438143 ///The data fields to group by. If not specified, a single group containing all data objects
81448144 ///will be used.
81458145 final List<String>? groupby;
81468146
81478147 Transform({
8148- this.filter,
8148+ required this.filter,
81498149 this.transformAs,
8150- this.calculate,
8150+ required this.calculate,
81518151 this.transformDefault,
8152- this.from,
8153- this.lookup,
8154- this.bin,
8155- this.field,
8156- this.timeUnit,
8157- this.aggregate,
8152+ required this.from,
8153+ required this.lookup,
8154+ required this.bin,
8155+ required this.field,
8156+ required this.timeUnit,
8157+ required this.aggregate,
81588158 this.groupby,
81598159 });
81608160
@@ -8163,12 +8163,12 @@ class Transform {
81638163 transformAs: json["as"],
81648164 calculate: json["calculate"],
81658165 transformDefault: json["default"],
8166- from: json["from"] == null ? null : LookupData.fromJson(json["from"]),
8166+ from: LookupData.fromJson(json["from"]),
81678167 lookup: json["lookup"],
81688168 bin: json["bin"],
81698169 field: json["field"],
8170- timeUnit: timeUnitValues.map[json["timeUnit"]],
8171- aggregate: json["aggregate"] == null ? null : List<AggregatedFieldDef>.from(json["aggregate"]!.map((x) => AggregatedFieldDef.fromJson(x))),
8170+ timeUnit: timeUnitValues.map[json["timeUnit"]]!,
8171+ aggregate: List<AggregatedFieldDef>.from(json["aggregate"].map((x) => AggregatedFieldDef.fromJson(x))),
81728172 groupby: json["groupby"] == null ? null : List<String>.from(json["groupby"]!.map((x) => x)),
81738173 );
81748174
@@ -8177,12 +8177,12 @@ class Transform {
81778177 "as": transformAs,
81788178 "calculate": calculate,
81798179 "default": transformDefault,
8180- "from": from?.toJson(),
8180+ "from": from.toJson(),
81818181 "lookup": lookup,
81828182 "bin": bin,
81838183 "field": field,
81848184 "timeUnit": timeUnitValues.reverse[timeUnit],
8185- "aggregate": aggregate == null ? null : List<dynamic>.from(aggregate!.map((x) => x.toJson())),
8185+ "aggregate": List<dynamic>.from(aggregate.map((x) => x.toJson())),
81868186 "groupby": groupby == null ? null : List<dynamic>.from(groupby!.map((x) => x)),
81878187 };
81888188 }
Mschema-elixirdefault / QuickType.ex+154 −174
@@ -1938,12 +1938,13 @@ defmodule ProjectionConfig do
19381938 end
19391939
19401940 defmodule VGScheme do
1941+ @enforce_keys [:scheme]
19411942 defstruct [:count, :extent, :scheme, :step]
19421943
19431944 @type t :: %__MODULE__{
19441945 count: float() | nil,
19451946 extent: [float()] | nil,
1946- scheme: String.t() | nil,
1947+ scheme: String.t(),
19471948 step: float() | nil
19481949 }
19491950
@@ -2502,13 +2503,13 @@ defmodule MultiSelectionConfig do
25022503 end
25032504
25042505 defmodule VGBinding do
2505- @enforce_keys [:input]
2506+ @enforce_keys [:input, :options]
25062507 defstruct [:element, :input, :options, :max, :min, :step]
25072508
25082509 @type t :: %__MODULE__{
25092510 element: String.t() | nil,
25102511 input: String.t(),
2511- options: [String.t()] | nil,
2512+ options: [String.t()],
25122513 max: float() | nil,
25132514 min: float() | nil,
25142515 step: float() | nil
@@ -3596,7 +3597,7 @@ defmodule ConfigClass do
35963597 def encode_padding(value) when is_nil(value), do: value
35973598 def encode_padding(_), do: {:error, "Unexpected type when encoding ConfigClass.padding"}
35983599
3599- def decode_range_value(%{} = value), do: VGScheme.from_map(value)
3600+ def decode_range_value(%{"scheme" => _,} = value), do: VGScheme.from_map(value)
36003601 def decode_range_value(value) when is_list(value), do: value
36013602 def decode_range_value(_), do: {:error, "Unexpected type when decoding ConfigClass.range"}
36023603
@@ -3881,25 +3882,24 @@ defmodule Data do
38813882 - `:name` - Provide a placeholder name and bind data at runtime.
38823883 """
38833884
3885+ @enforce_keys [:url, :values, :name]
38843886 defstruct [:format, :url, :values, :name]
38853887
38863888 @type t :: %__MODULE__{
38873889 format: DataFormat.t() | nil,
3888- url: String.t() | nil,
3889- values: [boolean() | float() | %{String.t() => any()} | String.t()] | %{String.t() => any()} | String.t() | nil,
3890- name: String.t() | nil
3890+ url: String.t(),
3891+ values: [boolean() | float() | %{String.t() => any()} | String.t()] | %{String.t() => any()} | String.t(),
3892+ name: String.t()
38913893 }
38923894
38933895 def decode_values(value) when is_binary(value), do: value
38943896 def decode_values(value) when is_list(value), do: value
38953897 def decode_values(value) when is_map(value), do: value
3896- def decode_values(value) when is_nil(value), do: value
38973898 def decode_values(_), do: {:error, "Unexpected type when decoding Data.values"}
38983899
38993900 def encode_values(value) when is_binary(value), do: value
39003901 def encode_values(value) when is_list(value), do: value
39013902 def encode_values(value) when is_map(value), do: value
3902- def encode_values(value) when is_nil(value), do: value
39033903 def encode_values(_), do: {:error, "Unexpected type when encoding Data.values"}
39043904
39053905 def from_map(m) do
@@ -4084,25 +4084,24 @@ defmodule BinParams do
40844084 end
40854085
40864086 defmodule Selection do
4087+ @enforce_keys [:selection_not, :selection_and, :selection_or]
40874088 defstruct [:selection_not, :selection_and, :selection_or]
40884089
40894090 @type t :: %__MODULE__{
4090- selection_not: Selection.t() | String.t() | nil,
4091- selection_and: [Selection.t() | String.t()] | nil,
4092- selection_or: [Selection.t() | String.t()] | nil
4091+ selection_not: Selection.t() | String.t(),
4092+ selection_and: [Selection.t() | String.t()],
4093+ selection_or: [Selection.t() | String.t()]
40934094 }
40944095
4095- def decode_selection_not(%{} = value), do: Selection.from_map(value)
4096+ def decode_selection_not(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
40964097 def decode_selection_not(value) when is_binary(value), do: value
4097- def decode_selection_not(value) when is_nil(value), do: value
40984098 def decode_selection_not(_), do: {:error, "Unexpected type when decoding Selection.selection_not"}
40994099
41004100 def encode_selection_not(%Selection{} = value), do: Selection.to_map(value)
41014101 def encode_selection_not(value) when is_binary(value), do: value
4102- def encode_selection_not(value) when is_nil(value), do: value
41034102 def encode_selection_not(_), do: {:error, "Unexpected type when encoding Selection.selection_not"}
41044103
4105- def decode_selection_and_element(%{} = value), do: Selection.from_map(value)
4104+ def decode_selection_and_element(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
41064105 def decode_selection_and_element(value) when is_binary(value), do: value
41074106 def decode_selection_and_element(_), do: {:error, "Unexpected type when decoding Selection.selection_and"}
41084107
@@ -4110,7 +4109,7 @@ defmodule Selection do
41104109 def encode_selection_and_element(value) when is_binary(value), do: value
41114110 def encode_selection_and_element(_), do: {:error, "Unexpected type when encoding Selection.selection_and"}
41124111
4113- def decode_selection_or_element(%{} = value), do: Selection.from_map(value)
4112+ def decode_selection_or_element(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
41144113 def decode_selection_or_element(value) when is_binary(value), do: value
41154114 def decode_selection_or_element(_), do: {:error, "Unexpected type when decoding Selection.selection_or"}
41164115
@@ -4121,8 +4120,8 @@ defmodule Selection do
41214120 def from_map(m) do
41224121 %Selection{
41234122 selection_not: decode_selection_not(m["not"]),
4124- selection_and: m["and"] && Enum.map(m["and"], &decode_selection_and_element/1),
4125- selection_or: m["or"] && Enum.map(m["or"], &decode_selection_or_element/1),
4123+ selection_and: Enum.map(m["and"], &decode_selection_and_element/1),
4124+ selection_or: Enum.map(m["or"], &decode_selection_or_element/1),
41264125 }
41274126 end
41284127
@@ -4333,31 +4332,30 @@ defmodule Predicate do
43334332 - `:selection` - Filter using a selection name.
43344333 """
43354334
4335+ @enforce_keys [:predicate_not, :predicate_and, :predicate_or, :equal, :field, :range, :one_of, :selection]
43364336 defstruct [:predicate_not, :predicate_and, :predicate_or, :equal, :field, :time_unit, :range, :one_of, :selection]
43374337
43384338 @type t :: %__MODULE__{
4339- predicate_not: Predicate.t() | String.t() | nil,
4340- predicate_and: [Predicate.t() | String.t()] | nil,
4341- predicate_or: [Predicate.t() | String.t()] | nil,
4342- equal: boolean() | DateTimeClass.t() | float() | String.t() | nil,
4343- field: String.t() | nil,
4339+ predicate_not: Predicate.t() | String.t(),
4340+ predicate_and: [Predicate.t() | String.t()],
4341+ predicate_or: [Predicate.t() | String.t()],
4342+ equal: boolean() | DateTimeClass.t() | float() | String.t(),
4343+ field: String.t(),
43444344 time_unit: TimeUnit.t() | nil,
4345- range: [DateTimeClass.t() | float() | nil] | nil,
4346- one_of: [boolean() | DateTimeClass.t() | float() | String.t()] | nil,
4347- selection: Selection.t() | String.t() | nil
4345+ range: [DateTimeClass.t() | float() | nil],
4346+ one_of: [boolean() | DateTimeClass.t() | float() | String.t()],
4347+ selection: Selection.t() | String.t()
43484348 }
43494349
4350- def decode_predicate_not(%{} = value), do: Predicate.from_map(value)
4350+ def decode_predicate_not(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
43514351 def decode_predicate_not(value) when is_binary(value), do: value
4352- def decode_predicate_not(value) when is_nil(value), do: value
43534352 def decode_predicate_not(_), do: {:error, "Unexpected type when decoding Predicate.predicate_not"}
43544353
43554354 def encode_predicate_not(%Predicate{} = value), do: Predicate.to_map(value)
43564355 def encode_predicate_not(value) when is_binary(value), do: value
4357- def encode_predicate_not(value) when is_nil(value), do: value
43584356 def encode_predicate_not(_), do: {:error, "Unexpected type when encoding Predicate.predicate_not"}
43594357
4360- def decode_predicate_and_element(%{} = value), do: Predicate.from_map(value)
4358+ def decode_predicate_and_element(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
43614359 def decode_predicate_and_element(value) when is_binary(value), do: value
43624360 def decode_predicate_and_element(_), do: {:error, "Unexpected type when decoding Predicate.predicate_and"}
43634361
@@ -4365,7 +4363,7 @@ defmodule Predicate do
43654363 def encode_predicate_and_element(value) when is_binary(value), do: value
43664364 def encode_predicate_and_element(_), do: {:error, "Unexpected type when encoding Predicate.predicate_and"}
43674365
4368- def decode_predicate_or_element(%{} = value), do: Predicate.from_map(value)
4366+ def decode_predicate_or_element(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
43694367 def decode_predicate_or_element(value) when is_binary(value), do: value
43704368 def decode_predicate_or_element(_), do: {:error, "Unexpected type when decoding Predicate.predicate_or"}
43714369
@@ -4378,7 +4376,6 @@ defmodule Predicate do
43784376 def decode_equal(value) when is_float(value), do: value
43794377 def decode_equal(value) when is_integer(value), do: value
43804378 def decode_equal(value) when is_binary(value), do: value
4381- def decode_equal(value) when is_nil(value), do: value
43824379 def decode_equal(_), do: {:error, "Unexpected type when decoding Predicate.equal"}
43834380
43844381 def encode_equal(%DateTimeClass{} = value), do: DateTimeClass.to_map(value)
@@ -4386,7 +4383,6 @@ defmodule Predicate do
43864383 def encode_equal(value) when is_float(value), do: value
43874384 def encode_equal(value) when is_integer(value), do: value
43884385 def encode_equal(value) when is_binary(value), do: value
4389- def encode_equal(value) when is_nil(value), do: value
43904386 def encode_equal(_), do: {:error, "Unexpected type when encoding Predicate.equal"}
43914387
43924388 def decode_range_element(%{} = value), do: DateTimeClass.from_map(value)
@@ -4415,26 +4411,24 @@ defmodule Predicate do
44154411 def encode_one_of_element(value) when is_binary(value), do: value
44164412 def encode_one_of_element(_), do: {:error, "Unexpected type when encoding Predicate.one_of"}
44174413
4418- def decode_selection(%{} = value), do: Selection.from_map(value)
4414+ def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
44194415 def decode_selection(value) when is_binary(value), do: value
4420- def decode_selection(value) when is_nil(value), do: value
44214416 def decode_selection(_), do: {:error, "Unexpected type when decoding Predicate.selection"}
44224417
44234418 def encode_selection(%Selection{} = value), do: Selection.to_map(value)
44244419 def encode_selection(value) when is_binary(value), do: value
4425- def encode_selection(value) when is_nil(value), do: value
44264420 def encode_selection(_), do: {:error, "Unexpected type when encoding Predicate.selection"}
44274421
44284422 def from_map(m) do
44294423 %Predicate{
44304424 predicate_not: decode_predicate_not(m["not"]),
4431- predicate_and: m["and"] && Enum.map(m["and"], &decode_predicate_and_element/1),
4432- predicate_or: m["or"] && Enum.map(m["or"], &decode_predicate_or_element/1),
4425+ predicate_and: Enum.map(m["and"], &decode_predicate_and_element/1),
4426+ predicate_or: Enum.map(m["or"], &decode_predicate_or_element/1),
44334427 equal: decode_equal(m["equal"]),
44344428 field: m["field"],
44354429 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
4436- range: m["range"] && Enum.map(m["range"], &decode_range_element/1),
4437- one_of: m["oneOf"] && Enum.map(m["oneOf"], &decode_one_of_element/1),
4430+ range: Enum.map(m["range"], &decode_range_element/1),
4431+ one_of: Enum.map(m["oneOf"], &decode_one_of_element/1),
44384432 selection: decode_selection(m["selection"]),
44394433 }
44404434 end
@@ -4472,33 +4466,29 @@ defmodule ConditionalValueDef do
44724466 - `:selection` - A [selection name](selection.html), or a series of [composedselections](selection.html#compose).
44734467 """
44744468
4475- @enforce_keys [:value]
4469+ @enforce_keys [:test, :value, :selection]
44764470 defstruct [:test, :value, :selection]
44774471
44784472 @type t :: %__MODULE__{
4479- test: Predicate.t() | String.t() | nil,
4473+ test: Predicate.t() | String.t(),
44804474 value: boolean() | float() | String.t(),
4481- selection: Selection.t() | String.t() | nil
4475+ selection: Selection.t() | String.t()
44824476 }
44834477
4484- def decode_test(%{} = value), do: Predicate.from_map(value)
4478+ def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
44854479 def decode_test(value) when is_binary(value), do: value
4486- def decode_test(value) when is_nil(value), do: value
44874480 def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalValueDef.test"}
44884481
44894482 def encode_test(%Predicate{} = value), do: Predicate.to_map(value)
44904483 def encode_test(value) when is_binary(value), do: value
4491- def encode_test(value) when is_nil(value), do: value
44924484 def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalValueDef.test"}
44934485
4494- def decode_selection(%{} = value), do: Selection.from_map(value)
4486+ def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
44954487 def decode_selection(value) when is_binary(value), do: value
4496- def decode_selection(value) when is_nil(value), do: value
44974488 def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalValueDef.selection"}
44984489
44994490 def encode_selection(%Selection{} = value), do: Selection.to_map(value)
45004491 def encode_selection(value) when is_binary(value), do: value
4501- def encode_selection(value) when is_nil(value), do: value
45024492 def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalValueDef.selection"}
45034493
45044494 def from_map(m) do
@@ -5456,12 +5446,13 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do
54565446 - `:type` - The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or`"nominal"`).It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a[geographic projection](projection.html) is applied.
54575447 """
54585448
5449+ @enforce_keys [:test, :value, :selection, :type]
54595450 defstruct [:test, :value, :selection, :aggregate, :bin, :field, :legend, :scale, :sort, :time_unit, :type]
54605451
54615452 @type t :: %__MODULE__{
5462- test: Predicate.t() | String.t() | nil,
5463- value: boolean() | float() | String.t() | nil,
5464- selection: Selection.t() | String.t() | nil,
5453+ test: Predicate.t() | String.t(),
5454+ value: boolean() | float() | String.t(),
5455+ selection: Selection.t() | String.t(),
54655456 aggregate: AggregateOp.t() | nil,
54665457 bin: boolean() | BinParams.t() | nil,
54675458 field: RepeatRef.t() | String.t() | nil,
@@ -5469,27 +5460,23 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do
54695460 scale: Scale.t() | nil,
54705461 sort: SortField.t() | SortEnum.t() | nil | nil,
54715462 time_unit: TimeUnit.t() | nil,
5472- type: Type.t() | nil
5463+ type: Type.t()
54735464 }
54745465
5475- def decode_test(%{} = value), do: Predicate.from_map(value)
5466+ def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
54765467 def decode_test(value) when is_binary(value), do: value
5477- def decode_test(value) when is_nil(value), do: value
54785468 def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalPredicateMarkPropFieldDefClass.test"}
54795469
54805470 def encode_test(%Predicate{} = value), do: Predicate.to_map(value)
54815471 def encode_test(value) when is_binary(value), do: value
5482- def encode_test(value) when is_nil(value), do: value
54835472 def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalPredicateMarkPropFieldDefClass.test"}
54845473
5485- def decode_selection(%{} = value), do: Selection.from_map(value)
5474+ def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
54865475 def decode_selection(value) when is_binary(value), do: value
5487- def decode_selection(value) when is_nil(value), do: value
54885476 def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalPredicateMarkPropFieldDefClass.selection"}
54895477
54905478 def encode_selection(%Selection{} = value), do: Selection.to_map(value)
54915479 def encode_selection(value) when is_binary(value), do: value
5492- def encode_selection(value) when is_nil(value), do: value
54935480 def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalPredicateMarkPropFieldDefClass.selection"}
54945481
54955482 def decode_bin(%{} = value), do: BinParams.from_map(value)
@@ -5534,7 +5521,7 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do
55345521 scale: m["scale"] && Scale.from_map(m["scale"]),
55355522 sort: decode_sort(m["sort"]),
55365523 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
5537- type: m["type"] && Type.decode(m["type"]),
5524+ type: Type.decode(m["type"]),
55385525 }
55395526 end
55405527
@@ -5556,7 +5543,7 @@ defmodule ConditionalPredicateMarkPropFieldDefClass do
55565543 "scale" => struct.scale && Scale.to_map(struct.scale),
55575544 "sort" => encode_sort(struct.sort),
55585545 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
5559- "type" => struct.type && Type.encode(struct.type),
5546+ "type" => Type.encode(struct.type),
55605547 }
55615548 end
55625549
@@ -5622,6 +5609,7 @@ defmodule MarkPropDefWithCondition do
56225609 - `:value` - A constant value in visual domain.
56235610 """
56245611
5612+ @enforce_keys [:type]
56255613 defstruct [:aggregate, :bin, :condition, :field, :legend, :scale, :sort, :time_unit, :type, :value]
56265614
56275615 @type t :: %__MODULE__{
@@ -5633,7 +5621,7 @@ defmodule MarkPropDefWithCondition do
56335621 scale: Scale.t() | nil,
56345622 sort: SortField.t() | SortEnum.t() | nil | nil,
56355623 time_unit: TimeUnit.t() | nil,
5636- type: Type.t() | nil,
5624+ type: Type.t(),
56375625 value: boolean() | float() | String.t() | nil
56385626 }
56395627
@@ -5647,7 +5635,7 @@ defmodule MarkPropDefWithCondition do
56475635 def encode_bin(value) when is_nil(value), do: value
56485636 def encode_bin(_), do: {:error, "Unexpected type when encoding MarkPropDefWithCondition.bin"}
56495637
5650- def decode_condition(%{} = value), do: ConditionalPredicateMarkPropFieldDefClass.from_map(value)
5638+ def decode_condition(%{"test" => _,"value" => _,"selection" => _,"type" => _,} = value), do: ConditionalPredicateMarkPropFieldDefClass.from_map(value)
56515639 def decode_condition(value) when is_list(value), do: value
56525640 def decode_condition(value) when is_nil(value), do: value
56535641 def decode_condition(_), do: {:error, "Unexpected type when decoding MarkPropDefWithCondition.condition"}
@@ -5687,7 +5675,7 @@ defmodule MarkPropDefWithCondition do
56875675 scale: m["scale"] && Scale.from_map(m["scale"]),
56885676 sort: decode_sort(m["sort"]),
56895677 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
5690- type: m["type"] && Type.decode(m["type"]),
5678+ type: Type.decode(m["type"]),
56915679 value: m["value"],
56925680 }
56935681 end
@@ -5708,7 +5696,7 @@ defmodule MarkPropDefWithCondition do
57085696 "scale" => struct.scale && Scale.to_map(struct.scale),
57095697 "sort" => encode_sort(struct.sort),
57105698 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
5711- "type" => struct.type && Type.encode(struct.type),
5699+ "type" => Type.encode(struct.type),
57125700 "value" => struct.value,
57135701 }
57145702 end
@@ -5936,37 +5924,34 @@ defmodule ConditionalPredicateFieldDefClass do
59365924 - `:type` - The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or`"nominal"`).It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a[geographic projection](projection.html) is applied.
59375925 """
59385926
5927+ @enforce_keys [:test, :value, :selection, :type]
59395928 defstruct [:test, :value, :selection, :aggregate, :bin, :field, :time_unit, :type]
59405929
59415930 @type t :: %__MODULE__{
5942- test: Predicate.t() | String.t() | nil,
5943- value: boolean() | float() | String.t() | nil,
5944- selection: Selection.t() | String.t() | nil,
5931+ test: Predicate.t() | String.t(),
5932+ value: boolean() | float() | String.t(),
5933+ selection: Selection.t() | String.t(),
59455934 aggregate: AggregateOp.t() | nil,
59465935 bin: boolean() | BinParams.t() | nil,
59475936 field: RepeatRef.t() | String.t() | nil,
59485937 time_unit: TimeUnit.t() | nil,
5949- type: Type.t() | nil
5938+ type: Type.t()
59505939 }
59515940
5952- def decode_test(%{} = value), do: Predicate.from_map(value)
5941+ def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
59535942 def decode_test(value) when is_binary(value), do: value
5954- def decode_test(value) when is_nil(value), do: value
59555943 def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalPredicateFieldDefClass.test"}
59565944
59575945 def encode_test(%Predicate{} = value), do: Predicate.to_map(value)
59585946 def encode_test(value) when is_binary(value), do: value
5959- def encode_test(value) when is_nil(value), do: value
59605947 def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalPredicateFieldDefClass.test"}
59615948
5962- def decode_selection(%{} = value), do: Selection.from_map(value)
5949+ def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
59635950 def decode_selection(value) when is_binary(value), do: value
5964- def decode_selection(value) when is_nil(value), do: value
59655951 def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalPredicateFieldDefClass.selection"}
59665952
59675953 def encode_selection(%Selection{} = value), do: Selection.to_map(value)
59685954 def encode_selection(value) when is_binary(value), do: value
5969- def encode_selection(value) when is_nil(value), do: value
59705955 def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalPredicateFieldDefClass.selection"}
59715956
59725957 def decode_bin(%{} = value), do: BinParams.from_map(value)
@@ -5998,7 +5983,7 @@ defmodule ConditionalPredicateFieldDefClass do
59985983 bin: decode_bin(m["bin"]),
59995984 field: decode_field(m["field"]),
60005985 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
6001- type: m["type"] && Type.decode(m["type"]),
5986+ type: Type.decode(m["type"]),
60025987 }
60035988 end
60045989
@@ -6017,7 +6002,7 @@ defmodule ConditionalPredicateFieldDefClass do
60176002 "bin" => encode_bin(struct.bin),
60186003 "field" => encode_field(struct.field),
60196004 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
6020- "type" => struct.type && Type.encode(struct.type),
6005+ "type" => Type.encode(struct.type),
60216006 }
60226007 end
60236008
@@ -6053,6 +6038,7 @@ defmodule DefWithCondition do
60536038 - `:value` - A constant value in visual domain.
60546039 """
60556040
6041+ @enforce_keys [:type]
60566042 defstruct [:aggregate, :bin, :condition, :field, :time_unit, :type, :value]
60576043
60586044 @type t :: %__MODULE__{
@@ -6061,7 +6047,7 @@ defmodule DefWithCondition do
60616047 condition: [ConditionalValueDef.t()] | ConditionalPredicateFieldDefClass.t() | nil,
60626048 field: RepeatRef.t() | String.t() | nil,
60636049 time_unit: TimeUnit.t() | nil,
6064- type: Type.t() | nil,
6050+ type: Type.t(),
60656051 value: boolean() | float() | String.t() | nil
60666052 }
60676053
@@ -6075,7 +6061,7 @@ defmodule DefWithCondition do
60756061 def encode_bin(value) when is_nil(value), do: value
60766062 def encode_bin(_), do: {:error, "Unexpected type when encoding DefWithCondition.bin"}
60776063
6078- def decode_condition(%{} = value), do: ConditionalPredicateFieldDefClass.from_map(value)
6064+ def decode_condition(%{"test" => _,"value" => _,"selection" => _,"type" => _,} = value), do: ConditionalPredicateFieldDefClass.from_map(value)
60796065 def decode_condition(value) when is_list(value), do: value
60806066 def decode_condition(value) when is_nil(value), do: value
60816067 def decode_condition(_), do: {:error, "Unexpected type when decoding DefWithCondition.condition"}
@@ -6102,7 +6088,7 @@ defmodule DefWithCondition do
61026088 condition: decode_condition(m["condition"]),
61036089 field: decode_field(m["field"]),
61046090 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
6105- type: m["type"] && Type.decode(m["type"]),
6091+ type: Type.decode(m["type"]),
61066092 value: m["value"],
61076093 }
61086094 end
@@ -6120,7 +6106,7 @@ defmodule DefWithCondition do
61206106 "condition" => encode_condition(struct.condition),
61216107 "field" => encode_field(struct.field),
61226108 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
6123- "type" => struct.type && Type.encode(struct.type),
6109+ "type" => Type.encode(struct.type),
61246110 "value" => struct.value,
61256111 }
61266112 end
@@ -6221,38 +6207,35 @@ defmodule ConditionalPredicateTextFieldDefClass do
62216207 - `:type` - The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or`"nominal"`).It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a[geographic projection](projection.html) is applied.
62226208 """
62236209
6210+ @enforce_keys [:test, :value, :selection, :type]
62246211 defstruct [:test, :value, :selection, :aggregate, :bin, :field, :format, :time_unit, :type]
62256212
62266213 @type t :: %__MODULE__{
6227- test: Predicate.t() | String.t() | nil,
6228- value: boolean() | float() | String.t() | nil,
6229- selection: Selection.t() | String.t() | nil,
6214+ test: Predicate.t() | String.t(),
6215+ value: boolean() | float() | String.t(),
6216+ selection: Selection.t() | String.t(),
62306217 aggregate: AggregateOp.t() | nil,
62316218 bin: boolean() | BinParams.t() | nil,
62326219 field: RepeatRef.t() | String.t() | nil,
62336220 format: String.t() | nil,
62346221 time_unit: TimeUnit.t() | nil,
6235- type: Type.t() | nil
6222+ type: Type.t()
62366223 }
62376224
6238- def decode_test(%{} = value), do: Predicate.from_map(value)
6225+ def decode_test(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
62396226 def decode_test(value) when is_binary(value), do: value
6240- def decode_test(value) when is_nil(value), do: value
62416227 def decode_test(_), do: {:error, "Unexpected type when decoding ConditionalPredicateTextFieldDefClass.test"}
62426228
62436229 def encode_test(%Predicate{} = value), do: Predicate.to_map(value)
62446230 def encode_test(value) when is_binary(value), do: value
6245- def encode_test(value) when is_nil(value), do: value
62466231 def encode_test(_), do: {:error, "Unexpected type when encoding ConditionalPredicateTextFieldDefClass.test"}
62476232
6248- def decode_selection(%{} = value), do: Selection.from_map(value)
6233+ def decode_selection(%{"not" => _,"and" => _,"or" => _,} = value), do: Selection.from_map(value)
62496234 def decode_selection(value) when is_binary(value), do: value
6250- def decode_selection(value) when is_nil(value), do: value
62516235 def decode_selection(_), do: {:error, "Unexpected type when decoding ConditionalPredicateTextFieldDefClass.selection"}
62526236
62536237 def encode_selection(%Selection{} = value), do: Selection.to_map(value)
62546238 def encode_selection(value) when is_binary(value), do: value
6255- def encode_selection(value) when is_nil(value), do: value
62566239 def encode_selection(_), do: {:error, "Unexpected type when encoding ConditionalPredicateTextFieldDefClass.selection"}
62576240
62586241 def decode_bin(%{} = value), do: BinParams.from_map(value)
@@ -6285,7 +6268,7 @@ defmodule ConditionalPredicateTextFieldDefClass do
62856268 field: decode_field(m["field"]),
62866269 format: m["format"],
62876270 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
6288- type: m["type"] && Type.decode(m["type"]),
6271+ type: Type.decode(m["type"]),
62896272 }
62906273 end
62916274
@@ -6305,7 +6288,7 @@ defmodule ConditionalPredicateTextFieldDefClass do
63056288 "field" => encode_field(struct.field),
63066289 "format" => struct.format,
63076290 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
6308- "type" => struct.type && Type.encode(struct.type),
6291+ "type" => Type.encode(struct.type),
63096292 }
63106293 end
63116294
@@ -6344,6 +6327,7 @@ defmodule TextDefWithCondition do
63446327 - `:value` - A constant value in visual domain.
63456328 """
63466329
6330+ @enforce_keys [:type]
63476331 defstruct [:aggregate, :bin, :condition, :field, :format, :time_unit, :type, :value]
63486332
63496333 @type t :: %__MODULE__{
@@ -6353,7 +6337,7 @@ defmodule TextDefWithCondition do
63536337 field: RepeatRef.t() | String.t() | nil,
63546338 format: String.t() | nil,
63556339 time_unit: TimeUnit.t() | nil,
6356- type: Type.t() | nil,
6340+ type: Type.t(),
63576341 value: boolean() | float() | String.t() | nil
63586342 }
63596343
@@ -6367,7 +6351,7 @@ defmodule TextDefWithCondition do
63676351 def encode_bin(value) when is_nil(value), do: value
63686352 def encode_bin(_), do: {:error, "Unexpected type when encoding TextDefWithCondition.bin"}
63696353
6370- def decode_condition(%{} = value), do: ConditionalPredicateTextFieldDefClass.from_map(value)
6354+ def decode_condition(%{"test" => _,"value" => _,"selection" => _,"type" => _,} = value), do: ConditionalPredicateTextFieldDefClass.from_map(value)
63716355 def decode_condition(value) when is_list(value), do: value
63726356 def decode_condition(value) when is_nil(value), do: value
63736357 def decode_condition(_), do: {:error, "Unexpected type when decoding TextDefWithCondition.condition"}
@@ -6395,7 +6379,7 @@ defmodule TextDefWithCondition do
63956379 field: decode_field(m["field"]),
63966380 format: m["format"],
63976381 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
6398- type: m["type"] && Type.decode(m["type"]),
6382+ type: Type.decode(m["type"]),
63996383 value: m["value"],
64006384 }
64016385 end
@@ -6414,7 +6398,7 @@ defmodule TextDefWithCondition do
64146398 "field" => encode_field(struct.field),
64156399 "format" => struct.format,
64166400 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
6417- "type" => struct.type && Type.encode(struct.type),
6401+ "type" => Type.encode(struct.type),
64186402 "value" => struct.value,
64196403 }
64206404 end
@@ -6585,6 +6569,7 @@ defmodule XClass do
65856569 - `:value` - A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between`0` to `1` for opacity).
65866570 """
65876571
6572+ @enforce_keys [:type, :value]
65886573 defstruct [:aggregate, :axis, :bin, :field, :scale, :sort, :stack, :time_unit, :type, :value]
65896574
65906575 @type t :: %__MODULE__{
@@ -6596,8 +6581,8 @@ defmodule XClass do
65966581 sort: SortField.t() | SortEnum.t() | nil | nil,
65976582 stack: StackOffset.t() | nil | nil,
65986583 time_unit: TimeUnit.t() | nil,
6599- type: Type.t() | nil,
6600- value: boolean() | float() | String.t() | nil
6584+ type: Type.t(),
6585+ value: boolean() | float() | String.t()
66016586 }
66026587
66036588 def decode_bin(%{} = value), do: BinParams.from_map(value)
@@ -6640,7 +6625,7 @@ defmodule XClass do
66406625 sort: decode_sort(m["sort"]),
66416626 stack: m["stack"] && StackOffset.decode(m["stack"]),
66426627 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
6643- type: m["type"] && Type.decode(m["type"]),
6628+ type: Type.decode(m["type"]),
66446629 value: m["value"],
66456630 }
66466631 end
@@ -6661,7 +6646,7 @@ defmodule XClass do
66616646 "sort" => encode_sort(struct.sort),
66626647 "stack" => struct.stack && StackOffset.encode(struct.stack),
66636648 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
6664- "type" => struct.type && Type.encode(struct.type),
6649+ "type" => Type.encode(struct.type),
66656650 "value" => struct.value,
66666651 }
66676652 end
@@ -6690,6 +6675,7 @@ defmodule X2Class do
66906675 - `:value` - A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between`0` to `1` for opacity).
66916676 """
66926677
6678+ @enforce_keys [:type, :value]
66936679 defstruct [:aggregate, :bin, :field, :time_unit, :type, :value]
66946680
66956681 @type t :: %__MODULE__{
@@ -6697,8 +6683,8 @@ defmodule X2Class do
66976683 bin: boolean() | BinParams.t() | nil,
66986684 field: RepeatRef.t() | String.t() | nil,
66996685 time_unit: TimeUnit.t() | nil,
6700- type: Type.t() | nil,
6701- value: boolean() | float() | String.t() | nil
6686+ type: Type.t(),
6687+ value: boolean() | float() | String.t()
67026688 }
67036689
67046690 def decode_bin(%{} = value), do: BinParams.from_map(value)
@@ -6727,7 +6713,7 @@ defmodule X2Class do
67276713 bin: decode_bin(m["bin"]),
67286714 field: decode_field(m["field"]),
67296715 time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
6730- type: m["type"] && Type.decode(m["type"]),
6716+ type: Type.decode(m["type"]),
67316717 value: m["value"],
67326718 }
67336719 end
@@ -6744,7 +6730,7 @@ defmodule X2Class do
67446730 "bin" => encode_bin(struct.bin),
67456731 "field" => encode_field(struct.field),
67466732 "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
6747- "type" => struct.type && Type.encode(struct.type),
6733+ "type" => Type.encode(struct.type),
67486734 "value" => struct.value,
67496735 }
67506736 end
@@ -7890,30 +7876,29 @@ defmodule Transform do
78907876 - `:groupby` - The data fields to group by. If not specified, a single group containing all data objectswill be used.
78917877 """
78927878
7879+ @enforce_keys [:filter, :calculate, :from, :lookup, :bin, :field, :time_unit, :aggregate]
78937880 defstruct [:filter, :as, :calculate, :default, :from, :lookup, :bin, :field, :time_unit, :aggregate, :groupby]
78947881
78957882 @type t :: %__MODULE__{
7896- filter: Predicate.t() | String.t() | nil,
7883+ filter: Predicate.t() | String.t(),
78977884 as: [String.t()] | String.t() | nil,
7898- calculate: String.t() | nil,
7885+ calculate: String.t(),
78997886 default: String.t() | nil,
7900- from: LookupData.t() | nil,
7901- lookup: String.t() | nil,
7902- bin: boolean() | BinParams.t() | nil,
7903- field: String.t() | nil,
7904- time_unit: TimeUnit.t() | nil,
7905- aggregate: [AggregatedFieldDef.t()] | nil,
7887+ from: LookupData.t(),
7888+ lookup: String.t(),
7889+ bin: boolean() | BinParams.t(),
7890+ field: String.t(),
7891+ time_unit: TimeUnit.t(),
7892+ aggregate: [AggregatedFieldDef.t()],
79067893 groupby: [String.t()] | nil
79077894 }
79087895
7909- def decode_filter(%{} = value), do: Predicate.from_map(value)
7896+ def decode_filter(%{"not" => _,"and" => _,"or" => _,"equal" => _,"field" => _,"range" => _,"oneOf" => _,"selection" => _,} = value), do: Predicate.from_map(value)
79107897 def decode_filter(value) when is_binary(value), do: value
7911- def decode_filter(value) when is_nil(value), do: value
79127898 def decode_filter(_), do: {:error, "Unexpected type when decoding Transform.filter"}
79137899
79147900 def encode_filter(%Predicate{} = value), do: Predicate.to_map(value)
79157901 def encode_filter(value) when is_binary(value), do: value
7916- def encode_filter(value) when is_nil(value), do: value
79177902 def encode_filter(_), do: {:error, "Unexpected type when encoding Transform.filter"}
79187903
79197904 def decode_as(value) when is_binary(value), do: value
@@ -7928,12 +7913,10 @@ defmodule Transform do
79287913
79297914 def decode_bin(%{} = value), do: BinParams.from_map(value)
79307915 def decode_bin(value) when is_boolean(value), do: value
7931- def decode_bin(value) when is_nil(value), do: value
79327916 def decode_bin(_), do: {:error, "Unexpected type when decoding Transform.bin"}
79337917
79347918 def encode_bin(%BinParams{} = value), do: BinParams.to_map(value)
79357919 def encode_bin(value) when is_boolean(value), do: value
7936- def encode_bin(value) when is_nil(value), do: value
79377920 def encode_bin(_), do: {:error, "Unexpected type when encoding Transform.bin"}
79387921
79397922 def from_map(m) do
@@ -7942,12 +7925,12 @@ defmodule Transform do
79427925 as: decode_as(m["as"]),
79437926 calculate: m["calculate"],
79447927 default: m["default"],
7945- from: m["from"] && LookupData.from_map(m["from"]),
7928+ from: LookupData.from_map(m["from"]),
79467929 lookup: m["lookup"],
79477930 bin: decode_bin(m["bin"]),
79487931 field: m["field"],
7949- time_unit: m["timeUnit"] && TimeUnit.decode(m["timeUnit"]),
7950- aggregate: m["aggregate"] && Enum.map(m["aggregate"], &AggregatedFieldDef.from_map/1),
7932+ time_unit: TimeUnit.decode(m["timeUnit"]),
7933+ aggregate: Enum.map(m["aggregate"], &AggregatedFieldDef.from_map/1),
79517934 groupby: m["groupby"],
79527935 }
79537936 end
@@ -7964,11 +7947,11 @@ defmodule Transform do
79647947 "as" => encode_as(struct.as),
79657948 "calculate" => struct.calculate,
79667949 "default" => struct.default,
7967- "from" => struct.from && LookupData.to_map(struct.from),
7950+ "from" => LookupData.to_map(struct.from),
79687951 "lookup" => struct.lookup,
79697952 "bin" => encode_bin(struct.bin),
79707953 "field" => struct.field,
7971- "timeUnit" => struct.time_unit && TimeUnit.encode(struct.time_unit),
7954+ "timeUnit" => TimeUnit.encode(struct.time_unit),
79727955 "aggregate" => struct.aggregate && Enum.map(struct.aggregate, &AggregatedFieldDef.to_map/1),
79737956 "groupby" => struct.groupby,
79747957 }
@@ -7999,20 +7982,21 @@ defmodule LayerSpec do
79997982 - `:selection` - A key-value mapping between selection names and definitions.
80007983 """
80017984
7985+ @enforce_keys [:layer, :encoding, :mark]
80027986 defstruct [:data, :description, :height, :layer, :name, :resolve, :title, :transform, :width, :encoding, :mark, :projection, :selection]
80037987
80047988 @type t :: %__MODULE__{
80057989 data: Data.t() | nil,
80067990 description: String.t() | nil,
80077991 height: float() | nil,
8008- layer: [LayerSpec.t()] | nil,
7992+ layer: [LayerSpec.t()],
80097993 name: String.t() | nil,
80107994 resolve: Resolve.t() | nil,
80117995 title: TitleParams.t() | String.t() | nil,
80127996 transform: [Transform.t()] | nil,
80137997 width: float() | nil,
8014- encoding: Encoding.t() | nil,
8015- mark: MarkDef.t() | Mark.t() | nil,
7998+ encoding: Encoding.t(),
7999+ mark: MarkDef.t() | Mark.t(),
80168000 projection: Projection.t() | nil,
80178001 selection: %{String.t() => SelectionDef.t()} | nil
80188002 }
@@ -8029,12 +8013,10 @@ defmodule LayerSpec do
80298013
80308014 def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value)
80318015 def decode_mark(value) when is_binary(value), do: Mark.decode(value)
8032- def decode_mark(value) when is_nil(value), do: value
80338016 def decode_mark(_), do: {:error, "Unexpected type when decoding LayerSpec.mark"}
80348017
80358018 def encode_mark(%MarkDef{} = value), do: MarkDef.to_map(value)
80368019 def encode_mark(value) when is_atom(value), do: Mark.encode(value)
8037- def encode_mark(value) when is_nil(value), do: value
80388020 def encode_mark(_), do: {:error, "Unexpected type when encoding LayerSpec.mark"}
80398021
80408022 def from_map(m) do
@@ -8042,13 +8024,13 @@ defmodule LayerSpec do
80428024 data: m["data"] && Data.from_map(m["data"]),
80438025 description: m["description"],
80448026 height: m["height"],
8045- layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
8027+ layer: Enum.map(m["layer"], &LayerSpec.from_map/1),
80468028 name: m["name"],
80478029 resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
80488030 title: decode_title(m["title"]),
80498031 transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
80508032 width: m["width"],
8051- encoding: m["encoding"] && Encoding.from_map(m["encoding"]),
8033+ encoding: Encoding.from_map(m["encoding"]),
80528034 mark: decode_mark(m["mark"]),
80538035 projection: m["projection"] && Projection.from_map(m["projection"]),
80548036 selection: m["selection"]
@@ -8073,7 +8055,7 @@ defmodule LayerSpec do
80738055 "title" => encode_title(struct.title),
80748056 "transform" => struct.transform && Enum.map(struct.transform, &Transform.to_map/1),
80758057 "width" => struct.width,
8076- "encoding" => struct.encoding && Encoding.to_map(struct.encoding),
8058+ "encoding" => Encoding.to_map(struct.encoding),
80778059 "mark" => encode_mark(struct.mark),
80788060 "projection" => struct.projection && Projection.to_map(struct.projection),
80798061 "selection" => struct.selection
@@ -8153,27 +8135,28 @@ defmodule Spec do
81538135 - `:hconcat` - A list of views that should be concatenated and put into a row.
81548136 """
81558137
8138+ @enforce_keys [:layer, :encoding, :mark, :facet, :spec, :repeat, :vconcat, :hconcat]
81568139 defstruct [:data, :description, :height, :layer, :name, :resolve, :title, :transform, :width, :encoding, :mark, :projection, :selection, :facet, :spec, :repeat, :vconcat, :hconcat]
81578140
81588141 @type t :: %__MODULE__{
81598142 data: Data.t() | nil,
81608143 description: String.t() | nil,
81618144 height: float() | nil,
8162- layer: [LayerSpec.t()] | nil,
8145+ layer: [LayerSpec.t()],
81638146 name: String.t() | nil,
81648147 resolve: Resolve.t() | nil,
81658148 title: TitleParams.t() | String.t() | nil,
81668149 transform: [Transform.t()] | nil,
81678150 width: float() | nil,
8168- encoding: Encoding.t() | nil,
8169- mark: MarkDef.t() | Mark.t() | nil,
8151+ encoding: Encoding.t(),
8152+ mark: MarkDef.t() | Mark.t(),
81708153 projection: Projection.t() | nil,
81718154 selection: %{String.t() => SelectionDef.t()} | nil,
8172- facet: FacetMapping.t() | nil,
8173- spec: Spec.t() | nil,
8174- repeat: Repeat.t() | nil,
8175- vconcat: [Spec.t()] | nil,
8176- hconcat: [Spec.t()] | nil
8155+ facet: FacetMapping.t(),
8156+ spec: Spec.t(),
8157+ repeat: Repeat.t(),
8158+ vconcat: [Spec.t()],
8159+ hconcat: [Spec.t()]
81778160 }
81788161
81798162 def decode_title(%{"text" => _,} = value), do: TitleParams.from_map(value)
@@ -8188,12 +8171,10 @@ defmodule Spec do
81888171
81898172 def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value)
81908173 def decode_mark(value) when is_binary(value), do: Mark.decode(value)
8191- def decode_mark(value) when is_nil(value), do: value
81928174 def decode_mark(_), do: {:error, "Unexpected type when decoding Spec.mark"}
81938175
81948176 def encode_mark(%MarkDef{} = value), do: MarkDef.to_map(value)
81958177 def encode_mark(value) when is_atom(value), do: Mark.encode(value)
8196- def encode_mark(value) when is_nil(value), do: value
81978178 def encode_mark(_), do: {:error, "Unexpected type when encoding Spec.mark"}
81988179
81998180 def from_map(m) do
@@ -8201,22 +8182,22 @@ defmodule Spec do
82018182 data: m["data"] && Data.from_map(m["data"]),
82028183 description: m["description"],
82038184 height: m["height"],
8204- layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
8185+ layer: Enum.map(m["layer"], &LayerSpec.from_map/1),
82058186 name: m["name"],
82068187 resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
82078188 title: decode_title(m["title"]),
82088189 transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
82098190 width: m["width"],
8210- encoding: m["encoding"] && Encoding.from_map(m["encoding"]),
8191+ encoding: Encoding.from_map(m["encoding"]),
82118192 mark: decode_mark(m["mark"]),
82128193 projection: m["projection"] && Projection.from_map(m["projection"]),
82138194 selection: m["selection"]
82148195 |> Map.new(fn {key, value} -> {key, SelectionDef.from_map(value)} end),
8215- facet: m["facet"] && FacetMapping.from_map(m["facet"]),
8216- spec: m["spec"] && Spec.from_map(m["spec"]),
8217- repeat: m["repeat"] && Repeat.from_map(m["repeat"]),
8218- vconcat: m["vconcat"] && Enum.map(m["vconcat"], &Spec.from_map/1),
8219- hconcat: m["hconcat"] && Enum.map(m["hconcat"], &Spec.from_map/1),
8196+ facet: FacetMapping.from_map(m["facet"]),
8197+ spec: Spec.from_map(m["spec"]),
8198+ repeat: Repeat.from_map(m["repeat"]),
8199+ vconcat: Enum.map(m["vconcat"], &Spec.from_map/1),
8200+ hconcat: Enum.map(m["hconcat"], &Spec.from_map/1),
82208201 }
82218202 end
82228203
@@ -8237,14 +8218,14 @@ defmodule Spec do
82378218 "title" => encode_title(struct.title),
82388219 "transform" => struct.transform && Enum.map(struct.transform, &Transform.to_map/1),
82398220 "width" => struct.width,
8240- "encoding" => struct.encoding && Encoding.to_map(struct.encoding),
8221+ "encoding" => Encoding.to_map(struct.encoding),
82418222 "mark" => encode_mark(struct.mark),
82428223 "projection" => struct.projection && Projection.to_map(struct.projection),
82438224 "selection" => struct.selection
82448225 |> Map.new(fn {key, value} -> {key, SelectionDef.to_map(value)} end),
8245- "facet" => struct.facet && FacetMapping.to_map(struct.facet),
8246- "spec" => struct.spec && Spec.to_map(struct.spec),
8247- "repeat" => struct.repeat && Repeat.to_map(struct.repeat),
8226+ "facet" => FacetMapping.to_map(struct.facet),
8227+ "spec" => Spec.to_map(struct.spec),
8228+ "repeat" => Repeat.to_map(struct.repeat),
82488229 "vconcat" => struct.vconcat && Enum.map(struct.vconcat, &Spec.to_map/1),
82498230 "hconcat" => struct.hconcat && Enum.map(struct.hconcat, &Spec.to_map/1),
82508231 }
@@ -8284,6 +8265,7 @@ defmodule TopLevel do
82848265 - `:hconcat` - A list of views that should be concatenated and put into a row.
82858266 """
82868267
8268+ @enforce_keys [:encoding, :mark, :layer, :facet, :spec, :repeat, :vconcat, :hconcat]
82878269 defstruct [:schema, :autosize, :background, :config, :data, :description, :encoding, :height, :mark, :name, :padding, :projection, :selection, :title, :transform, :width, :layer, :resolve, :facet, :spec, :repeat, :vconcat, :hconcat]
82888270
82898271 @type t :: %__MODULE__{
@@ -8293,9 +8275,9 @@ defmodule TopLevel do
82938275 config: ConfigClass.t() | nil,
82948276 data: Data.t() | nil,
82958277 description: String.t() | nil,
8296- encoding: EncodingWithFacet.t() | nil,
8278+ encoding: EncodingWithFacet.t(),
82978279 height: float() | nil,
8298- mark: MarkDef.t() | Mark.t() | nil,
8280+ mark: MarkDef.t() | Mark.t(),
82998281 name: String.t() | nil,
83008282 padding: PaddingClass.t() | float() | nil,
83018283 projection: Projection.t() | nil,
@@ -8303,13 +8285,13 @@ defmodule TopLevel do
83038285 title: TitleParams.t() | String.t() | nil,
83048286 transform: [Transform.t()] | nil,
83058287 width: float() | nil,
8306- layer: [LayerSpec.t()] | nil,
8288+ layer: [LayerSpec.t()],
83078289 resolve: Resolve.t() | nil,
8308- facet: FacetMapping.t() | nil,
8309- spec: Spec.t() | nil,
8310- repeat: Repeat.t() | nil,
8311- vconcat: [Spec.t()] | nil,
8312- hconcat: [Spec.t()] | nil
8290+ facet: FacetMapping.t(),
8291+ spec: Spec.t(),
8292+ repeat: Repeat.t(),
8293+ vconcat: [Spec.t()],
8294+ hconcat: [Spec.t()]
83138295 }
83148296
83158297 def decode_autosize(%{} = value), do: AutoSizeParams.from_map(value)
@@ -8324,12 +8306,10 @@ defmodule TopLevel do
83248306
83258307 def decode_mark(%{"type" => _,} = value), do: MarkDef.from_map(value)
83268308 def decode_mark(value) when is_binary(value), do: Mark.decode(value)
8327- def decode_mark(value) when is_nil(value), do: value
83288309 def decode_mark(_), do: {:error, "Unexpected type when decoding TopLevel.mark"}
83298310
83308311 def encode_mark(%MarkDef{} = value), do: MarkDef.to_map(value)
83318312 def encode_mark(value) when is_atom(value), do: Mark.encode(value)
8332- def encode_mark(value) when is_nil(value), do: value
83338313 def encode_mark(_), do: {:error, "Unexpected type when encoding TopLevel.mark"}
83348314
83358315 def decode_padding(%{} = value), do: PaddingClass.from_map(value)
@@ -8362,7 +8342,7 @@ defmodule TopLevel do
83628342 config: m["config"] && ConfigClass.from_map(m["config"]),
83638343 data: m["data"] && Data.from_map(m["data"]),
83648344 description: m["description"],
8365- encoding: m["encoding"] && EncodingWithFacet.from_map(m["encoding"]),
8345+ encoding: EncodingWithFacet.from_map(m["encoding"]),
83668346 height: m["height"],
83678347 mark: decode_mark(m["mark"]),
83688348 name: m["name"],
@@ -8373,13 +8353,13 @@ defmodule TopLevel do
83738353 title: decode_title(m["title"]),
83748354 transform: m["transform"] && Enum.map(m["transform"], &Transform.from_map/1),
83758355 width: m["width"],
8376- layer: m["layer"] && Enum.map(m["layer"], &LayerSpec.from_map/1),
8356+ layer: Enum.map(m["layer"], &LayerSpec.from_map/1),
83778357 resolve: m["resolve"] && Resolve.from_map(m["resolve"]),
8378- facet: m["facet"] && FacetMapping.from_map(m["facet"]),
8379- spec: m["spec"] && Spec.from_map(m["spec"]),
8380- repeat: m["repeat"] && Repeat.from_map(m["repeat"]),
8381- vconcat: m["vconcat"] && Enum.map(m["vconcat"], &Spec.from_map/1),
8382- hconcat: m["hconcat"] && Enum.map(m["hconcat"], &Spec.from_map/1),
8358+ facet: FacetMapping.from_map(m["facet"]),
8359+ spec: Spec.from_map(m["spec"]),
8360+ repeat: Repeat.from_map(m["repeat"]),
8361+ vconcat: Enum.map(m["vconcat"], &Spec.from_map/1),
8362+ hconcat: Enum.map(m["hconcat"], &Spec.from_map/1),
83838363 }
83848364 end
83858365
@@ -8397,7 +8377,7 @@ defmodule TopLevel do
83978377 "config" => struct.config && ConfigClass.to_map(struct.config),
83988378 "data" => struct.data && Data.to_map(struct.data),
83998379 "description" => struct.description,
8400- "encoding" => struct.encoding && EncodingWithFacet.to_map(struct.encoding),
8380+ "encoding" => EncodingWithFacet.to_map(struct.encoding),
84018381 "height" => struct.height,
84028382 "mark" => encode_mark(struct.mark),
84038383 "name" => struct.name,
@@ -8410,9 +8390,9 @@ defmodule TopLevel do
84108390 "width" => struct.width,
84118391 "layer" => struct.layer && Enum.map(struct.layer, &LayerSpec.to_map/1),
84128392 "resolve" => struct.resolve && Resolve.to_map(struct.resolve),
8413- "facet" => struct.facet && FacetMapping.to_map(struct.facet),
8414- "spec" => struct.spec && Spec.to_map(struct.spec),
8415- "repeat" => struct.repeat && Repeat.to_map(struct.repeat),
8393+ "facet" => FacetMapping.to_map(struct.facet),
8394+ "spec" => Spec.to_map(struct.spec),
8395+ "repeat" => Repeat.to_map(struct.repeat),
84168396 "vconcat" => struct.vconcat && Enum.map(struct.vconcat, &Spec.to_map/1),
84178397 "hconcat" => struct.hconcat && Enum.map(struct.hconcat, &Spec.to_map/1),
84188398 }
Mschema-flowdefault / TopLevel.js+130 −130
@@ -49,7 +49,7 @@ export type TopLevel = {
4949 /**
5050 * A key-value mapping between encoding channels and definition of fields.
5151 */
52- encoding?: EncodingWithFacet;
52+ encoding: EncodingWithFacet;
5353 /**
5454 * The height of a visualization.
5555 *
@@ -76,7 +76,7 @@ export type TopLevel = {
7676 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7777 * object](mark.html#mark-def).
7878 */
79- mark?: AnyMark;
79+ mark: AnyMark;
8080 /**
8181 * Name of the visualization for later reference.
8282 */
@@ -138,7 +138,7 @@ export type TopLevel = {
138138 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
139139 * layering facet specifications is not allowed.
140140 */
141- layer?: LayerSpec[];
141+ layer: LayerSpec[];
142142 /**
143143 * Scale, axis, and legend resolutions for layers.
144144 *
@@ -155,24 +155,24 @@ export type TopLevel = {
155155 * An object that describes mappings between `row` and `column` channels and their field
156156 * definitions.
157157 */
158- facet?: FacetMapping;
158+ facet: FacetMapping;
159159 /**
160160 * A specification of the view that gets faceted.
161161 */
162- spec?: Spec;
162+ spec: Spec;
163163 /**
164164 * An object that describes what fields should be repeated into views that are laid out as a
165165 * `row` or `column`.
166166 */
167- repeat?: Repeat;
167+ repeat: Repeat;
168168 /**
169169 * A list of views that should be concatenated and put into a column.
170170 */
171- vconcat?: Spec[];
171+ vconcat: Spec[];
172172 /**
173173 * A list of views that should be concatenated and put into a row.
174174 */
175- hconcat?: Spec[];
175+ hconcat: Spec[];
176176 };
177177
178178 /**
@@ -1827,8 +1827,8 @@ export type RangeConfigValue = TitleFontWeight[] | RangeConfigValueVGScheme;
18271827 export type RangeConfigValueVGScheme = {
18281828 count?: number;
18291829 extent?: number[];
1830- scheme?: string;
1831- step?: number;
1830+ scheme: string;
1831+ step: number;
18321832 };
18331833
18341834 /**
@@ -2295,7 +2295,7 @@ export type SingleSelectionConfig = {
22952295 export type VGBinding = {
22962296 element?: string;
22972297 input: string;
2298- options?: string[];
2298+ options: string[];
22992299 max?: number;
23002300 min?: number;
23012301 step?: number;
@@ -3052,18 +3052,18 @@ export type Data = {
30523052 * An URL from which to load the data set. Use the `format.type` property
30533053 * to ensure the loaded data is correctly parsed.
30543054 */
3055- url?: string;
3055+ url: string;
30563056 /**
30573057 * The full data set, included inline. This can be an array of objects or primitive values
30583058 * or a string.
30593059 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
30603060 * parsed according to the specified format type.
30613061 */
3062- values?: Values;
3062+ values: Values;
30633063 /**
30643064 * Provide a placeholder name and bind data at runtime.
30653065 */
3066- name?: string;
3066+ name: string;
30673067 };
30683068
30693069 /**
@@ -3362,7 +3362,7 @@ export type MarkPropDefWithCondition = {
33623362 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
33633363 * [geographic projection](projection.html) is applied.
33643364 */
3365- type?: Type;
3365+ type: Type;
33663366 /**
33673367 * A constant value in visual domain.
33683368 */
@@ -3468,7 +3468,7 @@ export type BinParams = {
34683468 export type ColorCondition = ConditionalValueDef[] | ConditionalPredicateMarkPropFieldDefClass;
34693469
34703470 export type ConditionalValueDef = {
3471- test?: LogicalOperandPredicate;
3471+ test: LogicalOperandPredicate;
34723472 /**
34733473 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
34743474 * `0` to `1` for opacity).
@@ -3478,13 +3478,13 @@ export type ConditionalValueDef = {
34783478 * A [selection name](selection.html), or a series of [composed
34793479 * selections](selection.html#compose).
34803480 */
3481- selection?: SelectionOperand;
3481+ selection: SelectionOperand;
34823482 };
34833483
34843484 export type Selection = {
3485- not?: SelectionOperand;
3486- and?: SelectionOperand[];
3487- or?: SelectionOperand[];
3485+ not: SelectionOperand;
3486+ and: SelectionOperand[];
3487+ or: SelectionOperand[];
34883488 };
34893489
34903490 /**
@@ -3496,19 +3496,19 @@ export type Selection = {
34963496 export type SelectionOperand = Selection | string;
34973497
34983498 export type Predicate = {
3499- not?: LogicalOperandPredicate;
3500- and?: LogicalOperandPredicate[];
3501- or?: LogicalOperandPredicate[];
3499+ not: LogicalOperandPredicate;
3500+ and: LogicalOperandPredicate[];
3501+ or: LogicalOperandPredicate[];
35023502 /**
35033503 * The value that the field should be equal to.
35043504 */
3505- equal?: Equal;
3505+ equal: Equal;
35063506 /**
35073507 * Field to be filtered.
35083508 *
35093509 * Field to be filtered
35103510 */
3511- field?: string;
3511+ field: string;
35123512 /**
35133513 * Time unit for the field to be filtered.
35143514 *
@@ -3519,16 +3519,16 @@ export type Predicate = {
35193519 * An array of inclusive minimum and maximum values
35203520 * for a field value of a data item to be included in the filtered data.
35213521 */
3522- range?: RangeElement[];
3522+ range: RangeElement[];
35233523 /**
35243524 * A set of values that the `field`'s value should be a member of,
35253525 * for a data item included in the filtered data.
35263526 */
3527- oneOf?: Equal[];
3527+ oneOf: Equal[];
35283528 /**
35293529 * Filter using a selection name.
35303530 */
3531- selection?: SelectionOperand;
3531+ selection: SelectionOperand;
35323532 };
35333533
35343534 /**
@@ -3689,17 +3689,17 @@ export type TimeUnit =
36893689 export type ConditionalValueDefValue = boolean | number | string;
36903690
36913691 export type ConditionalPredicateMarkPropFieldDefClass = {
3692- test?: LogicalOperandPredicate;
3692+ test: LogicalOperandPredicate;
36933693 /**
36943694 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
36953695 * `0` to `1` for opacity).
36963696 */
3697- value?: ConditionalValueDefValue;
3697+ value: ConditionalValueDefValue;
36983698 /**
36993699 * A [selection name](selection.html), or a series of [composed
37003700 * selections](selection.html#compose).
37013701 */
3702- selection?: SelectionOperand;
3702+ selection: SelectionOperand;
37033703 /**
37043704 * Aggregation function for the field
37053705 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -3765,7 +3765,7 @@ export type ConditionalPredicateMarkPropFieldDefClass = {
37653765 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
37663766 * [geographic projection](projection.html) is applied.
37673767 */
3768- type?: Type;
3768+ type: Type;
37693769 };
37703770
37713771 export type Field = RepeatRef | string;
@@ -4540,7 +4540,7 @@ export type DefWithCondition = {
45404540 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
45414541 * [geographic projection](projection.html) is applied.
45424542 */
4543- type?: Type;
4543+ type: Type;
45444544 /**
45454545 * A constant value in visual domain.
45464546 */
@@ -4550,17 +4550,17 @@ export type DefWithCondition = {
45504550 export type HrefCondition = ConditionalValueDef[] | ConditionalPredicateFieldDefClass;
45514551
45524552 export type ConditionalPredicateFieldDefClass = {
4553- test?: LogicalOperandPredicate;
4553+ test: LogicalOperandPredicate;
45544554 /**
45554555 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
45564556 * `0` to `1` for opacity).
45574557 */
4558- value?: ConditionalValueDefValue;
4558+ value: ConditionalValueDefValue;
45594559 /**
45604560 * A [selection name](selection.html), or a series of [composed
45614561 * selections](selection.html#compose).
45624562 */
4563- selection?: SelectionOperand;
4563+ selection: SelectionOperand;
45644564 /**
45654565 * Aggregation function for the field
45664566 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4602,7 +4602,7 @@ export type ConditionalPredicateFieldDefClass = {
46024602 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
46034603 * [geographic projection](projection.html) is applied.
46044604 */
4605- type?: Type;
4605+ type: Type;
46064606 };
46074607
46084608 export type Order = OrderFieldDef[] | OrderFieldDef;
@@ -4731,7 +4731,7 @@ export type TextDefWithCondition = {
47314731 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
47324732 * [geographic projection](projection.html) is applied.
47334733 */
4734- type?: Type;
4734+ type: Type;
47354735 /**
47364736 * A constant value in visual domain.
47374737 */
@@ -4741,17 +4741,17 @@ export type TextDefWithCondition = {
47414741 export type TextCondition = ConditionalValueDef[] | ConditionalPredicateTextFieldDefClass;
47424742
47434743 export type ConditionalPredicateTextFieldDefClass = {
4744- test?: LogicalOperandPredicate;
4744+ test: LogicalOperandPredicate;
47454745 /**
47464746 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
47474747 * `0` to `1` for opacity).
47484748 */
4749- value?: ConditionalValueDefValue;
4749+ value: ConditionalValueDefValue;
47504750 /**
47514751 * A [selection name](selection.html), or a series of [composed
47524752 * selections](selection.html#compose).
47534753 */
4754- selection?: SelectionOperand;
4754+ selection: SelectionOperand;
47554755 /**
47564756 * Aggregation function for the field
47574757 * (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4798,7 +4798,7 @@ export type ConditionalPredicateTextFieldDefClass = {
47984798 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
47994799 * [geographic projection](projection.html) is applied.
48004800 */
4801- type?: Type;
4801+ type: Type;
48024802 };
48034803
48044804 /**
@@ -4897,12 +4897,12 @@ export type XClass = {
48974897 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
48984898 * [geographic projection](projection.html) is applied.
48994899 */
4900- type?: Type;
4900+ type: Type;
49014901 /**
49024902 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
49034903 * `0` to `1` for opacity).
49044904 */
4905- value?: ConditionalValueDefValue;
4905+ value: ConditionalValueDefValue;
49064906 };
49074907
49084908 export type Axis = {
@@ -5125,12 +5125,12 @@ export type X2Class = {
51255125 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
51265126 * [geographic projection](projection.html) is applied.
51275127 */
5128- type?: Type;
5128+ type: Type;
51295129 /**
51305130 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
51315131 * `0` to `1` for opacity).
51325132 */
5133- value?: ConditionalValueDefValue;
5133+ value: ConditionalValueDefValue;
51345134 };
51355135
51365136 /**
@@ -5186,7 +5186,7 @@ export type Spec = {
51865186 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
51875187 * layering facet specifications is not allowed.
51885188 */
5189- layer?: LayerSpec[];
5189+ layer: LayerSpec[];
51905190 /**
51915191 * Name of the visualization for later reference.
51925192 */
@@ -5237,14 +5237,14 @@ export type Spec = {
52375237 /**
52385238 * A key-value mapping between encoding channels and definition of fields.
52395239 */
5240- encoding?: Encoding;
5240+ encoding: Encoding;
52415241 /**
52425242 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
52435243 * `"line"`,
52445244 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
52455245 * object](mark.html#mark-def).
52465246 */
5247- mark?: AnyMark;
5247+ mark: AnyMark;
52485248 /**
52495249 * An object defining properties of geographic projection.
52505250 *
@@ -5260,24 +5260,24 @@ export type Spec = {
52605260 * An object that describes mappings between `row` and `column` channels and their field
52615261 * definitions.
52625262 */
5263- facet?: FacetMapping;
5263+ facet: FacetMapping;
52645264 /**
52655265 * A specification of the view that gets faceted.
52665266 */
5267- spec?: Spec;
5267+ spec: Spec;
52685268 /**
52695269 * An object that describes what fields should be repeated into views that are laid out as a
52705270 * `row` or `column`.
52715271 */
5272- repeat?: Repeat;
5272+ repeat: Repeat;
52735273 /**
52745274 * A list of views that should be concatenated and put into a column.
52755275 */
5276- vconcat?: Spec[];
5276+ vconcat: Spec[];
52775277 /**
52785278 * A list of views that should be concatenated and put into a row.
52795279 */
5280- hconcat?: Spec[];
5280+ hconcat: Spec[];
52815281 };
52825282
52835283 /**
@@ -5402,7 +5402,7 @@ export type LayerSpec = {
54025402 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
54035403 * layering facet specifications is not allowed.
54045404 */
5405- layer?: LayerSpec[];
5405+ layer: LayerSpec[];
54065406 /**
54075407 * Name of the visualization for later reference.
54085408 */
@@ -5445,14 +5445,14 @@ export type LayerSpec = {
54455445 /**
54465446 * A key-value mapping between encoding channels and definition of fields.
54475447 */
5448- encoding?: Encoding;
5448+ encoding: Encoding;
54495449 /**
54505450 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
54515451 * `"line"`,
54525452 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
54535453 * object](mark.html#mark-def).
54545454 */
5455- mark?: AnyMark;
5455+ mark: AnyMark;
54565456 /**
54575457 * An object defining properties of geographic projection.
54585458 *
@@ -5995,7 +5995,7 @@ export type Transform = {
59955995 * (3) a [selection predicate](filter.html#selection-predicate);
59965996 * or (4) a logical operand that combines (1), (2), or (3).
59975997 */
5998- filter?: LogicalOperandPredicate;
5998+ filter: LogicalOperandPredicate;
59995999 /**
60006000 * The field for storing the computed formula value.
60016001 *
@@ -6013,7 +6013,7 @@ export type Transform = {
60136013 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
60146014 * current data object.
60156015 */
6016- calculate?: string;
6016+ calculate: string;
60176017 /**
60186018 * The default value to use if lookup fails.
60196019 *
@@ -6023,29 +6023,29 @@ export type Transform = {
60236023 /**
60246024 * Secondary data reference.
60256025 */
6026- from?: LookupData;
6026+ from: LookupData;
60276027 /**
60286028 * Key in primary data source.
60296029 */
6030- lookup?: string;
6030+ lookup: string;
60316031 /**
60326032 * An object indicating bin properties, or simply `true` for using default bin parameters.
60336033 */
6034- bin?: Bin;
6034+ bin: Bin;
60356035 /**
60366036 * The data field to bin.
60376037 *
60386038 * The data field to apply time unit.
60396039 */
6040- field?: string;
6040+ field: string;
60416041 /**
60426042 * The timeUnit.
60436043 */
6044- timeUnit?: TimeUnit;
6044+ timeUnit: TimeUnit;
60456045 /**
60466046 * Array of objects that define fields to aggregate.
60476047 */
6048- aggregate?: AggregatedFieldDef[];
6048+ aggregate: AggregatedFieldDef[];
60496049 /**
60506050 * The data fields to group by. If not specified, a single group containing all data objects
60516051 * will be used.
@@ -6276,9 +6276,9 @@ const typeMap: any = {
62766276 { json: "config", js: "config", typ: u(undefined, r("Config")) },
62776277 { json: "data", js: "data", typ: u(undefined, r("Data")) },
62786278 { json: "description", js: "description", typ: u(undefined, "") },
6279- { json: "encoding", js: "encoding", typ: u(undefined, r("EncodingWithFacet")) },
6279+ { json: "encoding", js: "encoding", typ: r("EncodingWithFacet") },
62806280 { json: "height", js: "height", typ: u(undefined, 3.14) },
6281- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
6281+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
62826282 { json: "name", js: "name", typ: u(undefined, "") },
62836283 { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
62846284 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
@@ -6286,13 +6286,13 @@ const typeMap: any = {
62866286 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
62876287 { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
62886288 { json: "width", js: "width", typ: u(undefined, 3.14) },
6289- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
6289+ { json: "layer", js: "layer", typ: a(r("LayerSpec")) },
62906290 { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
6291- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
6292- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
6293- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
6294- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
6295- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
6291+ { json: "facet", js: "facet", typ: r("FacetMapping") },
6292+ { json: "spec", js: "spec", typ: r("Spec") },
6293+ { json: "repeat", js: "repeat", typ: r("Repeat") },
6294+ { json: "vconcat", js: "vconcat", typ: a(r("Spec")) },
6295+ { json: "hconcat", js: "hconcat", typ: a(r("Spec")) },
62966296 ], false),
62976297 "AutoSizeParams": o([
62986298 { json: "contains", js: "contains", typ: u(undefined, r("Contains")) },
@@ -6566,8 +6566,8 @@ const typeMap: any = {
65666566 "RangeConfigValueVGScheme": o([
65676567 { json: "count", js: "count", typ: u(undefined, 3.14) },
65686568 { json: "extent", js: "extent", typ: u(undefined, a(3.14)) },
6569- { json: "scheme", js: "scheme", typ: u(undefined, "") },
6570- { json: "step", js: "step", typ: u(undefined, 3.14) },
6569+ { json: "scheme", js: "scheme", typ: "" },
6570+ { json: "step", js: "step", typ: 3.14 },
65716571 ], false),
65726572 "ScaleConfig": o([
65736573 { json: "bandPaddingInner", js: "bandPaddingInner", typ: u(undefined, 3.14) },
@@ -6636,7 +6636,7 @@ const typeMap: any = {
66366636 "VGBinding": o([
66376637 { json: "element", js: "element", typ: u(undefined, "") },
66386638 { json: "input", js: "input", typ: "" },
6639- { json: "options", js: "options", typ: u(undefined, a("")) },
6639+ { json: "options", js: "options", typ: a("") },
66406640 { json: "max", js: "max", typ: u(undefined, 3.14) },
66416641 { json: "min", js: "min", typ: u(undefined, 3.14) },
66426642 { json: "step", js: "step", typ: u(undefined, 3.14) },
@@ -6764,9 +6764,9 @@ const typeMap: any = {
67646764 ], false),
67656765 "Data": o([
67666766 { json: "format", js: "format", typ: u(undefined, r("DataFormat")) },
6767- { json: "url", js: "url", typ: u(undefined, "") },
6768- { json: "values", js: "values", typ: u(undefined, u(a(u(true, 3.14, m("any"), "")), m("any"), "")) },
6769- { json: "name", js: "name", typ: u(undefined, "") },
6767+ { json: "url", js: "url", typ: "" },
6768+ { json: "values", js: "values", typ: u(a(u(true, 3.14, m("any"), "")), m("any"), "") },
6769+ { json: "name", js: "name", typ: "" },
67706770 ], false),
67716771 "DataFormat": o([
67726772 { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
@@ -6801,7 +6801,7 @@ const typeMap: any = {
68016801 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
68026802 { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
68036803 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6804- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6804+ { json: "type", js: "type", typ: r("Type") },
68056805 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
68066806 ], false),
68076807 "BinParams": o([
@@ -6815,25 +6815,25 @@ const typeMap: any = {
68156815 { json: "steps", js: "steps", typ: u(undefined, a(3.14)) },
68166816 ], false),
68176817 "ConditionalValueDef": o([
6818- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
6818+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
68196819 { json: "value", js: "value", typ: u(true, 3.14, "") },
6820- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
6820+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
68216821 ], false),
68226822 "Selection": o([
6823- { json: "not", js: "not", typ: u(undefined, u(r("Selection"), "")) },
6824- { json: "and", js: "and", typ: u(undefined, a(u(r("Selection"), ""))) },
6825- { json: "or", js: "or", typ: u(undefined, a(u(r("Selection"), ""))) },
6823+ { json: "not", js: "not", typ: u(r("Selection"), "") },
6824+ { json: "and", js: "and", typ: a(u(r("Selection"), "")) },
6825+ { json: "or", js: "or", typ: a(u(r("Selection"), "")) },
68266826 ], false),
68276827 "Predicate": o([
6828- { json: "not", js: "not", typ: u(undefined, u(r("Predicate"), "")) },
6829- { json: "and", js: "and", typ: u(undefined, a(u(r("Predicate"), ""))) },
6830- { json: "or", js: "or", typ: u(undefined, a(u(r("Predicate"), ""))) },
6831- { json: "equal", js: "equal", typ: u(undefined, u(true, r("DateTime"), 3.14, "")) },
6832- { json: "field", js: "field", typ: u(undefined, "") },
6828+ { json: "not", js: "not", typ: u(r("Predicate"), "") },
6829+ { json: "and", js: "and", typ: a(u(r("Predicate"), "")) },
6830+ { json: "or", js: "or", typ: a(u(r("Predicate"), "")) },
6831+ { json: "equal", js: "equal", typ: u(true, r("DateTime"), 3.14, "") },
6832+ { json: "field", js: "field", typ: "" },
68336833 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6834- { json: "range", js: "range", typ: u(undefined, a(u(r("DateTime"), 3.14, null))) },
6835- { json: "oneOf", js: "oneOf", typ: u(undefined, a(u(true, r("DateTime"), 3.14, ""))) },
6836- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
6834+ { json: "range", js: "range", typ: a(u(r("DateTime"), 3.14, null)) },
6835+ { json: "oneOf", js: "oneOf", typ: a(u(true, r("DateTime"), 3.14, "")) },
6836+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
68376837 ], false),
68386838 "DateTime": o([
68396839 { json: "date", js: "date", typ: u(undefined, 3.14) },
@@ -6848,9 +6848,9 @@ const typeMap: any = {
68486848 { json: "year", js: "year", typ: u(undefined, 3.14) },
68496849 ], false),
68506850 "ConditionalPredicateMarkPropFieldDefClass": o([
6851- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
6852- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
6853- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
6851+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
6852+ { json: "value", js: "value", typ: u(true, 3.14, "") },
6853+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
68546854 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
68556855 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
68566856 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
@@ -6858,7 +6858,7 @@ const typeMap: any = {
68586858 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
68596859 { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
68606860 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6861- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6861+ { json: "type", js: "type", typ: r("Type") },
68626862 ], false),
68636863 "RepeatRef": o([
68646864 { json: "repeat", js: "repeat", typ: r("RepeatEnum") },
@@ -6941,18 +6941,18 @@ const typeMap: any = {
69416941 { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateFieldDefClass"))) },
69426942 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69436943 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6944- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6944+ { json: "type", js: "type", typ: r("Type") },
69456945 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
69466946 ], false),
69476947 "ConditionalPredicateFieldDefClass": o([
6948- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
6949- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
6950- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
6948+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
6949+ { json: "value", js: "value", typ: u(true, 3.14, "") },
6950+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
69516951 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69526952 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69536953 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69546954 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6955- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6955+ { json: "type", js: "type", typ: r("Type") },
69566956 ], false),
69576957 "OrderFieldDef": o([
69586958 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
@@ -6969,19 +6969,19 @@ const typeMap: any = {
69696969 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69706970 { json: "format", js: "format", typ: u(undefined, "") },
69716971 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6972- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6972+ { json: "type", js: "type", typ: r("Type") },
69736973 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
69746974 ], false),
69756975 "ConditionalPredicateTextFieldDefClass": o([
6976- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
6977- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
6978- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
6976+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
6977+ { json: "value", js: "value", typ: u(true, 3.14, "") },
6978+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
69796979 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
69806980 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
69816981 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
69826982 { json: "format", js: "format", typ: u(undefined, "") },
69836983 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6984- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6984+ { json: "type", js: "type", typ: r("Type") },
69856985 ], false),
69866986 "XClass": o([
69876987 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
@@ -6992,8 +6992,8 @@ const typeMap: any = {
69926992 { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
69936993 { json: "stack", js: "stack", typ: u(undefined, u(r("StackOffset"), null)) },
69946994 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
6995- { json: "type", js: "type", typ: u(undefined, r("Type")) },
6996- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
6995+ { json: "type", js: "type", typ: r("Type") },
6996+ { json: "value", js: "value", typ: u(true, 3.14, "") },
69976997 ], false),
69986998 "Axis": o([
69996999 { json: "domain", js: "domain", typ: u(undefined, true) },
@@ -7024,8 +7024,8 @@ const typeMap: any = {
70247024 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
70257025 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
70267026 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7027- { json: "type", js: "type", typ: u(undefined, r("Type")) },
7028- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
7027+ { json: "type", js: "type", typ: r("Type") },
7028+ { json: "value", js: "value", typ: u(true, 3.14, "") },
70297029 ], false),
70307030 "FacetMapping": o([
70317031 { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
@@ -7035,21 +7035,21 @@ const typeMap: any = {
70357035 { json: "data", js: "data", typ: u(undefined, r("Data")) },
70367036 { json: "description", js: "description", typ: u(undefined, "") },
70377037 { json: "height", js: "height", typ: u(undefined, 3.14) },
7038- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
7038+ { json: "layer", js: "layer", typ: a(r("LayerSpec")) },
70397039 { json: "name", js: "name", typ: u(undefined, "") },
70407040 { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
70417041 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
70427042 { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
70437043 { json: "width", js: "width", typ: u(undefined, 3.14) },
7044- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
7045- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
7044+ { json: "encoding", js: "encoding", typ: r("Encoding") },
7045+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
70467046 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
70477047 { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
7048- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
7049- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
7050- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
7051- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
7052- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
7048+ { json: "facet", js: "facet", typ: r("FacetMapping") },
7049+ { json: "spec", js: "spec", typ: r("Spec") },
7050+ { json: "repeat", js: "repeat", typ: r("Repeat") },
7051+ { json: "vconcat", js: "vconcat", typ: a(r("Spec")) },
7052+ { json: "hconcat", js: "hconcat", typ: a(r("Spec")) },
70537053 ], false),
70547054 "Encoding": o([
70557055 { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) },
@@ -7070,14 +7070,14 @@ const typeMap: any = {
70707070 { json: "data", js: "data", typ: u(undefined, r("Data")) },
70717071 { json: "description", js: "description", typ: u(undefined, "") },
70727072 { json: "height", js: "height", typ: u(undefined, 3.14) },
7073- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
7073+ { json: "layer", js: "layer", typ: a(r("LayerSpec")) },
70747074 { json: "name", js: "name", typ: u(undefined, "") },
70757075 { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
70767076 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
70777077 { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
70787078 { json: "width", js: "width", typ: u(undefined, 3.14) },
7079- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
7080- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
7079+ { json: "encoding", js: "encoding", typ: r("Encoding") },
7080+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
70817081 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
70827082 { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
70837083 ], false),
@@ -7181,16 +7181,16 @@ const typeMap: any = {
71817181 { json: "text", js: "text", typ: "" },
71827182 ], false),
71837183 "Transform": o([
7184- { json: "filter", js: "filter", typ: u(undefined, u(r("Predicate"), "")) },
7184+ { json: "filter", js: "filter", typ: u(r("Predicate"), "") },
71857185 { json: "as", js: "as", typ: u(undefined, u(a(""), "")) },
7186- { json: "calculate", js: "calculate", typ: u(undefined, "") },
7186+ { json: "calculate", js: "calculate", typ: "" },
71877187 { json: "default", js: "default", typ: u(undefined, "") },
7188- { json: "from", js: "from", typ: u(undefined, r("LookupData")) },
7189- { json: "lookup", js: "lookup", typ: u(undefined, "") },
7190- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
7191- { json: "field", js: "field", typ: u(undefined, "") },
7192- { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
7193- { json: "aggregate", js: "aggregate", typ: u(undefined, a(r("AggregatedFieldDef"))) },
7188+ { json: "from", js: "from", typ: r("LookupData") },
7189+ { json: "lookup", js: "lookup", typ: "" },
7190+ { json: "bin", js: "bin", typ: u(true, r("BinParams")) },
7191+ { json: "field", js: "field", typ: "" },
7192+ { json: "timeUnit", js: "timeUnit", typ: r("TimeUnit") },
7193+ { json: "aggregate", js: "aggregate", typ: a(r("AggregatedFieldDef")) },
71947194 { json: "groupby", js: "groupby", typ: u(undefined, a("")) },
71957195 ], false),
71967196 "AggregatedFieldDef": o([
Mschema-golangdefault / quicktype.go+41 −41
@@ -47,7 +47,7 @@ type TopLevel struct {
4747 // Description of this mark for commenting purpose.
4848 Description *string `json:"description,omitempty"`
4949 // A key-value mapping between encoding channels and definition of fields.
50- Encoding *EncodingWithFacet `json:"encoding,omitempty"`
50+ Encoding EncodingWithFacet `json:"encoding"`
5151 // The height of a visualization.
5252 //
5353 // __Default value:__
@@ -116,7 +116,7 @@ type TopLevel struct {
116116 //
117117 // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
118118 // layering facet specifications is not allowed.
119- Layer []LayerSpec `json:"layer,omitempty"`
119+ Layer []LayerSpec `json:"layer"`
120120 // Scale, axis, and legend resolutions for layers.
121121 //
122122 // Scale, axis, and legend resolutions for facets.
@@ -129,16 +129,16 @@ type TopLevel struct {
129129 Resolve *Resolve `json:"resolve,omitempty"`
130130 // An object that describes mappings between `row` and `column` channels and their field
131131 // definitions.
132- Facet *FacetMapping `json:"facet,omitempty"`
132+ Facet FacetMapping `json:"facet"`
133133 // A specification of the view that gets faceted.
134- Spec *Spec `json:"spec,omitempty"`
134+ Spec Spec `json:"spec"`
135135 // An object that describes what fields should be repeated into views that are laid out as a
136136 // `row` or `column`.
137- Repeat *Repeat `json:"repeat,omitempty"`
137+ Repeat Repeat `json:"repeat"`
138138 // A list of views that should be concatenated and put into a column.
139- Vconcat []Spec `json:"vconcat,omitempty"`
139+ Vconcat []Spec `json:"vconcat"`
140140 // A list of views that should be concatenated and put into a row.
141- Hconcat []Spec `json:"hconcat,omitempty"`
141+ Hconcat []Spec `json:"hconcat"`
142142 }
143143
144144 type AutoSizeParams struct {
@@ -992,7 +992,7 @@ type ProjectionConfig struct {
992992 type VGScheme struct {
993993 Count *float64 `json:"count,omitempty"`
994994 Extent []float64 `json:"extent,omitempty"`
995- Scheme *string `json:"scheme,omitempty"`
995+ Scheme string `json:"scheme"`
996996 Step *float64 `json:"step,omitempty"`
997997 }
998998
@@ -1274,7 +1274,7 @@ type SingleSelectionConfig struct {
12741274 type VGBinding struct {
12751275 Element *string `json:"element,omitempty"`
12761276 Input string `json:"input"`
1277- Options []string `json:"options,omitempty"`
1277+ Options []string `json:"options"`
12781278 Max *float64 `json:"max,omitempty"`
12791279 Min *float64 `json:"min,omitempty"`
12801280 Step *float64 `json:"step,omitempty"`
@@ -1752,14 +1752,14 @@ type Data struct {
17521752 Format *DataFormat `json:"format,omitempty"`
17531753 // An URL from which to load the data set. Use the `format.type` property
17541754 // to ensure the loaded data is correctly parsed.
1755- URL *string `json:"url,omitempty"`
1755+ URL string `json:"url"`
17561756 // The full data set, included inline. This can be an array of objects or primitive values
17571757 // or a string.
17581758 // Arrays of primitive values are ingested as objects with a `data` property. Strings are
17591759 // parsed according to the specified format type.
17601760 Values *ValuesUnion `json:"values"`
17611761 // Provide a placeholder name and bind data at runtime.
1762- Name *string `json:"name,omitempty"`
1762+ Name string `json:"name"`
17631763 }
17641764
17651765 // An object that specifies the format for parsing the data file.
@@ -1968,7 +1968,7 @@ type MarkPropDefWithCondition struct {
19681968 // `"nominal"`).
19691969 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
19701970 // [geographic projection](projection.html) is applied.
1971- Type *Type `json:"type,omitempty"`
1971+ Type Type `json:"type"`
19721972 // A constant value in visual domain.
19731973 Value *ConditionalValueDefValue `json:"value"`
19741974 }
@@ -2018,30 +2018,30 @@ type ConditionalValueDef struct {
20182018
20192019 type Selection struct {
20202020 Not *SelectionOperand `json:"not"`
2021- And []SelectionOperand `json:"and,omitempty"`
2022- Or []SelectionOperand `json:"or,omitempty"`
2021+ And []SelectionOperand `json:"and"`
2022+ Or []SelectionOperand `json:"or"`
20232023 }
20242024
20252025 type Predicate struct {
20262026 Not *LogicalOperandPredicate `json:"not"`
2027- And []LogicalOperandPredicate `json:"and,omitempty"`
2028- Or []LogicalOperandPredicate `json:"or,omitempty"`
2027+ And []LogicalOperandPredicate `json:"and"`
2028+ Or []LogicalOperandPredicate `json:"or"`
20292029 // The value that the field should be equal to.
20302030 Equal *Equal `json:"equal"`
20312031 // Field to be filtered.
20322032 //
20332033 // Field to be filtered
2034- Field *string `json:"field,omitempty"`
2034+ Field string `json:"field"`
20352035 // Time unit for the field to be filtered.
20362036 //
20372037 // time unit for the field to be filtered.
20382038 TimeUnit *TimeUnit `json:"timeUnit,omitempty"`
20392039 // An array of inclusive minimum and maximum values
20402040 // for a field value of a data item to be included in the filtered data.
2041- Range []RangeElement `json:"range,omitempty"`
2041+ Range []RangeElement `json:"range"`
20422042 // A set of values that the `field`'s value should be a member of,
20432043 // for a data item included in the filtered data.
2044- OneOf []Equal `json:"oneOf,omitempty"`
2044+ OneOf []Equal `json:"oneOf"`
20452045 // Filter using a selection name.
20462046 Selection *SelectionOperand `json:"selection"`
20472047 }
@@ -2137,7 +2137,7 @@ type ConditionalPredicateMarkPropFieldDefClass struct {
21372137 // `"nominal"`).
21382138 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
21392139 // [geographic projection](projection.html) is applied.
2140- Type *Type `json:"type,omitempty"`
2140+ Type Type `json:"type"`
21412141 }
21422142
21432143 // Reference to a repeated value.
@@ -2597,7 +2597,7 @@ type DefWithCondition struct {
25972597 // `"nominal"`).
25982598 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
25992599 // [geographic projection](projection.html) is applied.
2600- Type *Type `json:"type,omitempty"`
2600+ Type Type `json:"type"`
26012601 // A constant value in visual domain.
26022602 Value *ConditionalValueDefValue `json:"value"`
26032603 }
@@ -2641,7 +2641,7 @@ type ConditionalPredicateFieldDefClass struct {
26412641 // `"nominal"`).
26422642 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
26432643 // [geographic projection](projection.html) is applied.
2644- Type *Type `json:"type,omitempty"`
2644+ Type Type `json:"type"`
26452645 }
26462646
26472647 type OrderFieldDef struct {
@@ -2740,7 +2740,7 @@ type TextDefWithCondition struct {
27402740 // `"nominal"`).
27412741 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
27422742 // [geographic projection](projection.html) is applied.
2743- Type *Type `json:"type,omitempty"`
2743+ Type Type `json:"type"`
27442744 // A constant value in visual domain.
27452745 Value *ConditionalValueDefValue `json:"value"`
27462746 }
@@ -2787,7 +2787,7 @@ type ConditionalPredicateTextFieldDefClass struct {
27872787 // `"nominal"`).
27882788 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
27892789 // [geographic projection](projection.html) is applied.
2790- Type *Type `json:"type,omitempty"`
2790+ Type Type `json:"type"`
27912791 }
27922792
27932793 // X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
@@ -2866,7 +2866,7 @@ type XClass struct {
28662866 // `"nominal"`).
28672867 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
28682868 // [geographic projection](projection.html) is applied.
2869- Type *Type `json:"type,omitempty"`
2869+ Type Type `json:"type"`
28702870 // A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
28712871 // `0` to `1` for opacity).
28722872 Value *ConditionalValueDefValue `json:"value"`
@@ -3034,7 +3034,7 @@ type X2Class struct {
30343034 // `"nominal"`).
30353035 // It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
30363036 // [geographic projection](projection.html) is applied.
3037- Type *Type `json:"type,omitempty"`
3037+ Type Type `json:"type"`
30383038 // A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
30393039 // `0` to `1` for opacity).
30403040 Value *ConditionalValueDefValue `json:"value"`
@@ -3077,7 +3077,7 @@ type Spec struct {
30773077 //
30783078 // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
30793079 // layering facet specifications is not allowed.
3080- Layer []LayerSpec `json:"layer,omitempty"`
3080+ Layer []LayerSpec `json:"layer"`
30813081 // Name of the visualization for later reference.
30823082 Name *string `json:"name,omitempty"`
30833083 // Scale, axis, and legend resolutions for layers.
@@ -3116,7 +3116,7 @@ type Spec struct {
31163116 // __See also:__ The documentation for [width and height](size.html) contains more examples.
31173117 Width *float64 `json:"width,omitempty"`
31183118 // A key-value mapping between encoding channels and definition of fields.
3119- Encoding *Encoding `json:"encoding,omitempty"`
3119+ Encoding Encoding `json:"encoding"`
31203120 // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
31213121 // `"line"`,
31223122 // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
@@ -3131,16 +3131,16 @@ type Spec struct {
31313131 Selection map[string]SelectionDef `json:"selection,omitempty"`
31323132 // An object that describes mappings between `row` and `column` channels and their field
31333133 // definitions.
3134- Facet *FacetMapping `json:"facet,omitempty"`
3134+ Facet FacetMapping `json:"facet"`
31353135 // A specification of the view that gets faceted.
3136- Spec *Spec `json:"spec,omitempty"`
3136+ Spec Spec `json:"spec"`
31373137 // An object that describes what fields should be repeated into views that are laid out as a
31383138 // `row` or `column`.
3139- Repeat *Repeat `json:"repeat,omitempty"`
3139+ Repeat Repeat `json:"repeat"`
31403140 // A list of views that should be concatenated and put into a column.
3141- Vconcat []Spec `json:"vconcat,omitempty"`
3141+ Vconcat []Spec `json:"vconcat"`
31423142 // A list of views that should be concatenated and put into a row.
3143- Hconcat []Spec `json:"hconcat,omitempty"`
3143+ Hconcat []Spec `json:"hconcat"`
31443144 }
31453145
31463146 // A key-value mapping between encoding channels and definition of fields.
@@ -3227,7 +3227,7 @@ type LayerSpec struct {
32273227 //
32283228 // __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
32293229 // layering facet specifications is not allowed.
3230- Layer []LayerSpec `json:"layer,omitempty"`
3230+ Layer []LayerSpec `json:"layer"`
32313231 // Name of the visualization for later reference.
32323232 Name *string `json:"name,omitempty"`
32333233 // Scale, axis, and legend resolutions for layers.
@@ -3258,7 +3258,7 @@ type LayerSpec struct {
32583258 // __See also:__ The documentation for [width and height](size.html) contains more examples.
32593259 Width *float64 `json:"width,omitempty"`
32603260 // A key-value mapping between encoding channels and definition of fields.
3261- Encoding *Encoding `json:"encoding,omitempty"`
3261+ Encoding Encoding `json:"encoding"`
32623262 // A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
32633263 // `"line"`,
32643264 // * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
@@ -3624,25 +3624,25 @@ type Transform struct {
36243624 As *Style `json:"as"`
36253625 // A [expression](types.html#expression) string. Use the variable `datum` to refer to the
36263626 // current data object.
3627- Calculate *string `json:"calculate,omitempty"`
3627+ Calculate string `json:"calculate"`
36283628 // The default value to use if lookup fails.
36293629 //
36303630 // __Default value:__ `null`
36313631 Default *string `json:"default,omitempty"`
36323632 // Secondary data reference.
3633- From *LookupData `json:"from,omitempty"`
3633+ From LookupData `json:"from"`
36343634 // Key in primary data source.
3635- Lookup *string `json:"lookup,omitempty"`
3635+ Lookup string `json:"lookup"`
36363636 // An object indicating bin properties, or simply `true` for using default bin parameters.
36373637 Bin *Bin `json:"bin"`
36383638 // The data field to bin.
36393639 //
36403640 // The data field to apply time unit.
3641- Field *string `json:"field,omitempty"`
3641+ Field string `json:"field"`
36423642 // The timeUnit.
3643- TimeUnit *TimeUnit `json:"timeUnit,omitempty"`
3643+ TimeUnit TimeUnit `json:"timeUnit"`
36443644 // Array of objects that define fields to aggregate.
3645- Aggregate []AggregatedFieldDef `json:"aggregate,omitempty"`
3645+ Aggregate []AggregatedFieldDef `json:"aggregate"`
36463646 // The data fields to group by. If not specified, a single group containing all data objects
36473647 // will be used.
36483648 Groupby []string `json:"groupby,omitempty"`
Mschema-haskelldefault / QuickType.hs+128 −128
@@ -299,9 +299,9 @@ data QuickType = QuickType
299299 , configQuickType :: Maybe Config
300300 , quickTypeDataQuickType :: Maybe Data
301301 , descriptionQuickType :: Maybe Text
302- , encodingQuickType :: Maybe EncodingWithFacet
302+ , encodingQuickType :: EncodingWithFacet
303303 , heightQuickType :: Maybe Float
304- , markQuickType :: Maybe AnyMark
304+ , markQuickType :: AnyMark
305305 , nameQuickType :: Maybe Text
306306 , paddingQuickType :: Maybe Padding
307307 , projectionQuickType :: Maybe Projection
@@ -309,13 +309,13 @@ data QuickType = QuickType
309309 , titleQuickType :: Maybe Title
310310 , transformQuickType :: Maybe ([Transform])
311311 , widthQuickType :: Maybe Float
312- , layerQuickType :: Maybe ([LayerSpec])
312+ , layerQuickType :: [LayerSpec]
313313 , resolveQuickType :: Maybe Resolve
314- , facetQuickType :: Maybe FacetMapping
315- , specQuickType :: Maybe Spec
316- , repeatQuickType :: Maybe Repeat
317- , vconcatQuickType :: Maybe ([Spec])
318- , hconcatQuickType :: Maybe ([Spec])
314+ , facetQuickType :: FacetMapping
315+ , specQuickType :: Spec
316+ , repeatQuickType :: Repeat
317+ , vconcatQuickType :: [Spec]
318+ , hconcatQuickType :: [Spec]
319319 } deriving (Show)
320320
321321 {-| Sets how the visualization size should be determined. If a string, should be one of
@@ -2106,7 +2106,7 @@ data RangeConfigValue
21062106 data VGScheme = VGScheme
21072107 { countVGScheme :: Maybe Float
21082108 , extentVGScheme :: Maybe ([Float])
2109- , schemeVGScheme :: Maybe Text
2109+ , schemeVGScheme :: Text
21102110 , stepVGScheme :: Maybe Float
21112111 } deriving (Show)
21122112
@@ -2571,7 +2571,7 @@ data SingleSelectionConfig = SingleSelectionConfig
25712571 data VGBinding = VGBinding
25722572 { elementVGBinding :: Maybe Text
25732573 , inputVGBinding :: Text
2574- , optionsVGBinding :: Maybe ([Text])
2574+ , optionsVGBinding :: [Text]
25752575 , maxVGBinding :: Maybe Float
25762576 , minVGBinding :: Maybe Float
25772577 , stepVGBinding :: Maybe Float
@@ -3325,7 +3325,7 @@ data MarkPropDefWithCondition = MarkPropDefWithCondition
33253325 , scaleMarkPropDefWithCondition :: Maybe Scale
33263326 , sortMarkPropDefWithCondition :: Maybe SortUnion
33273327 , timeUnitMarkPropDefWithCondition :: Maybe TimeUnit
3328- , markPropDefWithConditionTypeMarkPropDefWithCondition :: Maybe Type
3328+ , markPropDefWithConditionTypeMarkPropDefWithCondition :: Type
33293329 , valueMarkPropDefWithCondition :: Maybe ConditionalValueDefValue
33303330 } deriving (Show)
33313331
@@ -3441,15 +3441,15 @@ A [selection name](selection.html), or a series of [composed
34413441 selections](selection.html#compose).
34423442 -}
34433443 data ConditionalValueDef = ConditionalValueDef
3444- { testConditionalValueDef :: Maybe LogicalOperandPredicate
3444+ { testConditionalValueDef :: LogicalOperandPredicate
34453445 , valueConditionalValueDef :: ConditionalValueDefValue
3446- , selectionConditionalValueDef :: Maybe SelectionOperand
3446+ , selectionConditionalValueDef :: SelectionOperand
34473447 } deriving (Show)
34483448
34493449 data Selection = Selection
3450- { notSelection :: Maybe SelectionOperand
3451- , andSelection :: Maybe ([SelectionOperand])
3452- , orSelection :: Maybe ([SelectionOperand])
3450+ { notSelection :: SelectionOperand
3451+ , andSelection :: [SelectionOperand]
3452+ , orSelection :: [SelectionOperand]
34533453 } deriving (Show)
34543454
34553455 {-| Filter using a selection name.
@@ -3487,15 +3487,15 @@ selection:
34873487 Filter using a selection name.
34883488 -}
34893489 data Predicate = Predicate
3490- { notPredicate :: Maybe LogicalOperandPredicate
3491- , andPredicate :: Maybe ([LogicalOperandPredicate])
3492- , orPredicate :: Maybe ([LogicalOperandPredicate])
3493- , equalPredicate :: Maybe Equal
3494- , fieldPredicate :: Maybe Text
3490+ { notPredicate :: LogicalOperandPredicate
3491+ , andPredicate :: [LogicalOperandPredicate]
3492+ , orPredicate :: [LogicalOperandPredicate]
3493+ , equalPredicate :: Equal
3494+ , fieldPredicate :: Text
34953495 , timeUnitPredicate :: Maybe TimeUnit
3496- , rangePredicate :: Maybe ([RangeElement])
3497- , oneOfPredicate :: Maybe ([Equal])
3498- , selectionPredicate :: Maybe SelectionOperand
3496+ , rangePredicate :: [RangeElement]
3497+ , oneOfPredicate :: [Equal]
3498+ , selectionPredicate :: SelectionOperand
34993499 } deriving (Show)
35003500
35013501 {-| The `filter` property must be one of the predicate definitions:
@@ -3738,9 +3738,9 @@ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
37383738 [geographic projection](projection.html) is applied.
37393739 -}
37403740 data ConditionalPredicateMarkPropFieldDefClass = ConditionalPredicateMarkPropFieldDefClass
3741- { testConditionalPredicateMarkPropFieldDefClass :: Maybe LogicalOperandPredicate
3742- , valueConditionalPredicateMarkPropFieldDefClass :: Maybe ConditionalValueDefValue
3743- , selectionConditionalPredicateMarkPropFieldDefClass :: Maybe SelectionOperand
3741+ { testConditionalPredicateMarkPropFieldDefClass :: LogicalOperandPredicate
3742+ , valueConditionalPredicateMarkPropFieldDefClass :: ConditionalValueDefValue
3743+ , selectionConditionalPredicateMarkPropFieldDefClass :: SelectionOperand
37443744 , aggregateConditionalPredicateMarkPropFieldDefClass :: Maybe AggregateOp
37453745 , binConditionalPredicateMarkPropFieldDefClass :: Maybe Bin
37463746 , fieldConditionalPredicateMarkPropFieldDefClass :: Maybe Field
@@ -3748,7 +3748,7 @@ data ConditionalPredicateMarkPropFieldDefClass = ConditionalPredicateMarkPropFie
37483748 , scaleConditionalPredicateMarkPropFieldDefClass :: Maybe Scale
37493749 , sortConditionalPredicateMarkPropFieldDefClass :: Maybe SortUnion
37503750 , timeUnitConditionalPredicateMarkPropFieldDefClass :: Maybe TimeUnit
3751- , conditionalDefTypeConditionalPredicateMarkPropFieldDefClass :: Maybe Type
3751+ , conditionalDefTypeConditionalPredicateMarkPropFieldDefClass :: Type
37523752 } deriving (Show)
37533753
37543754 {-| The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
@@ -4558,7 +4558,7 @@ data TextDefWithCondition = TextDefWithCondition
45584558 , fieldTextDefWithCondition :: Maybe Field
45594559 , formatTextDefWithCondition :: Maybe Text
45604560 , timeUnitTextDefWithCondition :: Maybe TimeUnit
4561- , textDefWithConditionTypeTextDefWithCondition :: Maybe Type
4561+ , textDefWithConditionTypeTextDefWithCondition :: Type
45624562 , valueTextDefWithCondition :: Maybe ConditionalValueDefValue
45634563 } deriving (Show)
45644564
@@ -4617,15 +4617,15 @@ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
46174617 [geographic projection](projection.html) is applied.
46184618 -}
46194619 data ConditionalPredicateTextFieldDefClass = ConditionalPredicateTextFieldDefClass
4620- { testConditionalPredicateTextFieldDefClass :: Maybe LogicalOperandPredicate
4621- , valueConditionalPredicateTextFieldDefClass :: Maybe ConditionalValueDefValue
4622- , selectionConditionalPredicateTextFieldDefClass :: Maybe SelectionOperand
4620+ { testConditionalPredicateTextFieldDefClass :: LogicalOperandPredicate
4621+ , valueConditionalPredicateTextFieldDefClass :: ConditionalValueDefValue
4622+ , selectionConditionalPredicateTextFieldDefClass :: SelectionOperand
46234623 , aggregateConditionalPredicateTextFieldDefClass :: Maybe AggregateOp
46244624 , binConditionalPredicateTextFieldDefClass :: Maybe Bin
46254625 , fieldConditionalPredicateTextFieldDefClass :: Maybe Field
46264626 , formatConditionalPredicateTextFieldDefClass :: Maybe Text
46274627 , timeUnitConditionalPredicateTextFieldDefClass :: Maybe TimeUnit
4628- , conditionalDefTypeConditionalPredicateTextFieldDefClass :: Maybe Type
4628+ , conditionalDefTypeConditionalPredicateTextFieldDefClass :: Type
46294629 } deriving (Show)
46304630
46314631 {-| A URL to load upon mouse click.
@@ -4698,7 +4698,7 @@ data DefWithCondition = DefWithCondition
46984698 , conditionDefWithCondition :: Maybe HrefCondition
46994699 , fieldDefWithCondition :: Maybe Field
47004700 , timeUnitDefWithCondition :: Maybe TimeUnit
4701- , defWithConditionTypeDefWithCondition :: Maybe Type
4701+ , defWithConditionTypeDefWithCondition :: Type
47024702 , valueDefWithCondition :: Maybe ConditionalValueDefValue
47034703 } deriving (Show)
47044704
@@ -4753,14 +4753,14 @@ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
47534753 [geographic projection](projection.html) is applied.
47544754 -}
47554755 data ConditionalPredicateFieldDefClass = ConditionalPredicateFieldDefClass
4756- { testConditionalPredicateFieldDefClass :: Maybe LogicalOperandPredicate
4757- , valueConditionalPredicateFieldDefClass :: Maybe ConditionalValueDefValue
4758- , selectionConditionalPredicateFieldDefClass :: Maybe SelectionOperand
4756+ { testConditionalPredicateFieldDefClass :: LogicalOperandPredicate
4757+ , valueConditionalPredicateFieldDefClass :: ConditionalValueDefValue
4758+ , selectionConditionalPredicateFieldDefClass :: SelectionOperand
47594759 , aggregateConditionalPredicateFieldDefClass :: Maybe AggregateOp
47604760 , binConditionalPredicateFieldDefClass :: Maybe Bin
47614761 , fieldConditionalPredicateFieldDefClass :: Maybe Field
47624762 , timeUnitConditionalPredicateFieldDefClass :: Maybe TimeUnit
4763- , conditionalDefTypeConditionalPredicateFieldDefClass :: Maybe Type
4763+ , conditionalDefTypeConditionalPredicateFieldDefClass :: Type
47644764 } deriving (Show)
47654765
47664766 data Order
@@ -4916,8 +4916,8 @@ data XClass = XClass
49164916 , sortXClass :: Maybe SortUnion
49174917 , stackXClass :: Maybe StackOffset
49184918 , timeUnitXClass :: Maybe TimeUnit
4919- , defTypeXClass :: Maybe Type
4920- , valueXClass :: Maybe ConditionalValueDefValue
4919+ , defTypeXClass :: Type
4920+ , valueXClass :: ConditionalValueDefValue
49214921 } deriving (Show)
49224922
49234923 {-| domain:
@@ -5146,8 +5146,8 @@ data X2Class = X2Class
51465146 , binX2Class :: Maybe Bin
51475147 , fieldX2Class :: Maybe Field
51485148 , timeUnitX2Class :: Maybe TimeUnit
5149- , defTypeX2Class :: Maybe Type
5150- , valueX2Class :: Maybe ConditionalValueDefValue
5149+ , defTypeX2Class :: Type
5150+ , valueX2Class :: ConditionalValueDefValue
51515151 } deriving (Show)
51525152
51535153 {-| An object that describes mappings between `row` and `column` channels and their field
@@ -5278,21 +5278,21 @@ data Spec = Spec
52785278 { specDataSpec :: Maybe Data
52795279 , descriptionSpec :: Maybe Text
52805280 , heightSpec :: Maybe Float
5281- , layerSpec :: Maybe ([LayerSpec])
5281+ , layerSpec :: [LayerSpec]
52825282 , nameSpec :: Maybe Text
52835283 , resolveSpec :: Maybe Resolve
52845284 , titleSpec :: Maybe Title
52855285 , transformSpec :: Maybe ([Transform])
52865286 , widthSpec :: Maybe Float
5287- , encodingSpec :: Maybe Encoding
5288- , markSpec :: Maybe AnyMark
5287+ , encodingSpec :: Encoding
5288+ , markSpec :: AnyMark
52895289 , projectionSpec :: Maybe Projection
52905290 , selectionSpec :: Maybe (HashMap Text SelectionDef)
5291- , facetSpec :: Maybe FacetMapping
5292- , specSpec :: Maybe Spec
5293- , repeatSpec :: Maybe Repeat
5294- , vconcatSpec :: Maybe ([Spec])
5295- , hconcatSpec :: Maybe ([Spec])
5291+ , facetSpec :: FacetMapping
5292+ , specSpec :: Spec
5293+ , repeatSpec :: Repeat
5294+ , vconcatSpec :: [Spec]
5295+ , hconcatSpec :: [Spec]
52965296 } deriving (Show)
52975297
52985298 {-| A key-value mapping between encoding channels and definition of fields.
@@ -5467,14 +5467,14 @@ data LayerSpec = LayerSpec
54675467 { layerSpecDataLayerSpec :: Maybe Data
54685468 , descriptionLayerSpec :: Maybe Text
54695469 , heightLayerSpec :: Maybe Float
5470- , layerLayerSpec :: Maybe ([LayerSpec])
5470+ , layerLayerSpec :: [LayerSpec]
54715471 , nameLayerSpec :: Maybe Text
54725472 , resolveLayerSpec :: Maybe Resolve
54735473 , titleLayerSpec :: Maybe Title
54745474 , transformLayerSpec :: Maybe ([Transform])
54755475 , widthLayerSpec :: Maybe Float
5476- , encodingLayerSpec :: Maybe Encoding
5477- , markLayerSpec :: Maybe AnyMark
5476+ , encodingLayerSpec :: Encoding
5477+ , markLayerSpec :: AnyMark
54785478 , projectionLayerSpec :: Maybe Projection
54795479 , selectionLayerSpec :: Maybe (HashMap Text SelectionDef)
54805480 } deriving (Show)
@@ -5505,9 +5505,9 @@ Provide a placeholder name and bind data at runtime.
55055505 -}
55065506 data Data = Data
55075507 { formatData :: Maybe DataFormat
5508- , urlData :: Maybe Text
5509- , valuesData :: Maybe Values
5510- , nameData :: Maybe Text
5508+ , urlData :: Text
5509+ , valuesData :: Values
5510+ , nameData :: Text
55115511 } deriving (Show)
55125512
55135513 {-| An object that specifies the format for parsing the data file.
@@ -6174,16 +6174,16 @@ The data fields to group by. If not specified, a single group containing all dat
61746174 will be used.
61756175 -}
61766176 data Transform = Transform
6177- { filterTransform :: Maybe LogicalOperandPredicate
6177+ { filterTransform :: LogicalOperandPredicate
61786178 , transformAsTransform :: Maybe Style
6179- , calculateTransform :: Maybe Text
6179+ , calculateTransform :: Text
61806180 , transformDefaultTransform :: Maybe Text
6181- , fromTransform :: Maybe LookupData
6182- , lookupTransform :: Maybe Text
6183- , binTransform :: Maybe Bin
6184- , fieldTransform :: Maybe Text
6185- , timeUnitTransform :: Maybe TimeUnit
6186- , aggregateTransform :: Maybe ([AggregatedFieldDef])
6181+ , fromTransform :: LookupData
6182+ , lookupTransform :: Text
6183+ , binTransform :: Bin
6184+ , fieldTransform :: Text
6185+ , timeUnitTransform :: TimeUnit
6186+ , aggregateTransform :: [AggregatedFieldDef]
61876187 , groupbyTransform :: Maybe ([Text])
61886188 } deriving (Show)
61896189
@@ -6276,9 +6276,9 @@ instance FromJSON QuickType where
62766276 <*> v .:? "config"
62776277 <*> v .:? "data"
62786278 <*> v .:? "description"
6279- <*> v .:? "encoding"
6279+ <*> v .: "encoding"
62806280 <*> v .:? "height"
6281- <*> v .:? "mark"
6281+ <*> v .: "mark"
62826282 <*> v .:? "name"
62836283 <*> v .:? "padding"
62846284 <*> v .:? "projection"
@@ -6286,13 +6286,13 @@ instance FromJSON QuickType where
62866286 <*> v .:? "title"
62876287 <*> v .:? "transform"
62886288 <*> v .:? "width"
6289- <*> v .:? "layer"
6289+ <*> v .: "layer"
62906290 <*> v .:? "resolve"
6291- <*> v .:? "facet"
6292- <*> v .:? "spec"
6293- <*> v .:? "repeat"
6294- <*> v .:? "vconcat"
6295- <*> v .:? "hconcat"
6291+ <*> v .: "facet"
6292+ <*> v .: "spec"
6293+ <*> v .: "repeat"
6294+ <*> v .: "vconcat"
6295+ <*> v .: "hconcat"
62966296
62976297 instance ToJSON Autosize where
62986298 toJSON (AutoSizeParamsInAutosize x) = toJSON x
@@ -7243,7 +7243,7 @@ instance FromJSON VGScheme where
72437243 parseJSON (Object v) = VGScheme
72447244 <$> v .:? "count"
72457245 <*> v .:? "extent"
7246- <*> v .:? "scheme"
7246+ <*> v .: "scheme"
72477247 <*> v .:? "step"
72487248
72497249 instance ToJSON ScaleConfig where
@@ -7483,7 +7483,7 @@ instance FromJSON VGBinding where
74837483 parseJSON (Object v) = VGBinding
74847484 <$> v .:? "element"
74857485 <*> v .: "input"
7486- <*> v .:? "options"
7486+ <*> v .: "options"
74877487 <*> v .:? "max"
74887488 <*> v .:? "min"
74897489 <*> v .:? "step"
@@ -7781,7 +7781,7 @@ instance FromJSON MarkPropDefWithCondition where
77817781 <*> v .:? "scale"
77827782 <*> v .:? "sort"
77837783 <*> v .:? "timeUnit"
7784- <*> v .:? "type"
7784+ <*> v .: "type"
77857785 <*> v .:? "value"
77867786
77877787 instance ToJSON AggregateOp where
@@ -7882,9 +7882,9 @@ instance ToJSON ConditionalValueDef where
78827882
78837883 instance FromJSON ConditionalValueDef where
78847884 parseJSON (Object v) = ConditionalValueDef
7885- <$> v .:? "test"
7885+ <$> v .: "test"
78867886 <*> v .: "value"
7887- <*> v .:? "selection"
7887+ <*> v .: "selection"
78887888
78897889 instance ToJSON Selection where
78907890 toJSON (Selection notSelection andSelection orSelection) =
@@ -7896,9 +7896,9 @@ instance ToJSON Selection where
78967896
78977897 instance FromJSON Selection where
78987898 parseJSON (Object v) = Selection
7899- <$> v .:? "not"
7900- <*> v .:? "and"
7901- <*> v .:? "or"
7899+ <$> v .: "not"
7900+ <*> v .: "and"
7901+ <*> v .: "or"
79027902
79037903 instance ToJSON SelectionOperand where
79047904 toJSON (SelectionInSelectionOperand x) = toJSON x
@@ -7924,15 +7924,15 @@ instance ToJSON Predicate where
79247924
79257925 instance FromJSON Predicate where
79267926 parseJSON (Object v) = Predicate
7927- <$> v .:? "not"
7928- <*> v .:? "and"
7929- <*> v .:? "or"
7930- <*> v .:? "equal"
7931- <*> v .:? "field"
7927+ <$> v .: "not"
7928+ <*> v .: "and"
7929+ <*> v .: "or"
7930+ <*> v .: "equal"
7931+ <*> v .: "field"
79327932 <*> v .:? "timeUnit"
7933- <*> v .:? "range"
7934- <*> v .:? "oneOf"
7935- <*> v .:? "selection"
7933+ <*> v .: "range"
7934+ <*> v .: "oneOf"
7935+ <*> v .: "selection"
79367936
79377937 instance ToJSON LogicalOperandPredicate where
79387938 toJSON (PredicateInLogicalOperandPredicate x) = toJSON x
@@ -8130,9 +8130,9 @@ instance ToJSON ConditionalPredicateMarkPropFieldDefClass where
81308130
81318131 instance FromJSON ConditionalPredicateMarkPropFieldDefClass where
81328132 parseJSON (Object v) = ConditionalPredicateMarkPropFieldDefClass
8133- <$> v .:? "test"
8134- <*> v .:? "value"
8135- <*> v .:? "selection"
8133+ <$> v .: "test"
8134+ <*> v .: "value"
8135+ <*> v .: "selection"
81368136 <*> v .:? "aggregate"
81378137 <*> v .:? "bin"
81388138 <*> v .:? "field"
@@ -8140,7 +8140,7 @@ instance FromJSON ConditionalPredicateMarkPropFieldDefClass where
81408140 <*> v .:? "scale"
81418141 <*> v .:? "sort"
81428142 <*> v .:? "timeUnit"
8143- <*> v .:? "type"
8143+ <*> v .: "type"
81448144
81458145 instance ToJSON Type where
81468146 toJSON QuantitativeType = "quantitative"
@@ -8559,7 +8559,7 @@ instance FromJSON TextDefWithCondition where
85598559 <*> v .:? "field"
85608560 <*> v .:? "format"
85618561 <*> v .:? "timeUnit"
8562- <*> v .:? "type"
8562+ <*> v .: "type"
85638563 <*> v .:? "value"
85648564
85658565 instance ToJSON TextCondition where
@@ -8586,15 +8586,15 @@ instance ToJSON ConditionalPredicateTextFieldDefClass where
85868586
85878587 instance FromJSON ConditionalPredicateTextFieldDefClass where
85888588 parseJSON (Object v) = ConditionalPredicateTextFieldDefClass
8589- <$> v .:? "test"
8590- <*> v .:? "value"
8591- <*> v .:? "selection"
8589+ <$> v .: "test"
8590+ <*> v .: "value"
8591+ <*> v .: "selection"
85928592 <*> v .:? "aggregate"
85938593 <*> v .:? "bin"
85948594 <*> v .:? "field"
85958595 <*> v .:? "format"
85968596 <*> v .:? "timeUnit"
8597- <*> v .:? "type"
8597+ <*> v .: "type"
85988598
85998599 instance ToJSON DefWithCondition where
86008600 toJSON (DefWithCondition aggregateDefWithCondition binDefWithCondition conditionDefWithCondition fieldDefWithCondition timeUnitDefWithCondition defWithConditionTypeDefWithCondition valueDefWithCondition) =
@@ -8615,7 +8615,7 @@ instance FromJSON DefWithCondition where
86158615 <*> v .:? "condition"
86168616 <*> v .:? "field"
86178617 <*> v .:? "timeUnit"
8618- <*> v .:? "type"
8618+ <*> v .: "type"
86198619 <*> v .:? "value"
86208620
86218621 instance ToJSON HrefCondition where
@@ -8641,14 +8641,14 @@ instance ToJSON ConditionalPredicateFieldDefClass where
86418641
86428642 instance FromJSON ConditionalPredicateFieldDefClass where
86438643 parseJSON (Object v) = ConditionalPredicateFieldDefClass
8644- <$> v .:? "test"
8645- <*> v .:? "value"
8646- <*> v .:? "selection"
8644+ <$> v .: "test"
8645+ <*> v .: "value"
8646+ <*> v .: "selection"
86478647 <*> v .:? "aggregate"
86488648 <*> v .:? "bin"
86498649 <*> v .:? "field"
86508650 <*> v .:? "timeUnit"
8651- <*> v .:? "type"
8651+ <*> v .: "type"
86528652
86538653 instance ToJSON Order where
86548654 toJSON (OrderFieldDefArrayInOrder x) = toJSON x
@@ -8703,8 +8703,8 @@ instance FromJSON XClass where
87038703 <*> v .:? "sort"
87048704 <*> v .:? "stack"
87058705 <*> v .:? "timeUnit"
8706- <*> v .:? "type"
8707- <*> v .:? "value"
8706+ <*> v .: "type"
8707+ <*> v .: "value"
87088708
87098709 instance ToJSON Axis where
87108710 toJSON (Axis domainAxis formatAxis gridAxis labelAngleAxis labelBoundAxis labelFlushAxis labelOverlapAxis labelPaddingAxis labelsAxis maxExtentAxis minExtentAxis offsetAxis orientAxis positionAxis tickCountAxis ticksAxis tickSizeAxis titleAxis titleMaxLengthAxis titlePaddingAxis valuesAxis zindexAxis) =
@@ -8783,8 +8783,8 @@ instance FromJSON X2Class where
87838783 <*> v .:? "bin"
87848784 <*> v .:? "field"
87858785 <*> v .:? "timeUnit"
8786- <*> v .:? "type"
8787- <*> v .:? "value"
8786+ <*> v .: "type"
8787+ <*> v .: "value"
87888788
87898789 instance ToJSON FacetMapping where
87908790 toJSON (FacetMapping columnFacetMapping rowFacetMapping) =
@@ -8826,21 +8826,21 @@ instance FromJSON Spec where
88268826 <$> v .:? "data"
88278827 <*> v .:? "description"
88288828 <*> v .:? "height"
8829- <*> v .:? "layer"
8829+ <*> v .: "layer"
88308830 <*> v .:? "name"
88318831 <*> v .:? "resolve"
88328832 <*> v .:? "title"
88338833 <*> v .:? "transform"
88348834 <*> v .:? "width"
8835- <*> v .:? "encoding"
8836- <*> v .:? "mark"
8835+ <*> v .: "encoding"
8836+ <*> v .: "mark"
88378837 <*> v .:? "projection"
88388838 <*> v .:? "selection"
8839- <*> v .:? "facet"
8840- <*> v .:? "spec"
8841- <*> v .:? "repeat"
8842- <*> v .:? "vconcat"
8843- <*> v .:? "hconcat"
8839+ <*> v .: "facet"
8840+ <*> v .: "spec"
8841+ <*> v .: "repeat"
8842+ <*> v .: "vconcat"
8843+ <*> v .: "hconcat"
88448844
88458845 instance ToJSON Encoding where
88468846 toJSON (Encoding colorEncoding detailEncoding hrefEncoding opacityEncoding orderEncoding shapeEncoding sizeEncoding encodingTextEncoding tooltipEncoding xEncoding x2Encoding yEncoding y2Encoding) =
@@ -8899,14 +8899,14 @@ instance FromJSON LayerSpec where
88998899 <$> v .:? "data"
89008900 <*> v .:? "description"
89018901 <*> v .:? "height"
8902- <*> v .:? "layer"
8902+ <*> v .: "layer"
89038903 <*> v .:? "name"
89048904 <*> v .:? "resolve"
89058905 <*> v .:? "title"
89068906 <*> v .:? "transform"
89078907 <*> v .:? "width"
8908- <*> v .:? "encoding"
8909- <*> v .:? "mark"
8908+ <*> v .: "encoding"
8909+ <*> v .: "mark"
89108910 <*> v .:? "projection"
89118911 <*> v .:? "selection"
89128912
@@ -8922,9 +8922,9 @@ instance ToJSON Data where
89228922 instance FromJSON Data where
89238923 parseJSON (Object v) = Data
89248924 <$> v .:? "format"
8925- <*> v .:? "url"
8926- <*> v .:? "values"
8927- <*> v .:? "name"
8925+ <*> v .: "url"
8926+ <*> v .: "values"
8927+ <*> v .: "name"
89288928
89298929 instance ToJSON DataFormat where
89308930 toJSON (DataFormat parseDataFormat dataFormatTypeDataFormat propertyDataFormat featureDataFormat meshDataFormat) =
@@ -9320,16 +9320,16 @@ instance ToJSON Transform where
93209320
93219321 instance FromJSON Transform where
93229322 parseJSON (Object v) = Transform
9323- <$> v .:? "filter"
9323+ <$> v .: "filter"
93249324 <*> v .:? "as"
9325- <*> v .:? "calculate"
9325+ <*> v .: "calculate"
93269326 <*> v .:? "default"
9327- <*> v .:? "from"
9328- <*> v .:? "lookup"
9329- <*> v .:? "bin"
9330- <*> v .:? "field"
9331- <*> v .:? "timeUnit"
9332- <*> v .:? "aggregate"
9327+ <*> v .: "from"
9328+ <*> v .: "lookup"
9329+ <*> v .: "bin"
9330+ <*> v .: "field"
9331+ <*> v .: "timeUnit"
9332+ <*> v .: "aggregate"
93339333 <*> v .:? "groupby"
93349334
93359335 instance ToJSON AggregatedFieldDef where
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / AnyMark.java+1 −3
@@ -24,8 +24,6 @@ public class AnyMark {
2424 public AnyMark deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
2525 AnyMark value = new AnyMark();
2626 switch (jsonParser.currentToken()) {
27- case VALUE_NULL:
28- break;
2927 case VALUE_STRING:
3028 String string = jsonParser.readValueAs(String.class);
3129 try {
@@ -54,7 +52,7 @@ public class AnyMark {
5452 jsonGenerator.writeObject(obj.enumValue);
5553 return;
5654 }
57- jsonGenerator.writeNull();
55+ throw new IOException("AnyMark must not be null");
5856 }
5957 }
6058 }
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / Bin.java+0 −50
@@ -1,50 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-@JsonDeserialize(using = Bin.Deserializer.class)
11-@JsonSerialize(using = Bin.Serializer.class)
12-public class Bin {
13- public Boolean boolValue;
14- public BinParams binParamsValue;
15-
16- static class Deserializer extends JsonDeserializer<Bin> {
17- @Override
18- public Bin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19- Bin value = new Bin();
20- switch (jsonParser.currentToken()) {
21- case VALUE_NULL:
22- break;
23- case VALUE_TRUE:
24- case VALUE_FALSE:
25- value.boolValue = jsonParser.readValueAs(Boolean.class);
26- break;
27- case START_OBJECT:
28- value.binParamsValue = jsonParser.readValueAs(BinParams.class);
29- break;
30- default: throw new IOException("Cannot deserialize Bin");
31- }
32- return value;
33- }
34- }
35-
36- static class Serializer extends JsonSerializer<Bin> {
37- @Override
38- public void serialize(Bin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39- if (obj.boolValue != null) {
40- jsonGenerator.writeObject(obj.boolValue);
41- return;
42- }
43- if (obj.binParamsValue != null) {
44- jsonGenerator.writeObject(obj.binParamsValue);
45- return;
46- }
47- jsonGenerator.writeNull();
48- }
49- }
50-}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / ColorBin.java+50 −0
@@ -0,0 +1,50 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+@JsonDeserialize(using = ColorBin.Deserializer.class)
11+@JsonSerialize(using = ColorBin.Serializer.class)
12+public class ColorBin {
13+ public Boolean boolValue;
14+ public BinParams binParamsValue;
15+
16+ static class Deserializer extends JsonDeserializer<ColorBin> {
17+ @Override
18+ public ColorBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ ColorBin value = new ColorBin();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_TRUE:
24+ case VALUE_FALSE:
25+ value.boolValue = jsonParser.readValueAs(Boolean.class);
26+ break;
27+ case START_OBJECT:
28+ value.binParamsValue = jsonParser.readValueAs(BinParams.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize ColorBin");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<ColorBin> {
37+ @Override
38+ public void serialize(ColorBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.boolValue != null) {
40+ jsonGenerator.writeObject(obj.boolValue);
41+ return;
42+ }
43+ if (obj.binParamsValue != null) {
44+ jsonGenerator.writeObject(obj.binParamsValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / ColorValue.java+66 −0
@@ -0,0 +1,66 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
12+ * `0` to `1` for opacity).
13+ *
14+ * A constant value in visual domain.
15+ */
16+@JsonDeserialize(using = ColorValue.Deserializer.class)
17+@JsonSerialize(using = ColorValue.Serializer.class)
18+public class ColorValue {
19+ public Double doubleValue;
20+ public Boolean boolValue;
21+ public String stringValue;
22+
23+ static class Deserializer extends JsonDeserializer<ColorValue> {
24+ @Override
25+ public ColorValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
26+ ColorValue value = new ColorValue();
27+ switch (jsonParser.currentToken()) {
28+ case VALUE_NULL:
29+ break;
30+ case VALUE_NUMBER_INT:
31+ case VALUE_NUMBER_FLOAT:
32+ value.doubleValue = jsonParser.readValueAs(Double.class);
33+ break;
34+ case VALUE_TRUE:
35+ case VALUE_FALSE:
36+ value.boolValue = jsonParser.readValueAs(Boolean.class);
37+ break;
38+ case VALUE_STRING:
39+ String string = jsonParser.readValueAs(String.class);
40+ value.stringValue = string;
41+ break;
42+ default: throw new IOException("Cannot deserialize ColorValue");
43+ }
44+ return value;
45+ }
46+ }
47+
48+ static class Serializer extends JsonSerializer<ColorValue> {
49+ @Override
50+ public void serialize(ColorValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
51+ if (obj.doubleValue != null) {
52+ jsonGenerator.writeObject(obj.doubleValue);
53+ return;
54+ }
55+ if (obj.boolValue != null) {
56+ jsonGenerator.writeObject(obj.boolValue);
57+ return;
58+ }
59+ if (obj.stringValue != null) {
60+ jsonGenerator.writeObject(obj.stringValue);
61+ return;
62+ }
63+ jsonGenerator.writeNull();
64+ }
65+ }
66+}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateFieldDefClass.java+12 −12
@@ -3,37 +3,37 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private TimeUnit timeUnit;
1313 private Type type;
1414
1515 @JsonProperty("test")
16- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
16+ public LogicalOperandPredicate getTest() { return test; }
1717 @JsonProperty("test")
18- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
18+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
1919
2020 /**
2121 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2222 * `0` to `1` for opacity).
2323 */
2424 @JsonProperty("value")
25- public ConditionalPredicateValueDefValue getValue() { return value; }
25+ public ConditionalValueDefValue getValue() { return value; }
2626 @JsonProperty("value")
27- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
27+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
2828
2929 /**
3030 * A [selection name](selection.html), or a series of [composed
3131 * selections](selection.html#compose).
3232 */
3333 @JsonProperty("selection")
34- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
34+ public SelectionOperand getSelection() { return selection; }
3535 @JsonProperty("selection")
36- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
36+ public void setSelection(SelectionOperand value) { this.selection = value; }
3737
3838 /**
3939 * Aggregation function for the field
@@ -54,9 +54,9 @@ public class ConditionalPredicateFieldDefClass {
5454 * __Default value:__ `false`
5555 */
5656 @JsonProperty("bin")
57- public Bin getBin() { return bin; }
57+ public ColorBin getBin() { return bin; }
5858 @JsonProperty("bin")
59- public void setBin(Bin value) { this.bin = value; }
59+ public void setBin(ColorBin value) { this.bin = value; }
6060
6161 /**
6262 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateMarkPropFieldDefClass.java+12 −12
@@ -3,11 +3,11 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateMarkPropFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private Legend legend;
1313 private Scale scale;
@@ -16,27 +16,27 @@ public class ConditionalPredicateMarkPropFieldDefClass {
1616 private Type type;
1717
1818 @JsonProperty("test")
19- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
19+ public LogicalOperandPredicate getTest() { return test; }
2020 @JsonProperty("test")
21- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
21+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
2222
2323 /**
2424 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2525 * `0` to `1` for opacity).
2626 */
2727 @JsonProperty("value")
28- public ConditionalPredicateValueDefValue getValue() { return value; }
28+ public ConditionalValueDefValue getValue() { return value; }
2929 @JsonProperty("value")
30- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
30+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
3131
3232 /**
3333 * A [selection name](selection.html), or a series of [composed
3434 * selections](selection.html#compose).
3535 */
3636 @JsonProperty("selection")
37- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
37+ public SelectionOperand getSelection() { return selection; }
3838 @JsonProperty("selection")
39- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
39+ public void setSelection(SelectionOperand value) { this.selection = value; }
4040
4141 /**
4242 * Aggregation function for the field
@@ -57,9 +57,9 @@ public class ConditionalPredicateMarkPropFieldDefClass {
5757 * __Default value:__ `false`
5858 */
5959 @JsonProperty("bin")
60- public Bin getBin() { return bin; }
60+ public ColorBin getBin() { return bin; }
6161 @JsonProperty("bin")
62- public void setBin(Bin value) { this.bin = value; }
62+ public void setBin(ColorBin value) { this.bin = value; }
6363
6464 /**
6565 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateTextFieldDefClass.java+12 −12
@@ -3,38 +3,38 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateTextFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private String format;
1313 private TimeUnit timeUnit;
1414 private Type type;
1515
1616 @JsonProperty("test")
17- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
17+ public LogicalOperandPredicate getTest() { return test; }
1818 @JsonProperty("test")
19- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
19+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
2020
2121 /**
2222 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2323 * `0` to `1` for opacity).
2424 */
2525 @JsonProperty("value")
26- public ConditionalPredicateValueDefValue getValue() { return value; }
26+ public ConditionalValueDefValue getValue() { return value; }
2727 @JsonProperty("value")
28- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
28+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
2929
3030 /**
3131 * A [selection name](selection.html), or a series of [composed
3232 * selections](selection.html#compose).
3333 */
3434 @JsonProperty("selection")
35- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
35+ public SelectionOperand getSelection() { return selection; }
3636 @JsonProperty("selection")
37- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
37+ public void setSelection(SelectionOperand value) { this.selection = value; }
3838
3939 /**
4040 * Aggregation function for the field
@@ -55,9 +55,9 @@ public class ConditionalPredicateTextFieldDefClass {
5555 * __Default value:__ `false`
5656 */
5757 @JsonProperty("bin")
58- public Bin getBin() { return bin; }
58+ public ColorBin getBin() { return bin; }
5959 @JsonProperty("bin")
60- public void setBin(Bin value) { this.bin = value; }
60+ public void setBin(ColorBin value) { this.bin = value; }
6161
6262 /**
6363 * __Required.__ A string defining the name of the field from which to pull a data value
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalPredicateValueDefValue.java+0 −66
@@ -1,66 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
12- * `0` to `1` for opacity).
13- *
14- * A constant value in visual domain.
15- */
16-@JsonDeserialize(using = ConditionalPredicateValueDefValue.Deserializer.class)
17-@JsonSerialize(using = ConditionalPredicateValueDefValue.Serializer.class)
18-public class ConditionalPredicateValueDefValue {
19- public Double doubleValue;
20- public Boolean boolValue;
21- public String stringValue;
22-
23- static class Deserializer extends JsonDeserializer<ConditionalPredicateValueDefValue> {
24- @Override
25- public ConditionalPredicateValueDefValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
26- ConditionalPredicateValueDefValue value = new ConditionalPredicateValueDefValue();
27- switch (jsonParser.currentToken()) {
28- case VALUE_NULL:
29- break;
30- case VALUE_NUMBER_INT:
31- case VALUE_NUMBER_FLOAT:
32- value.doubleValue = jsonParser.readValueAs(Double.class);
33- break;
34- case VALUE_TRUE:
35- case VALUE_FALSE:
36- value.boolValue = jsonParser.readValueAs(Boolean.class);
37- break;
38- case VALUE_STRING:
39- String string = jsonParser.readValueAs(String.class);
40- value.stringValue = string;
41- break;
42- default: throw new IOException("Cannot deserialize ConditionalPredicateValueDefValue");
43- }
44- return value;
45- }
46- }
47-
48- static class Serializer extends JsonSerializer<ConditionalPredicateValueDefValue> {
49- @Override
50- public void serialize(ConditionalPredicateValueDefValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
51- if (obj.doubleValue != null) {
52- jsonGenerator.writeObject(obj.doubleValue);
53- return;
54- }
55- if (obj.boolValue != null) {
56- jsonGenerator.writeObject(obj.boolValue);
57- return;
58- }
59- if (obj.stringValue != null) {
60- jsonGenerator.writeObject(obj.stringValue);
61- return;
62- }
63- jsonGenerator.writeNull();
64- }
65- }
66-}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalValueDef.java+6 −6
@@ -3,14 +3,14 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalValueDef {
6- private ConditionalValueDefLogicalOperandPredicate test;
6+ private LogicalOperandPredicate test;
77 private ConditionalValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
8+ private SelectionOperand selection;
99
1010 @JsonProperty("test")
11- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
11+ public LogicalOperandPredicate getTest() { return test; }
1212 @JsonProperty("test")
13- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
13+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
1414
1515 /**
1616 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -26,7 +26,7 @@ public class ConditionalValueDef {
2626 * selections](selection.html#compose).
2727 */
2828 @JsonProperty("selection")
29- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
29+ public SelectionOperand getSelection() { return selection; }
3030 @JsonProperty("selection")
31- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
31+ public void setSelection(SelectionOperand value) { this.selection = value; }
3232 }
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalValueDefLogicalOperandPredicate.java+0 −60
@@ -1,60 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The `filter` property must be one of the predicate definitions:
12- * (1) an [expression](types.html#expression) string,
13- * where `datum` can be used to refer to the current data object;
14- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15- * [range predicate](filter.html#range-predicate), [one-of
16- * predicate](filter.html#one-of-predicate);
17- * (3) a [selection predicate](filter.html#selection-predicate);
18- * or (4) a logical operand that combines (1), (2), or (3).
19- */
20-@JsonDeserialize(using = ConditionalValueDefLogicalOperandPredicate.Deserializer.class)
21-@JsonSerialize(using = ConditionalValueDefLogicalOperandPredicate.Serializer.class)
22-public class ConditionalValueDefLogicalOperandPredicate {
23- public Predicate predicateValue;
24- public String stringValue;
25-
26- static class Deserializer extends JsonDeserializer<ConditionalValueDefLogicalOperandPredicate> {
27- @Override
28- public ConditionalValueDefLogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29- ConditionalValueDefLogicalOperandPredicate value = new ConditionalValueDefLogicalOperandPredicate();
30- switch (jsonParser.currentToken()) {
31- case VALUE_NULL:
32- break;
33- case VALUE_STRING:
34- String string = jsonParser.readValueAs(String.class);
35- value.stringValue = string;
36- break;
37- case START_OBJECT:
38- value.predicateValue = jsonParser.readValueAs(Predicate.class);
39- break;
40- default: throw new IOException("Cannot deserialize ConditionalValueDefLogicalOperandPredicate");
41- }
42- return value;
43- }
44- }
45-
46- static class Serializer extends JsonSerializer<ConditionalValueDefLogicalOperandPredicate> {
47- @Override
48- public void serialize(ConditionalValueDefLogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
49- if (obj.predicateValue != null) {
50- jsonGenerator.writeObject(obj.predicateValue);
51- return;
52- }
53- if (obj.stringValue != null) {
54- jsonGenerator.writeObject(obj.stringValue);
55- return;
56- }
57- jsonGenerator.writeNull();
58- }
59- }
60-}
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / ConditionalValueDefSelectionOperand.java+0 −56
@@ -1,56 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * Filter using a selection name.
12- *
13- * A [selection name](selection.html), or a series of [composed
14- * selections](selection.html#compose).
15- */
16-@JsonDeserialize(using = ConditionalValueDefSelectionOperand.Deserializer.class)
17-@JsonSerialize(using = ConditionalValueDefSelectionOperand.Serializer.class)
18-public class ConditionalValueDefSelectionOperand {
19- public Selection selectionValue;
20- public String stringValue;
21-
22- static class Deserializer extends JsonDeserializer<ConditionalValueDefSelectionOperand> {
23- @Override
24- public ConditionalValueDefSelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25- ConditionalValueDefSelectionOperand value = new ConditionalValueDefSelectionOperand();
26- switch (jsonParser.currentToken()) {
27- case VALUE_NULL:
28- break;
29- case VALUE_STRING:
30- String string = jsonParser.readValueAs(String.class);
31- value.stringValue = string;
32- break;
33- case START_OBJECT:
34- value.selectionValue = jsonParser.readValueAs(Selection.class);
35- break;
36- default: throw new IOException("Cannot deserialize ConditionalValueDefSelectionOperand");
37- }
38- return value;
39- }
40- }
41-
42- static class Serializer extends JsonSerializer<ConditionalValueDefSelectionOperand> {
43- @Override
44- public void serialize(ConditionalValueDefSelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
45- if (obj.selectionValue != null) {
46- jsonGenerator.writeObject(obj.selectionValue);
47- return;
48- }
49- if (obj.stringValue != null) {
50- jsonGenerator.writeObject(obj.stringValue);
51- return;
52- }
53- jsonGenerator.writeNull();
54- }
55- }
56-}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / DefWithCondition.java+6 −6
@@ -21,12 +21,12 @@ import java.util.List;
2121 */
2222 public class DefWithCondition {
2323 private AggregateOp aggregate;
24- private Bin bin;
24+ private ColorBin bin;
2525 private HrefCondition condition;
2626 private Field field;
2727 private TimeUnit timeUnit;
2828 private Type type;
29- private ConditionalPredicateValueDefValue value;
29+ private ColorValue value;
3030
3131 /**
3232 * Aggregation function for the field
@@ -47,9 +47,9 @@ public class DefWithCondition {
4747 * __Default value:__ `false`
4848 */
4949 @JsonProperty("bin")
50- public Bin getBin() { return bin; }
50+ public ColorBin getBin() { return bin; }
5151 @JsonProperty("bin")
52- public void setBin(Bin value) { this.bin = value; }
52+ public void setBin(ColorBin value) { this.bin = value; }
5353
5454 /**
5555 * One or more value definition(s) with a selection predicate.
@@ -108,7 +108,7 @@ public class DefWithCondition {
108108 * A constant value in visual domain.
109109 */
110110 @JsonProperty("value")
111- public ConditionalPredicateValueDefValue getValue() { return value; }
111+ public ColorValue getValue() { return value; }
112112 @JsonProperty("value")
113- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
113+ public void setValue(ColorValue value) { this.value = value; }
114114 }
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / DomainUnion.java+2 −2
@@ -29,7 +29,7 @@ import java.util.List;
2929 @JsonDeserialize(using = DomainUnion.Deserializer.class)
3030 @JsonSerialize(using = DomainUnion.Serializer.class)
3131 public class DomainUnion {
32- public List<OneOfElement> unionArrayValue;
32+ public List<Equal> unionArrayValue;
3333 public DomainClass domainClassValue;
3434 public Domain enumValue;
3535
@@ -49,7 +49,7 @@ public class DomainUnion {
4949 }
5050 break;
5151 case START_ARRAY:
52- value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<OneOfElement>>() {});
52+ value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<Equal>>() {});
5353 break;
5454 case START_OBJECT:
5555 value.domainClassValue = jsonParser.readValueAs(DomainClass.class);
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / Equal.java+69 −0
@@ -0,0 +1,69 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * The value that the field should be equal to.
12+ */
13+@JsonDeserialize(using = Equal.Deserializer.class)
14+@JsonSerialize(using = Equal.Serializer.class)
15+public class Equal {
16+ public Double doubleValue;
17+ public Boolean boolValue;
18+ public DateTime dateTimeValue;
19+ public String stringValue;
20+
21+ static class Deserializer extends JsonDeserializer<Equal> {
22+ @Override
23+ public Equal deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24+ Equal value = new Equal();
25+ switch (jsonParser.currentToken()) {
26+ case VALUE_NUMBER_INT:
27+ case VALUE_NUMBER_FLOAT:
28+ value.doubleValue = jsonParser.readValueAs(Double.class);
29+ break;
30+ case VALUE_TRUE:
31+ case VALUE_FALSE:
32+ value.boolValue = jsonParser.readValueAs(Boolean.class);
33+ break;
34+ case VALUE_STRING:
35+ String string = jsonParser.readValueAs(String.class);
36+ value.stringValue = string;
37+ break;
38+ case START_OBJECT:
39+ value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
40+ break;
41+ default: throw new IOException("Cannot deserialize Equal");
42+ }
43+ return value;
44+ }
45+ }
46+
47+ static class Serializer extends JsonSerializer<Equal> {
48+ @Override
49+ public void serialize(Equal obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
50+ if (obj.doubleValue != null) {
51+ jsonGenerator.writeObject(obj.doubleValue);
52+ return;
53+ }
54+ if (obj.boolValue != null) {
55+ jsonGenerator.writeObject(obj.boolValue);
56+ return;
57+ }
58+ if (obj.dateTimeValue != null) {
59+ jsonGenerator.writeObject(obj.dateTimeValue);
60+ return;
61+ }
62+ if (obj.stringValue != null) {
63+ jsonGenerator.writeObject(obj.stringValue);
64+ return;
65+ }
66+ throw new IOException("Equal must not be null");
67+ }
68+ }
69+}
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / EqualUnion.java+0 −71
@@ -1,71 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The value that the field should be equal to.
12- */
13-@JsonDeserialize(using = EqualUnion.Deserializer.class)
14-@JsonSerialize(using = EqualUnion.Serializer.class)
15-public class EqualUnion {
16- public Double doubleValue;
17- public Boolean boolValue;
18- public DateTime dateTimeValue;
19- public String stringValue;
20-
21- static class Deserializer extends JsonDeserializer<EqualUnion> {
22- @Override
23- public EqualUnion deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24- EqualUnion value = new EqualUnion();
25- switch (jsonParser.currentToken()) {
26- case VALUE_NULL:
27- break;
28- case VALUE_NUMBER_INT:
29- case VALUE_NUMBER_FLOAT:
30- value.doubleValue = jsonParser.readValueAs(Double.class);
31- break;
32- case VALUE_TRUE:
33- case VALUE_FALSE:
34- value.boolValue = jsonParser.readValueAs(Boolean.class);
35- break;
36- case VALUE_STRING:
37- String string = jsonParser.readValueAs(String.class);
38- value.stringValue = string;
39- break;
40- case START_OBJECT:
41- value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
42- break;
43- default: throw new IOException("Cannot deserialize EqualUnion");
44- }
45- return value;
46- }
47- }
48-
49- static class Serializer extends JsonSerializer<EqualUnion> {
50- @Override
51- public void serialize(EqualUnion obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
52- if (obj.doubleValue != null) {
53- jsonGenerator.writeObject(obj.doubleValue);
54- return;
55- }
56- if (obj.boolValue != null) {
57- jsonGenerator.writeObject(obj.boolValue);
58- return;
59- }
60- if (obj.dateTimeValue != null) {
61- jsonGenerator.writeObject(obj.dateTimeValue);
62- return;
63- }
64- if (obj.stringValue != null) {
65- jsonGenerator.writeObject(obj.stringValue);
66- return;
67- }
68- jsonGenerator.writeNull();
69- }
70- }
71-}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / FacetFieldDef.java+3 −3
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.*;
99 */
1010 public class FacetFieldDef {
1111 private AggregateOp aggregate;
12- private Bin bin;
12+ private ColorBin bin;
1313 private Field field;
1414 private Header header;
1515 private SortEnum sort;
@@ -35,9 +35,9 @@ public class FacetFieldDef {
3535 * __Default value:__ `false`
3636 */
3737 @JsonProperty("bin")
38- public Bin getBin() { return bin; }
38+ public ColorBin getBin() { return bin; }
3939 @JsonProperty("bin")
40- public void setBin(Bin value) { this.bin = value; }
40+ public void setBin(ColorBin value) { this.bin = value; }
4141
4242 /**
4343 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / FieldDef.java+3 −3
@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.*;
77 */
88 public class FieldDef {
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private TimeUnit timeUnit;
1313 private Type type;
@@ -31,9 +31,9 @@ public class FieldDef {
3131 * __Default value:__ `false`
3232 */
3333 @JsonProperty("bin")
34- public Bin getBin() { return bin; }
34+ public ColorBin getBin() { return bin; }
3535 @JsonProperty("bin")
36- public void setBin(Bin value) { this.bin = value; }
36+ public void setBin(ColorBin value) { this.bin = value; }
3737
3838 /**
3939 * __Required.__ A string defining the name of the field from which to pull a data value
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / LogicalOperandPredicate.java+58 −0
@@ -0,0 +1,58 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * The `filter` property must be one of the predicate definitions:
12+ * (1) an [expression](types.html#expression) string,
13+ * where `datum` can be used to refer to the current data object;
14+ * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15+ * [range predicate](filter.html#range-predicate), [one-of
16+ * predicate](filter.html#one-of-predicate);
17+ * (3) a [selection predicate](filter.html#selection-predicate);
18+ * or (4) a logical operand that combines (1), (2), or (3).
19+ */
20+@JsonDeserialize(using = LogicalOperandPredicate.Deserializer.class)
21+@JsonSerialize(using = LogicalOperandPredicate.Serializer.class)
22+public class LogicalOperandPredicate {
23+ public Predicate predicateValue;
24+ public String stringValue;
25+
26+ static class Deserializer extends JsonDeserializer<LogicalOperandPredicate> {
27+ @Override
28+ public LogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29+ LogicalOperandPredicate value = new LogicalOperandPredicate();
30+ switch (jsonParser.currentToken()) {
31+ case VALUE_STRING:
32+ String string = jsonParser.readValueAs(String.class);
33+ value.stringValue = string;
34+ break;
35+ case START_OBJECT:
36+ value.predicateValue = jsonParser.readValueAs(Predicate.class);
37+ break;
38+ default: throw new IOException("Cannot deserialize LogicalOperandPredicate");
39+ }
40+ return value;
41+ }
42+ }
43+
44+ static class Serializer extends JsonSerializer<LogicalOperandPredicate> {
45+ @Override
46+ public void serialize(LogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
47+ if (obj.predicateValue != null) {
48+ jsonGenerator.writeObject(obj.predicateValue);
49+ return;
50+ }
51+ if (obj.stringValue != null) {
52+ jsonGenerator.writeObject(obj.stringValue);
53+ return;
54+ }
55+ throw new IOException("LogicalOperandPredicate must not be null");
56+ }
57+ }
58+}
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / LogicalOperandPredicateElement.java+0 −58
@@ -1,58 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The `filter` property must be one of the predicate definitions:
12- * (1) an [expression](types.html#expression) string,
13- * where `datum` can be used to refer to the current data object;
14- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15- * [range predicate](filter.html#range-predicate), [one-of
16- * predicate](filter.html#one-of-predicate);
17- * (3) a [selection predicate](filter.html#selection-predicate);
18- * or (4) a logical operand that combines (1), (2), or (3).
19- */
20-@JsonDeserialize(using = LogicalOperandPredicateElement.Deserializer.class)
21-@JsonSerialize(using = LogicalOperandPredicateElement.Serializer.class)
22-public class LogicalOperandPredicateElement {
23- public Predicate predicateValue;
24- public String stringValue;
25-
26- static class Deserializer extends JsonDeserializer<LogicalOperandPredicateElement> {
27- @Override
28- public LogicalOperandPredicateElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29- LogicalOperandPredicateElement value = new LogicalOperandPredicateElement();
30- switch (jsonParser.currentToken()) {
31- case VALUE_STRING:
32- String string = jsonParser.readValueAs(String.class);
33- value.stringValue = string;
34- break;
35- case START_OBJECT:
36- value.predicateValue = jsonParser.readValueAs(Predicate.class);
37- break;
38- default: throw new IOException("Cannot deserialize LogicalOperandPredicateElement");
39- }
40- return value;
41- }
42- }
43-
44- static class Serializer extends JsonSerializer<LogicalOperandPredicateElement> {
45- @Override
46- public void serialize(LogicalOperandPredicateElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
47- if (obj.predicateValue != null) {
48- jsonGenerator.writeObject(obj.predicateValue);
49- return;
50- }
51- if (obj.stringValue != null) {
52- jsonGenerator.writeObject(obj.stringValue);
53- return;
54- }
55- throw new IOException("LogicalOperandPredicateElement must not be null");
56- }
57- }
58-}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / MarkPropDefWithCondition.java+6 −6
@@ -48,7 +48,7 @@ import java.util.List;
4848 */
4949 public class MarkPropDefWithCondition {
5050 private AggregateOp aggregate;
51- private Bin bin;
51+ private ColorBin bin;
5252 private ColorCondition condition;
5353 private Field field;
5454 private Legend legend;
@@ -56,7 +56,7 @@ public class MarkPropDefWithCondition {
5656 private SortUnion sort;
5757 private TimeUnit timeUnit;
5858 private Type type;
59- private ConditionalPredicateValueDefValue value;
59+ private ColorValue value;
6060
6161 /**
6262 * Aggregation function for the field
@@ -77,9 +77,9 @@ public class MarkPropDefWithCondition {
7777 * __Default value:__ `false`
7878 */
7979 @JsonProperty("bin")
80- public Bin getBin() { return bin; }
80+ public ColorBin getBin() { return bin; }
8181 @JsonProperty("bin")
82- public void setBin(Bin value) { this.bin = value; }
82+ public void setBin(ColorBin value) { this.bin = value; }
8383
8484 /**
8585 * One or more value definition(s) with a selection predicate.
@@ -174,7 +174,7 @@ public class MarkPropDefWithCondition {
174174 * A constant value in visual domain.
175175 */
176176 @JsonProperty("value")
177- public ConditionalPredicateValueDefValue getValue() { return value; }
177+ public ColorValue getValue() { return value; }
178178 @JsonProperty("value")
179- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
179+ public void setValue(ColorValue value) { this.value = value; }
180180 }
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / OneOfElement.java+0 −69
@@ -1,69 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The value that the field should be equal to.
12- */
13-@JsonDeserialize(using = OneOfElement.Deserializer.class)
14-@JsonSerialize(using = OneOfElement.Serializer.class)
15-public class OneOfElement {
16- public Double doubleValue;
17- public Boolean boolValue;
18- public DateTime dateTimeValue;
19- public String stringValue;
20-
21- static class Deserializer extends JsonDeserializer<OneOfElement> {
22- @Override
23- public OneOfElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24- OneOfElement value = new OneOfElement();
25- switch (jsonParser.currentToken()) {
26- case VALUE_NUMBER_INT:
27- case VALUE_NUMBER_FLOAT:
28- value.doubleValue = jsonParser.readValueAs(Double.class);
29- break;
30- case VALUE_TRUE:
31- case VALUE_FALSE:
32- value.boolValue = jsonParser.readValueAs(Boolean.class);
33- break;
34- case VALUE_STRING:
35- String string = jsonParser.readValueAs(String.class);
36- value.stringValue = string;
37- break;
38- case START_OBJECT:
39- value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
40- break;
41- default: throw new IOException("Cannot deserialize OneOfElement");
42- }
43- return value;
44- }
45- }
46-
47- static class Serializer extends JsonSerializer<OneOfElement> {
48- @Override
49- public void serialize(OneOfElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
50- if (obj.doubleValue != null) {
51- jsonGenerator.writeObject(obj.doubleValue);
52- return;
53- }
54- if (obj.boolValue != null) {
55- jsonGenerator.writeObject(obj.boolValue);
56- return;
57- }
58- if (obj.dateTimeValue != null) {
59- jsonGenerator.writeObject(obj.dateTimeValue);
60- return;
61- }
62- if (obj.stringValue != null) {
63- jsonGenerator.writeObject(obj.stringValue);
64- return;
65- }
66- throw new IOException("OneOfElement must not be null");
67- }
68- }
69-}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / OrderFieldDef.java+3 −3
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*;
44
55 public class OrderFieldDef {
66 private AggregateOp aggregate;
7- private Bin bin;
7+ private ColorBin bin;
88 private Field field;
99 private SortEnum sort;
1010 private TimeUnit timeUnit;
@@ -29,9 +29,9 @@ public class OrderFieldDef {
2929 * __Default value:__ `false`
3030 */
3131 @JsonProperty("bin")
32- public Bin getBin() { return bin; }
32+ public ColorBin getBin() { return bin; }
3333 @JsonProperty("bin")
34- public void setBin(Bin value) { this.bin = value; }
34+ public void setBin(ColorBin value) { this.bin = value; }
3535
3636 /**
3737 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Predicate.java+18 −18
@@ -4,38 +4,38 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Predicate {
7- private ConditionalValueDefLogicalOperandPredicate not;
8- private List<LogicalOperandPredicateElement> and;
9- private List<LogicalOperandPredicateElement> or;
10- private EqualUnion equal;
7+ private LogicalOperandPredicate not;
8+ private List<LogicalOperandPredicate> and;
9+ private List<LogicalOperandPredicate> or;
10+ private Equal equal;
1111 private String field;
1212 private TimeUnit timeUnit;
1313 private List<RangeElement> range;
14- private List<OneOfElement> oneOf;
15- private ConditionalValueDefSelectionOperand selection;
14+ private List<Equal> oneOf;
15+ private SelectionOperand selection;
1616
1717 @JsonProperty("not")
18- public ConditionalValueDefLogicalOperandPredicate getNot() { return not; }
18+ public LogicalOperandPredicate getNot() { return not; }
1919 @JsonProperty("not")
20- public void setNot(ConditionalValueDefLogicalOperandPredicate value) { this.not = value; }
20+ public void setNot(LogicalOperandPredicate value) { this.not = value; }
2121
2222 @JsonProperty("and")
23- public List<LogicalOperandPredicateElement> getAnd() { return and; }
23+ public List<LogicalOperandPredicate> getAnd() { return and; }
2424 @JsonProperty("and")
25- public void setAnd(List<LogicalOperandPredicateElement> value) { this.and = value; }
25+ public void setAnd(List<LogicalOperandPredicate> value) { this.and = value; }
2626
2727 @JsonProperty("or")
28- public List<LogicalOperandPredicateElement> getOr() { return or; }
28+ public List<LogicalOperandPredicate> getOr() { return or; }
2929 @JsonProperty("or")
30- public void setOr(List<LogicalOperandPredicateElement> value) { this.or = value; }
30+ public void setOr(List<LogicalOperandPredicate> value) { this.or = value; }
3131
3232 /**
3333 * The value that the field should be equal to.
3434 */
3535 @JsonProperty("equal")
36- public EqualUnion getEqual() { return equal; }
36+ public Equal getEqual() { return equal; }
3737 @JsonProperty("equal")
38- public void setEqual(EqualUnion value) { this.equal = value; }
38+ public void setEqual(Equal value) { this.equal = value; }
3939
4040 /**
4141 * Field to be filtered.
@@ -71,15 +71,15 @@ public class Predicate {
7171 * for a data item included in the filtered data.
7272 */
7373 @JsonProperty("oneOf")
74- public List<OneOfElement> getOneOf() { return oneOf; }
74+ public List<Equal> getOneOf() { return oneOf; }
7575 @JsonProperty("oneOf")
76- public void setOneOf(List<OneOfElement> value) { this.oneOf = value; }
76+ public void setOneOf(List<Equal> value) { this.oneOf = value; }
7777
7878 /**
7979 * Filter using a selection name.
8080 */
8181 @JsonProperty("selection")
82- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
82+ public SelectionOperand getSelection() { return selection; }
8383 @JsonProperty("selection")
84- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
84+ public void setSelection(SelectionOperand value) { this.selection = value; }
8585 }
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Selection.java+9 −9
@@ -4,22 +4,22 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Selection {
7- private ConditionalValueDefSelectionOperand not;
8- private List<SelectionOperandElement> and;
9- private List<SelectionOperandElement> or;
7+ private SelectionOperand not;
8+ private List<SelectionOperand> and;
9+ private List<SelectionOperand> or;
1010
1111 @JsonProperty("not")
12- public ConditionalValueDefSelectionOperand getNot() { return not; }
12+ public SelectionOperand getNot() { return not; }
1313 @JsonProperty("not")
14- public void setNot(ConditionalValueDefSelectionOperand value) { this.not = value; }
14+ public void setNot(SelectionOperand value) { this.not = value; }
1515
1616 @JsonProperty("and")
17- public List<SelectionOperandElement> getAnd() { return and; }
17+ public List<SelectionOperand> getAnd() { return and; }
1818 @JsonProperty("and")
19- public void setAnd(List<SelectionOperandElement> value) { this.and = value; }
19+ public void setAnd(List<SelectionOperand> value) { this.and = value; }
2020
2121 @JsonProperty("or")
22- public List<SelectionOperandElement> getOr() { return or; }
22+ public List<SelectionOperand> getOr() { return or; }
2323 @JsonProperty("or")
24- public void setOr(List<SelectionOperandElement> value) { this.or = value; }
24+ public void setOr(List<SelectionOperand> value) { this.or = value; }
2525 }
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / SelectionOperand.java+54 −0
@@ -0,0 +1,54 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * Filter using a selection name.
12+ *
13+ * A [selection name](selection.html), or a series of [composed
14+ * selections](selection.html#compose).
15+ */
16+@JsonDeserialize(using = SelectionOperand.Deserializer.class)
17+@JsonSerialize(using = SelectionOperand.Serializer.class)
18+public class SelectionOperand {
19+ public Selection selectionValue;
20+ public String stringValue;
21+
22+ static class Deserializer extends JsonDeserializer<SelectionOperand> {
23+ @Override
24+ public SelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25+ SelectionOperand value = new SelectionOperand();
26+ switch (jsonParser.currentToken()) {
27+ case VALUE_STRING:
28+ String string = jsonParser.readValueAs(String.class);
29+ value.stringValue = string;
30+ break;
31+ case START_OBJECT:
32+ value.selectionValue = jsonParser.readValueAs(Selection.class);
33+ break;
34+ default: throw new IOException("Cannot deserialize SelectionOperand");
35+ }
36+ return value;
37+ }
38+ }
39+
40+ static class Serializer extends JsonSerializer<SelectionOperand> {
41+ @Override
42+ public void serialize(SelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
43+ if (obj.selectionValue != null) {
44+ jsonGenerator.writeObject(obj.selectionValue);
45+ return;
46+ }
47+ if (obj.stringValue != null) {
48+ jsonGenerator.writeObject(obj.stringValue);
49+ return;
50+ }
51+ throw new IOException("SelectionOperand must not be null");
52+ }
53+ }
54+}
Dschema-java-datetime-legacydefault / src / main / java / io / quicktype / SelectionOperandElement.java+0 −54
@@ -1,54 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * Filter using a selection name.
12- *
13- * A [selection name](selection.html), or a series of [composed
14- * selections](selection.html#compose).
15- */
16-@JsonDeserialize(using = SelectionOperandElement.Deserializer.class)
17-@JsonSerialize(using = SelectionOperandElement.Serializer.class)
18-public class SelectionOperandElement {
19- public Selection selectionValue;
20- public String stringValue;
21-
22- static class Deserializer extends JsonDeserializer<SelectionOperandElement> {
23- @Override
24- public SelectionOperandElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25- SelectionOperandElement value = new SelectionOperandElement();
26- switch (jsonParser.currentToken()) {
27- case VALUE_STRING:
28- String string = jsonParser.readValueAs(String.class);
29- value.stringValue = string;
30- break;
31- case START_OBJECT:
32- value.selectionValue = jsonParser.readValueAs(Selection.class);
33- break;
34- default: throw new IOException("Cannot deserialize SelectionOperandElement");
35- }
36- return value;
37- }
38- }
39-
40- static class Serializer extends JsonSerializer<SelectionOperandElement> {
41- @Override
42- public void serialize(SelectionOperandElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
43- if (obj.selectionValue != null) {
44- jsonGenerator.writeObject(obj.selectionValue);
45- return;
46- }
47- if (obj.stringValue != null) {
48- jsonGenerator.writeObject(obj.stringValue);
49- return;
50- }
51- throw new IOException("SelectionOperandElement must not be null");
52- }
53- }
54-}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / TextDefWithCondition.java+6 −6
@@ -23,13 +23,13 @@ import java.util.List;
2323 */
2424 public class TextDefWithCondition {
2525 private AggregateOp aggregate;
26- private Bin bin;
26+ private ColorBin bin;
2727 private TextCondition condition;
2828 private Field field;
2929 private String format;
3030 private TimeUnit timeUnit;
3131 private Type type;
32- private ConditionalPredicateValueDefValue value;
32+ private ColorValue value;
3333
3434 /**
3535 * Aggregation function for the field
@@ -50,9 +50,9 @@ public class TextDefWithCondition {
5050 * __Default value:__ `false`
5151 */
5252 @JsonProperty("bin")
53- public Bin getBin() { return bin; }
53+ public ColorBin getBin() { return bin; }
5454 @JsonProperty("bin")
55- public void setBin(Bin value) { this.bin = value; }
55+ public void setBin(ColorBin value) { this.bin = value; }
5656
5757 /**
5858 * One or more value definition(s) with a selection predicate.
@@ -120,7 +120,7 @@ public class TextDefWithCondition {
120120 * A constant value in visual domain.
121121 */
122122 @JsonProperty("value")
123- public ConditionalPredicateValueDefValue getValue() { return value; }
123+ public ColorValue getValue() { return value; }
124124 @JsonProperty("value")
125- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
125+ public void setValue(ColorValue value) { this.value = value; }
126126 }
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Transform.java+6 −6
@@ -4,13 +4,13 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Transform {
7- private ConditionalValueDefLogicalOperandPredicate filter;
7+ private LogicalOperandPredicate filter;
88 private Style as;
99 private String calculate;
1010 private String transformDefault;
1111 private LookupData from;
1212 private String lookup;
13- private Bin bin;
13+ private TransformBin bin;
1414 private String field;
1515 private TimeUnit timeUnit;
1616 private List<AggregatedFieldDef> aggregate;
@@ -27,9 +27,9 @@ public class Transform {
2727 * or (4) a logical operand that combines (1), (2), or (3).
2828 */
2929 @JsonProperty("filter")
30- public ConditionalValueDefLogicalOperandPredicate getFilter() { return filter; }
30+ public LogicalOperandPredicate getFilter() { return filter; }
3131 @JsonProperty("filter")
32- public void setFilter(ConditionalValueDefLogicalOperandPredicate value) { this.filter = value; }
32+ public void setFilter(LogicalOperandPredicate value) { this.filter = value; }
3333
3434 /**
3535 * The field for storing the computed formula value.
@@ -87,9 +87,9 @@ public class Transform {
8787 * An object indicating bin properties, or simply `true` for using default bin parameters.
8888 */
8989 @JsonProperty("bin")
90- public Bin getBin() { return bin; }
90+ public TransformBin getBin() { return bin; }
9191 @JsonProperty("bin")
92- public void setBin(Bin value) { this.bin = value; }
92+ public void setBin(TransformBin value) { this.bin = value; }
9393
9494 /**
9595 * The data field to bin.
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / TransformBin.java+48 −0
@@ -0,0 +1,48 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+@JsonDeserialize(using = TransformBin.Deserializer.class)
11+@JsonSerialize(using = TransformBin.Serializer.class)
12+public class TransformBin {
13+ public Boolean boolValue;
14+ public BinParams binParamsValue;
15+
16+ static class Deserializer extends JsonDeserializer<TransformBin> {
17+ @Override
18+ public TransformBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ TransformBin value = new TransformBin();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_TRUE:
22+ case VALUE_FALSE:
23+ value.boolValue = jsonParser.readValueAs(Boolean.class);
24+ break;
25+ case START_OBJECT:
26+ value.binParamsValue = jsonParser.readValueAs(BinParams.class);
27+ break;
28+ default: throw new IOException("Cannot deserialize TransformBin");
29+ }
30+ return value;
31+ }
32+ }
33+
34+ static class Serializer extends JsonSerializer<TransformBin> {
35+ @Override
36+ public void serialize(TransformBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
37+ if (obj.boolValue != null) {
38+ jsonGenerator.writeObject(obj.boolValue);
39+ return;
40+ }
41+ if (obj.binParamsValue != null) {
42+ jsonGenerator.writeObject(obj.binParamsValue);
43+ return;
44+ }
45+ throw new IOException("TransformBin must not be null");
46+ }
47+ }
48+}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Values.java+1 −3
@@ -27,8 +27,6 @@ public class Values {
2727 public Values deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
2828 Values value = new Values();
2929 switch (jsonParser.currentToken()) {
30- case VALUE_NULL:
31- break;
3230 case VALUE_STRING:
3331 String string = jsonParser.readValueAs(String.class);
3432 value.stringValue = string;
@@ -60,7 +58,7 @@ public class Values {
6058 jsonGenerator.writeObject(obj.stringValue);
6159 return;
6260 }
63- jsonGenerator.writeNull();
61+ throw new IOException("Values must not be null");
6462 }
6563 }
6664 }
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / X2Class.java+6 −6
@@ -13,11 +13,11 @@ import com.fasterxml.jackson.annotation.*;
1313 */
1414 public class X2Class {
1515 private AggregateOp aggregate;
16- private Bin bin;
16+ private ColorBin bin;
1717 private Field field;
1818 private TimeUnit timeUnit;
1919 private Type type;
20- private ConditionalPredicateValueDefValue value;
20+ private ConditionalValueDefValue value;
2121
2222 /**
2323 * Aggregation function for the field
@@ -38,9 +38,9 @@ public class X2Class {
3838 * __Default value:__ `false`
3939 */
4040 @JsonProperty("bin")
41- public Bin getBin() { return bin; }
41+ public ColorBin getBin() { return bin; }
4242 @JsonProperty("bin")
43- public void setBin(Bin value) { this.bin = value; }
43+ public void setBin(ColorBin value) { this.bin = value; }
4444
4545 /**
4646 * __Required.__ A string defining the name of the field from which to pull a data value
@@ -86,7 +86,7 @@ public class X2Class {
8686 * `0` to `1` for opacity).
8787 */
8888 @JsonProperty("value")
89- public ConditionalPredicateValueDefValue getValue() { return value; }
89+ public ConditionalValueDefValue getValue() { return value; }
9090 @JsonProperty("value")
91- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
91+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
9292 }
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / XClass.java+6 −6
@@ -12,14 +12,14 @@ import com.fasterxml.jackson.annotation.*;
1212 public class XClass {
1313 private AggregateOp aggregate;
1414 private Axis axis;
15- private Bin bin;
15+ private ColorBin bin;
1616 private Field field;
1717 private Scale scale;
1818 private SortUnion sort;
1919 private StackOffset stack;
2020 private TimeUnit timeUnit;
2121 private Type type;
22- private ConditionalPredicateValueDefValue value;
22+ private ConditionalValueDefValue value;
2323
2424 /**
2525 * Aggregation function for the field
@@ -51,9 +51,9 @@ public class XClass {
5151 * __Default value:__ `false`
5252 */
5353 @JsonProperty("bin")
54- public Bin getBin() { return bin; }
54+ public ColorBin getBin() { return bin; }
5555 @JsonProperty("bin")
56- public void setBin(Bin value) { this.bin = value; }
56+ public void setBin(ColorBin value) { this.bin = value; }
5757
5858 /**
5959 * __Required.__ A string defining the name of the field from which to pull a data value
@@ -151,7 +151,7 @@ public class XClass {
151151 * `0` to `1` for opacity).
152152 */
153153 @JsonProperty("value")
154- public ConditionalPredicateValueDefValue getValue() { return value; }
154+ public ConditionalValueDefValue getValue() { return value; }
155155 @JsonProperty("value")
156- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
156+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
157157 }
Mschema-java-lombokdefault / src / main / java / io / quicktype / AnyMark.java+1 −3
@@ -24,8 +24,6 @@ public class AnyMark {
2424 public AnyMark deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
2525 AnyMark value = new AnyMark();
2626 switch (jsonParser.currentToken()) {
27- case VALUE_NULL:
28- break;
2927 case VALUE_STRING:
3028 String string = jsonParser.readValueAs(String.class);
3129 try {
@@ -54,7 +52,7 @@ public class AnyMark {
5452 jsonGenerator.writeObject(obj.enumValue);
5553 return;
5654 }
57- jsonGenerator.writeNull();
55+ throw new IOException("AnyMark must not be null");
5856 }
5957 }
6058 }
Dschema-java-lombokdefault / src / main / java / io / quicktype / Bin.java+0 −50
@@ -1,50 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-@JsonDeserialize(using = Bin.Deserializer.class)
11-@JsonSerialize(using = Bin.Serializer.class)
12-public class Bin {
13- public Boolean boolValue;
14- public BinParams binParamsValue;
15-
16- static class Deserializer extends JsonDeserializer<Bin> {
17- @Override
18- public Bin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19- Bin value = new Bin();
20- switch (jsonParser.currentToken()) {
21- case VALUE_NULL:
22- break;
23- case VALUE_TRUE:
24- case VALUE_FALSE:
25- value.boolValue = jsonParser.readValueAs(Boolean.class);
26- break;
27- case START_OBJECT:
28- value.binParamsValue = jsonParser.readValueAs(BinParams.class);
29- break;
30- default: throw new IOException("Cannot deserialize Bin");
31- }
32- return value;
33- }
34- }
35-
36- static class Serializer extends JsonSerializer<Bin> {
37- @Override
38- public void serialize(Bin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39- if (obj.boolValue != null) {
40- jsonGenerator.writeObject(obj.boolValue);
41- return;
42- }
43- if (obj.binParamsValue != null) {
44- jsonGenerator.writeObject(obj.binParamsValue);
45- return;
46- }
47- jsonGenerator.writeNull();
48- }
49- }
50-}
Aschema-java-lombokdefault / src / main / java / io / quicktype / ColorBin.java+50 −0
@@ -0,0 +1,50 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+@JsonDeserialize(using = ColorBin.Deserializer.class)
11+@JsonSerialize(using = ColorBin.Serializer.class)
12+public class ColorBin {
13+ public Boolean boolValue;
14+ public BinParams binParamsValue;
15+
16+ static class Deserializer extends JsonDeserializer<ColorBin> {
17+ @Override
18+ public ColorBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ ColorBin value = new ColorBin();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_TRUE:
24+ case VALUE_FALSE:
25+ value.boolValue = jsonParser.readValueAs(Boolean.class);
26+ break;
27+ case START_OBJECT:
28+ value.binParamsValue = jsonParser.readValueAs(BinParams.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize ColorBin");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<ColorBin> {
37+ @Override
38+ public void serialize(ColorBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.boolValue != null) {
40+ jsonGenerator.writeObject(obj.boolValue);
41+ return;
42+ }
43+ if (obj.binParamsValue != null) {
44+ jsonGenerator.writeObject(obj.binParamsValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / ColorValue.java+66 −0
@@ -0,0 +1,66 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
12+ * `0` to `1` for opacity).
13+ *
14+ * A constant value in visual domain.
15+ */
16+@JsonDeserialize(using = ColorValue.Deserializer.class)
17+@JsonSerialize(using = ColorValue.Serializer.class)
18+public class ColorValue {
19+ public Double doubleValue;
20+ public Boolean boolValue;
21+ public String stringValue;
22+
23+ static class Deserializer extends JsonDeserializer<ColorValue> {
24+ @Override
25+ public ColorValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
26+ ColorValue value = new ColorValue();
27+ switch (jsonParser.currentToken()) {
28+ case VALUE_NULL:
29+ break;
30+ case VALUE_NUMBER_INT:
31+ case VALUE_NUMBER_FLOAT:
32+ value.doubleValue = jsonParser.readValueAs(Double.class);
33+ break;
34+ case VALUE_TRUE:
35+ case VALUE_FALSE:
36+ value.boolValue = jsonParser.readValueAs(Boolean.class);
37+ break;
38+ case VALUE_STRING:
39+ String string = jsonParser.readValueAs(String.class);
40+ value.stringValue = string;
41+ break;
42+ default: throw new IOException("Cannot deserialize ColorValue");
43+ }
44+ return value;
45+ }
46+ }
47+
48+ static class Serializer extends JsonSerializer<ColorValue> {
49+ @Override
50+ public void serialize(ColorValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
51+ if (obj.doubleValue != null) {
52+ jsonGenerator.writeObject(obj.doubleValue);
53+ return;
54+ }
55+ if (obj.boolValue != null) {
56+ jsonGenerator.writeObject(obj.boolValue);
57+ return;
58+ }
59+ if (obj.stringValue != null) {
60+ jsonGenerator.writeObject(obj.stringValue);
61+ return;
62+ }
63+ jsonGenerator.writeNull();
64+ }
65+ }
66+}
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateFieldDefClass.java+12 −12
@@ -3,37 +3,37 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private TimeUnit timeUnit;
1313 private Type type;
1414
1515 @JsonProperty("test")
16- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
16+ public LogicalOperandPredicate getTest() { return test; }
1717 @JsonProperty("test")
18- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
18+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
1919
2020 /**
2121 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2222 * `0` to `1` for opacity).
2323 */
2424 @JsonProperty("value")
25- public ConditionalPredicateValueDefValue getValue() { return value; }
25+ public ConditionalValueDefValue getValue() { return value; }
2626 @JsonProperty("value")
27- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
27+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
2828
2929 /**
3030 * A [selection name](selection.html), or a series of [composed
3131 * selections](selection.html#compose).
3232 */
3333 @JsonProperty("selection")
34- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
34+ public SelectionOperand getSelection() { return selection; }
3535 @JsonProperty("selection")
36- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
36+ public void setSelection(SelectionOperand value) { this.selection = value; }
3737
3838 /**
3939 * Aggregation function for the field
@@ -54,9 +54,9 @@ public class ConditionalPredicateFieldDefClass {
5454 * __Default value:__ `false`
5555 */
5656 @JsonProperty("bin")
57- public Bin getBin() { return bin; }
57+ public ColorBin getBin() { return bin; }
5858 @JsonProperty("bin")
59- public void setBin(Bin value) { this.bin = value; }
59+ public void setBin(ColorBin value) { this.bin = value; }
6060
6161 /**
6262 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateMarkPropFieldDefClass.java+12 −12
@@ -3,11 +3,11 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateMarkPropFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private Legend legend;
1313 private Scale scale;
@@ -16,27 +16,27 @@ public class ConditionalPredicateMarkPropFieldDefClass {
1616 private Type type;
1717
1818 @JsonProperty("test")
19- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
19+ public LogicalOperandPredicate getTest() { return test; }
2020 @JsonProperty("test")
21- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
21+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
2222
2323 /**
2424 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2525 * `0` to `1` for opacity).
2626 */
2727 @JsonProperty("value")
28- public ConditionalPredicateValueDefValue getValue() { return value; }
28+ public ConditionalValueDefValue getValue() { return value; }
2929 @JsonProperty("value")
30- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
30+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
3131
3232 /**
3333 * A [selection name](selection.html), or a series of [composed
3434 * selections](selection.html#compose).
3535 */
3636 @JsonProperty("selection")
37- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
37+ public SelectionOperand getSelection() { return selection; }
3838 @JsonProperty("selection")
39- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
39+ public void setSelection(SelectionOperand value) { this.selection = value; }
4040
4141 /**
4242 * Aggregation function for the field
@@ -57,9 +57,9 @@ public class ConditionalPredicateMarkPropFieldDefClass {
5757 * __Default value:__ `false`
5858 */
5959 @JsonProperty("bin")
60- public Bin getBin() { return bin; }
60+ public ColorBin getBin() { return bin; }
6161 @JsonProperty("bin")
62- public void setBin(Bin value) { this.bin = value; }
62+ public void setBin(ColorBin value) { this.bin = value; }
6363
6464 /**
6565 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateTextFieldDefClass.java+12 −12
@@ -3,38 +3,38 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateTextFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private String format;
1313 private TimeUnit timeUnit;
1414 private Type type;
1515
1616 @JsonProperty("test")
17- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
17+ public LogicalOperandPredicate getTest() { return test; }
1818 @JsonProperty("test")
19- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
19+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
2020
2121 /**
2222 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2323 * `0` to `1` for opacity).
2424 */
2525 @JsonProperty("value")
26- public ConditionalPredicateValueDefValue getValue() { return value; }
26+ public ConditionalValueDefValue getValue() { return value; }
2727 @JsonProperty("value")
28- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
28+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
2929
3030 /**
3131 * A [selection name](selection.html), or a series of [composed
3232 * selections](selection.html#compose).
3333 */
3434 @JsonProperty("selection")
35- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
35+ public SelectionOperand getSelection() { return selection; }
3636 @JsonProperty("selection")
37- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
37+ public void setSelection(SelectionOperand value) { this.selection = value; }
3838
3939 /**
4040 * Aggregation function for the field
@@ -55,9 +55,9 @@ public class ConditionalPredicateTextFieldDefClass {
5555 * __Default value:__ `false`
5656 */
5757 @JsonProperty("bin")
58- public Bin getBin() { return bin; }
58+ public ColorBin getBin() { return bin; }
5959 @JsonProperty("bin")
60- public void setBin(Bin value) { this.bin = value; }
60+ public void setBin(ColorBin value) { this.bin = value; }
6161
6262 /**
6363 * __Required.__ A string defining the name of the field from which to pull a data value
Dschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalPredicateValueDefValue.java+0 −66
@@ -1,66 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
12- * `0` to `1` for opacity).
13- *
14- * A constant value in visual domain.
15- */
16-@JsonDeserialize(using = ConditionalPredicateValueDefValue.Deserializer.class)
17-@JsonSerialize(using = ConditionalPredicateValueDefValue.Serializer.class)
18-public class ConditionalPredicateValueDefValue {
19- public Double doubleValue;
20- public Boolean boolValue;
21- public String stringValue;
22-
23- static class Deserializer extends JsonDeserializer<ConditionalPredicateValueDefValue> {
24- @Override
25- public ConditionalPredicateValueDefValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
26- ConditionalPredicateValueDefValue value = new ConditionalPredicateValueDefValue();
27- switch (jsonParser.currentToken()) {
28- case VALUE_NULL:
29- break;
30- case VALUE_NUMBER_INT:
31- case VALUE_NUMBER_FLOAT:
32- value.doubleValue = jsonParser.readValueAs(Double.class);
33- break;
34- case VALUE_TRUE:
35- case VALUE_FALSE:
36- value.boolValue = jsonParser.readValueAs(Boolean.class);
37- break;
38- case VALUE_STRING:
39- String string = jsonParser.readValueAs(String.class);
40- value.stringValue = string;
41- break;
42- default: throw new IOException("Cannot deserialize ConditionalPredicateValueDefValue");
43- }
44- return value;
45- }
46- }
47-
48- static class Serializer extends JsonSerializer<ConditionalPredicateValueDefValue> {
49- @Override
50- public void serialize(ConditionalPredicateValueDefValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
51- if (obj.doubleValue != null) {
52- jsonGenerator.writeObject(obj.doubleValue);
53- return;
54- }
55- if (obj.boolValue != null) {
56- jsonGenerator.writeObject(obj.boolValue);
57- return;
58- }
59- if (obj.stringValue != null) {
60- jsonGenerator.writeObject(obj.stringValue);
61- return;
62- }
63- jsonGenerator.writeNull();
64- }
65- }
66-}
Mschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalValueDef.java+6 −6
@@ -3,14 +3,14 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalValueDef {
6- private ConditionalValueDefLogicalOperandPredicate test;
6+ private LogicalOperandPredicate test;
77 private ConditionalValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
8+ private SelectionOperand selection;
99
1010 @JsonProperty("test")
11- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
11+ public LogicalOperandPredicate getTest() { return test; }
1212 @JsonProperty("test")
13- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
13+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
1414
1515 /**
1616 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -26,7 +26,7 @@ public class ConditionalValueDef {
2626 * selections](selection.html#compose).
2727 */
2828 @JsonProperty("selection")
29- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
29+ public SelectionOperand getSelection() { return selection; }
3030 @JsonProperty("selection")
31- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
31+ public void setSelection(SelectionOperand value) { this.selection = value; }
3232 }
Dschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalValueDefLogicalOperandPredicate.java+0 −60
@@ -1,60 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The `filter` property must be one of the predicate definitions:
12- * (1) an [expression](types.html#expression) string,
13- * where `datum` can be used to refer to the current data object;
14- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15- * [range predicate](filter.html#range-predicate), [one-of
16- * predicate](filter.html#one-of-predicate);
17- * (3) a [selection predicate](filter.html#selection-predicate);
18- * or (4) a logical operand that combines (1), (2), or (3).
19- */
20-@JsonDeserialize(using = ConditionalValueDefLogicalOperandPredicate.Deserializer.class)
21-@JsonSerialize(using = ConditionalValueDefLogicalOperandPredicate.Serializer.class)
22-public class ConditionalValueDefLogicalOperandPredicate {
23- public Predicate predicateValue;
24- public String stringValue;
25-
26- static class Deserializer extends JsonDeserializer<ConditionalValueDefLogicalOperandPredicate> {
27- @Override
28- public ConditionalValueDefLogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29- ConditionalValueDefLogicalOperandPredicate value = new ConditionalValueDefLogicalOperandPredicate();
30- switch (jsonParser.currentToken()) {
31- case VALUE_NULL:
32- break;
33- case VALUE_STRING:
34- String string = jsonParser.readValueAs(String.class);
35- value.stringValue = string;
36- break;
37- case START_OBJECT:
38- value.predicateValue = jsonParser.readValueAs(Predicate.class);
39- break;
40- default: throw new IOException("Cannot deserialize ConditionalValueDefLogicalOperandPredicate");
41- }
42- return value;
43- }
44- }
45-
46- static class Serializer extends JsonSerializer<ConditionalValueDefLogicalOperandPredicate> {
47- @Override
48- public void serialize(ConditionalValueDefLogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
49- if (obj.predicateValue != null) {
50- jsonGenerator.writeObject(obj.predicateValue);
51- return;
52- }
53- if (obj.stringValue != null) {
54- jsonGenerator.writeObject(obj.stringValue);
55- return;
56- }
57- jsonGenerator.writeNull();
58- }
59- }
60-}
Dschema-java-lombokdefault / src / main / java / io / quicktype / ConditionalValueDefSelectionOperand.java+0 −56
@@ -1,56 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * Filter using a selection name.
12- *
13- * A [selection name](selection.html), or a series of [composed
14- * selections](selection.html#compose).
15- */
16-@JsonDeserialize(using = ConditionalValueDefSelectionOperand.Deserializer.class)
17-@JsonSerialize(using = ConditionalValueDefSelectionOperand.Serializer.class)
18-public class ConditionalValueDefSelectionOperand {
19- public Selection selectionValue;
20- public String stringValue;
21-
22- static class Deserializer extends JsonDeserializer<ConditionalValueDefSelectionOperand> {
23- @Override
24- public ConditionalValueDefSelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25- ConditionalValueDefSelectionOperand value = new ConditionalValueDefSelectionOperand();
26- switch (jsonParser.currentToken()) {
27- case VALUE_NULL:
28- break;
29- case VALUE_STRING:
30- String string = jsonParser.readValueAs(String.class);
31- value.stringValue = string;
32- break;
33- case START_OBJECT:
34- value.selectionValue = jsonParser.readValueAs(Selection.class);
35- break;
36- default: throw new IOException("Cannot deserialize ConditionalValueDefSelectionOperand");
37- }
38- return value;
39- }
40- }
41-
42- static class Serializer extends JsonSerializer<ConditionalValueDefSelectionOperand> {
43- @Override
44- public void serialize(ConditionalValueDefSelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
45- if (obj.selectionValue != null) {
46- jsonGenerator.writeObject(obj.selectionValue);
47- return;
48- }
49- if (obj.stringValue != null) {
50- jsonGenerator.writeObject(obj.stringValue);
51- return;
52- }
53- jsonGenerator.writeNull();
54- }
55- }
56-}
Mschema-java-lombokdefault / src / main / java / io / quicktype / DefWithCondition.java+6 −6
@@ -21,12 +21,12 @@ import java.util.List;
2121 */
2222 public class DefWithCondition {
2323 private AggregateOp aggregate;
24- private Bin bin;
24+ private ColorBin bin;
2525 private HrefCondition condition;
2626 private Field field;
2727 private TimeUnit timeUnit;
2828 private Type type;
29- private ConditionalPredicateValueDefValue value;
29+ private ColorValue value;
3030
3131 /**
3232 * Aggregation function for the field
@@ -47,9 +47,9 @@ public class DefWithCondition {
4747 * __Default value:__ `false`
4848 */
4949 @JsonProperty("bin")
50- public Bin getBin() { return bin; }
50+ public ColorBin getBin() { return bin; }
5151 @JsonProperty("bin")
52- public void setBin(Bin value) { this.bin = value; }
52+ public void setBin(ColorBin value) { this.bin = value; }
5353
5454 /**
5555 * One or more value definition(s) with a selection predicate.
@@ -108,7 +108,7 @@ public class DefWithCondition {
108108 * A constant value in visual domain.
109109 */
110110 @JsonProperty("value")
111- public ConditionalPredicateValueDefValue getValue() { return value; }
111+ public ColorValue getValue() { return value; }
112112 @JsonProperty("value")
113- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
113+ public void setValue(ColorValue value) { this.value = value; }
114114 }
Mschema-java-lombokdefault / src / main / java / io / quicktype / DomainUnion.java+2 −2
@@ -29,7 +29,7 @@ import java.util.List;
2929 @JsonDeserialize(using = DomainUnion.Deserializer.class)
3030 @JsonSerialize(using = DomainUnion.Serializer.class)
3131 public class DomainUnion {
32- public List<OneOfElement> unionArrayValue;
32+ public List<Equal> unionArrayValue;
3333 public DomainClass domainClassValue;
3434 public Domain enumValue;
3535
@@ -49,7 +49,7 @@ public class DomainUnion {
4949 }
5050 break;
5151 case START_ARRAY:
52- value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<OneOfElement>>() {});
52+ value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<Equal>>() {});
5353 break;
5454 case START_OBJECT:
5555 value.domainClassValue = jsonParser.readValueAs(DomainClass.class);
Aschema-java-lombokdefault / src / main / java / io / quicktype / Equal.java+69 −0
@@ -0,0 +1,69 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * The value that the field should be equal to.
12+ */
13+@JsonDeserialize(using = Equal.Deserializer.class)
14+@JsonSerialize(using = Equal.Serializer.class)
15+public class Equal {
16+ public Double doubleValue;
17+ public Boolean boolValue;
18+ public DateTime dateTimeValue;
19+ public String stringValue;
20+
21+ static class Deserializer extends JsonDeserializer<Equal> {
22+ @Override
23+ public Equal deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24+ Equal value = new Equal();
25+ switch (jsonParser.currentToken()) {
26+ case VALUE_NUMBER_INT:
27+ case VALUE_NUMBER_FLOAT:
28+ value.doubleValue = jsonParser.readValueAs(Double.class);
29+ break;
30+ case VALUE_TRUE:
31+ case VALUE_FALSE:
32+ value.boolValue = jsonParser.readValueAs(Boolean.class);
33+ break;
34+ case VALUE_STRING:
35+ String string = jsonParser.readValueAs(String.class);
36+ value.stringValue = string;
37+ break;
38+ case START_OBJECT:
39+ value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
40+ break;
41+ default: throw new IOException("Cannot deserialize Equal");
42+ }
43+ return value;
44+ }
45+ }
46+
47+ static class Serializer extends JsonSerializer<Equal> {
48+ @Override
49+ public void serialize(Equal obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
50+ if (obj.doubleValue != null) {
51+ jsonGenerator.writeObject(obj.doubleValue);
52+ return;
53+ }
54+ if (obj.boolValue != null) {
55+ jsonGenerator.writeObject(obj.boolValue);
56+ return;
57+ }
58+ if (obj.dateTimeValue != null) {
59+ jsonGenerator.writeObject(obj.dateTimeValue);
60+ return;
61+ }
62+ if (obj.stringValue != null) {
63+ jsonGenerator.writeObject(obj.stringValue);
64+ return;
65+ }
66+ throw new IOException("Equal must not be null");
67+ }
68+ }
69+}
Dschema-java-lombokdefault / src / main / java / io / quicktype / EqualUnion.java+0 −71
@@ -1,71 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The value that the field should be equal to.
12- */
13-@JsonDeserialize(using = EqualUnion.Deserializer.class)
14-@JsonSerialize(using = EqualUnion.Serializer.class)
15-public class EqualUnion {
16- public Double doubleValue;
17- public Boolean boolValue;
18- public DateTime dateTimeValue;
19- public String stringValue;
20-
21- static class Deserializer extends JsonDeserializer<EqualUnion> {
22- @Override
23- public EqualUnion deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24- EqualUnion value = new EqualUnion();
25- switch (jsonParser.currentToken()) {
26- case VALUE_NULL:
27- break;
28- case VALUE_NUMBER_INT:
29- case VALUE_NUMBER_FLOAT:
30- value.doubleValue = jsonParser.readValueAs(Double.class);
31- break;
32- case VALUE_TRUE:
33- case VALUE_FALSE:
34- value.boolValue = jsonParser.readValueAs(Boolean.class);
35- break;
36- case VALUE_STRING:
37- String string = jsonParser.readValueAs(String.class);
38- value.stringValue = string;
39- break;
40- case START_OBJECT:
41- value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
42- break;
43- default: throw new IOException("Cannot deserialize EqualUnion");
44- }
45- return value;
46- }
47- }
48-
49- static class Serializer extends JsonSerializer<EqualUnion> {
50- @Override
51- public void serialize(EqualUnion obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
52- if (obj.doubleValue != null) {
53- jsonGenerator.writeObject(obj.doubleValue);
54- return;
55- }
56- if (obj.boolValue != null) {
57- jsonGenerator.writeObject(obj.boolValue);
58- return;
59- }
60- if (obj.dateTimeValue != null) {
61- jsonGenerator.writeObject(obj.dateTimeValue);
62- return;
63- }
64- if (obj.stringValue != null) {
65- jsonGenerator.writeObject(obj.stringValue);
66- return;
67- }
68- jsonGenerator.writeNull();
69- }
70- }
71-}
Mschema-java-lombokdefault / src / main / java / io / quicktype / FacetFieldDef.java+3 −3
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.*;
99 */
1010 public class FacetFieldDef {
1111 private AggregateOp aggregate;
12- private Bin bin;
12+ private ColorBin bin;
1313 private Field field;
1414 private Header header;
1515 private SortEnum sort;
@@ -35,9 +35,9 @@ public class FacetFieldDef {
3535 * __Default value:__ `false`
3636 */
3737 @JsonProperty("bin")
38- public Bin getBin() { return bin; }
38+ public ColorBin getBin() { return bin; }
3939 @JsonProperty("bin")
40- public void setBin(Bin value) { this.bin = value; }
40+ public void setBin(ColorBin value) { this.bin = value; }
4141
4242 /**
4343 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-lombokdefault / src / main / java / io / quicktype / FieldDef.java+3 −3
@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.*;
77 */
88 public class FieldDef {
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private TimeUnit timeUnit;
1313 private Type type;
@@ -31,9 +31,9 @@ public class FieldDef {
3131 * __Default value:__ `false`
3232 */
3333 @JsonProperty("bin")
34- public Bin getBin() { return bin; }
34+ public ColorBin getBin() { return bin; }
3535 @JsonProperty("bin")
36- public void setBin(Bin value) { this.bin = value; }
36+ public void setBin(ColorBin value) { this.bin = value; }
3737
3838 /**
3939 * __Required.__ A string defining the name of the field from which to pull a data value
Aschema-java-lombokdefault / src / main / java / io / quicktype / LogicalOperandPredicate.java+58 −0
@@ -0,0 +1,58 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * The `filter` property must be one of the predicate definitions:
12+ * (1) an [expression](types.html#expression) string,
13+ * where `datum` can be used to refer to the current data object;
14+ * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15+ * [range predicate](filter.html#range-predicate), [one-of
16+ * predicate](filter.html#one-of-predicate);
17+ * (3) a [selection predicate](filter.html#selection-predicate);
18+ * or (4) a logical operand that combines (1), (2), or (3).
19+ */
20+@JsonDeserialize(using = LogicalOperandPredicate.Deserializer.class)
21+@JsonSerialize(using = LogicalOperandPredicate.Serializer.class)
22+public class LogicalOperandPredicate {
23+ public Predicate predicateValue;
24+ public String stringValue;
25+
26+ static class Deserializer extends JsonDeserializer<LogicalOperandPredicate> {
27+ @Override
28+ public LogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29+ LogicalOperandPredicate value = new LogicalOperandPredicate();
30+ switch (jsonParser.currentToken()) {
31+ case VALUE_STRING:
32+ String string = jsonParser.readValueAs(String.class);
33+ value.stringValue = string;
34+ break;
35+ case START_OBJECT:
36+ value.predicateValue = jsonParser.readValueAs(Predicate.class);
37+ break;
38+ default: throw new IOException("Cannot deserialize LogicalOperandPredicate");
39+ }
40+ return value;
41+ }
42+ }
43+
44+ static class Serializer extends JsonSerializer<LogicalOperandPredicate> {
45+ @Override
46+ public void serialize(LogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
47+ if (obj.predicateValue != null) {
48+ jsonGenerator.writeObject(obj.predicateValue);
49+ return;
50+ }
51+ if (obj.stringValue != null) {
52+ jsonGenerator.writeObject(obj.stringValue);
53+ return;
54+ }
55+ throw new IOException("LogicalOperandPredicate must not be null");
56+ }
57+ }
58+}
Dschema-java-lombokdefault / src / main / java / io / quicktype / LogicalOperandPredicateElement.java+0 −58
@@ -1,58 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The `filter` property must be one of the predicate definitions:
12- * (1) an [expression](types.html#expression) string,
13- * where `datum` can be used to refer to the current data object;
14- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15- * [range predicate](filter.html#range-predicate), [one-of
16- * predicate](filter.html#one-of-predicate);
17- * (3) a [selection predicate](filter.html#selection-predicate);
18- * or (4) a logical operand that combines (1), (2), or (3).
19- */
20-@JsonDeserialize(using = LogicalOperandPredicateElement.Deserializer.class)
21-@JsonSerialize(using = LogicalOperandPredicateElement.Serializer.class)
22-public class LogicalOperandPredicateElement {
23- public Predicate predicateValue;
24- public String stringValue;
25-
26- static class Deserializer extends JsonDeserializer<LogicalOperandPredicateElement> {
27- @Override
28- public LogicalOperandPredicateElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29- LogicalOperandPredicateElement value = new LogicalOperandPredicateElement();
30- switch (jsonParser.currentToken()) {
31- case VALUE_STRING:
32- String string = jsonParser.readValueAs(String.class);
33- value.stringValue = string;
34- break;
35- case START_OBJECT:
36- value.predicateValue = jsonParser.readValueAs(Predicate.class);
37- break;
38- default: throw new IOException("Cannot deserialize LogicalOperandPredicateElement");
39- }
40- return value;
41- }
42- }
43-
44- static class Serializer extends JsonSerializer<LogicalOperandPredicateElement> {
45- @Override
46- public void serialize(LogicalOperandPredicateElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
47- if (obj.predicateValue != null) {
48- jsonGenerator.writeObject(obj.predicateValue);
49- return;
50- }
51- if (obj.stringValue != null) {
52- jsonGenerator.writeObject(obj.stringValue);
53- return;
54- }
55- throw new IOException("LogicalOperandPredicateElement must not be null");
56- }
57- }
58-}
Mschema-java-lombokdefault / src / main / java / io / quicktype / MarkPropDefWithCondition.java+6 −6
@@ -48,7 +48,7 @@ import java.util.List;
4848 */
4949 public class MarkPropDefWithCondition {
5050 private AggregateOp aggregate;
51- private Bin bin;
51+ private ColorBin bin;
5252 private ColorCondition condition;
5353 private Field field;
5454 private Legend legend;
@@ -56,7 +56,7 @@ public class MarkPropDefWithCondition {
5656 private SortUnion sort;
5757 private TimeUnit timeUnit;
5858 private Type type;
59- private ConditionalPredicateValueDefValue value;
59+ private ColorValue value;
6060
6161 /**
6262 * Aggregation function for the field
@@ -77,9 +77,9 @@ public class MarkPropDefWithCondition {
7777 * __Default value:__ `false`
7878 */
7979 @JsonProperty("bin")
80- public Bin getBin() { return bin; }
80+ public ColorBin getBin() { return bin; }
8181 @JsonProperty("bin")
82- public void setBin(Bin value) { this.bin = value; }
82+ public void setBin(ColorBin value) { this.bin = value; }
8383
8484 /**
8585 * One or more value definition(s) with a selection predicate.
@@ -174,7 +174,7 @@ public class MarkPropDefWithCondition {
174174 * A constant value in visual domain.
175175 */
176176 @JsonProperty("value")
177- public ConditionalPredicateValueDefValue getValue() { return value; }
177+ public ColorValue getValue() { return value; }
178178 @JsonProperty("value")
179- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
179+ public void setValue(ColorValue value) { this.value = value; }
180180 }
Dschema-java-lombokdefault / src / main / java / io / quicktype / OneOfElement.java+0 −69
@@ -1,69 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The value that the field should be equal to.
12- */
13-@JsonDeserialize(using = OneOfElement.Deserializer.class)
14-@JsonSerialize(using = OneOfElement.Serializer.class)
15-public class OneOfElement {
16- public Double doubleValue;
17- public Boolean boolValue;
18- public DateTime dateTimeValue;
19- public String stringValue;
20-
21- static class Deserializer extends JsonDeserializer<OneOfElement> {
22- @Override
23- public OneOfElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24- OneOfElement value = new OneOfElement();
25- switch (jsonParser.currentToken()) {
26- case VALUE_NUMBER_INT:
27- case VALUE_NUMBER_FLOAT:
28- value.doubleValue = jsonParser.readValueAs(Double.class);
29- break;
30- case VALUE_TRUE:
31- case VALUE_FALSE:
32- value.boolValue = jsonParser.readValueAs(Boolean.class);
33- break;
34- case VALUE_STRING:
35- String string = jsonParser.readValueAs(String.class);
36- value.stringValue = string;
37- break;
38- case START_OBJECT:
39- value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
40- break;
41- default: throw new IOException("Cannot deserialize OneOfElement");
42- }
43- return value;
44- }
45- }
46-
47- static class Serializer extends JsonSerializer<OneOfElement> {
48- @Override
49- public void serialize(OneOfElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
50- if (obj.doubleValue != null) {
51- jsonGenerator.writeObject(obj.doubleValue);
52- return;
53- }
54- if (obj.boolValue != null) {
55- jsonGenerator.writeObject(obj.boolValue);
56- return;
57- }
58- if (obj.dateTimeValue != null) {
59- jsonGenerator.writeObject(obj.dateTimeValue);
60- return;
61- }
62- if (obj.stringValue != null) {
63- jsonGenerator.writeObject(obj.stringValue);
64- return;
65- }
66- throw new IOException("OneOfElement must not be null");
67- }
68- }
69-}
Mschema-java-lombokdefault / src / main / java / io / quicktype / OrderFieldDef.java+3 −3
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*;
44
55 public class OrderFieldDef {
66 private AggregateOp aggregate;
7- private Bin bin;
7+ private ColorBin bin;
88 private Field field;
99 private SortEnum sort;
1010 private TimeUnit timeUnit;
@@ -29,9 +29,9 @@ public class OrderFieldDef {
2929 * __Default value:__ `false`
3030 */
3131 @JsonProperty("bin")
32- public Bin getBin() { return bin; }
32+ public ColorBin getBin() { return bin; }
3333 @JsonProperty("bin")
34- public void setBin(Bin value) { this.bin = value; }
34+ public void setBin(ColorBin value) { this.bin = value; }
3535
3636 /**
3737 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-java-lombokdefault / src / main / java / io / quicktype / Predicate.java+18 −18
@@ -4,38 +4,38 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Predicate {
7- private ConditionalValueDefLogicalOperandPredicate not;
8- private List<LogicalOperandPredicateElement> and;
9- private List<LogicalOperandPredicateElement> or;
10- private EqualUnion equal;
7+ private LogicalOperandPredicate not;
8+ private List<LogicalOperandPredicate> and;
9+ private List<LogicalOperandPredicate> or;
10+ private Equal equal;
1111 private String field;
1212 private TimeUnit timeUnit;
1313 private List<RangeElement> range;
14- private List<OneOfElement> oneOf;
15- private ConditionalValueDefSelectionOperand selection;
14+ private List<Equal> oneOf;
15+ private SelectionOperand selection;
1616
1717 @JsonProperty("not")
18- public ConditionalValueDefLogicalOperandPredicate getNot() { return not; }
18+ public LogicalOperandPredicate getNot() { return not; }
1919 @JsonProperty("not")
20- public void setNot(ConditionalValueDefLogicalOperandPredicate value) { this.not = value; }
20+ public void setNot(LogicalOperandPredicate value) { this.not = value; }
2121
2222 @JsonProperty("and")
23- public List<LogicalOperandPredicateElement> getAnd() { return and; }
23+ public List<LogicalOperandPredicate> getAnd() { return and; }
2424 @JsonProperty("and")
25- public void setAnd(List<LogicalOperandPredicateElement> value) { this.and = value; }
25+ public void setAnd(List<LogicalOperandPredicate> value) { this.and = value; }
2626
2727 @JsonProperty("or")
28- public List<LogicalOperandPredicateElement> getOr() { return or; }
28+ public List<LogicalOperandPredicate> getOr() { return or; }
2929 @JsonProperty("or")
30- public void setOr(List<LogicalOperandPredicateElement> value) { this.or = value; }
30+ public void setOr(List<LogicalOperandPredicate> value) { this.or = value; }
3131
3232 /**
3333 * The value that the field should be equal to.
3434 */
3535 @JsonProperty("equal")
36- public EqualUnion getEqual() { return equal; }
36+ public Equal getEqual() { return equal; }
3737 @JsonProperty("equal")
38- public void setEqual(EqualUnion value) { this.equal = value; }
38+ public void setEqual(Equal value) { this.equal = value; }
3939
4040 /**
4141 * Field to be filtered.
@@ -71,15 +71,15 @@ public class Predicate {
7171 * for a data item included in the filtered data.
7272 */
7373 @JsonProperty("oneOf")
74- public List<OneOfElement> getOneOf() { return oneOf; }
74+ public List<Equal> getOneOf() { return oneOf; }
7575 @JsonProperty("oneOf")
76- public void setOneOf(List<OneOfElement> value) { this.oneOf = value; }
76+ public void setOneOf(List<Equal> value) { this.oneOf = value; }
7777
7878 /**
7979 * Filter using a selection name.
8080 */
8181 @JsonProperty("selection")
82- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
82+ public SelectionOperand getSelection() { return selection; }
8383 @JsonProperty("selection")
84- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
84+ public void setSelection(SelectionOperand value) { this.selection = value; }
8585 }
Mschema-java-lombokdefault / src / main / java / io / quicktype / Selection.java+9 −9
@@ -4,22 +4,22 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Selection {
7- private ConditionalValueDefSelectionOperand not;
8- private List<SelectionOperandElement> and;
9- private List<SelectionOperandElement> or;
7+ private SelectionOperand not;
8+ private List<SelectionOperand> and;
9+ private List<SelectionOperand> or;
1010
1111 @JsonProperty("not")
12- public ConditionalValueDefSelectionOperand getNot() { return not; }
12+ public SelectionOperand getNot() { return not; }
1313 @JsonProperty("not")
14- public void setNot(ConditionalValueDefSelectionOperand value) { this.not = value; }
14+ public void setNot(SelectionOperand value) { this.not = value; }
1515
1616 @JsonProperty("and")
17- public List<SelectionOperandElement> getAnd() { return and; }
17+ public List<SelectionOperand> getAnd() { return and; }
1818 @JsonProperty("and")
19- public void setAnd(List<SelectionOperandElement> value) { this.and = value; }
19+ public void setAnd(List<SelectionOperand> value) { this.and = value; }
2020
2121 @JsonProperty("or")
22- public List<SelectionOperandElement> getOr() { return or; }
22+ public List<SelectionOperand> getOr() { return or; }
2323 @JsonProperty("or")
24- public void setOr(List<SelectionOperandElement> value) { this.or = value; }
24+ public void setOr(List<SelectionOperand> value) { this.or = value; }
2525 }
Aschema-java-lombokdefault / src / main / java / io / quicktype / SelectionOperand.java+54 −0
@@ -0,0 +1,54 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * Filter using a selection name.
12+ *
13+ * A [selection name](selection.html), or a series of [composed
14+ * selections](selection.html#compose).
15+ */
16+@JsonDeserialize(using = SelectionOperand.Deserializer.class)
17+@JsonSerialize(using = SelectionOperand.Serializer.class)
18+public class SelectionOperand {
19+ public Selection selectionValue;
20+ public String stringValue;
21+
22+ static class Deserializer extends JsonDeserializer<SelectionOperand> {
23+ @Override
24+ public SelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25+ SelectionOperand value = new SelectionOperand();
26+ switch (jsonParser.currentToken()) {
27+ case VALUE_STRING:
28+ String string = jsonParser.readValueAs(String.class);
29+ value.stringValue = string;
30+ break;
31+ case START_OBJECT:
32+ value.selectionValue = jsonParser.readValueAs(Selection.class);
33+ break;
34+ default: throw new IOException("Cannot deserialize SelectionOperand");
35+ }
36+ return value;
37+ }
38+ }
39+
40+ static class Serializer extends JsonSerializer<SelectionOperand> {
41+ @Override
42+ public void serialize(SelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
43+ if (obj.selectionValue != null) {
44+ jsonGenerator.writeObject(obj.selectionValue);
45+ return;
46+ }
47+ if (obj.stringValue != null) {
48+ jsonGenerator.writeObject(obj.stringValue);
49+ return;
50+ }
51+ throw new IOException("SelectionOperand must not be null");
52+ }
53+ }
54+}
Dschema-java-lombokdefault / src / main / java / io / quicktype / SelectionOperandElement.java+0 −54
@@ -1,54 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * Filter using a selection name.
12- *
13- * A [selection name](selection.html), or a series of [composed
14- * selections](selection.html#compose).
15- */
16-@JsonDeserialize(using = SelectionOperandElement.Deserializer.class)
17-@JsonSerialize(using = SelectionOperandElement.Serializer.class)
18-public class SelectionOperandElement {
19- public Selection selectionValue;
20- public String stringValue;
21-
22- static class Deserializer extends JsonDeserializer<SelectionOperandElement> {
23- @Override
24- public SelectionOperandElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25- SelectionOperandElement value = new SelectionOperandElement();
26- switch (jsonParser.currentToken()) {
27- case VALUE_STRING:
28- String string = jsonParser.readValueAs(String.class);
29- value.stringValue = string;
30- break;
31- case START_OBJECT:
32- value.selectionValue = jsonParser.readValueAs(Selection.class);
33- break;
34- default: throw new IOException("Cannot deserialize SelectionOperandElement");
35- }
36- return value;
37- }
38- }
39-
40- static class Serializer extends JsonSerializer<SelectionOperandElement> {
41- @Override
42- public void serialize(SelectionOperandElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
43- if (obj.selectionValue != null) {
44- jsonGenerator.writeObject(obj.selectionValue);
45- return;
46- }
47- if (obj.stringValue != null) {
48- jsonGenerator.writeObject(obj.stringValue);
49- return;
50- }
51- throw new IOException("SelectionOperandElement must not be null");
52- }
53- }
54-}
Mschema-java-lombokdefault / src / main / java / io / quicktype / TextDefWithCondition.java+6 −6
@@ -23,13 +23,13 @@ import java.util.List;
2323 */
2424 public class TextDefWithCondition {
2525 private AggregateOp aggregate;
26- private Bin bin;
26+ private ColorBin bin;
2727 private TextCondition condition;
2828 private Field field;
2929 private String format;
3030 private TimeUnit timeUnit;
3131 private Type type;
32- private ConditionalPredicateValueDefValue value;
32+ private ColorValue value;
3333
3434 /**
3535 * Aggregation function for the field
@@ -50,9 +50,9 @@ public class TextDefWithCondition {
5050 * __Default value:__ `false`
5151 */
5252 @JsonProperty("bin")
53- public Bin getBin() { return bin; }
53+ public ColorBin getBin() { return bin; }
5454 @JsonProperty("bin")
55- public void setBin(Bin value) { this.bin = value; }
55+ public void setBin(ColorBin value) { this.bin = value; }
5656
5757 /**
5858 * One or more value definition(s) with a selection predicate.
@@ -120,7 +120,7 @@ public class TextDefWithCondition {
120120 * A constant value in visual domain.
121121 */
122122 @JsonProperty("value")
123- public ConditionalPredicateValueDefValue getValue() { return value; }
123+ public ColorValue getValue() { return value; }
124124 @JsonProperty("value")
125- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
125+ public void setValue(ColorValue value) { this.value = value; }
126126 }
Mschema-java-lombokdefault / src / main / java / io / quicktype / Transform.java+6 −6
@@ -4,13 +4,13 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Transform {
7- private ConditionalValueDefLogicalOperandPredicate filter;
7+ private LogicalOperandPredicate filter;
88 private Style as;
99 private String calculate;
1010 private String transformDefault;
1111 private LookupData from;
1212 private String lookup;
13- private Bin bin;
13+ private TransformBin bin;
1414 private String field;
1515 private TimeUnit timeUnit;
1616 private List<AggregatedFieldDef> aggregate;
@@ -27,9 +27,9 @@ public class Transform {
2727 * or (4) a logical operand that combines (1), (2), or (3).
2828 */
2929 @JsonProperty("filter")
30- public ConditionalValueDefLogicalOperandPredicate getFilter() { return filter; }
30+ public LogicalOperandPredicate getFilter() { return filter; }
3131 @JsonProperty("filter")
32- public void setFilter(ConditionalValueDefLogicalOperandPredicate value) { this.filter = value; }
32+ public void setFilter(LogicalOperandPredicate value) { this.filter = value; }
3333
3434 /**
3535 * The field for storing the computed formula value.
@@ -87,9 +87,9 @@ public class Transform {
8787 * An object indicating bin properties, or simply `true` for using default bin parameters.
8888 */
8989 @JsonProperty("bin")
90- public Bin getBin() { return bin; }
90+ public TransformBin getBin() { return bin; }
9191 @JsonProperty("bin")
92- public void setBin(Bin value) { this.bin = value; }
92+ public void setBin(TransformBin value) { this.bin = value; }
9393
9494 /**
9595 * The data field to bin.
Aschema-java-lombokdefault / src / main / java / io / quicktype / TransformBin.java+48 −0
@@ -0,0 +1,48 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+@JsonDeserialize(using = TransformBin.Deserializer.class)
11+@JsonSerialize(using = TransformBin.Serializer.class)
12+public class TransformBin {
13+ public Boolean boolValue;
14+ public BinParams binParamsValue;
15+
16+ static class Deserializer extends JsonDeserializer<TransformBin> {
17+ @Override
18+ public TransformBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ TransformBin value = new TransformBin();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_TRUE:
22+ case VALUE_FALSE:
23+ value.boolValue = jsonParser.readValueAs(Boolean.class);
24+ break;
25+ case START_OBJECT:
26+ value.binParamsValue = jsonParser.readValueAs(BinParams.class);
27+ break;
28+ default: throw new IOException("Cannot deserialize TransformBin");
29+ }
30+ return value;
31+ }
32+ }
33+
34+ static class Serializer extends JsonSerializer<TransformBin> {
35+ @Override
36+ public void serialize(TransformBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
37+ if (obj.boolValue != null) {
38+ jsonGenerator.writeObject(obj.boolValue);
39+ return;
40+ }
41+ if (obj.binParamsValue != null) {
42+ jsonGenerator.writeObject(obj.binParamsValue);
43+ return;
44+ }
45+ throw new IOException("TransformBin must not be null");
46+ }
47+ }
48+}
Mschema-java-lombokdefault / src / main / java / io / quicktype / Values.java+1 −3
@@ -27,8 +27,6 @@ public class Values {
2727 public Values deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
2828 Values value = new Values();
2929 switch (jsonParser.currentToken()) {
30- case VALUE_NULL:
31- break;
3230 case VALUE_STRING:
3331 String string = jsonParser.readValueAs(String.class);
3432 value.stringValue = string;
@@ -60,7 +58,7 @@ public class Values {
6058 jsonGenerator.writeObject(obj.stringValue);
6159 return;
6260 }
63- jsonGenerator.writeNull();
61+ throw new IOException("Values must not be null");
6462 }
6563 }
6664 }
Mschema-java-lombokdefault / src / main / java / io / quicktype / X2Class.java+6 −6
@@ -13,11 +13,11 @@ import com.fasterxml.jackson.annotation.*;
1313 */
1414 public class X2Class {
1515 private AggregateOp aggregate;
16- private Bin bin;
16+ private ColorBin bin;
1717 private Field field;
1818 private TimeUnit timeUnit;
1919 private Type type;
20- private ConditionalPredicateValueDefValue value;
20+ private ConditionalValueDefValue value;
2121
2222 /**
2323 * Aggregation function for the field
@@ -38,9 +38,9 @@ public class X2Class {
3838 * __Default value:__ `false`
3939 */
4040 @JsonProperty("bin")
41- public Bin getBin() { return bin; }
41+ public ColorBin getBin() { return bin; }
4242 @JsonProperty("bin")
43- public void setBin(Bin value) { this.bin = value; }
43+ public void setBin(ColorBin value) { this.bin = value; }
4444
4545 /**
4646 * __Required.__ A string defining the name of the field from which to pull a data value
@@ -86,7 +86,7 @@ public class X2Class {
8686 * `0` to `1` for opacity).
8787 */
8888 @JsonProperty("value")
89- public ConditionalPredicateValueDefValue getValue() { return value; }
89+ public ConditionalValueDefValue getValue() { return value; }
9090 @JsonProperty("value")
91- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
91+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
9292 }
Mschema-java-lombokdefault / src / main / java / io / quicktype / XClass.java+6 −6
@@ -12,14 +12,14 @@ import com.fasterxml.jackson.annotation.*;
1212 public class XClass {
1313 private AggregateOp aggregate;
1414 private Axis axis;
15- private Bin bin;
15+ private ColorBin bin;
1616 private Field field;
1717 private Scale scale;
1818 private SortUnion sort;
1919 private StackOffset stack;
2020 private TimeUnit timeUnit;
2121 private Type type;
22- private ConditionalPredicateValueDefValue value;
22+ private ConditionalValueDefValue value;
2323
2424 /**
2525 * Aggregation function for the field
@@ -51,9 +51,9 @@ public class XClass {
5151 * __Default value:__ `false`
5252 */
5353 @JsonProperty("bin")
54- public Bin getBin() { return bin; }
54+ public ColorBin getBin() { return bin; }
5555 @JsonProperty("bin")
56- public void setBin(Bin value) { this.bin = value; }
56+ public void setBin(ColorBin value) { this.bin = value; }
5757
5858 /**
5959 * __Required.__ A string defining the name of the field from which to pull a data value
@@ -151,7 +151,7 @@ public class XClass {
151151 * `0` to `1` for opacity).
152152 */
153153 @JsonProperty("value")
154- public ConditionalPredicateValueDefValue getValue() { return value; }
154+ public ConditionalValueDefValue getValue() { return value; }
155155 @JsonProperty("value")
156- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
156+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
157157 }
Mschema-javadefault / src / main / java / io / quicktype / AnyMark.java+1 −3
@@ -24,8 +24,6 @@ public class AnyMark {
2424 public AnyMark deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
2525 AnyMark value = new AnyMark();
2626 switch (jsonParser.currentToken()) {
27- case VALUE_NULL:
28- break;
2927 case VALUE_STRING:
3028 String string = jsonParser.readValueAs(String.class);
3129 try {
@@ -54,7 +52,7 @@ public class AnyMark {
5452 jsonGenerator.writeObject(obj.enumValue);
5553 return;
5654 }
57- jsonGenerator.writeNull();
55+ throw new IOException("AnyMark must not be null");
5856 }
5957 }
6058 }
Dschema-javadefault / src / main / java / io / quicktype / Bin.java+0 −50
@@ -1,50 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-@JsonDeserialize(using = Bin.Deserializer.class)
11-@JsonSerialize(using = Bin.Serializer.class)
12-public class Bin {
13- public Boolean boolValue;
14- public BinParams binParamsValue;
15-
16- static class Deserializer extends JsonDeserializer<Bin> {
17- @Override
18- public Bin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19- Bin value = new Bin();
20- switch (jsonParser.currentToken()) {
21- case VALUE_NULL:
22- break;
23- case VALUE_TRUE:
24- case VALUE_FALSE:
25- value.boolValue = jsonParser.readValueAs(Boolean.class);
26- break;
27- case START_OBJECT:
28- value.binParamsValue = jsonParser.readValueAs(BinParams.class);
29- break;
30- default: throw new IOException("Cannot deserialize Bin");
31- }
32- return value;
33- }
34- }
35-
36- static class Serializer extends JsonSerializer<Bin> {
37- @Override
38- public void serialize(Bin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39- if (obj.boolValue != null) {
40- jsonGenerator.writeObject(obj.boolValue);
41- return;
42- }
43- if (obj.binParamsValue != null) {
44- jsonGenerator.writeObject(obj.binParamsValue);
45- return;
46- }
47- jsonGenerator.writeNull();
48- }
49- }
50-}
Aschema-javadefault / src / main / java / io / quicktype / ColorBin.java+50 −0
@@ -0,0 +1,50 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+@JsonDeserialize(using = ColorBin.Deserializer.class)
11+@JsonSerialize(using = ColorBin.Serializer.class)
12+public class ColorBin {
13+ public Boolean boolValue;
14+ public BinParams binParamsValue;
15+
16+ static class Deserializer extends JsonDeserializer<ColorBin> {
17+ @Override
18+ public ColorBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ ColorBin value = new ColorBin();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_TRUE:
24+ case VALUE_FALSE:
25+ value.boolValue = jsonParser.readValueAs(Boolean.class);
26+ break;
27+ case START_OBJECT:
28+ value.binParamsValue = jsonParser.readValueAs(BinParams.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize ColorBin");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<ColorBin> {
37+ @Override
38+ public void serialize(ColorBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.boolValue != null) {
40+ jsonGenerator.writeObject(obj.boolValue);
41+ return;
42+ }
43+ if (obj.binParamsValue != null) {
44+ jsonGenerator.writeObject(obj.binParamsValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-javadefault / src / main / java / io / quicktype / ColorValue.java+66 −0
@@ -0,0 +1,66 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
12+ * `0` to `1` for opacity).
13+ *
14+ * A constant value in visual domain.
15+ */
16+@JsonDeserialize(using = ColorValue.Deserializer.class)
17+@JsonSerialize(using = ColorValue.Serializer.class)
18+public class ColorValue {
19+ public Double doubleValue;
20+ public Boolean boolValue;
21+ public String stringValue;
22+
23+ static class Deserializer extends JsonDeserializer<ColorValue> {
24+ @Override
25+ public ColorValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
26+ ColorValue value = new ColorValue();
27+ switch (jsonParser.currentToken()) {
28+ case VALUE_NULL:
29+ break;
30+ case VALUE_NUMBER_INT:
31+ case VALUE_NUMBER_FLOAT:
32+ value.doubleValue = jsonParser.readValueAs(Double.class);
33+ break;
34+ case VALUE_TRUE:
35+ case VALUE_FALSE:
36+ value.boolValue = jsonParser.readValueAs(Boolean.class);
37+ break;
38+ case VALUE_STRING:
39+ String string = jsonParser.readValueAs(String.class);
40+ value.stringValue = string;
41+ break;
42+ default: throw new IOException("Cannot deserialize ColorValue");
43+ }
44+ return value;
45+ }
46+ }
47+
48+ static class Serializer extends JsonSerializer<ColorValue> {
49+ @Override
50+ public void serialize(ColorValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
51+ if (obj.doubleValue != null) {
52+ jsonGenerator.writeObject(obj.doubleValue);
53+ return;
54+ }
55+ if (obj.boolValue != null) {
56+ jsonGenerator.writeObject(obj.boolValue);
57+ return;
58+ }
59+ if (obj.stringValue != null) {
60+ jsonGenerator.writeObject(obj.stringValue);
61+ return;
62+ }
63+ jsonGenerator.writeNull();
64+ }
65+ }
66+}
Mschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateFieldDefClass.java+12 −12
@@ -3,37 +3,37 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private TimeUnit timeUnit;
1313 private Type type;
1414
1515 @JsonProperty("test")
16- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
16+ public LogicalOperandPredicate getTest() { return test; }
1717 @JsonProperty("test")
18- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
18+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
1919
2020 /**
2121 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2222 * `0` to `1` for opacity).
2323 */
2424 @JsonProperty("value")
25- public ConditionalPredicateValueDefValue getValue() { return value; }
25+ public ConditionalValueDefValue getValue() { return value; }
2626 @JsonProperty("value")
27- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
27+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
2828
2929 /**
3030 * A [selection name](selection.html), or a series of [composed
3131 * selections](selection.html#compose).
3232 */
3333 @JsonProperty("selection")
34- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
34+ public SelectionOperand getSelection() { return selection; }
3535 @JsonProperty("selection")
36- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
36+ public void setSelection(SelectionOperand value) { this.selection = value; }
3737
3838 /**
3939 * Aggregation function for the field
@@ -54,9 +54,9 @@ public class ConditionalPredicateFieldDefClass {
5454 * __Default value:__ `false`
5555 */
5656 @JsonProperty("bin")
57- public Bin getBin() { return bin; }
57+ public ColorBin getBin() { return bin; }
5858 @JsonProperty("bin")
59- public void setBin(Bin value) { this.bin = value; }
59+ public void setBin(ColorBin value) { this.bin = value; }
6060
6161 /**
6262 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateMarkPropFieldDefClass.java+12 −12
@@ -3,11 +3,11 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateMarkPropFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private Legend legend;
1313 private Scale scale;
@@ -16,27 +16,27 @@ public class ConditionalPredicateMarkPropFieldDefClass {
1616 private Type type;
1717
1818 @JsonProperty("test")
19- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
19+ public LogicalOperandPredicate getTest() { return test; }
2020 @JsonProperty("test")
21- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
21+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
2222
2323 /**
2424 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2525 * `0` to `1` for opacity).
2626 */
2727 @JsonProperty("value")
28- public ConditionalPredicateValueDefValue getValue() { return value; }
28+ public ConditionalValueDefValue getValue() { return value; }
2929 @JsonProperty("value")
30- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
30+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
3131
3232 /**
3333 * A [selection name](selection.html), or a series of [composed
3434 * selections](selection.html#compose).
3535 */
3636 @JsonProperty("selection")
37- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
37+ public SelectionOperand getSelection() { return selection; }
3838 @JsonProperty("selection")
39- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
39+ public void setSelection(SelectionOperand value) { this.selection = value; }
4040
4141 /**
4242 * Aggregation function for the field
@@ -57,9 +57,9 @@ public class ConditionalPredicateMarkPropFieldDefClass {
5757 * __Default value:__ `false`
5858 */
5959 @JsonProperty("bin")
60- public Bin getBin() { return bin; }
60+ public ColorBin getBin() { return bin; }
6161 @JsonProperty("bin")
62- public void setBin(Bin value) { this.bin = value; }
62+ public void setBin(ColorBin value) { this.bin = value; }
6363
6464 /**
6565 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateTextFieldDefClass.java+12 −12
@@ -3,38 +3,38 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalPredicateTextFieldDefClass {
6- private ConditionalValueDefLogicalOperandPredicate test;
7- private ConditionalPredicateValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
6+ private LogicalOperandPredicate test;
7+ private ConditionalValueDefValue value;
8+ private SelectionOperand selection;
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private String format;
1313 private TimeUnit timeUnit;
1414 private Type type;
1515
1616 @JsonProperty("test")
17- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
17+ public LogicalOperandPredicate getTest() { return test; }
1818 @JsonProperty("test")
19- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
19+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
2020
2121 /**
2222 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
2323 * `0` to `1` for opacity).
2424 */
2525 @JsonProperty("value")
26- public ConditionalPredicateValueDefValue getValue() { return value; }
26+ public ConditionalValueDefValue getValue() { return value; }
2727 @JsonProperty("value")
28- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
28+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
2929
3030 /**
3131 * A [selection name](selection.html), or a series of [composed
3232 * selections](selection.html#compose).
3333 */
3434 @JsonProperty("selection")
35- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
35+ public SelectionOperand getSelection() { return selection; }
3636 @JsonProperty("selection")
37- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
37+ public void setSelection(SelectionOperand value) { this.selection = value; }
3838
3939 /**
4040 * Aggregation function for the field
@@ -55,9 +55,9 @@ public class ConditionalPredicateTextFieldDefClass {
5555 * __Default value:__ `false`
5656 */
5757 @JsonProperty("bin")
58- public Bin getBin() { return bin; }
58+ public ColorBin getBin() { return bin; }
5959 @JsonProperty("bin")
60- public void setBin(Bin value) { this.bin = value; }
60+ public void setBin(ColorBin value) { this.bin = value; }
6161
6262 /**
6363 * __Required.__ A string defining the name of the field from which to pull a data value
Dschema-javadefault / src / main / java / io / quicktype / ConditionalPredicateValueDefValue.java+0 −66
@@ -1,66 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
12- * `0` to `1` for opacity).
13- *
14- * A constant value in visual domain.
15- */
16-@JsonDeserialize(using = ConditionalPredicateValueDefValue.Deserializer.class)
17-@JsonSerialize(using = ConditionalPredicateValueDefValue.Serializer.class)
18-public class ConditionalPredicateValueDefValue {
19- public Double doubleValue;
20- public Boolean boolValue;
21- public String stringValue;
22-
23- static class Deserializer extends JsonDeserializer<ConditionalPredicateValueDefValue> {
24- @Override
25- public ConditionalPredicateValueDefValue deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
26- ConditionalPredicateValueDefValue value = new ConditionalPredicateValueDefValue();
27- switch (jsonParser.currentToken()) {
28- case VALUE_NULL:
29- break;
30- case VALUE_NUMBER_INT:
31- case VALUE_NUMBER_FLOAT:
32- value.doubleValue = jsonParser.readValueAs(Double.class);
33- break;
34- case VALUE_TRUE:
35- case VALUE_FALSE:
36- value.boolValue = jsonParser.readValueAs(Boolean.class);
37- break;
38- case VALUE_STRING:
39- String string = jsonParser.readValueAs(String.class);
40- value.stringValue = string;
41- break;
42- default: throw new IOException("Cannot deserialize ConditionalPredicateValueDefValue");
43- }
44- return value;
45- }
46- }
47-
48- static class Serializer extends JsonSerializer<ConditionalPredicateValueDefValue> {
49- @Override
50- public void serialize(ConditionalPredicateValueDefValue obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
51- if (obj.doubleValue != null) {
52- jsonGenerator.writeObject(obj.doubleValue);
53- return;
54- }
55- if (obj.boolValue != null) {
56- jsonGenerator.writeObject(obj.boolValue);
57- return;
58- }
59- if (obj.stringValue != null) {
60- jsonGenerator.writeObject(obj.stringValue);
61- return;
62- }
63- jsonGenerator.writeNull();
64- }
65- }
66-}
Mschema-javadefault / src / main / java / io / quicktype / ConditionalValueDef.java+6 −6
@@ -3,14 +3,14 @@ package io.quicktype;
33 import com.fasterxml.jackson.annotation.*;
44
55 public class ConditionalValueDef {
6- private ConditionalValueDefLogicalOperandPredicate test;
6+ private LogicalOperandPredicate test;
77 private ConditionalValueDefValue value;
8- private ConditionalValueDefSelectionOperand selection;
8+ private SelectionOperand selection;
99
1010 @JsonProperty("test")
11- public ConditionalValueDefLogicalOperandPredicate getTest() { return test; }
11+ public LogicalOperandPredicate getTest() { return test; }
1212 @JsonProperty("test")
13- public void setTest(ConditionalValueDefLogicalOperandPredicate value) { this.test = value; }
13+ public void setTest(LogicalOperandPredicate value) { this.test = value; }
1414
1515 /**
1616 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -26,7 +26,7 @@ public class ConditionalValueDef {
2626 * selections](selection.html#compose).
2727 */
2828 @JsonProperty("selection")
29- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
29+ public SelectionOperand getSelection() { return selection; }
3030 @JsonProperty("selection")
31- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
31+ public void setSelection(SelectionOperand value) { this.selection = value; }
3232 }
Dschema-javadefault / src / main / java / io / quicktype / ConditionalValueDefLogicalOperandPredicate.java+0 −60
@@ -1,60 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The `filter` property must be one of the predicate definitions:
12- * (1) an [expression](types.html#expression) string,
13- * where `datum` can be used to refer to the current data object;
14- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15- * [range predicate](filter.html#range-predicate), [one-of
16- * predicate](filter.html#one-of-predicate);
17- * (3) a [selection predicate](filter.html#selection-predicate);
18- * or (4) a logical operand that combines (1), (2), or (3).
19- */
20-@JsonDeserialize(using = ConditionalValueDefLogicalOperandPredicate.Deserializer.class)
21-@JsonSerialize(using = ConditionalValueDefLogicalOperandPredicate.Serializer.class)
22-public class ConditionalValueDefLogicalOperandPredicate {
23- public Predicate predicateValue;
24- public String stringValue;
25-
26- static class Deserializer extends JsonDeserializer<ConditionalValueDefLogicalOperandPredicate> {
27- @Override
28- public ConditionalValueDefLogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29- ConditionalValueDefLogicalOperandPredicate value = new ConditionalValueDefLogicalOperandPredicate();
30- switch (jsonParser.currentToken()) {
31- case VALUE_NULL:
32- break;
33- case VALUE_STRING:
34- String string = jsonParser.readValueAs(String.class);
35- value.stringValue = string;
36- break;
37- case START_OBJECT:
38- value.predicateValue = jsonParser.readValueAs(Predicate.class);
39- break;
40- default: throw new IOException("Cannot deserialize ConditionalValueDefLogicalOperandPredicate");
41- }
42- return value;
43- }
44- }
45-
46- static class Serializer extends JsonSerializer<ConditionalValueDefLogicalOperandPredicate> {
47- @Override
48- public void serialize(ConditionalValueDefLogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
49- if (obj.predicateValue != null) {
50- jsonGenerator.writeObject(obj.predicateValue);
51- return;
52- }
53- if (obj.stringValue != null) {
54- jsonGenerator.writeObject(obj.stringValue);
55- return;
56- }
57- jsonGenerator.writeNull();
58- }
59- }
60-}
Dschema-javadefault / src / main / java / io / quicktype / ConditionalValueDefSelectionOperand.java+0 −56
@@ -1,56 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * Filter using a selection name.
12- *
13- * A [selection name](selection.html), or a series of [composed
14- * selections](selection.html#compose).
15- */
16-@JsonDeserialize(using = ConditionalValueDefSelectionOperand.Deserializer.class)
17-@JsonSerialize(using = ConditionalValueDefSelectionOperand.Serializer.class)
18-public class ConditionalValueDefSelectionOperand {
19- public Selection selectionValue;
20- public String stringValue;
21-
22- static class Deserializer extends JsonDeserializer<ConditionalValueDefSelectionOperand> {
23- @Override
24- public ConditionalValueDefSelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25- ConditionalValueDefSelectionOperand value = new ConditionalValueDefSelectionOperand();
26- switch (jsonParser.currentToken()) {
27- case VALUE_NULL:
28- break;
29- case VALUE_STRING:
30- String string = jsonParser.readValueAs(String.class);
31- value.stringValue = string;
32- break;
33- case START_OBJECT:
34- value.selectionValue = jsonParser.readValueAs(Selection.class);
35- break;
36- default: throw new IOException("Cannot deserialize ConditionalValueDefSelectionOperand");
37- }
38- return value;
39- }
40- }
41-
42- static class Serializer extends JsonSerializer<ConditionalValueDefSelectionOperand> {
43- @Override
44- public void serialize(ConditionalValueDefSelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
45- if (obj.selectionValue != null) {
46- jsonGenerator.writeObject(obj.selectionValue);
47- return;
48- }
49- if (obj.stringValue != null) {
50- jsonGenerator.writeObject(obj.stringValue);
51- return;
52- }
53- jsonGenerator.writeNull();
54- }
55- }
56-}
Mschema-javadefault / src / main / java / io / quicktype / DefWithCondition.java+6 −6
@@ -21,12 +21,12 @@ import java.util.List;
2121 */
2222 public class DefWithCondition {
2323 private AggregateOp aggregate;
24- private Bin bin;
24+ private ColorBin bin;
2525 private HrefCondition condition;
2626 private Field field;
2727 private TimeUnit timeUnit;
2828 private Type type;
29- private ConditionalPredicateValueDefValue value;
29+ private ColorValue value;
3030
3131 /**
3232 * Aggregation function for the field
@@ -47,9 +47,9 @@ public class DefWithCondition {
4747 * __Default value:__ `false`
4848 */
4949 @JsonProperty("bin")
50- public Bin getBin() { return bin; }
50+ public ColorBin getBin() { return bin; }
5151 @JsonProperty("bin")
52- public void setBin(Bin value) { this.bin = value; }
52+ public void setBin(ColorBin value) { this.bin = value; }
5353
5454 /**
5555 * One or more value definition(s) with a selection predicate.
@@ -108,7 +108,7 @@ public class DefWithCondition {
108108 * A constant value in visual domain.
109109 */
110110 @JsonProperty("value")
111- public ConditionalPredicateValueDefValue getValue() { return value; }
111+ public ColorValue getValue() { return value; }
112112 @JsonProperty("value")
113- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
113+ public void setValue(ColorValue value) { this.value = value; }
114114 }
Mschema-javadefault / src / main / java / io / quicktype / DomainUnion.java+2 −2
@@ -29,7 +29,7 @@ import java.util.List;
2929 @JsonDeserialize(using = DomainUnion.Deserializer.class)
3030 @JsonSerialize(using = DomainUnion.Serializer.class)
3131 public class DomainUnion {
32- public List<OneOfElement> unionArrayValue;
32+ public List<Equal> unionArrayValue;
3333 public DomainClass domainClassValue;
3434 public Domain enumValue;
3535
@@ -49,7 +49,7 @@ public class DomainUnion {
4949 }
5050 break;
5151 case START_ARRAY:
52- value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<OneOfElement>>() {});
52+ value.unionArrayValue = jsonParser.readValueAs(new TypeReference<List<Equal>>() {});
5353 break;
5454 case START_OBJECT:
5555 value.domainClassValue = jsonParser.readValueAs(DomainClass.class);
Aschema-javadefault / src / main / java / io / quicktype / Equal.java+69 −0
@@ -0,0 +1,69 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * The value that the field should be equal to.
12+ */
13+@JsonDeserialize(using = Equal.Deserializer.class)
14+@JsonSerialize(using = Equal.Serializer.class)
15+public class Equal {
16+ public Double doubleValue;
17+ public Boolean boolValue;
18+ public DateTime dateTimeValue;
19+ public String stringValue;
20+
21+ static class Deserializer extends JsonDeserializer<Equal> {
22+ @Override
23+ public Equal deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24+ Equal value = new Equal();
25+ switch (jsonParser.currentToken()) {
26+ case VALUE_NUMBER_INT:
27+ case VALUE_NUMBER_FLOAT:
28+ value.doubleValue = jsonParser.readValueAs(Double.class);
29+ break;
30+ case VALUE_TRUE:
31+ case VALUE_FALSE:
32+ value.boolValue = jsonParser.readValueAs(Boolean.class);
33+ break;
34+ case VALUE_STRING:
35+ String string = jsonParser.readValueAs(String.class);
36+ value.stringValue = string;
37+ break;
38+ case START_OBJECT:
39+ value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
40+ break;
41+ default: throw new IOException("Cannot deserialize Equal");
42+ }
43+ return value;
44+ }
45+ }
46+
47+ static class Serializer extends JsonSerializer<Equal> {
48+ @Override
49+ public void serialize(Equal obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
50+ if (obj.doubleValue != null) {
51+ jsonGenerator.writeObject(obj.doubleValue);
52+ return;
53+ }
54+ if (obj.boolValue != null) {
55+ jsonGenerator.writeObject(obj.boolValue);
56+ return;
57+ }
58+ if (obj.dateTimeValue != null) {
59+ jsonGenerator.writeObject(obj.dateTimeValue);
60+ return;
61+ }
62+ if (obj.stringValue != null) {
63+ jsonGenerator.writeObject(obj.stringValue);
64+ return;
65+ }
66+ throw new IOException("Equal must not be null");
67+ }
68+ }
69+}
Dschema-javadefault / src / main / java / io / quicktype / EqualUnion.java+0 −71
@@ -1,71 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The value that the field should be equal to.
12- */
13-@JsonDeserialize(using = EqualUnion.Deserializer.class)
14-@JsonSerialize(using = EqualUnion.Serializer.class)
15-public class EqualUnion {
16- public Double doubleValue;
17- public Boolean boolValue;
18- public DateTime dateTimeValue;
19- public String stringValue;
20-
21- static class Deserializer extends JsonDeserializer<EqualUnion> {
22- @Override
23- public EqualUnion deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24- EqualUnion value = new EqualUnion();
25- switch (jsonParser.currentToken()) {
26- case VALUE_NULL:
27- break;
28- case VALUE_NUMBER_INT:
29- case VALUE_NUMBER_FLOAT:
30- value.doubleValue = jsonParser.readValueAs(Double.class);
31- break;
32- case VALUE_TRUE:
33- case VALUE_FALSE:
34- value.boolValue = jsonParser.readValueAs(Boolean.class);
35- break;
36- case VALUE_STRING:
37- String string = jsonParser.readValueAs(String.class);
38- value.stringValue = string;
39- break;
40- case START_OBJECT:
41- value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
42- break;
43- default: throw new IOException("Cannot deserialize EqualUnion");
44- }
45- return value;
46- }
47- }
48-
49- static class Serializer extends JsonSerializer<EqualUnion> {
50- @Override
51- public void serialize(EqualUnion obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
52- if (obj.doubleValue != null) {
53- jsonGenerator.writeObject(obj.doubleValue);
54- return;
55- }
56- if (obj.boolValue != null) {
57- jsonGenerator.writeObject(obj.boolValue);
58- return;
59- }
60- if (obj.dateTimeValue != null) {
61- jsonGenerator.writeObject(obj.dateTimeValue);
62- return;
63- }
64- if (obj.stringValue != null) {
65- jsonGenerator.writeObject(obj.stringValue);
66- return;
67- }
68- jsonGenerator.writeNull();
69- }
70- }
71-}
Mschema-javadefault / src / main / java / io / quicktype / FacetFieldDef.java+3 −3
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.*;
99 */
1010 public class FacetFieldDef {
1111 private AggregateOp aggregate;
12- private Bin bin;
12+ private ColorBin bin;
1313 private Field field;
1414 private Header header;
1515 private SortEnum sort;
@@ -35,9 +35,9 @@ public class FacetFieldDef {
3535 * __Default value:__ `false`
3636 */
3737 @JsonProperty("bin")
38- public Bin getBin() { return bin; }
38+ public ColorBin getBin() { return bin; }
3939 @JsonProperty("bin")
40- public void setBin(Bin value) { this.bin = value; }
40+ public void setBin(ColorBin value) { this.bin = value; }
4141
4242 /**
4343 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-javadefault / src / main / java / io / quicktype / FieldDef.java+3 −3
@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.*;
77 */
88 public class FieldDef {
99 private AggregateOp aggregate;
10- private Bin bin;
10+ private ColorBin bin;
1111 private Field field;
1212 private TimeUnit timeUnit;
1313 private Type type;
@@ -31,9 +31,9 @@ public class FieldDef {
3131 * __Default value:__ `false`
3232 */
3333 @JsonProperty("bin")
34- public Bin getBin() { return bin; }
34+ public ColorBin getBin() { return bin; }
3535 @JsonProperty("bin")
36- public void setBin(Bin value) { this.bin = value; }
36+ public void setBin(ColorBin value) { this.bin = value; }
3737
3838 /**
3939 * __Required.__ A string defining the name of the field from which to pull a data value
Aschema-javadefault / src / main / java / io / quicktype / LogicalOperandPredicate.java+58 −0
@@ -0,0 +1,58 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * The `filter` property must be one of the predicate definitions:
12+ * (1) an [expression](types.html#expression) string,
13+ * where `datum` can be used to refer to the current data object;
14+ * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15+ * [range predicate](filter.html#range-predicate), [one-of
16+ * predicate](filter.html#one-of-predicate);
17+ * (3) a [selection predicate](filter.html#selection-predicate);
18+ * or (4) a logical operand that combines (1), (2), or (3).
19+ */
20+@JsonDeserialize(using = LogicalOperandPredicate.Deserializer.class)
21+@JsonSerialize(using = LogicalOperandPredicate.Serializer.class)
22+public class LogicalOperandPredicate {
23+ public Predicate predicateValue;
24+ public String stringValue;
25+
26+ static class Deserializer extends JsonDeserializer<LogicalOperandPredicate> {
27+ @Override
28+ public LogicalOperandPredicate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29+ LogicalOperandPredicate value = new LogicalOperandPredicate();
30+ switch (jsonParser.currentToken()) {
31+ case VALUE_STRING:
32+ String string = jsonParser.readValueAs(String.class);
33+ value.stringValue = string;
34+ break;
35+ case START_OBJECT:
36+ value.predicateValue = jsonParser.readValueAs(Predicate.class);
37+ break;
38+ default: throw new IOException("Cannot deserialize LogicalOperandPredicate");
39+ }
40+ return value;
41+ }
42+ }
43+
44+ static class Serializer extends JsonSerializer<LogicalOperandPredicate> {
45+ @Override
46+ public void serialize(LogicalOperandPredicate obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
47+ if (obj.predicateValue != null) {
48+ jsonGenerator.writeObject(obj.predicateValue);
49+ return;
50+ }
51+ if (obj.stringValue != null) {
52+ jsonGenerator.writeObject(obj.stringValue);
53+ return;
54+ }
55+ throw new IOException("LogicalOperandPredicate must not be null");
56+ }
57+ }
58+}
Dschema-javadefault / src / main / java / io / quicktype / LogicalOperandPredicateElement.java+0 −58
@@ -1,58 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The `filter` property must be one of the predicate definitions:
12- * (1) an [expression](types.html#expression) string,
13- * where `datum` can be used to refer to the current data object;
14- * (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
15- * [range predicate](filter.html#range-predicate), [one-of
16- * predicate](filter.html#one-of-predicate);
17- * (3) a [selection predicate](filter.html#selection-predicate);
18- * or (4) a logical operand that combines (1), (2), or (3).
19- */
20-@JsonDeserialize(using = LogicalOperandPredicateElement.Deserializer.class)
21-@JsonSerialize(using = LogicalOperandPredicateElement.Serializer.class)
22-public class LogicalOperandPredicateElement {
23- public Predicate predicateValue;
24- public String stringValue;
25-
26- static class Deserializer extends JsonDeserializer<LogicalOperandPredicateElement> {
27- @Override
28- public LogicalOperandPredicateElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
29- LogicalOperandPredicateElement value = new LogicalOperandPredicateElement();
30- switch (jsonParser.currentToken()) {
31- case VALUE_STRING:
32- String string = jsonParser.readValueAs(String.class);
33- value.stringValue = string;
34- break;
35- case START_OBJECT:
36- value.predicateValue = jsonParser.readValueAs(Predicate.class);
37- break;
38- default: throw new IOException("Cannot deserialize LogicalOperandPredicateElement");
39- }
40- return value;
41- }
42- }
43-
44- static class Serializer extends JsonSerializer<LogicalOperandPredicateElement> {
45- @Override
46- public void serialize(LogicalOperandPredicateElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
47- if (obj.predicateValue != null) {
48- jsonGenerator.writeObject(obj.predicateValue);
49- return;
50- }
51- if (obj.stringValue != null) {
52- jsonGenerator.writeObject(obj.stringValue);
53- return;
54- }
55- throw new IOException("LogicalOperandPredicateElement must not be null");
56- }
57- }
58-}
Mschema-javadefault / src / main / java / io / quicktype / MarkPropDefWithCondition.java+6 −6
@@ -48,7 +48,7 @@ import java.util.List;
4848 */
4949 public class MarkPropDefWithCondition {
5050 private AggregateOp aggregate;
51- private Bin bin;
51+ private ColorBin bin;
5252 private ColorCondition condition;
5353 private Field field;
5454 private Legend legend;
@@ -56,7 +56,7 @@ public class MarkPropDefWithCondition {
5656 private SortUnion sort;
5757 private TimeUnit timeUnit;
5858 private Type type;
59- private ConditionalPredicateValueDefValue value;
59+ private ColorValue value;
6060
6161 /**
6262 * Aggregation function for the field
@@ -77,9 +77,9 @@ public class MarkPropDefWithCondition {
7777 * __Default value:__ `false`
7878 */
7979 @JsonProperty("bin")
80- public Bin getBin() { return bin; }
80+ public ColorBin getBin() { return bin; }
8181 @JsonProperty("bin")
82- public void setBin(Bin value) { this.bin = value; }
82+ public void setBin(ColorBin value) { this.bin = value; }
8383
8484 /**
8585 * One or more value definition(s) with a selection predicate.
@@ -174,7 +174,7 @@ public class MarkPropDefWithCondition {
174174 * A constant value in visual domain.
175175 */
176176 @JsonProperty("value")
177- public ConditionalPredicateValueDefValue getValue() { return value; }
177+ public ColorValue getValue() { return value; }
178178 @JsonProperty("value")
179- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
179+ public void setValue(ColorValue value) { this.value = value; }
180180 }
Dschema-javadefault / src / main / java / io / quicktype / OneOfElement.java+0 −69
@@ -1,69 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * The value that the field should be equal to.
12- */
13-@JsonDeserialize(using = OneOfElement.Deserializer.class)
14-@JsonSerialize(using = OneOfElement.Serializer.class)
15-public class OneOfElement {
16- public Double doubleValue;
17- public Boolean boolValue;
18- public DateTime dateTimeValue;
19- public String stringValue;
20-
21- static class Deserializer extends JsonDeserializer<OneOfElement> {
22- @Override
23- public OneOfElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
24- OneOfElement value = new OneOfElement();
25- switch (jsonParser.currentToken()) {
26- case VALUE_NUMBER_INT:
27- case VALUE_NUMBER_FLOAT:
28- value.doubleValue = jsonParser.readValueAs(Double.class);
29- break;
30- case VALUE_TRUE:
31- case VALUE_FALSE:
32- value.boolValue = jsonParser.readValueAs(Boolean.class);
33- break;
34- case VALUE_STRING:
35- String string = jsonParser.readValueAs(String.class);
36- value.stringValue = string;
37- break;
38- case START_OBJECT:
39- value.dateTimeValue = jsonParser.readValueAs(DateTime.class);
40- break;
41- default: throw new IOException("Cannot deserialize OneOfElement");
42- }
43- return value;
44- }
45- }
46-
47- static class Serializer extends JsonSerializer<OneOfElement> {
48- @Override
49- public void serialize(OneOfElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
50- if (obj.doubleValue != null) {
51- jsonGenerator.writeObject(obj.doubleValue);
52- return;
53- }
54- if (obj.boolValue != null) {
55- jsonGenerator.writeObject(obj.boolValue);
56- return;
57- }
58- if (obj.dateTimeValue != null) {
59- jsonGenerator.writeObject(obj.dateTimeValue);
60- return;
61- }
62- if (obj.stringValue != null) {
63- jsonGenerator.writeObject(obj.stringValue);
64- return;
65- }
66- throw new IOException("OneOfElement must not be null");
67- }
68- }
69-}
Mschema-javadefault / src / main / java / io / quicktype / OrderFieldDef.java+3 −3
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.*;
44
55 public class OrderFieldDef {
66 private AggregateOp aggregate;
7- private Bin bin;
7+ private ColorBin bin;
88 private Field field;
99 private SortEnum sort;
1010 private TimeUnit timeUnit;
@@ -29,9 +29,9 @@ public class OrderFieldDef {
2929 * __Default value:__ `false`
3030 */
3131 @JsonProperty("bin")
32- public Bin getBin() { return bin; }
32+ public ColorBin getBin() { return bin; }
3333 @JsonProperty("bin")
34- public void setBin(Bin value) { this.bin = value; }
34+ public void setBin(ColorBin value) { this.bin = value; }
3535
3636 /**
3737 * __Required.__ A string defining the name of the field from which to pull a data value
Mschema-javadefault / src / main / java / io / quicktype / Predicate.java+18 −18
@@ -4,38 +4,38 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Predicate {
7- private ConditionalValueDefLogicalOperandPredicate not;
8- private List<LogicalOperandPredicateElement> and;
9- private List<LogicalOperandPredicateElement> or;
10- private EqualUnion equal;
7+ private LogicalOperandPredicate not;
8+ private List<LogicalOperandPredicate> and;
9+ private List<LogicalOperandPredicate> or;
10+ private Equal equal;
1111 private String field;
1212 private TimeUnit timeUnit;
1313 private List<RangeElement> range;
14- private List<OneOfElement> oneOf;
15- private ConditionalValueDefSelectionOperand selection;
14+ private List<Equal> oneOf;
15+ private SelectionOperand selection;
1616
1717 @JsonProperty("not")
18- public ConditionalValueDefLogicalOperandPredicate getNot() { return not; }
18+ public LogicalOperandPredicate getNot() { return not; }
1919 @JsonProperty("not")
20- public void setNot(ConditionalValueDefLogicalOperandPredicate value) { this.not = value; }
20+ public void setNot(LogicalOperandPredicate value) { this.not = value; }
2121
2222 @JsonProperty("and")
23- public List<LogicalOperandPredicateElement> getAnd() { return and; }
23+ public List<LogicalOperandPredicate> getAnd() { return and; }
2424 @JsonProperty("and")
25- public void setAnd(List<LogicalOperandPredicateElement> value) { this.and = value; }
25+ public void setAnd(List<LogicalOperandPredicate> value) { this.and = value; }
2626
2727 @JsonProperty("or")
28- public List<LogicalOperandPredicateElement> getOr() { return or; }
28+ public List<LogicalOperandPredicate> getOr() { return or; }
2929 @JsonProperty("or")
30- public void setOr(List<LogicalOperandPredicateElement> value) { this.or = value; }
30+ public void setOr(List<LogicalOperandPredicate> value) { this.or = value; }
3131
3232 /**
3333 * The value that the field should be equal to.
3434 */
3535 @JsonProperty("equal")
36- public EqualUnion getEqual() { return equal; }
36+ public Equal getEqual() { return equal; }
3737 @JsonProperty("equal")
38- public void setEqual(EqualUnion value) { this.equal = value; }
38+ public void setEqual(Equal value) { this.equal = value; }
3939
4040 /**
4141 * Field to be filtered.
@@ -71,15 +71,15 @@ public class Predicate {
7171 * for a data item included in the filtered data.
7272 */
7373 @JsonProperty("oneOf")
74- public List<OneOfElement> getOneOf() { return oneOf; }
74+ public List<Equal> getOneOf() { return oneOf; }
7575 @JsonProperty("oneOf")
76- public void setOneOf(List<OneOfElement> value) { this.oneOf = value; }
76+ public void setOneOf(List<Equal> value) { this.oneOf = value; }
7777
7878 /**
7979 * Filter using a selection name.
8080 */
8181 @JsonProperty("selection")
82- public ConditionalValueDefSelectionOperand getSelection() { return selection; }
82+ public SelectionOperand getSelection() { return selection; }
8383 @JsonProperty("selection")
84- public void setSelection(ConditionalValueDefSelectionOperand value) { this.selection = value; }
84+ public void setSelection(SelectionOperand value) { this.selection = value; }
8585 }
Mschema-javadefault / src / main / java / io / quicktype / Selection.java+9 −9
@@ -4,22 +4,22 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Selection {
7- private ConditionalValueDefSelectionOperand not;
8- private List<SelectionOperandElement> and;
9- private List<SelectionOperandElement> or;
7+ private SelectionOperand not;
8+ private List<SelectionOperand> and;
9+ private List<SelectionOperand> or;
1010
1111 @JsonProperty("not")
12- public ConditionalValueDefSelectionOperand getNot() { return not; }
12+ public SelectionOperand getNot() { return not; }
1313 @JsonProperty("not")
14- public void setNot(ConditionalValueDefSelectionOperand value) { this.not = value; }
14+ public void setNot(SelectionOperand value) { this.not = value; }
1515
1616 @JsonProperty("and")
17- public List<SelectionOperandElement> getAnd() { return and; }
17+ public List<SelectionOperand> getAnd() { return and; }
1818 @JsonProperty("and")
19- public void setAnd(List<SelectionOperandElement> value) { this.and = value; }
19+ public void setAnd(List<SelectionOperand> value) { this.and = value; }
2020
2121 @JsonProperty("or")
22- public List<SelectionOperandElement> getOr() { return or; }
22+ public List<SelectionOperand> getOr() { return or; }
2323 @JsonProperty("or")
24- public void setOr(List<SelectionOperandElement> value) { this.or = value; }
24+ public void setOr(List<SelectionOperand> value) { this.or = value; }
2525 }
Aschema-javadefault / src / main / java / io / quicktype / SelectionOperand.java+54 −0
@@ -0,0 +1,54 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+/**
11+ * Filter using a selection name.
12+ *
13+ * A [selection name](selection.html), or a series of [composed
14+ * selections](selection.html#compose).
15+ */
16+@JsonDeserialize(using = SelectionOperand.Deserializer.class)
17+@JsonSerialize(using = SelectionOperand.Serializer.class)
18+public class SelectionOperand {
19+ public Selection selectionValue;
20+ public String stringValue;
21+
22+ static class Deserializer extends JsonDeserializer<SelectionOperand> {
23+ @Override
24+ public SelectionOperand deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25+ SelectionOperand value = new SelectionOperand();
26+ switch (jsonParser.currentToken()) {
27+ case VALUE_STRING:
28+ String string = jsonParser.readValueAs(String.class);
29+ value.stringValue = string;
30+ break;
31+ case START_OBJECT:
32+ value.selectionValue = jsonParser.readValueAs(Selection.class);
33+ break;
34+ default: throw new IOException("Cannot deserialize SelectionOperand");
35+ }
36+ return value;
37+ }
38+ }
39+
40+ static class Serializer extends JsonSerializer<SelectionOperand> {
41+ @Override
42+ public void serialize(SelectionOperand obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
43+ if (obj.selectionValue != null) {
44+ jsonGenerator.writeObject(obj.selectionValue);
45+ return;
46+ }
47+ if (obj.stringValue != null) {
48+ jsonGenerator.writeObject(obj.stringValue);
49+ return;
50+ }
51+ throw new IOException("SelectionOperand must not be null");
52+ }
53+ }
54+}
Dschema-javadefault / src / main / java / io / quicktype / SelectionOperandElement.java+0 −54
@@ -1,54 +0,0 @@
1-package io.quicktype;
2-
3-import java.io.IOException;
4-import java.io.IOException;
5-import com.fasterxml.jackson.core.*;
6-import com.fasterxml.jackson.databind.*;
7-import com.fasterxml.jackson.databind.annotation.*;
8-import com.fasterxml.jackson.core.type.*;
9-
10-/**
11- * Filter using a selection name.
12- *
13- * A [selection name](selection.html), or a series of [composed
14- * selections](selection.html#compose).
15- */
16-@JsonDeserialize(using = SelectionOperandElement.Deserializer.class)
17-@JsonSerialize(using = SelectionOperandElement.Serializer.class)
18-public class SelectionOperandElement {
19- public Selection selectionValue;
20- public String stringValue;
21-
22- static class Deserializer extends JsonDeserializer<SelectionOperandElement> {
23- @Override
24- public SelectionOperandElement deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
25- SelectionOperandElement value = new SelectionOperandElement();
26- switch (jsonParser.currentToken()) {
27- case VALUE_STRING:
28- String string = jsonParser.readValueAs(String.class);
29- value.stringValue = string;
30- break;
31- case START_OBJECT:
32- value.selectionValue = jsonParser.readValueAs(Selection.class);
33- break;
34- default: throw new IOException("Cannot deserialize SelectionOperandElement");
35- }
36- return value;
37- }
38- }
39-
40- static class Serializer extends JsonSerializer<SelectionOperandElement> {
41- @Override
42- public void serialize(SelectionOperandElement obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
43- if (obj.selectionValue != null) {
44- jsonGenerator.writeObject(obj.selectionValue);
45- return;
46- }
47- if (obj.stringValue != null) {
48- jsonGenerator.writeObject(obj.stringValue);
49- return;
50- }
51- throw new IOException("SelectionOperandElement must not be null");
52- }
53- }
54-}
Mschema-javadefault / src / main / java / io / quicktype / TextDefWithCondition.java+6 −6
@@ -23,13 +23,13 @@ import java.util.List;
2323 */
2424 public class TextDefWithCondition {
2525 private AggregateOp aggregate;
26- private Bin bin;
26+ private ColorBin bin;
2727 private TextCondition condition;
2828 private Field field;
2929 private String format;
3030 private TimeUnit timeUnit;
3131 private Type type;
32- private ConditionalPredicateValueDefValue value;
32+ private ColorValue value;
3333
3434 /**
3535 * Aggregation function for the field
@@ -50,9 +50,9 @@ public class TextDefWithCondition {
5050 * __Default value:__ `false`
5151 */
5252 @JsonProperty("bin")
53- public Bin getBin() { return bin; }
53+ public ColorBin getBin() { return bin; }
5454 @JsonProperty("bin")
55- public void setBin(Bin value) { this.bin = value; }
55+ public void setBin(ColorBin value) { this.bin = value; }
5656
5757 /**
5858 * One or more value definition(s) with a selection predicate.
@@ -120,7 +120,7 @@ public class TextDefWithCondition {
120120 * A constant value in visual domain.
121121 */
122122 @JsonProperty("value")
123- public ConditionalPredicateValueDefValue getValue() { return value; }
123+ public ColorValue getValue() { return value; }
124124 @JsonProperty("value")
125- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
125+ public void setValue(ColorValue value) { this.value = value; }
126126 }
Mschema-javadefault / src / main / java / io / quicktype / Transform.java+6 −6
@@ -4,13 +4,13 @@ import com.fasterxml.jackson.annotation.*;
44 import java.util.List;
55
66 public class Transform {
7- private ConditionalValueDefLogicalOperandPredicate filter;
7+ private LogicalOperandPredicate filter;
88 private Style as;
99 private String calculate;
1010 private String transformDefault;
1111 private LookupData from;
1212 private String lookup;
13- private Bin bin;
13+ private TransformBin bin;
1414 private String field;
1515 private TimeUnit timeUnit;
1616 private List<AggregatedFieldDef> aggregate;
@@ -27,9 +27,9 @@ public class Transform {
2727 * or (4) a logical operand that combines (1), (2), or (3).
2828 */
2929 @JsonProperty("filter")
30- public ConditionalValueDefLogicalOperandPredicate getFilter() { return filter; }
30+ public LogicalOperandPredicate getFilter() { return filter; }
3131 @JsonProperty("filter")
32- public void setFilter(ConditionalValueDefLogicalOperandPredicate value) { this.filter = value; }
32+ public void setFilter(LogicalOperandPredicate value) { this.filter = value; }
3333
3434 /**
3535 * The field for storing the computed formula value.
@@ -87,9 +87,9 @@ public class Transform {
8787 * An object indicating bin properties, or simply `true` for using default bin parameters.
8888 */
8989 @JsonProperty("bin")
90- public Bin getBin() { return bin; }
90+ public TransformBin getBin() { return bin; }
9191 @JsonProperty("bin")
92- public void setBin(Bin value) { this.bin = value; }
92+ public void setBin(TransformBin value) { this.bin = value; }
9393
9494 /**
9595 * The data field to bin.
Aschema-javadefault / src / main / java / io / quicktype / TransformBin.java+48 −0
@@ -0,0 +1,48 @@
1+package io.quicktype;
2+
3+import java.io.IOException;
4+import java.io.IOException;
5+import com.fasterxml.jackson.core.*;
6+import com.fasterxml.jackson.databind.*;
7+import com.fasterxml.jackson.databind.annotation.*;
8+import com.fasterxml.jackson.core.type.*;
9+
10+@JsonDeserialize(using = TransformBin.Deserializer.class)
11+@JsonSerialize(using = TransformBin.Serializer.class)
12+public class TransformBin {
13+ public Boolean boolValue;
14+ public BinParams binParamsValue;
15+
16+ static class Deserializer extends JsonDeserializer<TransformBin> {
17+ @Override
18+ public TransformBin deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ TransformBin value = new TransformBin();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_TRUE:
22+ case VALUE_FALSE:
23+ value.boolValue = jsonParser.readValueAs(Boolean.class);
24+ break;
25+ case START_OBJECT:
26+ value.binParamsValue = jsonParser.readValueAs(BinParams.class);
27+ break;
28+ default: throw new IOException("Cannot deserialize TransformBin");
29+ }
30+ return value;
31+ }
32+ }
33+
34+ static class Serializer extends JsonSerializer<TransformBin> {
35+ @Override
36+ public void serialize(TransformBin obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
37+ if (obj.boolValue != null) {
38+ jsonGenerator.writeObject(obj.boolValue);
39+ return;
40+ }
41+ if (obj.binParamsValue != null) {
42+ jsonGenerator.writeObject(obj.binParamsValue);
43+ return;
44+ }
45+ throw new IOException("TransformBin must not be null");
46+ }
47+ }
48+}
Mschema-javadefault / src / main / java / io / quicktype / Values.java+1 −3
@@ -27,8 +27,6 @@ public class Values {
2727 public Values deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
2828 Values value = new Values();
2929 switch (jsonParser.currentToken()) {
30- case VALUE_NULL:
31- break;
3230 case VALUE_STRING:
3331 String string = jsonParser.readValueAs(String.class);
3432 value.stringValue = string;
@@ -60,7 +58,7 @@ public class Values {
6058 jsonGenerator.writeObject(obj.stringValue);
6159 return;
6260 }
63- jsonGenerator.writeNull();
61+ throw new IOException("Values must not be null");
6462 }
6563 }
6664 }
Mschema-javadefault / src / main / java / io / quicktype / X2Class.java+6 −6
@@ -13,11 +13,11 @@ import com.fasterxml.jackson.annotation.*;
1313 */
1414 public class X2Class {
1515 private AggregateOp aggregate;
16- private Bin bin;
16+ private ColorBin bin;
1717 private Field field;
1818 private TimeUnit timeUnit;
1919 private Type type;
20- private ConditionalPredicateValueDefValue value;
20+ private ConditionalValueDefValue value;
2121
2222 /**
2323 * Aggregation function for the field
@@ -38,9 +38,9 @@ public class X2Class {
3838 * __Default value:__ `false`
3939 */
4040 @JsonProperty("bin")
41- public Bin getBin() { return bin; }
41+ public ColorBin getBin() { return bin; }
4242 @JsonProperty("bin")
43- public void setBin(Bin value) { this.bin = value; }
43+ public void setBin(ColorBin value) { this.bin = value; }
4444
4545 /**
4646 * __Required.__ A string defining the name of the field from which to pull a data value
@@ -86,7 +86,7 @@ public class X2Class {
8686 * `0` to `1` for opacity).
8787 */
8888 @JsonProperty("value")
89- public ConditionalPredicateValueDefValue getValue() { return value; }
89+ public ConditionalValueDefValue getValue() { return value; }
9090 @JsonProperty("value")
91- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
91+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
9292 }
Mschema-javadefault / src / main / java / io / quicktype / XClass.java+6 −6
@@ -12,14 +12,14 @@ import com.fasterxml.jackson.annotation.*;
1212 public class XClass {
1313 private AggregateOp aggregate;
1414 private Axis axis;
15- private Bin bin;
15+ private ColorBin bin;
1616 private Field field;
1717 private Scale scale;
1818 private SortUnion sort;
1919 private StackOffset stack;
2020 private TimeUnit timeUnit;
2121 private Type type;
22- private ConditionalPredicateValueDefValue value;
22+ private ConditionalValueDefValue value;
2323
2424 /**
2525 * Aggregation function for the field
@@ -51,9 +51,9 @@ public class XClass {
5151 * __Default value:__ `false`
5252 */
5353 @JsonProperty("bin")
54- public Bin getBin() { return bin; }
54+ public ColorBin getBin() { return bin; }
5555 @JsonProperty("bin")
56- public void setBin(Bin value) { this.bin = value; }
56+ public void setBin(ColorBin value) { this.bin = value; }
5757
5858 /**
5959 * __Required.__ A string defining the name of the field from which to pull a data value
@@ -151,7 +151,7 @@ public class XClass {
151151 * `0` to `1` for opacity).
152152 */
153153 @JsonProperty("value")
154- public ConditionalPredicateValueDefValue getValue() { return value; }
154+ public ConditionalValueDefValue getValue() { return value; }
155155 @JsonProperty("value")
156- public void setValue(ConditionalPredicateValueDefValue value) { this.value = value; }
156+ public void setValue(ConditionalValueDefValue value) { this.value = value; }
157157 }
Mschema-javascriptdefault / TopLevel.js+65 −65
@@ -178,9 +178,9 @@ const typeMap = {
178178 { json: "config", js: "config", typ: u(undefined, r("Config")) },
179179 { json: "data", js: "data", typ: u(undefined, r("Data")) },
180180 { json: "description", js: "description", typ: u(undefined, "") },
181- { json: "encoding", js: "encoding", typ: u(undefined, r("EncodingWithFacet")) },
181+ { json: "encoding", js: "encoding", typ: r("EncodingWithFacet") },
182182 { json: "height", js: "height", typ: u(undefined, 3.14) },
183- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
183+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
184184 { json: "name", js: "name", typ: u(undefined, "") },
185185 { json: "padding", js: "padding", typ: u(undefined, u(r("PaddingClass"), 3.14)) },
186186 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
@@ -188,13 +188,13 @@ const typeMap = {
188188 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
189189 { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
190190 { json: "width", js: "width", typ: u(undefined, 3.14) },
191- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
191+ { json: "layer", js: "layer", typ: a(r("LayerSpec")) },
192192 { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
193- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
194- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
195- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
196- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
197- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
193+ { json: "facet", js: "facet", typ: r("FacetMapping") },
194+ { json: "spec", js: "spec", typ: r("Spec") },
195+ { json: "repeat", js: "repeat", typ: r("Repeat") },
196+ { json: "vconcat", js: "vconcat", typ: a(r("Spec")) },
197+ { json: "hconcat", js: "hconcat", typ: a(r("Spec")) },
198198 ], false),
199199 "AutoSizeParams": o([
200200 { json: "contains", js: "contains", typ: u(undefined, r("Contains")) },
@@ -468,8 +468,8 @@ const typeMap = {
468468 "RangeConfigValueVGScheme": o([
469469 { json: "count", js: "count", typ: u(undefined, 3.14) },
470470 { json: "extent", js: "extent", typ: u(undefined, a(3.14)) },
471- { json: "scheme", js: "scheme", typ: u(undefined, "") },
472- { json: "step", js: "step", typ: u(undefined, 3.14) },
471+ { json: "scheme", js: "scheme", typ: "" },
472+ { json: "step", js: "step", typ: 3.14 },
473473 ], false),
474474 "ScaleConfig": o([
475475 { json: "bandPaddingInner", js: "bandPaddingInner", typ: u(undefined, 3.14) },
@@ -538,7 +538,7 @@ const typeMap = {
538538 "VGBinding": o([
539539 { json: "element", js: "element", typ: u(undefined, "") },
540540 { json: "input", js: "input", typ: "" },
541- { json: "options", js: "options", typ: u(undefined, a("")) },
541+ { json: "options", js: "options", typ: a("") },
542542 { json: "max", js: "max", typ: u(undefined, 3.14) },
543543 { json: "min", js: "min", typ: u(undefined, 3.14) },
544544 { json: "step", js: "step", typ: u(undefined, 3.14) },
@@ -666,9 +666,9 @@ const typeMap = {
666666 ], false),
667667 "Data": o([
668668 { json: "format", js: "format", typ: u(undefined, r("DataFormat")) },
669- { json: "url", js: "url", typ: u(undefined, "") },
670- { json: "values", js: "values", typ: u(undefined, u(a(u(true, 3.14, m("any"), "")), m("any"), "")) },
671- { json: "name", js: "name", typ: u(undefined, "") },
669+ { json: "url", js: "url", typ: "" },
670+ { json: "values", js: "values", typ: u(a(u(true, 3.14, m("any"), "")), m("any"), "") },
671+ { json: "name", js: "name", typ: "" },
672672 ], false),
673673 "DataFormat": o([
674674 { json: "parse", js: "parse", typ: u(undefined, u(r("ParseEnum"), m("any"))) },
@@ -703,7 +703,7 @@ const typeMap = {
703703 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
704704 { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
705705 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
706- { json: "type", js: "type", typ: u(undefined, r("Type")) },
706+ { json: "type", js: "type", typ: r("Type") },
707707 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
708708 ], false),
709709 "BinParams": o([
@@ -717,25 +717,25 @@ const typeMap = {
717717 { json: "steps", js: "steps", typ: u(undefined, a(3.14)) },
718718 ], false),
719719 "ConditionalValueDef": o([
720- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
720+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
721721 { json: "value", js: "value", typ: u(true, 3.14, "") },
722- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
722+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
723723 ], false),
724724 "Selection": o([
725- { json: "not", js: "not", typ: u(undefined, u(r("Selection"), "")) },
726- { json: "and", js: "and", typ: u(undefined, a(u(r("Selection"), ""))) },
727- { json: "or", js: "or", typ: u(undefined, a(u(r("Selection"), ""))) },
725+ { json: "not", js: "not", typ: u(r("Selection"), "") },
726+ { json: "and", js: "and", typ: a(u(r("Selection"), "")) },
727+ { json: "or", js: "or", typ: a(u(r("Selection"), "")) },
728728 ], false),
729729 "Predicate": o([
730- { json: "not", js: "not", typ: u(undefined, u(r("Predicate"), "")) },
731- { json: "and", js: "and", typ: u(undefined, a(u(r("Predicate"), ""))) },
732- { json: "or", js: "or", typ: u(undefined, a(u(r("Predicate"), ""))) },
733- { json: "equal", js: "equal", typ: u(undefined, u(true, r("DateTime"), 3.14, "")) },
734- { json: "field", js: "field", typ: u(undefined, "") },
730+ { json: "not", js: "not", typ: u(r("Predicate"), "") },
731+ { json: "and", js: "and", typ: a(u(r("Predicate"), "")) },
732+ { json: "or", js: "or", typ: a(u(r("Predicate"), "")) },
733+ { json: "equal", js: "equal", typ: u(true, r("DateTime"), 3.14, "") },
734+ { json: "field", js: "field", typ: "" },
735735 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
736- { json: "range", js: "range", typ: u(undefined, a(u(r("DateTime"), 3.14, null))) },
737- { json: "oneOf", js: "oneOf", typ: u(undefined, a(u(true, r("DateTime"), 3.14, ""))) },
738- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
736+ { json: "range", js: "range", typ: a(u(r("DateTime"), 3.14, null)) },
737+ { json: "oneOf", js: "oneOf", typ: a(u(true, r("DateTime"), 3.14, "")) },
738+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
739739 ], false),
740740 "DateTime": o([
741741 { json: "date", js: "date", typ: u(undefined, 3.14) },
@@ -750,9 +750,9 @@ const typeMap = {
750750 { json: "year", js: "year", typ: u(undefined, 3.14) },
751751 ], false),
752752 "ConditionalPredicateMarkPropFieldDefClass": o([
753- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
754- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
755- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
753+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
754+ { json: "value", js: "value", typ: u(true, 3.14, "") },
755+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
756756 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
757757 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
758758 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
@@ -760,7 +760,7 @@ const typeMap = {
760760 { json: "scale", js: "scale", typ: u(undefined, r("Scale")) },
761761 { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
762762 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
763- { json: "type", js: "type", typ: u(undefined, r("Type")) },
763+ { json: "type", js: "type", typ: r("Type") },
764764 ], false),
765765 "RepeatRef": o([
766766 { json: "repeat", js: "repeat", typ: r("RepeatEnum") },
@@ -843,18 +843,18 @@ const typeMap = {
843843 { json: "condition", js: "condition", typ: u(undefined, u(a(r("ConditionalValueDef")), r("ConditionalPredicateFieldDefClass"))) },
844844 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
845845 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
846- { json: "type", js: "type", typ: u(undefined, r("Type")) },
846+ { json: "type", js: "type", typ: r("Type") },
847847 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
848848 ], false),
849849 "ConditionalPredicateFieldDefClass": o([
850- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
851- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
852- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
850+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
851+ { json: "value", js: "value", typ: u(true, 3.14, "") },
852+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
853853 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
854854 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
855855 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
856856 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
857- { json: "type", js: "type", typ: u(undefined, r("Type")) },
857+ { json: "type", js: "type", typ: r("Type") },
858858 ], false),
859859 "OrderFieldDef": o([
860860 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
@@ -871,19 +871,19 @@ const typeMap = {
871871 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
872872 { json: "format", js: "format", typ: u(undefined, "") },
873873 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
874- { json: "type", js: "type", typ: u(undefined, r("Type")) },
874+ { json: "type", js: "type", typ: r("Type") },
875875 { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
876876 ], false),
877877 "ConditionalPredicateTextFieldDefClass": o([
878- { json: "test", js: "test", typ: u(undefined, u(r("Predicate"), "")) },
879- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
880- { json: "selection", js: "selection", typ: u(undefined, u(r("Selection"), "")) },
878+ { json: "test", js: "test", typ: u(r("Predicate"), "") },
879+ { json: "value", js: "value", typ: u(true, 3.14, "") },
880+ { json: "selection", js: "selection", typ: u(r("Selection"), "") },
881881 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
882882 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
883883 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
884884 { json: "format", js: "format", typ: u(undefined, "") },
885885 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
886- { json: "type", js: "type", typ: u(undefined, r("Type")) },
886+ { json: "type", js: "type", typ: r("Type") },
887887 ], false),
888888 "XClass": o([
889889 { json: "aggregate", js: "aggregate", typ: u(undefined, r("AggregateOp")) },
@@ -894,8 +894,8 @@ const typeMap = {
894894 { json: "sort", js: "sort", typ: u(undefined, u(r("SortField"), r("SortEnum"), null)) },
895895 { json: "stack", js: "stack", typ: u(undefined, u(r("StackOffset"), null)) },
896896 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
897- { json: "type", js: "type", typ: u(undefined, r("Type")) },
898- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
897+ { json: "type", js: "type", typ: r("Type") },
898+ { json: "value", js: "value", typ: u(true, 3.14, "") },
899899 ], false),
900900 "Axis": o([
901901 { json: "domain", js: "domain", typ: u(undefined, true) },
@@ -926,8 +926,8 @@ const typeMap = {
926926 { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
927927 { json: "field", js: "field", typ: u(undefined, u(r("RepeatRef"), "")) },
928928 { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
929- { json: "type", js: "type", typ: u(undefined, r("Type")) },
930- { json: "value", js: "value", typ: u(undefined, u(true, 3.14, "")) },
929+ { json: "type", js: "type", typ: r("Type") },
930+ { json: "value", js: "value", typ: u(true, 3.14, "") },
931931 ], false),
932932 "FacetMapping": o([
933933 { json: "column", js: "column", typ: u(undefined, r("FacetFieldDef")) },
@@ -937,21 +937,21 @@ const typeMap = {
937937 { json: "data", js: "data", typ: u(undefined, r("Data")) },
938938 { json: "description", js: "description", typ: u(undefined, "") },
939939 { json: "height", js: "height", typ: u(undefined, 3.14) },
940- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
940+ { json: "layer", js: "layer", typ: a(r("LayerSpec")) },
941941 { json: "name", js: "name", typ: u(undefined, "") },
942942 { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
943943 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
944944 { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
945945 { json: "width", js: "width", typ: u(undefined, 3.14) },
946- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
947- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
946+ { json: "encoding", js: "encoding", typ: r("Encoding") },
947+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
948948 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
949949 { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
950- { json: "facet", js: "facet", typ: u(undefined, r("FacetMapping")) },
951- { json: "spec", js: "spec", typ: u(undefined, r("Spec")) },
952- { json: "repeat", js: "repeat", typ: u(undefined, r("Repeat")) },
953- { json: "vconcat", js: "vconcat", typ: u(undefined, a(r("Spec"))) },
954- { json: "hconcat", js: "hconcat", typ: u(undefined, a(r("Spec"))) },
950+ { json: "facet", js: "facet", typ: r("FacetMapping") },
951+ { json: "spec", js: "spec", typ: r("Spec") },
952+ { json: "repeat", js: "repeat", typ: r("Repeat") },
953+ { json: "vconcat", js: "vconcat", typ: a(r("Spec")) },
954+ { json: "hconcat", js: "hconcat", typ: a(r("Spec")) },
955955 ], false),
956956 "Encoding": o([
957957 { json: "color", js: "color", typ: u(undefined, r("MarkPropDefWithCondition")) },
@@ -972,14 +972,14 @@ const typeMap = {
972972 { json: "data", js: "data", typ: u(undefined, r("Data")) },
973973 { json: "description", js: "description", typ: u(undefined, "") },
974974 { json: "height", js: "height", typ: u(undefined, 3.14) },
975- { json: "layer", js: "layer", typ: u(undefined, a(r("LayerSpec"))) },
975+ { json: "layer", js: "layer", typ: a(r("LayerSpec")) },
976976 { json: "name", js: "name", typ: u(undefined, "") },
977977 { json: "resolve", js: "resolve", typ: u(undefined, r("Resolve")) },
978978 { json: "title", js: "title", typ: u(undefined, u(r("TitleParams"), "")) },
979979 { json: "transform", js: "transform", typ: u(undefined, a(r("Transform"))) },
980980 { json: "width", js: "width", typ: u(undefined, 3.14) },
981- { json: "encoding", js: "encoding", typ: u(undefined, r("Encoding")) },
982- { json: "mark", js: "mark", typ: u(undefined, u(r("MarkDef"), r("Mark"))) },
981+ { json: "encoding", js: "encoding", typ: r("Encoding") },
982+ { json: "mark", js: "mark", typ: u(r("MarkDef"), r("Mark")) },
983983 { json: "projection", js: "projection", typ: u(undefined, r("Projection")) },
984984 { json: "selection", js: "selection", typ: u(undefined, m(r("SelectionDef"))) },
985985 ], false),
@@ -1083,16 +1083,16 @@ const typeMap = {
10831083 { json: "text", js: "text", typ: "" },
10841084 ], false),
10851085 "Transform": o([
1086- { json: "filter", js: "filter", typ: u(undefined, u(r("Predicate"), "")) },
1086+ { json: "filter", js: "filter", typ: u(r("Predicate"), "") },
10871087 { json: "as", js: "as", typ: u(undefined, u(a(""), "")) },
1088- { json: "calculate", js: "calculate", typ: u(undefined, "") },
1088+ { json: "calculate", js: "calculate", typ: "" },
10891089 { json: "default", js: "default", typ: u(undefined, "") },
1090- { json: "from", js: "from", typ: u(undefined, r("LookupData")) },
1091- { json: "lookup", js: "lookup", typ: u(undefined, "") },
1092- { json: "bin", js: "bin", typ: u(undefined, u(true, r("BinParams"))) },
1093- { json: "field", js: "field", typ: u(undefined, "") },
1094- { json: "timeUnit", js: "timeUnit", typ: u(undefined, r("TimeUnit")) },
1095- { json: "aggregate", js: "aggregate", typ: u(undefined, a(r("AggregatedFieldDef"))) },
1090+ { json: "from", js: "from", typ: r("LookupData") },
1091+ { json: "lookup", js: "lookup", typ: "" },
1092+ { json: "bin", js: "bin", typ: u(true, r("BinParams")) },
1093+ { json: "field", js: "field", typ: "" },
1094+ { json: "timeUnit", js: "timeUnit", typ: r("TimeUnit") },
1095+ { json: "aggregate", js: "aggregate", typ: a(r("AggregatedFieldDef")) },
10961096 { json: "groupby", js: "groupby", typ: u(undefined, a("")) },
10971097 ], false),
10981098 "AggregatedFieldDef": o([
Mschema-kotlin-jacksondefault / TopLevel.kt+135 −64
@@ -149,7 +149,8 @@ data class TopLevel (
149149 /**
150150 * A key-value mapping between encoding channels and definition of fields.
151151 */
152- val encoding: EncodingWithFacet? = null,
152+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
153+ val encoding: EncodingWithFacet,
153154
154155 /**
155156 * The height of a visualization.
@@ -178,7 +179,8 @@ data class TopLevel (
178179 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
179180 * object](mark.html#mark-def).
180181 */
181- val mark: AnyMark? = null,
182+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
183+ val mark: AnyMark,
182184
183185 /**
184186 * Name of the visualization for later reference.
@@ -248,7 +250,8 @@ data class TopLevel (
248250 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
249251 * layering facet specifications is not allowed.
250252 */
251- val layer: List<LayerSpec>? = null,
253+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
254+ val layer: List<LayerSpec>,
252255
253256 /**
254257 * Scale, axis, and legend resolutions for layers.
@@ -267,28 +270,33 @@ data class TopLevel (
267270 * An object that describes mappings between `row` and `column` channels and their field
268271 * definitions.
269272 */
270- val facet: FacetMapping? = null,
273+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
274+ val facet: FacetMapping,
271275
272276 /**
273277 * A specification of the view that gets faceted.
274278 */
275- val spec: Spec? = null,
279+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
280+ val spec: Spec,
276281
277282 /**
278283 * An object that describes what fields should be repeated into views that are laid out as a
279284 * `row` or `column`.
280285 */
281- val repeat: Repeat? = null,
286+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
287+ val repeat: Repeat,
282288
283289 /**
284290 * A list of views that should be concatenated and put into a column.
285291 */
286- val vconcat: List<Spec>? = null,
292+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
293+ val vconcat: List<Spec>,
287294
288295 /**
289296 * A list of views that should be concatenated and put into a row.
290297 */
291- val hconcat: List<Spec>? = null
298+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
299+ val hconcat: List<Spec>
292300 ) {
293301 fun toJson() = mapper.writeValueAsString(this)
294302
@@ -2400,7 +2408,10 @@ sealed class RangeConfigValue {
24002408 data class VGScheme (
24012409 val count: Double? = null,
24022410 val extent: List<Double>? = null,
2403- val scheme: String? = null,
2411+
2412+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2413+ val scheme: String,
2414+
24042415 val step: Double? = null
24052416 )
24062417
@@ -2980,7 +2991,9 @@ data class VGBinding (
29802991 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
29812992 val input: String,
29822993
2983- val options: List<String>? = null,
2994+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2995+ val options: List<String>,
2996+
29842997 val max: Double? = null,
29852998 val min: Double? = null,
29862999 val step: Double? = null
@@ -3875,7 +3888,8 @@ data class Data (
38753888 * An URL from which to load the data set. Use the `format.type` property
38763889 * to ensure the loaded data is correctly parsed.
38773890 */
3878- val url: String? = null,
3891+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
3892+ val url: String,
38793893
38803894 /**
38813895 * The full data set, included inline. This can be an array of objects or primitive values
@@ -3883,12 +3897,14 @@ data class Data (
38833897 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
38843898 * parsed according to the specified format type.
38853899 */
3886- val values: Values? = null,
3900+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
3901+ val values: Values,
38873902
38883903 /**
38893904 * Provide a placeholder name and bind data at runtime.
38903905 */
3891- val name: String? = null
3906+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
3907+ val name: String
38923908 )
38933909
38943910 /**
@@ -4289,7 +4305,8 @@ data class MarkPropDefWithCondition (
42894305 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
42904306 * [geographic projection](projection.html) is applied.
42914307 */
4292- val type: Type? = null,
4308+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4309+ val type: Type,
42934310
42944311 /**
42954312 * A constant value in visual domain.
@@ -4463,7 +4480,8 @@ sealed class ColorCondition {
44634480 }
44644481
44654482 data class ConditionalValueDef (
4466- val test: LogicalOperandPredicate? = null,
4483+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4484+ val test: LogicalOperandPredicate,
44674485
44684486 /**
44694487 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -4476,13 +4494,19 @@ data class ConditionalValueDef (
44764494 * A [selection name](selection.html), or a series of [composed
44774495 * selections](selection.html#compose).
44784496 */
4479- val selection: SelectionOperand? = null
4497+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4498+ val selection: SelectionOperand
44804499 )
44814500
44824501 data class Selection (
4483- val not: SelectionOperand? = null,
4484- val and: List<SelectionOperand>? = null,
4485- val or: List<SelectionOperand>? = null
4502+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4503+ val not: SelectionOperand,
4504+
4505+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4506+ val and: List<SelectionOperand>,
4507+
4508+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4509+ val or: List<SelectionOperand>
44864510 )
44874511
44884512 /**
@@ -4510,21 +4534,28 @@ sealed class SelectionOperand {
45104534 }
45114535
45124536 data class Predicate (
4513- val not: LogicalOperandPredicate? = null,
4514- val and: List<LogicalOperandPredicate>? = null,
4515- val or: List<LogicalOperandPredicate>? = null,
4537+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4538+ val not: LogicalOperandPredicate,
4539+
4540+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4541+ val and: List<LogicalOperandPredicate>,
4542+
4543+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4544+ val or: List<LogicalOperandPredicate>,
45164545
45174546 /**
45184547 * The value that the field should be equal to.
45194548 */
4520- val equal: Equal? = null,
4549+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4550+ val equal: Equal,
45214551
45224552 /**
45234553 * Field to be filtered.
45244554 *
45254555 * Field to be filtered
45264556 */
4527- val field: String? = null,
4557+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4558+ val field: String,
45284559
45294560 /**
45304561 * Time unit for the field to be filtered.
@@ -4537,18 +4568,21 @@ data class Predicate (
45374568 * An array of inclusive minimum and maximum values
45384569 * for a field value of a data item to be included in the filtered data.
45394570 */
4540- val range: List<RangeElement>? = null,
4571+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4572+ val range: List<RangeElement>,
45414573
45424574 /**
45434575 * A set of values that the `field`'s value should be a member of,
45444576 * for a data item included in the filtered data.
45454577 */
4546- val oneOf: List<Equal>? = null,
4578+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4579+ val oneOf: List<Equal>,
45474580
45484581 /**
45494582 * Filter using a selection name.
45504583 */
4551- val selection: SelectionOperand? = null
4584+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4585+ val selection: SelectionOperand
45524586 )
45534587
45544588 /**
@@ -4877,19 +4911,22 @@ sealed class ConditionalValueDefValue {
48774911 }
48784912
48794913 data class ConditionalPredicateMarkPropFieldDefClass (
4880- val test: LogicalOperandPredicate? = null,
4914+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4915+ val test: LogicalOperandPredicate,
48814916
48824917 /**
48834918 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
48844919 * `0` to `1` for opacity).
48854920 */
4886- val value: ConditionalValueDefValue? = null,
4921+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4922+ val value: ConditionalValueDefValue,
48874923
48884924 /**
48894925 * A [selection name](selection.html), or a series of [composed
48904926 * selections](selection.html#compose).
48914927 */
4892- val selection: SelectionOperand? = null,
4928+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
4929+ val selection: SelectionOperand,
48934930
48944931 /**
48954932 * Aggregation function for the field
@@ -4963,7 +5000,8 @@ data class ConditionalPredicateMarkPropFieldDefClass (
49635000 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
49645001 * [geographic projection](projection.html) is applied.
49655002 */
4966- val type: Type? = null
5003+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
5004+ val type: Type
49675005 )
49685006
49695007 sealed class Field {
@@ -6045,7 +6083,8 @@ data class DefWithCondition (
60456083 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
60466084 * [geographic projection](projection.html) is applied.
60476085 */
6048- val type: Type? = null,
6086+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6087+ val type: Type,
60496088
60506089 /**
60516090 * A constant value in visual domain.
@@ -6072,19 +6111,22 @@ sealed class HrefCondition {
60726111 }
60736112
60746113 data class ConditionalPredicateFieldDefClass (
6075- val test: LogicalOperandPredicate? = null,
6114+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6115+ val test: LogicalOperandPredicate,
60766116
60776117 /**
60786118 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
60796119 * `0` to `1` for opacity).
60806120 */
6081- val value: ConditionalValueDefValue? = null,
6121+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6122+ val value: ConditionalValueDefValue,
60826123
60836124 /**
60846125 * A [selection name](selection.html), or a series of [composed
60856126 * selections](selection.html#compose).
60866127 */
6087- val selection: SelectionOperand? = null,
6128+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6129+ val selection: SelectionOperand,
60886130
60896131 /**
60906132 * Aggregation function for the field
@@ -6131,7 +6173,8 @@ data class ConditionalPredicateFieldDefClass (
61316173 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
61326174 * [geographic projection](projection.html) is applied.
61336175 */
6134- val type: Type? = null
6176+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6177+ val type: Type
61356178 )
61366179
61376180 sealed class Order {
@@ -6288,7 +6331,8 @@ data class TextDefWithCondition (
62886331 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
62896332 * [geographic projection](projection.html) is applied.
62906333 */
6291- val type: Type? = null,
6334+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6335+ val type: Type,
62926336
62936337 /**
62946338 * A constant value in visual domain.
@@ -6315,19 +6359,22 @@ sealed class TextCondition {
63156359 }
63166360
63176361 data class ConditionalPredicateTextFieldDefClass (
6318- val test: LogicalOperandPredicate? = null,
6362+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6363+ val test: LogicalOperandPredicate,
63196364
63206365 /**
63216366 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
63226367 * `0` to `1` for opacity).
63236368 */
6324- val value: ConditionalValueDefValue? = null,
6369+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6370+ val value: ConditionalValueDefValue,
63256371
63266372 /**
63276373 * A [selection name](selection.html), or a series of [composed
63286374 * selections](selection.html#compose).
63296375 */
6330- val selection: SelectionOperand? = null,
6376+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6377+ val selection: SelectionOperand,
63316378
63326379 /**
63336380 * Aggregation function for the field
@@ -6380,7 +6427,8 @@ data class ConditionalPredicateTextFieldDefClass (
63806427 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
63816428 * [geographic projection](projection.html) is applied.
63826429 */
6383- val type: Type? = null
6430+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6431+ val type: Type
63846432 )
63856433
63866434 /**
@@ -6487,13 +6535,15 @@ data class XClass (
64876535 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
64886536 * [geographic projection](projection.html) is applied.
64896537 */
6490- val type: Type? = null,
6538+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6539+ val type: Type,
64916540
64926541 /**
64936542 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
64946543 * `0` to `1` for opacity).
64956544 */
6496- val value: ConditionalValueDefValue? = null
6545+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6546+ val value: ConditionalValueDefValue
64976547 )
64986548
64996549 data class Axis (
@@ -6757,13 +6807,15 @@ data class X2Class (
67576807 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
67586808 * [geographic projection](projection.html) is applied.
67596809 */
6760- val type: Type? = null,
6810+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6811+ val type: Type,
67616812
67626813 /**
67636814 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
67646815 * `0` to `1` for opacity).
67656816 */
6766- val value: ConditionalValueDefValue? = null
6817+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6818+ val value: ConditionalValueDefValue
67676819 )
67686820
67696821 /**
@@ -6823,7 +6875,8 @@ data class Spec (
68236875 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
68246876 * layering facet specifications is not allowed.
68256877 */
6826- val layer: List<LayerSpec>? = null,
6878+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6879+ val layer: List<LayerSpec>,
68276880
68286881 /**
68296882 * Name of the visualization for later reference.
@@ -6880,7 +6933,8 @@ data class Spec (
68806933 /**
68816934 * A key-value mapping between encoding channels and definition of fields.
68826935 */
6883- val encoding: Encoding? = null,
6936+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6937+ val encoding: Encoding,
68846938
68856939 /**
68866940 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6888,7 +6942,8 @@ data class Spec (
68886942 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
68896943 * object](mark.html#mark-def).
68906944 */
6891- val mark: AnyMark? = null,
6945+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6946+ val mark: AnyMark,
68926947
68936948 /**
68946949 * An object defining properties of geographic projection.
@@ -6907,28 +6962,33 @@ data class Spec (
69076962 * An object that describes mappings between `row` and `column` channels and their field
69086963 * definitions.
69096964 */
6910- val facet: FacetMapping? = null,
6965+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6966+ val facet: FacetMapping,
69116967
69126968 /**
69136969 * A specification of the view that gets faceted.
69146970 */
6915- val spec: Spec? = null,
6971+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6972+ val spec: Spec,
69166973
69176974 /**
69186975 * An object that describes what fields should be repeated into views that are laid out as a
69196976 * `row` or `column`.
69206977 */
6921- val repeat: Repeat? = null,
6978+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6979+ val repeat: Repeat,
69226980
69236981 /**
69246982 * A list of views that should be concatenated and put into a column.
69256983 */
6926- val vconcat: List<Spec>? = null,
6984+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6985+ val vconcat: List<Spec>,
69276986
69286987 /**
69296988 * A list of views that should be concatenated and put into a row.
69306989 */
6931- val hconcat: List<Spec>? = null
6990+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
6991+ val hconcat: List<Spec>
69326992 )
69336993
69346994 /**
@@ -7068,7 +7128,8 @@ data class LayerSpec (
70687128 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
70697129 * layering facet specifications is not allowed.
70707130 */
7071- val layer: List<LayerSpec>? = null,
7131+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7132+ val layer: List<LayerSpec>,
70727133
70737134 /**
70747135 * Name of the visualization for later reference.
@@ -7117,7 +7178,8 @@ data class LayerSpec (
71177178 /**
71187179 * A key-value mapping between encoding channels and definition of fields.
71197180 */
7120- val encoding: Encoding? = null,
7181+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7182+ val encoding: Encoding,
71217183
71227184 /**
71237185 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -7125,7 +7187,8 @@ data class LayerSpec (
71257187 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
71267188 * object](mark.html#mark-def).
71277189 */
7128- val mark: AnyMark? = null,
7190+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7191+ val mark: AnyMark,
71297192
71307193 /**
71317194 * An object defining properties of geographic projection.
@@ -7813,7 +7876,8 @@ data class Transform (
78137876 * (3) a [selection predicate](filter.html#selection-predicate);
78147877 * or (4) a logical operand that combines (1), (2), or (3).
78157878 */
7816- val filter: LogicalOperandPredicate? = null,
7879+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7880+ val filter: LogicalOperandPredicate,
78177881
78187882 /**
78197883 * The field for storing the computed formula value.
@@ -7834,7 +7898,8 @@ data class Transform (
78347898 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
78357899 * current data object.
78367900 */
7837- val calculate: String? = null,
7901+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7902+ val calculate: String,
78387903
78397904 /**
78407905 * The default value to use if lookup fails.
@@ -7846,34 +7911,40 @@ data class Transform (
78467911 /**
78477912 * Secondary data reference.
78487913 */
7849- val from: LookupData? = null,
7914+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7915+ val from: LookupData,
78507916
78517917 /**
78527918 * Key in primary data source.
78537919 */
7854- val lookup: String? = null,
7920+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7921+ val lookup: String,
78557922
78567923 /**
78577924 * An object indicating bin properties, or simply `true` for using default bin parameters.
78587925 */
7859- val bin: Bin? = null,
7926+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7927+ val bin: Bin,
78607928
78617929 /**
78627930 * The data field to bin.
78637931 *
78647932 * The data field to apply time unit.
78657933 */
7866- val field: String? = null,
7934+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7935+ val field: String,
78677936
78687937 /**
78697938 * The timeUnit.
78707939 */
7871- val timeUnit: TimeUnit? = null,
7940+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7941+ val timeUnit: TimeUnit,
78727942
78737943 /**
78747944 * Array of objects that define fields to aggregate.
78757945 */
7876- val aggregate: List<AggregatedFieldDef>? = null,
7946+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
7947+ val aggregate: List<AggregatedFieldDef>,
78777948
78787949 /**
78797950 * The data fields to group by. If not specified, a single group containing all data objects
Mschema-kotlindefault / TopLevel.kt+64 −64
@@ -136,7 +136,7 @@ data class TopLevel (
136136 /**
137137 * A key-value mapping between encoding channels and definition of fields.
138138 */
139- val encoding: EncodingWithFacet? = null,
139+ val encoding: EncodingWithFacet,
140140
141141 /**
142142 * The height of a visualization.
@@ -165,7 +165,7 @@ data class TopLevel (
165165 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
166166 * object](mark.html#mark-def).
167167 */
168- val mark: AnyMark? = null,
168+ val mark: AnyMark,
169169
170170 /**
171171 * Name of the visualization for later reference.
@@ -235,7 +235,7 @@ data class TopLevel (
235235 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
236236 * layering facet specifications is not allowed.
237237 */
238- val layer: List<LayerSpec>? = null,
238+ val layer: List<LayerSpec>,
239239
240240 /**
241241 * Scale, axis, and legend resolutions for layers.
@@ -254,28 +254,28 @@ data class TopLevel (
254254 * An object that describes mappings between `row` and `column` channels and their field
255255 * definitions.
256256 */
257- val facet: FacetMapping? = null,
257+ val facet: FacetMapping,
258258
259259 /**
260260 * A specification of the view that gets faceted.
261261 */
262- val spec: Spec? = null,
262+ val spec: Spec,
263263
264264 /**
265265 * An object that describes what fields should be repeated into views that are laid out as a
266266 * `row` or `column`.
267267 */
268- val repeat: Repeat? = null,
268+ val repeat: Repeat,
269269
270270 /**
271271 * A list of views that should be concatenated and put into a column.
272272 */
273- val vconcat: List<Spec>? = null,
273+ val vconcat: List<Spec>,
274274
275275 /**
276276 * A list of views that should be concatenated and put into a row.
277277 */
278- val hconcat: List<Spec>? = null
278+ val hconcat: List<Spec>
279279 ) {
280280 public fun toJson() = klaxon.toJsonString(this)
281281
@@ -2387,7 +2387,7 @@ sealed class RangeConfigValue {
23872387 data class VGScheme (
23882388 val count: Double? = null,
23892389 val extent: List<Double>? = null,
2390- val scheme: String? = null,
2390+ val scheme: String,
23912391 val step: Double? = null
23922392 )
23932393
@@ -2964,7 +2964,7 @@ data class SingleSelectionConfig (
29642964 data class VGBinding (
29652965 val element: String? = null,
29662966 val input: String,
2967- val options: List<String>? = null,
2967+ val options: List<String>,
29682968 val max: Double? = null,
29692969 val min: Double? = null,
29702970 val step: Double? = null
@@ -3859,7 +3859,7 @@ data class Data (
38593859 * An URL from which to load the data set. Use the `format.type` property
38603860 * to ensure the loaded data is correctly parsed.
38613861 */
3862- val url: String? = null,
3862+ val url: String,
38633863
38643864 /**
38653865 * The full data set, included inline. This can be an array of objects or primitive values
@@ -3867,12 +3867,12 @@ data class Data (
38673867 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
38683868 * parsed according to the specified format type.
38693869 */
3870- val values: Values? = null,
3870+ val values: Values,
38713871
38723872 /**
38733873 * Provide a placeholder name and bind data at runtime.
38743874 */
3875- val name: String? = null
3875+ val name: String
38763876 )
38773877
38783878 /**
@@ -4273,7 +4273,7 @@ data class MarkPropDefWithCondition (
42734273 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
42744274 * [geographic projection](projection.html) is applied.
42754275 */
4276- val type: Type? = null,
4276+ val type: Type,
42774277
42784278 /**
42794279 * A constant value in visual domain.
@@ -4447,7 +4447,7 @@ sealed class ColorCondition {
44474447 }
44484448
44494449 data class ConditionalValueDef (
4450- val test: LogicalOperandPredicate? = null,
4450+ val test: LogicalOperandPredicate,
44514451
44524452 /**
44534453 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -4459,13 +4459,13 @@ data class ConditionalValueDef (
44594459 * A [selection name](selection.html), or a series of [composed
44604460 * selections](selection.html#compose).
44614461 */
4462- val selection: SelectionOperand? = null
4462+ val selection: SelectionOperand
44634463 )
44644464
44654465 data class Selection (
4466- val not: SelectionOperand? = null,
4467- val and: List<SelectionOperand>? = null,
4468- val or: List<SelectionOperand>? = null
4466+ val not: SelectionOperand,
4467+ val and: List<SelectionOperand>,
4468+ val or: List<SelectionOperand>
44694469 )
44704470
44714471 /**
@@ -4493,21 +4493,21 @@ sealed class SelectionOperand {
44934493 }
44944494
44954495 data class Predicate (
4496- val not: LogicalOperandPredicate? = null,
4497- val and: List<LogicalOperandPredicate>? = null,
4498- val or: List<LogicalOperandPredicate>? = null,
4496+ val not: LogicalOperandPredicate,
4497+ val and: List<LogicalOperandPredicate>,
4498+ val or: List<LogicalOperandPredicate>,
44994499
45004500 /**
45014501 * The value that the field should be equal to.
45024502 */
4503- val equal: Equal? = null,
4503+ val equal: Equal,
45044504
45054505 /**
45064506 * Field to be filtered.
45074507 *
45084508 * Field to be filtered
45094509 */
4510- val field: String? = null,
4510+ val field: String,
45114511
45124512 /**
45134513 * Time unit for the field to be filtered.
@@ -4520,18 +4520,18 @@ data class Predicate (
45204520 * An array of inclusive minimum and maximum values
45214521 * for a field value of a data item to be included in the filtered data.
45224522 */
4523- val range: List<RangeElement>? = null,
4523+ val range: List<RangeElement>,
45244524
45254525 /**
45264526 * A set of values that the `field`'s value should be a member of,
45274527 * for a data item included in the filtered data.
45284528 */
4529- val oneOf: List<Equal>? = null,
4529+ val oneOf: List<Equal>,
45304530
45314531 /**
45324532 * Filter using a selection name.
45334533 */
4534- val selection: SelectionOperand? = null
4534+ val selection: SelectionOperand
45354535 )
45364536
45374537 /**
@@ -4860,19 +4860,19 @@ sealed class ConditionalValueDefValue {
48604860 }
48614861
48624862 data class ConditionalPredicateMarkPropFieldDefClass (
4863- val test: LogicalOperandPredicate? = null,
4863+ val test: LogicalOperandPredicate,
48644864
48654865 /**
48664866 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
48674867 * `0` to `1` for opacity).
48684868 */
4869- val value: ConditionalValueDefValue? = null,
4869+ val value: ConditionalValueDefValue,
48704870
48714871 /**
48724872 * A [selection name](selection.html), or a series of [composed
48734873 * selections](selection.html#compose).
48744874 */
4875- val selection: SelectionOperand? = null,
4875+ val selection: SelectionOperand,
48764876
48774877 /**
48784878 * Aggregation function for the field
@@ -4946,7 +4946,7 @@ data class ConditionalPredicateMarkPropFieldDefClass (
49464946 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
49474947 * [geographic projection](projection.html) is applied.
49484948 */
4949- val type: Type? = null
4949+ val type: Type
49504950 )
49514951
49524952 sealed class Field {
@@ -6017,7 +6017,7 @@ data class DefWithCondition (
60176017 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
60186018 * [geographic projection](projection.html) is applied.
60196019 */
6020- val type: Type? = null,
6020+ val type: Type,
60216021
60226022 /**
60236023 * A constant value in visual domain.
@@ -6044,19 +6044,19 @@ sealed class HrefCondition {
60446044 }
60456045
60466046 data class ConditionalPredicateFieldDefClass (
6047- val test: LogicalOperandPredicate? = null,
6047+ val test: LogicalOperandPredicate,
60486048
60496049 /**
60506050 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
60516051 * `0` to `1` for opacity).
60526052 */
6053- val value: ConditionalValueDefValue? = null,
6053+ val value: ConditionalValueDefValue,
60546054
60556055 /**
60566056 * A [selection name](selection.html), or a series of [composed
60576057 * selections](selection.html#compose).
60586058 */
6059- val selection: SelectionOperand? = null,
6059+ val selection: SelectionOperand,
60606060
60616061 /**
60626062 * Aggregation function for the field
@@ -6103,7 +6103,7 @@ data class ConditionalPredicateFieldDefClass (
61036103 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
61046104 * [geographic projection](projection.html) is applied.
61056105 */
6106- val type: Type? = null
6106+ val type: Type
61076107 )
61086108
61096109 sealed class Order {
@@ -6259,7 +6259,7 @@ data class TextDefWithCondition (
62596259 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
62606260 * [geographic projection](projection.html) is applied.
62616261 */
6262- val type: Type? = null,
6262+ val type: Type,
62636263
62646264 /**
62656265 * A constant value in visual domain.
@@ -6286,19 +6286,19 @@ sealed class TextCondition {
62866286 }
62876287
62886288 data class ConditionalPredicateTextFieldDefClass (
6289- val test: LogicalOperandPredicate? = null,
6289+ val test: LogicalOperandPredicate,
62906290
62916291 /**
62926292 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
62936293 * `0` to `1` for opacity).
62946294 */
6295- val value: ConditionalValueDefValue? = null,
6295+ val value: ConditionalValueDefValue,
62966296
62976297 /**
62986298 * A [selection name](selection.html), or a series of [composed
62996299 * selections](selection.html#compose).
63006300 */
6301- val selection: SelectionOperand? = null,
6301+ val selection: SelectionOperand,
63026302
63036303 /**
63046304 * Aggregation function for the field
@@ -6351,7 +6351,7 @@ data class ConditionalPredicateTextFieldDefClass (
63516351 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
63526352 * [geographic projection](projection.html) is applied.
63536353 */
6354- val type: Type? = null
6354+ val type: Type
63556355 )
63566356
63576357 /**
@@ -6458,13 +6458,13 @@ data class XClass (
64586458 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
64596459 * [geographic projection](projection.html) is applied.
64606460 */
6461- val type: Type? = null,
6461+ val type: Type,
64626462
64636463 /**
64646464 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
64656465 * `0` to `1` for opacity).
64666466 */
6467- val value: ConditionalValueDefValue? = null
6467+ val value: ConditionalValueDefValue
64686468 )
64696469
64706470 data class Axis (
@@ -6728,13 +6728,13 @@ data class X2Class (
67286728 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
67296729 * [geographic projection](projection.html) is applied.
67306730 */
6731- val type: Type? = null,
6731+ val type: Type,
67326732
67336733 /**
67346734 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
67356735 * `0` to `1` for opacity).
67366736 */
6737- val value: ConditionalValueDefValue? = null
6737+ val value: ConditionalValueDefValue
67386738 )
67396739
67406740 /**
@@ -6794,7 +6794,7 @@ data class Spec (
67946794 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
67956795 * layering facet specifications is not allowed.
67966796 */
6797- val layer: List<LayerSpec>? = null,
6797+ val layer: List<LayerSpec>,
67986798
67996799 /**
68006800 * Name of the visualization for later reference.
@@ -6851,7 +6851,7 @@ data class Spec (
68516851 /**
68526852 * A key-value mapping between encoding channels and definition of fields.
68536853 */
6854- val encoding: Encoding? = null,
6854+ val encoding: Encoding,
68556855
68566856 /**
68576857 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6859,7 +6859,7 @@ data class Spec (
68596859 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
68606860 * object](mark.html#mark-def).
68616861 */
6862- val mark: AnyMark? = null,
6862+ val mark: AnyMark,
68636863
68646864 /**
68656865 * An object defining properties of geographic projection.
@@ -6878,28 +6878,28 @@ data class Spec (
68786878 * An object that describes mappings between `row` and `column` channels and their field
68796879 * definitions.
68806880 */
6881- val facet: FacetMapping? = null,
6881+ val facet: FacetMapping,
68826882
68836883 /**
68846884 * A specification of the view that gets faceted.
68856885 */
6886- val spec: Spec? = null,
6886+ val spec: Spec,
68876887
68886888 /**
68896889 * An object that describes what fields should be repeated into views that are laid out as a
68906890 * `row` or `column`.
68916891 */
6892- val repeat: Repeat? = null,
6892+ val repeat: Repeat,
68936893
68946894 /**
68956895 * A list of views that should be concatenated and put into a column.
68966896 */
6897- val vconcat: List<Spec>? = null,
6897+ val vconcat: List<Spec>,
68986898
68996899 /**
69006900 * A list of views that should be concatenated and put into a row.
69016901 */
6902- val hconcat: List<Spec>? = null
6902+ val hconcat: List<Spec>
69036903 )
69046904
69056905 /**
@@ -7039,7 +7039,7 @@ data class LayerSpec (
70397039 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
70407040 * layering facet specifications is not allowed.
70417041 */
7042- val layer: List<LayerSpec>? = null,
7042+ val layer: List<LayerSpec>,
70437043
70447044 /**
70457045 * Name of the visualization for later reference.
@@ -7088,7 +7088,7 @@ data class LayerSpec (
70887088 /**
70897089 * A key-value mapping between encoding channels and definition of fields.
70907090 */
7091- val encoding: Encoding? = null,
7091+ val encoding: Encoding,
70927092
70937093 /**
70947094 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -7096,7 +7096,7 @@ data class LayerSpec (
70967096 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
70977097 * object](mark.html#mark-def).
70987098 */
7099- val mark: AnyMark? = null,
7099+ val mark: AnyMark,
71007100
71017101 /**
71027102 * An object defining properties of geographic projection.
@@ -7781,7 +7781,7 @@ data class Transform (
77817781 * (3) a [selection predicate](filter.html#selection-predicate);
77827782 * or (4) a logical operand that combines (1), (2), or (3).
77837783 */
7784- val filter: LogicalOperandPredicate? = null,
7784+ val filter: LogicalOperandPredicate,
77857785
77867786 /**
77877787 * The field for storing the computed formula value.
@@ -7802,7 +7802,7 @@ data class Transform (
78027802 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
78037803 * current data object.
78047804 */
7805- val calculate: String? = null,
7805+ val calculate: String,
78067806
78077807 /**
78087808 * The default value to use if lookup fails.
@@ -7814,34 +7814,34 @@ data class Transform (
78147814 /**
78157815 * Secondary data reference.
78167816 */
7817- val from: LookupData? = null,
7817+ val from: LookupData,
78187818
78197819 /**
78207820 * Key in primary data source.
78217821 */
7822- val lookup: String? = null,
7822+ val lookup: String,
78237823
78247824 /**
78257825 * An object indicating bin properties, or simply `true` for using default bin parameters.
78267826 */
7827- val bin: Bin? = null,
7827+ val bin: Bin,
78287828
78297829 /**
78307830 * The data field to bin.
78317831 *
78327832 * The data field to apply time unit.
78337833 */
7834- val field: String? = null,
7834+ val field: String,
78357835
78367836 /**
78377837 * The timeUnit.
78387838 */
7839- val timeUnit: TimeUnit? = null,
7839+ val timeUnit: TimeUnit,
78407840
78417841 /**
78427842 * Array of objects that define fields to aggregate.
78437843 */
7844- val aggregate: List<AggregatedFieldDef>? = null,
7844+ val aggregate: List<AggregatedFieldDef>,
78457845
78467846 /**
78477847 * The data fields to group by. If not specified, a single group containing all data objects
Mschema-kotlinxdefault / TopLevel.kt+64 −64
@@ -58,7 +58,7 @@ data class TopLevel (
5858 /**
5959 * A key-value mapping between encoding channels and definition of fields.
6060 */
61- val encoding: EncodingWithFacet? = null,
61+ val encoding: EncodingWithFacet,
6262
6363 /**
6464 * The height of a visualization.
@@ -87,7 +87,7 @@ data class TopLevel (
8787 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
8888 * object](mark.html#mark-def).
8989 */
90- val mark: AnyMark? = null,
90+ val mark: AnyMark,
9191
9292 /**
9393 * Name of the visualization for later reference.
@@ -157,7 +157,7 @@ data class TopLevel (
157157 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
158158 * layering facet specifications is not allowed.
159159 */
160- val layer: List<LayerSpec>? = null,
160+ val layer: List<LayerSpec>,
161161
162162 /**
163163 * Scale, axis, and legend resolutions for layers.
@@ -176,28 +176,28 @@ data class TopLevel (
176176 * An object that describes mappings between `row` and `column` channels and their field
177177 * definitions.
178178 */
179- val facet: FacetMapping? = null,
179+ val facet: FacetMapping,
180180
181181 /**
182182 * A specification of the view that gets faceted.
183183 */
184- val spec: Spec? = null,
184+ val spec: Spec,
185185
186186 /**
187187 * An object that describes what fields should be repeated into views that are laid out as a
188188 * `row` or `column`.
189189 */
190- val repeat: Repeat? = null,
190+ val repeat: Repeat,
191191
192192 /**
193193 * A list of views that should be concatenated and put into a column.
194194 */
195- val vconcat: List<Spec>? = null,
195+ val vconcat: List<Spec>,
196196
197197 /**
198198 * A list of views that should be concatenated and put into a row.
199199 */
200- val hconcat: List<Spec>? = null
200+ val hconcat: List<Spec>
201201 )
202202
203203 /**
@@ -2067,7 +2067,7 @@ sealed class RangeConfigValue {
20672067 data class VGScheme (
20682068 val count: Double? = null,
20692069 val extent: List<Double>? = null,
2070- val scheme: String? = null,
2070+ val scheme: String,
20712071 val step: Double? = null
20722072 )
20732073
@@ -2600,7 +2600,7 @@ data class SingleSelectionConfig (
26002600 data class VGBinding (
26012601 val element: String? = null,
26022602 val input: String,
2603- val options: List<String>? = null,
2603+ val options: List<String>,
26042604 val max: Double? = null,
26052605 val min: Double? = null,
26062606 val step: Double? = null
@@ -3476,7 +3476,7 @@ data class Data (
34763476 * An URL from which to load the data set. Use the `format.type` property
34773477 * to ensure the loaded data is correctly parsed.
34783478 */
3479- val url: String? = null,
3479+ val url: String,
34803480
34813481 /**
34823482 * The full data set, included inline. This can be an array of objects or primitive values
@@ -3484,12 +3484,12 @@ data class Data (
34843484 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
34853485 * parsed according to the specified format type.
34863486 */
3487- val values: Values? = null,
3487+ val values: Values,
34883488
34893489 /**
34903490 * Provide a placeholder name and bind data at runtime.
34913491 */
3492- val name: String? = null
3492+ val name: String
34933493 )
34943494
34953495 /**
@@ -3836,7 +3836,7 @@ data class MarkPropDefWithCondition (
38363836 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
38373837 * [geographic projection](projection.html) is applied.
38383838 */
3839- val type: Type? = null,
3839+ val type: Type,
38403840
38413841 /**
38423842 * A constant value in visual domain.
@@ -3962,7 +3962,7 @@ sealed class ColorCondition {
39623962
39633963 @Serializable
39643964 data class ConditionalValueDef (
3965- val test: LogicalOperandPredicate? = null,
3965+ val test: LogicalOperandPredicate,
39663966
39673967 /**
39683968 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -3974,14 +3974,14 @@ data class ConditionalValueDef (
39743974 * A [selection name](selection.html), or a series of [composed
39753975 * selections](selection.html#compose).
39763976 */
3977- val selection: SelectionOperand? = null
3977+ val selection: SelectionOperand
39783978 )
39793979
39803980 @Serializable
39813981 data class Selection (
3982- val not: SelectionOperand? = null,
3983- val and: List<SelectionOperand>? = null,
3984- val or: List<SelectionOperand>? = null
3982+ val not: SelectionOperand,
3983+ val and: List<SelectionOperand>,
3984+ val or: List<SelectionOperand>
39853985 )
39863986
39873987 /**
@@ -3998,21 +3998,21 @@ sealed class SelectionOperand {
39983998
39993999 @Serializable
40004000 data class Predicate (
4001- val not: LogicalOperandPredicate? = null,
4002- val and: List<LogicalOperandPredicate>? = null,
4003- val or: List<LogicalOperandPredicate>? = null,
4001+ val not: LogicalOperandPredicate,
4002+ val and: List<LogicalOperandPredicate>,
4003+ val or: List<LogicalOperandPredicate>,
40044004
40054005 /**
40064006 * The value that the field should be equal to.
40074007 */
4008- val equal: Equal? = null,
4008+ val equal: Equal,
40094009
40104010 /**
40114011 * Field to be filtered.
40124012 *
40134013 * Field to be filtered
40144014 */
4015- val field: String? = null,
4015+ val field: String,
40164016
40174017 /**
40184018 * Time unit for the field to be filtered.
@@ -4025,18 +4025,18 @@ data class Predicate (
40254025 * An array of inclusive minimum and maximum values
40264026 * for a field value of a data item to be included in the filtered data.
40274027 */
4028- val range: List<RangeElement>? = null,
4028+ val range: List<RangeElement>,
40294029
40304030 /**
40314031 * A set of values that the `field`'s value should be a member of,
40324032 * for a data item included in the filtered data.
40334033 */
4034- val oneOf: List<Equal>? = null,
4034+ val oneOf: List<Equal>,
40354035
40364036 /**
40374037 * Filter using a selection name.
40384038 */
4039- val selection: SelectionOperand? = null
4039+ val selection: SelectionOperand
40404040 )
40414041
40424042 /**
@@ -4238,19 +4238,19 @@ sealed class ConditionalValueDefValue {
42384238
42394239 @Serializable
42404240 data class ConditionalPredicateMarkPropFieldDefClass (
4241- val test: LogicalOperandPredicate? = null,
4241+ val test: LogicalOperandPredicate,
42424242
42434243 /**
42444244 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
42454245 * `0` to `1` for opacity).
42464246 */
4247- val value: ConditionalValueDefValue? = null,
4247+ val value: ConditionalValueDefValue,
42484248
42494249 /**
42504250 * A [selection name](selection.html), or a series of [composed
42514251 * selections](selection.html#compose).
42524252 */
4253- val selection: SelectionOperand? = null,
4253+ val selection: SelectionOperand,
42544254
42554255 /**
42564256 * Aggregation function for the field
@@ -4324,7 +4324,7 @@ data class ConditionalPredicateMarkPropFieldDefClass (
43244324 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
43254325 * [geographic projection](projection.html) is applied.
43264326 */
4327- val type: Type? = null
4327+ val type: Type
43284328 )
43294329
43304330 @Serializable
@@ -5213,7 +5213,7 @@ data class DefWithCondition (
52135213 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
52145214 * [geographic projection](projection.html) is applied.
52155215 */
5216- val type: Type? = null,
5216+ val type: Type,
52175217
52185218 /**
52195219 * A constant value in visual domain.
@@ -5229,19 +5229,19 @@ sealed class HrefCondition {
52295229
52305230 @Serializable
52315231 data class ConditionalPredicateFieldDefClass (
5232- val test: LogicalOperandPredicate? = null,
5232+ val test: LogicalOperandPredicate,
52335233
52345234 /**
52355235 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
52365236 * `0` to `1` for opacity).
52375237 */
5238- val value: ConditionalValueDefValue? = null,
5238+ val value: ConditionalValueDefValue,
52395239
52405240 /**
52415241 * A [selection name](selection.html), or a series of [composed
52425242 * selections](selection.html#compose).
52435243 */
5244- val selection: SelectionOperand? = null,
5244+ val selection: SelectionOperand,
52455245
52465246 /**
52475247 * Aggregation function for the field
@@ -5288,7 +5288,7 @@ data class ConditionalPredicateFieldDefClass (
52885288 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
52895289 * [geographic projection](projection.html) is applied.
52905290 */
5291- val type: Type? = null
5291+ val type: Type
52925292 )
52935293
52945294 @Serializable
@@ -5434,7 +5434,7 @@ data class TextDefWithCondition (
54345434 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
54355435 * [geographic projection](projection.html) is applied.
54365436 */
5437- val type: Type? = null,
5437+ val type: Type,
54385438
54395439 /**
54405440 * A constant value in visual domain.
@@ -5450,19 +5450,19 @@ sealed class TextCondition {
54505450
54515451 @Serializable
54525452 data class ConditionalPredicateTextFieldDefClass (
5453- val test: LogicalOperandPredicate? = null,
5453+ val test: LogicalOperandPredicate,
54545454
54555455 /**
54565456 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
54575457 * `0` to `1` for opacity).
54585458 */
5459- val value: ConditionalValueDefValue? = null,
5459+ val value: ConditionalValueDefValue,
54605460
54615461 /**
54625462 * A [selection name](selection.html), or a series of [composed
54635463 * selections](selection.html#compose).
54645464 */
5465- val selection: SelectionOperand? = null,
5465+ val selection: SelectionOperand,
54665466
54675467 /**
54685468 * Aggregation function for the field
@@ -5515,7 +5515,7 @@ data class ConditionalPredicateTextFieldDefClass (
55155515 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
55165516 * [geographic projection](projection.html) is applied.
55175517 */
5518- val type: Type? = null
5518+ val type: Type
55195519 )
55205520
55215521 /**
@@ -5623,13 +5623,13 @@ data class XClass (
56235623 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
56245624 * [geographic projection](projection.html) is applied.
56255625 */
5626- val type: Type? = null,
5626+ val type: Type,
56275627
56285628 /**
56295629 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
56305630 * `0` to `1` for opacity).
56315631 */
5632- val value: ConditionalValueDefValue? = null
5632+ val value: ConditionalValueDefValue
56335633 )
56345634
56355635 @Serializable
@@ -5883,13 +5883,13 @@ data class X2Class (
58835883 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
58845884 * [geographic projection](projection.html) is applied.
58855885 */
5886- val type: Type? = null,
5886+ val type: Type,
58875887
58885888 /**
58895889 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
58905890 * `0` to `1` for opacity).
58915891 */
5892- val value: ConditionalValueDefValue? = null
5892+ val value: ConditionalValueDefValue
58935893 )
58945894
58955895 /**
@@ -5951,7 +5951,7 @@ data class Spec (
59515951 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
59525952 * layering facet specifications is not allowed.
59535953 */
5954- val layer: List<LayerSpec>? = null,
5954+ val layer: List<LayerSpec>,
59555955
59565956 /**
59575957 * Name of the visualization for later reference.
@@ -6008,7 +6008,7 @@ data class Spec (
60086008 /**
60096009 * A key-value mapping between encoding channels and definition of fields.
60106010 */
6011- val encoding: Encoding? = null,
6011+ val encoding: Encoding,
60126012
60136013 /**
60146014 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6016,7 +6016,7 @@ data class Spec (
60166016 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
60176017 * object](mark.html#mark-def).
60186018 */
6019- val mark: AnyMark? = null,
6019+ val mark: AnyMark,
60206020
60216021 /**
60226022 * An object defining properties of geographic projection.
@@ -6035,28 +6035,28 @@ data class Spec (
60356035 * An object that describes mappings between `row` and `column` channels and their field
60366036 * definitions.
60376037 */
6038- val facet: FacetMapping? = null,
6038+ val facet: FacetMapping,
60396039
60406040 /**
60416041 * A specification of the view that gets faceted.
60426042 */
6043- val spec: Spec? = null,
6043+ val spec: Spec,
60446044
60456045 /**
60466046 * An object that describes what fields should be repeated into views that are laid out as a
60476047 * `row` or `column`.
60486048 */
6049- val repeat: Repeat? = null,
6049+ val repeat: Repeat,
60506050
60516051 /**
60526052 * A list of views that should be concatenated and put into a column.
60536053 */
6054- val vconcat: List<Spec>? = null,
6054+ val vconcat: List<Spec>,
60556055
60566056 /**
60576057 * A list of views that should be concatenated and put into a row.
60586058 */
6059- val hconcat: List<Spec>? = null
6059+ val hconcat: List<Spec>
60606060 )
60616061
60626062 /**
@@ -6198,7 +6198,7 @@ data class LayerSpec (
61986198 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
61996199 * layering facet specifications is not allowed.
62006200 */
6201- val layer: List<LayerSpec>? = null,
6201+ val layer: List<LayerSpec>,
62026202
62036203 /**
62046204 * Name of the visualization for later reference.
@@ -6247,7 +6247,7 @@ data class LayerSpec (
62476247 /**
62486248 * A key-value mapping between encoding channels and definition of fields.
62496249 */
6250- val encoding: Encoding? = null,
6250+ val encoding: Encoding,
62516251
62526252 /**
62536253 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6255,7 +6255,7 @@ data class LayerSpec (
62556255 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
62566256 * object](mark.html#mark-def).
62576257 */
6258- val mark: AnyMark? = null,
6258+ val mark: AnyMark,
62596259
62606260 /**
62616261 * An object defining properties of geographic projection.
@@ -6870,7 +6870,7 @@ data class Transform (
68706870 * (3) a [selection predicate](filter.html#selection-predicate);
68716871 * or (4) a logical operand that combines (1), (2), or (3).
68726872 */
6873- val filter: LogicalOperandPredicate? = null,
6873+ val filter: LogicalOperandPredicate,
68746874
68756875 /**
68766876 * The field for storing the computed formula value.
@@ -6891,7 +6891,7 @@ data class Transform (
68916891 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
68926892 * current data object.
68936893 */
6894- val calculate: String? = null,
6894+ val calculate: String,
68956895
68966896 /**
68976897 * The default value to use if lookup fails.
@@ -6903,34 +6903,34 @@ data class Transform (
69036903 /**
69046904 * Secondary data reference.
69056905 */
6906- val from: LookupData? = null,
6906+ val from: LookupData,
69076907
69086908 /**
69096909 * Key in primary data source.
69106910 */
6911- val lookup: String? = null,
6911+ val lookup: String,
69126912
69136913 /**
69146914 * An object indicating bin properties, or simply `true` for using default bin parameters.
69156915 */
6916- val bin: Bin? = null,
6916+ val bin: Bin,
69176917
69186918 /**
69196919 * The data field to bin.
69206920 *
69216921 * The data field to apply time unit.
69226922 */
6923- val field: String? = null,
6923+ val field: String,
69246924
69256925 /**
69266926 * The timeUnit.
69276927 */
6928- val timeUnit: TimeUnit? = null,
6928+ val timeUnit: TimeUnit,
69296929
69306930 /**
69316931 * Array of objects that define fields to aggregate.
69326932 */
6933- val aggregate: List<AggregatedFieldDef>? = null,
6933+ val aggregate: List<AggregatedFieldDef>,
69346934
69356935 /**
69366936 * The data fields to group by. If not specified, a single group containing all data objects
Mschema-phpdefault / TopLevel.php+1,294 −1,888
@@ -10,9 +10,9 @@ class TopLevel {
1010 private ?Config $config; // json:config Optional
1111 private ?Data $data; // json:data Optional
1212 private ?string $description; // json:description Optional
13- private ?EncodingWithFacet $encoding; // json:encoding Optional
13+ private EncodingWithFacet $encoding; // json:encoding Required
1414 private ?float $height; // json:height Optional
15- private MarkDef|Mark|null $mark; // json:mark Optional
15+ private MarkDef|Mark $mark; // json:mark Required
1616 private ?string $name; // json:name Optional
1717 private Padding|float|null $padding; // json:padding Optional
1818 private ?Projection $projection; // json:projection Optional
@@ -20,13 +20,13 @@ class TopLevel {
2020 private TitleParams|string|null $title; // json:title Optional
2121 private ?array $transform; // json:transform Optional
2222 private ?float $width; // json:width Optional
23- private ?array $layer; // json:layer Optional
23+ private array $layer; // json:layer Required
2424 private ?Resolve $resolve; // json:resolve Optional
25- private ?FacetMapping $facet; // json:facet Optional
26- private ?Spec $spec; // json:spec Optional
27- private ?Repeat $repeat; // json:repeat Optional
28- private ?array $vconcat; // json:vconcat Optional
29- private ?array $hconcat; // json:hconcat Optional
25+ private FacetMapping $facet; // json:facet Required
26+ private Spec $spec; // json:spec Required
27+ private Repeat $repeat; // json:repeat Required
28+ private array $vconcat; // json:vconcat Required
29+ private array $hconcat; // json:hconcat Required
3030
3131 /**
3232 * @param string|null $schema
@@ -35,9 +35,9 @@ class TopLevel {
3535 * @param Config|null $config
3636 * @param Data|null $data
3737 * @param string|null $description
38- * @param EncodingWithFacet|null $encoding
38+ * @param EncodingWithFacet $encoding
3939 * @param float|null $height
40- * @param MarkDef|Mark|null $mark
40+ * @param MarkDef|Mark $mark
4141 * @param string|null $name
4242 * @param Padding|float|null $padding
4343 * @param Projection|null $projection
@@ -45,15 +45,15 @@ class TopLevel {
4545 * @param TitleParams|string|null $title
4646 * @param array|null $transform
4747 * @param float|null $width
48- * @param array|null $layer
48+ * @param array $layer
4949 * @param Resolve|null $resolve
50- * @param FacetMapping|null $facet
51- * @param Spec|null $spec
52- * @param Repeat|null $repeat
53- * @param array|null $vconcat
54- * @param array|null $hconcat
50+ * @param FacetMapping $facet
51+ * @param Spec $spec
52+ * @param Repeat $repeat
53+ * @param array $vconcat
54+ * @param array $hconcat
5555 */
56- public function __construct(?string $schema, AutoSizeParams|AutosizeType|null $autosize, ?string $background, ?Config $config, ?Data $data, ?string $description, ?EncodingWithFacet $encoding, ?float $height, MarkDef|Mark|null $mark, ?string $name, Padding|float|null $padding, ?Projection $projection, ?stdClass $selection, TitleParams|string|null $title, ?array $transform, ?float $width, ?array $layer, ?Resolve $resolve, ?FacetMapping $facet, ?Spec $spec, ?Repeat $repeat, ?array $vconcat, ?array $hconcat) {
56+ public function __construct(?string $schema, AutoSizeParams|AutosizeType|null $autosize, ?string $background, ?Config $config, ?Data $data, ?string $description, EncodingWithFacet $encoding, ?float $height, MarkDef|Mark $mark, ?string $name, Padding|float|null $padding, ?Projection $projection, ?stdClass $selection, TitleParams|string|null $title, ?array $transform, ?float $width, array $layer, ?Resolve $resolve, FacetMapping $facet, Spec $spec, Repeat $repeat, array $vconcat, array $hconcat) {
5757 $this->schema = $schema;
5858 $this->autosize = $autosize;
5959 $this->background = $background;
@@ -563,31 +563,23 @@ class TopLevel {
563563 /**
564564 * A key-value mapping between encoding channels and definition of fields.
565565 *
566- * @param ?stdClass $value
566+ * @param stdClass $value
567567 * @throws Exception
568- * @return ?EncodingWithFacet
568+ * @return EncodingWithFacet
569569 */
570- public static function fromEncoding(?stdClass $value): ?EncodingWithFacet {
571- if (!is_null($value)) {
572- return EncodingWithFacet::from($value); /*class*/
573- } else {
574- return null;
575- }
570+ public static function fromEncoding(stdClass $value): EncodingWithFacet {
571+ return EncodingWithFacet::from($value); /*class*/
576572 }
577573
578574 /**
579575 * A key-value mapping between encoding channels and definition of fields.
580576 *
581577 * @throws Exception
582- * @return ?stdClass
578+ * @return stdClass
583579 */
584- public function toEncoding(): ?stdClass {
580+ public function toEncoding(): stdClass {
585581 if (TopLevel::validateEncoding($this->encoding)) {
586- if (!is_null($this->encoding)) {
587- return $this->encoding->to(); /*class*/
588- } else {
589- return null;
590- }
582+ return $this->encoding->to(); /*class*/
591583 }
592584 throw new Exception('never get to this TopLevel::encoding');
593585 }
@@ -595,14 +587,12 @@ class TopLevel {
595587 /**
596588 * A key-value mapping between encoding channels and definition of fields.
597589 *
598- * @param EncodingWithFacet|null
590+ * @param EncodingWithFacet
599591 * @return bool
600592 * @throws Exception
601593 */
602- public static function validateEncoding(?EncodingWithFacet $value): bool {
603- if (!is_null($value)) {
604- $value->validate();
605- }
594+ public static function validateEncoding(EncodingWithFacet $value): bool {
595+ $value->validate();
606596 return true;
607597 }
608598
@@ -610,9 +600,9 @@ class TopLevel {
610600 * A key-value mapping between encoding channels and definition of fields.
611601 *
612602 * @throws Exception
613- * @return ?EncodingWithFacet
603+ * @return EncodingWithFacet
614604 */
615- public function getEncoding(): ?EncodingWithFacet {
605+ public function getEncoding(): EncodingWithFacet {
616606 if (TopLevel::validateEncoding($this->encoding)) {
617607 return $this->encoding;
618608 }
@@ -622,9 +612,9 @@ class TopLevel {
622612 /**
623613 * A key-value mapping between encoding channels and definition of fields.
624614 *
625- * @return ?EncodingWithFacet
615+ * @return EncodingWithFacet
626616 */
627- public static function sampleEncoding(): ?EncodingWithFacet {
617+ public static function sampleEncoding(): EncodingWithFacet {
628618 return EncodingWithFacet::sample(); /*37:encoding*/
629619 }
630620
@@ -781,14 +771,12 @@ class TopLevel {
781771 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
782772 * object](mark.html#mark-def).
783773 *
784- * @param stdClass|string|null $value
774+ * @param stdClass|string $value
785775 * @throws Exception
786- * @return MarkDef|Mark|null
776+ * @return MarkDef|Mark
787777 */
788- public static function fromMark(stdClass|string|null $value): MarkDef|Mark|null {
789- if (is_null($value)) {
790- return $value; /*null*/
791- } elseif (is_object($value)) {
778+ public static function fromMark(stdClass|string $value): MarkDef|Mark {
779+ if (is_object($value)) {
792780 return MarkDef::from($value); /*class*/
793781 } elseif (is_string($value) && in_array($value, ['area', 'bar', 'line', 'point', 'text', 'tick', 'rect', 'rule', 'circle', 'square', 'geoshape'], true)) {
794782 return Mark::from($value); /*enum*/
@@ -804,13 +792,11 @@ class TopLevel {
804792 * object](mark.html#mark-def).
805793 *
806794 * @throws Exception
807- * @return stdClass|string|null
795+ * @return stdClass|string
808796 */
809- public function toMark(): stdClass|string|null {
797+ public function toMark(): stdClass|string {
810798 if (TopLevel::validateMark($this->mark)) {
811- if (is_null($this->mark)) {
812- return $this->mark; /*null*/
813- } elseif ($this->mark instanceof MarkDef) {
799+ if ($this->mark instanceof MarkDef) {
814800 return $this->mark->to(); /*class*/
815801 } elseif ($this->mark instanceof Mark) {
816802 return Mark::to($this->mark); /*enum*/
@@ -827,16 +813,12 @@ class TopLevel {
827813 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
828814 * object](mark.html#mark-def).
829815 *
830- * @param MarkDef|Mark|null
816+ * @param MarkDef|Mark
831817 * @return bool
832818 * @throws Exception
833819 */
834- public static function validateMark(MarkDef|Mark|null $value): bool {
835- if (is_null($value)) {
836- if (!is_null($value)) {
837- throw new Exception("Attribute Error:TopLevel::mark");
838- }
839- } elseif ($value instanceof MarkDef) {
820+ public static function validateMark(MarkDef|Mark $value): bool {
821+ if ($value instanceof MarkDef) {
840822 $value->validate();
841823 } elseif ($value instanceof Mark) {
842824 Mark::to($value);
@@ -853,9 +835,9 @@ class TopLevel {
853835 * object](mark.html#mark-def).
854836 *
855837 * @throws Exception
856- * @return MarkDef|Mark|null
838+ * @return MarkDef|Mark
857839 */
858- public function getMark(): MarkDef|Mark|null {
840+ public function getMark(): MarkDef|Mark {
859841 if (TopLevel::validateMark($this->mark)) {
860842 return $this->mark;
861843 }
@@ -868,9 +850,9 @@ class TopLevel {
868850 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
869851 * object](mark.html#mark-def).
870852 *
871- * @return MarkDef|Mark|null
853+ * @return MarkDef|Mark
872854 */
873- public static function sampleMark(): MarkDef|Mark|null {
855+ public static function sampleMark(): MarkDef|Mark {
874856 return MarkDef::sample(); /*39:mark*/
875857 }
876858
@@ -1550,18 +1532,14 @@ class TopLevel {
15501532 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
15511533 * layering facet specifications is not allowed.
15521534 *
1553- * @param ?array $value
1535+ * @param array $value
15541536 * @throws Exception
1555- * @return ?array
1537+ * @return array
15561538 */
1557- public static function fromLayer(?array $value): ?array {
1558- if (!is_null($value)) {
1559- return array_map(function ($value) {
1560- return LayerSpec::from($value); /*class*/
1561- }, $value);
1562- } else {
1563- return null;
1564- }
1539+ public static function fromLayer(array $value): array {
1540+ return array_map(function ($value) {
1541+ return LayerSpec::from($value); /*class*/
1542+ }, $value);
15651543 }
15661544
15671545 /**
@@ -1571,17 +1549,13 @@ class TopLevel {
15711549 * layering facet specifications is not allowed.
15721550 *
15731551 * @throws Exception
1574- * @return ?array
1552+ * @return array
15751553 */
1576- public function toLayer(): ?array {
1554+ public function toLayer(): array {
15771555 if (TopLevel::validateLayer($this->layer)) {
1578- if (!is_null($this->layer)) {
1579- return array_map(function ($value) {
1580- return $value->to(); /*class*/
1581- }, $this->layer);
1582- } else {
1583- return null;
1584- }
1556+ return array_map(function ($value) {
1557+ return $value->to(); /*class*/
1558+ }, $this->layer);
15851559 }
15861560 throw new Exception('never get to this TopLevel::layer');
15871561 }
@@ -1592,19 +1566,17 @@ class TopLevel {
15921566 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
15931567 * layering facet specifications is not allowed.
15941568 *
1595- * @param array|null
1569+ * @param array
15961570 * @return bool
15971571 * @throws Exception
15981572 */
1599- public static function validateLayer(?array $value): bool {
1600- if (!is_null($value)) {
1601- if (!is_array($value)) {
1602- throw new Exception("Attribute Error:TopLevel::layer");
1603- }
1604- array_walk($value, function($value_v) {
1605- $value_v->validate();
1606- });
1573+ public static function validateLayer(array $value): bool {
1574+ if (!is_array($value)) {
1575+ throw new Exception("Attribute Error:TopLevel::layer");
16071576 }
1577+ array_walk($value, function($value_v) {
1578+ $value_v->validate();
1579+ });
16081580 return true;
16091581 }
16101582
@@ -1615,9 +1587,9 @@ class TopLevel {
16151587 * layering facet specifications is not allowed.
16161588 *
16171589 * @throws Exception
1618- * @return ?array
1590+ * @return array
16191591 */
1620- public function getLayer(): ?array {
1592+ public function getLayer(): array {
16211593 if (TopLevel::validateLayer($this->layer)) {
16221594 return $this->layer;
16231595 }
@@ -1630,9 +1602,9 @@ class TopLevel {
16301602 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
16311603 * layering facet specifications is not allowed.
16321604 *
1633- * @return ?array
1605+ * @return array
16341606 */
1635- public static function sampleLayer(): ?array {
1607+ public static function sampleLayer(): array {
16361608 return array(
16371609 LayerSpec::sample() /*47:*/
16381610 ); /* 47:layer*/
@@ -1750,16 +1722,12 @@ class TopLevel {
17501722 * An object that describes mappings between `row` and `column` channels and their field
17511723 * definitions.
17521724 *
1753- * @param ?stdClass $value
1725+ * @param stdClass $value
17541726 * @throws Exception
1755- * @return ?FacetMapping
1727+ * @return FacetMapping
17561728 */
1757- public static function fromFacet(?stdClass $value): ?FacetMapping {
1758- if (!is_null($value)) {
1759- return FacetMapping::from($value); /*class*/
1760- } else {
1761- return null;
1762- }
1729+ public static function fromFacet(stdClass $value): FacetMapping {
1730+ return FacetMapping::from($value); /*class*/
17631731 }
17641732
17651733 /**
@@ -1767,15 +1735,11 @@ class TopLevel {
17671735 * definitions.
17681736 *
17691737 * @throws Exception
1770- * @return ?stdClass
1738+ * @return stdClass
17711739 */
1772- public function toFacet(): ?stdClass {
1740+ public function toFacet(): stdClass {
17731741 if (TopLevel::validateFacet($this->facet)) {
1774- if (!is_null($this->facet)) {
1775- return $this->facet->to(); /*class*/
1776- } else {
1777- return null;
1778- }
1742+ return $this->facet->to(); /*class*/
17791743 }
17801744 throw new Exception('never get to this TopLevel::facet');
17811745 }
@@ -1784,14 +1748,12 @@ class TopLevel {
17841748 * An object that describes mappings between `row` and `column` channels and their field
17851749 * definitions.
17861750 *
1787- * @param FacetMapping|null
1751+ * @param FacetMapping
17881752 * @return bool
17891753 * @throws Exception
17901754 */
1791- public static function validateFacet(?FacetMapping $value): bool {
1792- if (!is_null($value)) {
1793- $value->validate();
1794- }
1755+ public static function validateFacet(FacetMapping $value): bool {
1756+ $value->validate();
17951757 return true;
17961758 }
17971759
@@ -1800,9 +1762,9 @@ class TopLevel {
18001762 * definitions.
18011763 *
18021764 * @throws Exception
1803- * @return ?FacetMapping
1765+ * @return FacetMapping
18041766 */
1805- public function getFacet(): ?FacetMapping {
1767+ public function getFacet(): FacetMapping {
18061768 if (TopLevel::validateFacet($this->facet)) {
18071769 return $this->facet;
18081770 }
@@ -1813,40 +1775,32 @@ class TopLevel {
18131775 * An object that describes mappings between `row` and `column` channels and their field
18141776 * definitions.
18151777 *
1816- * @return ?FacetMapping
1778+ * @return FacetMapping
18171779 */
1818- public static function sampleFacet(): ?FacetMapping {
1780+ public static function sampleFacet(): FacetMapping {
18191781 return FacetMapping::sample(); /*49:facet*/
18201782 }
18211783
18221784 /**
18231785 * A specification of the view that gets faceted.
18241786 *
1825- * @param ?stdClass $value
1787+ * @param stdClass $value
18261788 * @throws Exception
1827- * @return ?Spec
1789+ * @return Spec
18281790 */
1829- public static function fromSpec(?stdClass $value): ?Spec {
1830- if (!is_null($value)) {
1831- return Spec::from($value); /*class*/
1832- } else {
1833- return null;
1834- }
1791+ public static function fromSpec(stdClass $value): Spec {
1792+ return Spec::from($value); /*class*/
18351793 }
18361794
18371795 /**
18381796 * A specification of the view that gets faceted.
18391797 *
18401798 * @throws Exception
1841- * @return ?stdClass
1799+ * @return stdClass
18421800 */
1843- public function toSpec(): ?stdClass {
1801+ public function toSpec(): stdClass {
18441802 if (TopLevel::validateSpec($this->spec)) {
1845- if (!is_null($this->spec)) {
1846- return $this->spec->to(); /*class*/
1847- } else {
1848- return null;
1849- }
1803+ return $this->spec->to(); /*class*/
18501804 }
18511805 throw new Exception('never get to this TopLevel::spec');
18521806 }
@@ -1854,14 +1808,12 @@ class TopLevel {
18541808 /**
18551809 * A specification of the view that gets faceted.
18561810 *
1857- * @param Spec|null
1811+ * @param Spec
18581812 * @return bool
18591813 * @throws Exception
18601814 */
1861- public static function validateSpec(?Spec $value): bool {
1862- if (!is_null($value)) {
1863- $value->validate();
1864- }
1815+ public static function validateSpec(Spec $value): bool {
1816+ $value->validate();
18651817 return true;
18661818 }
18671819
@@ -1869,9 +1821,9 @@ class TopLevel {
18691821 * A specification of the view that gets faceted.
18701822 *
18711823 * @throws Exception
1872- * @return ?Spec
1824+ * @return Spec
18731825 */
1874- public function getSpec(): ?Spec {
1826+ public function getSpec(): Spec {
18751827 if (TopLevel::validateSpec($this->spec)) {
18761828 return $this->spec;
18771829 }
@@ -1881,9 +1833,9 @@ class TopLevel {
18811833 /**
18821834 * A specification of the view that gets faceted.
18831835 *
1884- * @return ?Spec
1836+ * @return Spec
18851837 */
1886- public static function sampleSpec(): ?Spec {
1838+ public static function sampleSpec(): Spec {
18871839 return Spec::sample(); /*50:spec*/
18881840 }
18891841
@@ -1891,16 +1843,12 @@ class TopLevel {
18911843 * An object that describes what fields should be repeated into views that are laid out as a
18921844 * `row` or `column`.
18931845 *
1894- * @param ?stdClass $value
1846+ * @param stdClass $value
18951847 * @throws Exception
1896- * @return ?Repeat
1848+ * @return Repeat
18971849 */
1898- public static function fromRepeat(?stdClass $value): ?Repeat {
1899- if (!is_null($value)) {
1900- return Repeat::from($value); /*class*/
1901- } else {
1902- return null;
1903- }
1850+ public static function fromRepeat(stdClass $value): Repeat {
1851+ return Repeat::from($value); /*class*/
19041852 }
19051853
19061854 /**
@@ -1908,15 +1856,11 @@ class TopLevel {
19081856 * `row` or `column`.
19091857 *
19101858 * @throws Exception
1911- * @return ?stdClass
1859+ * @return stdClass
19121860 */
1913- public function toRepeat(): ?stdClass {
1861+ public function toRepeat(): stdClass {
19141862 if (TopLevel::validateRepeat($this->repeat)) {
1915- if (!is_null($this->repeat)) {
1916- return $this->repeat->to(); /*class*/
1917- } else {
1918- return null;
1919- }
1863+ return $this->repeat->to(); /*class*/
19201864 }
19211865 throw new Exception('never get to this TopLevel::repeat');
19221866 }
@@ -1925,14 +1869,12 @@ class TopLevel {
19251869 * An object that describes what fields should be repeated into views that are laid out as a
19261870 * `row` or `column`.
19271871 *
1928- * @param Repeat|null
1872+ * @param Repeat
19291873 * @return bool
19301874 * @throws Exception
19311875 */
1932- public static function validateRepeat(?Repeat $value): bool {
1933- if (!is_null($value)) {
1934- $value->validate();
1935- }
1876+ public static function validateRepeat(Repeat $value): bool {
1877+ $value->validate();
19361878 return true;
19371879 }
19381880
@@ -1941,9 +1883,9 @@ class TopLevel {
19411883 * `row` or `column`.
19421884 *
19431885 * @throws Exception
1944- * @return ?Repeat
1886+ * @return Repeat
19451887 */
1946- public function getRepeat(): ?Repeat {
1888+ public function getRepeat(): Repeat {
19471889 if (TopLevel::validateRepeat($this->repeat)) {
19481890 return $this->repeat;
19491891 }
@@ -1954,44 +1896,36 @@ class TopLevel {
19541896 * An object that describes what fields should be repeated into views that are laid out as a
19551897 * `row` or `column`.
19561898 *
1957- * @return ?Repeat
1899+ * @return Repeat
19581900 */
1959- public static function sampleRepeat(): ?Repeat {
1901+ public static function sampleRepeat(): Repeat {
19601902 return Repeat::sample(); /*51:repeat*/
19611903 }
19621904
19631905 /**
19641906 * A list of views that should be concatenated and put into a column.
19651907 *
1966- * @param ?array $value
1908+ * @param array $value
19671909 * @throws Exception
1968- * @return ?array
1910+ * @return array
19691911 */
1970- public static function fromVconcat(?array $value): ?array {
1971- if (!is_null($value)) {
1972- return array_map(function ($value) {
1973- return Spec::from($value); /*class*/
1974- }, $value);
1975- } else {
1976- return null;
1977- }
1912+ public static function fromVconcat(array $value): array {
1913+ return array_map(function ($value) {
1914+ return Spec::from($value); /*class*/
1915+ }, $value);
19781916 }
19791917
19801918 /**
19811919 * A list of views that should be concatenated and put into a column.
19821920 *
19831921 * @throws Exception
1984- * @return ?array
1922+ * @return array
19851923 */
1986- public function toVconcat(): ?array {
1924+ public function toVconcat(): array {
19871925 if (TopLevel::validateVconcat($this->vconcat)) {
1988- if (!is_null($this->vconcat)) {
1989- return array_map(function ($value) {
1990- return $value->to(); /*class*/
1991- }, $this->vconcat);
1992- } else {
1993- return null;
1994- }
1926+ return array_map(function ($value) {
1927+ return $value->to(); /*class*/
1928+ }, $this->vconcat);
19951929 }
19961930 throw new Exception('never get to this TopLevel::vconcat');
19971931 }
@@ -1999,19 +1933,17 @@ class TopLevel {
19991933 /**
20001934 * A list of views that should be concatenated and put into a column.
20011935 *
2002- * @param array|null
1936+ * @param array
20031937 * @return bool
20041938 * @throws Exception
20051939 */
2006- public static function validateVconcat(?array $value): bool {
2007- if (!is_null($value)) {
2008- if (!is_array($value)) {
2009- throw new Exception("Attribute Error:TopLevel::vconcat");
2010- }
2011- array_walk($value, function($value_v) {
2012- $value_v->validate();
2013- });
1940+ public static function validateVconcat(array $value): bool {
1941+ if (!is_array($value)) {
1942+ throw new Exception("Attribute Error:TopLevel::vconcat");
20141943 }
1944+ array_walk($value, function($value_v) {
1945+ $value_v->validate();
1946+ });
20151947 return true;
20161948 }
20171949
@@ -2019,9 +1951,9 @@ class TopLevel {
20191951 * A list of views that should be concatenated and put into a column.
20201952 *
20211953 * @throws Exception
2022- * @return ?array
1954+ * @return array
20231955 */
2024- public function getVconcat(): ?array {
1956+ public function getVconcat(): array {
20251957 if (TopLevel::validateVconcat($this->vconcat)) {
20261958 return $this->vconcat;
20271959 }
@@ -2031,9 +1963,9 @@ class TopLevel {
20311963 /**
20321964 * A list of views that should be concatenated and put into a column.
20331965 *
2034- * @return ?array
1966+ * @return array
20351967 */
2036- public static function sampleVconcat(): ?array {
1968+ public static function sampleVconcat(): array {
20371969 return array(
20381970 Spec::sample() /*52:*/
20391971 ); /* 52:vconcat*/
@@ -2042,35 +1974,27 @@ class TopLevel {
20421974 /**
20431975 * A list of views that should be concatenated and put into a row.
20441976 *
2045- * @param ?array $value
1977+ * @param array $value
20461978 * @throws Exception
2047- * @return ?array
1979+ * @return array
20481980 */
2049- public static function fromHconcat(?array $value): ?array {
2050- if (!is_null($value)) {
2051- return array_map(function ($value) {
2052- return Spec::from($value); /*class*/
2053- }, $value);
2054- } else {
2055- return null;
2056- }
1981+ public static function fromHconcat(array $value): array {
1982+ return array_map(function ($value) {
1983+ return Spec::from($value); /*class*/
1984+ }, $value);
20571985 }
20581986
20591987 /**
20601988 * A list of views that should be concatenated and put into a row.
20611989 *
20621990 * @throws Exception
2063- * @return ?array
1991+ * @return array
20641992 */
2065- public function toHconcat(): ?array {
1993+ public function toHconcat(): array {
20661994 if (TopLevel::validateHconcat($this->hconcat)) {
2067- if (!is_null($this->hconcat)) {
2068- return array_map(function ($value) {
2069- return $value->to(); /*class*/
2070- }, $this->hconcat);
2071- } else {
2072- return null;
2073- }
1995+ return array_map(function ($value) {
1996+ return $value->to(); /*class*/
1997+ }, $this->hconcat);
20741998 }
20751999 throw new Exception('never get to this TopLevel::hconcat');
20762000 }
@@ -2078,19 +2002,17 @@ class TopLevel {
20782002 /**
20792003 * A list of views that should be concatenated and put into a row.
20802004 *
2081- * @param array|null
2005+ * @param array
20822006 * @return bool
20832007 * @throws Exception
20842008 */
2085- public static function validateHconcat(?array $value): bool {
2086- if (!is_null($value)) {
2087- if (!is_array($value)) {
2088- throw new Exception("Attribute Error:TopLevel::hconcat");
2089- }
2090- array_walk($value, function($value_v) {
2091- $value_v->validate();
2092- });
2009+ public static function validateHconcat(array $value): bool {
2010+ if (!is_array($value)) {
2011+ throw new Exception("Attribute Error:TopLevel::hconcat");
20932012 }
2013+ array_walk($value, function($value_v) {
2014+ $value_v->validate();
2015+ });
20942016 return true;
20952017 }
20962018
@@ -2098,9 +2020,9 @@ class TopLevel {
20982020 * A list of views that should be concatenated and put into a row.
20992021 *
21002022 * @throws Exception
2101- * @return ?array
2023+ * @return array
21022024 */
2103- public function getHconcat(): ?array {
2025+ public function getHconcat(): array {
21042026 if (TopLevel::validateHconcat($this->hconcat)) {
21052027 return $this->hconcat;
21062028 }
@@ -2110,9 +2032,9 @@ class TopLevel {
21102032 /**
21112033 * A list of views that should be concatenated and put into a row.
21122034 *
2113- * @return ?array
2035+ * @return array
21142036 */
2115- public static function sampleHconcat(): ?array {
2037+ public static function sampleHconcat(): array {
21162038 return array(
21172039 Spec::sample() /*53:*/
21182040 ); /* 53:hconcat*/
@@ -23081,16 +23003,16 @@ VGProjectionType::init();
2308123003 class VGScheme {
2308223004 private ?float $count; // json:count Optional
2308323005 private ?array $extent; // json:extent Optional
23084- private ?string $scheme; // json:scheme Optional
23006+ private string $scheme; // json:scheme Required
2308523007 private ?float $step; // json:step Optional
2308623008
2308723009 /**
2308823010 * @param float|null $count
2308923011 * @param array|null $extent
23090- * @param string|null $scheme
23012+ * @param string $scheme
2309123013 * @param float|null $step
2309223014 */
23093- public function __construct(?float $count, ?array $extent, ?string $scheme, ?float $step) {
23015+ public function __construct(?float $count, ?array $extent, string $scheme, ?float $step) {
2309423016 $this->count = $count;
2309523017 $this->extent = $extent;
2309623018 $this->scheme = $scheme;
@@ -23226,49 +23148,39 @@ class VGScheme {
2322623148 }
2322723149
2322823150 /**
23229- * @param ?string $value
23151+ * @param string $value
2323023152 * @throws Exception
23231- * @return ?string
23153+ * @return string
2323223154 */
23233- public static function fromScheme(?string $value): ?string {
23234- if (!is_null($value)) {
23235- return $value; /*string*/
23236- } else {
23237- return null;
23238- }
23155+ public static function fromScheme(string $value): string {
23156+ return $value; /*string*/
2323923157 }
2324023158
2324123159 /**
2324223160 * @throws Exception
23243- * @return ?string
23161+ * @return string
2324423162 */
23245- public function toScheme(): ?string {
23163+ public function toScheme(): string {
2324623164 if (VGScheme::validateScheme($this->scheme)) {
23247- if (!is_null($this->scheme)) {
23248- return $this->scheme; /*string*/
23249- } else {
23250- return null;
23251- }
23165+ return $this->scheme; /*string*/
2325223166 }
2325323167 throw new Exception('never get to this VGScheme::scheme');
2325423168 }
2325523169
2325623170 /**
23257- * @param string|null
23171+ * @param string
2325823172 * @return bool
2325923173 * @throws Exception
2326023174 */
23261- public static function validateScheme(?string $value): bool {
23262- if (!is_null($value)) {
23263- }
23175+ public static function validateScheme(string $value): bool {
2326423176 return true;
2326523177 }
2326623178
2326723179 /**
2326823180 * @throws Exception
23269- * @return ?string
23181+ * @return string
2327023182 */
23271- public function getScheme(): ?string {
23183+ public function getScheme(): string {
2327223184 if (VGScheme::validateScheme($this->scheme)) {
2327323185 return $this->scheme;
2327423186 }
@@ -23276,9 +23188,9 @@ class VGScheme {
2327623188 }
2327723189
2327823190 /**
23279- * @return ?string
23191+ * @return string
2328023192 */
23281- public static function sampleScheme(): ?string {
23193+ public static function sampleScheme(): string {
2328223194 return 'VGScheme::scheme::33'; /*33:scheme*/
2328323195 }
2328423196
@@ -28552,7 +28464,7 @@ class SingleSelectionConfig {
2855228464 class VGBinding {
2855328465 private ?string $element; // json:element Optional
2855428466 private string $input; // json:input Required
28555- private ?array $options; // json:options Optional
28467+ private array $options; // json:options Required
2855628468 private ?float $max; // json:max Optional
2855728469 private ?float $min; // json:min Optional
2855828470 private ?float $step; // json:step Optional
@@ -28560,12 +28472,12 @@ class VGBinding {
2856028472 /**
2856128473 * @param string|null $element
2856228474 * @param string $input
28563- * @param array|null $options
28475+ * @param array $options
2856428476 * @param float|null $max
2856528477 * @param float|null $min
2856628478 * @param float|null $step
2856728479 */
28568- public function __construct(?string $element, string $input, ?array $options, ?float $max, ?float $min, ?float $step) {
28480+ public function __construct(?string $element, string $input, array $options, ?float $max, ?float $min, ?float $step) {
2856928481 $this->element = $element;
2857028482 $this->input = $input;
2857128483 $this->options = $options;
@@ -28679,61 +28591,51 @@ class VGBinding {
2867928591 }
2868028592
2868128593 /**
28682- * @param ?array $value
28594+ * @param array $value
2868328595 * @throws Exception
28684- * @return ?array
28596+ * @return array
2868528597 */
28686- public static function fromOptions(?array $value): ?array {
28687- if (!is_null($value)) {
28688- return array_map(function ($value) {
28689- return $value; /*string*/
28690- }, $value);
28691- } else {
28692- return null;
28693- }
28598+ public static function fromOptions(array $value): array {
28599+ return array_map(function ($value) {
28600+ return $value; /*string*/
28601+ }, $value);
2869428602 }
2869528603
2869628604 /**
2869728605 * @throws Exception
28698- * @return ?array
28606+ * @return array
2869928607 */
28700- public function toOptions(): ?array {
28608+ public function toOptions(): array {
2870128609 if (VGBinding::validateOptions($this->options)) {
28702- if (!is_null($this->options)) {
28703- return array_map(function ($value) {
28704- return $value; /*string*/
28705- }, $this->options);
28706- } else {
28707- return null;
28708- }
28610+ return array_map(function ($value) {
28611+ return $value; /*string*/
28612+ }, $this->options);
2870928613 }
2871028614 throw new Exception('never get to this VGBinding::options');
2871128615 }
2871228616
2871328617 /**
28714- * @param array|null
28618+ * @param array
2871528619 * @return bool
2871628620 * @throws Exception
2871728621 */
28718- public static function validateOptions(?array $value): bool {
28719- if (!is_null($value)) {
28720- if (!is_array($value)) {
28622+ public static function validateOptions(array $value): bool {
28623+ if (!is_array($value)) {
28624+ throw new Exception("Attribute Error:VGBinding::options");
28625+ }
28626+ array_walk($value, function($value_v) {
28627+ if (!is_string($value_v)) {
2872128628 throw new Exception("Attribute Error:VGBinding::options");
2872228629 }
28723- array_walk($value, function($value_v) {
28724- if (!is_string($value_v)) {
28725- throw new Exception("Attribute Error:VGBinding::options");
28726- }
28727- });
28728- }
28630+ });
2872928631 return true;
2873028632 }
2873128633
2873228634 /**
2873328635 * @throws Exception
28734- * @return ?array
28636+ * @return array
2873528637 */
28736- public function getOptions(): ?array {
28638+ public function getOptions(): array {
2873728639 if (VGBinding::validateOptions($this->options)) {
2873828640 return $this->options;
2873928641 }
@@ -28741,9 +28643,9 @@ class VGBinding {
2874128643 }
2874228644
2874328645 /**
28744- * @return ?array
28646+ * @return array
2874528647 */
28746- public static function sampleOptions(): ?array {
28648+ public static function sampleOptions(): array {
2874728649 return array(
2874828650 'VGBinding::::33' /*33:*/
2874928651 ); /* 33:options*/
@@ -38845,17 +38747,17 @@ class ViewConfig {
3884538747
3884638748 class Data {
3884738749 private ?DataFormat $format; // json:format Optional
38848- private ?string $url; // json:url Optional
38849- private stdClass|array|string|null $values; // json:values Optional
38850- private ?string $name; // json:name Optional
38750+ private string $url; // json:url Required
38751+ private stdClass|array|string $values; // json:values Required
38752+ private string $name; // json:name Required
3885138753
3885238754 /**
3885338755 * @param DataFormat|null $format
38854- * @param string|null $url
38855- * @param stdClass|array|string|null $values
38856- * @param string|null $name
38756+ * @param string $url
38757+ * @param stdClass|array|string $values
38758+ * @param string $name
3885738759 */
38858- public function __construct(?DataFormat $format, ?string $url, stdClass|array|string|null $values, ?string $name) {
38760+ public function __construct(?DataFormat $format, string $url, stdClass|array|string $values, string $name) {
3885938761 $this->format = $format;
3886038762 $this->url = $url;
3886138763 $this->values = $values;
@@ -38954,16 +38856,12 @@ class Data {
3895438856 * An URL from which to load the data set. Use the `format.type` property
3895538857 * to ensure the loaded data is correctly parsed.
3895638858 *
38957- * @param ?string $value
38859+ * @param string $value
3895838860 * @throws Exception
38959- * @return ?string
38861+ * @return string
3896038862 */
38961- public static function fromURL(?string $value): ?string {
38962- if (!is_null($value)) {
38963- return $value; /*string*/
38964- } else {
38965- return null;
38966- }
38863+ public static function fromURL(string $value): string {
38864+ return $value; /*string*/
3896738865 }
3896838866
3896938867 /**
@@ -38971,15 +38869,11 @@ class Data {
3897138869 * to ensure the loaded data is correctly parsed.
3897238870 *
3897338871 * @throws Exception
38974- * @return ?string
38872+ * @return string
3897538873 */
38976- public function toURL(): ?string {
38874+ public function toURL(): string {
3897738875 if (Data::validateURL($this->url)) {
38978- if (!is_null($this->url)) {
38979- return $this->url; /*string*/
38980- } else {
38981- return null;
38982- }
38876+ return $this->url; /*string*/
3898338877 }
3898438878 throw new Exception('never get to this Data::url');
3898538879 }
@@ -38988,13 +38882,11 @@ class Data {
3898838882 * An URL from which to load the data set. Use the `format.type` property
3898938883 * to ensure the loaded data is correctly parsed.
3899038884 *
38991- * @param string|null
38885+ * @param string
3899238886 * @return bool
3899338887 * @throws Exception
3899438888 */
38995- public static function validateURL(?string $value): bool {
38996- if (!is_null($value)) {
38997- }
38889+ public static function validateURL(string $value): bool {
3899838890 return true;
3899938891 }
3900038892
@@ -39003,9 +38895,9 @@ class Data {
3900338895 * to ensure the loaded data is correctly parsed.
3900438896 *
3900538897 * @throws Exception
39006- * @return ?string
38898+ * @return string
3900738899 */
39008- public function getURL(): ?string {
38900+ public function getURL(): string {
3900938901 if (Data::validateURL($this->url)) {
3901038902 return $this->url;
3901138903 }
@@ -39016,9 +38908,9 @@ class Data {
3901638908 * An URL from which to load the data set. Use the `format.type` property
3901738909 * to ensure the loaded data is correctly parsed.
3901838910 *
39019- * @return ?string
38911+ * @return string
3902038912 */
39021- public static function sampleURL(): ?string {
38913+ public static function sampleURL(): string {
3902238914 return 'Data::url::32'; /*32:url*/
3902338915 }
3902438916
@@ -39028,14 +38920,12 @@ class Data {
3902838920 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
3902938921 * parsed according to the specified format type.
3903038922 *
39031- * @param stdClass|array|string|null $value
38923+ * @param stdClass|array|string $value
3903238924 * @throws Exception
39033- * @return stdClass|array|string|null
38925+ * @return stdClass|array|string
3903438926 */
39035- public static function fromValues(stdClass|array|string|null $value): stdClass|array|string|null {
39036- if (is_null($value)) {
39037- return $value; /*null*/
39038- } elseif (is_object($value)) {
38927+ public static function fromValues(stdClass|array|string $value): stdClass|array|string {
38928+ if (is_object($value)) {
3903938929 $out = new stdClass();
3904038930 foreach ($value as $k => $v) {
3904138931 $out->$k = $v; /*any*/
@@ -39073,13 +38963,11 @@ class Data {
3907338963 * parsed according to the specified format type.
3907438964 *
3907538965 * @throws Exception
39076- * @return stdClass|array|string|null
38966+ * @return stdClass|array|string
3907738967 */
39078- public function toValues(): stdClass|array|string|null {
38968+ public function toValues(): stdClass|array|string {
3907938969 if (Data::validateValues($this->values)) {
39080- if (is_null($this->values)) {
39081- return $this->values; /*null*/
39082- } elseif ($this->values instanceof stdClass) {
38970+ if ($this->values instanceof stdClass) {
3908338971 $out = new stdClass();
3908438972 foreach ($this->values as $k => $v) {
3908538973 $out->$k = $v; /*any*/
@@ -39118,16 +39006,12 @@ class Data {
3911839006 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
3911939007 * parsed according to the specified format type.
3912039008 *
39121- * @param stdClass|array|string|null
39009+ * @param stdClass|array|string
3912239010 * @return bool
3912339011 * @throws Exception
3912439012 */
39125- public static function validateValues(stdClass|array|string|null $value): bool {
39126- if (is_null($value)) {
39127- if (!is_null($value)) {
39128- throw new Exception("Attribute Error:Data::values");
39129- }
39130- } elseif ($value instanceof stdClass) {
39013+ public static function validateValues(stdClass|array|string $value): bool {
39014+ if ($value instanceof stdClass) {
3913139015 foreach ($value as $k => $v) {
3913239016 }
3913339017 } elseif (is_array($value)) {
@@ -39171,9 +39055,9 @@ class Data {
3917139055 * parsed according to the specified format type.
3917239056 *
3917339057 * @throws Exception
39174- * @return stdClass|array|string|null
39058+ * @return stdClass|array|string
3917539059 */
39176- public function getValues(): stdClass|array|string|null {
39060+ public function getValues(): stdClass|array|string {
3917739061 if (Data::validateValues($this->values)) {
3917839062 return $this->values;
3917939063 }
@@ -39186,9 +39070,9 @@ class Data {
3918639070 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
3918739071 * parsed according to the specified format type.
3918839072 *
39189- * @return stdClass|array|string|null
39073+ * @return stdClass|array|string
3919039074 */
39191- public static function sampleValues(): stdClass|array|string|null {
39075+ public static function sampleValues(): stdClass|array|string {
3919239076 return (function () {
3919339077 $out = new stdClass();
3919439078 $out->{'Data'} = 'AnyType::Data::values::33';/*33:values*/
@@ -39199,31 +39083,23 @@ class Data {
3919939083 /**
3920039084 * Provide a placeholder name and bind data at runtime.
3920139085 *
39202- * @param ?string $value
39086+ * @param string $value
3920339087 * @throws Exception
39204- * @return ?string
39088+ * @return string
3920539089 */
39206- public static function fromName(?string $value): ?string {
39207- if (!is_null($value)) {
39208- return $value; /*string*/
39209- } else {
39210- return null;
39211- }
39090+ public static function fromName(string $value): string {
39091+ return $value; /*string*/
3921239092 }
3921339093
3921439094 /**
3921539095 * Provide a placeholder name and bind data at runtime.
3921639096 *
3921739097 * @throws Exception
39218- * @return ?string
39098+ * @return string
3921939099 */
39220- public function toName(): ?string {
39100+ public function toName(): string {
3922139101 if (Data::validateName($this->name)) {
39222- if (!is_null($this->name)) {
39223- return $this->name; /*string*/
39224- } else {
39225- return null;
39226- }
39102+ return $this->name; /*string*/
3922739103 }
3922839104 throw new Exception('never get to this Data::name');
3922939105 }
@@ -39231,13 +39107,11 @@ class Data {
3923139107 /**
3923239108 * Provide a placeholder name and bind data at runtime.
3923339109 *
39234- * @param string|null
39110+ * @param string
3923539111 * @return bool
3923639112 * @throws Exception
3923739113 */
39238- public static function validateName(?string $value): bool {
39239- if (!is_null($value)) {
39240- }
39114+ public static function validateName(string $value): bool {
3924139115 return true;
3924239116 }
3924339117
@@ -39245,9 +39119,9 @@ class Data {
3924539119 * Provide a placeholder name and bind data at runtime.
3924639120 *
3924739121 * @throws Exception
39248- * @return ?string
39122+ * @return string
3924939123 */
39250- public function getName(): ?string {
39124+ public function getName(): string {
3925139125 if (Data::validateName($this->name)) {
3925239126 return $this->name;
3925339127 }
@@ -39257,9 +39131,9 @@ class Data {
3925739131 /**
3925839132 * Provide a placeholder name and bind data at runtime.
3925939133 *
39260- * @return ?string
39134+ * @return string
3926139135 */
39262- public static function sampleName(): ?string {
39136+ public static function sampleName(): string {
3926339137 return 'Data::name::34'; /*34:name*/
3926439138 }
3926539139
@@ -41367,7 +41241,7 @@ class MarkPropDefWithCondition {
4136741241 private ?Scale $scale; // json:scale Optional
4136841242 private SortField|SortOrder|null $sort; // json:sort Optional
4136941243 private ?TimeUnit $timeUnit; // json:timeUnit Optional
41370- private ?Type $type; // json:type Optional
41244+ private Type $type; // json:type Required
4137141245 private bool|float|string|null $value; // json:value Optional
4137241246
4137341247 /**
@@ -41379,10 +41253,10 @@ class MarkPropDefWithCondition {
4137941253 * @param Scale|null $scale
4138041254 * @param SortField|SortOrder|null $sort
4138141255 * @param TimeUnit|null $timeUnit
41382- * @param Type|null $type
41256+ * @param Type $type
4138341257 * @param bool|float|string|null $value
4138441258 */
41385- public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateMarkPropFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) {
41259+ public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateMarkPropFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, Type $type, bool|float|string|null $value) {
4138641260 $this->aggregate = $aggregate;
4138741261 $this->bin = $bin;
4138841262 $this->condition = $condition;
@@ -42207,16 +42081,12 @@ class MarkPropDefWithCondition {
4220742081 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4220842082 * [geographic projection](projection.html) is applied.
4220942083 *
42210- * @param ?string $value
42084+ * @param string $value
4221142085 * @throws Exception
42212- * @return ?Type
42086+ * @return Type
4221342087 */
42214- public static function fromType(?string $value): ?Type {
42215- if (!is_null($value)) {
42216- return Type::from($value); /*enum*/
42217- } else {
42218- return null;
42219- }
42088+ public static function fromType(string $value): Type {
42089+ return Type::from($value); /*enum*/
4222042090 }
4222142091
4222242092 /**
@@ -42226,15 +42096,11 @@ class MarkPropDefWithCondition {
4222642096 * [geographic projection](projection.html) is applied.
4222742097 *
4222842098 * @throws Exception
42229- * @return ?string
42099+ * @return string
4223042100 */
42231- public function toType(): ?string {
42101+ public function toType(): string {
4223242102 if (MarkPropDefWithCondition::validateType($this->type)) {
42233- if (!is_null($this->type)) {
42234- return Type::to($this->type); /*enum*/
42235- } else {
42236- return null;
42237- }
42103+ return Type::to($this->type); /*enum*/
4223842104 }
4223942105 throw new Exception('never get to this MarkPropDefWithCondition::type');
4224042106 }
@@ -42245,14 +42111,12 @@ class MarkPropDefWithCondition {
4224542111 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4224642112 * [geographic projection](projection.html) is applied.
4224742113 *
42248- * @param Type|null
42114+ * @param Type
4224942115 * @return bool
4225042116 * @throws Exception
4225142117 */
42252- public static function validateType(?Type $value): bool {
42253- if (!is_null($value)) {
42254- Type::to($value);
42255- }
42118+ public static function validateType(Type $value): bool {
42119+ Type::to($value);
4225642120 return true;
4225742121 }
4225842122
@@ -42263,9 +42127,9 @@ class MarkPropDefWithCondition {
4226342127 * [geographic projection](projection.html) is applied.
4226442128 *
4226542129 * @throws Exception
42266- * @return ?Type
42130+ * @return Type
4226742131 */
42268- public function getType(): ?Type {
42132+ public function getType(): Type {
4226942133 if (MarkPropDefWithCondition::validateType($this->type)) {
4227042134 return $this->type;
4227142135 }
@@ -42278,9 +42142,9 @@ class MarkPropDefWithCondition {
4227842142 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4227942143 * [geographic projection](projection.html) is applied.
4228042144 *
42281- * @return ?Type
42145+ * @return Type
4228242146 */
42283- public static function sampleType(): ?Type {
42147+ public static function sampleType(): Type {
4228442148 return Type::sample(); /*enum*/
4228542149 }
4228642150
@@ -43346,30 +43210,28 @@ class BinParams {
4334643210 // This is an autogenerated file:ConditionalValueDef
4334743211
4334843212 class ConditionalValueDef {
43349- private Predicate|string|null $test; // json:test Optional
43213+ private Predicate|string $test; // json:test Required
4335043214 private bool|float|string $value; // json:value Required
43351- private Selection|string|null $selection; // json:selection Optional
43215+ private Selection|string $selection; // json:selection Required
4335243216
4335343217 /**
43354- * @param Predicate|string|null $test
43218+ * @param Predicate|string $test
4335543219 * @param bool|float|string $value
43356- * @param Selection|string|null $selection
43220+ * @param Selection|string $selection
4335743221 */
43358- public function __construct(Predicate|string|null $test, bool|float|string $value, Selection|string|null $selection) {
43222+ public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection) {
4335943223 $this->test = $test;
4336043224 $this->value = $value;
4336143225 $this->selection = $selection;
4336243226 }
4336343227
4336443228 /**
43365- * @param stdClass|string|null $value
43229+ * @param stdClass|string $value
4336643230 * @throws Exception
43367- * @return Predicate|string|null
43231+ * @return Predicate|string
4336843232 */
43369- public static function fromTest(stdClass|string|null $value): Predicate|string|null {
43370- if (is_null($value)) {
43371- return $value; /*null*/
43372- } elseif (is_object($value)) {
43233+ public static function fromTest(stdClass|string $value): Predicate|string {
43234+ if (is_object($value)) {
4337343235 return Predicate::from($value); /*class*/
4337443236 } elseif (is_string($value)) {
4337543237 return $value; /*string*/
@@ -43380,13 +43242,11 @@ class ConditionalValueDef {
4338043242
4338143243 /**
4338243244 * @throws Exception
43383- * @return stdClass|string|null
43245+ * @return stdClass|string
4338443246 */
43385- public function toTest(): stdClass|string|null {
43247+ public function toTest(): stdClass|string {
4338643248 if (ConditionalValueDef::validateTest($this->test)) {
43387- if (is_null($this->test)) {
43388- return $this->test; /*null*/
43389- } elseif ($this->test instanceof Predicate) {
43249+ if ($this->test instanceof Predicate) {
4339043250 return $this->test->to(); /*class*/
4339143251 } elseif (is_string($this->test)) {
4339243252 return $this->test; /*string*/
@@ -43398,16 +43258,12 @@ class ConditionalValueDef {
4339843258 }
4339943259
4340043260 /**
43401- * @param Predicate|string|null
43261+ * @param Predicate|string
4340243262 * @return bool
4340343263 * @throws Exception
4340443264 */
43405- public static function validateTest(Predicate|string|null $value): bool {
43406- if (is_null($value)) {
43407- if (!is_null($value)) {
43408- throw new Exception("Attribute Error:ConditionalValueDef::test");
43409- }
43410- } elseif ($value instanceof Predicate) {
43265+ public static function validateTest(Predicate|string $value): bool {
43266+ if ($value instanceof Predicate) {
4341143267 $value->validate();
4341243268 } elseif (is_string($value)) {
4341343269 if (!is_string($value)) {
@@ -43421,9 +43277,9 @@ class ConditionalValueDef {
4342143277
4342243278 /**
4342343279 * @throws Exception
43424- * @return Predicate|string|null
43280+ * @return Predicate|string
4342543281 */
43426- public function getTest(): Predicate|string|null {
43282+ public function getTest(): Predicate|string {
4342743283 if (ConditionalValueDef::validateTest($this->test)) {
4342843284 return $this->test;
4342943285 }
@@ -43431,9 +43287,9 @@ class ConditionalValueDef {
4343143287 }
4343243288
4343343289 /**
43434- * @return Predicate|string|null
43290+ * @return Predicate|string
4343543291 */
43436- public static function sampleTest(): Predicate|string|null {
43292+ public static function sampleTest(): Predicate|string {
4343743293 return Predicate::sample(); /*31:test*/
4343843294 }
4343943295
@@ -43534,14 +43390,12 @@ class ConditionalValueDef {
4353443390 * A [selection name](selection.html), or a series of [composed
4353543391 * selections](selection.html#compose).
4353643392 *
43537- * @param stdClass|string|null $value
43393+ * @param stdClass|string $value
4353843394 * @throws Exception
43539- * @return Selection|string|null
43395+ * @return Selection|string
4354043396 */
43541- public static function fromSelection(stdClass|string|null $value): Selection|string|null {
43542- if (is_null($value)) {
43543- return $value; /*null*/
43544- } elseif (is_object($value)) {
43397+ public static function fromSelection(stdClass|string $value): Selection|string {
43398+ if (is_object($value)) {
4354543399 return Selection::from($value); /*class*/
4354643400 } elseif (is_string($value)) {
4354743401 return $value; /*string*/
@@ -43555,13 +43409,11 @@ class ConditionalValueDef {
4355543409 * selections](selection.html#compose).
4355643410 *
4355743411 * @throws Exception
43558- * @return stdClass|string|null
43412+ * @return stdClass|string
4355943413 */
43560- public function toSelection(): stdClass|string|null {
43414+ public function toSelection(): stdClass|string {
4356143415 if (ConditionalValueDef::validateSelection($this->selection)) {
43562- if (is_null($this->selection)) {
43563- return $this->selection; /*null*/
43564- } elseif ($this->selection instanceof Selection) {
43416+ if ($this->selection instanceof Selection) {
4356543417 return $this->selection->to(); /*class*/
4356643418 } elseif (is_string($this->selection)) {
4356743419 return $this->selection; /*string*/
@@ -43576,16 +43428,12 @@ class ConditionalValueDef {
4357643428 * A [selection name](selection.html), or a series of [composed
4357743429 * selections](selection.html#compose).
4357843430 *
43579- * @param Selection|string|null
43431+ * @param Selection|string
4358043432 * @return bool
4358143433 * @throws Exception
4358243434 */
43583- public static function validateSelection(Selection|string|null $value): bool {
43584- if (is_null($value)) {
43585- if (!is_null($value)) {
43586- throw new Exception("Attribute Error:ConditionalValueDef::selection");
43587- }
43588- } elseif ($value instanceof Selection) {
43435+ public static function validateSelection(Selection|string $value): bool {
43436+ if ($value instanceof Selection) {
4358943437 $value->validate();
4359043438 } elseif (is_string($value)) {
4359143439 if (!is_string($value)) {
@@ -43602,9 +43450,9 @@ class ConditionalValueDef {
4360243450 * selections](selection.html#compose).
4360343451 *
4360443452 * @throws Exception
43605- * @return Selection|string|null
43453+ * @return Selection|string
4360643454 */
43607- public function getSelection(): Selection|string|null {
43455+ public function getSelection(): Selection|string {
4360843456 if (ConditionalValueDef::validateSelection($this->selection)) {
4360943457 return $this->selection;
4361043458 }
@@ -43615,9 +43463,9 @@ class ConditionalValueDef {
4361543463 * A [selection name](selection.html), or a series of [composed
4361643464 * selections](selection.html#compose).
4361743465 *
43618- * @return Selection|string|null
43466+ * @return Selection|string
4361943467 */
43620- public static function sampleSelection(): Selection|string|null {
43468+ public static function sampleSelection(): Selection|string {
4362143469 return Selection::sample(); /*33:selection*/
4362243470 }
4362343471
@@ -43671,30 +43519,28 @@ class ConditionalValueDef {
4367143519 // This is an autogenerated file:Selection
4367243520
4367343521 class Selection {
43674- private Selection|string|null $not; // json:not Optional
43675- private ?array $and; // json:and Optional
43676- private ?array $or; // json:or Optional
43522+ private Selection|string $not; // json:not Required
43523+ private array $and; // json:and Required
43524+ private array $or; // json:or Required
4367743525
4367843526 /**
43679- * @param Selection|string|null $not
43680- * @param array|null $and
43681- * @param array|null $or
43527+ * @param Selection|string $not
43528+ * @param array $and
43529+ * @param array $or
4368243530 */
43683- public function __construct(Selection|string|null $not, ?array $and, ?array $or) {
43531+ public function __construct(Selection|string $not, array $and, array $or) {
4368443532 $this->not = $not;
4368543533 $this->and = $and;
4368643534 $this->or = $or;
4368743535 }
4368843536
4368943537 /**
43690- * @param stdClass|string|null $value
43538+ * @param stdClass|string $value
4369143539 * @throws Exception
43692- * @return Selection|string|null
43540+ * @return Selection|string
4369343541 */
43694- public static function fromNot(stdClass|string|null $value): Selection|string|null {
43695- if (is_null($value)) {
43696- return $value; /*null*/
43697- } elseif (is_object($value)) {
43542+ public static function fromNot(stdClass|string $value): Selection|string {
43543+ if (is_object($value)) {
4369843544 return Selection::from($value); /*class*/
4369943545 } elseif (is_string($value)) {
4370043546 return $value; /*string*/
@@ -43705,13 +43551,11 @@ class Selection {
4370543551
4370643552 /**
4370743553 * @throws Exception
43708- * @return stdClass|string|null
43554+ * @return stdClass|string
4370943555 */
43710- public function toNot(): stdClass|string|null {
43556+ public function toNot(): stdClass|string {
4371143557 if (Selection::validateNot($this->not)) {
43712- if (is_null($this->not)) {
43713- return $this->not; /*null*/
43714- } elseif ($this->not instanceof Selection) {
43558+ if ($this->not instanceof Selection) {
4371543559 return $this->not->to(); /*class*/
4371643560 } elseif (is_string($this->not)) {
4371743561 return $this->not; /*string*/
@@ -43723,16 +43567,12 @@ class Selection {
4372343567 }
4372443568
4372543569 /**
43726- * @param Selection|string|null
43570+ * @param Selection|string
4372743571 * @return bool
4372843572 * @throws Exception
4372943573 */
43730- public static function validateNot(Selection|string|null $value): bool {
43731- if (is_null($value)) {
43732- if (!is_null($value)) {
43733- throw new Exception("Attribute Error:Selection::not");
43734- }
43735- } elseif ($value instanceof Selection) {
43574+ public static function validateNot(Selection|string $value): bool {
43575+ if ($value instanceof Selection) {
4373643576 $value->validate();
4373743577 } elseif (is_string($value)) {
4373843578 if (!is_string($value)) {
@@ -43746,9 +43586,9 @@ class Selection {
4374643586
4374743587 /**
4374843588 * @throws Exception
43749- * @return Selection|string|null
43589+ * @return Selection|string
4375043590 */
43751- public function getNot(): Selection|string|null {
43591+ public function getNot(): Selection|string {
4375243592 if (Selection::validateNot($this->not)) {
4375343593 return $this->not;
4375443594 }
@@ -43756,86 +43596,76 @@ class Selection {
4375643596 }
4375743597
4375843598 /**
43759- * @return Selection|string|null
43599+ * @return Selection|string
4376043600 */
43761- public static function sampleNot(): Selection|string|null {
43601+ public static function sampleNot(): Selection|string {
4376243602 return Selection::sample(); /*31:not*/
4376343603 }
4376443604
4376543605 /**
43766- * @param ?array $value
43606+ * @param array $value
4376743607 * @throws Exception
43768- * @return ?array
43608+ * @return array
4376943609 */
43770- public static function fromAnd(?array $value): ?array {
43771- if (!is_null($value)) {
43772- return array_map(function ($value) {
43773- if (is_object($value)) {
43774- return Selection::from($value); /*class*/
43775- } elseif (is_string($value)) {
43776- return $value; /*string*/
43777- } else {
43778- throw new Exception('Cannot deserialize union value in Selection');
43779- }
43780- }, $value);
43781- } else {
43782- return null;
43783- }
43610+ public static function fromAnd(array $value): array {
43611+ return array_map(function ($value) {
43612+ if (is_object($value)) {
43613+ return Selection::from($value); /*class*/
43614+ } elseif (is_string($value)) {
43615+ return $value; /*string*/
43616+ } else {
43617+ throw new Exception('Cannot deserialize union value in Selection');
43618+ }
43619+ }, $value);
4378443620 }
4378543621
4378643622 /**
4378743623 * @throws Exception
43788- * @return ?array
43624+ * @return array
4378943625 */
43790- public function toAnd(): ?array {
43626+ public function toAnd(): array {
4379143627 if (Selection::validateAnd($this->and)) {
43792- if (!is_null($this->and)) {
43793- return array_map(function ($value) {
43794- if ($value instanceof Selection) {
43795- return $value->to(); /*class*/
43796- } elseif (is_string($value)) {
43797- return $value; /*string*/
43798- } else {
43799- throw new Exception('Union value has no matching member in Selection');
43800- }
43801- }, $this->and);
43802- } else {
43803- return null;
43804- }
43628+ return array_map(function ($value) {
43629+ if ($value instanceof Selection) {
43630+ return $value->to(); /*class*/
43631+ } elseif (is_string($value)) {
43632+ return $value; /*string*/
43633+ } else {
43634+ throw new Exception('Union value has no matching member in Selection');
43635+ }
43636+ }, $this->and);
4380543637 }
4380643638 throw new Exception('never get to this Selection::and');
4380743639 }
4380843640
4380943641 /**
43810- * @param array|null
43642+ * @param array
4381143643 * @return bool
4381243644 * @throws Exception
4381343645 */
43814- public static function validateAnd(?array $value): bool {
43815- if (!is_null($value)) {
43816- if (!is_array($value)) {
43817- throw new Exception("Attribute Error:Selection::and");
43818- }
43819- array_walk($value, function($value_v) {
43820- if ($value_v instanceof Selection) {
43821- $value_v->validate();
43822- } elseif (is_string($value_v)) {
43823- if (!is_string($value_v)) {
43824- throw new Exception("Attribute Error:Selection::and");
43825- }
43826- } else {
43646+ public static function validateAnd(array $value): bool {
43647+ if (!is_array($value)) {
43648+ throw new Exception("Attribute Error:Selection::and");
43649+ }
43650+ array_walk($value, function($value_v) {
43651+ if ($value_v instanceof Selection) {
43652+ $value_v->validate();
43653+ } elseif (is_string($value_v)) {
43654+ if (!is_string($value_v)) {
4382743655 throw new Exception("Attribute Error:Selection::and");
4382843656 }
43829- });
43830- }
43657+ } else {
43658+ throw new Exception("Attribute Error:Selection::and");
43659+ }
43660+ });
4383143661 return true;
4383243662 }
4383343663
4383443664 /**
4383543665 * @throws Exception
43836- * @return ?array
43666+ * @return array
4383743667 */
43838- public function getAnd(): ?array {
43668+ public function getAnd(): array {
4383943669 if (Selection::validateAnd($this->and)) {
4384043670 return $this->and;
4384143671 }
@@ -43843,88 +43673,78 @@ class Selection {
4384343673 }
4384443674
4384543675 /**
43846- * @return ?array
43676+ * @return array
4384743677 */
43848- public static function sampleAnd(): ?array {
43678+ public static function sampleAnd(): array {
4384943679 return array(
4385043680 Selection::sample() /*32:*/
4385143681 ); /* 32:and*/
4385243682 }
4385343683
4385443684 /**
43855- * @param ?array $value
43685+ * @param array $value
4385643686 * @throws Exception
43857- * @return ?array
43687+ * @return array
4385843688 */
43859- public static function fromOr(?array $value): ?array {
43860- if (!is_null($value)) {
43861- return array_map(function ($value) {
43862- if (is_object($value)) {
43863- return Selection::from($value); /*class*/
43864- } elseif (is_string($value)) {
43865- return $value; /*string*/
43866- } else {
43867- throw new Exception('Cannot deserialize union value in Selection');
43868- }
43869- }, $value);
43870- } else {
43871- return null;
43872- }
43689+ public static function fromOr(array $value): array {
43690+ return array_map(function ($value) {
43691+ if (is_object($value)) {
43692+ return Selection::from($value); /*class*/
43693+ } elseif (is_string($value)) {
43694+ return $value; /*string*/
43695+ } else {
43696+ throw new Exception('Cannot deserialize union value in Selection');
43697+ }
43698+ }, $value);
4387343699 }
4387443700
4387543701 /**
4387643702 * @throws Exception
43877- * @return ?array
43703+ * @return array
4387843704 */
43879- public function toOr(): ?array {
43705+ public function toOr(): array {
4388043706 if (Selection::validateOr($this->or)) {
43881- if (!is_null($this->or)) {
43882- return array_map(function ($value) {
43883- if ($value instanceof Selection) {
43884- return $value->to(); /*class*/
43885- } elseif (is_string($value)) {
43886- return $value; /*string*/
43887- } else {
43888- throw new Exception('Union value has no matching member in Selection');
43889- }
43890- }, $this->or);
43891- } else {
43892- return null;
43893- }
43707+ return array_map(function ($value) {
43708+ if ($value instanceof Selection) {
43709+ return $value->to(); /*class*/
43710+ } elseif (is_string($value)) {
43711+ return $value; /*string*/
43712+ } else {
43713+ throw new Exception('Union value has no matching member in Selection');
43714+ }
43715+ }, $this->or);
4389443716 }
4389543717 throw new Exception('never get to this Selection::or');
4389643718 }
4389743719
4389843720 /**
43899- * @param array|null
43721+ * @param array
4390043722 * @return bool
4390143723 * @throws Exception
4390243724 */
43903- public static function validateOr(?array $value): bool {
43904- if (!is_null($value)) {
43905- if (!is_array($value)) {
43906- throw new Exception("Attribute Error:Selection::or");
43907- }
43908- array_walk($value, function($value_v) {
43909- if ($value_v instanceof Selection) {
43910- $value_v->validate();
43911- } elseif (is_string($value_v)) {
43912- if (!is_string($value_v)) {
43913- throw new Exception("Attribute Error:Selection::or");
43914- }
43915- } else {
43725+ public static function validateOr(array $value): bool {
43726+ if (!is_array($value)) {
43727+ throw new Exception("Attribute Error:Selection::or");
43728+ }
43729+ array_walk($value, function($value_v) {
43730+ if ($value_v instanceof Selection) {
43731+ $value_v->validate();
43732+ } elseif (is_string($value_v)) {
43733+ if (!is_string($value_v)) {
4391643734 throw new Exception("Attribute Error:Selection::or");
4391743735 }
43918- });
43919- }
43736+ } else {
43737+ throw new Exception("Attribute Error:Selection::or");
43738+ }
43739+ });
4392043740 return true;
4392143741 }
4392243742
4392343743 /**
4392443744 * @throws Exception
43925- * @return ?array
43745+ * @return array
4392643746 */
43927- public function getOr(): ?array {
43747+ public function getOr(): array {
4392843748 if (Selection::validateOr($this->or)) {
4392943749 return $this->or;
4393043750 }
@@ -43932,9 +43752,9 @@ class Selection {
4393243752 }
4393343753
4393443754 /**
43935- * @return ?array
43755+ * @return array
4393643756 */
43937- public static function sampleOr(): ?array {
43757+ public static function sampleOr(): array {
4393843758 return array(
4393943759 Selection::sample() /*33:*/
4394043760 ); /* 33:or*/
@@ -43990,28 +43810,28 @@ class Selection {
4399043810 // This is an autogenerated file:Predicate
4399143811
4399243812 class Predicate {
43993- private Predicate|string|null $not; // json:not Optional
43994- private ?array $and; // json:and Optional
43995- private ?array $or; // json:or Optional
43996- private DateTimeClass|bool|float|string|null $equal; // json:equal Optional
43997- private ?string $field; // json:field Optional
43813+ private Predicate|string $not; // json:not Required
43814+ private array $and; // json:and Required
43815+ private array $or; // json:or Required
43816+ private DateTimeClass|bool|float|string $equal; // json:equal Required
43817+ private string $field; // json:field Required
4399843818 private ?TimeUnit $timeUnit; // json:timeUnit Optional
43999- private ?array $range; // json:range Optional
44000- private ?array $oneOf; // json:oneOf Optional
44001- private Selection|string|null $selection; // json:selection Optional
43819+ private array $range; // json:range Required
43820+ private array $oneOf; // json:oneOf Required
43821+ private Selection|string $selection; // json:selection Required
4400243822
4400343823 /**
44004- * @param Predicate|string|null $not
44005- * @param array|null $and
44006- * @param array|null $or
44007- * @param DateTimeClass|bool|float|string|null $equal
44008- * @param string|null $field
43824+ * @param Predicate|string $not
43825+ * @param array $and
43826+ * @param array $or
43827+ * @param DateTimeClass|bool|float|string $equal
43828+ * @param string $field
4400943829 * @param TimeUnit|null $timeUnit
44010- * @param array|null $range
44011- * @param array|null $oneOf
44012- * @param Selection|string|null $selection
43830+ * @param array $range
43831+ * @param array $oneOf
43832+ * @param Selection|string $selection
4401343833 */
44014- public function __construct(Predicate|string|null $not, ?array $and, ?array $or, DateTimeClass|bool|float|string|null $equal, ?string $field, ?TimeUnit $timeUnit, ?array $range, ?array $oneOf, Selection|string|null $selection) {
43834+ public function __construct(Predicate|string $not, array $and, array $or, DateTimeClass|bool|float|string $equal, string $field, ?TimeUnit $timeUnit, array $range, array $oneOf, Selection|string $selection) {
4401543835 $this->not = $not;
4401643836 $this->and = $and;
4401743837 $this->or = $or;
@@ -44024,14 +43844,12 @@ class Predicate {
4402443844 }
4402543845
4402643846 /**
44027- * @param stdClass|string|null $value
43847+ * @param stdClass|string $value
4402843848 * @throws Exception
44029- * @return Predicate|string|null
43849+ * @return Predicate|string
4403043850 */
44031- public static function fromNot(stdClass|string|null $value): Predicate|string|null {
44032- if (is_null($value)) {
44033- return $value; /*null*/
44034- } elseif (is_object($value)) {
43851+ public static function fromNot(stdClass|string $value): Predicate|string {
43852+ if (is_object($value)) {
4403543853 return Predicate::from($value); /*class*/
4403643854 } elseif (is_string($value)) {
4403743855 return $value; /*string*/
@@ -44042,13 +43860,11 @@ class Predicate {
4404243860
4404343861 /**
4404443862 * @throws Exception
44045- * @return stdClass|string|null
43863+ * @return stdClass|string
4404643864 */
44047- public function toNot(): stdClass|string|null {
43865+ public function toNot(): stdClass|string {
4404843866 if (Predicate::validateNot($this->not)) {
44049- if (is_null($this->not)) {
44050- return $this->not; /*null*/
44051- } elseif ($this->not instanceof Predicate) {
43867+ if ($this->not instanceof Predicate) {
4405243868 return $this->not->to(); /*class*/
4405343869 } elseif (is_string($this->not)) {
4405443870 return $this->not; /*string*/
@@ -44060,16 +43876,12 @@ class Predicate {
4406043876 }
4406143877
4406243878 /**
44063- * @param Predicate|string|null
43879+ * @param Predicate|string
4406443880 * @return bool
4406543881 * @throws Exception
4406643882 */
44067- public static function validateNot(Predicate|string|null $value): bool {
44068- if (is_null($value)) {
44069- if (!is_null($value)) {
44070- throw new Exception("Attribute Error:Predicate::not");
44071- }
44072- } elseif ($value instanceof Predicate) {
43883+ public static function validateNot(Predicate|string $value): bool {
43884+ if ($value instanceof Predicate) {
4407343885 $value->validate();
4407443886 } elseif (is_string($value)) {
4407543887 if (!is_string($value)) {
@@ -44083,9 +43895,9 @@ class Predicate {
4408343895
4408443896 /**
4408543897 * @throws Exception
44086- * @return Predicate|string|null
43898+ * @return Predicate|string
4408743899 */
44088- public function getNot(): Predicate|string|null {
43900+ public function getNot(): Predicate|string {
4408943901 if (Predicate::validateNot($this->not)) {
4409043902 return $this->not;
4409143903 }
@@ -44093,86 +43905,76 @@ class Predicate {
4409343905 }
4409443906
4409543907 /**
44096- * @return Predicate|string|null
43908+ * @return Predicate|string
4409743909 */
44098- public static function sampleNot(): Predicate|string|null {
43910+ public static function sampleNot(): Predicate|string {
4409943911 return Predicate::sample(); /*31:not*/
4410043912 }
4410143913
4410243914 /**
44103- * @param ?array $value
43915+ * @param array $value
4410443916 * @throws Exception
44105- * @return ?array
43917+ * @return array
4410643918 */
44107- public static function fromAnd(?array $value): ?array {
44108- if (!is_null($value)) {
44109- return array_map(function ($value) {
44110- if (is_object($value)) {
44111- return Predicate::from($value); /*class*/
44112- } elseif (is_string($value)) {
44113- return $value; /*string*/
44114- } else {
44115- throw new Exception('Cannot deserialize union value in Predicate');
44116- }
44117- }, $value);
44118- } else {
44119- return null;
44120- }
43919+ public static function fromAnd(array $value): array {
43920+ return array_map(function ($value) {
43921+ if (is_object($value)) {
43922+ return Predicate::from($value); /*class*/
43923+ } elseif (is_string($value)) {
43924+ return $value; /*string*/
43925+ } else {
43926+ throw new Exception('Cannot deserialize union value in Predicate');
43927+ }
43928+ }, $value);
4412143929 }
4412243930
4412343931 /**
4412443932 * @throws Exception
44125- * @return ?array
43933+ * @return array
4412643934 */
44127- public function toAnd(): ?array {
43935+ public function toAnd(): array {
4412843936 if (Predicate::validateAnd($this->and)) {
44129- if (!is_null($this->and)) {
44130- return array_map(function ($value) {
44131- if ($value instanceof Predicate) {
44132- return $value->to(); /*class*/
44133- } elseif (is_string($value)) {
44134- return $value; /*string*/
44135- } else {
44136- throw new Exception('Union value has no matching member in Predicate');
44137- }
44138- }, $this->and);
44139- } else {
44140- return null;
44141- }
43937+ return array_map(function ($value) {
43938+ if ($value instanceof Predicate) {
43939+ return $value->to(); /*class*/
43940+ } elseif (is_string($value)) {
43941+ return $value; /*string*/
43942+ } else {
43943+ throw new Exception('Union value has no matching member in Predicate');
43944+ }
43945+ }, $this->and);
4414243946 }
4414343947 throw new Exception('never get to this Predicate::and');
4414443948 }
4414543949
4414643950 /**
44147- * @param array|null
43951+ * @param array
4414843952 * @return bool
4414943953 * @throws Exception
4415043954 */
44151- public static function validateAnd(?array $value): bool {
44152- if (!is_null($value)) {
44153- if (!is_array($value)) {
44154- throw new Exception("Attribute Error:Predicate::and");
44155- }
44156- array_walk($value, function($value_v) {
44157- if ($value_v instanceof Predicate) {
44158- $value_v->validate();
44159- } elseif (is_string($value_v)) {
44160- if (!is_string($value_v)) {
44161- throw new Exception("Attribute Error:Predicate::and");
44162- }
44163- } else {
43955+ public static function validateAnd(array $value): bool {
43956+ if (!is_array($value)) {
43957+ throw new Exception("Attribute Error:Predicate::and");
43958+ }
43959+ array_walk($value, function($value_v) {
43960+ if ($value_v instanceof Predicate) {
43961+ $value_v->validate();
43962+ } elseif (is_string($value_v)) {
43963+ if (!is_string($value_v)) {
4416443964 throw new Exception("Attribute Error:Predicate::and");
4416543965 }
44166- });
44167- }
43966+ } else {
43967+ throw new Exception("Attribute Error:Predicate::and");
43968+ }
43969+ });
4416843970 return true;
4416943971 }
4417043972
4417143973 /**
4417243974 * @throws Exception
44173- * @return ?array
43975+ * @return array
4417443976 */
44175- public function getAnd(): ?array {
43977+ public function getAnd(): array {
4417643978 if (Predicate::validateAnd($this->and)) {
4417743979 return $this->and;
4417843980 }
@@ -44180,88 +43982,78 @@ class Predicate {
4418043982 }
4418143983
4418243984 /**
44183- * @return ?array
43985+ * @return array
4418443986 */
44185- public static function sampleAnd(): ?array {
43987+ public static function sampleAnd(): array {
4418643988 return array(
4418743989 Predicate::sample() /*32:*/
4418843990 ); /* 32:and*/
4418943991 }
4419043992
4419143993 /**
44192- * @param ?array $value
43994+ * @param array $value
4419343995 * @throws Exception
44194- * @return ?array
43996+ * @return array
4419543997 */
44196- public static function fromOr(?array $value): ?array {
44197- if (!is_null($value)) {
44198- return array_map(function ($value) {
44199- if (is_object($value)) {
44200- return Predicate::from($value); /*class*/
44201- } elseif (is_string($value)) {
44202- return $value; /*string*/
44203- } else {
44204- throw new Exception('Cannot deserialize union value in Predicate');
44205- }
44206- }, $value);
44207- } else {
44208- return null;
44209- }
43998+ public static function fromOr(array $value): array {
43999+ return array_map(function ($value) {
44000+ if (is_object($value)) {
44001+ return Predicate::from($value); /*class*/
44002+ } elseif (is_string($value)) {
44003+ return $value; /*string*/
44004+ } else {
44005+ throw new Exception('Cannot deserialize union value in Predicate');
44006+ }
44007+ }, $value);
4421044008 }
4421144009
4421244010 /**
4421344011 * @throws Exception
44214- * @return ?array
44012+ * @return array
4421544013 */
44216- public function toOr(): ?array {
44014+ public function toOr(): array {
4421744015 if (Predicate::validateOr($this->or)) {
44218- if (!is_null($this->or)) {
44219- return array_map(function ($value) {
44220- if ($value instanceof Predicate) {
44221- return $value->to(); /*class*/
44222- } elseif (is_string($value)) {
44223- return $value; /*string*/
44224- } else {
44225- throw new Exception('Union value has no matching member in Predicate');
44226- }
44227- }, $this->or);
44228- } else {
44229- return null;
44230- }
44016+ return array_map(function ($value) {
44017+ if ($value instanceof Predicate) {
44018+ return $value->to(); /*class*/
44019+ } elseif (is_string($value)) {
44020+ return $value; /*string*/
44021+ } else {
44022+ throw new Exception('Union value has no matching member in Predicate');
44023+ }
44024+ }, $this->or);
4423144025 }
4423244026 throw new Exception('never get to this Predicate::or');
4423344027 }
4423444028
4423544029 /**
44236- * @param array|null
44030+ * @param array
4423744031 * @return bool
4423844032 * @throws Exception
4423944033 */
44240- public static function validateOr(?array $value): bool {
44241- if (!is_null($value)) {
44242- if (!is_array($value)) {
44243- throw new Exception("Attribute Error:Predicate::or");
44244- }
44245- array_walk($value, function($value_v) {
44246- if ($value_v instanceof Predicate) {
44247- $value_v->validate();
44248- } elseif (is_string($value_v)) {
44249- if (!is_string($value_v)) {
44250- throw new Exception("Attribute Error:Predicate::or");
44251- }
44252- } else {
44034+ public static function validateOr(array $value): bool {
44035+ if (!is_array($value)) {
44036+ throw new Exception("Attribute Error:Predicate::or");
44037+ }
44038+ array_walk($value, function($value_v) {
44039+ if ($value_v instanceof Predicate) {
44040+ $value_v->validate();
44041+ } elseif (is_string($value_v)) {
44042+ if (!is_string($value_v)) {
4425344043 throw new Exception("Attribute Error:Predicate::or");
4425444044 }
44255- });
44256- }
44045+ } else {
44046+ throw new Exception("Attribute Error:Predicate::or");
44047+ }
44048+ });
4425744049 return true;
4425844050 }
4425944051
4426044052 /**
4426144053 * @throws Exception
44262- * @return ?array
44054+ * @return array
4426344055 */
44264- public function getOr(): ?array {
44056+ public function getOr(): array {
4426544057 if (Predicate::validateOr($this->or)) {
4426644058 return $this->or;
4426744059 }
@@ -44269,9 +44061,9 @@ class Predicate {
4426944061 }
4427044062
4427144063 /**
44272- * @return ?array
44064+ * @return array
4427344065 */
44274- public static function sampleOr(): ?array {
44066+ public static function sampleOr(): array {
4427544067 return array(
4427644068 Predicate::sample() /*33:*/
4427744069 ); /* 33:or*/
@@ -44280,14 +44072,12 @@ class Predicate {
4428044072 /**
4428144073 * The value that the field should be equal to.
4428244074 *
44283- * @param stdClass|bool|float|string|null $value
44075+ * @param stdClass|bool|float|string $value
4428444076 * @throws Exception
44285- * @return DateTimeClass|bool|float|string|null
44077+ * @return DateTimeClass|bool|float|string
4428644078 */
44287- public static function fromEqual(stdClass|bool|float|string|null $value): DateTimeClass|bool|float|string|null {
44288- if (is_null($value)) {
44289- return $value; /*null*/
44290- } elseif (is_object($value)) {
44079+ public static function fromEqual(stdClass|bool|float|string $value): DateTimeClass|bool|float|string {
44080+ if (is_object($value)) {
4429144081 return DateTimeClass::from($value); /*class*/
4429244082 } elseif (is_bool($value)) {
4429344083 return $value; /*bool*/
@@ -44304,13 +44094,11 @@ class Predicate {
4430444094 * The value that the field should be equal to.
4430544095 *
4430644096 * @throws Exception
44307- * @return stdClass|bool|float|string|null
44097+ * @return stdClass|bool|float|string
4430844098 */
44309- public function toEqual(): stdClass|bool|float|string|null {
44099+ public function toEqual(): stdClass|bool|float|string {
4431044100 if (Predicate::validateEqual($this->equal)) {
44311- if (is_null($this->equal)) {
44312- return $this->equal; /*null*/
44313- } elseif ($this->equal instanceof DateTimeClass) {
44101+ if ($this->equal instanceof DateTimeClass) {
4431444102 return $this->equal->to(); /*class*/
4431544103 } elseif (is_bool($this->equal)) {
4431644104 return $this->equal; /*bool*/
@@ -44328,16 +44116,12 @@ class Predicate {
4432844116 /**
4432944117 * The value that the field should be equal to.
4433044118 *
44331- * @param DateTimeClass|bool|float|string|null
44119+ * @param DateTimeClass|bool|float|string
4433244120 * @return bool
4433344121 * @throws Exception
4433444122 */
44335- public static function validateEqual(DateTimeClass|bool|float|string|null $value): bool {
44336- if (is_null($value)) {
44337- if (!is_null($value)) {
44338- throw new Exception("Attribute Error:Predicate::equal");
44339- }
44340- } elseif ($value instanceof DateTimeClass) {
44123+ public static function validateEqual(DateTimeClass|bool|float|string $value): bool {
44124+ if ($value instanceof DateTimeClass) {
4434144125 $value->validate();
4434244126 } elseif (is_bool($value)) {
4434344127 if (!is_bool($value)) {
@@ -44361,9 +44145,9 @@ class Predicate {
4436144145 * The value that the field should be equal to.
4436244146 *
4436344147 * @throws Exception
44364- * @return DateTimeClass|bool|float|string|null
44148+ * @return DateTimeClass|bool|float|string
4436544149 */
44366- public function getEqual(): DateTimeClass|bool|float|string|null {
44150+ public function getEqual(): DateTimeClass|bool|float|string {
4436744151 if (Predicate::validateEqual($this->equal)) {
4436844152 return $this->equal;
4436944153 }
@@ -44373,9 +44157,9 @@ class Predicate {
4437344157 /**
4437444158 * The value that the field should be equal to.
4437544159 *
44376- * @return DateTimeClass|bool|float|string|null
44160+ * @return DateTimeClass|bool|float|string
4437744161 */
44378- public static function sampleEqual(): DateTimeClass|bool|float|string|null {
44162+ public static function sampleEqual(): DateTimeClass|bool|float|string {
4437944163 return DateTimeClass::sample(); /*34:equal*/
4438044164 }
4438144165
@@ -44384,16 +44168,12 @@ class Predicate {
4438444168 *
4438544169 * Field to be filtered
4438644170 *
44387- * @param ?string $value
44171+ * @param string $value
4438844172 * @throws Exception
44389- * @return ?string
44173+ * @return string
4439044174 */
44391- public static function fromField(?string $value): ?string {
44392- if (!is_null($value)) {
44393- return $value; /*string*/
44394- } else {
44395- return null;
44396- }
44175+ public static function fromField(string $value): string {
44176+ return $value; /*string*/
4439744177 }
4439844178
4439944179 /**
@@ -44402,15 +44182,11 @@ class Predicate {
4440244182 * Field to be filtered
4440344183 *
4440444184 * @throws Exception
44405- * @return ?string
44185+ * @return string
4440644186 */
44407- public function toField(): ?string {
44187+ public function toField(): string {
4440844188 if (Predicate::validateField($this->field)) {
44409- if (!is_null($this->field)) {
44410- return $this->field; /*string*/
44411- } else {
44412- return null;
44413- }
44189+ return $this->field; /*string*/
4441444190 }
4441544191 throw new Exception('never get to this Predicate::field');
4441644192 }
@@ -44420,13 +44196,11 @@ class Predicate {
4442044196 *
4442144197 * Field to be filtered
4442244198 *
44423- * @param string|null
44199+ * @param string
4442444200 * @return bool
4442544201 * @throws Exception
4442644202 */
44427- public static function validateField(?string $value): bool {
44428- if (!is_null($value)) {
44429- }
44203+ public static function validateField(string $value): bool {
4443044204 return true;
4443144205 }
4443244206
@@ -44436,9 +44210,9 @@ class Predicate {
4443644210 * Field to be filtered
4443744211 *
4443844212 * @throws Exception
44439- * @return ?string
44213+ * @return string
4444044214 */
44441- public function getField(): ?string {
44215+ public function getField(): string {
4444244216 if (Predicate::validateField($this->field)) {
4444344217 return $this->field;
4444444218 }
@@ -44450,9 +44224,9 @@ class Predicate {
4445044224 *
4445144225 * Field to be filtered
4445244226 *
44453- * @return ?string
44227+ * @return string
4445444228 */
44455- public static function sampleField(): ?string {
44229+ public static function sampleField(): string {
4445644230 return 'Predicate::field::35'; /*35:field*/
4445744231 }
4445844232
@@ -44538,26 +44312,22 @@ class Predicate {
4453844312 * An array of inclusive minimum and maximum values
4453944313 * for a field value of a data item to be included in the filtered data.
4454044314 *
44541- * @param ?array $value
44315+ * @param array $value
4454244316 * @throws Exception
44543- * @return ?array
44317+ * @return array
4454444318 */
44545- public static function fromRange(?array $value): ?array {
44546- if (!is_null($value)) {
44547- return array_map(function ($value) {
44548- if (is_null($value)) {
44549- return $value; /*null*/
44550- } elseif (is_object($value)) {
44551- return DateTimeClass::from($value); /*class*/
44552- } elseif (is_float($value) || is_int($value)) {
44553- return $value; /*float*/
44554- } else {
44555- throw new Exception('Cannot deserialize union value in Predicate');
44556- }
44557- }, $value);
44558- } else {
44559- return null;
44560- }
44319+ public static function fromRange(array $value): array {
44320+ return array_map(function ($value) {
44321+ if (is_null($value)) {
44322+ return $value; /*null*/
44323+ } elseif (is_object($value)) {
44324+ return DateTimeClass::from($value); /*class*/
44325+ } elseif (is_float($value) || is_int($value)) {
44326+ return $value; /*float*/
44327+ } else {
44328+ throw new Exception('Cannot deserialize union value in Predicate');
44329+ }
44330+ }, $value);
4456144331 }
4456244332
4456344333 /**
@@ -44565,25 +44335,21 @@ class Predicate {
4456544335 * for a field value of a data item to be included in the filtered data.
4456644336 *
4456744337 * @throws Exception
44568- * @return ?array
44338+ * @return array
4456944339 */
44570- public function toRange(): ?array {
44340+ public function toRange(): array {
4457144341 if (Predicate::validateRange($this->range)) {
44572- if (!is_null($this->range)) {
44573- return array_map(function ($value) {
44574- if (is_null($value)) {
44575- return $value; /*null*/
44576- } elseif ($value instanceof DateTimeClass) {
44577- return $value->to(); /*class*/
44578- } elseif (is_float($value) || is_int($value)) {
44579- return $value; /*float*/
44580- } else {
44581- throw new Exception('Union value has no matching member in Predicate');
44582- }
44583- }, $this->range);
44584- } else {
44585- return null;
44586- }
44342+ return array_map(function ($value) {
44343+ if (is_null($value)) {
44344+ return $value; /*null*/
44345+ } elseif ($value instanceof DateTimeClass) {
44346+ return $value->to(); /*class*/
44347+ } elseif (is_float($value) || is_int($value)) {
44348+ return $value; /*float*/
44349+ } else {
44350+ throw new Exception('Union value has no matching member in Predicate');
44351+ }
44352+ }, $this->range);
4458744353 }
4458844354 throw new Exception('never get to this Predicate::range');
4458944355 }
@@ -44592,31 +44358,29 @@ class Predicate {
4459244358 * An array of inclusive minimum and maximum values
4459344359 * for a field value of a data item to be included in the filtered data.
4459444360 *
44595- * @param array|null
44361+ * @param array
4459644362 * @return bool
4459744363 * @throws Exception
4459844364 */
44599- public static function validateRange(?array $value): bool {
44600- if (!is_null($value)) {
44601- if (!is_array($value)) {
44602- throw new Exception("Attribute Error:Predicate::range");
44603- }
44604- array_walk($value, function($value_v) {
44605- if (is_null($value_v)) {
44606- if (!is_null($value_v)) {
44607- throw new Exception("Attribute Error:Predicate::range");
44608- }
44609- } elseif ($value_v instanceof DateTimeClass) {
44610- $value_v->validate();
44611- } elseif (is_float($value_v) || is_int($value_v)) {
44612- if (!is_float($value_v) && !is_int($value_v)) {
44613- throw new Exception("Attribute Error:Predicate::range");
44614- }
44615- } else {
44365+ public static function validateRange(array $value): bool {
44366+ if (!is_array($value)) {
44367+ throw new Exception("Attribute Error:Predicate::range");
44368+ }
44369+ array_walk($value, function($value_v) {
44370+ if (is_null($value_v)) {
44371+ if (!is_null($value_v)) {
4461644372 throw new Exception("Attribute Error:Predicate::range");
4461744373 }
44618- });
44619- }
44374+ } elseif ($value_v instanceof DateTimeClass) {
44375+ $value_v->validate();
44376+ } elseif (is_float($value_v) || is_int($value_v)) {
44377+ if (!is_float($value_v) && !is_int($value_v)) {
44378+ throw new Exception("Attribute Error:Predicate::range");
44379+ }
44380+ } else {
44381+ throw new Exception("Attribute Error:Predicate::range");
44382+ }
44383+ });
4462044384 return true;
4462144385 }
4462244386
@@ -44625,9 +44389,9 @@ class Predicate {
4462544389 * for a field value of a data item to be included in the filtered data.
4462644390 *
4462744391 * @throws Exception
44628- * @return ?array
44392+ * @return array
4462944393 */
44630- public function getRange(): ?array {
44394+ public function getRange(): array {
4463144395 if (Predicate::validateRange($this->range)) {
4463244396 return $this->range;
4463344397 }
@@ -44638,9 +44402,9 @@ class Predicate {
4463844402 * An array of inclusive minimum and maximum values
4463944403 * for a field value of a data item to be included in the filtered data.
4464044404 *
44641- * @return ?array
44405+ * @return array
4464244406 */
44643- public static function sampleRange(): ?array {
44407+ public static function sampleRange(): array {
4464444408 return array(
4464544409 DateTimeClass::sample() /*37:*/
4464644410 ); /* 37:range*/
@@ -44650,28 +44414,24 @@ class Predicate {
4465044414 * A set of values that the `field`'s value should be a member of,
4465144415 * for a data item included in the filtered data.
4465244416 *
44653- * @param ?array $value
44417+ * @param array $value
4465444418 * @throws Exception
44655- * @return ?array
44419+ * @return array
4465644420 */
44657- public static function fromOneOf(?array $value): ?array {
44658- if (!is_null($value)) {
44659- return array_map(function ($value) {
44660- if (is_object($value)) {
44661- return DateTimeClass::from($value); /*class*/
44662- } elseif (is_bool($value)) {
44663- return $value; /*bool*/
44664- } elseif (is_float($value) || is_int($value)) {
44665- return $value; /*float*/
44666- } elseif (is_string($value)) {
44667- return $value; /*string*/
44668- } else {
44669- throw new Exception('Cannot deserialize union value in Predicate');
44670- }
44671- }, $value);
44672- } else {
44673- return null;
44674- }
44421+ public static function fromOneOf(array $value): array {
44422+ return array_map(function ($value) {
44423+ if (is_object($value)) {
44424+ return DateTimeClass::from($value); /*class*/
44425+ } elseif (is_bool($value)) {
44426+ return $value; /*bool*/
44427+ } elseif (is_float($value) || is_int($value)) {
44428+ return $value; /*float*/
44429+ } elseif (is_string($value)) {
44430+ return $value; /*string*/
44431+ } else {
44432+ throw new Exception('Cannot deserialize union value in Predicate');
44433+ }
44434+ }, $value);
4467544435 }
4467644436
4467744437 /**
@@ -44679,27 +44439,23 @@ class Predicate {
4467944439 * for a data item included in the filtered data.
4468044440 *
4468144441 * @throws Exception
44682- * @return ?array
44442+ * @return array
4468344443 */
44684- public function toOneOf(): ?array {
44444+ public function toOneOf(): array {
4468544445 if (Predicate::validateOneOf($this->oneOf)) {
44686- if (!is_null($this->oneOf)) {
44687- return array_map(function ($value) {
44688- if ($value instanceof DateTimeClass) {
44689- return $value->to(); /*class*/
44690- } elseif (is_bool($value)) {
44691- return $value; /*bool*/
44692- } elseif (is_float($value) || is_int($value)) {
44693- return $value; /*float*/
44694- } elseif (is_string($value)) {
44695- return $value; /*string*/
44696- } else {
44697- throw new Exception('Union value has no matching member in Predicate');
44698- }
44699- }, $this->oneOf);
44700- } else {
44701- return null;
44702- }
44446+ return array_map(function ($value) {
44447+ if ($value instanceof DateTimeClass) {
44448+ return $value->to(); /*class*/
44449+ } elseif (is_bool($value)) {
44450+ return $value; /*bool*/
44451+ } elseif (is_float($value) || is_int($value)) {
44452+ return $value; /*float*/
44453+ } elseif (is_string($value)) {
44454+ return $value; /*string*/
44455+ } else {
44456+ throw new Exception('Union value has no matching member in Predicate');
44457+ }
44458+ }, $this->oneOf);
4470344459 }
4470444460 throw new Exception('never get to this Predicate::oneOf');
4470544461 }
@@ -44708,35 +44464,33 @@ class Predicate {
4470844464 * A set of values that the `field`'s value should be a member of,
4470944465 * for a data item included in the filtered data.
4471044466 *
44711- * @param array|null
44467+ * @param array
4471244468 * @return bool
4471344469 * @throws Exception
4471444470 */
44715- public static function validateOneOf(?array $value): bool {
44716- if (!is_null($value)) {
44717- if (!is_array($value)) {
44718- throw new Exception("Attribute Error:Predicate::oneOf");
44719- }
44720- array_walk($value, function($value_v) {
44721- if ($value_v instanceof DateTimeClass) {
44722- $value_v->validate();
44723- } elseif (is_bool($value_v)) {
44724- if (!is_bool($value_v)) {
44725- throw new Exception("Attribute Error:Predicate::oneOf");
44726- }
44727- } elseif (is_float($value_v) || is_int($value_v)) {
44728- if (!is_float($value_v) && !is_int($value_v)) {
44729- throw new Exception("Attribute Error:Predicate::oneOf");
44730- }
44731- } elseif (is_string($value_v)) {
44732- if (!is_string($value_v)) {
44733- throw new Exception("Attribute Error:Predicate::oneOf");
44734- }
44735- } else {
44471+ public static function validateOneOf(array $value): bool {
44472+ if (!is_array($value)) {
44473+ throw new Exception("Attribute Error:Predicate::oneOf");
44474+ }
44475+ array_walk($value, function($value_v) {
44476+ if ($value_v instanceof DateTimeClass) {
44477+ $value_v->validate();
44478+ } elseif (is_bool($value_v)) {
44479+ if (!is_bool($value_v)) {
4473644480 throw new Exception("Attribute Error:Predicate::oneOf");
4473744481 }
44738- });
44739- }
44482+ } elseif (is_float($value_v) || is_int($value_v)) {
44483+ if (!is_float($value_v) && !is_int($value_v)) {
44484+ throw new Exception("Attribute Error:Predicate::oneOf");
44485+ }
44486+ } elseif (is_string($value_v)) {
44487+ if (!is_string($value_v)) {
44488+ throw new Exception("Attribute Error:Predicate::oneOf");
44489+ }
44490+ } else {
44491+ throw new Exception("Attribute Error:Predicate::oneOf");
44492+ }
44493+ });
4474044494 return true;
4474144495 }
4474244496
@@ -44745,9 +44499,9 @@ class Predicate {
4474544499 * for a data item included in the filtered data.
4474644500 *
4474744501 * @throws Exception
44748- * @return ?array
44502+ * @return array
4474944503 */
44750- public function getOneOf(): ?array {
44504+ public function getOneOf(): array {
4475144505 if (Predicate::validateOneOf($this->oneOf)) {
4475244506 return $this->oneOf;
4475344507 }
@@ -44758,9 +44512,9 @@ class Predicate {
4475844512 * A set of values that the `field`'s value should be a member of,
4475944513 * for a data item included in the filtered data.
4476044514 *
44761- * @return ?array
44515+ * @return array
4476244516 */
44763- public static function sampleOneOf(): ?array {
44517+ public static function sampleOneOf(): array {
4476444518 return array(
4476544519 DateTimeClass::sample() /*38:*/
4476644520 ); /* 38:oneOf*/
@@ -44769,14 +44523,12 @@ class Predicate {
4476944523 /**
4477044524 * Filter using a selection name.
4477144525 *
44772- * @param stdClass|string|null $value
44526+ * @param stdClass|string $value
4477344527 * @throws Exception
44774- * @return Selection|string|null
44528+ * @return Selection|string
4477544529 */
44776- public static function fromSelection(stdClass|string|null $value): Selection|string|null {
44777- if (is_null($value)) {
44778- return $value; /*null*/
44779- } elseif (is_object($value)) {
44530+ public static function fromSelection(stdClass|string $value): Selection|string {
44531+ if (is_object($value)) {
4478044532 return Selection::from($value); /*class*/
4478144533 } elseif (is_string($value)) {
4478244534 return $value; /*string*/
@@ -44789,13 +44541,11 @@ class Predicate {
4478944541 * Filter using a selection name.
4479044542 *
4479144543 * @throws Exception
44792- * @return stdClass|string|null
44544+ * @return stdClass|string
4479344545 */
44794- public function toSelection(): stdClass|string|null {
44546+ public function toSelection(): stdClass|string {
4479544547 if (Predicate::validateSelection($this->selection)) {
44796- if (is_null($this->selection)) {
44797- return $this->selection; /*null*/
44798- } elseif ($this->selection instanceof Selection) {
44548+ if ($this->selection instanceof Selection) {
4479944549 return $this->selection->to(); /*class*/
4480044550 } elseif (is_string($this->selection)) {
4480144551 return $this->selection; /*string*/
@@ -44809,16 +44559,12 @@ class Predicate {
4480944559 /**
4481044560 * Filter using a selection name.
4481144561 *
44812- * @param Selection|string|null
44562+ * @param Selection|string
4481344563 * @return bool
4481444564 * @throws Exception
4481544565 */
44816- public static function validateSelection(Selection|string|null $value): bool {
44817- if (is_null($value)) {
44818- if (!is_null($value)) {
44819- throw new Exception("Attribute Error:Predicate::selection");
44820- }
44821- } elseif ($value instanceof Selection) {
44566+ public static function validateSelection(Selection|string $value): bool {
44567+ if ($value instanceof Selection) {
4482244568 $value->validate();
4482344569 } elseif (is_string($value)) {
4482444570 if (!is_string($value)) {
@@ -44834,9 +44580,9 @@ class Predicate {
4483444580 * Filter using a selection name.
4483544581 *
4483644582 * @throws Exception
44837- * @return Selection|string|null
44583+ * @return Selection|string
4483844584 */
44839- public function getSelection(): Selection|string|null {
44585+ public function getSelection(): Selection|string {
4484044586 if (Predicate::validateSelection($this->selection)) {
4484144587 return $this->selection;
4484244588 }
@@ -44846,9 +44592,9 @@ class Predicate {
4484644592 /**
4484744593 * Filter using a selection name.
4484844594 *
44849- * @return Selection|string|null
44595+ * @return Selection|string
4485044596 */
44851- public static function sampleSelection(): Selection|string|null {
44597+ public static function sampleSelection(): Selection|string {
4485244598 return Selection::sample(); /*39:selection*/
4485344599 }
4485444600
@@ -46016,9 +45762,9 @@ TimeUnit::init();
4601645762 // This is an autogenerated file:ConditionalPredicateMarkPropFieldDefClass
4601745763
4601845764 class ConditionalPredicateMarkPropFieldDefClass {
46019- private Predicate|string|null $test; // json:test Optional
46020- private bool|float|string|null $value; // json:value Optional
46021- private Selection|string|null $selection; // json:selection Optional
45765+ private Predicate|string $test; // json:test Required
45766+ private bool|float|string $value; // json:value Required
45767+ private Selection|string $selection; // json:selection Required
4602245768 private ?AggregateOp $aggregate; // json:aggregate Optional
4602345769 private BinParams|bool|null $bin; // json:bin Optional
4602445770 private RepeatRef|string|null $field; // json:field Optional
@@ -46026,12 +45772,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4602645772 private ?Scale $scale; // json:scale Optional
4602745773 private SortField|SortOrder|null $sort; // json:sort Optional
4602845774 private ?TimeUnit $timeUnit; // json:timeUnit Optional
46029- private ?Type $type; // json:type Optional
45775+ private Type $type; // json:type Required
4603045776
4603145777 /**
46032- * @param Predicate|string|null $test
46033- * @param bool|float|string|null $value
46034- * @param Selection|string|null $selection
45778+ * @param Predicate|string $test
45779+ * @param bool|float|string $value
45780+ * @param Selection|string $selection
4603545781 * @param AggregateOp|null $aggregate
4603645782 * @param BinParams|bool|null $bin
4603745783 * @param RepeatRef|string|null $field
@@ -46039,9 +45785,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4603945785 * @param Scale|null $scale
4604045786 * @param SortField|SortOrder|null $sort
4604145787 * @param TimeUnit|null $timeUnit
46042- * @param Type|null $type
45788+ * @param Type $type
4604345789 */
46044- public function __construct(Predicate|string|null $test, bool|float|string|null $value, Selection|string|null $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, ?Type $type) {
45790+ public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Legend $legend, ?Scale $scale, SortField|SortOrder|null $sort, ?TimeUnit $timeUnit, Type $type) {
4604545791 $this->test = $test;
4604645792 $this->value = $value;
4604745793 $this->selection = $selection;
@@ -46056,14 +45802,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4605645802 }
4605745803
4605845804 /**
46059- * @param stdClass|string|null $value
45805+ * @param stdClass|string $value
4606045806 * @throws Exception
46061- * @return Predicate|string|null
45807+ * @return Predicate|string
4606245808 */
46063- public static function fromTest(stdClass|string|null $value): Predicate|string|null {
46064- if (is_null($value)) {
46065- return $value; /*null*/
46066- } elseif (is_object($value)) {
45809+ public static function fromTest(stdClass|string $value): Predicate|string {
45810+ if (is_object($value)) {
4606745811 return Predicate::from($value); /*class*/
4606845812 } elseif (is_string($value)) {
4606945813 return $value; /*string*/
@@ -46074,13 +45818,11 @@ class ConditionalPredicateMarkPropFieldDefClass {
4607445818
4607545819 /**
4607645820 * @throws Exception
46077- * @return stdClass|string|null
45821+ * @return stdClass|string
4607845822 */
46079- public function toTest(): stdClass|string|null {
45823+ public function toTest(): stdClass|string {
4608045824 if (ConditionalPredicateMarkPropFieldDefClass::validateTest($this->test)) {
46081- if (is_null($this->test)) {
46082- return $this->test; /*null*/
46083- } elseif ($this->test instanceof Predicate) {
45825+ if ($this->test instanceof Predicate) {
4608445826 return $this->test->to(); /*class*/
4608545827 } elseif (is_string($this->test)) {
4608645828 return $this->test; /*string*/
@@ -46092,16 +45834,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4609245834 }
4609345835
4609445836 /**
46095- * @param Predicate|string|null
45837+ * @param Predicate|string
4609645838 * @return bool
4609745839 * @throws Exception
4609845840 */
46099- public static function validateTest(Predicate|string|null $value): bool {
46100- if (is_null($value)) {
46101- if (!is_null($value)) {
46102- throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::test");
46103- }
46104- } elseif ($value instanceof Predicate) {
45841+ public static function validateTest(Predicate|string $value): bool {
45842+ if ($value instanceof Predicate) {
4610545843 $value->validate();
4610645844 } elseif (is_string($value)) {
4610745845 if (!is_string($value)) {
@@ -46115,9 +45853,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4611545853
4611645854 /**
4611745855 * @throws Exception
46118- * @return Predicate|string|null
45856+ * @return Predicate|string
4611945857 */
46120- public function getTest(): Predicate|string|null {
45858+ public function getTest(): Predicate|string {
4612145859 if (ConditionalPredicateMarkPropFieldDefClass::validateTest($this->test)) {
4612245860 return $this->test;
4612345861 }
@@ -46125,9 +45863,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4612545863 }
4612645864
4612745865 /**
46128- * @return Predicate|string|null
45866+ * @return Predicate|string
4612945867 */
46130- public static function sampleTest(): Predicate|string|null {
45868+ public static function sampleTest(): Predicate|string {
4613145869 return Predicate::sample(); /*31:test*/
4613245870 }
4613345871
@@ -46135,14 +45873,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4613545873 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4613645874 * `0` to `1` for opacity).
4613745875 *
46138- * @param bool|float|string|null $value
45876+ * @param bool|float|string $value
4613945877 * @throws Exception
46140- * @return bool|float|string|null
45878+ * @return bool|float|string
4614145879 */
46142- public static function fromValue(bool|float|string|null $value): bool|float|string|null {
46143- if (is_null($value)) {
46144- return $value; /*null*/
46145- } elseif (is_bool($value)) {
45880+ public static function fromValue(bool|float|string $value): bool|float|string {
45881+ if (is_bool($value)) {
4614645882 return $value; /*bool*/
4614745883 } elseif (is_float($value) || is_int($value)) {
4614845884 return $value; /*float*/
@@ -46158,13 +45894,11 @@ class ConditionalPredicateMarkPropFieldDefClass {
4615845894 * `0` to `1` for opacity).
4615945895 *
4616045896 * @throws Exception
46161- * @return bool|float|string|null
45897+ * @return bool|float|string
4616245898 */
46163- public function toValue(): bool|float|string|null {
45899+ public function toValue(): bool|float|string {
4616445900 if (ConditionalPredicateMarkPropFieldDefClass::validateValue($this->value)) {
46165- if (is_null($this->value)) {
46166- return $this->value; /*null*/
46167- } elseif (is_bool($this->value)) {
45901+ if (is_bool($this->value)) {
4616845902 return $this->value; /*bool*/
4616945903 } elseif (is_float($this->value) || is_int($this->value)) {
4617045904 return $this->value; /*float*/
@@ -46181,16 +45915,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4618145915 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4618245916 * `0` to `1` for opacity).
4618345917 *
46184- * @param bool|float|string|null
45918+ * @param bool|float|string
4618545919 * @return bool
4618645920 * @throws Exception
4618745921 */
46188- public static function validateValue(bool|float|string|null $value): bool {
46189- if (is_null($value)) {
46190- if (!is_null($value)) {
46191- throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::value");
46192- }
46193- } elseif (is_bool($value)) {
45922+ public static function validateValue(bool|float|string $value): bool {
45923+ if (is_bool($value)) {
4619445924 if (!is_bool($value)) {
4619545925 throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::value");
4619645926 }
@@ -46213,9 +45943,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4621345943 * `0` to `1` for opacity).
4621445944 *
4621545945 * @throws Exception
46216- * @return bool|float|string|null
45946+ * @return bool|float|string
4621745947 */
46218- public function getValue(): bool|float|string|null {
45948+ public function getValue(): bool|float|string {
4621945949 if (ConditionalPredicateMarkPropFieldDefClass::validateValue($this->value)) {
4622045950 return $this->value;
4622145951 }
@@ -46226,9 +45956,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4622645956 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
4622745957 * `0` to `1` for opacity).
4622845958 *
46229- * @return bool|float|string|null
45959+ * @return bool|float|string
4623045960 */
46231- public static function sampleValue(): bool|float|string|null {
45961+ public static function sampleValue(): bool|float|string {
4623245962 return true; /*32:value*/
4623345963 }
4623445964
@@ -46236,14 +45966,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4623645966 * A [selection name](selection.html), or a series of [composed
4623745967 * selections](selection.html#compose).
4623845968 *
46239- * @param stdClass|string|null $value
45969+ * @param stdClass|string $value
4624045970 * @throws Exception
46241- * @return Selection|string|null
45971+ * @return Selection|string
4624245972 */
46243- public static function fromSelection(stdClass|string|null $value): Selection|string|null {
46244- if (is_null($value)) {
46245- return $value; /*null*/
46246- } elseif (is_object($value)) {
45973+ public static function fromSelection(stdClass|string $value): Selection|string {
45974+ if (is_object($value)) {
4624745975 return Selection::from($value); /*class*/
4624845976 } elseif (is_string($value)) {
4624945977 return $value; /*string*/
@@ -46257,13 +45985,11 @@ class ConditionalPredicateMarkPropFieldDefClass {
4625745985 * selections](selection.html#compose).
4625845986 *
4625945987 * @throws Exception
46260- * @return stdClass|string|null
45988+ * @return stdClass|string
4626145989 */
46262- public function toSelection(): stdClass|string|null {
45990+ public function toSelection(): stdClass|string {
4626345991 if (ConditionalPredicateMarkPropFieldDefClass::validateSelection($this->selection)) {
46264- if (is_null($this->selection)) {
46265- return $this->selection; /*null*/
46266- } elseif ($this->selection instanceof Selection) {
45992+ if ($this->selection instanceof Selection) {
4626745993 return $this->selection->to(); /*class*/
4626845994 } elseif (is_string($this->selection)) {
4626945995 return $this->selection; /*string*/
@@ -46278,16 +46004,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4627846004 * A [selection name](selection.html), or a series of [composed
4627946005 * selections](selection.html#compose).
4628046006 *
46281- * @param Selection|string|null
46007+ * @param Selection|string
4628246008 * @return bool
4628346009 * @throws Exception
4628446010 */
46285- public static function validateSelection(Selection|string|null $value): bool {
46286- if (is_null($value)) {
46287- if (!is_null($value)) {
46288- throw new Exception("Attribute Error:ConditionalPredicateMarkPropFieldDefClass::selection");
46289- }
46290- } elseif ($value instanceof Selection) {
46011+ public static function validateSelection(Selection|string $value): bool {
46012+ if ($value instanceof Selection) {
4629146013 $value->validate();
4629246014 } elseif (is_string($value)) {
4629346015 if (!is_string($value)) {
@@ -46304,9 +46026,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4630446026 * selections](selection.html#compose).
4630546027 *
4630646028 * @throws Exception
46307- * @return Selection|string|null
46029+ * @return Selection|string
4630846030 */
46309- public function getSelection(): Selection|string|null {
46031+ public function getSelection(): Selection|string {
4631046032 if (ConditionalPredicateMarkPropFieldDefClass::validateSelection($this->selection)) {
4631146033 return $this->selection;
4631246034 }
@@ -46317,9 +46039,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4631746039 * A [selection name](selection.html), or a series of [composed
4631846040 * selections](selection.html#compose).
4631946041 *
46320- * @return Selection|string|null
46042+ * @return Selection|string
4632146043 */
46322- public static function sampleSelection(): Selection|string|null {
46044+ public static function sampleSelection(): Selection|string {
4632346045 return Selection::sample(); /*33:selection*/
4632446046 }
4632546047
@@ -47012,16 +46734,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4701246734 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4701346735 * [geographic projection](projection.html) is applied.
4701446736 *
47015- * @param ?string $value
46737+ * @param string $value
4701646738 * @throws Exception
47017- * @return ?Type
46739+ * @return Type
4701846740 */
47019- public static function fromType(?string $value): ?Type {
47020- if (!is_null($value)) {
47021- return Type::from($value); /*enum*/
47022- } else {
47023- return null;
47024- }
46741+ public static function fromType(string $value): Type {
46742+ return Type::from($value); /*enum*/
4702546743 }
4702646744
4702746745 /**
@@ -47031,15 +46749,11 @@ class ConditionalPredicateMarkPropFieldDefClass {
4703146749 * [geographic projection](projection.html) is applied.
4703246750 *
4703346751 * @throws Exception
47034- * @return ?string
46752+ * @return string
4703546753 */
47036- public function toType(): ?string {
46754+ public function toType(): string {
4703746755 if (ConditionalPredicateMarkPropFieldDefClass::validateType($this->type)) {
47038- if (!is_null($this->type)) {
47039- return Type::to($this->type); /*enum*/
47040- } else {
47041- return null;
47042- }
46756+ return Type::to($this->type); /*enum*/
4704346757 }
4704446758 throw new Exception('never get to this ConditionalPredicateMarkPropFieldDefClass::type');
4704546759 }
@@ -47050,14 +46764,12 @@ class ConditionalPredicateMarkPropFieldDefClass {
4705046764 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4705146765 * [geographic projection](projection.html) is applied.
4705246766 *
47053- * @param Type|null
46767+ * @param Type
4705446768 * @return bool
4705546769 * @throws Exception
4705646770 */
47057- public static function validateType(?Type $value): bool {
47058- if (!is_null($value)) {
47059- Type::to($value);
47060- }
46771+ public static function validateType(Type $value): bool {
46772+ Type::to($value);
4706146773 return true;
4706246774 }
4706346775
@@ -47068,9 +46780,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4706846780 * [geographic projection](projection.html) is applied.
4706946781 *
4707046782 * @throws Exception
47071- * @return ?Type
46783+ * @return Type
4707246784 */
47073- public function getType(): ?Type {
46785+ public function getType(): Type {
4707446786 if (ConditionalPredicateMarkPropFieldDefClass::validateType($this->type)) {
4707546787 return $this->type;
4707646788 }
@@ -47083,9 +46795,9 @@ class ConditionalPredicateMarkPropFieldDefClass {
4708346795 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4708446796 * [geographic projection](projection.html) is applied.
4708546797 *
47086- * @return ?Type
46798+ * @return Type
4708746799 */
47088- public static function sampleType(): ?Type {
46800+ public static function sampleType(): Type {
4708946801 return Type::sample(); /*enum*/
4709046802 }
4709146803
@@ -53576,7 +53288,7 @@ class DefWithCondition {
5357653288 private ConditionalPredicateFieldDefClass|array|null $condition; // json:condition Optional
5357753289 private RepeatRef|string|null $field; // json:field Optional
5357853290 private ?TimeUnit $timeUnit; // json:timeUnit Optional
53579- private ?Type $type; // json:type Optional
53291+ private Type $type; // json:type Required
5358053292 private bool|float|string|null $value; // json:value Optional
5358153293
5358253294 /**
@@ -53585,10 +53297,10 @@ class DefWithCondition {
5358553297 * @param ConditionalPredicateFieldDefClass|array|null $condition
5358653298 * @param RepeatRef|string|null $field
5358753299 * @param TimeUnit|null $timeUnit
53588- * @param Type|null $type
53300+ * @param Type $type
5358953301 * @param bool|float|string|null $value
5359053302 */
53591- public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) {
53303+ public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?TimeUnit $timeUnit, Type $type, bool|float|string|null $value) {
5359253304 $this->aggregate = $aggregate;
5359353305 $this->bin = $bin;
5359453306 $this->condition = $condition;
@@ -54130,16 +53842,12 @@ class DefWithCondition {
5413053842 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5413153843 * [geographic projection](projection.html) is applied.
5413253844 *
54133- * @param ?string $value
53845+ * @param string $value
5413453846 * @throws Exception
54135- * @return ?Type
53847+ * @return Type
5413653848 */
54137- public static function fromType(?string $value): ?Type {
54138- if (!is_null($value)) {
54139- return Type::from($value); /*enum*/
54140- } else {
54141- return null;
54142- }
53849+ public static function fromType(string $value): Type {
53850+ return Type::from($value); /*enum*/
5414353851 }
5414453852
5414553853 /**
@@ -54149,15 +53857,11 @@ class DefWithCondition {
5414953857 * [geographic projection](projection.html) is applied.
5415053858 *
5415153859 * @throws Exception
54152- * @return ?string
53860+ * @return string
5415353861 */
54154- public function toType(): ?string {
53862+ public function toType(): string {
5415553863 if (DefWithCondition::validateType($this->type)) {
54156- if (!is_null($this->type)) {
54157- return Type::to($this->type); /*enum*/
54158- } else {
54159- return null;
54160- }
53864+ return Type::to($this->type); /*enum*/
5416153865 }
5416253866 throw new Exception('never get to this DefWithCondition::type');
5416353867 }
@@ -54168,14 +53872,12 @@ class DefWithCondition {
5416853872 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5416953873 * [geographic projection](projection.html) is applied.
5417053874 *
54171- * @param Type|null
53875+ * @param Type
5417253876 * @return bool
5417353877 * @throws Exception
5417453878 */
54175- public static function validateType(?Type $value): bool {
54176- if (!is_null($value)) {
54177- Type::to($value);
54178- }
53879+ public static function validateType(Type $value): bool {
53880+ Type::to($value);
5417953881 return true;
5418053882 }
5418153883
@@ -54186,9 +53888,9 @@ class DefWithCondition {
5418653888 * [geographic projection](projection.html) is applied.
5418753889 *
5418853890 * @throws Exception
54189- * @return ?Type
53891+ * @return Type
5419053892 */
54191- public function getType(): ?Type {
53893+ public function getType(): Type {
5419253894 if (DefWithCondition::validateType($this->type)) {
5419353895 return $this->type;
5419453896 }
@@ -54201,9 +53903,9 @@ class DefWithCondition {
5420153903 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5420253904 * [geographic projection](projection.html) is applied.
5420353905 *
54204- * @return ?Type
53906+ * @return Type
5420553907 */
54206- public static function sampleType(): ?Type {
53908+ public static function sampleType(): Type {
5420753909 return Type::sample(); /*enum*/
5420853910 }
5420953911
@@ -54369,26 +54071,26 @@ class DefWithCondition {
5436954071 // This is an autogenerated file:ConditionalPredicateFieldDefClass
5437054072
5437154073 class ConditionalPredicateFieldDefClass {
54372- private Predicate|string|null $test; // json:test Optional
54373- private bool|float|string|null $value; // json:value Optional
54374- private Selection|string|null $selection; // json:selection Optional
54074+ private Predicate|string $test; // json:test Required
54075+ private bool|float|string $value; // json:value Required
54076+ private Selection|string $selection; // json:selection Required
5437554077 private ?AggregateOp $aggregate; // json:aggregate Optional
5437654078 private BinParams|bool|null $bin; // json:bin Optional
5437754079 private RepeatRef|string|null $field; // json:field Optional
5437854080 private ?TimeUnit $timeUnit; // json:timeUnit Optional
54379- private ?Type $type; // json:type Optional
54081+ private Type $type; // json:type Required
5438054082
5438154083 /**
54382- * @param Predicate|string|null $test
54383- * @param bool|float|string|null $value
54384- * @param Selection|string|null $selection
54084+ * @param Predicate|string $test
54085+ * @param bool|float|string $value
54086+ * @param Selection|string $selection
5438554087 * @param AggregateOp|null $aggregate
5438654088 * @param BinParams|bool|null $bin
5438754089 * @param RepeatRef|string|null $field
5438854090 * @param TimeUnit|null $timeUnit
54389- * @param Type|null $type
54091+ * @param Type $type
5439054092 */
54391- public function __construct(Predicate|string|null $test, bool|float|string|null $value, Selection|string|null $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, ?Type $type) {
54093+ public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, Type $type) {
5439254094 $this->test = $test;
5439354095 $this->value = $value;
5439454096 $this->selection = $selection;
@@ -54400,14 +54102,12 @@ class ConditionalPredicateFieldDefClass {
5440054102 }
5440154103
5440254104 /**
54403- * @param stdClass|string|null $value
54105+ * @param stdClass|string $value
5440454106 * @throws Exception
54405- * @return Predicate|string|null
54107+ * @return Predicate|string
5440654108 */
54407- public static function fromTest(stdClass|string|null $value): Predicate|string|null {
54408- if (is_null($value)) {
54409- return $value; /*null*/
54410- } elseif (is_object($value)) {
54109+ public static function fromTest(stdClass|string $value): Predicate|string {
54110+ if (is_object($value)) {
5441154111 return Predicate::from($value); /*class*/
5441254112 } elseif (is_string($value)) {
5441354113 return $value; /*string*/
@@ -54418,13 +54118,11 @@ class ConditionalPredicateFieldDefClass {
5441854118
5441954119 /**
5442054120 * @throws Exception
54421- * @return stdClass|string|null
54121+ * @return stdClass|string
5442254122 */
54423- public function toTest(): stdClass|string|null {
54123+ public function toTest(): stdClass|string {
5442454124 if (ConditionalPredicateFieldDefClass::validateTest($this->test)) {
54425- if (is_null($this->test)) {
54426- return $this->test; /*null*/
54427- } elseif ($this->test instanceof Predicate) {
54125+ if ($this->test instanceof Predicate) {
5442854126 return $this->test->to(); /*class*/
5442954127 } elseif (is_string($this->test)) {
5443054128 return $this->test; /*string*/
@@ -54436,16 +54134,12 @@ class ConditionalPredicateFieldDefClass {
5443654134 }
5443754135
5443854136 /**
54439- * @param Predicate|string|null
54137+ * @param Predicate|string
5444054138 * @return bool
5444154139 * @throws Exception
5444254140 */
54443- public static function validateTest(Predicate|string|null $value): bool {
54444- if (is_null($value)) {
54445- if (!is_null($value)) {
54446- throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::test");
54447- }
54448- } elseif ($value instanceof Predicate) {
54141+ public static function validateTest(Predicate|string $value): bool {
54142+ if ($value instanceof Predicate) {
5444954143 $value->validate();
5445054144 } elseif (is_string($value)) {
5445154145 if (!is_string($value)) {
@@ -54459,9 +54153,9 @@ class ConditionalPredicateFieldDefClass {
5445954153
5446054154 /**
5446154155 * @throws Exception
54462- * @return Predicate|string|null
54156+ * @return Predicate|string
5446354157 */
54464- public function getTest(): Predicate|string|null {
54158+ public function getTest(): Predicate|string {
5446554159 if (ConditionalPredicateFieldDefClass::validateTest($this->test)) {
5446654160 return $this->test;
5446754161 }
@@ -54469,9 +54163,9 @@ class ConditionalPredicateFieldDefClass {
5446954163 }
5447054164
5447154165 /**
54472- * @return Predicate|string|null
54166+ * @return Predicate|string
5447354167 */
54474- public static function sampleTest(): Predicate|string|null {
54168+ public static function sampleTest(): Predicate|string {
5447554169 return Predicate::sample(); /*31:test*/
5447654170 }
5447754171
@@ -54479,14 +54173,12 @@ class ConditionalPredicateFieldDefClass {
5447954173 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5448054174 * `0` to `1` for opacity).
5448154175 *
54482- * @param bool|float|string|null $value
54176+ * @param bool|float|string $value
5448354177 * @throws Exception
54484- * @return bool|float|string|null
54178+ * @return bool|float|string
5448554179 */
54486- public static function fromValue(bool|float|string|null $value): bool|float|string|null {
54487- if (is_null($value)) {
54488- return $value; /*null*/
54489- } elseif (is_bool($value)) {
54180+ public static function fromValue(bool|float|string $value): bool|float|string {
54181+ if (is_bool($value)) {
5449054182 return $value; /*bool*/
5449154183 } elseif (is_float($value) || is_int($value)) {
5449254184 return $value; /*float*/
@@ -54502,13 +54194,11 @@ class ConditionalPredicateFieldDefClass {
5450254194 * `0` to `1` for opacity).
5450354195 *
5450454196 * @throws Exception
54505- * @return bool|float|string|null
54197+ * @return bool|float|string
5450654198 */
54507- public function toValue(): bool|float|string|null {
54199+ public function toValue(): bool|float|string {
5450854200 if (ConditionalPredicateFieldDefClass::validateValue($this->value)) {
54509- if (is_null($this->value)) {
54510- return $this->value; /*null*/
54511- } elseif (is_bool($this->value)) {
54201+ if (is_bool($this->value)) {
5451254202 return $this->value; /*bool*/
5451354203 } elseif (is_float($this->value) || is_int($this->value)) {
5451454204 return $this->value; /*float*/
@@ -54525,16 +54215,12 @@ class ConditionalPredicateFieldDefClass {
5452554215 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5452654216 * `0` to `1` for opacity).
5452754217 *
54528- * @param bool|float|string|null
54218+ * @param bool|float|string
5452954219 * @return bool
5453054220 * @throws Exception
5453154221 */
54532- public static function validateValue(bool|float|string|null $value): bool {
54533- if (is_null($value)) {
54534- if (!is_null($value)) {
54535- throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::value");
54536- }
54537- } elseif (is_bool($value)) {
54222+ public static function validateValue(bool|float|string $value): bool {
54223+ if (is_bool($value)) {
5453854224 if (!is_bool($value)) {
5453954225 throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::value");
5454054226 }
@@ -54557,9 +54243,9 @@ class ConditionalPredicateFieldDefClass {
5455754243 * `0` to `1` for opacity).
5455854244 *
5455954245 * @throws Exception
54560- * @return bool|float|string|null
54246+ * @return bool|float|string
5456154247 */
54562- public function getValue(): bool|float|string|null {
54248+ public function getValue(): bool|float|string {
5456354249 if (ConditionalPredicateFieldDefClass::validateValue($this->value)) {
5456454250 return $this->value;
5456554251 }
@@ -54570,9 +54256,9 @@ class ConditionalPredicateFieldDefClass {
5457054256 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5457154257 * `0` to `1` for opacity).
5457254258 *
54573- * @return bool|float|string|null
54259+ * @return bool|float|string
5457454260 */
54575- public static function sampleValue(): bool|float|string|null {
54261+ public static function sampleValue(): bool|float|string {
5457654262 return true; /*32:value*/
5457754263 }
5457854264
@@ -54580,14 +54266,12 @@ class ConditionalPredicateFieldDefClass {
5458054266 * A [selection name](selection.html), or a series of [composed
5458154267 * selections](selection.html#compose).
5458254268 *
54583- * @param stdClass|string|null $value
54269+ * @param stdClass|string $value
5458454270 * @throws Exception
54585- * @return Selection|string|null
54271+ * @return Selection|string
5458654272 */
54587- public static function fromSelection(stdClass|string|null $value): Selection|string|null {
54588- if (is_null($value)) {
54589- return $value; /*null*/
54590- } elseif (is_object($value)) {
54273+ public static function fromSelection(stdClass|string $value): Selection|string {
54274+ if (is_object($value)) {
5459154275 return Selection::from($value); /*class*/
5459254276 } elseif (is_string($value)) {
5459354277 return $value; /*string*/
@@ -54601,13 +54285,11 @@ class ConditionalPredicateFieldDefClass {
5460154285 * selections](selection.html#compose).
5460254286 *
5460354287 * @throws Exception
54604- * @return stdClass|string|null
54288+ * @return stdClass|string
5460554289 */
54606- public function toSelection(): stdClass|string|null {
54290+ public function toSelection(): stdClass|string {
5460754291 if (ConditionalPredicateFieldDefClass::validateSelection($this->selection)) {
54608- if (is_null($this->selection)) {
54609- return $this->selection; /*null*/
54610- } elseif ($this->selection instanceof Selection) {
54292+ if ($this->selection instanceof Selection) {
5461154293 return $this->selection->to(); /*class*/
5461254294 } elseif (is_string($this->selection)) {
5461354295 return $this->selection; /*string*/
@@ -54622,16 +54304,12 @@ class ConditionalPredicateFieldDefClass {
5462254304 * A [selection name](selection.html), or a series of [composed
5462354305 * selections](selection.html#compose).
5462454306 *
54625- * @param Selection|string|null
54307+ * @param Selection|string
5462654308 * @return bool
5462754309 * @throws Exception
5462854310 */
54629- public static function validateSelection(Selection|string|null $value): bool {
54630- if (is_null($value)) {
54631- if (!is_null($value)) {
54632- throw new Exception("Attribute Error:ConditionalPredicateFieldDefClass::selection");
54633- }
54634- } elseif ($value instanceof Selection) {
54311+ public static function validateSelection(Selection|string $value): bool {
54312+ if ($value instanceof Selection) {
5463554313 $value->validate();
5463654314 } elseif (is_string($value)) {
5463754315 if (!is_string($value)) {
@@ -54648,9 +54326,9 @@ class ConditionalPredicateFieldDefClass {
5464854326 * selections](selection.html#compose).
5464954327 *
5465054328 * @throws Exception
54651- * @return Selection|string|null
54329+ * @return Selection|string
5465254330 */
54653- public function getSelection(): Selection|string|null {
54331+ public function getSelection(): Selection|string {
5465454332 if (ConditionalPredicateFieldDefClass::validateSelection($this->selection)) {
5465554333 return $this->selection;
5465654334 }
@@ -54661,9 +54339,9 @@ class ConditionalPredicateFieldDefClass {
5466154339 * A [selection name](selection.html), or a series of [composed
5466254340 * selections](selection.html#compose).
5466354341 *
54664- * @return Selection|string|null
54342+ * @return Selection|string
5466554343 */
54666- public static function sampleSelection(): Selection|string|null {
54344+ public static function sampleSelection(): Selection|string {
5466754345 return Selection::sample(); /*33:selection*/
5466854346 }
5466954347
@@ -55076,16 +54754,12 @@ class ConditionalPredicateFieldDefClass {
5507654754 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5507754755 * [geographic projection](projection.html) is applied.
5507854756 *
55079- * @param ?string $value
54757+ * @param string $value
5508054758 * @throws Exception
55081- * @return ?Type
54759+ * @return Type
5508254760 */
55083- public static function fromType(?string $value): ?Type {
55084- if (!is_null($value)) {
55085- return Type::from($value); /*enum*/
55086- } else {
55087- return null;
55088- }
54761+ public static function fromType(string $value): Type {
54762+ return Type::from($value); /*enum*/
5508954763 }
5509054764
5509154765 /**
@@ -55095,15 +54769,11 @@ class ConditionalPredicateFieldDefClass {
5509554769 * [geographic projection](projection.html) is applied.
5509654770 *
5509754771 * @throws Exception
55098- * @return ?string
54772+ * @return string
5509954773 */
55100- public function toType(): ?string {
54774+ public function toType(): string {
5510154775 if (ConditionalPredicateFieldDefClass::validateType($this->type)) {
55102- if (!is_null($this->type)) {
55103- return Type::to($this->type); /*enum*/
55104- } else {
55105- return null;
55106- }
54776+ return Type::to($this->type); /*enum*/
5510754777 }
5510854778 throw new Exception('never get to this ConditionalPredicateFieldDefClass::type');
5510954779 }
@@ -55114,14 +54784,12 @@ class ConditionalPredicateFieldDefClass {
5511454784 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5511554785 * [geographic projection](projection.html) is applied.
5511654786 *
55117- * @param Type|null
54787+ * @param Type
5511854788 * @return bool
5511954789 * @throws Exception
5512054790 */
55121- public static function validateType(?Type $value): bool {
55122- if (!is_null($value)) {
55123- Type::to($value);
55124- }
54791+ public static function validateType(Type $value): bool {
54792+ Type::to($value);
5512554793 return true;
5512654794 }
5512754795
@@ -55132,9 +54800,9 @@ class ConditionalPredicateFieldDefClass {
5513254800 * [geographic projection](projection.html) is applied.
5513354801 *
5513454802 * @throws Exception
55135- * @return ?Type
54803+ * @return Type
5513654804 */
55137- public function getType(): ?Type {
54805+ public function getType(): Type {
5513854806 if (ConditionalPredicateFieldDefClass::validateType($this->type)) {
5513954807 return $this->type;
5514054808 }
@@ -55147,9 +54815,9 @@ class ConditionalPredicateFieldDefClass {
5514754815 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5514854816 * [geographic projection](projection.html) is applied.
5514954817 *
55150- * @return ?Type
54818+ * @return Type
5515154819 */
55152- public static function sampleType(): ?Type {
54820+ public static function sampleType(): Type {
5515354821 return Type::sample(); /*enum*/
5515454822 }
5515554823
@@ -55859,7 +55527,7 @@ class TextDefWithCondition {
5585955527 private RepeatRef|string|null $field; // json:field Optional
5586055528 private ?string $format; // json:format Optional
5586155529 private ?TimeUnit $timeUnit; // json:timeUnit Optional
55862- private ?Type $type; // json:type Optional
55530+ private Type $type; // json:type Required
5586355531 private bool|float|string|null $value; // json:value Optional
5586455532
5586555533 /**
@@ -55869,10 +55537,10 @@ class TextDefWithCondition {
5586955537 * @param RepeatRef|string|null $field
5587055538 * @param string|null $format
5587155539 * @param TimeUnit|null $timeUnit
55872- * @param Type|null $type
55540+ * @param Type $type
5587355541 * @param bool|float|string|null $value
5587455542 */
55875- public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateTextFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) {
55543+ public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, ConditionalPredicateTextFieldDefClass|array|null $condition, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, Type $type, bool|float|string|null $value) {
5587655544 $this->aggregate = $aggregate;
5587755545 $this->bin = $bin;
5587855546 $this->condition = $condition;
@@ -56487,16 +56155,12 @@ class TextDefWithCondition {
5648756155 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5648856156 * [geographic projection](projection.html) is applied.
5648956157 *
56490- * @param ?string $value
56158+ * @param string $value
5649156159 * @throws Exception
56492- * @return ?Type
56160+ * @return Type
5649356161 */
56494- public static function fromType(?string $value): ?Type {
56495- if (!is_null($value)) {
56496- return Type::from($value); /*enum*/
56497- } else {
56498- return null;
56499- }
56162+ public static function fromType(string $value): Type {
56163+ return Type::from($value); /*enum*/
5650056164 }
5650156165
5650256166 /**
@@ -56506,15 +56170,11 @@ class TextDefWithCondition {
5650656170 * [geographic projection](projection.html) is applied.
5650756171 *
5650856172 * @throws Exception
56509- * @return ?string
56173+ * @return string
5651056174 */
56511- public function toType(): ?string {
56175+ public function toType(): string {
5651256176 if (TextDefWithCondition::validateType($this->type)) {
56513- if (!is_null($this->type)) {
56514- return Type::to($this->type); /*enum*/
56515- } else {
56516- return null;
56517- }
56177+ return Type::to($this->type); /*enum*/
5651856178 }
5651956179 throw new Exception('never get to this TextDefWithCondition::type');
5652056180 }
@@ -56525,14 +56185,12 @@ class TextDefWithCondition {
5652556185 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5652656186 * [geographic projection](projection.html) is applied.
5652756187 *
56528- * @param Type|null
56188+ * @param Type
5652956189 * @return bool
5653056190 * @throws Exception
5653156191 */
56532- public static function validateType(?Type $value): bool {
56533- if (!is_null($value)) {
56534- Type::to($value);
56535- }
56192+ public static function validateType(Type $value): bool {
56193+ Type::to($value);
5653656194 return true;
5653756195 }
5653856196
@@ -56543,9 +56201,9 @@ class TextDefWithCondition {
5654356201 * [geographic projection](projection.html) is applied.
5654456202 *
5654556203 * @throws Exception
56546- * @return ?Type
56204+ * @return Type
5654756205 */
56548- public function getType(): ?Type {
56206+ public function getType(): Type {
5654956207 if (TextDefWithCondition::validateType($this->type)) {
5655056208 return $this->type;
5655156209 }
@@ -56558,9 +56216,9 @@ class TextDefWithCondition {
5655856216 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5655956217 * [geographic projection](projection.html) is applied.
5656056218 *
56561- * @return ?Type
56219+ * @return Type
5656256220 */
56563- public static function sampleType(): ?Type {
56221+ public static function sampleType(): Type {
5656456222 return Type::sample(); /*enum*/
5656556223 }
5656656224
@@ -56730,28 +56388,28 @@ class TextDefWithCondition {
5673056388 // This is an autogenerated file:ConditionalPredicateTextFieldDefClass
5673156389
5673256390 class ConditionalPredicateTextFieldDefClass {
56733- private Predicate|string|null $test; // json:test Optional
56734- private bool|float|string|null $value; // json:value Optional
56735- private Selection|string|null $selection; // json:selection Optional
56391+ private Predicate|string $test; // json:test Required
56392+ private bool|float|string $value; // json:value Required
56393+ private Selection|string $selection; // json:selection Required
5673656394 private ?AggregateOp $aggregate; // json:aggregate Optional
5673756395 private BinParams|bool|null $bin; // json:bin Optional
5673856396 private RepeatRef|string|null $field; // json:field Optional
5673956397 private ?string $format; // json:format Optional
5674056398 private ?TimeUnit $timeUnit; // json:timeUnit Optional
56741- private ?Type $type; // json:type Optional
56399+ private Type $type; // json:type Required
5674256400
5674356401 /**
56744- * @param Predicate|string|null $test
56745- * @param bool|float|string|null $value
56746- * @param Selection|string|null $selection
56402+ * @param Predicate|string $test
56403+ * @param bool|float|string $value
56404+ * @param Selection|string $selection
5674756405 * @param AggregateOp|null $aggregate
5674856406 * @param BinParams|bool|null $bin
5674956407 * @param RepeatRef|string|null $field
5675056408 * @param string|null $format
5675156409 * @param TimeUnit|null $timeUnit
56752- * @param Type|null $type
56410+ * @param Type $type
5675356411 */
56754- public function __construct(Predicate|string|null $test, bool|float|string|null $value, Selection|string|null $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, ?Type $type) {
56412+ public function __construct(Predicate|string $test, bool|float|string $value, Selection|string $selection, ?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?string $format, ?TimeUnit $timeUnit, Type $type) {
5675556413 $this->test = $test;
5675656414 $this->value = $value;
5675756415 $this->selection = $selection;
@@ -56764,14 +56422,12 @@ class ConditionalPredicateTextFieldDefClass {
5676456422 }
5676556423
5676656424 /**
56767- * @param stdClass|string|null $value
56425+ * @param stdClass|string $value
5676856426 * @throws Exception
56769- * @return Predicate|string|null
56427+ * @return Predicate|string
5677056428 */
56771- public static function fromTest(stdClass|string|null $value): Predicate|string|null {
56772- if (is_null($value)) {
56773- return $value; /*null*/
56774- } elseif (is_object($value)) {
56429+ public static function fromTest(stdClass|string $value): Predicate|string {
56430+ if (is_object($value)) {
5677556431 return Predicate::from($value); /*class*/
5677656432 } elseif (is_string($value)) {
5677756433 return $value; /*string*/
@@ -56782,13 +56438,11 @@ class ConditionalPredicateTextFieldDefClass {
5678256438
5678356439 /**
5678456440 * @throws Exception
56785- * @return stdClass|string|null
56441+ * @return stdClass|string
5678656442 */
56787- public function toTest(): stdClass|string|null {
56443+ public function toTest(): stdClass|string {
5678856444 if (ConditionalPredicateTextFieldDefClass::validateTest($this->test)) {
56789- if (is_null($this->test)) {
56790- return $this->test; /*null*/
56791- } elseif ($this->test instanceof Predicate) {
56445+ if ($this->test instanceof Predicate) {
5679256446 return $this->test->to(); /*class*/
5679356447 } elseif (is_string($this->test)) {
5679456448 return $this->test; /*string*/
@@ -56800,16 +56454,12 @@ class ConditionalPredicateTextFieldDefClass {
5680056454 }
5680156455
5680256456 /**
56803- * @param Predicate|string|null
56457+ * @param Predicate|string
5680456458 * @return bool
5680556459 * @throws Exception
5680656460 */
56807- public static function validateTest(Predicate|string|null $value): bool {
56808- if (is_null($value)) {
56809- if (!is_null($value)) {
56810- throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::test");
56811- }
56812- } elseif ($value instanceof Predicate) {
56461+ public static function validateTest(Predicate|string $value): bool {
56462+ if ($value instanceof Predicate) {
5681356463 $value->validate();
5681456464 } elseif (is_string($value)) {
5681556465 if (!is_string($value)) {
@@ -56823,9 +56473,9 @@ class ConditionalPredicateTextFieldDefClass {
5682356473
5682456474 /**
5682556475 * @throws Exception
56826- * @return Predicate|string|null
56476+ * @return Predicate|string
5682756477 */
56828- public function getTest(): Predicate|string|null {
56478+ public function getTest(): Predicate|string {
5682956479 if (ConditionalPredicateTextFieldDefClass::validateTest($this->test)) {
5683056480 return $this->test;
5683156481 }
@@ -56833,9 +56483,9 @@ class ConditionalPredicateTextFieldDefClass {
5683356483 }
5683456484
5683556485 /**
56836- * @return Predicate|string|null
56486+ * @return Predicate|string
5683756487 */
56838- public static function sampleTest(): Predicate|string|null {
56488+ public static function sampleTest(): Predicate|string {
5683956489 return Predicate::sample(); /*31:test*/
5684056490 }
5684156491
@@ -56843,14 +56493,12 @@ class ConditionalPredicateTextFieldDefClass {
5684356493 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5684456494 * `0` to `1` for opacity).
5684556495 *
56846- * @param bool|float|string|null $value
56496+ * @param bool|float|string $value
5684756497 * @throws Exception
56848- * @return bool|float|string|null
56498+ * @return bool|float|string
5684956499 */
56850- public static function fromValue(bool|float|string|null $value): bool|float|string|null {
56851- if (is_null($value)) {
56852- return $value; /*null*/
56853- } elseif (is_bool($value)) {
56500+ public static function fromValue(bool|float|string $value): bool|float|string {
56501+ if (is_bool($value)) {
5685456502 return $value; /*bool*/
5685556503 } elseif (is_float($value) || is_int($value)) {
5685656504 return $value; /*float*/
@@ -56866,13 +56514,11 @@ class ConditionalPredicateTextFieldDefClass {
5686656514 * `0` to `1` for opacity).
5686756515 *
5686856516 * @throws Exception
56869- * @return bool|float|string|null
56517+ * @return bool|float|string
5687056518 */
56871- public function toValue(): bool|float|string|null {
56519+ public function toValue(): bool|float|string {
5687256520 if (ConditionalPredicateTextFieldDefClass::validateValue($this->value)) {
56873- if (is_null($this->value)) {
56874- return $this->value; /*null*/
56875- } elseif (is_bool($this->value)) {
56521+ if (is_bool($this->value)) {
5687656522 return $this->value; /*bool*/
5687756523 } elseif (is_float($this->value) || is_int($this->value)) {
5687856524 return $this->value; /*float*/
@@ -56889,16 +56535,12 @@ class ConditionalPredicateTextFieldDefClass {
5688956535 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5689056536 * `0` to `1` for opacity).
5689156537 *
56892- * @param bool|float|string|null
56538+ * @param bool|float|string
5689356539 * @return bool
5689456540 * @throws Exception
5689556541 */
56896- public static function validateValue(bool|float|string|null $value): bool {
56897- if (is_null($value)) {
56898- if (!is_null($value)) {
56899- throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::value");
56900- }
56901- } elseif (is_bool($value)) {
56542+ public static function validateValue(bool|float|string $value): bool {
56543+ if (is_bool($value)) {
5690256544 if (!is_bool($value)) {
5690356545 throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::value");
5690456546 }
@@ -56921,9 +56563,9 @@ class ConditionalPredicateTextFieldDefClass {
5692156563 * `0` to `1` for opacity).
5692256564 *
5692356565 * @throws Exception
56924- * @return bool|float|string|null
56566+ * @return bool|float|string
5692556567 */
56926- public function getValue(): bool|float|string|null {
56568+ public function getValue(): bool|float|string {
5692756569 if (ConditionalPredicateTextFieldDefClass::validateValue($this->value)) {
5692856570 return $this->value;
5692956571 }
@@ -56934,9 +56576,9 @@ class ConditionalPredicateTextFieldDefClass {
5693456576 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5693556577 * `0` to `1` for opacity).
5693656578 *
56937- * @return bool|float|string|null
56579+ * @return bool|float|string
5693856580 */
56939- public static function sampleValue(): bool|float|string|null {
56581+ public static function sampleValue(): bool|float|string {
5694056582 return true; /*32:value*/
5694156583 }
5694256584
@@ -56944,14 +56586,12 @@ class ConditionalPredicateTextFieldDefClass {
5694456586 * A [selection name](selection.html), or a series of [composed
5694556587 * selections](selection.html#compose).
5694656588 *
56947- * @param stdClass|string|null $value
56589+ * @param stdClass|string $value
5694856590 * @throws Exception
56949- * @return Selection|string|null
56591+ * @return Selection|string
5695056592 */
56951- public static function fromSelection(stdClass|string|null $value): Selection|string|null {
56952- if (is_null($value)) {
56953- return $value; /*null*/
56954- } elseif (is_object($value)) {
56593+ public static function fromSelection(stdClass|string $value): Selection|string {
56594+ if (is_object($value)) {
5695556595 return Selection::from($value); /*class*/
5695656596 } elseif (is_string($value)) {
5695756597 return $value; /*string*/
@@ -56965,13 +56605,11 @@ class ConditionalPredicateTextFieldDefClass {
5696556605 * selections](selection.html#compose).
5696656606 *
5696756607 * @throws Exception
56968- * @return stdClass|string|null
56608+ * @return stdClass|string
5696956609 */
56970- public function toSelection(): stdClass|string|null {
56610+ public function toSelection(): stdClass|string {
5697156611 if (ConditionalPredicateTextFieldDefClass::validateSelection($this->selection)) {
56972- if (is_null($this->selection)) {
56973- return $this->selection; /*null*/
56974- } elseif ($this->selection instanceof Selection) {
56612+ if ($this->selection instanceof Selection) {
5697556613 return $this->selection->to(); /*class*/
5697656614 } elseif (is_string($this->selection)) {
5697756615 return $this->selection; /*string*/
@@ -56986,16 +56624,12 @@ class ConditionalPredicateTextFieldDefClass {
5698656624 * A [selection name](selection.html), or a series of [composed
5698756625 * selections](selection.html#compose).
5698856626 *
56989- * @param Selection|string|null
56627+ * @param Selection|string
5699056628 * @return bool
5699156629 * @throws Exception
5699256630 */
56993- public static function validateSelection(Selection|string|null $value): bool {
56994- if (is_null($value)) {
56995- if (!is_null($value)) {
56996- throw new Exception("Attribute Error:ConditionalPredicateTextFieldDefClass::selection");
56997- }
56998- } elseif ($value instanceof Selection) {
56631+ public static function validateSelection(Selection|string $value): bool {
56632+ if ($value instanceof Selection) {
5699956633 $value->validate();
5700056634 } elseif (is_string($value)) {
5700156635 if (!is_string($value)) {
@@ -57012,9 +56646,9 @@ class ConditionalPredicateTextFieldDefClass {
5701256646 * selections](selection.html#compose).
5701356647 *
5701456648 * @throws Exception
57015- * @return Selection|string|null
56649+ * @return Selection|string
5701656650 */
57017- public function getSelection(): Selection|string|null {
56651+ public function getSelection(): Selection|string {
5701856652 if (ConditionalPredicateTextFieldDefClass::validateSelection($this->selection)) {
5701956653 return $this->selection;
5702056654 }
@@ -57025,9 +56659,9 @@ class ConditionalPredicateTextFieldDefClass {
5702556659 * A [selection name](selection.html), or a series of [composed
5702656660 * selections](selection.html#compose).
5702756661 *
57028- * @return Selection|string|null
56662+ * @return Selection|string
5702956663 */
57030- public static function sampleSelection(): Selection|string|null {
56664+ public static function sampleSelection(): Selection|string {
5703156665 return Selection::sample(); /*33:selection*/
5703256666 }
5703356667
@@ -57512,16 +57146,12 @@ class ConditionalPredicateTextFieldDefClass {
5751257146 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5751357147 * [geographic projection](projection.html) is applied.
5751457148 *
57515- * @param ?string $value
57149+ * @param string $value
5751657150 * @throws Exception
57517- * @return ?Type
57151+ * @return Type
5751857152 */
57519- public static function fromType(?string $value): ?Type {
57520- if (!is_null($value)) {
57521- return Type::from($value); /*enum*/
57522- } else {
57523- return null;
57524- }
57153+ public static function fromType(string $value): Type {
57154+ return Type::from($value); /*enum*/
5752557155 }
5752657156
5752757157 /**
@@ -57531,15 +57161,11 @@ class ConditionalPredicateTextFieldDefClass {
5753157161 * [geographic projection](projection.html) is applied.
5753257162 *
5753357163 * @throws Exception
57534- * @return ?string
57164+ * @return string
5753557165 */
57536- public function toType(): ?string {
57166+ public function toType(): string {
5753757167 if (ConditionalPredicateTextFieldDefClass::validateType($this->type)) {
57538- if (!is_null($this->type)) {
57539- return Type::to($this->type); /*enum*/
57540- } else {
57541- return null;
57542- }
57168+ return Type::to($this->type); /*enum*/
5754357169 }
5754457170 throw new Exception('never get to this ConditionalPredicateTextFieldDefClass::type');
5754557171 }
@@ -57550,14 +57176,12 @@ class ConditionalPredicateTextFieldDefClass {
5755057176 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5755157177 * [geographic projection](projection.html) is applied.
5755257178 *
57553- * @param Type|null
57179+ * @param Type
5755457180 * @return bool
5755557181 * @throws Exception
5755657182 */
57557- public static function validateType(?Type $value): bool {
57558- if (!is_null($value)) {
57559- Type::to($value);
57560- }
57183+ public static function validateType(Type $value): bool {
57184+ Type::to($value);
5756157185 return true;
5756257186 }
5756357187
@@ -57568,9 +57192,9 @@ class ConditionalPredicateTextFieldDefClass {
5756857192 * [geographic projection](projection.html) is applied.
5756957193 *
5757057194 * @throws Exception
57571- * @return ?Type
57195+ * @return Type
5757257196 */
57573- public function getType(): ?Type {
57197+ public function getType(): Type {
5757457198 if (ConditionalPredicateTextFieldDefClass::validateType($this->type)) {
5757557199 return $this->type;
5757657200 }
@@ -57583,9 +57207,9 @@ class ConditionalPredicateTextFieldDefClass {
5758357207 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5758457208 * [geographic projection](projection.html) is applied.
5758557209 *
57586- * @return ?Type
57210+ * @return Type
5758757211 */
57588- public static function sampleType(): ?Type {
57212+ public static function sampleType(): Type {
5758957213 return Type::sample(); /*enum*/
5759057214 }
5759157215
@@ -57671,8 +57295,8 @@ class XClass {
5767157295 private SortField|SortOrder|null $sort; // json:sort Optional
5767257296 private ?StackOffset $stack; // json:stack Optional
5767357297 private ?TimeUnit $timeUnit; // json:timeUnit Optional
57674- private ?Type $type; // json:type Optional
57675- private bool|float|string|null $value; // json:value Optional
57298+ private Type $type; // json:type Required
57299+ private bool|float|string $value; // json:value Required
5767657300
5767757301 /**
5767857302 * @param AggregateOp|null $aggregate
@@ -57683,10 +57307,10 @@ class XClass {
5768357307 * @param SortField|SortOrder|null $sort
5768457308 * @param StackOffset|null $stack
5768557309 * @param TimeUnit|null $timeUnit
57686- * @param Type|null $type
57687- * @param bool|float|string|null $value
57310+ * @param Type $type
57311+ * @param bool|float|string $value
5768857312 */
57689- public function __construct(?AggregateOp $aggregate, ?Axis $axis, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Scale $scale, SortField|SortOrder|null $sort, ?StackOffset $stack, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) {
57313+ public function __construct(?AggregateOp $aggregate, ?Axis $axis, BinParams|bool|null $bin, RepeatRef|string|null $field, ?Scale $scale, SortField|SortOrder|null $sort, ?StackOffset $stack, ?TimeUnit $timeUnit, Type $type, bool|float|string $value) {
5769057314 $this->aggregate = $aggregate;
5769157315 $this->axis = $axis;
5769257316 $this->bin = $bin;
@@ -58551,16 +58175,12 @@ class XClass {
5855158175 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5855258176 * [geographic projection](projection.html) is applied.
5855358177 *
58554- * @param ?string $value
58178+ * @param string $value
5855558179 * @throws Exception
58556- * @return ?Type
58180+ * @return Type
5855758181 */
58558- public static function fromType(?string $value): ?Type {
58559- if (!is_null($value)) {
58560- return Type::from($value); /*enum*/
58561- } else {
58562- return null;
58563- }
58182+ public static function fromType(string $value): Type {
58183+ return Type::from($value); /*enum*/
5856458184 }
5856558185
5856658186 /**
@@ -58570,15 +58190,11 @@ class XClass {
5857058190 * [geographic projection](projection.html) is applied.
5857158191 *
5857258192 * @throws Exception
58573- * @return ?string
58193+ * @return string
5857458194 */
58575- public function toType(): ?string {
58195+ public function toType(): string {
5857658196 if (XClass::validateType($this->type)) {
58577- if (!is_null($this->type)) {
58578- return Type::to($this->type); /*enum*/
58579- } else {
58580- return null;
58581- }
58197+ return Type::to($this->type); /*enum*/
5858258198 }
5858358199 throw new Exception('never get to this XClass::type');
5858458200 }
@@ -58589,14 +58205,12 @@ class XClass {
5858958205 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5859058206 * [geographic projection](projection.html) is applied.
5859158207 *
58592- * @param Type|null
58208+ * @param Type
5859358209 * @return bool
5859458210 * @throws Exception
5859558211 */
58596- public static function validateType(?Type $value): bool {
58597- if (!is_null($value)) {
58598- Type::to($value);
58599- }
58212+ public static function validateType(Type $value): bool {
58213+ Type::to($value);
5860058214 return true;
5860158215 }
5860258216
@@ -58607,9 +58221,9 @@ class XClass {
5860758221 * [geographic projection](projection.html) is applied.
5860858222 *
5860958223 * @throws Exception
58610- * @return ?Type
58224+ * @return Type
5861158225 */
58612- public function getType(): ?Type {
58226+ public function getType(): Type {
5861358227 if (XClass::validateType($this->type)) {
5861458228 return $this->type;
5861558229 }
@@ -58622,9 +58236,9 @@ class XClass {
5862258236 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5862358237 * [geographic projection](projection.html) is applied.
5862458238 *
58625- * @return ?Type
58239+ * @return Type
5862658240 */
58627- public static function sampleType(): ?Type {
58241+ public static function sampleType(): Type {
5862858242 return Type::sample(); /*enum*/
5862958243 }
5863058244
@@ -58632,14 +58246,12 @@ class XClass {
5863258246 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5863358247 * `0` to `1` for opacity).
5863458248 *
58635- * @param bool|float|string|null $value
58249+ * @param bool|float|string $value
5863658250 * @throws Exception
58637- * @return bool|float|string|null
58251+ * @return bool|float|string
5863858252 */
58639- public static function fromValue(bool|float|string|null $value): bool|float|string|null {
58640- if (is_null($value)) {
58641- return $value; /*null*/
58642- } elseif (is_bool($value)) {
58253+ public static function fromValue(bool|float|string $value): bool|float|string {
58254+ if (is_bool($value)) {
5864358255 return $value; /*bool*/
5864458256 } elseif (is_float($value) || is_int($value)) {
5864558257 return $value; /*float*/
@@ -58655,13 +58267,11 @@ class XClass {
5865558267 * `0` to `1` for opacity).
5865658268 *
5865758269 * @throws Exception
58658- * @return bool|float|string|null
58270+ * @return bool|float|string
5865958271 */
58660- public function toValue(): bool|float|string|null {
58272+ public function toValue(): bool|float|string {
5866158273 if (XClass::validateValue($this->value)) {
58662- if (is_null($this->value)) {
58663- return $this->value; /*null*/
58664- } elseif (is_bool($this->value)) {
58274+ if (is_bool($this->value)) {
5866558275 return $this->value; /*bool*/
5866658276 } elseif (is_float($this->value) || is_int($this->value)) {
5866758277 return $this->value; /*float*/
@@ -58678,16 +58288,12 @@ class XClass {
5867858288 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5867958289 * `0` to `1` for opacity).
5868058290 *
58681- * @param bool|float|string|null
58291+ * @param bool|float|string
5868258292 * @return bool
5868358293 * @throws Exception
5868458294 */
58685- public static function validateValue(bool|float|string|null $value): bool {
58686- if (is_null($value)) {
58687- if (!is_null($value)) {
58688- throw new Exception("Attribute Error:XClass::value");
58689- }
58690- } elseif (is_bool($value)) {
58295+ public static function validateValue(bool|float|string $value): bool {
58296+ if (is_bool($value)) {
5869158297 if (!is_bool($value)) {
5869258298 throw new Exception("Attribute Error:XClass::value");
5869358299 }
@@ -58710,9 +58316,9 @@ class XClass {
5871058316 * `0` to `1` for opacity).
5871158317 *
5871258318 * @throws Exception
58713- * @return bool|float|string|null
58319+ * @return bool|float|string
5871458320 */
58715- public function getValue(): bool|float|string|null {
58321+ public function getValue(): bool|float|string {
5871658322 if (XClass::validateValue($this->value)) {
5871758323 return $this->value;
5871858324 }
@@ -58723,9 +58329,9 @@ class XClass {
5872358329 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
5872458330 * `0` to `1` for opacity).
5872558331 *
58726- * @return bool|float|string|null
58332+ * @return bool|float|string
5872758333 */
58728- public static function sampleValue(): bool|float|string|null {
58334+ public static function sampleValue(): bool|float|string {
5872958335 return true; /*40:value*/
5873058336 }
5873158337
@@ -60957,18 +60563,18 @@ class X2Class {
6095760563 private BinParams|bool|null $bin; // json:bin Optional
6095860564 private RepeatRef|string|null $field; // json:field Optional
6095960565 private ?TimeUnit $timeUnit; // json:timeUnit Optional
60960- private ?Type $type; // json:type Optional
60961- private bool|float|string|null $value; // json:value Optional
60566+ private Type $type; // json:type Required
60567+ private bool|float|string $value; // json:value Required
6096260568
6096360569 /**
6096460570 * @param AggregateOp|null $aggregate
6096560571 * @param BinParams|bool|null $bin
6096660572 * @param RepeatRef|string|null $field
6096760573 * @param TimeUnit|null $timeUnit
60968- * @param Type|null $type
60969- * @param bool|float|string|null $value
60574+ * @param Type $type
60575+ * @param bool|float|string $value
6097060576 */
60971- public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, ?Type $type, bool|float|string|null $value) {
60577+ public function __construct(?AggregateOp $aggregate, BinParams|bool|null $bin, RepeatRef|string|null $field, ?TimeUnit $timeUnit, Type $type, bool|float|string $value) {
6097260578 $this->aggregate = $aggregate;
6097360579 $this->bin = $bin;
6097460580 $this->field = $field;
@@ -61386,16 +60992,12 @@ class X2Class {
6138660992 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
6138760993 * [geographic projection](projection.html) is applied.
6138860994 *
61389- * @param ?string $value
60995+ * @param string $value
6139060996 * @throws Exception
61391- * @return ?Type
60997+ * @return Type
6139260998 */
61393- public static function fromType(?string $value): ?Type {
61394- if (!is_null($value)) {
61395- return Type::from($value); /*enum*/
61396- } else {
61397- return null;
61398- }
60999+ public static function fromType(string $value): Type {
61000+ return Type::from($value); /*enum*/
6139961001 }
6140061002
6140161003 /**
@@ -61405,15 +61007,11 @@ class X2Class {
6140561007 * [geographic projection](projection.html) is applied.
6140661008 *
6140761009 * @throws Exception
61408- * @return ?string
61010+ * @return string
6140961011 */
61410- public function toType(): ?string {
61012+ public function toType(): string {
6141161013 if (X2Class::validateType($this->type)) {
61412- if (!is_null($this->type)) {
61413- return Type::to($this->type); /*enum*/
61414- } else {
61415- return null;
61416- }
61014+ return Type::to($this->type); /*enum*/
6141761015 }
6141861016 throw new Exception('never get to this X2Class::type');
6141961017 }
@@ -61424,14 +61022,12 @@ class X2Class {
6142461022 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
6142561023 * [geographic projection](projection.html) is applied.
6142661024 *
61427- * @param Type|null
61025+ * @param Type
6142861026 * @return bool
6142961027 * @throws Exception
6143061028 */
61431- public static function validateType(?Type $value): bool {
61432- if (!is_null($value)) {
61433- Type::to($value);
61434- }
61029+ public static function validateType(Type $value): bool {
61030+ Type::to($value);
6143561031 return true;
6143661032 }
6143761033
@@ -61442,9 +61038,9 @@ class X2Class {
6144261038 * [geographic projection](projection.html) is applied.
6144361039 *
6144461040 * @throws Exception
61445- * @return ?Type
61041+ * @return Type
6144661042 */
61447- public function getType(): ?Type {
61043+ public function getType(): Type {
6144861044 if (X2Class::validateType($this->type)) {
6144961045 return $this->type;
6145061046 }
@@ -61457,9 +61053,9 @@ class X2Class {
6145761053 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
6145861054 * [geographic projection](projection.html) is applied.
6145961055 *
61460- * @return ?Type
61056+ * @return Type
6146161057 */
61462- public static function sampleType(): ?Type {
61058+ public static function sampleType(): Type {
6146361059 return Type::sample(); /*enum*/
6146461060 }
6146561061
@@ -61467,14 +61063,12 @@ class X2Class {
6146761063 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6146861064 * `0` to `1` for opacity).
6146961065 *
61470- * @param bool|float|string|null $value
61066+ * @param bool|float|string $value
6147161067 * @throws Exception
61472- * @return bool|float|string|null
61068+ * @return bool|float|string
6147361069 */
61474- public static function fromValue(bool|float|string|null $value): bool|float|string|null {
61475- if (is_null($value)) {
61476- return $value; /*null*/
61477- } elseif (is_bool($value)) {
61070+ public static function fromValue(bool|float|string $value): bool|float|string {
61071+ if (is_bool($value)) {
6147861072 return $value; /*bool*/
6147961073 } elseif (is_float($value) || is_int($value)) {
6148061074 return $value; /*float*/
@@ -61490,13 +61084,11 @@ class X2Class {
6149061084 * `0` to `1` for opacity).
6149161085 *
6149261086 * @throws Exception
61493- * @return bool|float|string|null
61087+ * @return bool|float|string
6149461088 */
61495- public function toValue(): bool|float|string|null {
61089+ public function toValue(): bool|float|string {
6149661090 if (X2Class::validateValue($this->value)) {
61497- if (is_null($this->value)) {
61498- return $this->value; /*null*/
61499- } elseif (is_bool($this->value)) {
61091+ if (is_bool($this->value)) {
6150061092 return $this->value; /*bool*/
6150161093 } elseif (is_float($this->value) || is_int($this->value)) {
6150261094 return $this->value; /*float*/
@@ -61513,16 +61105,12 @@ class X2Class {
6151361105 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6151461106 * `0` to `1` for opacity).
6151561107 *
61516- * @param bool|float|string|null
61108+ * @param bool|float|string
6151761109 * @return bool
6151861110 * @throws Exception
6151961111 */
61520- public static function validateValue(bool|float|string|null $value): bool {
61521- if (is_null($value)) {
61522- if (!is_null($value)) {
61523- throw new Exception("Attribute Error:X2Class::value");
61524- }
61525- } elseif (is_bool($value)) {
61112+ public static function validateValue(bool|float|string $value): bool {
61113+ if (is_bool($value)) {
6152661114 if (!is_bool($value)) {
6152761115 throw new Exception("Attribute Error:X2Class::value");
6152861116 }
@@ -61545,9 +61133,9 @@ class X2Class {
6154561133 * `0` to `1` for opacity).
6154661134 *
6154761135 * @throws Exception
61548- * @return bool|float|string|null
61136+ * @return bool|float|string
6154961137 */
61550- public function getValue(): bool|float|string|null {
61138+ public function getValue(): bool|float|string {
6155161139 if (X2Class::validateValue($this->value)) {
6155261140 return $this->value;
6155361141 }
@@ -61558,9 +61146,9 @@ class X2Class {
6155861146 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6155961147 * `0` to `1` for opacity).
6156061148 *
61561- * @return bool|float|string|null
61149+ * @return bool|float|string
6156261150 */
61563- public static function sampleValue(): bool|float|string|null {
61151+ public static function sampleValue(): bool|float|string {
6156461152 return true; /*36:value*/
6156561153 }
6156661154
@@ -61823,43 +61411,43 @@ class Spec {
6182361411 private ?Data $data; // json:data Optional
6182461412 private ?string $description; // json:description Optional
6182561413 private ?float $height; // json:height Optional
61826- private ?array $layer; // json:layer Optional
61414+ private array $layer; // json:layer Required
6182761415 private ?string $name; // json:name Optional
6182861416 private ?Resolve $resolve; // json:resolve Optional
6182961417 private TitleParams|string|null $title; // json:title Optional
6183061418 private ?array $transform; // json:transform Optional
6183161419 private ?float $width; // json:width Optional
61832- private ?Encoding $encoding; // json:encoding Optional
61833- private MarkDef|Mark|null $mark; // json:mark Optional
61420+ private Encoding $encoding; // json:encoding Required
61421+ private MarkDef|Mark $mark; // json:mark Required
6183461422 private ?Projection $projection; // json:projection Optional
6183561423 private ?stdClass $selection; // json:selection Optional
61836- private ?FacetMapping $facet; // json:facet Optional
61837- private ?Spec $spec; // json:spec Optional
61838- private ?Repeat $repeat; // json:repeat Optional
61839- private ?array $vconcat; // json:vconcat Optional
61840- private ?array $hconcat; // json:hconcat Optional
61424+ private FacetMapping $facet; // json:facet Required
61425+ private Spec $spec; // json:spec Required
61426+ private Repeat $repeat; // json:repeat Required
61427+ private array $vconcat; // json:vconcat Required
61428+ private array $hconcat; // json:hconcat Required
6184161429
6184261430 /**
6184361431 * @param Data|null $data
6184461432 * @param string|null $description
6184561433 * @param float|null $height
61846- * @param array|null $layer
61434+ * @param array $layer
6184761435 * @param string|null $name
6184861436 * @param Resolve|null $resolve
6184961437 * @param TitleParams|string|null $title
6185061438 * @param array|null $transform
6185161439 * @param float|null $width
61852- * @param Encoding|null $encoding
61853- * @param MarkDef|Mark|null $mark
61440+ * @param Encoding $encoding
61441+ * @param MarkDef|Mark $mark
6185461442 * @param Projection|null $projection
6185561443 * @param stdClass|null $selection
61856- * @param FacetMapping|null $facet
61857- * @param Spec|null $spec
61858- * @param Repeat|null $repeat
61859- * @param array|null $vconcat
61860- * @param array|null $hconcat
61444+ * @param FacetMapping $facet
61445+ * @param Spec $spec
61446+ * @param Repeat $repeat
61447+ * @param array $vconcat
61448+ * @param array $hconcat
6186161449 */
61862- public function __construct(?Data $data, ?string $description, ?float $height, ?array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, ?Encoding $encoding, MarkDef|Mark|null $mark, ?Projection $projection, ?stdClass $selection, ?FacetMapping $facet, ?Spec $spec, ?Repeat $repeat, ?array $vconcat, ?array $hconcat) {
61450+ public function __construct(?Data $data, ?string $description, ?float $height, array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, Encoding $encoding, MarkDef|Mark $mark, ?Projection $projection, ?stdClass $selection, FacetMapping $facet, Spec $spec, Repeat $repeat, array $vconcat, array $hconcat) {
6186361451 $this->data = $data;
6186461452 $this->description = $description;
6186561453 $this->height = $height;
@@ -62168,18 +61756,14 @@ class Spec {
6216861756 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
6216961757 * layering facet specifications is not allowed.
6217061758 *
62171- * @param ?array $value
61759+ * @param array $value
6217261760 * @throws Exception
62173- * @return ?array
61761+ * @return array
6217461762 */
62175- public static function fromLayer(?array $value): ?array {
62176- if (!is_null($value)) {
62177- return array_map(function ($value) {
62178- return LayerSpec::from($value); /*class*/
62179- }, $value);
62180- } else {
62181- return null;
62182- }
61763+ public static function fromLayer(array $value): array {
61764+ return array_map(function ($value) {
61765+ return LayerSpec::from($value); /*class*/
61766+ }, $value);
6218361767 }
6218461768
6218561769 /**
@@ -62189,17 +61773,13 @@ class Spec {
6218961773 * layering facet specifications is not allowed.
6219061774 *
6219161775 * @throws Exception
62192- * @return ?array
61776+ * @return array
6219361777 */
62194- public function toLayer(): ?array {
61778+ public function toLayer(): array {
6219561779 if (Spec::validateLayer($this->layer)) {
62196- if (!is_null($this->layer)) {
62197- return array_map(function ($value) {
62198- return $value->to(); /*class*/
62199- }, $this->layer);
62200- } else {
62201- return null;
62202- }
61780+ return array_map(function ($value) {
61781+ return $value->to(); /*class*/
61782+ }, $this->layer);
6220361783 }
6220461784 throw new Exception('never get to this Spec::layer');
6220561785 }
@@ -62210,19 +61790,17 @@ class Spec {
6221061790 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
6221161791 * layering facet specifications is not allowed.
6221261792 *
62213- * @param array|null
61793+ * @param array
6221461794 * @return bool
6221561795 * @throws Exception
6221661796 */
62217- public static function validateLayer(?array $value): bool {
62218- if (!is_null($value)) {
62219- if (!is_array($value)) {
62220- throw new Exception("Attribute Error:Spec::layer");
62221- }
62222- array_walk($value, function($value_v) {
62223- $value_v->validate();
62224- });
61797+ public static function validateLayer(array $value): bool {
61798+ if (!is_array($value)) {
61799+ throw new Exception("Attribute Error:Spec::layer");
6222561800 }
61801+ array_walk($value, function($value_v) {
61802+ $value_v->validate();
61803+ });
6222661804 return true;
6222761805 }
6222861806
@@ -62233,9 +61811,9 @@ class Spec {
6223361811 * layering facet specifications is not allowed.
6223461812 *
6223561813 * @throws Exception
62236- * @return ?array
61814+ * @return array
6223761815 */
62238- public function getLayer(): ?array {
61816+ public function getLayer(): array {
6223961817 if (Spec::validateLayer($this->layer)) {
6224061818 return $this->layer;
6224161819 }
@@ -62248,9 +61826,9 @@ class Spec {
6224861826 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
6224961827 * layering facet specifications is not allowed.
6225061828 *
62251- * @return ?array
61829+ * @return array
6225261830 */
62253- public static function sampleLayer(): ?array {
61831+ public static function sampleLayer(): array {
6225461832 return array(
6225561833 LayerSpec::sample() /*34:*/
6225661834 ); /* 34:layer*/
@@ -62761,31 +62339,23 @@ class Spec {
6276162339 /**
6276262340 * A key-value mapping between encoding channels and definition of fields.
6276362341 *
62764- * @param ?stdClass $value
62342+ * @param stdClass $value
6276562343 * @throws Exception
62766- * @return ?Encoding
62344+ * @return Encoding
6276762345 */
62768- public static function fromEncoding(?stdClass $value): ?Encoding {
62769- if (!is_null($value)) {
62770- return Encoding::from($value); /*class*/
62771- } else {
62772- return null;
62773- }
62346+ public static function fromEncoding(stdClass $value): Encoding {
62347+ return Encoding::from($value); /*class*/
6277462348 }
6277562349
6277662350 /**
6277762351 * A key-value mapping between encoding channels and definition of fields.
6277862352 *
6277962353 * @throws Exception
62780- * @return ?stdClass
62354+ * @return stdClass
6278162355 */
62782- public function toEncoding(): ?stdClass {
62356+ public function toEncoding(): stdClass {
6278362357 if (Spec::validateEncoding($this->encoding)) {
62784- if (!is_null($this->encoding)) {
62785- return $this->encoding->to(); /*class*/
62786- } else {
62787- return null;
62788- }
62358+ return $this->encoding->to(); /*class*/
6278962359 }
6279062360 throw new Exception('never get to this Spec::encoding');
6279162361 }
@@ -62793,14 +62363,12 @@ class Spec {
6279362363 /**
6279462364 * A key-value mapping between encoding channels and definition of fields.
6279562365 *
62796- * @param Encoding|null
62366+ * @param Encoding
6279762367 * @return bool
6279862368 * @throws Exception
6279962369 */
62800- public static function validateEncoding(?Encoding $value): bool {
62801- if (!is_null($value)) {
62802- $value->validate();
62803- }
62370+ public static function validateEncoding(Encoding $value): bool {
62371+ $value->validate();
6280462372 return true;
6280562373 }
6280662374
@@ -62808,9 +62376,9 @@ class Spec {
6280862376 * A key-value mapping between encoding channels and definition of fields.
6280962377 *
6281062378 * @throws Exception
62811- * @return ?Encoding
62379+ * @return Encoding
6281262380 */
62813- public function getEncoding(): ?Encoding {
62381+ public function getEncoding(): Encoding {
6281462382 if (Spec::validateEncoding($this->encoding)) {
6281562383 return $this->encoding;
6281662384 }
@@ -62820,9 +62388,9 @@ class Spec {
6282062388 /**
6282162389 * A key-value mapping between encoding channels and definition of fields.
6282262390 *
62823- * @return ?Encoding
62391+ * @return Encoding
6282462392 */
62825- public static function sampleEncoding(): ?Encoding {
62393+ public static function sampleEncoding(): Encoding {
6282662394 return Encoding::sample(); /*40:encoding*/
6282762395 }
6282862396
@@ -62832,14 +62400,12 @@ class Spec {
6283262400 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
6283362401 * object](mark.html#mark-def).
6283462402 *
62835- * @param stdClass|string|null $value
62403+ * @param stdClass|string $value
6283662404 * @throws Exception
62837- * @return MarkDef|Mark|null
62405+ * @return MarkDef|Mark
6283862406 */
62839- public static function fromMark(stdClass|string|null $value): MarkDef|Mark|null {
62840- if (is_null($value)) {
62841- return $value; /*null*/
62842- } elseif (is_object($value)) {
62407+ public static function fromMark(stdClass|string $value): MarkDef|Mark {
62408+ if (is_object($value)) {
6284362409 return MarkDef::from($value); /*class*/
6284462410 } elseif (is_string($value) && in_array($value, ['area', 'bar', 'line', 'point', 'text', 'tick', 'rect', 'rule', 'circle', 'square', 'geoshape'], true)) {
6284562411 return Mark::from($value); /*enum*/
@@ -62855,13 +62421,11 @@ class Spec {
6285562421 * object](mark.html#mark-def).
6285662422 *
6285762423 * @throws Exception
62858- * @return stdClass|string|null
62424+ * @return stdClass|string
6285962425 */
62860- public function toMark(): stdClass|string|null {
62426+ public function toMark(): stdClass|string {
6286162427 if (Spec::validateMark($this->mark)) {
62862- if (is_null($this->mark)) {
62863- return $this->mark; /*null*/
62864- } elseif ($this->mark instanceof MarkDef) {
62428+ if ($this->mark instanceof MarkDef) {
6286562429 return $this->mark->to(); /*class*/
6286662430 } elseif ($this->mark instanceof Mark) {
6286762431 return Mark::to($this->mark); /*enum*/
@@ -62878,16 +62442,12 @@ class Spec {
6287862442 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
6287962443 * object](mark.html#mark-def).
6288062444 *
62881- * @param MarkDef|Mark|null
62445+ * @param MarkDef|Mark
6288262446 * @return bool
6288362447 * @throws Exception
6288462448 */
62885- public static function validateMark(MarkDef|Mark|null $value): bool {
62886- if (is_null($value)) {
62887- if (!is_null($value)) {
62888- throw new Exception("Attribute Error:Spec::mark");
62889- }
62890- } elseif ($value instanceof MarkDef) {
62449+ public static function validateMark(MarkDef|Mark $value): bool {
62450+ if ($value instanceof MarkDef) {
6289162451 $value->validate();
6289262452 } elseif ($value instanceof Mark) {
6289362453 Mark::to($value);
@@ -62904,9 +62464,9 @@ class Spec {
6290462464 * object](mark.html#mark-def).
6290562465 *
6290662466 * @throws Exception
62907- * @return MarkDef|Mark|null
62467+ * @return MarkDef|Mark
6290862468 */
62909- public function getMark(): MarkDef|Mark|null {
62469+ public function getMark(): MarkDef|Mark {
6291062470 if (Spec::validateMark($this->mark)) {
6291162471 return $this->mark;
6291262472 }
@@ -62919,9 +62479,9 @@ class Spec {
6291962479 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
6292062480 * object](mark.html#mark-def).
6292162481 *
62922- * @return MarkDef|Mark|null
62482+ * @return MarkDef|Mark
6292362483 */
62924- public static function sampleMark(): MarkDef|Mark|null {
62484+ public static function sampleMark(): MarkDef|Mark {
6292562485 return MarkDef::sample(); /*41:mark*/
6292662486 }
6292762487
@@ -63094,16 +62654,12 @@ class Spec {
6309462654 * An object that describes mappings between `row` and `column` channels and their field
6309562655 * definitions.
6309662656 *
63097- * @param ?stdClass $value
62657+ * @param stdClass $value
6309862658 * @throws Exception
63099- * @return ?FacetMapping
62659+ * @return FacetMapping
6310062660 */
63101- public static function fromFacet(?stdClass $value): ?FacetMapping {
63102- if (!is_null($value)) {
63103- return FacetMapping::from($value); /*class*/
63104- } else {
63105- return null;
63106- }
62661+ public static function fromFacet(stdClass $value): FacetMapping {
62662+ return FacetMapping::from($value); /*class*/
6310762663 }
6310862664
6310962665 /**
@@ -63111,15 +62667,11 @@ class Spec {
6311162667 * definitions.
6311262668 *
6311362669 * @throws Exception
63114- * @return ?stdClass
62670+ * @return stdClass
6311562671 */
63116- public function toFacet(): ?stdClass {
62672+ public function toFacet(): stdClass {
6311762673 if (Spec::validateFacet($this->facet)) {
63118- if (!is_null($this->facet)) {
63119- return $this->facet->to(); /*class*/
63120- } else {
63121- return null;
63122- }
62674+ return $this->facet->to(); /*class*/
6312362675 }
6312462676 throw new Exception('never get to this Spec::facet');
6312562677 }
@@ -63128,14 +62680,12 @@ class Spec {
6312862680 * An object that describes mappings between `row` and `column` channels and their field
6312962681 * definitions.
6313062682 *
63131- * @param FacetMapping|null
62683+ * @param FacetMapping
6313262684 * @return bool
6313362685 * @throws Exception
6313462686 */
63135- public static function validateFacet(?FacetMapping $value): bool {
63136- if (!is_null($value)) {
63137- $value->validate();
63138- }
62687+ public static function validateFacet(FacetMapping $value): bool {
62688+ $value->validate();
6313962689 return true;
6314062690 }
6314162691
@@ -63144,9 +62694,9 @@ class Spec {
6314462694 * definitions.
6314562695 *
6314662696 * @throws Exception
63147- * @return ?FacetMapping
62697+ * @return FacetMapping
6314862698 */
63149- public function getFacet(): ?FacetMapping {
62699+ public function getFacet(): FacetMapping {
6315062700 if (Spec::validateFacet($this->facet)) {
6315162701 return $this->facet;
6315262702 }
@@ -63157,40 +62707,32 @@ class Spec {
6315762707 * An object that describes mappings between `row` and `column` channels and their field
6315862708 * definitions.
6315962709 *
63160- * @return ?FacetMapping
62710+ * @return FacetMapping
6316162711 */
63162- public static function sampleFacet(): ?FacetMapping {
62712+ public static function sampleFacet(): FacetMapping {
6316362713 return FacetMapping::sample(); /*44:facet*/
6316462714 }
6316562715
6316662716 /**
6316762717 * A specification of the view that gets faceted.
6316862718 *
63169- * @param ?stdClass $value
62719+ * @param stdClass $value
6317062720 * @throws Exception
63171- * @return ?Spec
62721+ * @return Spec
6317262722 */
63173- public static function fromSpec(?stdClass $value): ?Spec {
63174- if (!is_null($value)) {
63175- return Spec::from($value); /*class*/
63176- } else {
63177- return null;
63178- }
62723+ public static function fromSpec(stdClass $value): Spec {
62724+ return Spec::from($value); /*class*/
6317962725 }
6318062726
6318162727 /**
6318262728 * A specification of the view that gets faceted.
6318362729 *
6318462730 * @throws Exception
63185- * @return ?stdClass
62731+ * @return stdClass
6318662732 */
63187- public function toSpec(): ?stdClass {
62733+ public function toSpec(): stdClass {
6318862734 if (Spec::validateSpec($this->spec)) {
63189- if (!is_null($this->spec)) {
63190- return $this->spec->to(); /*class*/
63191- } else {
63192- return null;
63193- }
62735+ return $this->spec->to(); /*class*/
6319462736 }
6319562737 throw new Exception('never get to this Spec::spec');
6319662738 }
@@ -63198,14 +62740,12 @@ class Spec {
6319862740 /**
6319962741 * A specification of the view that gets faceted.
6320062742 *
63201- * @param Spec|null
62743+ * @param Spec
6320262744 * @return bool
6320362745 * @throws Exception
6320462746 */
63205- public static function validateSpec(?Spec $value): bool {
63206- if (!is_null($value)) {
63207- $value->validate();
63208- }
62747+ public static function validateSpec(Spec $value): bool {
62748+ $value->validate();
6320962749 return true;
6321062750 }
6321162751
@@ -63213,9 +62753,9 @@ class Spec {
6321362753 * A specification of the view that gets faceted.
6321462754 *
6321562755 * @throws Exception
63216- * @return ?Spec
62756+ * @return Spec
6321762757 */
63218- public function getSpec(): ?Spec {
62758+ public function getSpec(): Spec {
6321962759 if (Spec::validateSpec($this->spec)) {
6322062760 return $this->spec;
6322162761 }
@@ -63225,9 +62765,9 @@ class Spec {
6322562765 /**
6322662766 * A specification of the view that gets faceted.
6322762767 *
63228- * @return ?Spec
62768+ * @return Spec
6322962769 */
63230- public static function sampleSpec(): ?Spec {
62770+ public static function sampleSpec(): Spec {
6323162771 return Spec::sample(); /*45:spec*/
6323262772 }
6323362773
@@ -63235,16 +62775,12 @@ class Spec {
6323562775 * An object that describes what fields should be repeated into views that are laid out as a
6323662776 * `row` or `column`.
6323762777 *
63238- * @param ?stdClass $value
62778+ * @param stdClass $value
6323962779 * @throws Exception
63240- * @return ?Repeat
62780+ * @return Repeat
6324162781 */
63242- public static function fromRepeat(?stdClass $value): ?Repeat {
63243- if (!is_null($value)) {
63244- return Repeat::from($value); /*class*/
63245- } else {
63246- return null;
63247- }
62782+ public static function fromRepeat(stdClass $value): Repeat {
62783+ return Repeat::from($value); /*class*/
6324862784 }
6324962785
6325062786 /**
@@ -63252,15 +62788,11 @@ class Spec {
6325262788 * `row` or `column`.
6325362789 *
6325462790 * @throws Exception
63255- * @return ?stdClass
62791+ * @return stdClass
6325662792 */
63257- public function toRepeat(): ?stdClass {
62793+ public function toRepeat(): stdClass {
6325862794 if (Spec::validateRepeat($this->repeat)) {
63259- if (!is_null($this->repeat)) {
63260- return $this->repeat->to(); /*class*/
63261- } else {
63262- return null;
63263- }
62795+ return $this->repeat->to(); /*class*/
6326462796 }
6326562797 throw new Exception('never get to this Spec::repeat');
6326662798 }
@@ -63269,14 +62801,12 @@ class Spec {
6326962801 * An object that describes what fields should be repeated into views that are laid out as a
6327062802 * `row` or `column`.
6327162803 *
63272- * @param Repeat|null
62804+ * @param Repeat
6327362805 * @return bool
6327462806 * @throws Exception
6327562807 */
63276- public static function validateRepeat(?Repeat $value): bool {
63277- if (!is_null($value)) {
63278- $value->validate();
63279- }
62808+ public static function validateRepeat(Repeat $value): bool {
62809+ $value->validate();
6328062810 return true;
6328162811 }
6328262812
@@ -63285,9 +62815,9 @@ class Spec {
6328562815 * `row` or `column`.
6328662816 *
6328762817 * @throws Exception
63288- * @return ?Repeat
62818+ * @return Repeat
6328962819 */
63290- public function getRepeat(): ?Repeat {
62820+ public function getRepeat(): Repeat {
6329162821 if (Spec::validateRepeat($this->repeat)) {
6329262822 return $this->repeat;
6329362823 }
@@ -63298,44 +62828,36 @@ class Spec {
6329862828 * An object that describes what fields should be repeated into views that are laid out as a
6329962829 * `row` or `column`.
6330062830 *
63301- * @return ?Repeat
62831+ * @return Repeat
6330262832 */
63303- public static function sampleRepeat(): ?Repeat {
62833+ public static function sampleRepeat(): Repeat {
6330462834 return Repeat::sample(); /*46:repeat*/
6330562835 }
6330662836
6330762837 /**
6330862838 * A list of views that should be concatenated and put into a column.
6330962839 *
63310- * @param ?array $value
62840+ * @param array $value
6331162841 * @throws Exception
63312- * @return ?array
62842+ * @return array
6331362843 */
63314- public static function fromVconcat(?array $value): ?array {
63315- if (!is_null($value)) {
63316- return array_map(function ($value) {
63317- return Spec::from($value); /*class*/
63318- }, $value);
63319- } else {
63320- return null;
63321- }
62844+ public static function fromVconcat(array $value): array {
62845+ return array_map(function ($value) {
62846+ return Spec::from($value); /*class*/
62847+ }, $value);
6332262848 }
6332362849
6332462850 /**
6332562851 * A list of views that should be concatenated and put into a column.
6332662852 *
6332762853 * @throws Exception
63328- * @return ?array
62854+ * @return array
6332962855 */
63330- public function toVconcat(): ?array {
62856+ public function toVconcat(): array {
6333162857 if (Spec::validateVconcat($this->vconcat)) {
63332- if (!is_null($this->vconcat)) {
63333- return array_map(function ($value) {
63334- return $value->to(); /*class*/
63335- }, $this->vconcat);
63336- } else {
63337- return null;
63338- }
62858+ return array_map(function ($value) {
62859+ return $value->to(); /*class*/
62860+ }, $this->vconcat);
6333962861 }
6334062862 throw new Exception('never get to this Spec::vconcat');
6334162863 }
@@ -63343,19 +62865,17 @@ class Spec {
6334362865 /**
6334462866 * A list of views that should be concatenated and put into a column.
6334562867 *
63346- * @param array|null
62868+ * @param array
6334762869 * @return bool
6334862870 * @throws Exception
6334962871 */
63350- public static function validateVconcat(?array $value): bool {
63351- if (!is_null($value)) {
63352- if (!is_array($value)) {
63353- throw new Exception("Attribute Error:Spec::vconcat");
63354- }
63355- array_walk($value, function($value_v) {
63356- $value_v->validate();
63357- });
62872+ public static function validateVconcat(array $value): bool {
62873+ if (!is_array($value)) {
62874+ throw new Exception("Attribute Error:Spec::vconcat");
6335862875 }
62876+ array_walk($value, function($value_v) {
62877+ $value_v->validate();
62878+ });
6335962879 return true;
6336062880 }
6336162881
@@ -63363,9 +62883,9 @@ class Spec {
6336362883 * A list of views that should be concatenated and put into a column.
6336462884 *
6336562885 * @throws Exception
63366- * @return ?array
62886+ * @return array
6336762887 */
63368- public function getVconcat(): ?array {
62888+ public function getVconcat(): array {
6336962889 if (Spec::validateVconcat($this->vconcat)) {
6337062890 return $this->vconcat;
6337162891 }
@@ -63375,9 +62895,9 @@ class Spec {
6337562895 /**
6337662896 * A list of views that should be concatenated and put into a column.
6337762897 *
63378- * @return ?array
62898+ * @return array
6337962899 */
63380- public static function sampleVconcat(): ?array {
62900+ public static function sampleVconcat(): array {
6338162901 return array(
6338262902 Spec::sample() /*47:*/
6338362903 ); /* 47:vconcat*/
@@ -63386,35 +62906,27 @@ class Spec {
6338662906 /**
6338762907 * A list of views that should be concatenated and put into a row.
6338862908 *
63389- * @param ?array $value
62909+ * @param array $value
6339062910 * @throws Exception
63391- * @return ?array
62911+ * @return array
6339262912 */
63393- public static function fromHconcat(?array $value): ?array {
63394- if (!is_null($value)) {
63395- return array_map(function ($value) {
63396- return Spec::from($value); /*class*/
63397- }, $value);
63398- } else {
63399- return null;
63400- }
62913+ public static function fromHconcat(array $value): array {
62914+ return array_map(function ($value) {
62915+ return Spec::from($value); /*class*/
62916+ }, $value);
6340162917 }
6340262918
6340362919 /**
6340462920 * A list of views that should be concatenated and put into a row.
6340562921 *
6340662922 * @throws Exception
63407- * @return ?array
62923+ * @return array
6340862924 */
63409- public function toHconcat(): ?array {
62925+ public function toHconcat(): array {
6341062926 if (Spec::validateHconcat($this->hconcat)) {
63411- if (!is_null($this->hconcat)) {
63412- return array_map(function ($value) {
63413- return $value->to(); /*class*/
63414- }, $this->hconcat);
63415- } else {
63416- return null;
63417- }
62927+ return array_map(function ($value) {
62928+ return $value->to(); /*class*/
62929+ }, $this->hconcat);
6341862930 }
6341962931 throw new Exception('never get to this Spec::hconcat');
6342062932 }
@@ -63422,19 +62934,17 @@ class Spec {
6342262934 /**
6342362935 * A list of views that should be concatenated and put into a row.
6342462936 *
63425- * @param array|null
62937+ * @param array
6342662938 * @return bool
6342762939 * @throws Exception
6342862940 */
63429- public static function validateHconcat(?array $value): bool {
63430- if (!is_null($value)) {
63431- if (!is_array($value)) {
63432- throw new Exception("Attribute Error:Spec::hconcat");
63433- }
63434- array_walk($value, function($value_v) {
63435- $value_v->validate();
63436- });
62941+ public static function validateHconcat(array $value): bool {
62942+ if (!is_array($value)) {
62943+ throw new Exception("Attribute Error:Spec::hconcat");
6343762944 }
62945+ array_walk($value, function($value_v) {
62946+ $value_v->validate();
62947+ });
6343862948 return true;
6343962949 }
6344062950
@@ -63442,9 +62952,9 @@ class Spec {
6344262952 * A list of views that should be concatenated and put into a row.
6344362953 *
6344462954 * @throws Exception
63445- * @return ?array
62955+ * @return array
6344662956 */
63447- public function getHconcat(): ?array {
62957+ public function getHconcat(): array {
6344862958 if (Spec::validateHconcat($this->hconcat)) {
6344962959 return $this->hconcat;
6345062960 }
@@ -63454,9 +62964,9 @@ class Spec {
6345462964 /**
6345562965 * A list of views that should be concatenated and put into a row.
6345662966 *
63457- * @return ?array
62967+ * @return array
6345862968 */
63459- public static function sampleHconcat(): ?array {
62969+ public static function sampleHconcat(): array {
6346062970 return array(
6346162971 Spec::sample() /*48:*/
6346262972 ); /* 48:hconcat*/
@@ -64774,14 +64284,14 @@ class LayerSpec {
6477464284 private ?Data $data; // json:data Optional
6477564285 private ?string $description; // json:description Optional
6477664286 private ?float $height; // json:height Optional
64777- private ?array $layer; // json:layer Optional
64287+ private array $layer; // json:layer Required
6477864288 private ?string $name; // json:name Optional
6477964289 private ?Resolve $resolve; // json:resolve Optional
6478064290 private TitleParams|string|null $title; // json:title Optional
6478164291 private ?array $transform; // json:transform Optional
6478264292 private ?float $width; // json:width Optional
64783- private ?Encoding $encoding; // json:encoding Optional
64784- private MarkDef|Mark|null $mark; // json:mark Optional
64293+ private Encoding $encoding; // json:encoding Required
64294+ private MarkDef|Mark $mark; // json:mark Required
6478564295 private ?Projection $projection; // json:projection Optional
6478664296 private ?stdClass $selection; // json:selection Optional
6478764297
@@ -64789,18 +64299,18 @@ class LayerSpec {
6478964299 * @param Data|null $data
6479064300 * @param string|null $description
6479164301 * @param float|null $height
64792- * @param array|null $layer
64302+ * @param array $layer
6479364303 * @param string|null $name
6479464304 * @param Resolve|null $resolve
6479564305 * @param TitleParams|string|null $title
6479664306 * @param array|null $transform
6479764307 * @param float|null $width
64798- * @param Encoding|null $encoding
64799- * @param MarkDef|Mark|null $mark
64308+ * @param Encoding $encoding
64309+ * @param MarkDef|Mark $mark
6480064310 * @param Projection|null $projection
6480164311 * @param stdClass|null $selection
6480264312 */
64803- public function __construct(?Data $data, ?string $description, ?float $height, ?array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, ?Encoding $encoding, MarkDef|Mark|null $mark, ?Projection $projection, ?stdClass $selection) {
64313+ public function __construct(?Data $data, ?string $description, ?float $height, array $layer, ?string $name, ?Resolve $resolve, TitleParams|string|null $title, ?array $transform, ?float $width, Encoding $encoding, MarkDef|Mark $mark, ?Projection $projection, ?stdClass $selection) {
6480464314 $this->data = $data;
6480564315 $this->description = $description;
6480664316 $this->height = $height;
@@ -65104,18 +64614,14 @@ class LayerSpec {
6510464614 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
6510564615 * layering facet specifications is not allowed.
6510664616 *
65107- * @param ?array $value
64617+ * @param array $value
6510864618 * @throws Exception
65109- * @return ?array
64619+ * @return array
6511064620 */
65111- public static function fromLayer(?array $value): ?array {
65112- if (!is_null($value)) {
65113- return array_map(function ($value) {
65114- return LayerSpec::from($value); /*class*/
65115- }, $value);
65116- } else {
65117- return null;
65118- }
64621+ public static function fromLayer(array $value): array {
64622+ return array_map(function ($value) {
64623+ return LayerSpec::from($value); /*class*/
64624+ }, $value);
6511964625 }
6512064626
6512164627 /**
@@ -65125,17 +64631,13 @@ class LayerSpec {
6512564631 * layering facet specifications is not allowed.
6512664632 *
6512764633 * @throws Exception
65128- * @return ?array
64634+ * @return array
6512964635 */
65130- public function toLayer(): ?array {
64636+ public function toLayer(): array {
6513164637 if (LayerSpec::validateLayer($this->layer)) {
65132- if (!is_null($this->layer)) {
65133- return array_map(function ($value) {
65134- return $value->to(); /*class*/
65135- }, $this->layer);
65136- } else {
65137- return null;
65138- }
64638+ return array_map(function ($value) {
64639+ return $value->to(); /*class*/
64640+ }, $this->layer);
6513964641 }
6514064642 throw new Exception('never get to this LayerSpec::layer');
6514164643 }
@@ -65146,19 +64648,17 @@ class LayerSpec {
6514664648 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
6514764649 * layering facet specifications is not allowed.
6514864650 *
65149- * @param array|null
64651+ * @param array
6515064652 * @return bool
6515164653 * @throws Exception
6515264654 */
65153- public static function validateLayer(?array $value): bool {
65154- if (!is_null($value)) {
65155- if (!is_array($value)) {
65156- throw new Exception("Attribute Error:LayerSpec::layer");
65157- }
65158- array_walk($value, function($value_v) {
65159- $value_v->validate();
65160- });
64655+ public static function validateLayer(array $value): bool {
64656+ if (!is_array($value)) {
64657+ throw new Exception("Attribute Error:LayerSpec::layer");
6516164658 }
64659+ array_walk($value, function($value_v) {
64660+ $value_v->validate();
64661+ });
6516264662 return true;
6516364663 }
6516464664
@@ -65169,9 +64669,9 @@ class LayerSpec {
6516964669 * layering facet specifications is not allowed.
6517064670 *
6517164671 * @throws Exception
65172- * @return ?array
64672+ * @return array
6517364673 */
65174- public function getLayer(): ?array {
64674+ public function getLayer(): array {
6517564675 if (LayerSpec::validateLayer($this->layer)) {
6517664676 return $this->layer;
6517764677 }
@@ -65184,9 +64684,9 @@ class LayerSpec {
6518464684 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
6518564685 * layering facet specifications is not allowed.
6518664686 *
65187- * @return ?array
64687+ * @return array
6518864688 */
65189- public static function sampleLayer(): ?array {
64689+ public static function sampleLayer(): array {
6519064690 return array(
6519164691 LayerSpec::sample() /*34:*/
6519264692 ); /* 34:layer*/
@@ -65657,31 +65157,23 @@ class LayerSpec {
6565765157 /**
6565865158 * A key-value mapping between encoding channels and definition of fields.
6565965159 *
65660- * @param ?stdClass $value
65160+ * @param stdClass $value
6566165161 * @throws Exception
65662- * @return ?Encoding
65162+ * @return Encoding
6566365163 */
65664- public static function fromEncoding(?stdClass $value): ?Encoding {
65665- if (!is_null($value)) {
65666- return Encoding::from($value); /*class*/
65667- } else {
65668- return null;
65669- }
65164+ public static function fromEncoding(stdClass $value): Encoding {
65165+ return Encoding::from($value); /*class*/
6567065166 }
6567165167
6567265168 /**
6567365169 * A key-value mapping between encoding channels and definition of fields.
6567465170 *
6567565171 * @throws Exception
65676- * @return ?stdClass
65172+ * @return stdClass
6567765173 */
65678- public function toEncoding(): ?stdClass {
65174+ public function toEncoding(): stdClass {
6567965175 if (LayerSpec::validateEncoding($this->encoding)) {
65680- if (!is_null($this->encoding)) {
65681- return $this->encoding->to(); /*class*/
65682- } else {
65683- return null;
65684- }
65176+ return $this->encoding->to(); /*class*/
6568565177 }
6568665178 throw new Exception('never get to this LayerSpec::encoding');
6568765179 }
@@ -65689,14 +65181,12 @@ class LayerSpec {
6568965181 /**
6569065182 * A key-value mapping between encoding channels and definition of fields.
6569165183 *
65692- * @param Encoding|null
65184+ * @param Encoding
6569365185 * @return bool
6569465186 * @throws Exception
6569565187 */
65696- public static function validateEncoding(?Encoding $value): bool {
65697- if (!is_null($value)) {
65698- $value->validate();
65699- }
65188+ public static function validateEncoding(Encoding $value): bool {
65189+ $value->validate();
6570065190 return true;
6570165191 }
6570265192
@@ -65704,9 +65194,9 @@ class LayerSpec {
6570465194 * A key-value mapping between encoding channels and definition of fields.
6570565195 *
6570665196 * @throws Exception
65707- * @return ?Encoding
65197+ * @return Encoding
6570865198 */
65709- public function getEncoding(): ?Encoding {
65199+ public function getEncoding(): Encoding {
6571065200 if (LayerSpec::validateEncoding($this->encoding)) {
6571165201 return $this->encoding;
6571265202 }
@@ -65716,9 +65206,9 @@ class LayerSpec {
6571665206 /**
6571765207 * A key-value mapping between encoding channels and definition of fields.
6571865208 *
65719- * @return ?Encoding
65209+ * @return Encoding
6572065210 */
65721- public static function sampleEncoding(): ?Encoding {
65211+ public static function sampleEncoding(): Encoding {
6572265212 return Encoding::sample(); /*40:encoding*/
6572365213 }
6572465214
@@ -65728,14 +65218,12 @@ class LayerSpec {
6572865218 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
6572965219 * object](mark.html#mark-def).
6573065220 *
65731- * @param stdClass|string|null $value
65221+ * @param stdClass|string $value
6573265222 * @throws Exception
65733- * @return MarkDef|Mark|null
65223+ * @return MarkDef|Mark
6573465224 */
65735- public static function fromMark(stdClass|string|null $value): MarkDef|Mark|null {
65736- if (is_null($value)) {
65737- return $value; /*null*/
65738- } elseif (is_object($value)) {
65225+ public static function fromMark(stdClass|string $value): MarkDef|Mark {
65226+ if (is_object($value)) {
6573965227 return MarkDef::from($value); /*class*/
6574065228 } elseif (is_string($value) && in_array($value, ['area', 'bar', 'line', 'point', 'text', 'tick', 'rect', 'rule', 'circle', 'square', 'geoshape'], true)) {
6574165229 return Mark::from($value); /*enum*/
@@ -65751,13 +65239,11 @@ class LayerSpec {
6575165239 * object](mark.html#mark-def).
6575265240 *
6575365241 * @throws Exception
65754- * @return stdClass|string|null
65242+ * @return stdClass|string
6575565243 */
65756- public function toMark(): stdClass|string|null {
65244+ public function toMark(): stdClass|string {
6575765245 if (LayerSpec::validateMark($this->mark)) {
65758- if (is_null($this->mark)) {
65759- return $this->mark; /*null*/
65760- } elseif ($this->mark instanceof MarkDef) {
65246+ if ($this->mark instanceof MarkDef) {
6576165247 return $this->mark->to(); /*class*/
6576265248 } elseif ($this->mark instanceof Mark) {
6576365249 return Mark::to($this->mark); /*enum*/
@@ -65774,16 +65260,12 @@ class LayerSpec {
6577465260 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
6577565261 * object](mark.html#mark-def).
6577665262 *
65777- * @param MarkDef|Mark|null
65263+ * @param MarkDef|Mark
6577865264 * @return bool
6577965265 * @throws Exception
6578065266 */
65781- public static function validateMark(MarkDef|Mark|null $value): bool {
65782- if (is_null($value)) {
65783- if (!is_null($value)) {
65784- throw new Exception("Attribute Error:LayerSpec::mark");
65785- }
65786- } elseif ($value instanceof MarkDef) {
65267+ public static function validateMark(MarkDef|Mark $value): bool {
65268+ if ($value instanceof MarkDef) {
6578765269 $value->validate();
6578865270 } elseif ($value instanceof Mark) {
6578965271 Mark::to($value);
@@ -65800,9 +65282,9 @@ class LayerSpec {
6580065282 * object](mark.html#mark-def).
6580165283 *
6580265284 * @throws Exception
65803- * @return MarkDef|Mark|null
65285+ * @return MarkDef|Mark
6580465286 */
65805- public function getMark(): MarkDef|Mark|null {
65287+ public function getMark(): MarkDef|Mark {
6580665288 if (LayerSpec::validateMark($this->mark)) {
6580765289 return $this->mark;
6580865290 }
@@ -65815,9 +65297,9 @@ class LayerSpec {
6581565297 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
6581665298 * object](mark.html#mark-def).
6581765299 *
65818- * @return MarkDef|Mark|null
65300+ * @return MarkDef|Mark
6581965301 */
65820- public static function sampleMark(): MarkDef|Mark|null {
65302+ public static function sampleMark(): MarkDef|Mark {
6582165303 return MarkDef::sample(); /*41:mark*/
6582265304 }
6582365305
@@ -73349,32 +72831,32 @@ class TitleParams {
7334972831 // This is an autogenerated file:Transform
7335072832
7335172833 class Transform {
73352- private Predicate|string|null $filter; // json:filter Optional
72834+ private Predicate|string $filter; // json:filter Required
7335372835 private array|string|null $as; // json:as Optional
73354- private ?string $calculate; // json:calculate Optional
72836+ private string $calculate; // json:calculate Required
7335572837 private ?string $default; // json:default Optional
73356- private ?LookupData $from; // json:from Optional
73357- private ?string $lookup; // json:lookup Optional
73358- private BinParams|bool|null $bin; // json:bin Optional
73359- private ?string $field; // json:field Optional
73360- private ?TimeUnit $timeUnit; // json:timeUnit Optional
73361- private ?array $aggregate; // json:aggregate Optional
72838+ private LookupData $from; // json:from Required
72839+ private string $lookup; // json:lookup Required
72840+ private BinParams|bool $bin; // json:bin Required
72841+ private string $field; // json:field Required
72842+ private TimeUnit $timeUnit; // json:timeUnit Required
72843+ private array $aggregate; // json:aggregate Required
7336272844 private ?array $groupby; // json:groupby Optional
7336372845
7336472846 /**
73365- * @param Predicate|string|null $filter
72847+ * @param Predicate|string $filter
7336672848 * @param array|string|null $as
73367- * @param string|null $calculate
72849+ * @param string $calculate
7336872850 * @param string|null $default
73369- * @param LookupData|null $from
73370- * @param string|null $lookup
73371- * @param BinParams|bool|null $bin
73372- * @param string|null $field
73373- * @param TimeUnit|null $timeUnit
73374- * @param array|null $aggregate
72851+ * @param LookupData $from
72852+ * @param string $lookup
72853+ * @param BinParams|bool $bin
72854+ * @param string $field
72855+ * @param TimeUnit $timeUnit
72856+ * @param array $aggregate
7337572857 * @param array|null $groupby
7337672858 */
73377- public function __construct(Predicate|string|null $filter, array|string|null $as, ?string $calculate, ?string $default, ?LookupData $from, ?string $lookup, BinParams|bool|null $bin, ?string $field, ?TimeUnit $timeUnit, ?array $aggregate, ?array $groupby) {
72859+ public function __construct(Predicate|string $filter, array|string|null $as, string $calculate, ?string $default, LookupData $from, string $lookup, BinParams|bool $bin, string $field, TimeUnit $timeUnit, array $aggregate, ?array $groupby) {
7337872860 $this->filter = $filter;
7337972861 $this->as = $as;
7338072862 $this->calculate = $calculate;
@@ -73398,14 +72880,12 @@ class Transform {
7339872880 * (3) a [selection predicate](filter.html#selection-predicate);
7339972881 * or (4) a logical operand that combines (1), (2), or (3).
7340072882 *
73401- * @param stdClass|string|null $value
72883+ * @param stdClass|string $value
7340272884 * @throws Exception
73403- * @return Predicate|string|null
72885+ * @return Predicate|string
7340472886 */
73405- public static function fromFilter(stdClass|string|null $value): Predicate|string|null {
73406- if (is_null($value)) {
73407- return $value; /*null*/
73408- } elseif (is_object($value)) {
72887+ public static function fromFilter(stdClass|string $value): Predicate|string {
72888+ if (is_object($value)) {
7340972889 return Predicate::from($value); /*class*/
7341072890 } elseif (is_string($value)) {
7341172891 return $value; /*string*/
@@ -73425,13 +72905,11 @@ class Transform {
7342572905 * or (4) a logical operand that combines (1), (2), or (3).
7342672906 *
7342772907 * @throws Exception
73428- * @return stdClass|string|null
72908+ * @return stdClass|string
7342972909 */
73430- public function toFilter(): stdClass|string|null {
72910+ public function toFilter(): stdClass|string {
7343172911 if (Transform::validateFilter($this->filter)) {
73432- if (is_null($this->filter)) {
73433- return $this->filter; /*null*/
73434- } elseif ($this->filter instanceof Predicate) {
72912+ if ($this->filter instanceof Predicate) {
7343572913 return $this->filter->to(); /*class*/
7343672914 } elseif (is_string($this->filter)) {
7343772915 return $this->filter; /*string*/
@@ -73452,16 +72930,12 @@ class Transform {
7345272930 * (3) a [selection predicate](filter.html#selection-predicate);
7345372931 * or (4) a logical operand that combines (1), (2), or (3).
7345472932 *
73455- * @param Predicate|string|null
72933+ * @param Predicate|string
7345672934 * @return bool
7345772935 * @throws Exception
7345872936 */
73459- public static function validateFilter(Predicate|string|null $value): bool {
73460- if (is_null($value)) {
73461- if (!is_null($value)) {
73462- throw new Exception("Attribute Error:Transform::filter");
73463- }
73464- } elseif ($value instanceof Predicate) {
72937+ public static function validateFilter(Predicate|string $value): bool {
72938+ if ($value instanceof Predicate) {
7346572939 $value->validate();
7346672940 } elseif (is_string($value)) {
7346772941 if (!is_string($value)) {
@@ -73484,9 +72958,9 @@ class Transform {
7348472958 * or (4) a logical operand that combines (1), (2), or (3).
7348572959 *
7348672960 * @throws Exception
73487- * @return Predicate|string|null
72961+ * @return Predicate|string
7348872962 */
73489- public function getFilter(): Predicate|string|null {
72963+ public function getFilter(): Predicate|string {
7349072964 if (Transform::validateFilter($this->filter)) {
7349172965 return $this->filter;
7349272966 }
@@ -73503,9 +72977,9 @@ class Transform {
7350372977 * (3) a [selection predicate](filter.html#selection-predicate);
7350472978 * or (4) a logical operand that combines (1), (2), or (3).
7350572979 *
73506- * @return Predicate|string|null
72980+ * @return Predicate|string
7350772981 */
73508- public static function sampleFilter(): Predicate|string|null {
72982+ public static function sampleFilter(): Predicate|string {
7350972983 return Predicate::sample(); /*31:filter*/
7351072984 }
7351172985
@@ -73657,16 +73131,12 @@ class Transform {
7365773131 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
7365873132 * current data object.
7365973133 *
73660- * @param ?string $value
73134+ * @param string $value
7366173135 * @throws Exception
73662- * @return ?string
73136+ * @return string
7366373137 */
73664- public static function fromCalculate(?string $value): ?string {
73665- if (!is_null($value)) {
73666- return $value; /*string*/
73667- } else {
73668- return null;
73669- }
73138+ public static function fromCalculate(string $value): string {
73139+ return $value; /*string*/
7367073140 }
7367173141
7367273142 /**
@@ -73674,15 +73144,11 @@ class Transform {
7367473144 * current data object.
7367573145 *
7367673146 * @throws Exception
73677- * @return ?string
73147+ * @return string
7367873148 */
73679- public function toCalculate(): ?string {
73149+ public function toCalculate(): string {
7368073150 if (Transform::validateCalculate($this->calculate)) {
73681- if (!is_null($this->calculate)) {
73682- return $this->calculate; /*string*/
73683- } else {
73684- return null;
73685- }
73151+ return $this->calculate; /*string*/
7368673152 }
7368773153 throw new Exception('never get to this Transform::calculate');
7368873154 }
@@ -73691,13 +73157,11 @@ class Transform {
7369173157 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
7369273158 * current data object.
7369373159 *
73694- * @param string|null
73160+ * @param string
7369573161 * @return bool
7369673162 * @throws Exception
7369773163 */
73698- public static function validateCalculate(?string $value): bool {
73699- if (!is_null($value)) {
73700- }
73164+ public static function validateCalculate(string $value): bool {
7370173165 return true;
7370273166 }
7370373167
@@ -73706,9 +73170,9 @@ class Transform {
7370673170 * current data object.
7370773171 *
7370873172 * @throws Exception
73709- * @return ?string
73173+ * @return string
7371073174 */
73711- public function getCalculate(): ?string {
73175+ public function getCalculate(): string {
7371273176 if (Transform::validateCalculate($this->calculate)) {
7371373177 return $this->calculate;
7371473178 }
@@ -73719,9 +73183,9 @@ class Transform {
7371973183 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
7372073184 * current data object.
7372173185 *
73722- * @return ?string
73186+ * @return string
7372373187 */
73724- public static function sampleCalculate(): ?string {
73188+ public static function sampleCalculate(): string {
7372573189 return 'Transform::calculate::33'; /*33:calculate*/
7372673190 }
7372773191
@@ -73805,31 +73269,23 @@ class Transform {
7380573269 /**
7380673270 * Secondary data reference.
7380773271 *
73808- * @param ?stdClass $value
73272+ * @param stdClass $value
7380973273 * @throws Exception
73810- * @return ?LookupData
73274+ * @return LookupData
7381173275 */
73812- public static function fromFrom(?stdClass $value): ?LookupData {
73813- if (!is_null($value)) {
73814- return LookupData::from($value); /*class*/
73815- } else {
73816- return null;
73817- }
73276+ public static function fromFrom(stdClass $value): LookupData {
73277+ return LookupData::from($value); /*class*/
7381873278 }
7381973279
7382073280 /**
7382173281 * Secondary data reference.
7382273282 *
7382373283 * @throws Exception
73824- * @return ?stdClass
73284+ * @return stdClass
7382573285 */
73826- public function toFrom(): ?stdClass {
73286+ public function toFrom(): stdClass {
7382773287 if (Transform::validateFrom($this->from)) {
73828- if (!is_null($this->from)) {
73829- return $this->from->to(); /*class*/
73830- } else {
73831- return null;
73832- }
73288+ return $this->from->to(); /*class*/
7383373289 }
7383473290 throw new Exception('never get to this Transform::from');
7383573291 }
@@ -73837,14 +73293,12 @@ class Transform {
7383773293 /**
7383873294 * Secondary data reference.
7383973295 *
73840- * @param LookupData|null
73296+ * @param LookupData
7384173297 * @return bool
7384273298 * @throws Exception
7384373299 */
73844- public static function validateFrom(?LookupData $value): bool {
73845- if (!is_null($value)) {
73846- $value->validate();
73847- }
73300+ public static function validateFrom(LookupData $value): bool {
73301+ $value->validate();
7384873302 return true;
7384973303 }
7385073304
@@ -73852,9 +73306,9 @@ class Transform {
7385273306 * Secondary data reference.
7385373307 *
7385473308 * @throws Exception
73855- * @return ?LookupData
73309+ * @return LookupData
7385673310 */
73857- public function getFrom(): ?LookupData {
73311+ public function getFrom(): LookupData {
7385873312 if (Transform::validateFrom($this->from)) {
7385973313 return $this->from;
7386073314 }
@@ -73864,40 +73318,32 @@ class Transform {
7386473318 /**
7386573319 * Secondary data reference.
7386673320 *
73867- * @return ?LookupData
73321+ * @return LookupData
7386873322 */
73869- public static function sampleFrom(): ?LookupData {
73323+ public static function sampleFrom(): LookupData {
7387073324 return LookupData::sample(); /*35:from*/
7387173325 }
7387273326
7387373327 /**
7387473328 * Key in primary data source.
7387573329 *
73876- * @param ?string $value
73330+ * @param string $value
7387773331 * @throws Exception
73878- * @return ?string
73332+ * @return string
7387973333 */
73880- public static function fromLookup(?string $value): ?string {
73881- if (!is_null($value)) {
73882- return $value; /*string*/
73883- } else {
73884- return null;
73885- }
73334+ public static function fromLookup(string $value): string {
73335+ return $value; /*string*/
7388673336 }
7388773337
7388873338 /**
7388973339 * Key in primary data source.
7389073340 *
7389173341 * @throws Exception
73892- * @return ?string
73342+ * @return string
7389373343 */
73894- public function toLookup(): ?string {
73344+ public function toLookup(): string {
7389573345 if (Transform::validateLookup($this->lookup)) {
73896- if (!is_null($this->lookup)) {
73897- return $this->lookup; /*string*/
73898- } else {
73899- return null;
73900- }
73346+ return $this->lookup; /*string*/
7390173347 }
7390273348 throw new Exception('never get to this Transform::lookup');
7390373349 }
@@ -73905,13 +73351,11 @@ class Transform {
7390573351 /**
7390673352 * Key in primary data source.
7390773353 *
73908- * @param string|null
73354+ * @param string
7390973355 * @return bool
7391073356 * @throws Exception
7391173357 */
73912- public static function validateLookup(?string $value): bool {
73913- if (!is_null($value)) {
73914- }
73358+ public static function validateLookup(string $value): bool {
7391573359 return true;
7391673360 }
7391773361
@@ -73919,9 +73363,9 @@ class Transform {
7391973363 * Key in primary data source.
7392073364 *
7392173365 * @throws Exception
73922- * @return ?string
73366+ * @return string
7392373367 */
73924- public function getLookup(): ?string {
73368+ public function getLookup(): string {
7392573369 if (Transform::validateLookup($this->lookup)) {
7392673370 return $this->lookup;
7392773371 }
@@ -73931,23 +73375,21 @@ class Transform {
7393173375 /**
7393273376 * Key in primary data source.
7393373377 *
73934- * @return ?string
73378+ * @return string
7393573379 */
73936- public static function sampleLookup(): ?string {
73380+ public static function sampleLookup(): string {
7393773381 return 'Transform::lookup::36'; /*36:lookup*/
7393873382 }
7393973383
7394073384 /**
7394173385 * An object indicating bin properties, or simply `true` for using default bin parameters.
7394273386 *
73943- * @param stdClass|bool|null $value
73387+ * @param stdClass|bool $value
7394473388 * @throws Exception
73945- * @return BinParams|bool|null
73389+ * @return BinParams|bool
7394673390 */
73947- public static function fromBin(stdClass|bool|null $value): BinParams|bool|null {
73948- if (is_null($value)) {
73949- return $value; /*null*/
73950- } elseif (is_object($value)) {
73391+ public static function fromBin(stdClass|bool $value): BinParams|bool {
73392+ if (is_object($value)) {
7395173393 return BinParams::from($value); /*class*/
7395273394 } elseif (is_bool($value)) {
7395373395 return $value; /*bool*/
@@ -73960,13 +73402,11 @@ class Transform {
7396073402 * An object indicating bin properties, or simply `true` for using default bin parameters.
7396173403 *
7396273404 * @throws Exception
73963- * @return stdClass|bool|null
73405+ * @return stdClass|bool
7396473406 */
73965- public function toBin(): stdClass|bool|null {
73407+ public function toBin(): stdClass|bool {
7396673408 if (Transform::validateBin($this->bin)) {
73967- if (is_null($this->bin)) {
73968- return $this->bin; /*null*/
73969- } elseif ($this->bin instanceof BinParams) {
73409+ if ($this->bin instanceof BinParams) {
7397073410 return $this->bin->to(); /*class*/
7397173411 } elseif (is_bool($this->bin)) {
7397273412 return $this->bin; /*bool*/
@@ -73980,16 +73420,12 @@ class Transform {
7398073420 /**
7398173421 * An object indicating bin properties, or simply `true` for using default bin parameters.
7398273422 *
73983- * @param BinParams|bool|null
73423+ * @param BinParams|bool
7398473424 * @return bool
7398573425 * @throws Exception
7398673426 */
73987- public static function validateBin(BinParams|bool|null $value): bool {
73988- if (is_null($value)) {
73989- if (!is_null($value)) {
73990- throw new Exception("Attribute Error:Transform::bin");
73991- }
73992- } elseif ($value instanceof BinParams) {
73427+ public static function validateBin(BinParams|bool $value): bool {
73428+ if ($value instanceof BinParams) {
7399373429 $value->validate();
7399473430 } elseif (is_bool($value)) {
7399573431 if (!is_bool($value)) {
@@ -74005,9 +73441,9 @@ class Transform {
7400573441 * An object indicating bin properties, or simply `true` for using default bin parameters.
7400673442 *
7400773443 * @throws Exception
74008- * @return BinParams|bool|null
73444+ * @return BinParams|bool
7400973445 */
74010- public function getBin(): BinParams|bool|null {
73446+ public function getBin(): BinParams|bool {
7401173447 if (Transform::validateBin($this->bin)) {
7401273448 return $this->bin;
7401373449 }
@@ -74017,9 +73453,9 @@ class Transform {
7401773453 /**
7401873454 * An object indicating bin properties, or simply `true` for using default bin parameters.
7401973455 *
74020- * @return BinParams|bool|null
73456+ * @return BinParams|bool
7402173457 */
74022- public static function sampleBin(): BinParams|bool|null {
73458+ public static function sampleBin(): BinParams|bool {
7402373459 return BinParams::sample(); /*37:bin*/
7402473460 }
7402573461
@@ -74028,16 +73464,12 @@ class Transform {
7402873464 *
7402973465 * The data field to apply time unit.
7403073466 *
74031- * @param ?string $value
73467+ * @param string $value
7403273468 * @throws Exception
74033- * @return ?string
73469+ * @return string
7403473470 */
74035- public static function fromField(?string $value): ?string {
74036- if (!is_null($value)) {
74037- return $value; /*string*/
74038- } else {
74039- return null;
74040- }
73471+ public static function fromField(string $value): string {
73472+ return $value; /*string*/
7404173473 }
7404273474
7404373475 /**
@@ -74046,15 +73478,11 @@ class Transform {
7404673478 * The data field to apply time unit.
7404773479 *
7404873480 * @throws Exception
74049- * @return ?string
73481+ * @return string
7405073482 */
74051- public function toField(): ?string {
73483+ public function toField(): string {
7405273484 if (Transform::validateField($this->field)) {
74053- if (!is_null($this->field)) {
74054- return $this->field; /*string*/
74055- } else {
74056- return null;
74057- }
73485+ return $this->field; /*string*/
7405873486 }
7405973487 throw new Exception('never get to this Transform::field');
7406073488 }
@@ -74064,13 +73492,11 @@ class Transform {
7406473492 *
7406573493 * The data field to apply time unit.
7406673494 *
74067- * @param string|null
73495+ * @param string
7406873496 * @return bool
7406973497 * @throws Exception
7407073498 */
74071- public static function validateField(?string $value): bool {
74072- if (!is_null($value)) {
74073- }
73499+ public static function validateField(string $value): bool {
7407473500 return true;
7407573501 }
7407673502
@@ -74080,9 +73506,9 @@ class Transform {
7408073506 * The data field to apply time unit.
7408173507 *
7408273508 * @throws Exception
74083- * @return ?string
73509+ * @return string
7408473510 */
74085- public function getField(): ?string {
73511+ public function getField(): string {
7408673512 if (Transform::validateField($this->field)) {
7408773513 return $this->field;
7408873514 }
@@ -74094,40 +73520,32 @@ class Transform {
7409473520 *
7409573521 * The data field to apply time unit.
7409673522 *
74097- * @return ?string
73523+ * @return string
7409873524 */
74099- public static function sampleField(): ?string {
73525+ public static function sampleField(): string {
7410073526 return 'Transform::field::38'; /*38:field*/
7410173527 }
7410273528
7410373529 /**
7410473530 * The timeUnit.
7410573531 *
74106- * @param ?string $value
73532+ * @param string $value
7410773533 * @throws Exception
74108- * @return ?TimeUnit
73534+ * @return TimeUnit
7410973535 */
74110- public static function fromTimeUnit(?string $value): ?TimeUnit {
74111- if (!is_null($value)) {
74112- return TimeUnit::from($value); /*enum*/
74113- } else {
74114- return null;
74115- }
73536+ public static function fromTimeUnit(string $value): TimeUnit {
73537+ return TimeUnit::from($value); /*enum*/
7411673538 }
7411773539
7411873540 /**
7411973541 * The timeUnit.
7412073542 *
7412173543 * @throws Exception
74122- * @return ?string
73544+ * @return string
7412373545 */
74124- public function toTimeUnit(): ?string {
73546+ public function toTimeUnit(): string {
7412573547 if (Transform::validateTimeUnit($this->timeUnit)) {
74126- if (!is_null($this->timeUnit)) {
74127- return TimeUnit::to($this->timeUnit); /*enum*/
74128- } else {
74129- return null;
74130- }
73548+ return TimeUnit::to($this->timeUnit); /*enum*/
7413173549 }
7413273550 throw new Exception('never get to this Transform::timeUnit');
7413373551 }
@@ -74135,14 +73553,12 @@ class Transform {
7413573553 /**
7413673554 * The timeUnit.
7413773555 *
74138- * @param TimeUnit|null
73556+ * @param TimeUnit
7413973557 * @return bool
7414073558 * @throws Exception
7414173559 */
74142- public static function validateTimeUnit(?TimeUnit $value): bool {
74143- if (!is_null($value)) {
74144- TimeUnit::to($value);
74145- }
73560+ public static function validateTimeUnit(TimeUnit $value): bool {
73561+ TimeUnit::to($value);
7414673562 return true;
7414773563 }
7414873564
@@ -74150,9 +73566,9 @@ class Transform {
7415073566 * The timeUnit.
7415173567 *
7415273568 * @throws Exception
74153- * @return ?TimeUnit
73569+ * @return TimeUnit
7415473570 */
74155- public function getTimeUnit(): ?TimeUnit {
73571+ public function getTimeUnit(): TimeUnit {
7415673572 if (Transform::validateTimeUnit($this->timeUnit)) {
7415773573 return $this->timeUnit;
7415873574 }
@@ -74162,44 +73578,36 @@ class Transform {
7416273578 /**
7416373579 * The timeUnit.
7416473580 *
74165- * @return ?TimeUnit
73581+ * @return TimeUnit
7416673582 */
74167- public static function sampleTimeUnit(): ?TimeUnit {
73583+ public static function sampleTimeUnit(): TimeUnit {
7416873584 return TimeUnit::sample(); /*enum*/
7416973585 }
7417073586
7417173587 /**
7417273588 * Array of objects that define fields to aggregate.
7417373589 *
74174- * @param ?array $value
73590+ * @param array $value
7417573591 * @throws Exception
74176- * @return ?array
73592+ * @return array
7417773593 */
74178- public static function fromAggregate(?array $value): ?array {
74179- if (!is_null($value)) {
74180- return array_map(function ($value) {
74181- return AggregatedFieldDef::from($value); /*class*/
74182- }, $value);
74183- } else {
74184- return null;
74185- }
73594+ public static function fromAggregate(array $value): array {
73595+ return array_map(function ($value) {
73596+ return AggregatedFieldDef::from($value); /*class*/
73597+ }, $value);
7418673598 }
7418773599
7418873600 /**
7418973601 * Array of objects that define fields to aggregate.
7419073602 *
7419173603 * @throws Exception
74192- * @return ?array
73604+ * @return array
7419373605 */
74194- public function toAggregate(): ?array {
73606+ public function toAggregate(): array {
7419573607 if (Transform::validateAggregate($this->aggregate)) {
74196- if (!is_null($this->aggregate)) {
74197- return array_map(function ($value) {
74198- return $value->to(); /*class*/
74199- }, $this->aggregate);
74200- } else {
74201- return null;
74202- }
73608+ return array_map(function ($value) {
73609+ return $value->to(); /*class*/
73610+ }, $this->aggregate);
7420373611 }
7420473612 throw new Exception('never get to this Transform::aggregate');
7420573613 }
@@ -74207,19 +73615,17 @@ class Transform {
7420773615 /**
7420873616 * Array of objects that define fields to aggregate.
7420973617 *
74210- * @param array|null
73618+ * @param array
7421173619 * @return bool
7421273620 * @throws Exception
7421373621 */
74214- public static function validateAggregate(?array $value): bool {
74215- if (!is_null($value)) {
74216- if (!is_array($value)) {
74217- throw new Exception("Attribute Error:Transform::aggregate");
74218- }
74219- array_walk($value, function($value_v) {
74220- $value_v->validate();
74221- });
73622+ public static function validateAggregate(array $value): bool {
73623+ if (!is_array($value)) {
73624+ throw new Exception("Attribute Error:Transform::aggregate");
7422273625 }
73626+ array_walk($value, function($value_v) {
73627+ $value_v->validate();
73628+ });
7422373629 return true;
7422473630 }
7422573631
@@ -74227,9 +73633,9 @@ class Transform {
7422773633 * Array of objects that define fields to aggregate.
7422873634 *
7422973635 * @throws Exception
74230- * @return ?array
73636+ * @return array
7423173637 */
74232- public function getAggregate(): ?array {
73638+ public function getAggregate(): array {
7423373639 if (Transform::validateAggregate($this->aggregate)) {
7423473640 return $this->aggregate;
7423573641 }
@@ -74239,9 +73645,9 @@ class Transform {
7423973645 /**
7424073646 * Array of objects that define fields to aggregate.
7424173647 *
74242- * @return ?array
73648+ * @return array
7424373649 */
74244- public static function sampleAggregate(): ?array {
73650+ public static function sampleAggregate(): array {
7424573651 return array(
7424673652 AggregatedFieldDef::sample() /*40:*/
7424773653 ); /* 40:aggregate*/
Mschema-pikedefault / TopLevel.pmod+140 −165
@@ -19,7 +19,7 @@ class TopLevel {
1919 Config|mixed config; // json: "config"
2020 Data|mixed data; // json: "data"
2121 mixed|string description; // json: "description"
22- EncodingWithFacet|mixed encoding; // json: "encoding"
22+ EncodingWithFacet encoding; // json: "encoding"
2323 float|mixed height; // json: "height"
2424 AnyMark mark; // json: "mark"
2525 mixed|string name; // json: "name"
@@ -29,13 +29,13 @@ class TopLevel {
2929 Title title; // json: "title"
3030 array(Transform)|mixed transform; // json: "transform"
3131 float|mixed width; // json: "width"
32- array(LayerSpec)|mixed layer; // json: "layer"
32+ array(LayerSpec) layer; // json: "layer"
3333 Resolve|mixed resolve; // json: "resolve"
34- FacetMapping|mixed facet; // json: "facet"
35- Spec|mixed spec; // json: "spec"
36- Repeat|mixed repeat; // json: "repeat"
37- array(Spec)|mixed vconcat; // json: "vconcat"
38- array(Spec)|mixed hconcat; // json: "hconcat"
34+ FacetMapping facet; // json: "facet"
35+ Spec spec; // json: "spec"
36+ Repeat repeat; // json: "repeat"
37+ array(Spec) vconcat; // json: "vconcat"
38+ array(Spec) hconcat; // json: "hconcat"
3939
4040 string encode_json() {
4141 mapping(string:mixed) json = ([
@@ -1225,7 +1225,7 @@ RangeConfigValue RangeConfigValue_from_JSON(mixed json) {
12251225 class VgScheme {
12261226 float|mixed count; // json: "count"
12271227 array(float)|mixed extent; // json: "extent"
1228- mixed|string scheme; // json: "scheme"
1228+ string scheme; // json: "scheme"
12291229 float|mixed step; // json: "step"
12301230
12311231 string encode_json() {
@@ -1597,12 +1597,12 @@ SingleSelectionConfig SingleSelectionConfig_from_JSON(mixed json) {
15971597 }
15981598
15991599 class VgBinding {
1600- mixed|string element; // json: "element"
1601- string input; // json: "input"
1602- array(string)|mixed options; // json: "options"
1603- float|mixed max; // json: "max"
1604- float|mixed min; // json: "min"
1605- float|mixed step; // json: "step"
1600+ mixed|string element; // json: "element"
1601+ string input; // json: "input"
1602+ array(string) options; // json: "options"
1603+ float|mixed max; // json: "max"
1604+ float|mixed min; // json: "min"
1605+ float|mixed step; // json: "step"
16061606
16071607 string encode_json() {
16081608 mapping(string:mixed) json = ([
@@ -2079,9 +2079,9 @@ ViewConfig ViewConfig_from_JSON(mixed json) {
20792079 // Secondary data source to lookup in.
20802080 class Data {
20812081 DataFormat|mixed format; // json: "format"
2082- mixed|string url; // json: "url"
2082+ string url; // json: "url"
20832083 Values values; // json: "values"
2084- mixed|string name; // json: "name"
2084+ string name; // json: "name"
20852085
20862086 string encode_json() {
20872087 mapping(string:mixed) json = ([
@@ -2281,16 +2281,16 @@ EncodingWithFacet EncodingWithFacet_from_JSON(mixed json) {
22812281 // value: ...,
22822282 // }
22832283 class MarkPropDefWithCondition {
2284- AggregateOp|mixed aggregate; // json: "aggregate"
2285- Bin bin; // json: "bin"
2286- ColorCondition condition; // json: "condition"
2287- Field field; // json: "field"
2288- Legend|mixed legend; // json: "legend"
2289- Scale|mixed scale; // json: "scale"
2290- SortUnion sort; // json: "sort"
2291- TimeUnit|mixed time_unit; // json: "timeUnit"
2292- Type|mixed type; // json: "type"
2293- ConditionalPredicateValueDefValue value; // json: "value"
2284+ AggregateOp|mixed aggregate; // json: "aggregate"
2285+ ColorBin bin; // json: "bin"
2286+ ColorCondition condition; // json: "condition"
2287+ Field field; // json: "field"
2288+ Legend|mixed legend; // json: "legend"
2289+ Scale|mixed scale; // json: "scale"
2290+ SortUnion sort; // json: "sort"
2291+ TimeUnit|mixed time_unit; // json: "timeUnit"
2292+ Type type; // json: "type"
2293+ ColorValue value; // json: "value"
22942294
22952295 string encode_json() {
22962296 mapping(string:mixed) json = ([
@@ -2351,9 +2351,9 @@ enum AggregateOp {
23512351 VARIANCEP = "variancep", // json: "variancep"
23522352 }
23532353
2354-typedef BinParams|bool Bin;
2354+typedef BinParams|bool ColorBin;
23552355
2356-Bin Bin_from_JSON(mixed json) {
2356+ColorBin ColorBin_from_JSON(mixed json) {
23572357 return json;
23582358 }
23592359
@@ -2406,9 +2406,9 @@ ColorCondition ColorCondition_from_JSON(mixed json) {
24062406 }
24072407
24082408 class ConditionalValueDef {
2409- ConditionalValueDefLogicalOperandPredicate test; // json: "test"
2410- ConditionalValueDefValue value; // json: "value"
2411- ConditionalValueDefSelectionOperand selection; // json: "selection"
2409+ LogicalOperandPredicate test; // json: "test"
2410+ ConditionalValueDefValue value; // json: "value"
2411+ SelectionOperand selection; // json: "selection"
24122412
24132413 string encode_json() {
24142414 mapping(string:mixed) json = ([
@@ -2431,20 +2431,10 @@ ConditionalValueDef ConditionalValueDef_from_JSON(mixed json) {
24312431 return retval;
24322432 }
24332433
2434-// Filter using a selection name.
2435-//
2436-// A [selection name](selection.html), or a series of [composed
2437-// selections](selection.html#compose).
2438-typedef string|Selection SelectionOperandElement;
2439-
2440-SelectionOperandElement SelectionOperandElement_from_JSON(mixed json) {
2441- return json;
2442-}
2443-
24442434 class Selection {
2445- ConditionalValueDefSelectionOperand not; // json: "not"
2446- array(SelectionOperandElement)|mixed and; // json: "and"
2447- array(SelectionOperandElement)|mixed or; // json: "or"
2435+ SelectionOperand not; // json: "not"
2436+ array(SelectionOperand) and; // json: "and"
2437+ array(SelectionOperand) or; // json: "or"
24482438
24492439 string encode_json() {
24502440 mapping(string:mixed) json = ([
@@ -2471,36 +2461,22 @@ Selection Selection_from_JSON(mixed json) {
24712461 //
24722462 // A [selection name](selection.html), or a series of [composed
24732463 // selections](selection.html#compose).
2474-typedef string|Selection ConditionalValueDefSelectionOperand;
2464+typedef string|Selection SelectionOperand;
24752465
2476-ConditionalValueDefSelectionOperand ConditionalValueDefSelectionOperand_from_JSON(mixed json) {
2477- return json;
2478-}
2479-
2480-// The `filter` property must be one of the predicate definitions:
2481-// (1) an [expression](types.html#expression) string,
2482-// where `datum` can be used to refer to the current data object;
2483-// (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
2484-// [range predicate](filter.html#range-predicate), [one-of
2485-// predicate](filter.html#one-of-predicate);
2486-// (3) a [selection predicate](filter.html#selection-predicate);
2487-// or (4) a logical operand that combines (1), (2), or (3).
2488-typedef Predicate|string LogicalOperandPredicateElement;
2489-
2490-LogicalOperandPredicateElement LogicalOperandPredicateElement_from_JSON(mixed json) {
2466+SelectionOperand SelectionOperand_from_JSON(mixed json) {
24912467 return json;
24922468 }
24932469
24942470 class Predicate {
2495- ConditionalValueDefLogicalOperandPredicate not; // json: "not"
2496- array(LogicalOperandPredicateElement)|mixed and; // json: "and"
2497- array(LogicalOperandPredicateElement)|mixed or; // json: "or"
2498- EqualUnion equal; // json: "equal"
2499- mixed|string field; // json: "field"
2500- TimeUnit|mixed time_unit; // json: "timeUnit"
2501- array(RangeElement)|mixed range; // json: "range"
2502- array(OneOfElement)|mixed one_of; // json: "oneOf"
2503- ConditionalValueDefSelectionOperand selection; // json: "selection"
2471+ LogicalOperandPredicate not; // json: "not"
2472+ array(LogicalOperandPredicate) and; // json: "and"
2473+ array(LogicalOperandPredicate) or; // json: "or"
2474+ Equal equal; // json: "equal"
2475+ string field; // json: "field"
2476+ TimeUnit|mixed time_unit; // json: "timeUnit"
2477+ array(RangeElement) range; // json: "range"
2478+ array(Equal) one_of; // json: "oneOf"
2479+ SelectionOperand selection; // json: "selection"
25042480
25052481 string encode_json() {
25062482 mapping(string:mixed) json = ([
@@ -2543,16 +2519,16 @@ Predicate Predicate_from_JSON(mixed json) {
25432519 // predicate](filter.html#one-of-predicate);
25442520 // (3) a [selection predicate](filter.html#selection-predicate);
25452521 // or (4) a logical operand that combines (1), (2), or (3).
2546-typedef Predicate|string ConditionalValueDefLogicalOperandPredicate;
2522+typedef Predicate|string LogicalOperandPredicate;
25472523
2548-ConditionalValueDefLogicalOperandPredicate ConditionalValueDefLogicalOperandPredicate_from_JSON(mixed json) {
2524+LogicalOperandPredicate LogicalOperandPredicate_from_JSON(mixed json) {
25492525 return json;
25502526 }
25512527
25522528 // The value that the field should be equal to.
2553-typedef bool|DateTime|float|string EqualUnion;
2529+typedef bool|DateTime|float|string Equal;
25542530
2555-EqualUnion EqualUnion_from_JSON(mixed json) {
2531+Equal Equal_from_JSON(mixed json) {
25562532 return json;
25572533 }
25582534
@@ -2627,13 +2603,6 @@ Month Month_from_JSON(mixed json) {
26272603 return json;
26282604 }
26292605
2630-// The value that the field should be equal to.
2631-typedef bool|DateTime|float|string OneOfElement;
2632-
2633-OneOfElement OneOfElement_from_JSON(mixed json) {
2634- return json;
2635-}
2636-
26372606 typedef DateTime|float RangeElement;
26382607
26392608 RangeElement RangeElement_from_JSON(mixed json) {
@@ -2698,17 +2667,17 @@ ConditionalValueDefValue ConditionalValueDefValue_from_JSON(mixed json) {
26982667 }
26992668
27002669 class ConditionalPredicateMarkPropFieldDefClass {
2701- ConditionalValueDefLogicalOperandPredicate test; // json: "test"
2702- ConditionalPredicateValueDefValue value; // json: "value"
2703- ConditionalValueDefSelectionOperand selection; // json: "selection"
2704- AggregateOp|mixed aggregate; // json: "aggregate"
2705- Bin bin; // json: "bin"
2706- Field field; // json: "field"
2707- Legend|mixed legend; // json: "legend"
2708- Scale|mixed scale; // json: "scale"
2709- SortUnion sort; // json: "sort"
2710- TimeUnit|mixed time_unit; // json: "timeUnit"
2711- Type|mixed type; // json: "type"
2670+ LogicalOperandPredicate test; // json: "test"
2671+ ConditionalValueDefValue value; // json: "value"
2672+ SelectionOperand selection; // json: "selection"
2673+ AggregateOp|mixed aggregate; // json: "aggregate"
2674+ ColorBin bin; // json: "bin"
2675+ Field field; // json: "field"
2676+ Legend|mixed legend; // json: "legend"
2677+ Scale|mixed scale; // json: "scale"
2678+ SortUnion sort; // json: "sort"
2679+ TimeUnit|mixed time_unit; // json: "timeUnit"
2680+ Type type; // json: "type"
27122681
27132682 string encode_json() {
27142683 mapping(string:mixed) json = ([
@@ -2921,7 +2890,7 @@ Scale Scale_from_JSON(mixed json) {
29212890 //
29222891 // The `selection` property can be used to [interactively
29232892 // determine](selection.html#scale-domains) the scale domain.
2924-typedef DomainClass|Domain|array(OneOfElement) DomainUnion;
2893+typedef DomainClass|Domain|array(Equal) DomainUnion;
29252894
29262895 DomainUnion DomainUnion_from_JSON(mixed json) {
29272896 return json;
@@ -3195,9 +3164,9 @@ enum Type {
31953164 // `0` to `1` for opacity).
31963165 //
31973166 // A constant value in visual domain.
3198-typedef bool|float|string ConditionalPredicateValueDefValue;
3167+typedef bool|float|string ColorValue;
31993168
3200-ConditionalPredicateValueDefValue ConditionalPredicateValueDefValue_from_JSON(mixed json) {
3169+ColorValue ColorValue_from_JSON(mixed json) {
32013170 return json;
32023171 }
32033172
@@ -3206,7 +3175,7 @@ ConditionalPredicateValueDefValue ConditionalPredicateValueDefValue_from_JSON(mi
32063175 // Vertical facets for trellis plots.
32073176 class FacetFieldDef {
32083177 AggregateOp|mixed aggregate; // json: "aggregate"
3209- Bin bin; // json: "bin"
3178+ ColorBin bin; // json: "bin"
32103179 Field field; // json: "field"
32113180 Header|mixed header; // json: "header"
32123181 SortEnum|mixed sort; // json: "sort"
@@ -3280,7 +3249,7 @@ Detail Detail_from_JSON(mixed json) {
32803249 // Definition object for a data field, its type and transformation of an encoding channel.
32813250 class FieldDef {
32823251 AggregateOp|mixed aggregate; // json: "aggregate"
3283- Bin bin; // json: "bin"
3252+ ColorBin bin; // json: "bin"
32843253 Field field; // json: "field"
32853254 TimeUnit|mixed time_unit; // json: "timeUnit"
32863255 Type type; // json: "type"
@@ -3325,13 +3294,13 @@ FieldDef FieldDef_from_JSON(mixed json) {
33253294 // value: ...,
33263295 // }
33273296 class DefWithCondition {
3328- AggregateOp|mixed aggregate; // json: "aggregate"
3329- Bin bin; // json: "bin"
3330- HrefCondition condition; // json: "condition"
3331- Field field; // json: "field"
3332- TimeUnit|mixed time_unit; // json: "timeUnit"
3333- Type|mixed type; // json: "type"
3334- ConditionalPredicateValueDefValue value; // json: "value"
3297+ AggregateOp|mixed aggregate; // json: "aggregate"
3298+ ColorBin bin; // json: "bin"
3299+ HrefCondition condition; // json: "condition"
3300+ Field field; // json: "field"
3301+ TimeUnit|mixed time_unit; // json: "timeUnit"
3302+ Type type; // json: "type"
3303+ ColorValue value; // json: "value"
33353304
33363305 string encode_json() {
33373306 mapping(string:mixed) json = ([
@@ -3369,14 +3338,14 @@ HrefCondition HrefCondition_from_JSON(mixed json) {
33693338 }
33703339
33713340 class ConditionalPredicateFieldDefClass {
3372- ConditionalValueDefLogicalOperandPredicate test; // json: "test"
3373- ConditionalPredicateValueDefValue value; // json: "value"
3374- ConditionalValueDefSelectionOperand selection; // json: "selection"
3375- AggregateOp|mixed aggregate; // json: "aggregate"
3376- Bin bin; // json: "bin"
3377- Field field; // json: "field"
3378- TimeUnit|mixed time_unit; // json: "timeUnit"
3379- Type|mixed type; // json: "type"
3341+ LogicalOperandPredicate test; // json: "test"
3342+ ConditionalValueDefValue value; // json: "value"
3343+ SelectionOperand selection; // json: "selection"
3344+ AggregateOp|mixed aggregate; // json: "aggregate"
3345+ ColorBin bin; // json: "bin"
3346+ Field field; // json: "field"
3347+ TimeUnit|mixed time_unit; // json: "timeUnit"
3348+ Type type; // json: "type"
33803349
33813350 string encode_json() {
33823351 mapping(string:mixed) json = ([
@@ -3417,7 +3386,7 @@ Order Order_from_JSON(mixed json) {
34173386
34183387 class OrderFieldDef {
34193388 AggregateOp|mixed aggregate; // json: "aggregate"
3420- Bin bin; // json: "bin"
3389+ ColorBin bin; // json: "bin"
34213390 Field field; // json: "field"
34223391 SortEnum|mixed sort; // json: "sort"
34233392 TimeUnit|mixed time_unit; // json: "timeUnit"
@@ -3467,14 +3436,14 @@ OrderFieldDef OrderFieldDef_from_JSON(mixed json) {
34673436 // value: ...,
34683437 // }
34693438 class TextDefWithCondition {
3470- AggregateOp|mixed aggregate; // json: "aggregate"
3471- Bin bin; // json: "bin"
3472- TextCondition condition; // json: "condition"
3473- Field field; // json: "field"
3474- mixed|string format; // json: "format"
3475- TimeUnit|mixed time_unit; // json: "timeUnit"
3476- Type|mixed type; // json: "type"
3477- ConditionalPredicateValueDefValue value; // json: "value"
3439+ AggregateOp|mixed aggregate; // json: "aggregate"
3440+ ColorBin bin; // json: "bin"
3441+ TextCondition condition; // json: "condition"
3442+ Field field; // json: "field"
3443+ mixed|string format; // json: "format"
3444+ TimeUnit|mixed time_unit; // json: "timeUnit"
3445+ Type type; // json: "type"
3446+ ColorValue value; // json: "value"
34783447
34793448 string encode_json() {
34803449 mapping(string:mixed) json = ([
@@ -3514,15 +3483,15 @@ TextCondition TextCondition_from_JSON(mixed json) {
35143483 }
35153484
35163485 class ConditionalPredicateTextFieldDefClass {
3517- ConditionalValueDefLogicalOperandPredicate test; // json: "test"
3518- ConditionalPredicateValueDefValue value; // json: "value"
3519- ConditionalValueDefSelectionOperand selection; // json: "selection"
3520- AggregateOp|mixed aggregate; // json: "aggregate"
3521- Bin bin; // json: "bin"
3522- Field field; // json: "field"
3523- mixed|string format; // json: "format"
3524- TimeUnit|mixed time_unit; // json: "timeUnit"
3525- Type|mixed type; // json: "type"
3486+ LogicalOperandPredicate test; // json: "test"
3487+ ConditionalValueDefValue value; // json: "value"
3488+ SelectionOperand selection; // json: "selection"
3489+ AggregateOp|mixed aggregate; // json: "aggregate"
3490+ ColorBin bin; // json: "bin"
3491+ Field field; // json: "field"
3492+ mixed|string format; // json: "format"
3493+ TimeUnit|mixed time_unit; // json: "timeUnit"
3494+ Type type; // json: "type"
35263495
35273496 string encode_json() {
35283497 mapping(string:mixed) json = ([
@@ -3563,16 +3532,16 @@ ConditionalPredicateTextFieldDefClass ConditionalPredicateTextFieldDefClass_from
35633532 //
35643533 // Definition object for a constant value of an encoding channel.
35653534 class XClass {
3566- AggregateOp|mixed aggregate; // json: "aggregate"
3567- Axis|mixed axis; // json: "axis"
3568- Bin bin; // json: "bin"
3569- Field field; // json: "field"
3570- Scale|mixed scale; // json: "scale"
3571- SortUnion sort; // json: "sort"
3572- StackOffset|mixed stack; // json: "stack"
3573- TimeUnit|mixed time_unit; // json: "timeUnit"
3574- Type|mixed type; // json: "type"
3575- ConditionalPredicateValueDefValue value; // json: "value"
3535+ AggregateOp|mixed aggregate; // json: "aggregate"
3536+ Axis|mixed axis; // json: "axis"
3537+ ColorBin bin; // json: "bin"
3538+ Field field; // json: "field"
3539+ Scale|mixed scale; // json: "scale"
3540+ SortUnion sort; // json: "sort"
3541+ StackOffset|mixed stack; // json: "stack"
3542+ TimeUnit|mixed time_unit; // json: "timeUnit"
3543+ Type type; // json: "type"
3544+ ConditionalValueDefValue value; // json: "value"
35763545
35773546 string encode_json() {
35783547 mapping(string:mixed) json = ([
@@ -3706,12 +3675,12 @@ AxisValue AxisValue_from_JSON(mixed json) {
37063675 //
37073676 // Definition object for a constant value of an encoding channel.
37083677 class X2Class {
3709- AggregateOp|mixed aggregate; // json: "aggregate"
3710- Bin bin; // json: "bin"
3711- Field field; // json: "field"
3712- TimeUnit|mixed time_unit; // json: "timeUnit"
3713- Type|mixed type; // json: "type"
3714- ConditionalPredicateValueDefValue value; // json: "value"
3678+ AggregateOp|mixed aggregate; // json: "aggregate"
3679+ ColorBin bin; // json: "bin"
3680+ Field field; // json: "field"
3681+ TimeUnit|mixed time_unit; // json: "timeUnit"
3682+ Type type; // json: "type"
3683+ ConditionalValueDefValue value; // json: "value"
37153684
37163685 string encode_json() {
37173686 mapping(string:mixed) json = ([
@@ -3770,21 +3739,21 @@ class Spec {
37703739 Data|mixed data; // json: "data"
37713740 mixed|string description; // json: "description"
37723741 float|mixed height; // json: "height"
3773- array(LayerSpec)|mixed layer; // json: "layer"
3742+ array(LayerSpec) layer; // json: "layer"
37743743 mixed|string name; // json: "name"
37753744 Resolve|mixed resolve; // json: "resolve"
37763745 Title title; // json: "title"
37773746 array(Transform)|mixed transform; // json: "transform"
37783747 float|mixed width; // json: "width"
3779- Encoding|mixed encoding; // json: "encoding"
3748+ Encoding encoding; // json: "encoding"
37803749 AnyMark mark; // json: "mark"
37813750 Projection|mixed projection; // json: "projection"
37823751 mapping(string:SelectionDef)|mixed selection; // json: "selection"
3783- FacetMapping|mixed facet; // json: "facet"
3784- Spec|mixed spec; // json: "spec"
3785- Repeat|mixed repeat; // json: "repeat"
3786- array(Spec)|mixed vconcat; // json: "vconcat"
3787- array(Spec)|mixed hconcat; // json: "hconcat"
3752+ FacetMapping facet; // json: "facet"
3753+ Spec spec; // json: "spec"
3754+ Repeat repeat; // json: "repeat"
3755+ array(Spec) vconcat; // json: "vconcat"
3756+ array(Spec) hconcat; // json: "hconcat"
37883757
37893758 string encode_json() {
37903759 mapping(string:mixed) json = ([
@@ -3899,13 +3868,13 @@ class LayerSpec {
38993868 Data|mixed data; // json: "data"
39003869 mixed|string description; // json: "description"
39013870 float|mixed height; // json: "height"
3902- array(LayerSpec)|mixed layer; // json: "layer"
3871+ array(LayerSpec) layer; // json: "layer"
39033872 mixed|string name; // json: "name"
39043873 Resolve|mixed resolve; // json: "resolve"
39053874 Title title; // json: "title"
39063875 array(Transform)|mixed transform; // json: "transform"
39073876 float|mixed width; // json: "width"
3908- Encoding|mixed encoding; // json: "encoding"
3877+ Encoding encoding; // json: "encoding"
39093878 AnyMark mark; // json: "mark"
39103879 Projection|mixed projection; // json: "projection"
39113880 mapping(string:SelectionDef)|mixed selection; // json: "selection"
@@ -4412,17 +4381,17 @@ TitleParams TitleParams_from_JSON(mixed json) {
44124381 }
44134382
44144383 class Transform {
4415- ConditionalValueDefLogicalOperandPredicate filter; // json: "filter"
4416- Style as; // json: "as"
4417- mixed|string calculate; // json: "calculate"
4418- mixed|string transform_default; // json: "default"
4419- LookupData|mixed from; // json: "from"
4420- mixed|string lookup; // json: "lookup"
4421- Bin bin; // json: "bin"
4422- mixed|string field; // json: "field"
4423- TimeUnit|mixed time_unit; // json: "timeUnit"
4424- array(AggregatedFieldDef)|mixed aggregate; // json: "aggregate"
4425- array(string)|mixed groupby; // json: "groupby"
4384+ LogicalOperandPredicate filter; // json: "filter"
4385+ Style as; // json: "as"
4386+ string calculate; // json: "calculate"
4387+ mixed|string transform_default; // json: "default"
4388+ LookupData from; // json: "from"
4389+ string lookup; // json: "lookup"
4390+ TransformBin bin; // json: "bin"
4391+ string field; // json: "field"
4392+ TimeUnit time_unit; // json: "timeUnit"
4393+ array(AggregatedFieldDef) aggregate; // json: "aggregate"
4394+ array(string)|mixed groupby; // json: "groupby"
44264395
44274396 string encode_json() {
44284397 mapping(string:mixed) json = ([
@@ -4487,6 +4456,12 @@ AggregatedFieldDef AggregatedFieldDef_from_JSON(mixed json) {
44874456 return retval;
44884457 }
44894458
4459+typedef BinParams|bool TransformBin;
4460+
4461+TransformBin TransformBin_from_JSON(mixed json) {
4462+ return json;
4463+}
4464+
44904465 // Secondary data reference.
44914466 class LookupData {
44924467 Data data; // json: "data"
Mschema-pythondefault / quicktype.py+346 −407
@@ -1866,28 +1866,27 @@ class ProjectionConfig:
18661866
18671867 @dataclass
18681868 class VGScheme:
1869+ scheme: str
18691870 count: float | None = None
18701871 extent: list[float] | None = None
1871- scheme: str | None = None
18721872 step: float | None = None
18731873
18741874 @staticmethod
18751875 def from_dict(obj: Any) -> 'VGScheme':
18761876 assert isinstance(obj, dict)
1877+ scheme = from_str(obj.get("scheme"))
18771878 count = from_union([from_float, from_none], obj.get("count"))
18781879 extent = from_union([lambda x: from_list(from_float, x), from_none], obj.get("extent"))
1879- scheme = from_union([from_str, from_none], obj.get("scheme"))
18801880 step = from_union([from_float, from_none], obj.get("step"))
1881- return VGScheme(count, extent, scheme, step)
1881+ return VGScheme(scheme, count, extent, step)
18821882
18831883 def to_dict(self) -> dict:
18841884 result: dict = {}
1885+ result["scheme"] = from_str(self.scheme)
18851886 if self.count is not None:
18861887 result["count"] = from_union([to_float, from_none], self.count)
18871888 if self.extent is not None:
18881889 result["extent"] = from_union([lambda x: from_list(to_float, x), from_none], self.extent)
1889- if self.scheme is not None:
1890- result["scheme"] = from_union([from_str, from_none], self.scheme)
18911890 if self.step is not None:
18921891 result["step"] = from_union([to_float, from_none], self.step)
18931892 return result
@@ -2360,8 +2359,8 @@ class MultiSelectionConfig:
23602359 @dataclass
23612360 class VGBinding:
23622361 input: str
2362+ options: list[str]
23632363 element: str | None = None
2364- options: list[str] | None = None
23652364 max: float | None = None
23662365 min: float | None = None
23672366 step: float | None = None
@@ -2370,20 +2369,19 @@ class VGBinding:
23702369 def from_dict(obj: Any) -> 'VGBinding':
23712370 assert isinstance(obj, dict)
23722371 input = from_str(obj.get("input"))
2372+ options = from_list(from_str, obj.get("options"))
23732373 element = from_union([from_str, from_none], obj.get("element"))
2374- options = from_union([lambda x: from_list(from_str, x), from_none], obj.get("options"))
23752374 max = from_union([from_float, from_none], obj.get("max"))
23762375 min = from_union([from_float, from_none], obj.get("min"))
23772376 step = from_union([from_float, from_none], obj.get("step"))
2378- return VGBinding(input, element, options, max, min, step)
2377+ return VGBinding(input, options, element, max, min, step)
23792378
23802379 def to_dict(self) -> dict:
23812380 result: dict = {}
23822381 result["input"] = from_str(self.input)
2382+ result["options"] = from_list(from_str, self.options)
23832383 if self.element is not None:
23842384 result["element"] = from_union([from_str, from_none], self.element)
2385- if self.options is not None:
2386- result["options"] = from_union([lambda x: from_list(from_str, x), from_none], self.options)
23872385 if self.max is not None:
23882386 result["max"] = from_union([to_float, from_none], self.max)
23892387 if self.min is not None:
@@ -3900,45 +3898,43 @@ class Data:
39003898
39013899 Secondary data source to lookup in.
39023900 """
3903- format: DataFormat | None = None
3904- """An object that specifies the format for parsing the data file.
3905-
3906- An object that specifies the format for parsing the data values.
3907-
3908- An object that specifies the format for parsing the data.
3909- """
3910- url: str | None = None
3901+ url: str
39113902 """An URL from which to load the data set. Use the `format.type` property
39123903 to ensure the loaded data is correctly parsed.
39133904 """
3914- values: list[float | bool | dict[str, Any] | str] | dict[str, Any] | str | None = None
3905+ values: list[float | bool | dict[str, Any] | str] | dict[str, Any] | str
39153906 """The full data set, included inline. This can be an array of objects or primitive values
39163907 or a string.
39173908 Arrays of primitive values are ingested as objects with a `data` property. Strings are
39183909 parsed according to the specified format type.
39193910 """
3920- name: str | None = None
3911+ name: str
39213912 """Provide a placeholder name and bind data at runtime."""
39223913
3914+ format: DataFormat | None = None
3915+ """An object that specifies the format for parsing the data file.
3916+
3917+ An object that specifies the format for parsing the data values.
3918+
3919+ An object that specifies the format for parsing the data.
3920+ """
3921+
39233922 @staticmethod
39243923 def from_dict(obj: Any) -> 'Data':
39253924 assert isinstance(obj, dict)
3925+ url = from_str(obj.get("url"))
3926+ values = from_union([lambda x: from_list(lambda x: from_union([from_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str], obj.get("values"))
3927+ name = from_str(obj.get("name"))
39263928 format = from_union([DataFormat.from_dict, from_none], obj.get("format"))
3927- url = from_union([from_str, from_none], obj.get("url"))
3928- values = from_union([lambda x: from_list(lambda x: from_union([from_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str, from_none], obj.get("values"))
3929- name = from_union([from_str, from_none], obj.get("name"))
3930- return Data(format, url, values, name)
3929+ return Data(url, values, name, format)
39313930
39323931 def to_dict(self) -> dict:
39333932 result: dict = {}
3933+ result["url"] = from_str(self.url)
3934+ result["values"] = from_union([lambda x: from_list(lambda x: from_union([to_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str], self.values)
3935+ result["name"] = from_str(self.name)
39343936 if self.format is not None:
39353937 result["format"] = from_union([lambda x: to_class(DataFormat, x), from_none], self.format)
3936- if self.url is not None:
3937- result["url"] = from_union([from_str, from_none], self.url)
3938- if self.values is not None:
3939- result["values"] = from_union([lambda x: from_list(lambda x: from_union([to_float, from_bool, lambda x: from_dict(lambda x: x, x), from_str], x), x), lambda x: from_dict(lambda x: x, x), from_str, from_none], self.values)
3940- if self.name is not None:
3941- result["name"] = from_union([from_str, from_none], self.name)
39423938 return result
39433939
39443940
@@ -4062,26 +4058,23 @@ class BinParams:
40624058
40634059 @dataclass
40644060 class Selection:
4065- selection_not: 'Selection | str | None' = None
4066- selection_and: 'list[Selection | str] | None' = None
4067- selection_or: 'list[Selection | str] | None' = None
4061+ selection_not: 'Selection | str'
4062+ selection_and: list['Selection | str']
4063+ selection_or: list['Selection | str']
40684064
40694065 @staticmethod
40704066 def from_dict(obj: Any) -> 'Selection':
40714067 assert isinstance(obj, dict)
4072- selection_not = from_union([Selection.from_dict, from_str, from_none], obj.get("not"))
4073- selection_and = from_union([lambda x: from_list(lambda x: from_union([Selection.from_dict, from_str], x), x), from_none], obj.get("and"))
4074- selection_or = from_union([lambda x: from_list(lambda x: from_union([Selection.from_dict, from_str], x), x), from_none], obj.get("or"))
4068+ selection_not = from_union([Selection.from_dict, from_str], obj.get("not"))
4069+ selection_and = from_list(lambda x: from_union([Selection.from_dict, from_str], x), obj.get("and"))
4070+ selection_or = from_list(lambda x: from_union([Selection.from_dict, from_str], x), obj.get("or"))
40754071 return Selection(selection_not, selection_and, selection_or)
40764072
40774073 def to_dict(self) -> dict:
40784074 result: dict = {}
4079- if self.selection_not is not None:
4080- result["not"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection_not)
4081- if self.selection_and is not None:
4082- result["and"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), x), from_none], self.selection_and)
4083- if self.selection_or is not None:
4084- result["or"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), x), from_none], self.selection_or)
4075+ result["not"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection_not)
4076+ result["and"] = from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), self.selection_and)
4077+ result["or"] = from_list(lambda x: from_union([lambda x: to_class(Selection, x), from_str], x), self.selection_or)
40854078 return result
40864079
40874080
@@ -4229,78 +4222,71 @@ class TimeUnit(Enum):
42294222
42304223 @dataclass
42314224 class Predicate:
4232- predicate_not: 'Predicate | str | None' = None
4233- predicate_and: 'list[Predicate | str] | None' = None
4234- predicate_or: 'list[Predicate | str] | None' = None
4235- equal: float | bool | DateTime | str | None = None
4225+ predicate_not: 'Predicate | str'
4226+ predicate_and: list['Predicate | str']
4227+ predicate_or: list['Predicate | str']
4228+ equal: float | bool | DateTime | str
42364229 """The value that the field should be equal to."""
42374230
4238- field: str | None = None
4231+ field: str
42394232 """Field to be filtered.
42404233
42414234 Field to be filtered
42424235 """
4243- time_unit: TimeUnit | None = None
4244- """Time unit for the field to be filtered.
4245-
4246- time unit for the field to be filtered.
4247- """
4248- range: list[float | DateTime | None] | None = None
4236+ range: list[float | DateTime | None]
42494237 """An array of inclusive minimum and maximum values
42504238 for a field value of a data item to be included in the filtered data.
42514239 """
4252- one_of: list[float | bool | DateTime | str] | None = None
4240+ one_of: list[float | bool | DateTime | str]
42534241 """A set of values that the `field`'s value should be a member of,
42544242 for a data item included in the filtered data.
42554243 """
4256- selection: Selection | str | None = None
4244+ selection: Selection | str
42574245 """Filter using a selection name."""
42584246
4247+ time_unit: TimeUnit | None = None
4248+ """Time unit for the field to be filtered.
4249+
4250+ time unit for the field to be filtered.
4251+ """
4252+
42594253 @staticmethod
42604254 def from_dict(obj: Any) -> 'Predicate':
42614255 assert isinstance(obj, dict)
4262- predicate_not = from_union([Predicate.from_dict, from_str, from_none], obj.get("not"))
4263- predicate_and = from_union([lambda x: from_list(lambda x: from_union([Predicate.from_dict, from_str], x), x), from_none], obj.get("and"))
4264- predicate_or = from_union([lambda x: from_list(lambda x: from_union([Predicate.from_dict, from_str], x), x), from_none], obj.get("or"))
4265- equal = from_union([from_float, from_bool, DateTime.from_dict, from_str, from_none], obj.get("equal"))
4266- field = from_union([from_str, from_none], obj.get("field"))
4256+ predicate_not = from_union([Predicate.from_dict, from_str], obj.get("not"))
4257+ predicate_and = from_list(lambda x: from_union([Predicate.from_dict, from_str], x), obj.get("and"))
4258+ predicate_or = from_list(lambda x: from_union([Predicate.from_dict, from_str], x), obj.get("or"))
4259+ equal = from_union([from_float, from_bool, DateTime.from_dict, from_str], obj.get("equal"))
4260+ field = from_str(obj.get("field"))
4261+ range = from_list(lambda x: from_union([from_float, DateTime.from_dict, from_none], x), obj.get("range"))
4262+ one_of = from_list(lambda x: from_union([from_float, from_bool, DateTime.from_dict, from_str], x), obj.get("oneOf"))
4263+ selection = from_union([Selection.from_dict, from_str], obj.get("selection"))
42674264 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
4268- range = from_union([lambda x: from_list(lambda x: from_union([from_float, DateTime.from_dict, from_none], x), x), from_none], obj.get("range"))
4269- one_of = from_union([lambda x: from_list(lambda x: from_union([from_float, from_bool, DateTime.from_dict, from_str], x), x), from_none], obj.get("oneOf"))
4270- selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection"))
4271- return Predicate(predicate_not, predicate_and, predicate_or, equal, field, time_unit, range, one_of, selection)
4265+ return Predicate(predicate_not, predicate_and, predicate_or, equal, field, range, one_of, selection, time_unit)
42724266
42734267 def to_dict(self) -> dict:
42744268 result: dict = {}
4275- if self.predicate_not is not None:
4276- result["not"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.predicate_not)
4277- if self.predicate_and is not None:
4278- result["and"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), x), from_none], self.predicate_and)
4279- if self.predicate_or is not None:
4280- result["or"] = from_union([lambda x: from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), x), from_none], self.predicate_or)
4281- if self.equal is not None:
4282- result["equal"] = from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str, from_none], self.equal)
4283- if self.field is not None:
4284- result["field"] = from_union([from_str, from_none], self.field)
4269+ result["not"] = from_union([lambda x: to_class(Predicate, x), from_str], self.predicate_not)
4270+ result["and"] = from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), self.predicate_and)
4271+ result["or"] = from_list(lambda x: from_union([lambda x: to_class(Predicate, x), from_str], x), self.predicate_or)
4272+ result["equal"] = from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str], self.equal)
4273+ result["field"] = from_str(self.field)
4274+ result["range"] = from_list(lambda x: from_union([to_float, lambda x: to_class(DateTime, x), from_none], x), self.range)
4275+ result["oneOf"] = from_list(lambda x: from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str], x), self.one_of)
4276+ result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection)
42854277 if self.time_unit is not None:
42864278 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
4287- if self.range is not None:
4288- result["range"] = from_union([lambda x: from_list(lambda x: from_union([to_float, lambda x: to_class(DateTime, x), from_none], x), x), from_none], self.range)
4289- if self.one_of is not None:
4290- result["oneOf"] = from_union([lambda x: from_list(lambda x: from_union([to_float, from_bool, lambda x: to_class(DateTime, x), from_str], x), x), from_none], self.one_of)
4291- if self.selection is not None:
4292- result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection)
42934279 return result
42944280
42954281
42964282 @dataclass
42974283 class ConditionalValueDef:
4284+ test: Predicate | str
42984285 value: float | bool | str
42994286 """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
43004287 `0` to `1` for opacity).
43014288 """
4302- test: Predicate | str | None = None
4303- selection: Selection | str | None = None
4289+ selection: Selection | str
43044290 """A [selection name](selection.html), or a series of [composed
43054291 selections](selection.html#compose).
43064292 """
@@ -4308,18 +4294,16 @@ class ConditionalValueDef:
43084294 @staticmethod
43094295 def from_dict(obj: Any) -> 'ConditionalValueDef':
43104296 assert isinstance(obj, dict)
4297+ test = from_union([Predicate.from_dict, from_str], obj.get("test"))
43114298 value = from_union([from_float, from_bool, from_str], obj.get("value"))
4312- test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test"))
4313- selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection"))
4314- return ConditionalValueDef(value, test, selection)
4299+ selection = from_union([Selection.from_dict, from_str], obj.get("selection"))
4300+ return ConditionalValueDef(test, value, selection)
43154301
43164302 def to_dict(self) -> dict:
43174303 result: dict = {}
4304+ result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test)
43184305 result["value"] = from_union([to_float, from_bool, from_str], self.value)
4319- if self.test is not None:
4320- result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test)
4321- if self.selection is not None:
4322- result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection)
4306+ result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection)
43234307 return result
43244308
43254309
@@ -4929,15 +4913,21 @@ class ConditionalPredicateValueDefType(Enum):
49294913
49304914 @dataclass
49314915 class ConditionalPredicateMarkPropFieldDefClass:
4932- test: Predicate | str | None = None
4933- value: float | bool | str | None = None
4916+ test: Predicate | str
4917+ value: float | bool | str
49344918 """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
49354919 `0` to `1` for opacity).
49364920 """
4937- selection: Selection | str | None = None
4921+ selection: Selection | str
49384922 """A [selection name](selection.html), or a series of [composed
49394923 selections](selection.html#compose).
49404924 """
4925+ type: ConditionalPredicateValueDefType
4926+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4927+ `"nominal"`).
4928+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4929+ [geographic projection](projection.html) is applied.
4930+ """
49414931 aggregate: AggregateOp | None = None
49424932 """Aggregation function for the field
49434933 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4990,19 +4980,14 @@ class ConditionalPredicateMarkPropFieldDefClass:
49904980
49914981 __Default value:__ `undefined` (None)
49924982 """
4993- type: ConditionalPredicateValueDefType | None = None
4994- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
4995- `"nominal"`).
4996- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
4997- [geographic projection](projection.html) is applied.
4998- """
49994983
50004984 @staticmethod
50014985 def from_dict(obj: Any) -> 'ConditionalPredicateMarkPropFieldDefClass':
50024986 assert isinstance(obj, dict)
5003- test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test"))
5004- value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
5005- selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection"))
4987+ test = from_union([Predicate.from_dict, from_str], obj.get("test"))
4988+ value = from_union([from_float, from_bool, from_str], obj.get("value"))
4989+ selection = from_union([Selection.from_dict, from_str], obj.get("selection"))
4990+ type = ConditionalPredicateValueDefType(obj.get("type"))
50064991 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
50074992 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
50084993 field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field"))
@@ -5010,17 +4995,14 @@ class ConditionalPredicateMarkPropFieldDefClass:
50104995 scale = from_union([Scale.from_dict, from_none], obj.get("scale"))
50114996 sort = from_union([from_none, SortField.from_dict, SortEnum], obj.get("sort"))
50124997 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
5013- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
5014- return ConditionalPredicateMarkPropFieldDefClass(test, value, selection, aggregate, bin, field, legend, scale, sort, time_unit, type)
4998+ return ConditionalPredicateMarkPropFieldDefClass(test, value, selection, type, aggregate, bin, field, legend, scale, sort, time_unit)
50154999
50165000 def to_dict(self) -> dict:
50175001 result: dict = {}
5018- if self.test is not None:
5019- result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test)
5020- if self.value is not None:
5021- result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
5022- if self.selection is not None:
5023- result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection)
5002+ result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test)
5003+ result["value"] = from_union([to_float, from_bool, from_str], self.value)
5004+ result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection)
5005+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
50245006 if self.aggregate is not None:
50255007 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
50265008 if self.bin is not None:
@@ -5035,8 +5017,6 @@ class ConditionalPredicateMarkPropFieldDefClass:
50355017 result["sort"] = from_union([from_none, lambda x: to_class(SortField, x), lambda x: to_enum(SortEnum, x)], self.sort)
50365018 if self.time_unit is not None:
50375019 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
5038- if self.type is not None:
5039- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
50405020 return result
50415021
50425022
@@ -5084,6 +5064,12 @@ class MarkPropDefWithCondition:
50845064 value: ...,
50855065 }
50865066 """
5067+ type: ConditionalPredicateValueDefType
5068+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5069+ `"nominal"`).
5070+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5071+ [geographic projection](projection.html) is applied.
5072+ """
50875073 aggregate: AggregateOp | None = None
50885074 """Aggregation function for the field
50895075 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -5145,18 +5131,13 @@ class MarkPropDefWithCondition:
51455131
51465132 __Default value:__ `undefined` (None)
51475133 """
5148- type: ConditionalPredicateValueDefType | None = None
5149- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5150- `"nominal"`).
5151- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5152- [geographic projection](projection.html) is applied.
5153- """
51545134 value: float | bool | str | None = None
51555135 """A constant value in visual domain."""
51565136
51575137 @staticmethod
51585138 def from_dict(obj: Any) -> 'MarkPropDefWithCondition':
51595139 assert isinstance(obj, dict)
5140+ type = ConditionalPredicateValueDefType(obj.get("type"))
51605141 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
51615142 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
51625143 condition = from_union([ConditionalPredicateMarkPropFieldDefClass.from_dict, lambda x: from_list(ConditionalValueDef.from_dict, x), from_none], obj.get("condition"))
@@ -5165,12 +5146,12 @@ class MarkPropDefWithCondition:
51655146 scale = from_union([Scale.from_dict, from_none], obj.get("scale"))
51665147 sort = from_union([from_none, SortField.from_dict, SortEnum], obj.get("sort"))
51675148 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
5168- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
51695149 value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
5170- return MarkPropDefWithCondition(aggregate, bin, condition, field, legend, scale, sort, time_unit, type, value)
5150+ return MarkPropDefWithCondition(type, aggregate, bin, condition, field, legend, scale, sort, time_unit, value)
51715151
51725152 def to_dict(self) -> dict:
51735153 result: dict = {}
5154+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
51745155 if self.aggregate is not None:
51755156 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
51765157 if self.bin is not None:
@@ -5187,8 +5168,6 @@ class MarkPropDefWithCondition:
51875168 result["sort"] = from_union([from_none, lambda x: to_class(SortField, x), lambda x: to_enum(SortEnum, x)], self.sort)
51885169 if self.time_unit is not None:
51895170 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
5190- if self.type is not None:
5191- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
51925171 if self.value is not None:
51935172 result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
51945173 return result
@@ -5399,15 +5378,21 @@ class FieldDef:
53995378
54005379 @dataclass
54015380 class ConditionalPredicateFieldDefClass:
5402- test: Predicate | str | None = None
5403- value: float | bool | str | None = None
5381+ test: Predicate | str
5382+ value: float | bool | str
54045383 """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
54055384 `0` to `1` for opacity).
54065385 """
5407- selection: Selection | str | None = None
5386+ selection: Selection | str
54085387 """A [selection name](selection.html), or a series of [composed
54095388 selections](selection.html#compose).
54105389 """
5390+ type: ConditionalPredicateValueDefType
5391+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5392+ `"nominal"`).
5393+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5394+ [geographic projection](projection.html) is applied.
5395+ """
54115396 aggregate: AggregateOp | None = None
54125397 """Aggregation function for the field
54135398 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -5439,34 +5424,26 @@ class ConditionalPredicateFieldDefClass:
54395424
54405425 __Default value:__ `undefined` (None)
54415426 """
5442- type: ConditionalPredicateValueDefType | None = None
5443- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5444- `"nominal"`).
5445- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5446- [geographic projection](projection.html) is applied.
5447- """
54485427
54495428 @staticmethod
54505429 def from_dict(obj: Any) -> 'ConditionalPredicateFieldDefClass':
54515430 assert isinstance(obj, dict)
5452- test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test"))
5453- value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
5454- selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection"))
5431+ test = from_union([Predicate.from_dict, from_str], obj.get("test"))
5432+ value = from_union([from_float, from_bool, from_str], obj.get("value"))
5433+ selection = from_union([Selection.from_dict, from_str], obj.get("selection"))
5434+ type = ConditionalPredicateValueDefType(obj.get("type"))
54555435 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
54565436 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
54575437 field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field"))
54585438 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
5459- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
5460- return ConditionalPredicateFieldDefClass(test, value, selection, aggregate, bin, field, time_unit, type)
5439+ return ConditionalPredicateFieldDefClass(test, value, selection, type, aggregate, bin, field, time_unit)
54615440
54625441 def to_dict(self) -> dict:
54635442 result: dict = {}
5464- if self.test is not None:
5465- result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test)
5466- if self.value is not None:
5467- result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
5468- if self.selection is not None:
5469- result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection)
5443+ result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test)
5444+ result["value"] = from_union([to_float, from_bool, from_str], self.value)
5445+ result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection)
5446+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
54705447 if self.aggregate is not None:
54715448 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
54725449 if self.bin is not None:
@@ -5475,8 +5452,6 @@ class ConditionalPredicateFieldDefClass:
54755452 result["field"] = from_union([lambda x: to_class(RepeatRef, x), from_str, from_none], self.field)
54765453 if self.time_unit is not None:
54775454 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
5478- if self.type is not None:
5479- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
54805455 return result
54815456
54825457
@@ -5497,6 +5472,12 @@ class DefWithCondition:
54975472 value: ...,
54985473 }
54995474 """
5475+ type: ConditionalPredicateValueDefType
5476+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5477+ `"nominal"`).
5478+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5479+ [geographic projection](projection.html) is applied.
5480+ """
55005481 aggregate: AggregateOp | None = None
55015482 """Aggregation function for the field
55025483 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -5537,29 +5518,24 @@ class DefWithCondition:
55375518
55385519 __Default value:__ `undefined` (None)
55395520 """
5540- type: ConditionalPredicateValueDefType | None = None
5541- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5542- `"nominal"`).
5543- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5544- [geographic projection](projection.html) is applied.
5545- """
55465521 value: float | bool | str | None = None
55475522 """A constant value in visual domain."""
55485523
55495524 @staticmethod
55505525 def from_dict(obj: Any) -> 'DefWithCondition':
55515526 assert isinstance(obj, dict)
5527+ type = ConditionalPredicateValueDefType(obj.get("type"))
55525528 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
55535529 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
55545530 condition = from_union([ConditionalPredicateFieldDefClass.from_dict, lambda x: from_list(ConditionalValueDef.from_dict, x), from_none], obj.get("condition"))
55555531 field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field"))
55565532 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
5557- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
55585533 value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
5559- return DefWithCondition(aggregate, bin, condition, field, time_unit, type, value)
5534+ return DefWithCondition(type, aggregate, bin, condition, field, time_unit, value)
55605535
55615536 def to_dict(self) -> dict:
55625537 result: dict = {}
5538+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
55635539 if self.aggregate is not None:
55645540 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
55655541 if self.bin is not None:
@@ -5570,8 +5546,6 @@ class DefWithCondition:
55705546 result["field"] = from_union([lambda x: to_class(RepeatRef, x), from_str, from_none], self.field)
55715547 if self.time_unit is not None:
55725548 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
5573- if self.type is not None:
5574- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
55755549 if self.value is not None:
55765550 result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
55775551 return result
@@ -5649,15 +5623,21 @@ class OrderFieldDef:
56495623
56505624 @dataclass
56515625 class ConditionalPredicateTextFieldDefClass:
5652- test: Predicate | str | None = None
5653- value: float | bool | str | None = None
5626+ test: Predicate | str
5627+ value: float | bool | str
56545628 """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
56555629 `0` to `1` for opacity).
56565630 """
5657- selection: Selection | str | None = None
5631+ selection: Selection | str
56585632 """A [selection name](selection.html), or a series of [composed
56595633 selections](selection.html#compose).
56605634 """
5635+ type: ConditionalPredicateValueDefType
5636+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5637+ `"nominal"`).
5638+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5639+ [geographic projection](projection.html) is applied.
5640+ """
56615641 aggregate: AggregateOp | None = None
56625642 """Aggregation function for the field
56635643 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -5693,35 +5673,27 @@ class ConditionalPredicateTextFieldDefClass:
56935673
56945674 __Default value:__ `undefined` (None)
56955675 """
5696- type: ConditionalPredicateValueDefType | None = None
5697- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5698- `"nominal"`).
5699- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5700- [geographic projection](projection.html) is applied.
5701- """
57025676
57035677 @staticmethod
57045678 def from_dict(obj: Any) -> 'ConditionalPredicateTextFieldDefClass':
57055679 assert isinstance(obj, dict)
5706- test = from_union([Predicate.from_dict, from_str, from_none], obj.get("test"))
5707- value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
5708- selection = from_union([Selection.from_dict, from_str, from_none], obj.get("selection"))
5680+ test = from_union([Predicate.from_dict, from_str], obj.get("test"))
5681+ value = from_union([from_float, from_bool, from_str], obj.get("value"))
5682+ selection = from_union([Selection.from_dict, from_str], obj.get("selection"))
5683+ type = ConditionalPredicateValueDefType(obj.get("type"))
57095684 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
57105685 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
57115686 field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field"))
57125687 format = from_union([from_str, from_none], obj.get("format"))
57135688 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
5714- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
5715- return ConditionalPredicateTextFieldDefClass(test, value, selection, aggregate, bin, field, format, time_unit, type)
5689+ return ConditionalPredicateTextFieldDefClass(test, value, selection, type, aggregate, bin, field, format, time_unit)
57165690
57175691 def to_dict(self) -> dict:
57185692 result: dict = {}
5719- if self.test is not None:
5720- result["test"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.test)
5721- if self.value is not None:
5722- result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
5723- if self.selection is not None:
5724- result["selection"] = from_union([lambda x: to_class(Selection, x), from_str, from_none], self.selection)
5693+ result["test"] = from_union([lambda x: to_class(Predicate, x), from_str], self.test)
5694+ result["value"] = from_union([to_float, from_bool, from_str], self.value)
5695+ result["selection"] = from_union([lambda x: to_class(Selection, x), from_str], self.selection)
5696+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
57255697 if self.aggregate is not None:
57265698 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
57275699 if self.bin is not None:
@@ -5732,8 +5704,6 @@ class ConditionalPredicateTextFieldDefClass:
57325704 result["format"] = from_union([from_str, from_none], self.format)
57335705 if self.time_unit is not None:
57345706 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
5735- if self.type is not None:
5736- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
57375707 return result
57385708
57395709
@@ -5756,6 +5726,12 @@ class TextDefWithCondition:
57565726 value: ...,
57575727 }
57585728 """
5729+ type: ConditionalPredicateValueDefType
5730+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5731+ `"nominal"`).
5732+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5733+ [geographic projection](projection.html) is applied.
5734+ """
57595735 aggregate: AggregateOp | None = None
57605736 """Aggregation function for the field
57615737 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -5800,30 +5776,25 @@ class TextDefWithCondition:
58005776
58015777 __Default value:__ `undefined` (None)
58025778 """
5803- type: ConditionalPredicateValueDefType | None = None
5804- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
5805- `"nominal"`).
5806- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
5807- [geographic projection](projection.html) is applied.
5808- """
58095779 value: float | bool | str | None = None
58105780 """A constant value in visual domain."""
58115781
58125782 @staticmethod
58135783 def from_dict(obj: Any) -> 'TextDefWithCondition':
58145784 assert isinstance(obj, dict)
5785+ type = ConditionalPredicateValueDefType(obj.get("type"))
58155786 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
58165787 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
58175788 condition = from_union([ConditionalPredicateTextFieldDefClass.from_dict, lambda x: from_list(ConditionalValueDef.from_dict, x), from_none], obj.get("condition"))
58185789 field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field"))
58195790 format = from_union([from_str, from_none], obj.get("format"))
58205791 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
5821- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
58225792 value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
5823- return TextDefWithCondition(aggregate, bin, condition, field, format, time_unit, type, value)
5793+ return TextDefWithCondition(type, aggregate, bin, condition, field, format, time_unit, value)
58245794
58255795 def to_dict(self) -> dict:
58265796 result: dict = {}
5797+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
58275798 if self.aggregate is not None:
58285799 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
58295800 if self.bin is not None:
@@ -5836,8 +5807,6 @@ class TextDefWithCondition:
58365807 result["format"] = from_union([from_str, from_none], self.format)
58375808 if self.time_unit is not None:
58385809 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
5839- if self.type is not None:
5840- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
58415810 if self.value is not None:
58425811 result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
58435812 return result
@@ -6072,6 +6041,16 @@ class XClass:
60726041
60736042 Definition object for a constant value of an encoding channel.
60746043 """
6044+ type: ConditionalPredicateValueDefType
6045+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
6046+ `"nominal"`).
6047+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
6048+ [geographic projection](projection.html) is applied.
6049+ """
6050+ value: float | bool | str
6051+ """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6052+ `0` to `1` for opacity).
6053+ """
60756054 aggregate: AggregateOp | None = None
60766055 """Aggregation function for the field
60776056 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -6146,20 +6125,12 @@ class XClass:
61466125
61476126 __Default value:__ `undefined` (None)
61486127 """
6149- type: ConditionalPredicateValueDefType | None = None
6150- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
6151- `"nominal"`).
6152- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
6153- [geographic projection](projection.html) is applied.
6154- """
6155- value: float | bool | str | None = None
6156- """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6157- `0` to `1` for opacity).
6158- """
61596128
61606129 @staticmethod
61616130 def from_dict(obj: Any) -> 'XClass':
61626131 assert isinstance(obj, dict)
6132+ type = ConditionalPredicateValueDefType(obj.get("type"))
6133+ value = from_union([from_float, from_bool, from_str], obj.get("value"))
61636134 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
61646135 axis = from_union([Axis.from_dict, from_none], obj.get("axis"))
61656136 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
@@ -6168,12 +6139,12 @@ class XClass:
61686139 sort = from_union([from_none, SortField.from_dict, SortEnum], obj.get("sort"))
61696140 stack = from_union([StackOffset, from_none], obj.get("stack"))
61706141 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
6171- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
6172- value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
6173- return XClass(aggregate, axis, bin, field, scale, sort, stack, time_unit, type, value)
6142+ return XClass(type, value, aggregate, axis, bin, field, scale, sort, stack, time_unit)
61746143
61756144 def to_dict(self) -> dict:
61766145 result: dict = {}
6146+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
6147+ result["value"] = from_union([to_float, from_bool, from_str], self.value)
61776148 if self.aggregate is not None:
61786149 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
61796150 if self.axis is not None:
@@ -6190,10 +6161,6 @@ class XClass:
61906161 result["stack"] = from_union([lambda x: to_enum(StackOffset, x), from_none], self.stack)
61916162 if self.time_unit is not None:
61926163 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
6193- if self.type is not None:
6194- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
6195- if self.value is not None:
6196- result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
61976164 return result
61986165
61996166
@@ -6207,6 +6174,16 @@ class X2Class:
62076174
62086175 Definition object for a constant value of an encoding channel.
62096176 """
6177+ type: ConditionalPredicateValueDefType
6178+ """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
6179+ `"nominal"`).
6180+ It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
6181+ [geographic projection](projection.html) is applied.
6182+ """
6183+ value: float | bool | str
6184+ """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6185+ `0` to `1` for opacity).
6186+ """
62106187 aggregate: AggregateOp | None = None
62116188 """Aggregation function for the field
62126189 (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -6238,30 +6215,22 @@ class X2Class:
62386215
62396216 __Default value:__ `undefined` (None)
62406217 """
6241- type: ConditionalPredicateValueDefType | None = None
6242- """The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
6243- `"nominal"`).
6244- It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
6245- [geographic projection](projection.html) is applied.
6246- """
6247- value: float | bool | str | None = None
6248- """A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
6249- `0` to `1` for opacity).
6250- """
62516218
62526219 @staticmethod
62536220 def from_dict(obj: Any) -> 'X2Class':
62546221 assert isinstance(obj, dict)
6222+ type = ConditionalPredicateValueDefType(obj.get("type"))
6223+ value = from_union([from_float, from_bool, from_str], obj.get("value"))
62556224 aggregate = from_union([AggregateOp, from_none], obj.get("aggregate"))
62566225 bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
62576226 field = from_union([RepeatRef.from_dict, from_str, from_none], obj.get("field"))
62586227 time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
6259- type = from_union([ConditionalPredicateValueDefType, from_none], obj.get("type"))
6260- value = from_union([from_float, from_bool, from_str, from_none], obj.get("value"))
6261- return X2Class(aggregate, bin, field, time_unit, type, value)
6228+ return X2Class(type, value, aggregate, bin, field, time_unit)
62626229
62636230 def to_dict(self) -> dict:
62646231 result: dict = {}
6232+ result["type"] = to_enum(ConditionalPredicateValueDefType, self.type)
6233+ result["value"] = from_union([to_float, from_bool, from_str], self.value)
62656234 if self.aggregate is not None:
62666235 result["aggregate"] = from_union([lambda x: to_enum(AggregateOp, x), from_none], self.aggregate)
62676236 if self.bin is not None:
@@ -6270,10 +6239,6 @@ class X2Class:
62706239 result["field"] = from_union([lambda x: to_class(RepeatRef, x), from_str, from_none], self.field)
62716240 if self.time_unit is not None:
62726241 result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
6273- if self.type is not None:
6274- result["type"] = from_union([lambda x: to_enum(ConditionalPredicateValueDefType, x), from_none], self.type)
6275- if self.value is not None:
6276- result["value"] = from_union([to_float, from_bool, from_str, from_none], self.value)
62776242 return result
62786243
62796244
@@ -7350,7 +7315,7 @@ class LookupData:
73507315
73517316 @dataclass
73527317 class Transform:
7353- filter: Predicate | str | None = None
7318+ filter: Predicate | str
73547319 """The `filter` property must be one of the predicate definitions:
73557320 (1) an [expression](types.html#expression) string,
73567321 where `datum` can be used to refer to the current data object;
@@ -7360,47 +7325,47 @@ class Transform:
73607325 (3) a [selection predicate](filter.html#selection-predicate);
73617326 or (4) a logical operand that combines (1), (2), or (3).
73627327 """
7363- transform_as: list[str] | str | None = None
7364- """The field for storing the computed formula value.
7365-
7366- The field or fields for storing the computed formula value.
7367- If `from.fields` is specified, the transform will use the same names for `as`.
7368- If `from.fields` is not specified, `as` has to be a string and we put the whole object
7369- into the data under the specified name.
7370-
7371- The output fields at which to write the start and end bin values.
7372-
7373- The output field to write the timeUnit value.
7374- """
7375- calculate: str | None = None
7328+ calculate: str
73767329 """A [expression](types.html#expression) string. Use the variable `datum` to refer to the
73777330 current data object.
73787331 """
7379- default: str | None = None
7380- """The default value to use if lookup fails.
7381-
7382- __Default value:__ `null`
7383- """
7384- transform_from: LookupData | None = None
7332+ transform_from: LookupData
73857333 """Secondary data reference."""
73867334
7387- lookup: str | None = None
7335+ lookup: str
73887336 """Key in primary data source."""
73897337
7390- bin: bool | BinParams | None = None
7338+ bin: bool | BinParams
73917339 """An object indicating bin properties, or simply `true` for using default bin parameters."""
73927340
7393- field: str | None = None
7341+ field: str
73947342 """The data field to bin.
73957343
73967344 The data field to apply time unit.
73977345 """
7398- time_unit: TimeUnit | None = None
7346+ time_unit: TimeUnit
73997347 """The timeUnit."""
74007348
7401- aggregate: list[AggregatedFieldDef] | None = None
7349+ aggregate: list[AggregatedFieldDef]
74027350 """Array of objects that define fields to aggregate."""
74037351
7352+ transform_as: list[str] | str | None = None
7353+ """The field for storing the computed formula value.
7354+
7355+ The field or fields for storing the computed formula value.
7356+ If `from.fields` is specified, the transform will use the same names for `as`.
7357+ If `from.fields` is not specified, `as` has to be a string and we put the whole object
7358+ into the data under the specified name.
7359+
7360+ The output fields at which to write the start and end bin values.
7361+
7362+ The output field to write the timeUnit value.
7363+ """
7364+ default: str | None = None
7365+ """The default value to use if lookup fails.
7366+
7367+ __Default value:__ `null`
7368+ """
74047369 groupby: list[str] | None = None
74057370 """The data fields to group by. If not specified, a single group containing all data objects
74067371 will be used.
@@ -7409,41 +7374,33 @@ class Transform:
74097374 @staticmethod
74107375 def from_dict(obj: Any) -> 'Transform':
74117376 assert isinstance(obj, dict)
7412- filter = from_union([Predicate.from_dict, from_str, from_none], obj.get("filter"))
7377+ filter = from_union([Predicate.from_dict, from_str], obj.get("filter"))
7378+ calculate = from_str(obj.get("calculate"))
7379+ transform_from = LookupData.from_dict(obj.get("from"))
7380+ lookup = from_str(obj.get("lookup"))
7381+ bin = from_union([from_bool, BinParams.from_dict], obj.get("bin"))
7382+ field = from_str(obj.get("field"))
7383+ time_unit = TimeUnit(obj.get("timeUnit"))
7384+ aggregate = from_list(AggregatedFieldDef.from_dict, obj.get("aggregate"))
74137385 transform_as = from_union([lambda x: from_list(from_str, x), from_str, from_none], obj.get("as"))
7414- calculate = from_union([from_str, from_none], obj.get("calculate"))
74157386 default = from_union([from_str, from_none], obj.get("default"))
7416- transform_from = from_union([LookupData.from_dict, from_none], obj.get("from"))
7417- lookup = from_union([from_str, from_none], obj.get("lookup"))
7418- bin = from_union([from_bool, BinParams.from_dict, from_none], obj.get("bin"))
7419- field = from_union([from_str, from_none], obj.get("field"))
7420- time_unit = from_union([TimeUnit, from_none], obj.get("timeUnit"))
7421- aggregate = from_union([lambda x: from_list(AggregatedFieldDef.from_dict, x), from_none], obj.get("aggregate"))
74227387 groupby = from_union([lambda x: from_list(from_str, x), from_none], obj.get("groupby"))
7423- return Transform(filter, transform_as, calculate, default, transform_from, lookup, bin, field, time_unit, aggregate, groupby)
7388+ return Transform(filter, calculate, transform_from, lookup, bin, field, time_unit, aggregate, transform_as, default, groupby)
74247389
74257390 def to_dict(self) -> dict:
74267391 result: dict = {}
7427- if self.filter is not None:
7428- result["filter"] = from_union([lambda x: to_class(Predicate, x), from_str, from_none], self.filter)
7392+ result["filter"] = from_union([lambda x: to_class(Predicate, x), from_str], self.filter)
7393+ result["calculate"] = from_str(self.calculate)
7394+ result["from"] = to_class(LookupData, self.transform_from)
7395+ result["lookup"] = from_str(self.lookup)
7396+ result["bin"] = from_union([from_bool, lambda x: to_class(BinParams, x)], self.bin)
7397+ result["field"] = from_str(self.field)
7398+ result["timeUnit"] = to_enum(TimeUnit, self.time_unit)
7399+ result["aggregate"] = from_list(lambda x: to_class(AggregatedFieldDef, x), self.aggregate)
74297400 if self.transform_as is not None:
74307401 result["as"] = from_union([lambda x: from_list(from_str, x), from_str, from_none], self.transform_as)
7431- if self.calculate is not None:
7432- result["calculate"] = from_union([from_str, from_none], self.calculate)
74337402 if self.default is not None:
74347403 result["default"] = from_union([from_str, from_none], self.default)
7435- if self.transform_from is not None:
7436- result["from"] = from_union([lambda x: to_class(LookupData, x), from_none], self.transform_from)
7437- if self.lookup is not None:
7438- result["lookup"] = from_union([from_str, from_none], self.lookup)
7439- if self.bin is not None:
7440- result["bin"] = from_union([from_bool, lambda x: to_class(BinParams, x), from_none], self.bin)
7441- if self.field is not None:
7442- result["field"] = from_union([from_str, from_none], self.field)
7443- if self.time_unit is not None:
7444- result["timeUnit"] = from_union([lambda x: to_enum(TimeUnit, x), from_none], self.time_unit)
7445- if self.aggregate is not None:
7446- result["aggregate"] = from_union([lambda x: from_list(lambda x: to_class(AggregatedFieldDef, x), x), from_none], self.aggregate)
74477404 if self.groupby is not None:
74487405 result["groupby"] = from_union([lambda x: from_list(from_str, x), from_none], self.groupby)
74497406 return result
@@ -7453,6 +7410,21 @@ class Transform:
74537410 class LayerSpec:
74547411 """Unit spec that can have a composite mark."""
74557412
7413+ layer: list['LayerSpec']
7414+ """Layer or single view specifications to be layered.
7415+
7416+ __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
7417+ layering facet specifications is not allowed.
7418+ """
7419+ encoding: Encoding
7420+ """A key-value mapping between encoding channels and definition of fields."""
7421+
7422+ mark: MarkDef | Mark
7423+ """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
7424+ `"line"`,
7425+ * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7426+ object](mark.html#mark-def).
7427+ """
74567428 data: Data | None = None
74577429 """An object describing the data source"""
74587430
@@ -7478,12 +7450,6 @@ class LayerSpec:
74787450
74797451 __See also:__ The documentation for [width and height](size.html) contains more examples.
74807452 """
7481- layer: 'list[LayerSpec] | None' = None
7482- """Layer or single view specifications to be layered.
7483-
7484- __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
7485- layering facet specifications is not allowed.
7486- """
74877453 name: str | None = None
74887454 """Name of the visualization for later reference."""
74897455
@@ -7518,15 +7484,6 @@ class LayerSpec:
75187484
75197485 __See also:__ The documentation for [width and height](size.html) contains more examples.
75207486 """
7521- encoding: Encoding | None = None
7522- """A key-value mapping between encoding channels and definition of fields."""
7523-
7524- mark: MarkDef | Mark | None = None
7525- """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
7526- `"line"`,
7527- * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7528- object](mark.html#mark-def).
7529- """
75307487 projection: Projection | None = None
75317488 """An object defining properties of geographic projection.
75327489
@@ -7539,31 +7496,32 @@ class LayerSpec:
75397496 @staticmethod
75407497 def from_dict(obj: Any) -> 'LayerSpec':
75417498 assert isinstance(obj, dict)
7499+ layer = from_list(LayerSpec.from_dict, obj.get("layer"))
7500+ encoding = Encoding.from_dict(obj.get("encoding"))
7501+ mark = from_union([MarkDef.from_dict, Mark], obj.get("mark"))
75427502 data = from_union([Data.from_dict, from_none], obj.get("data"))
75437503 description = from_union([from_str, from_none], obj.get("description"))
75447504 height = from_union([from_float, from_none], obj.get("height"))
7545- layer = from_union([lambda x: from_list(LayerSpec.from_dict, x), from_none], obj.get("layer"))
75467505 name = from_union([from_str, from_none], obj.get("name"))
75477506 resolve = from_union([Resolve.from_dict, from_none], obj.get("resolve"))
75487507 title = from_union([TitleParams.from_dict, from_str, from_none], obj.get("title"))
75497508 transform = from_union([lambda x: from_list(Transform.from_dict, x), from_none], obj.get("transform"))
75507509 width = from_union([from_float, from_none], obj.get("width"))
7551- encoding = from_union([Encoding.from_dict, from_none], obj.get("encoding"))
7552- mark = from_union([MarkDef.from_dict, Mark, from_none], obj.get("mark"))
75537510 projection = from_union([Projection.from_dict, from_none], obj.get("projection"))
75547511 selection = from_union([lambda x: from_dict(SelectionDef.from_dict, x), from_none], obj.get("selection"))
7555- return LayerSpec(data, description, height, layer, name, resolve, title, transform, width, encoding, mark, projection, selection)
7512+ return LayerSpec(layer, encoding, mark, data, description, height, name, resolve, title, transform, width, projection, selection)
75567513
75577514 def to_dict(self) -> dict:
75587515 result: dict = {}
7516+ result["layer"] = from_list(lambda x: to_class(LayerSpec, x), self.layer)
7517+ result["encoding"] = to_class(Encoding, self.encoding)
7518+ result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x)], self.mark)
75597519 if self.data is not None:
75607520 result["data"] = from_union([lambda x: to_class(Data, x), from_none], self.data)
75617521 if self.description is not None:
75627522 result["description"] = from_union([from_str, from_none], self.description)
75637523 if self.height is not None:
75647524 result["height"] = from_union([to_float, from_none], self.height)
7565- if self.layer is not None:
7566- result["layer"] = from_union([lambda x: from_list(lambda x: to_class(LayerSpec, x), x), from_none], self.layer)
75677525 if self.name is not None:
75687526 result["name"] = from_union([from_str, from_none], self.name)
75697527 if self.resolve is not None:
@@ -7574,10 +7532,6 @@ class LayerSpec:
75747532 result["transform"] = from_union([lambda x: from_list(lambda x: to_class(Transform, x), x), from_none], self.transform)
75757533 if self.width is not None:
75767534 result["width"] = from_union([to_float, from_none], self.width)
7577- if self.encoding is not None:
7578- result["encoding"] = from_union([lambda x: to_class(Encoding, x), from_none], self.encoding)
7579- if self.mark is not None:
7580- result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x), from_none], self.mark)
75817535 if self.projection is not None:
75827536 result["projection"] = from_union([lambda x: to_class(Projection, x), from_none], self.projection)
75837537 if self.selection is not None:
@@ -7616,6 +7570,38 @@ class Repeat:
76167570 class Spec:
76177571 """Unit spec that can have a composite mark."""
76187572
7573+ layer: list[LayerSpec]
7574+ """Layer or single view specifications to be layered.
7575+
7576+ __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
7577+ layering facet specifications is not allowed.
7578+ """
7579+ encoding: Encoding
7580+ """A key-value mapping between encoding channels and definition of fields."""
7581+
7582+ mark: MarkDef | Mark
7583+ """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
7584+ `"line"`,
7585+ * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7586+ object](mark.html#mark-def).
7587+ """
7588+ facet: FacetMapping
7589+ """An object that describes mappings between `row` and `column` channels and their field
7590+ definitions.
7591+ """
7592+ spec: 'Spec'
7593+ """A specification of the view that gets faceted."""
7594+
7595+ repeat: Repeat
7596+ """An object that describes what fields should be repeated into views that are laid out as a
7597+ `row` or `column`.
7598+ """
7599+ vconcat: list['Spec']
7600+ """A list of views that should be concatenated and put into a column."""
7601+
7602+ hconcat: list['Spec']
7603+ """A list of views that should be concatenated and put into a row."""
7604+
76197605 data: Data | None = None
76207606 """An object describing the data source"""
76217607
@@ -7641,12 +7627,6 @@ class Spec:
76417627
76427628 __See also:__ The documentation for [width and height](size.html) contains more examples.
76437629 """
7644- layer: list[LayerSpec] | None = None
7645- """Layer or single view specifications to be layered.
7646-
7647- __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
7648- layering facet specifications is not allowed.
7649- """
76507630 name: str | None = None
76517631 """Name of the visualization for later reference."""
76527632
@@ -7689,15 +7669,6 @@ class Spec:
76897669
76907670 __See also:__ The documentation for [width and height](size.html) contains more examples.
76917671 """
7692- encoding: Encoding | None = None
7693- """A key-value mapping between encoding channels and definition of fields."""
7694-
7695- mark: MarkDef | Mark | None = None
7696- """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
7697- `"line"`,
7698- * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7699- object](mark.html#mark-def).
7700- """
77017672 projection: Projection | None = None
77027673 """An object defining properties of geographic projection.
77037674
@@ -7707,56 +7678,45 @@ class Spec:
77077678 selection: dict[str, SelectionDef] | None = None
77087679 """A key-value mapping between selection names and definitions."""
77097680
7710- facet: FacetMapping | None = None
7711- """An object that describes mappings between `row` and `column` channels and their field
7712- definitions.
7713- """
7714- spec: 'Spec | None' = None
7715- """A specification of the view that gets faceted."""
7716-
7717- repeat: Repeat | None = None
7718- """An object that describes what fields should be repeated into views that are laid out as a
7719- `row` or `column`.
7720- """
7721- vconcat: 'list[Spec] | None' = None
7722- """A list of views that should be concatenated and put into a column."""
7723-
7724- hconcat: 'list[Spec] | None' = None
7725- """A list of views that should be concatenated and put into a row."""
7726-
77277681 @staticmethod
77287682 def from_dict(obj: Any) -> 'Spec':
77297683 assert isinstance(obj, dict)
7684+ layer = from_list(LayerSpec.from_dict, obj.get("layer"))
7685+ encoding = Encoding.from_dict(obj.get("encoding"))
7686+ mark = from_union([MarkDef.from_dict, Mark], obj.get("mark"))
7687+ facet = FacetMapping.from_dict(obj.get("facet"))
7688+ spec = Spec.from_dict(obj.get("spec"))
7689+ repeat = Repeat.from_dict(obj.get("repeat"))
7690+ vconcat = from_list(Spec.from_dict, obj.get("vconcat"))
7691+ hconcat = from_list(Spec.from_dict, obj.get("hconcat"))
77307692 data = from_union([Data.from_dict, from_none], obj.get("data"))
77317693 description = from_union([from_str, from_none], obj.get("description"))
77327694 height = from_union([from_float, from_none], obj.get("height"))
7733- layer = from_union([lambda x: from_list(LayerSpec.from_dict, x), from_none], obj.get("layer"))
77347695 name = from_union([from_str, from_none], obj.get("name"))
77357696 resolve = from_union([Resolve.from_dict, from_none], obj.get("resolve"))
77367697 title = from_union([TitleParams.from_dict, from_str, from_none], obj.get("title"))
77377698 transform = from_union([lambda x: from_list(Transform.from_dict, x), from_none], obj.get("transform"))
77387699 width = from_union([from_float, from_none], obj.get("width"))
7739- encoding = from_union([Encoding.from_dict, from_none], obj.get("encoding"))
7740- mark = from_union([MarkDef.from_dict, Mark, from_none], obj.get("mark"))
77417700 projection = from_union([Projection.from_dict, from_none], obj.get("projection"))
77427701 selection = from_union([lambda x: from_dict(SelectionDef.from_dict, x), from_none], obj.get("selection"))
7743- facet = from_union([FacetMapping.from_dict, from_none], obj.get("facet"))
7744- spec = from_union([Spec.from_dict, from_none], obj.get("spec"))
7745- repeat = from_union([Repeat.from_dict, from_none], obj.get("repeat"))
7746- vconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("vconcat"))
7747- hconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("hconcat"))
7748- return Spec(data, description, height, layer, name, resolve, title, transform, width, encoding, mark, projection, selection, facet, spec, repeat, vconcat, hconcat)
7702+ return Spec(layer, encoding, mark, facet, spec, repeat, vconcat, hconcat, data, description, height, name, resolve, title, transform, width, projection, selection)
77497703
77507704 def to_dict(self) -> dict:
77517705 result: dict = {}
7706+ result["layer"] = from_list(lambda x: to_class(LayerSpec, x), self.layer)
7707+ result["encoding"] = to_class(Encoding, self.encoding)
7708+ result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x)], self.mark)
7709+ result["facet"] = to_class(FacetMapping, self.facet)
7710+ result["spec"] = to_class(Spec, self.spec)
7711+ result["repeat"] = to_class(Repeat, self.repeat)
7712+ result["vconcat"] = from_list(lambda x: to_class(Spec, x), self.vconcat)
7713+ result["hconcat"] = from_list(lambda x: to_class(Spec, x), self.hconcat)
77527714 if self.data is not None:
77537715 result["data"] = from_union([lambda x: to_class(Data, x), from_none], self.data)
77547716 if self.description is not None:
77557717 result["description"] = from_union([from_str, from_none], self.description)
77567718 if self.height is not None:
77577719 result["height"] = from_union([to_float, from_none], self.height)
7758- if self.layer is not None:
7759- result["layer"] = from_union([lambda x: from_list(lambda x: to_class(LayerSpec, x), x), from_none], self.layer)
77607720 if self.name is not None:
77617721 result["name"] = from_union([from_str, from_none], self.name)
77627722 if self.resolve is not None:
@@ -7767,29 +7727,47 @@ class Spec:
77677727 result["transform"] = from_union([lambda x: from_list(lambda x: to_class(Transform, x), x), from_none], self.transform)
77687728 if self.width is not None:
77697729 result["width"] = from_union([to_float, from_none], self.width)
7770- if self.encoding is not None:
7771- result["encoding"] = from_union([lambda x: to_class(Encoding, x), from_none], self.encoding)
7772- if self.mark is not None:
7773- result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x), from_none], self.mark)
77747730 if self.projection is not None:
77757731 result["projection"] = from_union([lambda x: to_class(Projection, x), from_none], self.projection)
77767732 if self.selection is not None:
77777733 result["selection"] = from_union([lambda x: from_dict(lambda x: to_class(SelectionDef, x), x), from_none], self.selection)
7778- if self.facet is not None:
7779- result["facet"] = from_union([lambda x: to_class(FacetMapping, x), from_none], self.facet)
7780- if self.spec is not None:
7781- result["spec"] = from_union([lambda x: to_class(Spec, x), from_none], self.spec)
7782- if self.repeat is not None:
7783- result["repeat"] = from_union([lambda x: to_class(Repeat, x), from_none], self.repeat)
7784- if self.vconcat is not None:
7785- result["vconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.vconcat)
7786- if self.hconcat is not None:
7787- result["hconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.hconcat)
77887734 return result
77897735
77907736
77917737 @dataclass
77927738 class TopLevel:
7739+ encoding: EncodingWithFacet
7740+ """A key-value mapping between encoding channels and definition of fields."""
7741+
7742+ mark: MarkDef | Mark
7743+ """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
7744+ `"line"`,
7745+ * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7746+ object](mark.html#mark-def).
7747+ """
7748+ layer: list[LayerSpec]
7749+ """Layer or single view specifications to be layered.
7750+
7751+ __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
7752+ layering facet specifications is not allowed.
7753+ """
7754+ facet: FacetMapping
7755+ """An object that describes mappings between `row` and `column` channels and their field
7756+ definitions.
7757+ """
7758+ spec: Spec
7759+ """A specification of the view that gets faceted."""
7760+
7761+ repeat: Repeat
7762+ """An object that describes what fields should be repeated into views that are laid out as a
7763+ `row` or `column`.
7764+ """
7765+ vconcat: list[Spec]
7766+ """A list of views that should be concatenated and put into a column."""
7767+
7768+ hconcat: list[Spec]
7769+ """A list of views that should be concatenated and put into a row."""
7770+
77937771 schema: str | None = None
77947772 """URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you
77957773 have a reason to change this, use `https://vega.github.io/schema/vega-lite/v2.json`.
@@ -7820,9 +7798,6 @@ class TopLevel:
78207798 description: str | None = None
78217799 """Description of this mark for commenting purpose."""
78227800
7823- encoding: EncodingWithFacet | None = None
7824- """A key-value mapping between encoding channels and definition of fields."""
7825-
78267801 height: float | None = None
78277802 """The height of a visualization.
78287803
@@ -7842,12 +7817,6 @@ class TopLevel:
78427817
78437818 __See also:__ The documentation for [width and height](size.html) contains more examples.
78447819 """
7845- mark: MarkDef | Mark | None = None
7846- """A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
7847- `"line"`,
7848- * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7849- object](mark.html#mark-def).
7850- """
78517820 name: str | None = None
78527821 """Name of the visualization for later reference."""
78537822
@@ -7896,12 +7865,6 @@ class TopLevel:
78967865
78977866 __See also:__ The documentation for [width and height](size.html) contains more examples.
78987867 """
7899- layer: list[LayerSpec] | None = None
7900- """Layer or single view specifications to be layered.
7901-
7902- __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
7903- layering facet specifications is not allowed.
7904- """
79057868 resolve: Resolve | None = None
79067869 """Scale, axis, and legend resolutions for layers.
79077870
@@ -7913,35 +7876,25 @@ class TopLevel:
79137876
79147877 Scale, axis, and legend resolutions for horizontally concatenated charts.
79157878 """
7916- facet: FacetMapping | None = None
7917- """An object that describes mappings between `row` and `column` channels and their field
7918- definitions.
7919- """
7920- spec: Spec | None = None
7921- """A specification of the view that gets faceted."""
7922-
7923- repeat: Repeat | None = None
7924- """An object that describes what fields should be repeated into views that are laid out as a
7925- `row` or `column`.
7926- """
7927- vconcat: list[Spec] | None = None
7928- """A list of views that should be concatenated and put into a column."""
7929-
7930- hconcat: list[Spec] | None = None
7931- """A list of views that should be concatenated and put into a row."""
79327879
79337880 @staticmethod
79347881 def from_dict(obj: Any) -> 'TopLevel':
79357882 assert isinstance(obj, dict)
7883+ encoding = EncodingWithFacet.from_dict(obj.get("encoding"))
7884+ mark = from_union([MarkDef.from_dict, Mark], obj.get("mark"))
7885+ layer = from_list(LayerSpec.from_dict, obj.get("layer"))
7886+ facet = FacetMapping.from_dict(obj.get("facet"))
7887+ spec = Spec.from_dict(obj.get("spec"))
7888+ repeat = Repeat.from_dict(obj.get("repeat"))
7889+ vconcat = from_list(Spec.from_dict, obj.get("vconcat"))
7890+ hconcat = from_list(Spec.from_dict, obj.get("hconcat"))
79367891 schema = from_union([from_str, from_none], obj.get("$schema"))
79377892 autosize = from_union([AutoSizeParams.from_dict, AutosizeType, from_none], obj.get("autosize"))
79387893 background = from_union([from_str, from_none], obj.get("background"))
79397894 config = from_union([Config.from_dict, from_none], obj.get("config"))
79407895 data = from_union([Data.from_dict, from_none], obj.get("data"))
79417896 description = from_union([from_str, from_none], obj.get("description"))
7942- encoding = from_union([EncodingWithFacet.from_dict, from_none], obj.get("encoding"))
79437897 height = from_union([from_float, from_none], obj.get("height"))
7944- mark = from_union([MarkDef.from_dict, Mark, from_none], obj.get("mark"))
79457898 name = from_union([from_str, from_none], obj.get("name"))
79467899 padding = from_union([from_float, PaddingClass.from_dict, from_none], obj.get("padding"))
79477900 projection = from_union([Projection.from_dict, from_none], obj.get("projection"))
@@ -7949,17 +7902,19 @@ class TopLevel:
79497902 title = from_union([TitleParams.from_dict, from_str, from_none], obj.get("title"))
79507903 transform = from_union([lambda x: from_list(Transform.from_dict, x), from_none], obj.get("transform"))
79517904 width = from_union([from_float, from_none], obj.get("width"))
7952- layer = from_union([lambda x: from_list(LayerSpec.from_dict, x), from_none], obj.get("layer"))
79537905 resolve = from_union([Resolve.from_dict, from_none], obj.get("resolve"))
7954- facet = from_union([FacetMapping.from_dict, from_none], obj.get("facet"))
7955- spec = from_union([Spec.from_dict, from_none], obj.get("spec"))
7956- repeat = from_union([Repeat.from_dict, from_none], obj.get("repeat"))
7957- vconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("vconcat"))
7958- hconcat = from_union([lambda x: from_list(Spec.from_dict, x), from_none], obj.get("hconcat"))
7959- return TopLevel(schema, autosize, background, config, data, description, encoding, height, mark, name, padding, projection, selection, title, transform, width, layer, resolve, facet, spec, repeat, vconcat, hconcat)
7906+ return TopLevel(encoding, mark, layer, facet, spec, repeat, vconcat, hconcat, schema, autosize, background, config, data, description, height, name, padding, projection, selection, title, transform, width, resolve)
79607907
79617908 def to_dict(self) -> dict:
79627909 result: dict = {}
7910+ result["encoding"] = to_class(EncodingWithFacet, self.encoding)
7911+ result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x)], self.mark)
7912+ result["layer"] = from_list(lambda x: to_class(LayerSpec, x), self.layer)
7913+ result["facet"] = to_class(FacetMapping, self.facet)
7914+ result["spec"] = to_class(Spec, self.spec)
7915+ result["repeat"] = to_class(Repeat, self.repeat)
7916+ result["vconcat"] = from_list(lambda x: to_class(Spec, x), self.vconcat)
7917+ result["hconcat"] = from_list(lambda x: to_class(Spec, x), self.hconcat)
79637918 if self.schema is not None:
79647919 result["$schema"] = from_union([from_str, from_none], self.schema)
79657920 if self.autosize is not None:
@@ -7972,12 +7927,8 @@ class TopLevel:
79727927 result["data"] = from_union([lambda x: to_class(Data, x), from_none], self.data)
79737928 if self.description is not None:
79747929 result["description"] = from_union([from_str, from_none], self.description)
7975- if self.encoding is not None:
7976- result["encoding"] = from_union([lambda x: to_class(EncodingWithFacet, x), from_none], self.encoding)
79777930 if self.height is not None:
79787931 result["height"] = from_union([to_float, from_none], self.height)
7979- if self.mark is not None:
7980- result["mark"] = from_union([lambda x: to_class(MarkDef, x), lambda x: to_enum(Mark, x), from_none], self.mark)
79817932 if self.name is not None:
79827933 result["name"] = from_union([from_str, from_none], self.name)
79837934 if self.padding is not None:
@@ -7992,20 +7943,8 @@ class TopLevel:
79927943 result["transform"] = from_union([lambda x: from_list(lambda x: to_class(Transform, x), x), from_none], self.transform)
79937944 if self.width is not None:
79947945 result["width"] = from_union([to_float, from_none], self.width)
7995- if self.layer is not None:
7996- result["layer"] = from_union([lambda x: from_list(lambda x: to_class(LayerSpec, x), x), from_none], self.layer)
79977946 if self.resolve is not None:
79987947 result["resolve"] = from_union([lambda x: to_class(Resolve, x), from_none], self.resolve)
7999- if self.facet is not None:
8000- result["facet"] = from_union([lambda x: to_class(FacetMapping, x), from_none], self.facet)
8001- if self.spec is not None:
8002- result["spec"] = from_union([lambda x: to_class(Spec, x), from_none], self.spec)
8003- if self.repeat is not None:
8004- result["repeat"] = from_union([lambda x: to_class(Repeat, x), from_none], self.repeat)
8005- if self.vconcat is not None:
8006- result["vconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.vconcat)
8007- if self.hconcat is not None:
8008- result["hconcat"] = from_union([lambda x: from_list(lambda x: to_class(Spec, x), x), from_none], self.hconcat)
80097948 return result
Mschema-rubydefault / TopLevel.rb+176 −176
@@ -4,7 +4,7 @@
44 # To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do:
55 #
66 # top_level = TopLevel.from_json! "{…}"
7-# puts top_level.hconcat&.first.hconcat&.first.hconcat&.first
7+# puts top_level.hconcat.first.hconcat.first.hconcat.first
88 #
99 # If from_json! succeeds, the value returned matches the schema.
1010
@@ -1962,7 +1962,7 @@ end
19621962 class VGScheme < Dry::Struct
19631963 attribute :count, Types::Double.optional
19641964 attribute :extent, Types.Array(Types::Double).optional
1965- attribute :scheme, Types::String.optional
1965+ attribute :scheme, Types::String
19661966 attribute :step, Types::Double.optional
19671967
19681968 def self.from_dynamic!(d)
@@ -1970,7 +1970,7 @@ class VGScheme < Dry::Struct
19701970 new(
19711971 count: d["count"],
19721972 extent: d["extent"],
1973- scheme: d["scheme"],
1973+ scheme: d.fetch("scheme"),
19741974 step: d["step"],
19751975 )
19761976 end
@@ -2543,7 +2543,7 @@ end
25432543 class VGBinding < Dry::Struct
25442544 attribute :element, Types::String.optional
25452545 attribute :input, Types::String
2546- attribute :vg_binding_options, Types.Array(Types::String).optional
2546+ attribute :vg_binding_options, Types.Array(Types::String)
25472547 attribute :max, Types::Double.optional
25482548 attribute :min, Types::Double.optional
25492549 attribute :step, Types::Double.optional
@@ -2553,7 +2553,7 @@ class VGBinding < Dry::Struct
25532553 new(
25542554 element: d["element"],
25552555 input: d.fetch("input"),
2556- vg_binding_options: d["options"],
2556+ vg_binding_options: d.fetch("options"),
25572557 max: d["max"],
25582558 min: d["min"],
25592559 step: d["step"],
@@ -4134,24 +4134,24 @@ class DataClass < Dry::Struct
41344134
41354135 # An URL from which to load the data set. Use the `format.type` property
41364136 # to ensure the loaded data is correctly parsed.
4137- attribute :url, Types::String.optional
4137+ attribute :url, Types::String
41384138
41394139 # The full data set, included inline. This can be an array of objects or primitive values
41404140 # or a string.
41414141 # Arrays of primitive values are ingested as objects with a `data` property. Strings are
41424142 # parsed according to the specified format type.
4143- attribute :values, Types.Instance(Values).optional
4143+ attribute :values, Types.Instance(Values)
41444144
41454145 # Provide a placeholder name and bind data at runtime.
4146- attribute :data_name, Types::String.optional
4146+ attribute :data_name, Types::String
41474147
41484148 def self.from_dynamic!(d)
41494149 d = Types::Hash[d]
41504150 new(
41514151 data_format: d["format"] ? DataFormat.from_dynamic!(d["format"]) : nil,
4152- url: d["url"],
4153- values: d["values"] ? Values.from_dynamic!(d["values"]) : nil,
4154- data_name: d["name"],
4152+ url: d.fetch("url"),
4153+ values: Values.from_dynamic!(d.fetch("values")),
4154+ data_name: d.fetch("name"),
41554155 )
41564156 end
41574157
@@ -4163,7 +4163,7 @@ class DataClass < Dry::Struct
41634163 {
41644164 "format" => data_format&.to_dynamic,
41654165 "url" => url,
4166- "values" => values&.to_dynamic,
4166+ "values" => values.to_dynamic,
41674167 "name" => data_name,
41684168 }
41694169 end
@@ -4608,16 +4608,16 @@ class SelectionOperand < Dry::Struct
46084608 end
46094609
46104610 class Selection < Dry::Struct
4611- attribute :selection_not, Types.Instance(SelectionOperand).optional
4612- attribute :selection_and, Types.Array(Types.Instance(SelectionOperand)).optional
4613- attribute :selection_or, Types.Array(Types.Instance(SelectionOperand)).optional
4611+ attribute :selection_not, Types.Instance(SelectionOperand)
4612+ attribute :selection_and, Types.Array(Types.Instance(SelectionOperand))
4613+ attribute :selection_or, Types.Array(Types.Instance(SelectionOperand))
46144614
46154615 def self.from_dynamic!(d)
46164616 d = Types::Hash[d]
46174617 new(
4618- selection_not: d["not"] ? SelectionOperand.from_dynamic!(d["not"]) : nil,
4619- selection_and: d["and"]&.map { |x| SelectionOperand.from_dynamic!(x) },
4620- selection_or: d["or"]&.map { |x| SelectionOperand.from_dynamic!(x) },
4618+ selection_not: SelectionOperand.from_dynamic!(d.fetch("not")),
4619+ selection_and: d.fetch("and").map { |x| SelectionOperand.from_dynamic!(x) },
4620+ selection_or: d.fetch("or").map { |x| SelectionOperand.from_dynamic!(x) },
46214621 )
46224622 end
46234623
@@ -4627,9 +4627,9 @@ class Selection < Dry::Struct
46274627
46284628 def to_dynamic
46294629 {
4630- "not" => selection_not&.to_dynamic,
4631- "and" => selection_and&.map { |x| x.to_dynamic },
4632- "or" => selection_or&.map { |x| x.to_dynamic },
4630+ "not" => selection_not.to_dynamic,
4631+ "and" => selection_and.map { |x| x.to_dynamic },
4632+ "or" => selection_or.map { |x| x.to_dynamic },
46334633 }
46344634 end
46354635
@@ -4739,17 +4739,17 @@ class LogicalOperandPredicate < Dry::Struct
47394739 end
47404740
47414741 class Predicate < Dry::Struct
4742- attribute :predicate_not, Types.Instance(LogicalOperandPredicate).optional
4743- attribute :predicate_and, Types.Array(Types.Instance(LogicalOperandPredicate)).optional
4744- attribute :predicate_or, Types.Array(Types.Instance(LogicalOperandPredicate)).optional
4742+ attribute :predicate_not, Types.Instance(LogicalOperandPredicate)
4743+ attribute :predicate_and, Types.Array(Types.Instance(LogicalOperandPredicate))
4744+ attribute :predicate_or, Types.Array(Types.Instance(LogicalOperandPredicate))
47454745
47464746 # The value that the field should be equal to.
4747- attribute :equal, Types.Instance(Equal).optional
4747+ attribute :equal, Types.Instance(Equal)
47484748
47494749 # Field to be filtered.
47504750 #
47514751 # Field to be filtered
4752- attribute :field, Types::String.optional
4752+ attribute :field, Types::String
47534753
47544754 # Time unit for the field to be filtered.
47554755 #
@@ -4758,27 +4758,27 @@ class Predicate < Dry::Struct
47584758
47594759 # An array of inclusive minimum and maximum values
47604760 # for a field value of a data item to be included in the filtered data.
4761- attribute :range, Types.Array(Types.Instance(RangeElement)).optional
4761+ attribute :range, Types.Array(Types.Instance(RangeElement))
47624762
47634763 # A set of values that the `field`'s value should be a member of,
47644764 # for a data item included in the filtered data.
4765- attribute :one_of, Types.Array(Types.Instance(Equal)).optional
4765+ attribute :one_of, Types.Array(Types.Instance(Equal))
47664766
47674767 # Filter using a selection name.
4768- attribute :selection, Types.Instance(SelectionOperand).optional
4768+ attribute :selection, Types.Instance(SelectionOperand)
47694769
47704770 def self.from_dynamic!(d)
47714771 d = Types::Hash[d]
47724772 new(
4773- predicate_not: d["not"] ? LogicalOperandPredicate.from_dynamic!(d["not"]) : nil,
4774- predicate_and: d["and"]&.map { |x| LogicalOperandPredicate.from_dynamic!(x) },
4775- predicate_or: d["or"]&.map { |x| LogicalOperandPredicate.from_dynamic!(x) },
4776- equal: d["equal"] ? Equal.from_dynamic!(d["equal"]) : nil,
4777- field: d["field"],
4773+ predicate_not: LogicalOperandPredicate.from_dynamic!(d.fetch("not")),
4774+ predicate_and: d.fetch("and").map { |x| LogicalOperandPredicate.from_dynamic!(x) },
4775+ predicate_or: d.fetch("or").map { |x| LogicalOperandPredicate.from_dynamic!(x) },
4776+ equal: Equal.from_dynamic!(d.fetch("equal")),
4777+ field: d.fetch("field"),
47784778 time_unit: d["timeUnit"],
4779- range: d["range"]&.map { |x| RangeElement.from_dynamic!(x) },
4780- one_of: d["oneOf"]&.map { |x| Equal.from_dynamic!(x) },
4781- selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil,
4779+ range: d.fetch("range").map { |x| RangeElement.from_dynamic!(x) },
4780+ one_of: d.fetch("oneOf").map { |x| Equal.from_dynamic!(x) },
4781+ selection: SelectionOperand.from_dynamic!(d.fetch("selection")),
47824782 )
47834783 end
47844784
@@ -4788,15 +4788,15 @@ class Predicate < Dry::Struct
47884788
47894789 def to_dynamic
47904790 {
4791- "not" => predicate_not&.to_dynamic,
4792- "and" => predicate_and&.map { |x| x.to_dynamic },
4793- "or" => predicate_or&.map { |x| x.to_dynamic },
4794- "equal" => equal&.to_dynamic,
4791+ "not" => predicate_not.to_dynamic,
4792+ "and" => predicate_and.map { |x| x.to_dynamic },
4793+ "or" => predicate_or.map { |x| x.to_dynamic },
4794+ "equal" => equal.to_dynamic,
47954795 "field" => field,
47964796 "timeUnit" => time_unit,
4797- "range" => range&.map { |x| x.to_dynamic },
4798- "oneOf" => one_of&.map { |x| x.to_dynamic },
4799- "selection" => selection&.to_dynamic,
4797+ "range" => range.map { |x| x.to_dynamic },
4798+ "oneOf" => one_of.map { |x| x.to_dynamic },
4799+ "selection" => selection.to_dynamic,
48004800 }
48014801 end
48024802
@@ -4847,7 +4847,7 @@ class ConditionalValueDefValue < Dry::Struct
48474847 end
48484848
48494849 class ConditionalValueDef < Dry::Struct
4850- attribute :conditional_value_def_test, Types.Instance(LogicalOperandPredicate).optional
4850+ attribute :conditional_value_def_test, Types.Instance(LogicalOperandPredicate)
48514851
48524852 # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
48534853 # `0` to `1` for opacity).
@@ -4855,14 +4855,14 @@ class ConditionalValueDef < Dry::Struct
48554855
48564856 # A [selection name](selection.html), or a series of [composed
48574857 # selections](selection.html#compose).
4858- attribute :selection, Types.Instance(SelectionOperand).optional
4858+ attribute :selection, Types.Instance(SelectionOperand)
48594859
48604860 def self.from_dynamic!(d)
48614861 d = Types::Hash[d]
48624862 new(
4863- conditional_value_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil,
4863+ conditional_value_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")),
48644864 value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")),
4865- selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil,
4865+ selection: SelectionOperand.from_dynamic!(d.fetch("selection")),
48664866 )
48674867 end
48684868
@@ -4872,9 +4872,9 @@ class ConditionalValueDef < Dry::Struct
48724872
48734873 def to_dynamic
48744874 {
4875- "test" => conditional_value_def_test&.to_dynamic,
4875+ "test" => conditional_value_def_test.to_dynamic,
48764876 "value" => value.to_dynamic,
4877- "selection" => selection&.to_dynamic,
4877+ "selection" => selection.to_dynamic,
48784878 }
48794879 end
48804880
@@ -5917,15 +5917,15 @@ class SortUnion < Dry::Struct
59175917 end
59185918
59195919 class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct
5920- attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate).optional
5920+ attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate)
59215921
59225922 # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
59235923 # `0` to `1` for opacity).
5924- attribute :value, Types.Instance(ConditionalValueDefValue).optional
5924+ attribute :value, Types.Instance(ConditionalValueDefValue)
59255925
59265926 # A [selection name](selection.html), or a series of [composed
59275927 # selections](selection.html#compose).
5928- attribute :selection, Types.Instance(SelectionOperand).optional
5928+ attribute :selection, Types.Instance(SelectionOperand)
59295929
59305930 # Aggregation function for the field
59315931 # (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -5983,14 +5983,14 @@ class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct
59835983 # `"nominal"`).
59845984 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
59855985 # [geographic projection](projection.html) is applied.
5986- attribute :conditional_def_type, Types::Type.optional
5986+ attribute :conditional_def_type, Types::Type
59875987
59885988 def self.from_dynamic!(d)
59895989 d = Types::Hash[d]
59905990 new(
5991- conditional_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil,
5992- value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
5993- selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil,
5991+ conditional_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")),
5992+ value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")),
5993+ selection: SelectionOperand.from_dynamic!(d.fetch("selection")),
59945994 aggregate: d["aggregate"],
59955995 bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil,
59965996 field: d["field"] ? Field.from_dynamic!(d["field"]) : nil,
@@ -5998,7 +5998,7 @@ class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct
59985998 scale: d["scale"] ? Scale.from_dynamic!(d["scale"]) : nil,
59995999 sort: d["sort"] ? SortUnion.from_dynamic!(d["sort"]) : nil,
60006000 time_unit: d["timeUnit"],
6001- conditional_def_type: d["type"],
6001+ conditional_def_type: d.fetch("type"),
60026002 )
60036003 end
60046004
@@ -6008,9 +6008,9 @@ class ConditionalPredicateMarkPropFieldDefClass < Dry::Struct
60086008
60096009 def to_dynamic
60106010 {
6011- "test" => conditional_def_test&.to_dynamic,
6012- "value" => value&.to_dynamic,
6013- "selection" => selection&.to_dynamic,
6011+ "test" => conditional_def_test.to_dynamic,
6012+ "value" => value.to_dynamic,
6013+ "selection" => selection.to_dynamic,
60146014 "aggregate" => aggregate,
60156015 "bin" => bin&.to_dynamic,
60166016 "field" => field&.to_dynamic,
@@ -6174,7 +6174,7 @@ class MarkPropDefWithCondition < Dry::Struct
61746174 # `"nominal"`).
61756175 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
61766176 # [geographic projection](projection.html) is applied.
6177- attribute :mark_prop_def_with_condition_type, Types::Type.optional
6177+ attribute :mark_prop_def_with_condition_type, Types::Type
61786178
61796179 # A constant value in visual domain.
61806180 attribute :value, Types.Instance(ConditionalValueDefValue).optional
@@ -6190,7 +6190,7 @@ class MarkPropDefWithCondition < Dry::Struct
61906190 scale: d["scale"] ? Scale.from_dynamic!(d["scale"]) : nil,
61916191 sort: d["sort"] ? SortUnion.from_dynamic!(d["sort"]) : nil,
61926192 time_unit: d["timeUnit"],
6193- mark_prop_def_with_condition_type: d["type"],
6193+ mark_prop_def_with_condition_type: d.fetch("type"),
61946194 value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
61956195 )
61966196 end
@@ -6473,15 +6473,15 @@ class Detail < Dry::Struct
64736473 end
64746474
64756475 class ConditionalPredicateFieldDefClass < Dry::Struct
6476- attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate).optional
6476+ attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate)
64776477
64786478 # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
64796479 # `0` to `1` for opacity).
6480- attribute :value, Types.Instance(ConditionalValueDefValue).optional
6480+ attribute :value, Types.Instance(ConditionalValueDefValue)
64816481
64826482 # A [selection name](selection.html), or a series of [composed
64836483 # selections](selection.html#compose).
6484- attribute :selection, Types.Instance(SelectionOperand).optional
6484+ attribute :selection, Types.Instance(SelectionOperand)
64856485
64866486 # Aggregation function for the field
64876487 # (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -6518,19 +6518,19 @@ class ConditionalPredicateFieldDefClass < Dry::Struct
65186518 # `"nominal"`).
65196519 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
65206520 # [geographic projection](projection.html) is applied.
6521- attribute :conditional_def_type, Types::Type.optional
6521+ attribute :conditional_def_type, Types::Type
65226522
65236523 def self.from_dynamic!(d)
65246524 d = Types::Hash[d]
65256525 new(
6526- conditional_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil,
6527- value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
6528- selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil,
6526+ conditional_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")),
6527+ value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")),
6528+ selection: SelectionOperand.from_dynamic!(d.fetch("selection")),
65296529 aggregate: d["aggregate"],
65306530 bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil,
65316531 field: d["field"] ? Field.from_dynamic!(d["field"]) : nil,
65326532 time_unit: d["timeUnit"],
6533- conditional_def_type: d["type"],
6533+ conditional_def_type: d.fetch("type"),
65346534 )
65356535 end
65366536
@@ -6540,9 +6540,9 @@ class ConditionalPredicateFieldDefClass < Dry::Struct
65406540
65416541 def to_dynamic
65426542 {
6543- "test" => conditional_def_test&.to_dynamic,
6544- "value" => value&.to_dynamic,
6545- "selection" => selection&.to_dynamic,
6543+ "test" => conditional_def_test.to_dynamic,
6544+ "value" => value.to_dynamic,
6545+ "selection" => selection.to_dynamic,
65466546 "aggregate" => aggregate,
65476547 "bin" => bin&.to_dynamic,
65486548 "field" => field&.to_dynamic,
@@ -6655,7 +6655,7 @@ class DefWithCondition < Dry::Struct
66556655 # `"nominal"`).
66566656 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
66576657 # [geographic projection](projection.html) is applied.
6658- attribute :def_with_condition_type, Types::Type.optional
6658+ attribute :def_with_condition_type, Types::Type
66596659
66606660 # A constant value in visual domain.
66616661 attribute :value, Types.Instance(ConditionalValueDefValue).optional
@@ -6668,7 +6668,7 @@ class DefWithCondition < Dry::Struct
66686668 condition: d["condition"] ? HrefCondition.from_dynamic!(d["condition"]) : nil,
66696669 field: d["field"] ? Field.from_dynamic!(d["field"]) : nil,
66706670 time_unit: d["timeUnit"],
6671- def_with_condition_type: d["type"],
6671+ def_with_condition_type: d.fetch("type"),
66726672 value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
66736673 )
66746674 end
@@ -6808,15 +6808,15 @@ class Order < Dry::Struct
68086808 end
68096809
68106810 class ConditionalPredicateTextFieldDefClass < Dry::Struct
6811- attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate).optional
6811+ attribute :conditional_def_test, Types.Instance(LogicalOperandPredicate)
68126812
68136813 # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
68146814 # `0` to `1` for opacity).
6815- attribute :value, Types.Instance(ConditionalValueDefValue).optional
6815+ attribute :value, Types.Instance(ConditionalValueDefValue)
68166816
68176817 # A [selection name](selection.html), or a series of [composed
68186818 # selections](selection.html#compose).
6819- attribute :selection, Types.Instance(SelectionOperand).optional
6819+ attribute :selection, Types.Instance(SelectionOperand)
68206820
68216821 # Aggregation function for the field
68226822 # (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -6857,20 +6857,20 @@ class ConditionalPredicateTextFieldDefClass < Dry::Struct
68576857 # `"nominal"`).
68586858 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
68596859 # [geographic projection](projection.html) is applied.
6860- attribute :conditional_def_type, Types::Type.optional
6860+ attribute :conditional_def_type, Types::Type
68616861
68626862 def self.from_dynamic!(d)
68636863 d = Types::Hash[d]
68646864 new(
6865- conditional_def_test: d["test"] ? LogicalOperandPredicate.from_dynamic!(d["test"]) : nil,
6866- value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
6867- selection: d["selection"] ? SelectionOperand.from_dynamic!(d["selection"]) : nil,
6865+ conditional_def_test: LogicalOperandPredicate.from_dynamic!(d.fetch("test")),
6866+ value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")),
6867+ selection: SelectionOperand.from_dynamic!(d.fetch("selection")),
68686868 aggregate: d["aggregate"],
68696869 bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil,
68706870 field: d["field"] ? Field.from_dynamic!(d["field"]) : nil,
68716871 conditional_def_format: d["format"],
68726872 time_unit: d["timeUnit"],
6873- conditional_def_type: d["type"],
6873+ conditional_def_type: d.fetch("type"),
68746874 )
68756875 end
68766876
@@ -6880,9 +6880,9 @@ class ConditionalPredicateTextFieldDefClass < Dry::Struct
68806880
68816881 def to_dynamic
68826882 {
6883- "test" => conditional_def_test&.to_dynamic,
6884- "value" => value&.to_dynamic,
6885- "selection" => selection&.to_dynamic,
6883+ "test" => conditional_def_test.to_dynamic,
6884+ "value" => value.to_dynamic,
6885+ "selection" => selection.to_dynamic,
68866886 "aggregate" => aggregate,
68876887 "bin" => bin&.to_dynamic,
68886888 "field" => field&.to_dynamic,
@@ -7002,7 +7002,7 @@ class TextDefWithCondition < Dry::Struct
70027002 # `"nominal"`).
70037003 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
70047004 # [geographic projection](projection.html) is applied.
7005- attribute :text_def_with_condition_type, Types::Type.optional
7005+ attribute :text_def_with_condition_type, Types::Type
70067006
70077007 # A constant value in visual domain.
70087008 attribute :value, Types.Instance(ConditionalValueDefValue).optional
@@ -7016,7 +7016,7 @@ class TextDefWithCondition < Dry::Struct
70167016 field: d["field"] ? Field.from_dynamic!(d["field"]) : nil,
70177017 text_def_with_condition_format: d["format"],
70187018 time_unit: d["timeUnit"],
7019- text_def_with_condition_type: d["type"],
7019+ text_def_with_condition_type: d.fetch("type"),
70207020 value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
70217021 )
70227022 end
@@ -7371,11 +7371,11 @@ class XClass < Dry::Struct
73717371 # `"nominal"`).
73727372 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
73737373 # [geographic projection](projection.html) is applied.
7374- attribute :def_type, Types::Type.optional
7374+ attribute :def_type, Types::Type
73757375
73767376 # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
73777377 # `0` to `1` for opacity).
7378- attribute :value, Types.Instance(ConditionalValueDefValue).optional
7378+ attribute :value, Types.Instance(ConditionalValueDefValue)
73797379
73807380 def self.from_dynamic!(d)
73817381 d = Types::Hash[d]
@@ -7388,8 +7388,8 @@ class XClass < Dry::Struct
73887388 sort: d["sort"] ? SortUnion.from_dynamic!(d["sort"]) : nil,
73897389 stack: d["stack"],
73907390 time_unit: d["timeUnit"],
7391- def_type: d["type"],
7392- value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
7391+ def_type: d.fetch("type"),
7392+ value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")),
73937393 )
73947394 end
73957395
@@ -7408,7 +7408,7 @@ class XClass < Dry::Struct
74087408 "stack" => stack,
74097409 "timeUnit" => time_unit,
74107410 "type" => def_type,
7411- "value" => value&.to_dynamic,
7411+ "value" => value.to_dynamic,
74127412 }
74137413 end
74147414
@@ -7461,11 +7461,11 @@ class X2Class < Dry::Struct
74617461 # `"nominal"`).
74627462 # It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
74637463 # [geographic projection](projection.html) is applied.
7464- attribute :def_type, Types::Type.optional
7464+ attribute :def_type, Types::Type
74657465
74667466 # A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
74677467 # `0` to `1` for opacity).
7468- attribute :value, Types.Instance(ConditionalValueDefValue).optional
7468+ attribute :value, Types.Instance(ConditionalValueDefValue)
74697469
74707470 def self.from_dynamic!(d)
74717471 d = Types::Hash[d]
@@ -7474,8 +7474,8 @@ class X2Class < Dry::Struct
74747474 bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil,
74757475 field: d["field"] ? Field.from_dynamic!(d["field"]) : nil,
74767476 time_unit: d["timeUnit"],
7477- def_type: d["type"],
7478- value: d["value"] ? ConditionalValueDefValue.from_dynamic!(d["value"]) : nil,
7477+ def_type: d.fetch("type"),
7478+ value: ConditionalValueDefValue.from_dynamic!(d.fetch("value")),
74797479 )
74807480 end
74817481
@@ -7490,7 +7490,7 @@ class X2Class < Dry::Struct
74907490 "field" => field&.to_dynamic,
74917491 "timeUnit" => time_unit,
74927492 "type" => def_type,
7493- "value" => value&.to_dynamic,
7493+ "value" => value.to_dynamic,
74947494 }
74957495 end
74967496
@@ -8744,7 +8744,7 @@ class Transform < Dry::Struct
87448744 # predicate](filter.html#one-of-predicate);
87458745 # (3) a [selection predicate](filter.html#selection-predicate);
87468746 # or (4) a logical operand that combines (1), (2), or (3).
8747- attribute :filter, Types.Instance(LogicalOperandPredicate).optional
8747+ attribute :filter, Types.Instance(LogicalOperandPredicate)
87488748
87498749 # The field for storing the computed formula value.
87508750 #
@@ -8760,7 +8760,7 @@ class Transform < Dry::Struct
87608760
87618761 # A [expression](types.html#expression) string. Use the variable `datum` to refer to the
87628762 # current data object.
8763- attribute :calculate, Types::String.optional
8763+ attribute :calculate, Types::String
87648764
87658765 # The default value to use if lookup fails.
87668766 #
@@ -8768,24 +8768,24 @@ class Transform < Dry::Struct
87688768 attribute :transform_default, Types::String.optional
87698769
87708770 # Secondary data reference.
8771- attribute :from, LookupData.optional
8771+ attribute :from, LookupData
87728772
87738773 # Key in primary data source.
8774- attribute :lookup, Types::String.optional
8774+ attribute :lookup, Types::String
87758775
87768776 # An object indicating bin properties, or simply `true` for using default bin parameters.
8777- attribute :bin, Types.Instance(Bin).optional
8777+ attribute :bin, Types.Instance(Bin)
87788778
87798779 # The data field to bin.
87808780 #
87818781 # The data field to apply time unit.
8782- attribute :field, Types::String.optional
8782+ attribute :field, Types::String
87838783
87848784 # The timeUnit.
8785- attribute :time_unit, Types::TimeUnit.optional
8785+ attribute :time_unit, Types::TimeUnit
87868786
87878787 # Array of objects that define fields to aggregate.
8788- attribute :aggregate, Types.Array(AggregatedFieldDef).optional
8788+ attribute :aggregate, Types.Array(AggregatedFieldDef)
87898789
87908790 # The data fields to group by. If not specified, a single group containing all data objects
87918791 # will be used.
@@ -8794,16 +8794,16 @@ class Transform < Dry::Struct
87948794 def self.from_dynamic!(d)
87958795 d = Types::Hash[d]
87968796 new(
8797- filter: d["filter"] ? LogicalOperandPredicate.from_dynamic!(d["filter"]) : nil,
8797+ filter: LogicalOperandPredicate.from_dynamic!(d.fetch("filter")),
87988798 as: d["as"] ? Style.from_dynamic!(d["as"]) : nil,
8799- calculate: d["calculate"],
8799+ calculate: d.fetch("calculate"),
88008800 transform_default: d["default"],
8801- from: d["from"] ? LookupData.from_dynamic!(d["from"]) : nil,
8802- lookup: d["lookup"],
8803- bin: d["bin"] ? Bin.from_dynamic!(d["bin"]) : nil,
8804- field: d["field"],
8805- time_unit: d["timeUnit"],
8806- aggregate: d["aggregate"]&.map { |x| AggregatedFieldDef.from_dynamic!(x) },
8801+ from: LookupData.from_dynamic!(d.fetch("from")),
8802+ lookup: d.fetch("lookup"),
8803+ bin: Bin.from_dynamic!(d.fetch("bin")),
8804+ field: d.fetch("field"),
8805+ time_unit: d.fetch("timeUnit"),
8806+ aggregate: d.fetch("aggregate").map { |x| AggregatedFieldDef.from_dynamic!(x) },
88078807 groupby: d["groupby"],
88088808 )
88098809 end
@@ -8814,16 +8814,16 @@ class Transform < Dry::Struct
88148814
88158815 def to_dynamic
88168816 {
8817- "filter" => filter&.to_dynamic,
8817+ "filter" => filter.to_dynamic,
88188818 "as" => as&.to_dynamic,
88198819 "calculate" => calculate,
88208820 "default" => transform_default,
8821- "from" => from&.to_dynamic,
8821+ "from" => from.to_dynamic,
88228822 "lookup" => lookup,
8823- "bin" => bin&.to_dynamic,
8823+ "bin" => bin.to_dynamic,
88248824 "field" => field,
88258825 "timeUnit" => time_unit,
8826- "aggregate" => aggregate&.map { |x| x.to_dynamic },
8826+ "aggregate" => aggregate.map { |x| x.to_dynamic },
88278827 "groupby" => groupby,
88288828 }
88298829 end
@@ -8865,7 +8865,7 @@ class LayerSpec < Dry::Struct
88658865 #
88668866 # __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
88678867 # layering facet specifications is not allowed.
8868- attribute :layer, Types.Array(LayerSpec).optional
8868+ attribute :layer, Types.Array(LayerSpec)
88698869
88708870 # Name of the visualization for later reference.
88718871 attribute :layer_spec_name, Types::String.optional
@@ -8902,13 +8902,13 @@ class LayerSpec < Dry::Struct
89028902 attribute :width, Types::Double.optional
89038903
89048904 # A key-value mapping between encoding channels and definition of fields.
8905- attribute :encoding, EncodingClass.optional
8905+ attribute :encoding, EncodingClass
89068906
89078907 # A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
89088908 # `"line"`,
89098909 # * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
89108910 # object](mark.html#mark-def).
8911- attribute :mark, Types.Instance(AnyMark).optional
8911+ attribute :mark, Types.Instance(AnyMark)
89128912
89138913 # An object defining properties of geographic projection.
89148914 #
@@ -8925,14 +8925,14 @@ class LayerSpec < Dry::Struct
89258925 data: d["data"] ? DataClass.from_dynamic!(d["data"]) : nil,
89268926 description: d["description"],
89278927 height: d["height"],
8928- layer: d["layer"]&.map { |x| LayerSpec.from_dynamic!(x) },
8928+ layer: d.fetch("layer").map { |x| LayerSpec.from_dynamic!(x) },
89298929 layer_spec_name: d["name"],
89308930 resolve: d["resolve"] ? Resolve.from_dynamic!(d["resolve"]) : nil,
89318931 title: d["title"] ? Title.from_dynamic!(d["title"]) : nil,
89328932 transform: d["transform"]&.map { |x| Transform.from_dynamic!(x) },
89338933 width: d["width"],
8934- encoding: d["encoding"] ? EncodingClass.from_dynamic!(d["encoding"]) : nil,
8935- mark: d["mark"] ? AnyMark.from_dynamic!(d["mark"]) : nil,
8934+ encoding: EncodingClass.from_dynamic!(d.fetch("encoding")),
8935+ mark: AnyMark.from_dynamic!(d.fetch("mark")),
89368936 projection: d["projection"] ? Projection.from_dynamic!(d["projection"]) : nil,
89378937 selection: Types::Hash.optional[d["selection"]]&.map { |k, v| [k, SelectionDef.from_dynamic!(v)] }&.to_h,
89388938 )
@@ -8947,14 +8947,14 @@ class LayerSpec < Dry::Struct
89478947 "data" => data&.to_dynamic,
89488948 "description" => description,
89498949 "height" => height,
8950- "layer" => layer&.map { |x| x.to_dynamic },
8950+ "layer" => layer.map { |x| x.to_dynamic },
89518951 "name" => layer_spec_name,
89528952 "resolve" => resolve&.to_dynamic,
89538953 "title" => title&.to_dynamic,
89548954 "transform" => transform&.map { |x| x.to_dynamic },
89558955 "width" => width,
8956- "encoding" => encoding&.to_dynamic,
8957- "mark" => mark&.to_dynamic,
8956+ "encoding" => encoding.to_dynamic,
8957+ "mark" => mark.to_dynamic,
89588958 "projection" => projection&.to_dynamic,
89598959 "selection" => selection&.map { |k, v| [k, v.to_dynamic] }.to_h,
89608960 }
@@ -9031,7 +9031,7 @@ class Spec < Dry::Struct
90319031 #
90329032 # __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
90339033 # layering facet specifications is not allowed.
9034- attribute :layer, Types.Array(LayerSpec).optional
9034+ attribute :layer, Types.Array(LayerSpec)
90359035
90369036 # Name of the visualization for later reference.
90379037 attribute :spec_name, Types::String.optional
@@ -9076,13 +9076,13 @@ class Spec < Dry::Struct
90769076 attribute :width, Types::Double.optional
90779077
90789078 # A key-value mapping between encoding channels and definition of fields.
9079- attribute :encoding, EncodingClass.optional
9079+ attribute :encoding, EncodingClass
90809080
90819081 # A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
90829082 # `"line"`,
90839083 # * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
90849084 # object](mark.html#mark-def).
9085- attribute :mark, Types.Instance(AnyMark).optional
9085+ attribute :mark, Types.Instance(AnyMark)
90869086
90879087 # An object defining properties of geographic projection.
90889088 #
@@ -9095,20 +9095,20 @@ class Spec < Dry::Struct
90959095
90969096 # An object that describes mappings between `row` and `column` channels and their field
90979097 # definitions.
9098- attribute :facet, FacetMapping.optional
9098+ attribute :facet, FacetMapping
90999099
91009100 # A specification of the view that gets faceted.
9101- attribute :spec, Spec.optional
9101+ attribute :spec, Spec
91029102
91039103 # An object that describes what fields should be repeated into views that are laid out as a
91049104 # `row` or `column`.
9105- attribute :repeat, Repeat.optional
9105+ attribute :repeat, Repeat
91069106
91079107 # A list of views that should be concatenated and put into a column.
9108- attribute :vconcat, Types.Array(Spec).optional
9108+ attribute :vconcat, Types.Array(Spec)
91099109
91109110 # A list of views that should be concatenated and put into a row.
9111- attribute :hconcat, Types.Array(Spec).optional
9111+ attribute :hconcat, Types.Array(Spec)
91129112
91139113 def self.from_dynamic!(d)
91149114 d = Types::Hash[d]
@@ -9116,21 +9116,21 @@ class Spec < Dry::Struct
91169116 data: d["data"] ? DataClass.from_dynamic!(d["data"]) : nil,
91179117 description: d["description"],
91189118 height: d["height"],
9119- layer: d["layer"]&.map { |x| LayerSpec.from_dynamic!(x) },
9119+ layer: d.fetch("layer").map { |x| LayerSpec.from_dynamic!(x) },
91209120 spec_name: d["name"],
91219121 resolve: d["resolve"] ? Resolve.from_dynamic!(d["resolve"]) : nil,
91229122 title: d["title"] ? Title.from_dynamic!(d["title"]) : nil,
91239123 transform: d["transform"]&.map { |x| Transform.from_dynamic!(x) },
91249124 width: d["width"],
9125- encoding: d["encoding"] ? EncodingClass.from_dynamic!(d["encoding"]) : nil,
9126- mark: d["mark"] ? AnyMark.from_dynamic!(d["mark"]) : nil,
9125+ encoding: EncodingClass.from_dynamic!(d.fetch("encoding")),
9126+ mark: AnyMark.from_dynamic!(d.fetch("mark")),
91279127 projection: d["projection"] ? Projection.from_dynamic!(d["projection"]) : nil,
91289128 selection: Types::Hash.optional[d["selection"]]&.map { |k, v| [k, SelectionDef.from_dynamic!(v)] }&.to_h,
9129- facet: d["facet"] ? FacetMapping.from_dynamic!(d["facet"]) : nil,
9130- spec: d["spec"] ? Spec.from_dynamic!(d["spec"]) : nil,
9131- repeat: d["repeat"] ? Repeat.from_dynamic!(d["repeat"]) : nil,
9132- vconcat: d["vconcat"]&.map { |x| Spec.from_dynamic!(x) },
9133- hconcat: d["hconcat"]&.map { |x| Spec.from_dynamic!(x) },
9129+ facet: FacetMapping.from_dynamic!(d.fetch("facet")),
9130+ spec: Spec.from_dynamic!(d.fetch("spec")),
9131+ repeat: Repeat.from_dynamic!(d.fetch("repeat")),
9132+ vconcat: d.fetch("vconcat").map { |x| Spec.from_dynamic!(x) },
9133+ hconcat: d.fetch("hconcat").map { |x| Spec.from_dynamic!(x) },
91349134 )
91359135 end
91369136
@@ -9143,21 +9143,21 @@ class Spec < Dry::Struct
91439143 "data" => data&.to_dynamic,
91449144 "description" => description,
91459145 "height" => height,
9146- "layer" => layer&.map { |x| x.to_dynamic },
9146+ "layer" => layer.map { |x| x.to_dynamic },
91479147 "name" => spec_name,
91489148 "resolve" => resolve&.to_dynamic,
91499149 "title" => title&.to_dynamic,
91509150 "transform" => transform&.map { |x| x.to_dynamic },
91519151 "width" => width,
9152- "encoding" => encoding&.to_dynamic,
9153- "mark" => mark&.to_dynamic,
9152+ "encoding" => encoding.to_dynamic,
9153+ "mark" => mark.to_dynamic,
91549154 "projection" => projection&.to_dynamic,
91559155 "selection" => selection&.map { |k, v| [k, v.to_dynamic] }.to_h,
9156- "facet" => facet&.to_dynamic,
9157- "spec" => spec&.to_dynamic,
9158- "repeat" => repeat&.to_dynamic,
9159- "vconcat" => vconcat&.map { |x| x.to_dynamic },
9160- "hconcat" => hconcat&.map { |x| x.to_dynamic },
9156+ "facet" => facet.to_dynamic,
9157+ "spec" => spec.to_dynamic,
9158+ "repeat" => repeat.to_dynamic,
9159+ "vconcat" => vconcat.map { |x| x.to_dynamic },
9160+ "hconcat" => hconcat.map { |x| x.to_dynamic },
91619161 }
91629162 end
91639163
@@ -9199,7 +9199,7 @@ class TopLevel < Dry::Struct
91999199 attribute :description, Types::String.optional
92009200
92019201 # A key-value mapping between encoding channels and definition of fields.
9202- attribute :encoding, EncodingWithFacet.optional
9202+ attribute :encoding, EncodingWithFacet
92039203
92049204 # The height of a visualization.
92059205 #
@@ -9224,7 +9224,7 @@ class TopLevel < Dry::Struct
92249224 # `"line"`,
92259225 # * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
92269226 # object](mark.html#mark-def).
9227- attribute :mark, Types.Instance(AnyMark).optional
9227+ attribute :mark, Types.Instance(AnyMark)
92289228
92299229 # Name of the visualization for later reference.
92309230 attribute :top_level_name, Types::String.optional
@@ -9278,7 +9278,7 @@ class TopLevel < Dry::Struct
92789278 #
92799279 # __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
92809280 # layering facet specifications is not allowed.
9281- attribute :layer, Types.Array(LayerSpec).optional
9281+ attribute :layer, Types.Array(LayerSpec)
92829282
92839283 # Scale, axis, and legend resolutions for layers.
92849284 #
@@ -9293,20 +9293,20 @@ class TopLevel < Dry::Struct
92939293
92949294 # An object that describes mappings between `row` and `column` channels and their field
92959295 # definitions.
9296- attribute :facet, FacetMapping.optional
9296+ attribute :facet, FacetMapping
92979297
92989298 # A specification of the view that gets faceted.
9299- attribute :spec, Spec.optional
9299+ attribute :spec, Spec
93009300
93019301 # An object that describes what fields should be repeated into views that are laid out as a
93029302 # `row` or `column`.
9303- attribute :repeat, Repeat.optional
9303+ attribute :repeat, Repeat
93049304
93059305 # A list of views that should be concatenated and put into a column.
9306- attribute :vconcat, Types.Array(Spec).optional
9306+ attribute :vconcat, Types.Array(Spec)
93079307
93089308 # A list of views that should be concatenated and put into a row.
9309- attribute :hconcat, Types.Array(Spec).optional
9309+ attribute :hconcat, Types.Array(Spec)
93109310
93119311 def self.from_dynamic!(d)
93129312 d = Types::Hash[d]
@@ -9317,9 +9317,9 @@ class TopLevel < Dry::Struct
93179317 config: d["config"] ? Config.from_dynamic!(d["config"]) : nil,
93189318 data: d["data"] ? DataClass.from_dynamic!(d["data"]) : nil,
93199319 description: d["description"],
9320- encoding: d["encoding"] ? EncodingWithFacet.from_dynamic!(d["encoding"]) : nil,
9320+ encoding: EncodingWithFacet.from_dynamic!(d.fetch("encoding")),
93219321 height: d["height"],
9322- mark: d["mark"] ? AnyMark.from_dynamic!(d["mark"]) : nil,
9322+ mark: AnyMark.from_dynamic!(d.fetch("mark")),
93239323 top_level_name: d["name"],
93249324 padding: d["padding"] ? Padding.from_dynamic!(d["padding"]) : nil,
93259325 projection: d["projection"] ? Projection.from_dynamic!(d["projection"]) : nil,
@@ -9327,13 +9327,13 @@ class TopLevel < Dry::Struct
93279327 title: d["title"] ? Title.from_dynamic!(d["title"]) : nil,
93289328 transform: d["transform"]&.map { |x| Transform.from_dynamic!(x) },
93299329 width: d["width"],
9330- layer: d["layer"]&.map { |x| LayerSpec.from_dynamic!(x) },
9330+ layer: d.fetch("layer").map { |x| LayerSpec.from_dynamic!(x) },
93319331 resolve: d["resolve"] ? Resolve.from_dynamic!(d["resolve"]) : nil,
9332- facet: d["facet"] ? FacetMapping.from_dynamic!(d["facet"]) : nil,
9333- spec: d["spec"] ? Spec.from_dynamic!(d["spec"]) : nil,
9334- repeat: d["repeat"] ? Repeat.from_dynamic!(d["repeat"]) : nil,
9335- vconcat: d["vconcat"]&.map { |x| Spec.from_dynamic!(x) },
9336- hconcat: d["hconcat"]&.map { |x| Spec.from_dynamic!(x) },
9332+ facet: FacetMapping.from_dynamic!(d.fetch("facet")),
9333+ spec: Spec.from_dynamic!(d.fetch("spec")),
9334+ repeat: Repeat.from_dynamic!(d.fetch("repeat")),
9335+ vconcat: d.fetch("vconcat").map { |x| Spec.from_dynamic!(x) },
9336+ hconcat: d.fetch("hconcat").map { |x| Spec.from_dynamic!(x) },
93379337 )
93389338 end
93399339
@@ -9349,9 +9349,9 @@ class TopLevel < Dry::Struct
93499349 "config" => config&.to_dynamic,
93509350 "data" => data&.to_dynamic,
93519351 "description" => description,
9352- "encoding" => encoding&.to_dynamic,
9352+ "encoding" => encoding.to_dynamic,
93539353 "height" => height,
9354- "mark" => mark&.to_dynamic,
9354+ "mark" => mark.to_dynamic,
93559355 "name" => top_level_name,
93569356 "padding" => padding&.to_dynamic,
93579357 "projection" => projection&.to_dynamic,
@@ -9359,13 +9359,13 @@ class TopLevel < Dry::Struct
93599359 "title" => title&.to_dynamic,
93609360 "transform" => transform&.map { |x| x.to_dynamic },
93619361 "width" => width,
9362- "layer" => layer&.map { |x| x.to_dynamic },
9362+ "layer" => layer.map { |x| x.to_dynamic },
93639363 "resolve" => resolve&.to_dynamic,
9364- "facet" => facet&.to_dynamic,
9365- "spec" => spec&.to_dynamic,
9366- "repeat" => repeat&.to_dynamic,
9367- "vconcat" => vconcat&.map { |x| x.to_dynamic },
9368- "hconcat" => hconcat&.map { |x| x.to_dynamic },
9364+ "facet" => facet.to_dynamic,
9365+ "spec" => spec.to_dynamic,
9366+ "repeat" => repeat.to_dynamic,
9367+ "vconcat" => vconcat.map { |x| x.to_dynamic },
9368+ "hconcat" => hconcat.map { |x| x.to_dynamic },
93699369 }
93709370 end
Mschema-rustdefault / module_under_test.rs+92 −125
@@ -48,7 +48,7 @@ pub struct TopLevel {
4848 pub description: Option<String>,
4949
5050 /// A key-value mapping between encoding channels and definition of fields.
51- pub encoding: Option<EncodingWithFacet>,
51+ pub encoding: EncodingWithFacet,
5252
5353 /// The height of a visualization.
5454 ///
@@ -73,7 +73,7 @@ pub struct TopLevel {
7373 /// `"line"`,
7474 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
7575 /// object](mark.html#mark-def).
76- pub mark: Option<AnyMark>,
76+ pub mark: AnyMark,
7777
7878 /// Name of the visualization for later reference.
7979 pub name: Option<String>,
@@ -127,7 +127,7 @@ pub struct TopLevel {
127127 ///
128128 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
129129 /// layering facet specifications is not allowed.
130- pub layer: Option<Vec<LayerSpec>>,
130+ pub layer: Vec<LayerSpec>,
131131
132132 /// Scale, axis, and legend resolutions for layers.
133133 ///
@@ -142,20 +142,20 @@ pub struct TopLevel {
142142
143143 /// An object that describes mappings between `row` and `column` channels and their field
144144 /// definitions.
145- pub facet: Option<FacetMapping>,
145+ pub facet: FacetMapping,
146146
147147 /// A specification of the view that gets faceted.
148- pub spec: Box<Option<Spec>>,
148+ pub spec: Box<Spec>,
149149
150150 /// An object that describes what fields should be repeated into views that are laid out as a
151151 /// `row` or `column`.
152- pub repeat: Option<Repeat>,
152+ pub repeat: Repeat,
153153
154154 /// A list of views that should be concatenated and put into a column.
155- pub vconcat: Option<Vec<Spec>>,
155+ pub vconcat: Vec<Spec>,
156156
157157 /// A list of views that should be concatenated and put into a row.
158- pub hconcat: Option<Vec<Spec>>,
158+ pub hconcat: Vec<Spec>,
159159 }
160160
161161 /// Sets how the visualization size should be determined. If a string, should be one of
@@ -1712,7 +1712,7 @@ pub struct VgScheme {
17121712
17131713 pub extent: Option<Vec<f64>>,
17141714
1715- pub scheme: Option<String>,
1715+ pub scheme: String,
17161716
17171717 pub step: Option<f64>,
17181718 }
@@ -2148,7 +2148,7 @@ pub struct VgBinding {
21482148
21492149 pub input: String,
21502150
2151- pub options: Option<Vec<String>>,
2151+ pub options: Vec<String>,
21522152
21532153 pub max: Option<f64>,
21542154
@@ -2800,16 +2800,16 @@ pub struct Data {
28002800
28012801 /// An URL from which to load the data set. Use the `format.type` property
28022802 /// to ensure the loaded data is correctly parsed.
2803- pub url: Option<String>,
2803+ pub url: String,
28042804
28052805 /// The full data set, included inline. This can be an array of objects or primitive values
28062806 /// or a string.
28072807 /// Arrays of primitive values are ingested as objects with a `data` property. Strings are
28082808 /// parsed according to the specified format type.
2809- pub values: Option<Values>,
2809+ pub values: Values,
28102810
28112811 /// Provide a placeholder name and bind data at runtime.
2812- pub name: Option<String>,
2812+ pub name: String,
28132813 }
28142814
28152815 /// An object that specifies the format for parsing the data file.
@@ -3050,7 +3050,7 @@ pub struct MarkPropDefWithCondition {
30503050 /// If `true`, default [binning parameters](bin.html) will be applied.
30513051 ///
30523052 /// __Default value:__ `false`
3053- pub bin: Option<Bin>,
3053+ pub bin: Option<ColorBin>,
30543054
30553055 /// One or more value definition(s) with a selection predicate.
30563056 ///
@@ -3105,10 +3105,10 @@ pub struct MarkPropDefWithCondition {
31053105 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
31063106 /// [geographic projection](projection.html) is applied.
31073107 #[serde(rename = "type")]
3108- pub mark_prop_def_with_condition_type: Option<Type>,
3108+ pub mark_prop_def_with_condition_type: Type,
31093109
31103110 /// A constant value in visual domain.
3111- pub value: Option<ConditionalPredicateValueDefValue>,
3111+ pub value: Option<ColorValue>,
31123112 }
31133113
31143114 /// Aggregation function for the field
@@ -3177,7 +3177,7 @@ pub enum AggregateOp {
31773177
31783178 #[derive(Debug, Clone, Serialize, Deserialize)]
31793179 #[serde(untagged)]
3180-pub enum Bin {
3180+pub enum ColorBin {
31813181 BinParams(BinParams),
31823182
31833183 Bool(bool),
@@ -3234,7 +3234,7 @@ pub enum ColorCondition {
32343234
32353235 #[derive(Debug, Clone, Serialize, Deserialize)]
32363236 pub struct ConditionalValueDef {
3237- pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>,
3237+ pub test: Box<LogicalOperandPredicate>,
32383238
32393239 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
32403240 /// `0` to `1` for opacity).
@@ -3242,28 +3242,16 @@ pub struct ConditionalValueDef {
32423242
32433243 /// A [selection name](selection.html), or a series of [composed
32443244 /// selections](selection.html#compose).
3245- pub selection: Option<Box<ConditionalValueDefSelectionOperand>>,
3246-}
3247-
3248-/// Filter using a selection name.
3249-///
3250-/// A [selection name](selection.html), or a series of [composed
3251-/// selections](selection.html#compose).
3252-#[derive(Debug, Clone, Serialize, Deserialize)]
3253-#[serde(untagged)]
3254-pub enum SelectionOperandElement {
3255- PurpleString(String),
3256-
3257- Selection(Selection),
3245+ pub selection: Box<SelectionOperand>,
32583246 }
32593247
32603248 #[derive(Debug, Clone, Serialize, Deserialize)]
32613249 pub struct Selection {
3262- pub not: Option<Box<ConditionalValueDefSelectionOperand>>,
3250+ pub not: Box<SelectionOperand>,
32633251
3264- pub and: Option<Vec<SelectionOperandElement>>,
3252+ pub and: Vec<Box<SelectionOperand>>,
32653253
3266- pub or: Option<Vec<SelectionOperandElement>>,
3254+ pub or: Vec<Box<SelectionOperand>>,
32673255 }
32683256
32693257 /// Filter using a selection name.
@@ -3272,44 +3260,28 @@ pub struct Selection {
32723260 /// selections](selection.html#compose).
32733261 #[derive(Debug, Clone, Serialize, Deserialize)]
32743262 #[serde(untagged)]
3275-pub enum ConditionalValueDefSelectionOperand {
3263+pub enum SelectionOperand {
32763264 PurpleString(String),
32773265
32783266 Selection(Selection),
32793267 }
32803268
3281-/// The `filter` property must be one of the predicate definitions:
3282-/// (1) an [expression](types.html#expression) string,
3283-/// where `datum` can be used to refer to the current data object;
3284-/// (2) one of the field predicates: [equal predicate](filter.html#equal-predicate);
3285-/// [range predicate](filter.html#range-predicate), [one-of
3286-/// predicate](filter.html#one-of-predicate);
3287-/// (3) a [selection predicate](filter.html#selection-predicate);
3288-/// or (4) a logical operand that combines (1), (2), or (3).
3289-#[derive(Debug, Clone, Serialize, Deserialize)]
3290-#[serde(untagged)]
3291-pub enum LogicalOperandPredicateElement {
3292- Predicate(Predicate),
3293-
3294- PurpleString(String),
3295-}
3296-
32973269 #[derive(Debug, Clone, Serialize, Deserialize)]
32983270 #[serde(rename_all = "camelCase")]
32993271 pub struct Predicate {
3300- pub not: Option<Box<ConditionalValueDefLogicalOperandPredicate>>,
3272+ pub not: Box<LogicalOperandPredicate>,
33013273
3302- pub and: Option<Vec<LogicalOperandPredicateElement>>,
3274+ pub and: Vec<Box<LogicalOperandPredicate>>,
33033275
3304- pub or: Option<Vec<LogicalOperandPredicateElement>>,
3276+ pub or: Vec<Box<LogicalOperandPredicate>>,
33053277
33063278 /// The value that the field should be equal to.
3307- pub equal: Option<EqualUnion>,
3279+ pub equal: Equal,
33083280
33093281 /// Field to be filtered.
33103282 ///
33113283 /// Field to be filtered
3312- pub field: Option<String>,
3284+ pub field: String,
33133285
33143286 /// Time unit for the field to be filtered.
33153287 ///
@@ -3318,14 +3290,14 @@ pub struct Predicate {
33183290
33193291 /// An array of inclusive minimum and maximum values
33203292 /// for a field value of a data item to be included in the filtered data.
3321- pub range: Option<Vec<Option<RangeElement>>>,
3293+ pub range: Vec<Option<RangeElement>>,
33223294
33233295 /// A set of values that the `field`'s value should be a member of,
33243296 /// for a data item included in the filtered data.
3325- pub one_of: Option<Vec<OneOfElement>>,
3297+ pub one_of: Vec<Equal>,
33263298
33273299 /// Filter using a selection name.
3328- pub selection: Option<Box<ConditionalValueDefSelectionOperand>>,
3300+ pub selection: Box<SelectionOperand>,
33293301 }
33303302
33313303 /// The `filter` property must be one of the predicate definitions:
@@ -3338,7 +3310,7 @@ pub struct Predicate {
33383310 /// or (4) a logical operand that combines (1), (2), or (3).
33393311 #[derive(Debug, Clone, Serialize, Deserialize)]
33403312 #[serde(untagged)]
3341-pub enum ConditionalValueDefLogicalOperandPredicate {
3313+pub enum LogicalOperandPredicate {
33423314 Predicate(Predicate),
33433315
33443316 PurpleString(String),
@@ -3347,7 +3319,7 @@ pub enum ConditionalValueDefLogicalOperandPredicate {
33473319 /// The value that the field should be equal to.
33483320 #[derive(Debug, Clone, Serialize, Deserialize)]
33493321 #[serde(untagged)]
3350-pub enum EqualUnion {
3322+pub enum Equal {
33513323 Bool(bool),
33523324
33533325 DateTime(DateTime),
@@ -3425,19 +3397,6 @@ pub enum Month {
34253397 PurpleString(String),
34263398 }
34273399
3428-/// The value that the field should be equal to.
3429-#[derive(Debug, Clone, Serialize, Deserialize)]
3430-#[serde(untagged)]
3431-pub enum OneOfElement {
3432- Bool(bool),
3433-
3434- DateTime(DateTime),
3435-
3436- Double(f64),
3437-
3438- PurpleString(String),
3439-}
3440-
34413400 #[derive(Debug, Clone, Serialize, Deserialize)]
34423401 #[serde(untagged)]
34433402 pub enum RangeElement {
@@ -3565,15 +3524,15 @@ pub enum ConditionalValueDefValue {
35653524 #[derive(Debug, Clone, Serialize, Deserialize)]
35663525 #[serde(rename_all = "camelCase")]
35673526 pub struct ConditionalPredicateMarkPropFieldDefClass {
3568- pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>,
3527+ pub test: Box<LogicalOperandPredicate>,
35693528
35703529 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
35713530 /// `0` to `1` for opacity).
3572- pub value: Option<ConditionalPredicateValueDefValue>,
3531+ pub value: ConditionalValueDefValue,
35733532
35743533 /// A [selection name](selection.html), or a series of [composed
35753534 /// selections](selection.html#compose).
3576- pub selection: Option<Box<ConditionalValueDefSelectionOperand>>,
3535+ pub selection: Box<SelectionOperand>,
35773536
35783537 /// Aggregation function for the field
35793538 /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -3586,7 +3545,7 @@ pub struct ConditionalPredicateMarkPropFieldDefClass {
35863545 /// If `true`, default [binning parameters](bin.html) will be applied.
35873546 ///
35883547 /// __Default value:__ `false`
3589- pub bin: Option<Bin>,
3548+ pub bin: Option<ColorBin>,
35903549
35913550 /// __Required.__ A string defining the name of the field from which to pull a data value
35923551 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -3632,7 +3591,7 @@ pub struct ConditionalPredicateMarkPropFieldDefClass {
36323591 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
36333592 /// [geographic projection](projection.html) is applied.
36343593 #[serde(rename = "type")]
3635- pub conditional_def_type: Option<Type>,
3594+ pub conditional_def_type: Type,
36363595 }
36373596
36383597 /// The encoded field's type of measurement (`"quantitative"`, `"temporal"`, `"ordinal"`, or
@@ -3989,7 +3948,7 @@ pub enum DomainUnion {
39893948
39903949 Enum(Domain),
39913950
3992- UnionArray(Vec<OneOfElement>),
3951+ UnionArray(Vec<Equal>),
39933952 }
39943953
39953954 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -4261,7 +4220,7 @@ pub enum SortEnum {
42614220 /// A constant value in visual domain.
42624221 #[derive(Debug, Clone, Serialize, Deserialize)]
42634222 #[serde(untagged)]
4264-pub enum ConditionalPredicateValueDefValue {
4223+pub enum ColorValue {
42654224 Bool(bool),
42664225
42674226 Double(f64),
@@ -4286,7 +4245,7 @@ pub struct FacetFieldDef {
42864245 /// If `true`, default [binning parameters](bin.html) will be applied.
42874246 ///
42884247 /// __Default value:__ `false`
4289- pub bin: Option<Bin>,
4248+ pub bin: Option<ColorBin>,
42904249
42914250 /// __Required.__ A string defining the name of the field from which to pull a data value
42924251 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4381,7 +4340,7 @@ pub struct FieldDef {
43814340 /// If `true`, default [binning parameters](bin.html) will be applied.
43824341 ///
43834342 /// __Default value:__ `false`
4384- pub bin: Option<Bin>,
4343+ pub bin: Option<ColorBin>,
43854344
43864345 /// __Required.__ A string defining the name of the field from which to pull a data value
43874346 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4437,7 +4396,7 @@ pub struct DefWithCondition {
44374396 /// If `true`, default [binning parameters](bin.html) will be applied.
44384397 ///
44394398 /// __Default value:__ `false`
4440- pub bin: Option<Bin>,
4399+ pub bin: Option<ColorBin>,
44414400
44424401 /// One or more value definition(s) with a selection predicate.
44434402 ///
@@ -4471,10 +4430,10 @@ pub struct DefWithCondition {
44714430 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
44724431 /// [geographic projection](projection.html) is applied.
44734432 #[serde(rename = "type")]
4474- pub def_with_condition_type: Option<Type>,
4433+ pub def_with_condition_type: Type,
44754434
44764435 /// A constant value in visual domain.
4477- pub value: Option<ConditionalPredicateValueDefValue>,
4436+ pub value: Option<ColorValue>,
44784437 }
44794438
44804439 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -4488,15 +4447,15 @@ pub enum HrefCondition {
44884447 #[derive(Debug, Clone, Serialize, Deserialize)]
44894448 #[serde(rename_all = "camelCase")]
44904449 pub struct ConditionalPredicateFieldDefClass {
4491- pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>,
4450+ pub test: Box<LogicalOperandPredicate>,
44924451
44934452 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
44944453 /// `0` to `1` for opacity).
4495- pub value: Option<ConditionalPredicateValueDefValue>,
4454+ pub value: ConditionalValueDefValue,
44964455
44974456 /// A [selection name](selection.html), or a series of [composed
44984457 /// selections](selection.html#compose).
4499- pub selection: Option<Box<ConditionalValueDefSelectionOperand>>,
4458+ pub selection: Box<SelectionOperand>,
45004459
45014460 /// Aggregation function for the field
45024461 /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4509,7 +4468,7 @@ pub struct ConditionalPredicateFieldDefClass {
45094468 /// If `true`, default [binning parameters](bin.html) will be applied.
45104469 ///
45114470 /// __Default value:__ `false`
4512- pub bin: Option<Bin>,
4471+ pub bin: Option<ColorBin>,
45134472
45144473 /// __Required.__ A string defining the name of the field from which to pull a data value
45154474 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4534,7 +4493,7 @@ pub struct ConditionalPredicateFieldDefClass {
45344493 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
45354494 /// [geographic projection](projection.html) is applied.
45364495 #[serde(rename = "type")]
4537- pub conditional_def_type: Option<Type>,
4496+ pub conditional_def_type: Type,
45384497 }
45394498
45404499 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -4559,7 +4518,7 @@ pub struct OrderFieldDef {
45594518 /// If `true`, default [binning parameters](bin.html) will be applied.
45604519 ///
45614520 /// __Default value:__ `false`
4562- pub bin: Option<Bin>,
4521+ pub bin: Option<ColorBin>,
45634522
45644523 /// __Required.__ A string defining the name of the field from which to pull a data value
45654524 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4620,7 +4579,7 @@ pub struct TextDefWithCondition {
46204579 /// If `true`, default [binning parameters](bin.html) will be applied.
46214580 ///
46224581 /// __Default value:__ `false`
4623- pub bin: Option<Bin>,
4582+ pub bin: Option<ColorBin>,
46244583
46254584 /// One or more value definition(s) with a selection predicate.
46264585 ///
@@ -4658,10 +4617,10 @@ pub struct TextDefWithCondition {
46584617 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
46594618 /// [geographic projection](projection.html) is applied.
46604619 #[serde(rename = "type")]
4661- pub text_def_with_condition_type: Option<Type>,
4620+ pub text_def_with_condition_type: Type,
46624621
46634622 /// A constant value in visual domain.
4664- pub value: Option<ConditionalPredicateValueDefValue>,
4623+ pub value: Option<ColorValue>,
46654624 }
46664625
46674626 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -4675,15 +4634,15 @@ pub enum TextCondition {
46754634 #[derive(Debug, Clone, Serialize, Deserialize)]
46764635 #[serde(rename_all = "camelCase")]
46774636 pub struct ConditionalPredicateTextFieldDefClass {
4678- pub test: Option<Box<ConditionalValueDefLogicalOperandPredicate>>,
4637+ pub test: Box<LogicalOperandPredicate>,
46794638
46804639 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
46814640 /// `0` to `1` for opacity).
4682- pub value: Option<ConditionalPredicateValueDefValue>,
4641+ pub value: ConditionalValueDefValue,
46834642
46844643 /// A [selection name](selection.html), or a series of [composed
46854644 /// selections](selection.html#compose).
4686- pub selection: Option<Box<ConditionalValueDefSelectionOperand>>,
4645+ pub selection: Box<SelectionOperand>,
46874646
46884647 /// Aggregation function for the field
46894648 /// (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).
@@ -4696,7 +4655,7 @@ pub struct ConditionalPredicateTextFieldDefClass {
46964655 /// If `true`, default [binning parameters](bin.html) will be applied.
46974656 ///
46984657 /// __Default value:__ `false`
4699- pub bin: Option<Bin>,
4658+ pub bin: Option<ColorBin>,
47004659
47014660 /// __Required.__ A string defining the name of the field from which to pull a data value
47024661 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4725,7 +4684,7 @@ pub struct ConditionalPredicateTextFieldDefClass {
47254684 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
47264685 /// [geographic projection](projection.html) is applied.
47274686 #[serde(rename = "type")]
4728- pub conditional_def_type: Option<Type>,
4687+ pub conditional_def_type: Type,
47294688 }
47304689
47314690 /// X coordinates of the marks, or width of horizontal `"bar"` and `"area"`.
@@ -4753,7 +4712,7 @@ pub struct XClass {
47534712 /// If `true`, default [binning parameters](bin.html) will be applied.
47544713 ///
47554714 /// __Default value:__ `false`
4756- pub bin: Option<Bin>,
4715+ pub bin: Option<ColorBin>,
47574716
47584717 /// __Required.__ A string defining the name of the field from which to pull a data value
47594718 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -4815,11 +4774,11 @@ pub struct XClass {
48154774 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
48164775 /// [geographic projection](projection.html) is applied.
48174776 #[serde(rename = "type")]
4818- pub def_type: Option<Type>,
4777+ pub def_type: Type,
48194778
48204779 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
48214780 /// `0` to `1` for opacity).
4822- pub value: Option<ConditionalPredicateValueDefValue>,
4781+ pub value: ConditionalValueDefValue,
48234782 }
48244783
48254784 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -4997,7 +4956,7 @@ pub struct X2Class {
49974956 /// If `true`, default [binning parameters](bin.html) will be applied.
49984957 ///
49994958 /// __Default value:__ `false`
5000- pub bin: Option<Bin>,
4959+ pub bin: Option<ColorBin>,
50014960
50024961 /// __Required.__ A string defining the name of the field from which to pull a data value
50034962 /// or an object defining iterated values from the [`repeat`](repeat.html) operator.
@@ -5022,11 +4981,11 @@ pub struct X2Class {
50224981 /// It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
50234982 /// [geographic projection](projection.html) is applied.
50244983 #[serde(rename = "type")]
5025- pub def_type: Option<Type>,
4984+ pub def_type: Type,
50264985
50274986 /// A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
50284987 /// `0` to `1` for opacity).
5029- pub value: Option<ConditionalPredicateValueDefValue>,
4988+ pub value: ConditionalValueDefValue,
50304989 }
50314990
50324991 /// An object that describes mappings between `row` and `column` channels and their field
@@ -5072,7 +5031,7 @@ pub struct Spec {
50725031 ///
50735032 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
50745033 /// layering facet specifications is not allowed.
5075- pub layer: Option<Vec<LayerSpec>>,
5034+ pub layer: Vec<LayerSpec>,
50765035
50775036 /// Name of the visualization for later reference.
50785037 pub name: Option<String>,
@@ -5117,13 +5076,13 @@ pub struct Spec {
51175076 pub width: Option<f64>,
51185077
51195078 /// A key-value mapping between encoding channels and definition of fields.
5120- pub encoding: Option<Encoding>,
5079+ pub encoding: Encoding,
51215080
51225081 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
51235082 /// `"line"`,
51245083 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
51255084 /// object](mark.html#mark-def).
5126- pub mark: Option<AnyMark>,
5085+ pub mark: AnyMark,
51275086
51285087 /// An object defining properties of geographic projection.
51295088 ///
@@ -5136,20 +5095,20 @@ pub struct Spec {
51365095
51375096 /// An object that describes mappings between `row` and `column` channels and their field
51385097 /// definitions.
5139- pub facet: Option<FacetMapping>,
5098+ pub facet: FacetMapping,
51405099
51415100 /// A specification of the view that gets faceted.
5142- pub spec: Box<Option<Spec>>,
5101+ pub spec: Box<Spec>,
51435102
51445103 /// An object that describes what fields should be repeated into views that are laid out as a
51455104 /// `row` or `column`.
5146- pub repeat: Option<Repeat>,
5105+ pub repeat: Repeat,
51475106
51485107 /// A list of views that should be concatenated and put into a column.
5149- pub vconcat: Option<Vec<Spec>>,
5108+ pub vconcat: Vec<Spec>,
51505109
51515110 /// A list of views that should be concatenated and put into a row.
5152- pub hconcat: Option<Vec<Spec>>,
5111+ pub hconcat: Vec<Spec>,
51535112 }
51545113
51555114 /// A key-value mapping between encoding channels and definition of fields.
@@ -5253,7 +5212,7 @@ pub struct LayerSpec {
52535212 ///
52545213 /// __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
52555214 /// layering facet specifications is not allowed.
5256- pub layer: Option<Vec<LayerSpec>>,
5215+ pub layer: Vec<LayerSpec>,
52575216
52585217 /// Name of the visualization for later reference.
52595218 pub name: Option<String>,
@@ -5290,13 +5249,13 @@ pub struct LayerSpec {
52905249 pub width: Option<f64>,
52915250
52925251 /// A key-value mapping between encoding channels and definition of fields.
5293- pub encoding: Option<Encoding>,
5252+ pub encoding: Encoding,
52945253
52955254 /// A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
52965255 /// `"line"`,
52975256 /// * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
52985257 /// object](mark.html#mark-def).
5299- pub mark: Option<AnyMark>,
5258+ pub mark: AnyMark,
53005259
53015260 /// An object defining properties of geographic projection.
53025261 ///
@@ -5832,7 +5791,7 @@ pub struct Transform {
58325791 /// predicate](filter.html#one-of-predicate);
58335792 /// (3) a [selection predicate](filter.html#selection-predicate);
58345793 /// or (4) a logical operand that combines (1), (2), or (3).
5835- pub filter: Option<Box<ConditionalValueDefLogicalOperandPredicate>>,
5794+ pub filter: Box<LogicalOperandPredicate>,
58365795
58375796 /// The field for storing the computed formula value.
58385797 ///
@@ -5849,7 +5808,7 @@ pub struct Transform {
58495808
58505809 /// A [expression](types.html#expression) string. Use the variable `datum` to refer to the
58515810 /// current data object.
5852- pub calculate: Option<String>,
5811+ pub calculate: String,
58535812
58545813 /// The default value to use if lookup fails.
58555814 ///
@@ -5858,24 +5817,24 @@ pub struct Transform {
58585817 pub transform_default: Option<String>,
58595818
58605819 /// Secondary data reference.
5861- pub from: Option<LookupData>,
5820+ pub from: LookupData,
58625821
58635822 /// Key in primary data source.
5864- pub lookup: Option<String>,
5823+ pub lookup: String,
58655824
58665825 /// An object indicating bin properties, or simply `true` for using default bin parameters.
5867- pub bin: Option<Bin>,
5826+ pub bin: TransformBin,
58685827
58695828 /// The data field to bin.
58705829 ///
58715830 /// The data field to apply time unit.
5872- pub field: Option<String>,
5831+ pub field: String,
58735832
58745833 /// The timeUnit.
5875- pub time_unit: Option<TimeUnit>,
5834+ pub time_unit: TimeUnit,
58765835
58775836 /// Array of objects that define fields to aggregate.
5878- pub aggregate: Option<Vec<AggregatedFieldDef>>,
5837+ pub aggregate: Vec<AggregatedFieldDef>,
58795838
58805839 /// The data fields to group by. If not specified, a single group containing all data objects
58815840 /// will be used.
@@ -5898,6 +5857,14 @@ pub struct AggregatedFieldDef {
58985857 pub op: AggregateOp,
58995858 }
59005859
5860+#[derive(Debug, Clone, Serialize, Deserialize)]
5861+#[serde(untagged)]
5862+pub enum TransformBin {
5863+ BinParams(BinParams),
5864+
5865+ Bool(bool),
5866+}
5867+
59015868 /// Secondary data reference.
59025869 #[derive(Debug, Clone, Serialize, Deserialize)]
59035870 pub struct LookupData {
Mschema-scala3-upickledefault / TopLevel.scala+64 −64
@@ -111,7 +111,7 @@ case class TopLevel (
111111 /**
112112 * A key-value mapping between encoding channels and definition of fields.
113113 */
114- val encoding : Option[EncodingWithFacet] = None,
114+ val encoding : EncodingWithFacet,
115115
116116 /**
117117 * The height of a visualization.
@@ -140,7 +140,7 @@ case class TopLevel (
140140 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
141141 * object](mark.html#mark-def).
142142 */
143- val mark : Option[AnyMark] = None,
143+ val mark : AnyMark,
144144
145145 /**
146146 * Name of the visualization for later reference.
@@ -210,7 +210,7 @@ case class TopLevel (
210210 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
211211 * layering facet specifications is not allowed.
212212 */
213- val layer : Option[Seq[LayerSpec]] = None,
213+ val layer : Seq[LayerSpec],
214214
215215 /**
216216 * Scale, axis, and legend resolutions for layers.
@@ -229,28 +229,28 @@ case class TopLevel (
229229 * An object that describes mappings between `row` and `column` channels and their field
230230 * definitions.
231231 */
232- val facet : Option[FacetMapping] = None,
232+ val facet : FacetMapping,
233233
234234 /**
235235 * A specification of the view that gets faceted.
236236 */
237- val spec : Option[Spec] = None,
237+ val spec : Spec,
238238
239239 /**
240240 * An object that describes what fields should be repeated into views that are laid out as a
241241 * `row` or `column`.
242242 */
243- val repeat : Option[Repeat] = None,
243+ val repeat : Repeat,
244244
245245 /**
246246 * A list of views that should be concatenated and put into a column.
247247 */
248- val vconcat : Option[Seq[Spec]] = None,
248+ val vconcat : Seq[Spec],
249249
250250 /**
251251 * A list of views that should be concatenated and put into a row.
252252 */
253- val hconcat : Option[Seq[Spec]] = None
253+ val hconcat : Seq[Spec]
254254 ) derives OptionPickler.ReadWriter
255255
256256 /**
@@ -2432,7 +2432,7 @@ given unionWriterRangeConfigValue: OptionPickler.Writer[RangeConfigValue] = Opti
24322432 case class VGScheme (
24332433 val count : Option[Double] = None,
24342434 val extent : Option[Seq[Double]] = None,
2435- val scheme : Option[String] = None,
2435+ val scheme : String,
24362436 val step : Option[Double] = None
24372437 ) derives OptionPickler.ReadWriter
24382438
@@ -3029,7 +3029,7 @@ case class SingleSelectionConfig (
30293029 case class VGBinding (
30303030 val element : Option[String] = None,
30313031 val input : String,
3032- val options : Option[Seq[String]] = None,
3032+ val options : Seq[String],
30333033 val max : Option[Double] = None,
30343034 val min : Option[Double] = None,
30353035 val step : Option[Double] = None
@@ -3940,7 +3940,7 @@ case class Data (
39403940 * An URL from which to load the data set. Use the `format.type` property
39413941 * to ensure the loaded data is correctly parsed.
39423942 */
3943- val url : Option[String] = None,
3943+ val url : String,
39443944
39453945 /**
39463946 * The full data set, included inline. This can be an array of objects or primitive values
@@ -3948,12 +3948,12 @@ case class Data (
39483948 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
39493949 * parsed according to the specified format type.
39503950 */
3951- val values : Option[Values] = None,
3951+ val values : Values,
39523952
39533953 /**
39543954 * Provide a placeholder name and bind data at runtime.
39553955 */
3956- val name : Option[String] = None
3956+ val name : String
39573957 ) derives OptionPickler.ReadWriter
39583958
39593959 /**
@@ -4341,7 +4341,7 @@ case class MarkPropDefWithCondition (
43414341 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
43424342 * [geographic projection](projection.html) is applied.
43434343 */
4344- val `type` : Option[Type] = None,
4344+ val `type` : Type,
43454345
43464346 /**
43474347 * A constant value in visual domain.
@@ -4526,7 +4526,7 @@ given unionWriterColorCondition: OptionPickler.Writer[ColorCondition] = OptionPi
45264526 }
45274527
45284528 case class ConditionalValueDef (
4529- val test : Option[LogicalOperandPredicate] = None,
4529+ val test : LogicalOperandPredicate,
45304530
45314531 /**
45324532 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -4538,13 +4538,13 @@ case class ConditionalValueDef (
45384538 * A [selection name](selection.html), or a series of [composed
45394539 * selections](selection.html#compose).
45404540 */
4541- val selection : Option[SelectionOperand] = None
4541+ val selection : SelectionOperand
45424542 ) derives OptionPickler.ReadWriter
45434543
45444544 case class Selection (
4545- val not : Option[SelectionOperand] = None,
4546- val and : Option[Seq[SelectionOperand]] = None,
4547- val or : Option[Seq[SelectionOperand]] = None
4545+ val not : SelectionOperand,
4546+ val and : Seq[SelectionOperand],
4547+ val or : Seq[SelectionOperand]
45484548 ) derives OptionPickler.ReadWriter
45494549
45504550 /**
@@ -4566,21 +4566,21 @@ given unionWriterSelectionOperand: OptionPickler.Writer[SelectionOperand] = Opti
45664566 }
45674567
45684568 case class Predicate (
4569- val not : Option[LogicalOperandPredicate] = None,
4570- val and : Option[Seq[LogicalOperandPredicate]] = None,
4571- val or : Option[Seq[LogicalOperandPredicate]] = None,
4569+ val not : LogicalOperandPredicate,
4570+ val and : Seq[LogicalOperandPredicate],
4571+ val or : Seq[LogicalOperandPredicate],
45724572
45734573 /**
45744574 * The value that the field should be equal to.
45754575 */
4576- val equal : Option[Equal] = None,
4576+ val equal : Equal,
45774577
45784578 /**
45794579 * Field to be filtered.
45804580 *
45814581 * Field to be filtered
45824582 */
4583- val field : Option[String] = None,
4583+ val field : String,
45844584
45854585 /**
45864586 * Time unit for the field to be filtered.
@@ -4593,18 +4593,18 @@ case class Predicate (
45934593 * An array of inclusive minimum and maximum values
45944594 * for a field value of a data item to be included in the filtered data.
45954595 */
4596- val range : Option[Seq[RangeElement]] = None,
4596+ val range : Seq[RangeElement],
45974597
45984598 /**
45994599 * A set of values that the `field`'s value should be a member of,
46004600 * for a data item included in the filtered data.
46014601 */
4602- val oneOf : Option[Seq[Equal]] = None,
4602+ val oneOf : Seq[Equal],
46034603
46044604 /**
46054605 * Filter using a selection name.
46064606 */
4607- val selection : Option[SelectionOperand] = None
4607+ val selection : SelectionOperand
46084608 ) derives OptionPickler.ReadWriter
46094609
46104610 /**
@@ -4917,19 +4917,19 @@ given unionWriterConditionalValueDefValue: OptionPickler.Writer[ConditionalValue
49174917 }
49184918
49194919 case class ConditionalPredicateMarkPropFieldDefClass (
4920- val test : Option[LogicalOperandPredicate] = None,
4920+ val test : LogicalOperandPredicate,
49214921
49224922 /**
49234923 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
49244924 * `0` to `1` for opacity).
49254925 */
4926- val value : Option[ConditionalValueDefValue] = None,
4926+ val value : ConditionalValueDefValue,
49274927
49284928 /**
49294929 * A [selection name](selection.html), or a series of [composed
49304930 * selections](selection.html#compose).
49314931 */
4932- val selection : Option[SelectionOperand] = None,
4932+ val selection : SelectionOperand,
49334933
49344934 /**
49354935 * Aggregation function for the field
@@ -5003,7 +5003,7 @@ case class ConditionalPredicateMarkPropFieldDefClass (
50035003 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
50045004 * [geographic projection](projection.html) is applied.
50055005 */
5006- val `type` : Option[Type] = None
5006+ val `type` : Type
50075007 ) derives OptionPickler.ReadWriter
50085008
50095009 /**
@@ -6062,7 +6062,7 @@ case class DefWithCondition (
60626062 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
60636063 * [geographic projection](projection.html) is applied.
60646064 */
6065- val `type` : Option[Type] = None,
6065+ val `type` : Type,
60666066
60676067 /**
60686068 * A constant value in visual domain.
@@ -6083,19 +6083,19 @@ given unionWriterHrefCondition: OptionPickler.Writer[HrefCondition] = OptionPick
60836083 }
60846084
60856085 case class ConditionalPredicateFieldDefClass (
6086- val test : Option[LogicalOperandPredicate] = None,
6086+ val test : LogicalOperandPredicate,
60876087
60886088 /**
60896089 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
60906090 * `0` to `1` for opacity).
60916091 */
6092- val value : Option[ConditionalValueDefValue] = None,
6092+ val value : ConditionalValueDefValue,
60936093
60946094 /**
60956095 * A [selection name](selection.html), or a series of [composed
60966096 * selections](selection.html#compose).
60976097 */
6098- val selection : Option[SelectionOperand] = None,
6098+ val selection : SelectionOperand,
60996099
61006100 /**
61016101 * Aggregation function for the field
@@ -6142,7 +6142,7 @@ case class ConditionalPredicateFieldDefClass (
61426142 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
61436143 * [geographic projection](projection.html) is applied.
61446144 */
6145- val `type` : Option[Type] = None
6145+ val `type` : Type
61466146 ) derives OptionPickler.ReadWriter
61476147
61486148 type Order = Seq[OrderFieldDef] | OrderFieldDef
@@ -6292,7 +6292,7 @@ case class TextDefWithCondition (
62926292 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
62936293 * [geographic projection](projection.html) is applied.
62946294 */
6295- val `type` : Option[Type] = None,
6295+ val `type` : Type,
62966296
62976297 /**
62986298 * A constant value in visual domain.
@@ -6313,19 +6313,19 @@ given unionWriterTextCondition: OptionPickler.Writer[TextCondition] = OptionPick
63136313 }
63146314
63156315 case class ConditionalPredicateTextFieldDefClass (
6316- val test : Option[LogicalOperandPredicate] = None,
6316+ val test : LogicalOperandPredicate,
63176317
63186318 /**
63196319 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
63206320 * `0` to `1` for opacity).
63216321 */
6322- val value : Option[ConditionalValueDefValue] = None,
6322+ val value : ConditionalValueDefValue,
63236323
63246324 /**
63256325 * A [selection name](selection.html), or a series of [composed
63266326 * selections](selection.html#compose).
63276327 */
6328- val selection : Option[SelectionOperand] = None,
6328+ val selection : SelectionOperand,
63296329
63306330 /**
63316331 * Aggregation function for the field
@@ -6378,7 +6378,7 @@ case class ConditionalPredicateTextFieldDefClass (
63786378 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
63796379 * [geographic projection](projection.html) is applied.
63806380 */
6381- val `type` : Option[Type] = None
6381+ val `type` : Type
63826382 ) derives OptionPickler.ReadWriter
63836383
63846384 /**
@@ -6485,13 +6485,13 @@ case class XClass (
64856485 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
64866486 * [geographic projection](projection.html) is applied.
64876487 */
6488- val `type` : Option[Type] = None,
6488+ val `type` : Type,
64896489
64906490 /**
64916491 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
64926492 * `0` to `1` for opacity).
64936493 */
6494- val value : Option[ConditionalValueDefValue] = None
6494+ val value : ConditionalValueDefValue
64956495 ) derives OptionPickler.ReadWriter
64966496
64976497 case class Axis (
@@ -6749,13 +6749,13 @@ case class X2Class (
67496749 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
67506750 * [geographic projection](projection.html) is applied.
67516751 */
6752- val `type` : Option[Type] = None,
6752+ val `type` : Type,
67536753
67546754 /**
67556755 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
67566756 * `0` to `1` for opacity).
67576757 */
6758- val value : Option[ConditionalValueDefValue] = None
6758+ val value : ConditionalValueDefValue
67596759 ) derives OptionPickler.ReadWriter
67606760
67616761 /**
@@ -6815,7 +6815,7 @@ case class Spec (
68156815 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
68166816 * layering facet specifications is not allowed.
68176817 */
6818- val layer : Option[Seq[LayerSpec]] = None,
6818+ val layer : Seq[LayerSpec],
68196819
68206820 /**
68216821 * Name of the visualization for later reference.
@@ -6872,7 +6872,7 @@ case class Spec (
68726872 /**
68736873 * A key-value mapping between encoding channels and definition of fields.
68746874 */
6875- val encoding : Option[Encoding] = None,
6875+ val encoding : Encoding,
68766876
68776877 /**
68786878 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6880,7 +6880,7 @@ case class Spec (
68806880 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
68816881 * object](mark.html#mark-def).
68826882 */
6883- val mark : Option[AnyMark] = None,
6883+ val mark : AnyMark,
68846884
68856885 /**
68866886 * An object defining properties of geographic projection.
@@ -6899,28 +6899,28 @@ case class Spec (
68996899 * An object that describes mappings between `row` and `column` channels and their field
69006900 * definitions.
69016901 */
6902- val facet : Option[FacetMapping] = None,
6902+ val facet : FacetMapping,
69036903
69046904 /**
69056905 * A specification of the view that gets faceted.
69066906 */
6907- val spec : Option[Spec] = None,
6907+ val spec : Spec,
69086908
69096909 /**
69106910 * An object that describes what fields should be repeated into views that are laid out as a
69116911 * `row` or `column`.
69126912 */
6913- val repeat : Option[Repeat] = None,
6913+ val repeat : Repeat,
69146914
69156915 /**
69166916 * A list of views that should be concatenated and put into a column.
69176917 */
6918- val vconcat : Option[Seq[Spec]] = None,
6918+ val vconcat : Seq[Spec],
69196919
69206920 /**
69216921 * A list of views that should be concatenated and put into a row.
69226922 */
6923- val hconcat : Option[Seq[Spec]] = None
6923+ val hconcat : Seq[Spec]
69246924 ) derives OptionPickler.ReadWriter
69256925
69266926 /**
@@ -7060,7 +7060,7 @@ case class LayerSpec (
70607060 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
70617061 * layering facet specifications is not allowed.
70627062 */
7063- val layer : Option[Seq[LayerSpec]] = None,
7063+ val layer : Seq[LayerSpec],
70647064
70657065 /**
70667066 * Name of the visualization for later reference.
@@ -7109,7 +7109,7 @@ case class LayerSpec (
71097109 /**
71107110 * A key-value mapping between encoding channels and definition of fields.
71117111 */
7112- val encoding : Option[Encoding] = None,
7112+ val encoding : Encoding,
71137113
71147114 /**
71157115 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -7117,7 +7117,7 @@ case class LayerSpec (
71177117 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
71187118 * object](mark.html#mark-def).
71197119 */
7120- val mark : Option[AnyMark] = None,
7120+ val mark : AnyMark,
71217121
71227122 /**
71237123 * An object defining properties of geographic projection.
@@ -7798,7 +7798,7 @@ case class Transform (
77987798 * (3) a [selection predicate](filter.html#selection-predicate);
77997799 * or (4) a logical operand that combines (1), (2), or (3).
78007800 */
7801- val filter : Option[LogicalOperandPredicate] = None,
7801+ val filter : LogicalOperandPredicate,
78027802
78037803 /**
78047804 * The field for storing the computed formula value.
@@ -7818,7 +7818,7 @@ case class Transform (
78187818 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
78197819 * current data object.
78207820 */
7821- val calculate : Option[String] = None,
7821+ val calculate : String,
78227822
78237823 /**
78247824 * The default value to use if lookup fails.
@@ -7830,34 +7830,34 @@ case class Transform (
78307830 /**
78317831 * Secondary data reference.
78327832 */
7833- val from : Option[LookupData] = None,
7833+ val from : LookupData,
78347834
78357835 /**
78367836 * Key in primary data source.
78377837 */
7838- val lookup : Option[String] = None,
7838+ val lookup : String,
78397839
78407840 /**
78417841 * An object indicating bin properties, or simply `true` for using default bin parameters.
78427842 */
7843- val bin : Option[Bin] = None,
7843+ val bin : Bin,
78447844
78457845 /**
78467846 * The data field to bin.
78477847 *
78487848 * The data field to apply time unit.
78497849 */
7850- val field : Option[String] = None,
7850+ val field : String,
78517851
78527852 /**
78537853 * The timeUnit.
78547854 */
7855- val timeUnit : Option[TimeUnit] = None,
7855+ val timeUnit : TimeUnit,
78567856
78577857 /**
78587858 * Array of objects that define fields to aggregate.
78597859 */
7860- val aggregate : Option[Seq[AggregatedFieldDef]] = None,
7860+ val aggregate : Seq[AggregatedFieldDef],
78617861
78627862 /**
78637863 * The data fields to group by. If not specified, a single group containing all data objects
Mschema-scala3default / TopLevel.scala+64 −64
@@ -53,7 +53,7 @@ case class TopLevel (
5353 /**
5454 * A key-value mapping between encoding channels and definition of fields.
5555 */
56- val encoding : Option[EncodingWithFacet] = None,
56+ val encoding : EncodingWithFacet,
5757
5858 /**
5959 * The height of a visualization.
@@ -82,7 +82,7 @@ case class TopLevel (
8282 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
8383 * object](mark.html#mark-def).
8484 */
85- val mark : Option[AnyMark] = None,
85+ val mark : AnyMark,
8686
8787 /**
8888 * Name of the visualization for later reference.
@@ -152,7 +152,7 @@ case class TopLevel (
152152 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
153153 * layering facet specifications is not allowed.
154154 */
155- val layer : Option[Seq[LayerSpec]] = None,
155+ val layer : Seq[LayerSpec],
156156
157157 /**
158158 * Scale, axis, and legend resolutions for layers.
@@ -171,28 +171,28 @@ case class TopLevel (
171171 * An object that describes mappings between `row` and `column` channels and their field
172172 * definitions.
173173 */
174- val facet : Option[FacetMapping] = None,
174+ val facet : FacetMapping,
175175
176176 /**
177177 * A specification of the view that gets faceted.
178178 */
179- val spec : Option[Spec] = None,
179+ val spec : Spec,
180180
181181 /**
182182 * An object that describes what fields should be repeated into views that are laid out as a
183183 * `row` or `column`.
184184 */
185- val repeat : Option[Repeat] = None,
185+ val repeat : Repeat,
186186
187187 /**
188188 * A list of views that should be concatenated and put into a column.
189189 */
190- val vconcat : Option[Seq[Spec]] = None,
190+ val vconcat : Seq[Spec],
191191
192192 /**
193193 * A list of views that should be concatenated and put into a row.
194194 */
195- val hconcat : Option[Seq[Spec]] = None
195+ val hconcat : Seq[Spec]
196196 ) derives Encoder.AsObject, Decoder
197197
198198 /**
@@ -2353,7 +2353,7 @@ given Encoder[RangeConfigValue] = Encoder.instance {
23532353 case class VGScheme (
23542354 val count : Option[Double] = None,
23552355 val extent : Option[Seq[Double]] = None,
2356- val scheme : Option[String] = None,
2356+ val scheme : String,
23572357 val step : Option[Double] = None
23582358 ) derives Encoder.AsObject, Decoder
23592359
@@ -2943,7 +2943,7 @@ case class SingleSelectionConfig (
29432943 case class VGBinding (
29442944 val element : Option[String] = None,
29452945 val input : String,
2946- val options : Option[Seq[String]] = None,
2946+ val options : Seq[String],
29472947 val max : Option[Double] = None,
29482948 val min : Option[Double] = None,
29492949 val step : Option[Double] = None
@@ -3848,7 +3848,7 @@ case class Data (
38483848 * An URL from which to load the data set. Use the `format.type` property
38493849 * to ensure the loaded data is correctly parsed.
38503850 */
3851- val url : Option[String] = None,
3851+ val url : String,
38523852
38533853 /**
38543854 * The full data set, included inline. This can be an array of objects or primitive values
@@ -3856,12 +3856,12 @@ case class Data (
38563856 * Arrays of primitive values are ingested as objects with a `data` property. Strings are
38573857 * parsed according to the specified format type.
38583858 */
3859- val values : Option[Values] = None,
3859+ val values : Values,
38603860
38613861 /**
38623862 * Provide a placeholder name and bind data at runtime.
38633863 */
3864- val name : Option[String] = None
3864+ val name : String
38653865 ) derives Encoder.AsObject, Decoder
38663866
38673867 /**
@@ -4248,7 +4248,7 @@ case class MarkPropDefWithCondition (
42484248 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
42494249 * [geographic projection](projection.html) is applied.
42504250 */
4251- val `type` : Option[Type] = None,
4251+ val `type` : Type,
42524252
42534253 /**
42544254 * A constant value in visual domain.
@@ -4433,7 +4433,7 @@ given Encoder[ColorCondition] = Encoder.instance {
44334433 }
44344434
44354435 case class ConditionalValueDef (
4436- val test : Option[LogicalOperandPredicate] = None,
4436+ val test : LogicalOperandPredicate,
44374437
44384438 /**
44394439 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
@@ -4445,13 +4445,13 @@ case class ConditionalValueDef (
44454445 * A [selection name](selection.html), or a series of [composed
44464446 * selections](selection.html#compose).
44474447 */
4448- val selection : Option[SelectionOperand] = None
4448+ val selection : SelectionOperand
44494449 ) derives Encoder.AsObject, Decoder
44504450
44514451 case class Selection (
4452- val not : Option[SelectionOperand] = None,
4453- val and : Option[Seq[SelectionOperand]] = None,
4454- val or : Option[Seq[SelectionOperand]] = None
4452+ val not : SelectionOperand,
4453+ val and : Seq[SelectionOperand],
4454+ val or : Seq[SelectionOperand]
44554455 ) derives Encoder.AsObject, Decoder
44564456
44574457 /**
@@ -4474,21 +4474,21 @@ given Encoder[SelectionOperand] = Encoder.instance {
44744474 }
44754475
44764476 case class Predicate (
4477- val not : Option[LogicalOperandPredicate] = None,
4478- val and : Option[Seq[LogicalOperandPredicate]] = None,
4479- val or : Option[Seq[LogicalOperandPredicate]] = None,
4477+ val not : LogicalOperandPredicate,
4478+ val and : Seq[LogicalOperandPredicate],
4479+ val or : Seq[LogicalOperandPredicate],
44804480
44814481 /**
44824482 * The value that the field should be equal to.
44834483 */
4484- val equal : Option[Equal] = None,
4484+ val equal : Equal,
44854485
44864486 /**
44874487 * Field to be filtered.
44884488 *
44894489 * Field to be filtered
44904490 */
4491- val field : Option[String] = None,
4491+ val field : String,
44924492
44934493 /**
44944494 * Time unit for the field to be filtered.
@@ -4501,18 +4501,18 @@ case class Predicate (
45014501 * An array of inclusive minimum and maximum values
45024502 * for a field value of a data item to be included in the filtered data.
45034503 */
4504- val range : Option[Seq[RangeElement]] = None,
4504+ val range : Seq[RangeElement],
45054505
45064506 /**
45074507 * A set of values that the `field`'s value should be a member of,
45084508 * for a data item included in the filtered data.
45094509 */
4510- val oneOf : Option[Seq[Equal]] = None,
4510+ val oneOf : Seq[Equal],
45114511
45124512 /**
45134513 * Filter using a selection name.
45144514 */
4515- val selection : Option[SelectionOperand] = None
4515+ val selection : SelectionOperand
45164516 ) derives Encoder.AsObject, Decoder
45174517
45184518 /**
@@ -4827,19 +4827,19 @@ given Encoder[ConditionalValueDefValue] = Encoder.instance {
48274827 }
48284828
48294829 case class ConditionalPredicateMarkPropFieldDefClass (
4830- val test : Option[LogicalOperandPredicate] = None,
4830+ val test : LogicalOperandPredicate,
48314831
48324832 /**
48334833 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
48344834 * `0` to `1` for opacity).
48354835 */
4836- val value : Option[ConditionalValueDefValue] = None,
4836+ val value : ConditionalValueDefValue,
48374837
48384838 /**
48394839 * A [selection name](selection.html), or a series of [composed
48404840 * selections](selection.html#compose).
48414841 */
4842- val selection : Option[SelectionOperand] = None,
4842+ val selection : SelectionOperand,
48434843
48444844 /**
48454845 * Aggregation function for the field
@@ -4913,7 +4913,7 @@ case class ConditionalPredicateMarkPropFieldDefClass (
49134913 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
49144914 * [geographic projection](projection.html) is applied.
49154915 */
4916- val `type` : Option[Type] = None
4916+ val `type` : Type
49174917 ) derives Encoder.AsObject, Decoder
49184918
49194919 /**
@@ -5965,7 +5965,7 @@ case class DefWithCondition (
59655965 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
59665966 * [geographic projection](projection.html) is applied.
59675967 */
5968- val `type` : Option[Type] = None,
5968+ val `type` : Type,
59695969
59705970 /**
59715971 * A constant value in visual domain.
@@ -5987,19 +5987,19 @@ given Encoder[HrefCondition] = Encoder.instance {
59875987 }
59885988
59895989 case class ConditionalPredicateFieldDefClass (
5990- val test : Option[LogicalOperandPredicate] = None,
5990+ val test : LogicalOperandPredicate,
59915991
59925992 /**
59935993 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
59945994 * `0` to `1` for opacity).
59955995 */
5996- val value : Option[ConditionalValueDefValue] = None,
5996+ val value : ConditionalValueDefValue,
59975997
59985998 /**
59995999 * A [selection name](selection.html), or a series of [composed
60006000 * selections](selection.html#compose).
60016001 */
6002- val selection : Option[SelectionOperand] = None,
6002+ val selection : SelectionOperand,
60036003
60046004 /**
60056005 * Aggregation function for the field
@@ -6046,7 +6046,7 @@ case class ConditionalPredicateFieldDefClass (
60466046 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
60476047 * [geographic projection](projection.html) is applied.
60486048 */
6049- val `type` : Option[Type] = None
6049+ val `type` : Type
60506050 ) derives Encoder.AsObject, Decoder
60516051
60526052 type Order = Seq[OrderFieldDef] | OrderFieldDef
@@ -6197,7 +6197,7 @@ case class TextDefWithCondition (
61976197 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
61986198 * [geographic projection](projection.html) is applied.
61996199 */
6200- val `type` : Option[Type] = None,
6200+ val `type` : Type,
62016201
62026202 /**
62036203 * A constant value in visual domain.
@@ -6219,19 +6219,19 @@ given Encoder[TextCondition] = Encoder.instance {
62196219 }
62206220
62216221 case class ConditionalPredicateTextFieldDefClass (
6222- val test : Option[LogicalOperandPredicate] = None,
6222+ val test : LogicalOperandPredicate,
62236223
62246224 /**
62256225 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
62266226 * `0` to `1` for opacity).
62276227 */
6228- val value : Option[ConditionalValueDefValue] = None,
6228+ val value : ConditionalValueDefValue,
62296229
62306230 /**
62316231 * A [selection name](selection.html), or a series of [composed
62326232 * selections](selection.html#compose).
62336233 */
6234- val selection : Option[SelectionOperand] = None,
6234+ val selection : SelectionOperand,
62356235
62366236 /**
62376237 * Aggregation function for the field
@@ -6284,7 +6284,7 @@ case class ConditionalPredicateTextFieldDefClass (
62846284 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
62856285 * [geographic projection](projection.html) is applied.
62866286 */
6287- val `type` : Option[Type] = None
6287+ val `type` : Type
62886288 ) derives Encoder.AsObject, Decoder
62896289
62906290 /**
@@ -6391,13 +6391,13 @@ case class XClass (
63916391 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
63926392 * [geographic projection](projection.html) is applied.
63936393 */
6394- val `type` : Option[Type] = None,
6394+ val `type` : Type,
63956395
63966396 /**
63976397 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
63986398 * `0` to `1` for opacity).
63996399 */
6400- val value : Option[ConditionalValueDefValue] = None
6400+ val value : ConditionalValueDefValue
64016401 ) derives Encoder.AsObject, Decoder
64026402
64036403 case class Axis (
@@ -6656,13 +6656,13 @@ case class X2Class (
66566656 * It can also be a geo type (`"latitude"`, `"longitude"`, and `"geojson"`) when a
66576657 * [geographic projection](projection.html) is applied.
66586658 */
6659- val `type` : Option[Type] = None,
6659+ val `type` : Type,
66606660
66616661 /**
66626662 * A constant value in visual domain (e.g., `"red"` / "#0099ff" for color, values between
66636663 * `0` to `1` for opacity).
66646664 */
6665- val value : Option[ConditionalValueDefValue] = None
6665+ val value : ConditionalValueDefValue
66666666 ) derives Encoder.AsObject, Decoder
66676667
66686668 /**
@@ -6722,7 +6722,7 @@ case class Spec (
67226722 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
67236723 * layering facet specifications is not allowed.
67246724 */
6725- val layer : Option[Seq[LayerSpec]] = None,
6725+ val layer : Seq[LayerSpec],
67266726
67276727 /**
67286728 * Name of the visualization for later reference.
@@ -6779,7 +6779,7 @@ case class Spec (
67796779 /**
67806780 * A key-value mapping between encoding channels and definition of fields.
67816781 */
6782- val encoding : Option[Encoding] = None,
6782+ val encoding : Encoding,
67836783
67846784 /**
67856785 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -6787,7 +6787,7 @@ case class Spec (
67876787 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
67886788 * object](mark.html#mark-def).
67896789 */
6790- val mark : Option[AnyMark] = None,
6790+ val mark : AnyMark,
67916791
67926792 /**
67936793 * An object defining properties of geographic projection.
@@ -6806,28 +6806,28 @@ case class Spec (
68066806 * An object that describes mappings between `row` and `column` channels and their field
68076807 * definitions.
68086808 */
6809- val facet : Option[FacetMapping] = None,
6809+ val facet : FacetMapping,
68106810
68116811 /**
68126812 * A specification of the view that gets faceted.
68136813 */
6814- val spec : Option[Spec] = None,
6814+ val spec : Spec,
68156815
68166816 /**
68176817 * An object that describes what fields should be repeated into views that are laid out as a
68186818 * `row` or `column`.
68196819 */
6820- val repeat : Option[Repeat] = None,
6820+ val repeat : Repeat,
68216821
68226822 /**
68236823 * A list of views that should be concatenated and put into a column.
68246824 */
6825- val vconcat : Option[Seq[Spec]] = None,
6825+ val vconcat : Seq[Spec],
68266826
68276827 /**
68286828 * A list of views that should be concatenated and put into a row.
68296829 */
6830- val hconcat : Option[Seq[Spec]] = None
6830+ val hconcat : Seq[Spec]
68316831 ) derives Encoder.AsObject, Decoder
68326832
68336833 /**
@@ -6967,7 +6967,7 @@ case class LayerSpec (
69676967 * __Note__: Specifications inside `layer` cannot use `row` and `column` channels as
69686968 * layering facet specifications is not allowed.
69696969 */
6970- val layer : Option[Seq[LayerSpec]] = None,
6970+ val layer : Seq[LayerSpec],
69716971
69726972 /**
69736973 * Name of the visualization for later reference.
@@ -7016,7 +7016,7 @@ case class LayerSpec (
70167016 /**
70177017 * A key-value mapping between encoding channels and definition of fields.
70187018 */
7019- val encoding : Option[Encoding] = None,
7019+ val encoding : Encoding,
70207020
70217021 /**
70227022 * A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`,
@@ -7024,7 +7024,7 @@ case class LayerSpec (
70247024 * * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a [mark definition
70257025 * object](mark.html#mark-def).
70267026 */
7027- val mark : Option[AnyMark] = None,
7027+ val mark : AnyMark,
70287028
70297029 /**
70307030 * An object defining properties of geographic projection.
@@ -7703,7 +7703,7 @@ case class Transform (
77037703 * (3) a [selection predicate](filter.html#selection-predicate);
77047704 * or (4) a logical operand that combines (1), (2), or (3).
77057705 */
7706- val filter : Option[LogicalOperandPredicate] = None,
7706+ val filter : LogicalOperandPredicate,
77077707
77087708 /**
77097709 * The field for storing the computed formula value.
@@ -7723,7 +7723,7 @@ case class Transform (
77237723 * A [expression](types.html#expression) string. Use the variable `datum` to refer to the
77247724 * current data object.
77257725 */
7726- val calculate : Option[String] = None,
7726+ val calculate : String,
77277727
77287728 /**
77297729 * The default value to use if lookup fails.
@@ -7735,34 +7735,34 @@ case class Transform (
77357735 /**
77367736 * Secondary data reference.
77377737 */
7738- val from : Option[LookupData] = None,
7738+ val from : LookupData,
77397739
77407740 /**
77417741 * Key in primary data source.
77427742 */
7743- val lookup : Option[String] = None,
7743+ val lookup : String,
77447744
77457745 /**
77467746 * An object indicating bin properties, or simply `true` for using default bin parameters.
77477747 */
7748- val bin : Option[Bin] = None,
7748+ val bin : Bin,
77497749
77507750 /**
77517751 * The data field to bin.
77527752 *
77537753 * The data field to apply time unit.
77547754 */
7755- val field : Option[String] = None,
7755+ val field : String,
77567756
77577757 /**
77587758 * The timeUnit.
77597759 */
7760- val timeUnit : Option[TimeUnit] = None,
7760+ val timeUnit : TimeUnit,
77617761
77627762 /**
77637763 * Array of objects that define fields to aggregate.
77647764 */
7765- val aggregate : Option[Seq[AggregatedFieldDef]] = None,
7765+ val aggregate : Seq[AggregatedFieldDef],
77667766
77677767 /**
77687768 * The data fields to group by. If not specified, a single group containing all data objects
Mschema-schemadefault / TopLevel.schema+98 −17
@@ -114,7 +114,16 @@
114114 "description": "A list of views that should be concatenated and put into a row."
115115 }
116116 },
117- "required": [],
117+ "required": [
118+ "encoding",
119+ "facet",
120+ "hconcat",
121+ "layer",
122+ "mark",
123+ "repeat",
124+ "spec",
125+ "vconcat"
126+ ],
118127 "title": "TopLevel"
119128 },
120129 "AutoSizeParams": {
@@ -1306,7 +1315,10 @@
13061315 "type": "number"
13071316 }
13081317 },
1309- "required": [],
1318+ "required": [
1319+ "scheme",
1320+ "step"
1321+ ],
13101322 "title": "RangeConfigValueVGScheme"
13111323 },
13121324 "ScaleConfig": {
@@ -2187,7 +2199,11 @@
21872199 "description": "Provide a placeholder name and bind data at runtime."
21882200 }
21892201 },
2190- "required": [],
2202+ "required": [
2203+ "name",
2204+ "url",
2205+ "values"
2206+ ],
21912207 "title": "Data",
21922208 "description": "An object describing the data source\nSecondary data source to lookup in."
21932209 },
@@ -2341,7 +2357,9 @@
23412357 "description": "A constant value in visual domain."
23422358 }
23432359 },
2344- "required": [],
2360+ "required": [
2361+ "type"
2362+ ],
23452363 "title": "MarkPropDefWithCondition",
23462364 "description": "Color of the marks – either fill or stroke color based on mark type.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](config.html#mark)'s `color` property.\n\n_Note:_ See the scale documentation for more information about customizing [color scheme](scale.html#scheme).\nOpacity of the marks – either can be a value or a range.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](config.html#mark)'s `opacity` property.\nFor `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark config](config.html#point-config)'s `shape` property.\nSize of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is currently unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`.\nA FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}\nA ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
23472365 },
@@ -2417,6 +2435,8 @@
24172435 }
24182436 },
24192437 "required": [
2438+ "selection",
2439+ "test",
24202440 "value"
24212441 ],
24222442 "title": "ConditionalValueDef"
@@ -2476,7 +2496,12 @@
24762496 "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
24772497 }
24782498 },
2479- "required": [],
2499+ "required": [
2500+ "selection",
2501+ "test",
2502+ "type",
2503+ "value"
2504+ ],
24802505 "title": "ConditionalPredicateMarkPropFieldDefClass"
24812506 },
24822507 "Selection": {
@@ -2499,7 +2524,11 @@
24992524 }
25002525 }
25012526 },
2502- "required": [],
2527+ "required": [
2528+ "and",
2529+ "not",
2530+ "or"
2531+ ],
25032532 "title": "Selection"
25042533 },
25052534 "Predicate": {
@@ -2554,7 +2583,16 @@
25542583 "description": "Filter using a selection name."
25552584 }
25562585 },
2557- "required": [],
2586+ "required": [
2587+ "and",
2588+ "equal",
2589+ "field",
2590+ "not",
2591+ "oneOf",
2592+ "or",
2593+ "range",
2594+ "selection"
2595+ ],
25582596 "title": "Predicate"
25592597 },
25602598 "DateTime": {
@@ -3019,7 +3057,9 @@
30193057 "description": "A constant value in visual domain."
30203058 }
30213059 },
3022- "required": [],
3060+ "required": [
3061+ "type"
3062+ ],
30233063 "title": "DefWithCondition",
30243064 "description": "A URL to load upon mouse click.\nA FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}\nA ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
30253065 },
@@ -3059,7 +3099,12 @@
30593099 "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
30603100 }
30613101 },
3062- "required": [],
3102+ "required": [
3103+ "selection",
3104+ "test",
3105+ "type",
3106+ "value"
3107+ ],
30633108 "title": "ConditionalPredicateFieldDefClass"
30643109 },
30653110 "OrderFieldDef": {
@@ -3140,7 +3185,9 @@
31403185 "description": "A constant value in visual domain."
31413186 }
31423187 },
3143- "required": [],
3188+ "required": [
3189+ "type"
3190+ ],
31443191 "title": "TextDefWithCondition",
31453192 "description": "Text of the `text` mark.\nThe tooltip text to show upon mouse hover.\nA FieldDef with Condition<ValueDef>\n{\n condition: {value: ...},\n field: ...,\n ...\n}\nA ValueDef with Condition<ValueDef | FieldDef>\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}"
31463193 },
@@ -3184,7 +3231,12 @@
31843231 "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or\n`\"nominal\"`).\nIt can also be a geo type (`\"latitude\"`, `\"longitude\"`, and `\"geojson\"`) when a\n[geographic projection](projection.html) is applied."
31853232 }
31863233 },
3187- "required": [],
3234+ "required": [
3235+ "selection",
3236+ "test",
3237+ "type",
3238+ "value"
3239+ ],
31883240 "title": "ConditionalPredicateTextFieldDefClass"
31893241 },
31903242 "XClass": {
@@ -3246,7 +3298,10 @@
32463298 "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
32473299 }
32483300 },
3249- "required": [],
3301+ "required": [
3302+ "type",
3303+ "value"
3304+ ],
32503305 "title": "XClass",
32513306 "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\nY coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\nDefinition object for a constant value of an encoding channel."
32523307 },
@@ -3389,7 +3444,10 @@
33893444 "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between\n`0` to `1` for opacity)."
33903445 }
33913446 },
3392- "required": [],
3447+ "required": [
3448+ "type",
3449+ "value"
3450+ ],
33933451 "title": "X2Class",
33943452 "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\nY2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\nDefinition object for a data field, its type and transformation of an encoding channel.\nDefinition object for a constant value of an encoding channel."
33953453 },
@@ -3502,7 +3560,16 @@
35023560 "description": "A list of views that should be concatenated and put into a row."
35033561 }
35043562 },
3505- "required": [],
3563+ "required": [
3564+ "encoding",
3565+ "facet",
3566+ "hconcat",
3567+ "layer",
3568+ "mark",
3569+ "repeat",
3570+ "spec",
3571+ "vconcat"
3572+ ],
35063573 "title": "Spec",
35073574 "description": "Unit spec that can have a composite mark."
35083575 },
@@ -3633,7 +3700,11 @@
36333700 "description": "A key-value mapping between selection names and definitions."
36343701 }
36353702 },
3636- "required": [],
3703+ "required": [
3704+ "encoding",
3705+ "layer",
3706+ "mark"
3707+ ],
36373708 "title": "LayerSpec",
36383709 "description": "Unit spec that can have a composite mark."
36393710 },
@@ -4052,7 +4123,8 @@
40524123 }
40534124 },
40544125 "required": [
4055- "input"
4126+ "input",
4127+ "options"
40564128 ],
40574129 "title": "VGBinding"
40584130 },
@@ -4141,7 +4213,16 @@
41414213 "description": "The data fields to group by. If not specified, a single group containing all data objects\nwill be used."
41424214 }
41434215 },
4144- "required": [],
4216+ "required": [
4217+ "aggregate",
4218+ "bin",
4219+ "calculate",
4220+ "field",
4221+ "filter",
4222+ "from",
4223+ "lookup",
4224+ "timeUnit"
4225+ ],
41454226 "title": "Transform"
41464227 },
41474228 "AggregatedFieldDef": {
Mschema-typescript-zoddefault / TopLevel.ts+86 −86
@@ -588,40 +588,40 @@ export const SelectionDefTypeSchema = z.enum([
588588 export type SelectionDefType = z.infer<typeof SelectionDefTypeSchema>;
589589
590590 export type Selection = {
591- "not"?: Selection | string;
592- "and"?: Array<Selection | string>;
593- "or"?: Array<Selection | string>;
591+ "not": Selection | string;
592+ "and": Array<Selection | string>;
593+ "or": Array<Selection | string>;
594594 };
595595 export const SelectionSchema: z.ZodType<Selection> = z.lazy(() =>
596596 z.object({
597- "not": z.union([SelectionSchema, z.string()]).optional(),
598- "and": z.array(z.union([SelectionSchema, z.string()])).optional(),
599- "or": z.array(z.union([SelectionSchema, z.string()])).optional(),
597+ "not": z.union([SelectionSchema, z.string()]),
598+ "and": z.array(z.union([SelectionSchema, z.string()])),
599+ "or": z.array(z.union([SelectionSchema, z.string()])),
600600 })
601601 );
602602
603603 export type Predicate = {
604- "not"?: Predicate | string;
605- "and"?: Array<Predicate | string>;
606- "or"?: Array<Predicate | string>;
607- "equal"?: boolean | DateTime | number | string;
608- "field"?: string;
604+ "not": Predicate | string;
605+ "and": Array<Predicate | string>;
606+ "or": Array<Predicate | string>;
607+ "equal": boolean | DateTime | number | string;
608+ "field": string;
609609 "timeUnit"?: TimeUnit;
610- "range"?: Array<DateTime | number | null>;
611- "oneOf"?: Array<boolean | DateTime | number | string>;
612- "selection"?: Selection | string;
610+ "range": Array<DateTime | number | null>;
611+ "oneOf": Array<boolean | DateTime | number | string>;
612+ "selection": Selection | string;
613613 };
614614 export const PredicateSchema: z.ZodType<Predicate> = z.lazy(() =>
615615 z.object({
616- "not": z.union([PredicateSchema, z.string()]).optional(),
617- "and": z.array(z.union([PredicateSchema, z.string()])).optional(),
618- "or": z.array(z.union([PredicateSchema, z.string()])).optional(),
619- "equal": z.union([z.boolean(), DateTimeSchema, z.number(), z.string()]).optional(),
620- "field": z.string().optional(),
616+ "not": z.union([PredicateSchema, z.string()]),
617+ "and": z.array(z.union([PredicateSchema, z.string()])),
618+ "or": z.array(z.union([PredicateSchema, z.string()])),
619+ "equal": z.union([z.boolean(), DateTimeSchema, z.number(), z.string()]),
620+ "field": z.string(),
621621 "timeUnit": TimeUnitSchema.optional(),
622- "range": z.array(z.union([z.null(), DateTimeSchema, z.number()])).min(2).max(2).optional(),
623- "oneOf": z.array(z.union([z.boolean(), DateTimeSchema, z.number(), z.string()])).optional(),
624- "selection": z.union([SelectionSchema, z.string()]).optional(),
622+ "range": z.array(z.union([z.null(), DateTimeSchema, z.number()])).min(2).max(2),
623+ "oneOf": z.array(z.union([z.boolean(), DateTimeSchema, z.number(), z.string()])),
624+ "selection": z.union([SelectionSchema, z.string()]),
625625 })
626626 );
627627
@@ -629,42 +629,42 @@ export type Spec = {
629629 "data"?: Data;
630630 "description"?: string;
631631 "height"?: number;
632- "layer"?: Array<LayerSpec>;
632+ "layer": Array<LayerSpec>;
633633 "name"?: string;
634634 "resolve"?: Resolve;
635635 "title"?: TitleParams | string;
636636 "transform"?: Array<Transform>;
637637 "width"?: number;
638- "encoding"?: Encoding;
639- "mark"?: MarkDef | Mark;
638+ "encoding": Encoding;
639+ "mark": MarkDef | Mark;
640640 "projection"?: Projection;
641641 "selection"?: Record<string, SelectionDef>;
642- "facet"?: FacetMapping;
643- "spec"?: Spec;
644- "repeat"?: Repeat;
645- "vconcat"?: Array<Spec>;
646- "hconcat"?: Array<Spec>;
642+ "facet": FacetMapping;
643+ "spec": Spec;
644+ "repeat": Repeat;
645+ "vconcat": Array<Spec>;
646+ "hconcat": Array<Spec>;
647647 };
648648 export const SpecSchema: z.ZodType<Spec> = z.lazy(() =>
649649 z.object({
650650 "data": DataSchema.optional(),
651651 "description": z.string().optional(),
652652 "height": z.number().optional(),
653- "layer": z.array(LayerSpecSchema).optional(),
653+ "layer": z.array(LayerSpecSchema),
654654 "name": z.string().optional(),
655655 "resolve": ResolveSchema.optional(),
656656 "title": z.union([TitleParamsSchema, z.string()]).optional(),
657657 "transform": z.array(TransformSchema).optional(),
658658 "width": z.number().optional(),
659- "encoding": EncodingSchema.optional(),
660- "mark": z.union([MarkDefSchema, MarkSchema]).optional(),
659+ "encoding": EncodingSchema,
660+ "mark": z.union([MarkDefSchema, MarkSchema]),
661661 "projection": ProjectionSchema.optional(),
662662 "selection": z.record(z.string(), SelectionDefSchema).optional(),
663- "facet": FacetMappingSchema.optional(),
664- "spec": SpecSchema.optional(),
665- "repeat": RepeatSchema.optional(),
666- "vconcat": z.array(SpecSchema).optional(),
667- "hconcat": z.array(SpecSchema).optional(),
663+ "facet": FacetMappingSchema,
664+ "spec": SpecSchema,
665+ "repeat": RepeatSchema,
666+ "vconcat": z.array(SpecSchema),
667+ "hconcat": z.array(SpecSchema),
668668 })
669669 );
670670
@@ -672,14 +672,14 @@ export type LayerSpec = {
672672 "data"?: Data;
673673 "description"?: string;
674674 "height"?: number;
675- "layer"?: Array<LayerSpec>;
675+ "layer": Array<LayerSpec>;
676676 "name"?: string;
677677 "resolve"?: Resolve;
678678 "title"?: TitleParams | string;
679679 "transform"?: Array<Transform>;
680680 "width"?: number;
681- "encoding"?: Encoding;
682- "mark"?: MarkDef | Mark;
681+ "encoding": Encoding;
682+ "mark": MarkDef | Mark;
683683 "projection"?: Projection;
684684 "selection"?: Record<string, SelectionDef>;
685685 };
@@ -688,14 +688,14 @@ export const LayerSpecSchema: z.ZodType<LayerSpec> = z.lazy(() =>
688688 "data": DataSchema.optional(),
689689 "description": z.string().optional(),
690690 "height": z.number().optional(),
691- "layer": z.array(LayerSpecSchema).optional(),
691+ "layer": z.array(LayerSpecSchema),
692692 "name": z.string().optional(),
693693 "resolve": ResolveSchema.optional(),
694694 "title": z.union([TitleParamsSchema, z.string()]).optional(),
695695 "transform": z.array(TransformSchema).optional(),
696696 "width": z.number().optional(),
697- "encoding": EncodingSchema.optional(),
698- "mark": z.union([MarkDefSchema, MarkSchema]).optional(),
697+ "encoding": EncodingSchema,
698+ "mark": z.union([MarkDefSchema, MarkSchema]),
699699 "projection": ProjectionSchema.optional(),
700700 "selection": z.record(z.string(), SelectionDefSchema).optional(),
701701 })
@@ -934,7 +934,7 @@ export type ProjectionConfig = z.infer<typeof ProjectionConfigSchema>;
934934 export const VgSchemeSchema = z.object({
935935 "count": z.number().optional(),
936936 "extent": z.array(z.number()).optional(),
937- "scheme": z.string().optional(),
937+ "scheme": z.string(),
938938 "step": z.number().optional(),
939939 });
940940 export type VgScheme = z.infer<typeof VgSchemeSchema>;
@@ -987,7 +987,7 @@ export type MultiSelectionConfig = z.infer<typeof MultiSelectionConfigSchema>;
987987 export const VgBindingSchema = z.object({
988988 "element": z.string().optional(),
989989 "input": z.string(),
990- "options": z.array(z.string()).optional(),
990+ "options": z.array(z.string()),
991991 "max": z.number().optional(),
992992 "min": z.number().optional(),
993993 "step": z.number().optional(),
@@ -1147,9 +1147,9 @@ export const BinParamsSchema = z.object({
11471147 export type BinParams = z.infer<typeof BinParamsSchema>;
11481148
11491149 export const ConditionalValueDefSchema = z.object({
1150- "test": z.union([PredicateSchema, z.string()]).optional(),
1150+ "test": z.union([PredicateSchema, z.string()]),
11511151 "value": z.union([z.boolean(), z.number(), z.string()]),
1152- "selection": z.union([SelectionSchema, z.string()]).optional(),
1152+ "selection": z.union([SelectionSchema, z.string()]),
11531153 });
11541154 export type ConditionalValueDef = z.infer<typeof ConditionalValueDefSchema>;
11551155
@@ -1235,14 +1235,14 @@ export const FieldDefSchema = z.object({
12351235 export type FieldDef = z.infer<typeof FieldDefSchema>;
12361236
12371237 export const ConditionalPredicateFieldDefClassSchema = z.object({
1238- "test": z.union([PredicateSchema, z.string()]).optional(),
1239- "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
1240- "selection": z.union([SelectionSchema, z.string()]).optional(),
1238+ "test": z.union([PredicateSchema, z.string()]),
1239+ "value": z.union([z.boolean(), z.number(), z.string()]),
1240+ "selection": z.union([SelectionSchema, z.string()]),
12411241 "aggregate": AggregateOpSchema.optional(),
12421242 "bin": z.union([z.boolean(), BinParamsSchema]).optional(),
12431243 "field": z.union([RepeatRefSchema, z.string()]).optional(),
12441244 "timeUnit": TimeUnitSchema.optional(),
1245- "type": TypeSchema.optional(),
1245+ "type": TypeSchema,
12461246 });
12471247 export type ConditionalPredicateFieldDefClass = z.infer<typeof ConditionalPredicateFieldDefClassSchema>;
12481248
@@ -1257,15 +1257,15 @@ export const OrderFieldDefSchema = z.object({
12571257 export type OrderFieldDef = z.infer<typeof OrderFieldDefSchema>;
12581258
12591259 export const ConditionalPredicateTextFieldDefClassSchema = z.object({
1260- "test": z.union([PredicateSchema, z.string()]).optional(),
1261- "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
1262- "selection": z.union([SelectionSchema, z.string()]).optional(),
1260+ "test": z.union([PredicateSchema, z.string()]),
1261+ "value": z.union([z.boolean(), z.number(), z.string()]),
1262+ "selection": z.union([SelectionSchema, z.string()]),
12631263 "aggregate": AggregateOpSchema.optional(),
12641264 "bin": z.union([z.boolean(), BinParamsSchema]).optional(),
12651265 "field": z.union([RepeatRefSchema, z.string()]).optional(),
12661266 "format": z.string().optional(),
12671267 "timeUnit": TimeUnitSchema.optional(),
1268- "type": TypeSchema.optional(),
1268+ "type": TypeSchema,
12691269 });
12701270 export type ConditionalPredicateTextFieldDefClass = z.infer<typeof ConditionalPredicateTextFieldDefClassSchema>;
12711271
@@ -1300,8 +1300,8 @@ export const X2ClassSchema = z.object({
13001300 "bin": z.union([z.boolean(), BinParamsSchema]).optional(),
13011301 "field": z.union([RepeatRefSchema, z.string()]).optional(),
13021302 "timeUnit": TimeUnitSchema.optional(),
1303- "type": TypeSchema.optional(),
1304- "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
1303+ "type": TypeSchema,
1304+ "value": z.union([z.boolean(), z.number(), z.string()]),
13051305 });
13061306 export type X2Class = z.infer<typeof X2ClassSchema>;
13071307
@@ -1449,9 +1449,9 @@ export type SingleSelectionConfig = z.infer<typeof SingleSelectionConfigSchema>;
14491449
14501450 export const DataSchema = z.object({
14511451 "format": DataFormatSchema.optional(),
1452- "url": z.string().optional(),
1453- "values": z.union([z.array(z.union([z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()])), z.record(z.string(), z.any()), z.string()]).optional(),
1454- "name": z.string().optional(),
1452+ "url": z.string(),
1453+ "values": z.union([z.array(z.union([z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()])), z.record(z.string(), z.any()), z.string()]),
1454+ "name": z.string(),
14551455 });
14561456 export type Data = z.infer<typeof DataSchema>;
14571457
@@ -1491,7 +1491,7 @@ export const DefWithConditionSchema = z.object({
14911491 "condition": z.union([z.array(ConditionalValueDefSchema), ConditionalPredicateFieldDefClassSchema]).optional(),
14921492 "field": z.union([RepeatRefSchema, z.string()]).optional(),
14931493 "timeUnit": TimeUnitSchema.optional(),
1494- "type": TypeSchema.optional(),
1494+ "type": TypeSchema,
14951495 "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
14961496 });
14971497 export type DefWithCondition = z.infer<typeof DefWithConditionSchema>;
@@ -1503,7 +1503,7 @@ export const TextDefWithConditionSchema = z.object({
15031503 "field": z.union([RepeatRefSchema, z.string()]).optional(),
15041504 "format": z.string().optional(),
15051505 "timeUnit": TimeUnitSchema.optional(),
1506- "type": TypeSchema.optional(),
1506+ "type": TypeSchema,
15071507 "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
15081508 });
15091509 export type TextDefWithCondition = z.infer<typeof TextDefWithConditionSchema>;
@@ -1517,8 +1517,8 @@ export const XClassSchema = z.object({
15171517 "sort": z.union([z.null(), SortFieldSchema, SortEnumSchema]).optional(),
15181518 "stack": z.union([z.null(), StackOffsetSchema]).optional(),
15191519 "timeUnit": TimeUnitSchema.optional(),
1520- "type": TypeSchema.optional(),
1521- "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
1520+ "type": TypeSchema,
1521+ "value": z.union([z.boolean(), z.number(), z.string()]),
15221522 });
15231523 export type XClass = z.infer<typeof XClassSchema>;
15241524
@@ -1550,9 +1550,9 @@ export const SelectionConfigSchema = z.object({
15501550 export type SelectionConfig = z.infer<typeof SelectionConfigSchema>;
15511551
15521552 export const ConditionalPredicateMarkPropFieldDefClassSchema = z.object({
1553- "test": z.union([PredicateSchema, z.string()]).optional(),
1554- "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
1555- "selection": z.union([SelectionSchema, z.string()]).optional(),
1553+ "test": z.union([PredicateSchema, z.string()]),
1554+ "value": z.union([z.boolean(), z.number(), z.string()]),
1555+ "selection": z.union([SelectionSchema, z.string()]),
15561556 "aggregate": AggregateOpSchema.optional(),
15571557 "bin": z.union([z.boolean(), BinParamsSchema]).optional(),
15581558 "field": z.union([RepeatRefSchema, z.string()]).optional(),
@@ -1560,21 +1560,21 @@ export const ConditionalPredicateMarkPropFieldDefClassSchema = z.object({
15601560 "scale": ScaleSchema.optional(),
15611561 "sort": z.union([z.null(), SortFieldSchema, SortEnumSchema]).optional(),
15621562 "timeUnit": TimeUnitSchema.optional(),
1563- "type": TypeSchema.optional(),
1563+ "type": TypeSchema,
15641564 });
15651565 export type ConditionalPredicateMarkPropFieldDefClass = z.infer<typeof ConditionalPredicateMarkPropFieldDefClassSchema>;
15661566
15671567 export const TransformSchema = z.object({
1568- "filter": z.union([PredicateSchema, z.string()]).optional(),
1568+ "filter": z.union([PredicateSchema, z.string()]),
15691569 "as": z.union([z.array(z.string()), z.string()]).optional(),
1570- "calculate": z.string().optional(),
1570+ "calculate": z.string(),
15711571 "default": z.string().optional(),
1572- "from": LookupDataSchema.optional(),
1573- "lookup": z.string().optional(),
1574- "bin": z.union([z.boolean(), BinParamsSchema]).optional(),
1575- "field": z.string().optional(),
1576- "timeUnit": TimeUnitSchema.optional(),
1577- "aggregate": z.array(AggregatedFieldDefSchema).optional(),
1572+ "from": LookupDataSchema,
1573+ "lookup": z.string(),
1574+ "bin": z.union([z.boolean(), BinParamsSchema]),
1575+ "field": z.string(),
1576+ "timeUnit": TimeUnitSchema,
1577+ "aggregate": z.array(AggregatedFieldDefSchema),
15781578 "groupby": z.array(z.string()).optional(),
15791579 });
15801580 export type Transform = z.infer<typeof TransformSchema>;
@@ -1629,7 +1629,7 @@ export const MarkPropDefWithConditionSchema = z.object({
16291629 "scale": ScaleSchema.optional(),
16301630 "sort": z.union([z.null(), SortFieldSchema, SortEnumSchema]).optional(),
16311631 "timeUnit": TimeUnitSchema.optional(),
1632- "type": TypeSchema.optional(),
1632+ "type": TypeSchema,
16331633 "value": z.union([z.boolean(), z.number(), z.string()]).optional(),
16341634 });
16351635 export type MarkPropDefWithCondition = z.infer<typeof MarkPropDefWithConditionSchema>;
@@ -1677,9 +1677,9 @@ export const TopLevelSchema = z.object({
16771677 "config": ConfigSchema.optional(),
16781678 "data": DataSchema.optional(),
16791679 "description": z.string().optional(),
1680- "encoding": EncodingWithFacetSchema.optional(),
1680+ "encoding": EncodingWithFacetSchema,
16811681 "height": z.number().optional(),
1682- "mark": z.union([MarkDefSchema, MarkSchema]).optional(),
1682+ "mark": z.union([MarkDefSchema, MarkSchema]),
16831683 "name": z.string().optional(),
16841684 "padding": z.union([PaddingClassSchema, z.number()]).optional(),
16851685 "projection": ProjectionSchema.optional(),
@@ -1687,12 +1687,12 @@ export const TopLevelSchema = z.object({
16871687 "title": z.union([TitleParamsSchema, z.string()]).optional(),
16881688 "transform": z.array(TransformSchema).optional(),
16891689 "width": z.number().optional(),
1690- "layer": z.array(LayerSpecSchema).optional(),
1690+ "layer": z.array(LayerSpecSchema),
16911691 "resolve": ResolveSchema.optional(),
1692- "facet": FacetMappingSchema.optional(),
1693- "spec": SpecSchema.optional(),
1694- "repeat": RepeatSchema.optional(),
1695- "vconcat": z.array(SpecSchema).optional(),
1696- "hconcat": z.array(SpecSchema).optional(),
1692+ "facet": FacetMappingSchema,
1693+ "spec": SpecSchema,
1694+ "repeat": RepeatSchema,
1695+ "vconcat": z.array(SpecSchema),
1696+ "hconcat": z.array(SpecSchema),
16971697 });
16981698 export type TopLevel = z.infer<typeof TopLevelSchema>;
No generated files match these filters.