Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
316test cases
1,214files differ
1,173modified
41new
0deleted
23,677changed lines
+16,838 −6,839insertions / deletions
Base b848720ff991a5e25d8f194da6d4aed99b478368 · PR merge 782e3f0783b9b72f84a75a5139bdbfff19fd690c · Head 6d7da60d5cc2cb71b43692c7cb371e8aed17e208 · raw patch
Test case

test/inputs/graphql/github1.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/graphql/github2.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Test case

test/inputs/graphql/github3.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Test case

test/inputs/graphql/github4.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/graphql/github5.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/graphql/github6.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/graphql/github7.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Test case

test/inputs/graphql/github8.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Test case

test/inputs/graphql/github9.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 if (val === null || typeof val !== "object" || Array.isArray(val)) {
134134 return invalidValue(l(ref || "object"), val, key, parent);
135135 }
136- const result: any = {};
136+ const result: any = Object.create(null);
137137 Object.getOwnPropertyNames(props).forEach(key => {
138138 const prop = props[key];
139139 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
144144 result[key] = transform(val[key], additional, getProps, key, ref);
145145 }
146146 });
147- return result;
147+ return Object.setPrototypeOf(result, Object.prototype);
148148 }
149149
150150 if (typ === "any") return val;
Test case

test/inputs/json/misc/00c36.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/00ec5.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -160,7 +160,7 @@ provider =
160160 encodeProvider : Provider -> Jenc.Value
161161 encodeProvider x =
162162 Jenc.object
163- [ ("properties", Jenc.dict identity encodeProperty x.properties)
163+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
164164 ]
165165
166166 property : Jdec.Decoder Property
@@ -303,6 +303,14 @@ encodeSchema x =
303303
304304 --- encoder helpers
305305
306+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
307+makeDictEncoder f m r =
308+ r
309+ |> Dict.toList
310+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
311+ |> String.join ","
312+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
313+
306314 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
307315 makeNullableEncoder f m =
308316 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
174174 if (val === null || typeof val !== "object" || Array.isArray(val)) {
175175 return invalidValue(l(ref || "object"), val, key, parent);
176176 }
177- const result: any = {};
177+ const result: any = Object.create(null);
178178 Object.getOwnPropertyNames(props).forEach(key => {
179179 const prop = props[key];
180180 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -185,7 +185,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
185185 result[key] = transform(val[key], additional, getProps, key, ref);
186186 }
187187 });
188- return result;
188+ return Object.setPrototypeOf(result, Object.prototype);
189189 }
190190
191191 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -173,7 +173,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
173173 if (val === null || typeof val !== "object" || Array.isArray(val)) {
174174 return invalidValue(l(ref || "object"), val, key, parent);
175175 }
176- const result: any = {};
176+ const result: any = Object.create(null);
177177 Object.getOwnPropertyNames(props).forEach(key => {
178178 const prop = props[key];
179179 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -184,7 +184,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
184184 result[key] = transform(val[key], additional, getProps, key, ref);
185185 }
186186 });
187- return result;
187+ return Object.setPrototypeOf(result, Object.prototype);
188188 }
189189
190190 if (typ === "any") return val;
Test case

test/inputs/json/misc/010b1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/016af.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/033b1.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/050b0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
163163 if (val === null || typeof val !== "object" || Array.isArray(val)) {
164164 return invalidValue(l(ref || "object"), val, key, parent);
165165 }
166- const result: any = {};
166+ const result: any = Object.create(null);
167167 Object.getOwnPropertyNames(props).forEach(key => {
168168 const prop = props[key];
169169 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
174174 result[key] = transform(val[key], additional, getProps, key, ref);
175175 }
176176 });
177- return result;
177+ return Object.setPrototypeOf(result, Object.prototype);
178178 }
179179
180180 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/06bee.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Test case

test/inputs/json/misc/07540.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/0779f.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/07c75.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Test case

test/inputs/json/misc/09f54.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("data", Jenc.dict identity encodeDatum x.data)
64+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6565 , ("description", encodeDescription x.description)
6666 ]
6767
@@ -97,6 +97,14 @@ encodeDescription x =
9797
9898 --- encoder helpers
9999
100+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
101+makeDictEncoder f m r =
102+ r
103+ |> Dict.toList
104+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
105+ |> String.join ","
106+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
107+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/misc/0a358.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 if (val === null || typeof val !== "object" || Array.isArray(val)) {
126126 return invalidValue(l(ref || "object"), val, key, parent);
127127 }
128- const result: any = {};
128+ const result: any = Object.create(null);
129129 Object.getOwnPropertyNames(props).forEach(key => {
130130 const prop = props[key];
131131 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 result[key] = transform(val[key], additional, getProps, key, ref);
137137 }
138138 });
139- return result;
139+ return Object.setPrototypeOf(result, Object.prototype);
140140 }
141141
142142 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Test case

test/inputs/json/misc/0a91a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -327,7 +327,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
327327 if (val === null || typeof val !== "object" || Array.isArray(val)) {
328328 return invalidValue(l(ref || "object"), val, key, parent);
329329 }
330- const result: any = {};
330+ const result: any = Object.create(null);
331331 Object.getOwnPropertyNames(props).forEach(key => {
332332 const prop = props[key];
333333 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -338,7 +338,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
338338 result[key] = transform(val[key], additional, getProps, key, ref);
339339 }
340340 });
341- return result;
341+ return Object.setPrototypeOf(result, Object.prototype);
342342 }
343343
344344 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -322,7 +322,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
322322 if (val === null || typeof val !== "object" || Array.isArray(val)) {
323323 return invalidValue(l(ref || "object"), val, key, parent);
324324 }
325- const result: any = {};
325+ const result: any = Object.create(null);
326326 Object.getOwnPropertyNames(props).forEach(key => {
327327 const prop = props[key];
328328 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -333,7 +333,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
333333 result[key] = transform(val[key], additional, getProps, key, ref);
334334 }
335335 });
336- return result;
336+ return Object.setPrototypeOf(result, Object.prototype);
337337 }
338338
339339 if (typ === "any") return val;
Test case

test/inputs/json/misc/0b91a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/0cffa.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -222,7 +222,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
222222 if (val === null || typeof val !== "object" || Array.isArray(val)) {
223223 return invalidValue(l(ref || "object"), val, key, parent);
224224 }
225- const result: any = {};
225+ const result: any = Object.create(null);
226226 Object.getOwnPropertyNames(props).forEach(key => {
227227 const prop = props[key];
228228 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
233233 result[key] = transform(val[key], additional, getProps, key, ref);
234234 }
235235 });
236- return result;
236+ return Object.setPrototypeOf(result, Object.prototype);
237237 }
238238
239239 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/0e0c2.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -184,7 +184,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
184184 if (val === null || typeof val !== "object" || Array.isArray(val)) {
185185 return invalidValue(l(ref || "object"), val, key, parent);
186186 }
187- const result: any = {};
187+ const result: any = Object.create(null);
188188 Object.getOwnPropertyNames(props).forEach(key => {
189189 const prop = props[key];
190190 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
195195 result[key] = transform(val[key], additional, getProps, key, ref);
196196 }
197197 });
198- return result;
198+ return Object.setPrototypeOf(result, Object.prototype);
199199 }
200200
201201 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
178178 if (val === null || typeof val !== "object" || Array.isArray(val)) {
179179 return invalidValue(l(ref || "object"), val, key, parent);
180180 }
181- const result: any = {};
181+ const result: any = Object.create(null);
182182 Object.getOwnPropertyNames(props).forEach(key => {
183183 const prop = props[key];
184184 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
189189 result[key] = transform(val[key], additional, getProps, key, ref);
190190 }
191191 });
192- return result;
192+ return Object.setPrototypeOf(result, Object.prototype);
193193 }
194194
195195 if (typ === "any") return val;
Test case

test/inputs/json/misc/0fecf.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/10be4.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
174174 if (val === null || typeof val !== "object" || Array.isArray(val)) {
175175 return invalidValue(l(ref || "object"), val, key, parent);
176176 }
177- const result: any = {};
177+ const result: any = Object.create(null);
178178 Object.getOwnPropertyNames(props).forEach(key => {
179179 const prop = props[key];
180180 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -185,7 +185,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
185185 result[key] = transform(val[key], additional, getProps, key, ref);
186186 }
187187 });
188- return result;
188+ return Object.setPrototypeOf(result, Object.prototype);
189189 }
190190
191191 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/112b5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/misc/127a1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
221221 if (val === null || typeof val !== "object" || Array.isArray(val)) {
222222 return invalidValue(l(ref || "object"), val, key, parent);
223223 }
224- const result: any = {};
224+ const result: any = Object.create(null);
225225 Object.getOwnPropertyNames(props).forEach(key => {
226226 const prop = props[key];
227227 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -232,7 +232,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
232232 result[key] = transform(val[key], additional, getProps, key, ref);
233233 }
234234 });
235- return result;
235+ return Object.setPrototypeOf(result, Object.prototype);
236236 }
237237
238238 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/13d8d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 if (val === null || typeof val !== "object" || Array.isArray(val)) {
134134 return invalidValue(l(ref || "object"), val, key, parent);
135135 }
136- const result: any = {};
136+ const result: any = Object.create(null);
137137 Object.getOwnPropertyNames(props).forEach(key => {
138138 const prop = props[key];
139139 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
144144 result[key] = transform(val[key], additional, getProps, key, ref);
145145 }
146146 });
147- return result;
147+ return Object.setPrototypeOf(result, Object.prototype);
148148 }
149149
150150 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 if (val === null || typeof val !== "object" || Array.isArray(val)) {
134134 return invalidValue(l(ref || "object"), val, key, parent);
135135 }
136- const result: any = {};
136+ const result: any = Object.create(null);
137137 Object.getOwnPropertyNames(props).forEach(key => {
138138 const prop = props[key];
139139 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
144144 result[key] = transform(val[key], additional, getProps, key, ref);
145145 }
146146 });
147- return result;
147+ return Object.setPrototypeOf(result, Object.prototype);
148148 }
149149
150150 if (typ === "any") return val;
Test case

test/inputs/json/misc/14d38.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/misc/167d6.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/16bc5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/176f1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Test case

test/inputs/json/misc/1a7f5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/1b28c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/1b409.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -198,7 +198,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
198198 if (val === null || typeof val !== "object" || Array.isArray(val)) {
199199 return invalidValue(l(ref || "object"), val, key, parent);
200200 }
201- const result: any = {};
201+ const result: any = Object.create(null);
202202 Object.getOwnPropertyNames(props).forEach(key => {
203203 const prop = props[key];
204204 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -209,7 +209,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
209209 result[key] = transform(val[key], additional, getProps, key, ref);
210210 }
211211 });
212- return result;
212+ return Object.setPrototypeOf(result, Object.prototype);
213213 }
214214
215215 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
181181 if (val === null || typeof val !== "object" || Array.isArray(val)) {
182182 return invalidValue(l(ref || "object"), val, key, parent);
183183 }
184- const result: any = {};
184+ const result: any = Object.create(null);
185185 Object.getOwnPropertyNames(props).forEach(key => {
186186 const prop = props[key];
187187 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -192,7 +192,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
192192 result[key] = transform(val[key], additional, getProps, key, ref);
193193 }
194194 });
195- return result;
195+ return Object.setPrototypeOf(result, Object.prototype);
196196 }
197197
198198 if (typ === "any") return val;
Test case

test/inputs/json/misc/2465e.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Test case

test/inputs/json/misc/24f52.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/262f0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
210210 if (val === null || typeof val !== "object" || Array.isArray(val)) {
211211 return invalidValue(l(ref || "object"), val, key, parent);
212212 }
213- const result: any = {};
213+ const result: any = Object.create(null);
214214 Object.getOwnPropertyNames(props).forEach(key => {
215215 const prop = props[key];
216216 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
221221 result[key] = transform(val[key], additional, getProps, key, ref);
222222 }
223223 });
224- return result;
224+ return Object.setPrototypeOf(result, Object.prototype);
225225 }
226226
227227 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/26b49.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
219219 if (val === null || typeof val !== "object" || Array.isArray(val)) {
220220 return invalidValue(l(ref || "object"), val, key, parent);
221221 }
222- const result: any = {};
222+ const result: any = Object.create(null);
223223 Object.getOwnPropertyNames(props).forEach(key => {
224224 const prop = props[key];
225225 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -230,7 +230,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
230230 result[key] = transform(val[key], additional, getProps, key, ref);
231231 }
232232 });
233- return result;
233+ return Object.setPrototypeOf(result, Object.prototype);
234234 }
235235
236236 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -214,7 +214,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
214214 if (val === null || typeof val !== "object" || Array.isArray(val)) {
215215 return invalidValue(l(ref || "object"), val, key, parent);
216216 }
217- const result: any = {};
217+ const result: any = Object.create(null);
218218 Object.getOwnPropertyNames(props).forEach(key => {
219219 const prop = props[key];
220220 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -225,7 +225,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
225225 result[key] = transform(val[key], additional, getProps, key, ref);
226226 }
227227 });
228- return result;
228+ return Object.setPrototypeOf(result, Object.prototype);
229229 }
230230
231231 if (typ === "any") return val;
Test case

test/inputs/json/misc/26c9c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
294294 if (val === null || typeof val !== "object" || Array.isArray(val)) {
295295 return invalidValue(l(ref || "object"), val, key, parent);
296296 }
297- const result: any = {};
297+ const result: any = Object.create(null);
298298 Object.getOwnPropertyNames(props).forEach(key => {
299299 const prop = props[key];
300300 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -305,7 +305,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
305305 result[key] = transform(val[key], additional, getProps, key, ref);
306306 }
307307 });
308- return result;
308+ return Object.setPrototypeOf(result, Object.prototype);
309309 }
310310
311311 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
294294 if (val === null || typeof val !== "object" || Array.isArray(val)) {
295295 return invalidValue(l(ref || "object"), val, key, parent);
296296 }
297- const result: any = {};
297+ const result: any = Object.create(null);
298298 Object.getOwnPropertyNames(props).forEach(key => {
299299 const prop = props[key];
300300 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -305,7 +305,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
305305 result[key] = transform(val[key], additional, getProps, key, ref);
306306 }
307307 });
308- return result;
308+ return Object.setPrototypeOf(result, Object.prototype);
309309 }
310310
311311 if (typ === "any") return val;
Test case

test/inputs/json/misc/27332.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -260,7 +260,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
260260 if (val === null || typeof val !== "object" || Array.isArray(val)) {
261261 return invalidValue(l(ref || "object"), val, key, parent);
262262 }
263- const result: any = {};
263+ const result: any = Object.create(null);
264264 Object.getOwnPropertyNames(props).forEach(key => {
265265 const prop = props[key];
266266 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -271,7 +271,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
271271 result[key] = transform(val[key], additional, getProps, key, ref);
272272 }
273273 });
274- return result;
274+ return Object.setPrototypeOf(result, Object.prototype);
275275 }
276276
277277 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -246,7 +246,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
246246 if (val === null || typeof val !== "object" || Array.isArray(val)) {
247247 return invalidValue(l(ref || "object"), val, key, parent);
248248 }
249- const result: any = {};
249+ const result: any = Object.create(null);
250250 Object.getOwnPropertyNames(props).forEach(key => {
251251 const prop = props[key];
252252 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -257,7 +257,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
257257 result[key] = transform(val[key], additional, getProps, key, ref);
258258 }
259259 });
260- return result;
260+ return Object.setPrototypeOf(result, Object.prototype);
261261 }
262262
263263 if (typ === "any") return val;
Test case

test/inputs/json/misc/29f47.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -246,7 +246,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
246246 if (val === null || typeof val !== "object" || Array.isArray(val)) {
247247 return invalidValue(l(ref || "object"), val, key, parent);
248248 }
249- const result: any = {};
249+ const result: any = Object.create(null);
250250 Object.getOwnPropertyNames(props).forEach(key => {
251251 const prop = props[key];
252252 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -257,7 +257,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
257257 result[key] = transform(val[key], additional, getProps, key, ref);
258258 }
259259 });
260- return result;
260+ return Object.setPrototypeOf(result, Object.prototype);
261261 }
262262
263263 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Test case

test/inputs/json/misc/2d4e2.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -214,7 +214,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
214214 if (val === null || typeof val !== "object" || Array.isArray(val)) {
215215 return invalidValue(l(ref || "object"), val, key, parent);
216216 }
217- const result: any = {};
217+ const result: any = Object.create(null);
218218 Object.getOwnPropertyNames(props).forEach(key => {
219219 const prop = props[key];
220220 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -225,7 +225,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
225225 result[key] = transform(val[key], additional, getProps, key, ref);
226226 }
227227 });
228- return result;
228+ return Object.setPrototypeOf(result, Object.prototype);
229229 }
230230
231231 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
191191 if (val === null || typeof val !== "object" || Array.isArray(val)) {
192192 return invalidValue(l(ref || "object"), val, key, parent);
193193 }
194- const result: any = {};
194+ const result: any = Object.create(null);
195195 Object.getOwnPropertyNames(props).forEach(key => {
196196 const prop = props[key];
197197 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -202,7 +202,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
202202 result[key] = transform(val[key], additional, getProps, key, ref);
203203 }
204204 });
205- return result;
205+ return Object.setPrototypeOf(result, Object.prototype);
206206 }
207207
208208 if (typ === "any") return val;
Test case

test/inputs/json/misc/2df80.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/misc/31189.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Test case

test/inputs/json/misc/32431.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
178178 if (val === null || typeof val !== "object" || Array.isArray(val)) {
179179 return invalidValue(l(ref || "object"), val, key, parent);
180180 }
181- const result: any = {};
181+ const result: any = Object.create(null);
182182 Object.getOwnPropertyNames(props).forEach(key => {
183183 const prop = props[key];
184184 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
189189 result[key] = transform(val[key], additional, getProps, key, ref);
190190 }
191191 });
192- return result;
192+ return Object.setPrototypeOf(result, Object.prototype);
193193 }
194194
195195 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
170170 if (val === null || typeof val !== "object" || Array.isArray(val)) {
171171 return invalidValue(l(ref || "object"), val, key, parent);
172172 }
173- const result: any = {};
173+ const result: any = Object.create(null);
174174 Object.getOwnPropertyNames(props).forEach(key => {
175175 const prop = props[key];
176176 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
181181 result[key] = transform(val[key], additional, getProps, key, ref);
182182 }
183183 });
184- return result;
184+ return Object.setPrototypeOf(result, Object.prototype);
185185 }
186186
187187 if (typ === "any") return val;
Test case

test/inputs/json/misc/32d5c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/337ed.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
175175 if (val === null || typeof val !== "object" || Array.isArray(val)) {
176176 return invalidValue(l(ref || "object"), val, key, parent);
177177 }
178- const result: any = {};
178+ const result: any = Object.create(null);
179179 Object.getOwnPropertyNames(props).forEach(key => {
180180 const prop = props[key];
181181 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -186,7 +186,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
186186 result[key] = transform(val[key], additional, getProps, key, ref);
187187 }
188188 });
189- return result;
189+ return Object.setPrototypeOf(result, Object.prototype);
190190 }
191191
192192 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -165,7 +165,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
165165 if (val === null || typeof val !== "object" || Array.isArray(val)) {
166166 return invalidValue(l(ref || "object"), val, key, parent);
167167 }
168- const result: any = {};
168+ const result: any = Object.create(null);
169169 Object.getOwnPropertyNames(props).forEach(key => {
170170 const prop = props[key];
171171 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -176,7 +176,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
176176 result[key] = transform(val[key], additional, getProps, key, ref);
177177 }
178178 });
179- return result;
179+ return Object.setPrototypeOf(result, Object.prototype);
180180 }
181181
182182 if (typ === "any") return val;
Test case

test/inputs/json/misc/33d2e.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
160160 if (val === null || typeof val !== "object" || Array.isArray(val)) {
161161 return invalidValue(l(ref || "object"), val, key, parent);
162162 }
163- const result: any = {};
163+ const result: any = Object.create(null);
164164 Object.getOwnPropertyNames(props).forEach(key => {
165165 const prop = props[key];
166166 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -171,7 +171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
171171 result[key] = transform(val[key], additional, getProps, key, ref);
172172 }
173173 });
174- return result;
174+ return Object.setPrototypeOf(result, Object.prototype);
175175 }
176176
177177 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
148148 if (val === null || typeof val !== "object" || Array.isArray(val)) {
149149 return invalidValue(l(ref || "object"), val, key, parent);
150150 }
151- const result: any = {};
151+ const result: any = Object.create(null);
152152 Object.getOwnPropertyNames(props).forEach(key => {
153153 const prop = props[key];
154154 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
159159 result[key] = transform(val[key], additional, getProps, key, ref);
160160 }
161161 });
162- return result;
162+ return Object.setPrototypeOf(result, Object.prototype);
163163 }
164164
165165 if (typ === "any") return val;
Test case

test/inputs/json/misc/34702.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
195195 if (val === null || typeof val !== "object" || Array.isArray(val)) {
196196 return invalidValue(l(ref || "object"), val, key, parent);
197197 }
198- const result: any = {};
198+ const result: any = Object.create(null);
199199 Object.getOwnPropertyNames(props).forEach(key => {
200200 const prop = props[key];
201201 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
206206 result[key] = transform(val[key], additional, getProps, key, ref);
207207 }
208208 });
209- return result;
209+ return Object.setPrototypeOf(result, Object.prototype);
210210 }
211211
212212 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
162162 if (val === null || typeof val !== "object" || Array.isArray(val)) {
163163 return invalidValue(l(ref || "object"), val, key, parent);
164164 }
165- const result: any = {};
165+ const result: any = Object.create(null);
166166 Object.getOwnPropertyNames(props).forEach(key => {
167167 const prop = props[key];
168168 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -173,7 +173,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
173173 result[key] = transform(val[key], additional, getProps, key, ref);
174174 }
175175 });
176- return result;
176+ return Object.setPrototypeOf(result, Object.prototype);
177177 }
178178
179179 if (typ === "any") return val;
Test case

test/inputs/json/misc/3536b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/misc/3659d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/36d5d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/3a6b3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/3e9a3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Test case

test/inputs/json/misc/3f1ce.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
208208 if (val === null || typeof val !== "object" || Array.isArray(val)) {
209209 return invalidValue(l(ref || "object"), val, key, parent);
210210 }
211- const result: any = {};
211+ const result: any = Object.create(null);
212212 Object.getOwnPropertyNames(props).forEach(key => {
213213 const prop = props[key];
214214 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
219219 result[key] = transform(val[key], additional, getProps, key, ref);
220220 }
221221 });
222- return result;
222+ return Object.setPrototypeOf(result, Object.prototype);
223223 }
224224
225225 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/421d4.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
221221 if (val === null || typeof val !== "object" || Array.isArray(val)) {
222222 return invalidValue(l(ref || "object"), val, key, parent);
223223 }
224- const result: any = {};
224+ const result: any = Object.create(null);
225225 Object.getOwnPropertyNames(props).forEach(key => {
226226 const prop = props[key];
227227 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -232,7 +232,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
232232 result[key] = transform(val[key], additional, getProps, key, ref);
233233 }
234234 });
235- return result;
235+ return Object.setPrototypeOf(result, Object.prototype);
236236 }
237237
238238 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
218218 if (val === null || typeof val !== "object" || Array.isArray(val)) {
219219 return invalidValue(l(ref || "object"), val, key, parent);
220220 }
221- const result: any = {};
221+ const result: any = Object.create(null);
222222 Object.getOwnPropertyNames(props).forEach(key => {
223223 const prop = props[key];
224224 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -229,7 +229,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
229229 result[key] = transform(val[key], additional, getProps, key, ref);
230230 }
231231 });
232- return result;
232+ return Object.setPrototypeOf(result, Object.prototype);
233233 }
234234
235235 if (typ === "any") return val;
Test case

test/inputs/json/misc/437e7.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 if (val === null || typeof val !== "object" || Array.isArray(val)) {
217217 return invalidValue(l(ref || "object"), val, key, parent);
218218 }
219- const result: any = {};
219+ const result: any = Object.create(null);
220220 Object.getOwnPropertyNames(props).forEach(key => {
221221 const prop = props[key];
222222 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -227,7 +227,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
227227 result[key] = transform(val[key], additional, getProps, key, ref);
228228 }
229229 });
230- return result;
230+ return Object.setPrototypeOf(result, Object.prototype);
231231 }
232232
233233 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -211,7 +211,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
211211 if (val === null || typeof val !== "object" || Array.isArray(val)) {
212212 return invalidValue(l(ref || "object"), val, key, parent);
213213 }
214- const result: any = {};
214+ const result: any = Object.create(null);
215215 Object.getOwnPropertyNames(props).forEach(key => {
216216 const prop = props[key];
217217 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -222,7 +222,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
222222 result[key] = transform(val[key], additional, getProps, key, ref);
223223 }
224224 });
225- return result;
225+ return Object.setPrototypeOf(result, Object.prototype);
226226 }
227227
228228 if (typ === "any") return val;
Test case

test/inputs/json/misc/43970.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/misc/43eaf.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/458db.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 if (val === null || typeof val !== "object" || Array.isArray(val)) {
150150 return invalidValue(l(ref || "object"), val, key, parent);
151151 }
152- const result: any = {};
152+ const result: any = Object.create(null);
153153 Object.getOwnPropertyNames(props).forEach(key => {
154154 const prop = props[key];
155155 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
160160 result[key] = transform(val[key], additional, getProps, key, ref);
161161 }
162162 });
163- return result;
163+ return Object.setPrototypeOf(result, Object.prototype);
164164 }
165165
166166 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
148148 if (val === null || typeof val !== "object" || Array.isArray(val)) {
149149 return invalidValue(l(ref || "object"), val, key, parent);
150150 }
151- const result: any = {};
151+ const result: any = Object.create(null);
152152 Object.getOwnPropertyNames(props).forEach(key => {
153153 const prop = props[key];
154154 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
159159 result[key] = transform(val[key], additional, getProps, key, ref);
160160 }
161161 });
162- return result;
162+ return Object.setPrototypeOf(result, Object.prototype);
163163 }
164164
165165 if (typ === "any") return val;
Test case

test/inputs/json/misc/4961a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/4a0d7.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/4a455.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
150150 if (val === null || typeof val !== "object" || Array.isArray(val)) {
151151 return invalidValue(l(ref || "object"), val, key, parent);
152152 }
153- const result: any = {};
153+ const result: any = Object.create(null);
154154 Object.getOwnPropertyNames(props).forEach(key => {
155155 const prop = props[key];
156156 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -161,7 +161,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
161161 result[key] = transform(val[key], additional, getProps, key, ref);
162162 }
163163 });
164- return result;
164+ return Object.setPrototypeOf(result, Object.prototype);
165165 }
166166
167167 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/4c547.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/4d6fb.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
255255 if (val === null || typeof val !== "object" || Array.isArray(val)) {
256256 return invalidValue(l(ref || "object"), val, key, parent);
257257 }
258- const result: any = {};
258+ const result: any = Object.create(null);
259259 Object.getOwnPropertyNames(props).forEach(key => {
260260 const prop = props[key];
261261 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -266,7 +266,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
266266 result[key] = transform(val[key], additional, getProps, key, ref);
267267 }
268268 });
269- return result;
269+ return Object.setPrototypeOf(result, Object.prototype);
270270 }
271271
272272 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -245,7 +245,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
245245 if (val === null || typeof val !== "object" || Array.isArray(val)) {
246246 return invalidValue(l(ref || "object"), val, key, parent);
247247 }
248- const result: any = {};
248+ const result: any = Object.create(null);
249249 Object.getOwnPropertyNames(props).forEach(key => {
250250 const prop = props[key];
251251 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -256,7 +256,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
256256 result[key] = transform(val[key], additional, getProps, key, ref);
257257 }
258258 });
259- return result;
259+ return Object.setPrototypeOf(result, Object.prototype);
260260 }
261261
262262 if (typ === "any") return val;
Test case

test/inputs/json/misc/4e336.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/54147.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 if (val === null || typeof val !== "object" || Array.isArray(val)) {
124124 return invalidValue(l(ref || "object"), val, key, parent);
125125 }
126- const result: any = {};
126+ const result: any = Object.create(null);
127127 Object.getOwnPropertyNames(props).forEach(key => {
128128 const prop = props[key];
129129 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 result[key] = transform(val[key], additional, getProps, key, ref);
135135 }
136136 });
137- return result;
137+ return Object.setPrototypeOf(result, Object.prototype);
138138 }
139139
140140 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/misc/54d32.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 if (val === null || typeof val !== "object" || Array.isArray(val)) {
130130 return invalidValue(l(ref || "object"), val, key, parent);
131131 }
132- const result: any = {};
132+ const result: any = Object.create(null);
133133 Object.getOwnPropertyNames(props).forEach(key => {
134134 const prop = props[key];
135135 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 result[key] = transform(val[key], additional, getProps, key, ref);
141141 }
142142 });
143- return result;
143+ return Object.setPrototypeOf(result, Object.prototype);
144144 }
145145
146146 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Test case

test/inputs/json/misc/570ec.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Test case

test/inputs/json/misc/5dd0d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/5eae5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/5eb20.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/5f3a1.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/5f7fe.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -295,7 +295,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
295295 if (val === null || typeof val !== "object" || Array.isArray(val)) {
296296 return invalidValue(l(ref || "object"), val, key, parent);
297297 }
298- const result: any = {};
298+ const result: any = Object.create(null);
299299 Object.getOwnPropertyNames(props).forEach(key => {
300300 const prop = props[key];
301301 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -306,7 +306,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
306306 result[key] = transform(val[key], additional, getProps, key, ref);
307307 }
308308 });
309- return result;
309+ return Object.setPrototypeOf(result, Object.prototype);
310310 }
311311
312312 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -292,7 +292,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
292292 if (val === null || typeof val !== "object" || Array.isArray(val)) {
293293 return invalidValue(l(ref || "object"), val, key, parent);
294294 }
295- const result: any = {};
295+ const result: any = Object.create(null);
296296 Object.getOwnPropertyNames(props).forEach(key => {
297297 const prop = props[key];
298298 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -303,7 +303,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
303303 result[key] = transform(val[key], additional, getProps, key, ref);
304304 }
305305 });
306- return result;
306+ return Object.setPrototypeOf(result, Object.prototype);
307307 }
308308
309309 if (typ === "any") return val;
Test case

test/inputs/json/misc/617e8.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
294294 if (val === null || typeof val !== "object" || Array.isArray(val)) {
295295 return invalidValue(l(ref || "object"), val, key, parent);
296296 }
297- const result: any = {};
297+ const result: any = Object.create(null);
298298 Object.getOwnPropertyNames(props).forEach(key => {
299299 const prop = props[key];
300300 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -305,7 +305,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
305305 result[key] = transform(val[key], additional, getProps, key, ref);
306306 }
307307 });
308- return result;
308+ return Object.setPrototypeOf(result, Object.prototype);
309309 }
310310
311311 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -291,7 +291,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
291291 if (val === null || typeof val !== "object" || Array.isArray(val)) {
292292 return invalidValue(l(ref || "object"), val, key, parent);
293293 }
294- const result: any = {};
294+ const result: any = Object.create(null);
295295 Object.getOwnPropertyNames(props).forEach(key => {
296296 const prop = props[key];
297297 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -302,7 +302,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
302302 result[key] = transform(val[key], additional, getProps, key, ref);
303303 }
304304 });
305- return result;
305+ return Object.setPrototypeOf(result, Object.prototype);
306306 }
307307
308308 if (typ === "any") return val;
Test case

test/inputs/json/misc/61b66.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/6260a.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/65dec.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -194,7 +194,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
194194 if (val === null || typeof val !== "object" || Array.isArray(val)) {
195195 return invalidValue(l(ref || "object"), val, key, parent);
196196 }
197- const result: any = {};
197+ const result: any = Object.create(null);
198198 Object.getOwnPropertyNames(props).forEach(key => {
199199 const prop = props[key];
200200 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 result[key] = transform(val[key], additional, getProps, key, ref);
206206 }
207207 });
208- return result;
208+ return Object.setPrototypeOf(result, Object.prototype);
209209 }
210210
211211 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
170170 if (val === null || typeof val !== "object" || Array.isArray(val)) {
171171 return invalidValue(l(ref || "object"), val, key, parent);
172172 }
173- const result: any = {};
173+ const result: any = Object.create(null);
174174 Object.getOwnPropertyNames(props).forEach(key => {
175175 const prop = props[key];
176176 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
181181 result[key] = transform(val[key], additional, getProps, key, ref);
182182 }
183183 });
184- return result;
184+ return Object.setPrototypeOf(result, Object.prototype);
185185 }
186186
187187 if (typ === "any") return val;
Test case

test/inputs/json/misc/66121.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Test case

test/inputs/json/misc/6617c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/misc/67c03.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/misc/68c30.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Test case

test/inputs/json/misc/6c155.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
160160 if (val === null || typeof val !== "object" || Array.isArray(val)) {
161161 return invalidValue(l(ref || "object"), val, key, parent);
162162 }
163- const result: any = {};
163+ const result: any = Object.create(null);
164164 Object.getOwnPropertyNames(props).forEach(key => {
165165 const prop = props[key];
166166 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -171,7 +171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
171171 result[key] = transform(val[key], additional, getProps, key, ref);
172172 }
173173 });
174- return result;
174+ return Object.setPrototypeOf(result, Object.prototype);
175175 }
176176
177177 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
160160 if (val === null || typeof val !== "object" || Array.isArray(val)) {
161161 return invalidValue(l(ref || "object"), val, key, parent);
162162 }
163- const result: any = {};
163+ const result: any = Object.create(null);
164164 Object.getOwnPropertyNames(props).forEach(key => {
165165 const prop = props[key];
166166 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -171,7 +171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
171171 result[key] = transform(val[key], additional, getProps, key, ref);
172172 }
173173 });
174- return result;
174+ return Object.setPrototypeOf(result, Object.prototype);
175175 }
176176
177177 if (typ === "any") return val;
Test case

test/inputs/json/misc/6de06.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
255255 if (val === null || typeof val !== "object" || Array.isArray(val)) {
256256 return invalidValue(l(ref || "object"), val, key, parent);
257257 }
258- const result: any = {};
258+ const result: any = Object.create(null);
259259 Object.getOwnPropertyNames(props).forEach(key => {
260260 const prop = props[key];
261261 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -266,7 +266,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
266266 result[key] = transform(val[key], additional, getProps, key, ref);
267267 }
268268 });
269- return result;
269+ return Object.setPrototypeOf(result, Object.prototype);
270270 }
271271
272272 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -250,7 +250,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
250250 if (val === null || typeof val !== "object" || Array.isArray(val)) {
251251 return invalidValue(l(ref || "object"), val, key, parent);
252252 }
253- const result: any = {};
253+ const result: any = Object.create(null);
254254 Object.getOwnPropertyNames(props).forEach(key => {
255255 const prop = props[key];
256256 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -261,7 +261,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
261261 result[key] = transform(val[key], additional, getProps, key, ref);
262262 }
263263 });
264- return result;
264+ return Object.setPrototypeOf(result, Object.prototype);
265265 }
266266
267267 if (typ === "any") return val;
Test case

test/inputs/json/misc/6dec6.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
210210 if (val === null || typeof val !== "object" || Array.isArray(val)) {
211211 return invalidValue(l(ref || "object"), val, key, parent);
212212 }
213- const result: any = {};
213+ const result: any = Object.create(null);
214214 Object.getOwnPropertyNames(props).forEach(key => {
215215 const prop = props[key];
216216 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
221221 result[key] = transform(val[key], additional, getProps, key, ref);
222222 }
223223 });
224- return result;
224+ return Object.setPrototypeOf(result, Object.prototype);
225225 }
226226
227227 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/6eb00.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/misc/70c77.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/734ad.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
181181 if (val === null || typeof val !== "object" || Array.isArray(val)) {
182182 return invalidValue(l(ref || "object"), val, key, parent);
183183 }
184- const result: any = {};
184+ const result: any = Object.create(null);
185185 Object.getOwnPropertyNames(props).forEach(key => {
186186 const prop = props[key];
187187 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -192,7 +192,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
192192 result[key] = transform(val[key], additional, getProps, key, ref);
193193 }
194194 });
195- return result;
195+ return Object.setPrototypeOf(result, Object.prototype);
196196 }
197197
198198 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -176,7 +176,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
176176 if (val === null || typeof val !== "object" || Array.isArray(val)) {
177177 return invalidValue(l(ref || "object"), val, key, parent);
178178 }
179- const result: any = {};
179+ const result: any = Object.create(null);
180180 Object.getOwnPropertyNames(props).forEach(key => {
181181 const prop = props[key];
182182 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -187,7 +187,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
187187 result[key] = transform(val[key], additional, getProps, key, ref);
188188 }
189189 });
190- return result;
190+ return Object.setPrototypeOf(result, Object.prototype);
191191 }
192192
193193 if (typ === "any") return val;
Test case

test/inputs/json/misc/75912.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/7681c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
223223 if (val === null || typeof val !== "object" || Array.isArray(val)) {
224224 return invalidValue(l(ref || "object"), val, key, parent);
225225 }
226- const result: any = {};
226+ const result: any = Object.create(null);
227227 Object.getOwnPropertyNames(props).forEach(key => {
228228 const prop = props[key];
229229 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -234,7 +234,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
234234 result[key] = transform(val[key], additional, getProps, key, ref);
235235 }
236236 });
237- return result;
237+ return Object.setPrototypeOf(result, Object.prototype);
238238 }
239239
240240 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/76ae1.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -316,7 +316,7 @@ article =
316316 encodeArticle : Article -> Jenc.Value
317317 encodeArticle x =
318318 Jenc.object
319- [ ("properties", Jenc.dict identity encodeProperty x.properties)
319+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
320320 ]
321321
322322 property : Jdec.Decoder Property
@@ -722,6 +722,14 @@ encodeSchemaType x = case x of
722722
723723 --- encoder helpers
724724
725+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
726+makeDictEncoder f m r =
727+ r
728+ |> Dict.toList
729+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
730+ |> String.join ","
731+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
732+
725733 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
726734 makeNullableEncoder f m =
727735 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -291,7 +291,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
291291 if (val === null || typeof val !== "object" || Array.isArray(val)) {
292292 return invalidValue(l(ref || "object"), val, key, parent);
293293 }
294- const result: any = {};
294+ const result: any = Object.create(null);
295295 Object.getOwnPropertyNames(props).forEach(key => {
296296 const prop = props[key];
297297 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -302,7 +302,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
302302 result[key] = transform(val[key], additional, getProps, key, ref);
303303 }
304304 });
305- return result;
305+ return Object.setPrototypeOf(result, Object.prototype);
306306 }
307307
308308 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -288,7 +288,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
288288 if (val === null || typeof val !== "object" || Array.isArray(val)) {
289289 return invalidValue(l(ref || "object"), val, key, parent);
290290 }
291- const result: any = {};
291+ const result: any = Object.create(null);
292292 Object.getOwnPropertyNames(props).forEach(key => {
293293 const prop = props[key];
294294 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -299,7 +299,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
299299 result[key] = transform(val[key], additional, getProps, key, ref);
300300 }
301301 });
302- return result;
302+ return Object.setPrototypeOf(result, Object.prototype);
303303 }
304304
305305 if (typ === "any") return val;
Test case

test/inputs/json/misc/77392.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Test case

test/inputs/json/misc/7d397.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -170,7 +170,7 @@ listClass =
170170 encodeListClass : ListClass -> Jenc.Value
171171 encodeListClass x =
172172 Jenc.object
173- [ ("properties", Jenc.dict identity encodeProperty x.properties)
173+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
174174 ]
175175
176176 property : Jdec.Decoder Property
@@ -339,6 +339,14 @@ encodeItems x =
339339
340340 --- encoder helpers
341341
342+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
343+makeDictEncoder f m r =
344+ r
345+ |> Dict.toList
346+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
347+ |> String.join ","
348+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
349+
342350 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
343351 makeNullableEncoder f m =
344352 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -182,7 +182,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
182182 if (val === null || typeof val !== "object" || Array.isArray(val)) {
183183 return invalidValue(l(ref || "object"), val, key, parent);
184184 }
185- const result: any = {};
185+ const result: any = Object.create(null);
186186 Object.getOwnPropertyNames(props).forEach(key => {
187187 const prop = props[key];
188188 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
193193 result[key] = transform(val[key], additional, getProps, key, ref);
194194 }
195195 });
196- return result;
196+ return Object.setPrototypeOf(result, Object.prototype);
197197 }
198198
199199 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Test case

test/inputs/json/misc/7d722.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/7df41.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/misc/7dfa6.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/7eb30.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
144144 if (val === null || typeof val !== "object" || Array.isArray(val)) {
145145 return invalidValue(l(ref || "object"), val, key, parent);
146146 }
147- const result: any = {};
147+ const result: any = Object.create(null);
148148 Object.getOwnPropertyNames(props).forEach(key => {
149149 const prop = props[key];
150150 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -155,7 +155,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
155155 result[key] = transform(val[key], additional, getProps, key, ref);
156156 }
157157 });
158- return result;
158+ return Object.setPrototypeOf(result, Object.prototype);
159159 }
160160
161161 if (typ === "any") return val;
Test case

test/inputs/json/misc/7f568.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -103,7 +103,7 @@ encodeQuickTypeElement x =
103103 , ("commits_url", Jenc.string x.commitsURL)
104104 , ("created_at", Jenc.string x.createdAt)
105105 , ("description", makeNullableEncoder Jenc.string x.description)
106- , ("files", Jenc.dict identity encodeFile x.files)
106+ , ("files", makeDictEncoder identity encodeFile x.files)
107107 , ("forks_url", Jenc.string x.forksURL)
108108 , ("git_pull_url", Jenc.string x.gitPullURL)
109109 , ("git_push_url", Jenc.string x.gitPushURL)
@@ -163,6 +163,14 @@ encodeLanguage x = case x of
163163
164164 --- encoder helpers
165165
166+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
167+makeDictEncoder f m r =
168+ r
169+ |> Dict.toList
170+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
171+ |> String.join ","
172+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
173+
166174 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
167175 makeNullableEncoder f m =
168176 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/misc/7fbfb.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/80aff.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 if (val === null || typeof val !== "object" || Array.isArray(val)) {
127127 return invalidValue(l(ref || "object"), val, key, parent);
128128 }
129- const result: any = {};
129+ const result: any = Object.create(null);
130130 Object.getOwnPropertyNames(props).forEach(key => {
131131 const prop = props[key];
132132 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
137137 result[key] = transform(val[key], additional, getProps, key, ref);
138138 }
139139 });
140- return result;
140+ return Object.setPrototypeOf(result, Object.prototype);
141141 }
142142
143143 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 if (val === null || typeof val !== "object" || Array.isArray(val)) {
124124 return invalidValue(l(ref || "object"), val, key, parent);
125125 }
126- const result: any = {};
126+ const result: any = Object.create(null);
127127 Object.getOwnPropertyNames(props).forEach(key => {
128128 const prop = props[key];
129129 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 result[key] = transform(val[key], additional, getProps, key, ref);
135135 }
136136 });
137- return result;
137+ return Object.setPrototypeOf(result, Object.prototype);
138138 }
139139
140140 if (typ === "any") return val;
Test case

test/inputs/json/misc/82509.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/8592b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -230,7 +230,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
230230 if (val === null || typeof val !== "object" || Array.isArray(val)) {
231231 return invalidValue(l(ref || "object"), val, key, parent);
232232 }
233- const result: any = {};
233+ const result: any = Object.create(null);
234234 Object.getOwnPropertyNames(props).forEach(key => {
235235 const prop = props[key];
236236 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -241,7 +241,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
241241 result[key] = transform(val[key], additional, getProps, key, ref);
242242 }
243243 });
244- return result;
244+ return Object.setPrototypeOf(result, Object.prototype);
245245 }
246246
247247 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
219219 if (val === null || typeof val !== "object" || Array.isArray(val)) {
220220 return invalidValue(l(ref || "object"), val, key, parent);
221221 }
222- const result: any = {};
222+ const result: any = Object.create(null);
223223 Object.getOwnPropertyNames(props).forEach(key => {
224224 const prop = props[key];
225225 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -230,7 +230,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
230230 result[key] = transform(val[key], additional, getProps, key, ref);
231231 }
232232 });
233- return result;
233+ return Object.setPrototypeOf(result, Object.prototype);
234234 }
235235
236236 if (typ === "any") return val;
Test case

test/inputs/json/misc/88130.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/8a62c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/908db.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/9617f.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/96f7c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/9847b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/9929c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/996bd.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/9a503.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
137137 if (val === null || typeof val !== "object" || Array.isArray(val)) {
138138 return invalidValue(l(ref || "object"), val, key, parent);
139139 }
140- const result: any = {};
140+ const result: any = Object.create(null);
141141 Object.getOwnPropertyNames(props).forEach(key => {
142142 const prop = props[key];
143143 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
148148 result[key] = transform(val[key], additional, getProps, key, ref);
149149 }
150150 });
151- return result;
151+ return Object.setPrototypeOf(result, Object.prototype);
152152 }
153153
154154 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Test case

test/inputs/json/misc/9ac3b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/9eed5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Test case

test/inputs/json/misc/a0496.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 if (val === null || typeof val !== "object" || Array.isArray(val)) {
129129 return invalidValue(l(ref || "object"), val, key, parent);
130130 }
131- const result: any = {};
131+ const result: any = Object.create(null);
132132 Object.getOwnPropertyNames(props).forEach(key => {
133133 const prop = props[key];
134134 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 result[key] = transform(val[key], additional, getProps, key, ref);
140140 }
141141 });
142- return result;
142+ return Object.setPrototypeOf(result, Object.prototype);
143143 }
144144
145145 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 if (val === null || typeof val !== "object" || Array.isArray(val)) {
126126 return invalidValue(l(ref || "object"), val, key, parent);
127127 }
128- const result: any = {};
128+ const result: any = Object.create(null);
129129 Object.getOwnPropertyNames(props).forEach(key => {
130130 const prop = props[key];
131131 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 result[key] = transform(val[key], additional, getProps, key, ref);
137137 }
138138 });
139- return result;
139+ return Object.setPrototypeOf(result, Object.prototype);
140140 }
141141
142142 if (typ === "any") return val;
Test case

test/inputs/json/misc/a1eca.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/a3d8c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
223223 if (val === null || typeof val !== "object" || Array.isArray(val)) {
224224 return invalidValue(l(ref || "object"), val, key, parent);
225225 }
226- const result: any = {};
226+ const result: any = Object.create(null);
227227 Object.getOwnPropertyNames(props).forEach(key => {
228228 const prop = props[key];
229229 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -234,7 +234,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
234234 result[key] = transform(val[key], additional, getProps, key, ref);
235235 }
236236 });
237- return result;
237+ return Object.setPrototypeOf(result, Object.prototype);
238238 }
239239
240240 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
217217 if (val === null || typeof val !== "object" || Array.isArray(val)) {
218218 return invalidValue(l(ref || "object"), val, key, parent);
219219 }
220- const result: any = {};
220+ const result: any = Object.create(null);
221221 Object.getOwnPropertyNames(props).forEach(key => {
222222 const prop = props[key];
223223 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -228,7 +228,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
228228 result[key] = transform(val[key], additional, getProps, key, ref);
229229 }
230230 });
231- return result;
231+ return Object.setPrototypeOf(result, Object.prototype);
232232 }
233233
234234 if (typ === "any") return val;
Test case

test/inputs/json/misc/a45b0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/a71df.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/a9691.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/ab0d1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/abb4b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/ac944.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/ad8be.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
174174 if (val === null || typeof val !== "object" || Array.isArray(val)) {
175175 return invalidValue(l(ref || "object"), val, key, parent);
176176 }
177- const result: any = {};
177+ const result: any = Object.create(null);
178178 Object.getOwnPropertyNames(props).forEach(key => {
179179 const prop = props[key];
180180 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -185,7 +185,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
185185 result[key] = transform(val[key], additional, getProps, key, ref);
186186 }
187187 });
188- return result;
188+ return Object.setPrototypeOf(result, Object.prototype);
189189 }
190190
191191 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/ae7f0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
204204 if (val === null || typeof val !== "object" || Array.isArray(val)) {
205205 return invalidValue(l(ref || "object"), val, key, parent);
206206 }
207- const result: any = {};
207+ const result: any = Object.create(null);
208208 Object.getOwnPropertyNames(props).forEach(key => {
209209 const prop = props[key];
210210 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
215215 result[key] = transform(val[key], additional, getProps, key, ref);
216216 }
217217 });
218- return result;
218+ return Object.setPrototypeOf(result, Object.prototype);
219219 }
220220
221221 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
195195 if (val === null || typeof val !== "object" || Array.isArray(val)) {
196196 return invalidValue(l(ref || "object"), val, key, parent);
197197 }
198- const result: any = {};
198+ const result: any = Object.create(null);
199199 Object.getOwnPropertyNames(props).forEach(key => {
200200 const prop = props[key];
201201 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
206206 result[key] = transform(val[key], additional, getProps, key, ref);
207207 }
208208 });
209- return result;
209+ return Object.setPrototypeOf(result, Object.prototype);
210210 }
211211
212212 if (typ === "any") return val;
Test case

test/inputs/json/misc/ae9ca.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 if (val === null || typeof val !== "object" || Array.isArray(val)) {
154154 return invalidValue(l(ref || "object"), val, key, parent);
155155 }
156- const result: any = {};
156+ const result: any = Object.create(null);
157157 Object.getOwnPropertyNames(props).forEach(key => {
158158 const prop = props[key];
159159 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
164164 result[key] = transform(val[key], additional, getProps, key, ref);
165165 }
166166 });
167- return result;
167+ return Object.setPrototypeOf(result, Object.prototype);
168168 }
169169
170170 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
143143 if (val === null || typeof val !== "object" || Array.isArray(val)) {
144144 return invalidValue(l(ref || "object"), val, key, parent);
145145 }
146- const result: any = {};
146+ const result: any = Object.create(null);
147147 Object.getOwnPropertyNames(props).forEach(key => {
148148 const prop = props[key];
149149 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -154,7 +154,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
154154 result[key] = transform(val[key], additional, getProps, key, ref);
155155 }
156156 });
157- return result;
157+ return Object.setPrototypeOf(result, Object.prototype);
158158 }
159159
160160 if (typ === "any") return val;
Test case

test/inputs/json/misc/af2d1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
193193 if (val === null || typeof val !== "object" || Array.isArray(val)) {
194194 return invalidValue(l(ref || "object"), val, key, parent);
195195 }
196- const result: any = {};
196+ const result: any = Object.create(null);
197197 Object.getOwnPropertyNames(props).forEach(key => {
198198 const prop = props[key];
199199 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
204204 result[key] = transform(val[key], additional, getProps, key, ref);
205205 }
206206 });
207- return result;
207+ return Object.setPrototypeOf(result, Object.prototype);
208208 }
209209
210210 if (typ === "any") return val;
Test case

test/inputs/json/misc/b4865.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/b6f2c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/b6fe5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/b9f64.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/bb1ec.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/be234.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -269,7 +269,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
269269 if (val === null || typeof val !== "object" || Array.isArray(val)) {
270270 return invalidValue(l(ref || "object"), val, key, parent);
271271 }
272- const result: any = {};
272+ const result: any = Object.create(null);
273273 Object.getOwnPropertyNames(props).forEach(key => {
274274 const prop = props[key];
275275 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -280,7 +280,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
280280 result[key] = transform(val[key], additional, getProps, key, ref);
281281 }
282282 });
283- return result;
283+ return Object.setPrototypeOf(result, Object.prototype);
284284 }
285285
286286 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -256,7 +256,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
256256 if (val === null || typeof val !== "object" || Array.isArray(val)) {
257257 return invalidValue(l(ref || "object"), val, key, parent);
258258 }
259- const result: any = {};
259+ const result: any = Object.create(null);
260260 Object.getOwnPropertyNames(props).forEach(key => {
261261 const prop = props[key];
262262 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -267,7 +267,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
267267 result[key] = transform(val[key], additional, getProps, key, ref);
268268 }
269269 });
270- return result;
270+ return Object.setPrototypeOf(result, Object.prototype);
271271 }
272272
273273 if (typ === "any") return val;
Test case

test/inputs/json/misc/c0356.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -60,7 +60,7 @@ quickType =
6060 encodeQuickType : QuickType -> Jenc.Value
6161 encodeQuickType x =
6262 Jenc.object
63- [ ("data", Jenc.dict identity encodeDatum x.data)
63+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6464 , ("description", encodeDescription x.description)
6565 ]
6666
@@ -94,6 +94,14 @@ encodeDescription x =
9494
9595 --- encoder helpers
9696
97+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
98+makeDictEncoder f m r =
99+ r
100+ |> Dict.toList
101+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
102+ |> String.join ","
103+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
104+
97105 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
98106 makeNullableEncoder f m =
99107 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Test case

test/inputs/json/misc/c0a3a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/c3303.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -220,7 +220,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
220220 if (val === null || typeof val !== "object" || Array.isArray(val)) {
221221 return invalidValue(l(ref || "object"), val, key, parent);
222222 }
223- const result: any = {};
223+ const result: any = Object.create(null);
224224 Object.getOwnPropertyNames(props).forEach(key => {
225225 const prop = props[key];
226226 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -231,7 +231,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
231231 result[key] = transform(val[key], additional, getProps, key, ref);
232232 }
233233 });
234- return result;
234+ return Object.setPrototypeOf(result, Object.prototype);
235235 }
236236
237237 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -214,7 +214,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
214214 if (val === null || typeof val !== "object" || Array.isArray(val)) {
215215 return invalidValue(l(ref || "object"), val, key, parent);
216216 }
217- const result: any = {};
217+ const result: any = Object.create(null);
218218 Object.getOwnPropertyNames(props).forEach(key => {
219219 const prop = props[key];
220220 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -225,7 +225,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
225225 result[key] = transform(val[key], additional, getProps, key, ref);
226226 }
227227 });
228- return result;
228+ return Object.setPrototypeOf(result, Object.prototype);
229229 }
230230
231231 if (typ === "any") return val;
Test case

test/inputs/json/misc/c6cfd.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/c8c7e.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/cb0cc.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Test case

test/inputs/json/misc/cb81e.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -55,7 +55,7 @@ quickType =
5555 encodeQuickType : QuickType -> Jenc.Value
5656 encodeQuickType x =
5757 Jenc.object
58- [ ("data", Jenc.dict identity Jenc.string x.data)
58+ [ ("data", makeDictEncoder identity Jenc.string x.data)
5959 , ("description", encodeDescription x.description)
6060 ]
6161
@@ -78,6 +78,14 @@ encodeDescription x =
7878
7979 --- encoder helpers
8080
81+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
82+makeDictEncoder f m r =
83+ r
84+ |> Dict.toList
85+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
86+ |> String.join ","
87+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
88+
8189 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
8290 makeNullableEncoder f m =
8391 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/json/misc/ccd18.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/cd238.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/cd463.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/cda6c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/cf0d8.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/cfbce.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
59+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
60+makeDictEncoder f m r =
61+ r
62+ |> Dict.toList
63+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
64+ |> String.join ","
65+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
66+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/d0908.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/d23d5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 if (val === null || typeof val !== "object" || Array.isArray(val)) {
126126 return invalidValue(l(ref || "object"), val, key, parent);
127127 }
128- const result: any = {};
128+ const result: any = Object.create(null);
129129 Object.getOwnPropertyNames(props).forEach(key => {
130130 const prop = props[key];
131131 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 result[key] = transform(val[key], additional, getProps, key, ref);
137137 }
138138 });
139- return result;
139+ return Object.setPrototypeOf(result, Object.prototype);
140140 }
141141
142142 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Test case

test/inputs/json/misc/dbfb3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -209,7 +209,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
209209 if (val === null || typeof val !== "object" || Array.isArray(val)) {
210210 return invalidValue(l(ref || "object"), val, key, parent);
211211 }
212- const result: any = {};
212+ const result: any = Object.create(null);
213213 Object.getOwnPropertyNames(props).forEach(key => {
214214 const prop = props[key];
215215 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -220,7 +220,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
220220 result[key] = transform(val[key], additional, getProps, key, ref);
221221 }
222222 });
223- return result;
223+ return Object.setPrototypeOf(result, Object.prototype);
224224 }
225225
226226 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/dc44f.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
175175 if (val === null || typeof val !== "object" || Array.isArray(val)) {
176176 return invalidValue(l(ref || "object"), val, key, parent);
177177 }
178- const result: any = {};
178+ const result: any = Object.create(null);
179179 Object.getOwnPropertyNames(props).forEach(key => {
180180 const prop = props[key];
181181 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -186,7 +186,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
186186 result[key] = transform(val[key], additional, getProps, key, ref);
187187 }
188188 });
189- return result;
189+ return Object.setPrototypeOf(result, Object.prototype);
190190 }
191191
192192 if (typ === "any") return val;
Test case

test/inputs/json/misc/dd1ce.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
175175 if (val === null || typeof val !== "object" || Array.isArray(val)) {
176176 return invalidValue(l(ref || "object"), val, key, parent);
177177 }
178- const result: any = {};
178+ const result: any = Object.create(null);
179179 Object.getOwnPropertyNames(props).forEach(key => {
180180 const prop = props[key];
181181 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -186,7 +186,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
186186 result[key] = transform(val[key], additional, getProps, key, ref);
187187 }
188188 });
189- return result;
189+ return Object.setPrototypeOf(result, Object.prototype);
190190 }
191191
192192 if (typ === "any") return val;
Test case

test/inputs/json/misc/dec3a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
168168 if (val === null || typeof val !== "object" || Array.isArray(val)) {
169169 return invalidValue(l(ref || "object"), val, key, parent);
170170 }
171- const result: any = {};
171+ const result: any = Object.create(null);
172172 Object.getOwnPropertyNames(props).forEach(key => {
173173 const prop = props[key];
174174 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
179179 result[key] = transform(val[key], additional, getProps, key, ref);
180180 }
181181 });
182- return result;
182+ return Object.setPrototypeOf(result, Object.prototype);
183183 }
184184
185185 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
168168 if (val === null || typeof val !== "object" || Array.isArray(val)) {
169169 return invalidValue(l(ref || "object"), val, key, parent);
170170 }
171- const result: any = {};
171+ const result: any = Object.create(null);
172172 Object.getOwnPropertyNames(props).forEach(key => {
173173 const prop = props[key];
174174 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
179179 result[key] = transform(val[key], additional, getProps, key, ref);
180180 }
181181 });
182- return result;
182+ return Object.setPrototypeOf(result, Object.prototype);
183183 }
184184
185185 if (typ === "any") return val;
Test case

test/inputs/json/misc/df957.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/e0ac7.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
217217 if (val === null || typeof val !== "object" || Array.isArray(val)) {
218218 return invalidValue(l(ref || "object"), val, key, parent);
219219 }
220- const result: any = {};
220+ const result: any = Object.create(null);
221221 Object.getOwnPropertyNames(props).forEach(key => {
222222 const prop = props[key];
223223 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -228,7 +228,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
228228 result[key] = transform(val[key], additional, getProps, key, ref);
229229 }
230230 });
231- return result;
231+ return Object.setPrototypeOf(result, Object.prototype);
232232 }
233233
234234 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -213,7 +213,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
213213 if (val === null || typeof val !== "object" || Array.isArray(val)) {
214214 return invalidValue(l(ref || "object"), val, key, parent);
215215 }
216- const result: any = {};
216+ const result: any = Object.create(null);
217217 Object.getOwnPropertyNames(props).forEach(key => {
218218 const prop = props[key];
219219 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -224,7 +224,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
224224 result[key] = transform(val[key], additional, getProps, key, ref);
225225 }
226226 });
227- return result;
227+ return Object.setPrototypeOf(result, Object.prototype);
228228 }
229229
230230 if (typ === "any") return val;
Test case

test/inputs/json/misc/e2915.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
208208 if (val === null || typeof val !== "object" || Array.isArray(val)) {
209209 return invalidValue(l(ref || "object"), val, key, parent);
210210 }
211- const result: any = {};
211+ const result: any = Object.create(null);
212212 Object.getOwnPropertyNames(props).forEach(key => {
213213 const prop = props[key];
214214 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
219219 result[key] = transform(val[key], additional, getProps, key, ref);
220220 }
221221 });
222- return result;
222+ return Object.setPrototypeOf(result, Object.prototype);
223223 }
224224
225225 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/e2a58.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/e324e.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -166,7 +166,7 @@ rate =
166166 encodeRate : Rate -> Jenc.Value
167167 encodeRate x =
168168 Jenc.object
169- [ ("properties", Jenc.dict identity encodeProperty x.properties)
169+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
170170 ]
171171
172172 property : Jdec.Decoder Property
@@ -322,6 +322,14 @@ encodeItems x =
322322
323323 --- encoder helpers
324324
325+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
326+makeDictEncoder f m r =
327+ r
328+ |> Dict.toList
329+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
330+ |> String.join ","
331+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
332+
325333 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
326334 makeNullableEncoder f m =
327335 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
179179 if (val === null || typeof val !== "object" || Array.isArray(val)) {
180180 return invalidValue(l(ref || "object"), val, key, parent);
181181 }
182- const result: any = {};
182+ const result: any = Object.create(null);
183183 Object.getOwnPropertyNames(props).forEach(key => {
184184 const prop = props[key];
185185 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -190,7 +190,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
190190 result[key] = transform(val[key], additional, getProps, key, ref);
191191 }
192192 });
193- return result;
193+ return Object.setPrototypeOf(result, Object.prototype);
194194 }
195195
196196 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
178178 if (val === null || typeof val !== "object" || Array.isArray(val)) {
179179 return invalidValue(l(ref || "object"), val, key, parent);
180180 }
181- const result: any = {};
181+ const result: any = Object.create(null);
182182 Object.getOwnPropertyNames(props).forEach(key => {
183183 const prop = props[key];
184184 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
189189 result[key] = transform(val[key], additional, getProps, key, ref);
190190 }
191191 });
192- return result;
192+ return Object.setPrototypeOf(result, Object.prototype);
193193 }
194194
195195 if (typ === "any") return val;
Test case

test/inputs/json/misc/e53b5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/e64a0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/misc/e8a0b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/e8b04.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -377,7 +377,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
377377 if (val === null || typeof val !== "object" || Array.isArray(val)) {
378378 return invalidValue(l(ref || "object"), val, key, parent);
379379 }
380- const result: any = {};
380+ const result: any = Object.create(null);
381381 Object.getOwnPropertyNames(props).forEach(key => {
382382 const prop = props[key];
383383 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -388,7 +388,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
388388 result[key] = transform(val[key], additional, getProps, key, ref);
389389 }
390390 });
391- return result;
391+ return Object.setPrototypeOf(result, Object.prototype);
392392 }
393393
394394 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -338,7 +338,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
338338 if (val === null || typeof val !== "object" || Array.isArray(val)) {
339339 return invalidValue(l(ref || "object"), val, key, parent);
340340 }
341- const result: any = {};
341+ const result: any = Object.create(null);
342342 Object.getOwnPropertyNames(props).forEach(key => {
343343 const prop = props[key];
344344 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -349,7 +349,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
349349 result[key] = transform(val[key], additional, getProps, key, ref);
350350 }
351351 });
352- return result;
352+ return Object.setPrototypeOf(result, Object.prototype);
353353 }
354354
355355 if (typ === "any") return val;
Test case

test/inputs/json/misc/ed095.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -36,10 +36,18 @@ quickType : Jdec.Decoder QuickType
3636 quickType = Jdec.dict Jdec.string
3737
3838 quickTypeToString : QuickType -> String
39-quickTypeToString r = Jenc.encode 0 (Jenc.dict identity Jenc.string r)
39+quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity Jenc.string r)
4040
4141 --- encoder helpers
4242
43+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
44+makeDictEncoder f m r =
45+ r
46+ |> Dict.toList
47+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
48+ |> String.join ","
49+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
50+
4351 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
4452 makeNullableEncoder f m =
4553 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/json/misc/f22f5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -201,7 +201,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
201201 if (val === null || typeof val !== "object" || Array.isArray(val)) {
202202 return invalidValue(l(ref || "object"), val, key, parent);
203203 }
204- const result: any = {};
204+ const result: any = Object.create(null);
205205 Object.getOwnPropertyNames(props).forEach(key => {
206206 const prop = props[key];
207207 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -212,7 +212,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
212212 result[key] = transform(val[key], additional, getProps, key, ref);
213213 }
214214 });
215- return result;
215+ return Object.setPrototypeOf(result, Object.prototype);
216216 }
217217
218218 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
193193 if (val === null || typeof val !== "object" || Array.isArray(val)) {
194194 return invalidValue(l(ref || "object"), val, key, parent);
195195 }
196- const result: any = {};
196+ const result: any = Object.create(null);
197197 Object.getOwnPropertyNames(props).forEach(key => {
198198 const prop = props[key];
199199 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
204204 result[key] = transform(val[key], additional, getProps, key, ref);
205205 }
206206 });
207- return result;
207+ return Object.setPrototypeOf(result, Object.prototype);
208208 }
209209
210210 if (typ === "any") return val;
Test case

test/inputs/json/misc/f3139.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/f3edf.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/f466a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/f6a65.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -224,7 +224,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
224224 if (val === null || typeof val !== "object" || Array.isArray(val)) {
225225 return invalidValue(l(ref || "object"), val, key, parent);
226226 }
227- const result: any = {};
227+ const result: any = Object.create(null);
228228 Object.getOwnPropertyNames(props).forEach(key => {
229229 const prop = props[key];
230230 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -235,7 +235,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
235235 result[key] = transform(val[key], additional, getProps, key, ref);
236236 }
237237 });
238- return result;
238+ return Object.setPrototypeOf(result, Object.prototype);
239239 }
240240
241241 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/f74d5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
223223 if (val === null || typeof val !== "object" || Array.isArray(val)) {
224224 return invalidValue(l(ref || "object"), val, key, parent);
225225 }
226- const result: any = {};
226+ const result: any = Object.create(null);
227227 Object.getOwnPropertyNames(props).forEach(key => {
228228 const prop = props[key];
229229 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -234,7 +234,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
234234 result[key] = transform(val[key], additional, getProps, key, ref);
235235 }
236236 });
237- return result;
237+ return Object.setPrototypeOf(result, Object.prototype);
238238 }
239239
240240 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
217217 if (val === null || typeof val !== "object" || Array.isArray(val)) {
218218 return invalidValue(l(ref || "object"), val, key, parent);
219219 }
220- const result: any = {};
220+ const result: any = Object.create(null);
221221 Object.getOwnPropertyNames(props).forEach(key => {
222222 const prop = props[key];
223223 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -228,7 +228,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
228228 result[key] = transform(val[key], additional, getProps, key, ref);
229229 }
230230 });
231- return result;
231+ return Object.setPrototypeOf(result, Object.prototype);
232232 }
233233
234234 if (typ === "any") return val;
Test case

test/inputs/json/misc/f82d9.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -192,7 +192,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
192192 if (val === null || typeof val !== "object" || Array.isArray(val)) {
193193 return invalidValue(l(ref || "object"), val, key, parent);
194194 }
195- const result: any = {};
195+ const result: any = Object.create(null);
196196 Object.getOwnPropertyNames(props).forEach(key => {
197197 const prop = props[key];
198198 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -203,7 +203,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
203203 result[key] = transform(val[key], additional, getProps, key, ref);
204204 }
205205 });
206- return result;
206+ return Object.setPrototypeOf(result, Object.prototype);
207207 }
208208
209209 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
191191 if (val === null || typeof val !== "object" || Array.isArray(val)) {
192192 return invalidValue(l(ref || "object"), val, key, parent);
193193 }
194- const result: any = {};
194+ const result: any = Object.create(null);
195195 Object.getOwnPropertyNames(props).forEach(key => {
196196 const prop = props[key];
197197 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -202,7 +202,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
202202 result[key] = transform(val[key], additional, getProps, key, ref);
203203 }
204204 });
205- return result;
205+ return Object.setPrototypeOf(result, Object.prototype);
206206 }
207207
208208 if (typ === "any") return val;
Test case

test/inputs/json/misc/f974d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/misc/faff5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/fcca3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -320,7 +320,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
320320 if (val === null || typeof val !== "object" || Array.isArray(val)) {
321321 return invalidValue(l(ref || "object"), val, key, parent);
322322 }
323- const result: any = {};
323+ const result: any = Object.create(null);
324324 Object.getOwnPropertyNames(props).forEach(key => {
325325 const prop = props[key];
326326 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -331,7 +331,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
331331 result[key] = transform(val[key], additional, getProps, key, ref);
332332 }
333333 });
334- return result;
334+ return Object.setPrototypeOf(result, Object.prototype);
335335 }
336336
337337 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -317,7 +317,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
317317 if (val === null || typeof val !== "object" || Array.isArray(val)) {
318318 return invalidValue(l(ref || "object"), val, key, parent);
319319 }
320- const result: any = {};
320+ const result: any = Object.create(null);
321321 Object.getOwnPropertyNames(props).forEach(key => {
322322 const prop = props[key];
323323 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -328,7 +328,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
328328 result[key] = transform(val[key], additional, getProps, key, ref);
329329 }
330330 });
331- return result;
331+ return Object.setPrototypeOf(result, Object.prototype);
332332 }
333333
334334 if (typ === "any") return val;
Test case

test/inputs/json/misc/fd329.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("data", Jenc.dict identity encodeDatum x.data)
64+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6565 , ("description", encodeDescription x.description)
6666 ]
6767
@@ -97,6 +97,14 @@ encodeDescription x =
9797
9898 --- encoder helpers
9999
100+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
101+makeDictEncoder f m r =
102+ r
103+ |> Dict.toList
104+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
105+ |> String.join ","
106+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
107+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/priority/blns-object.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -702,7 +702,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
702702 if (val === null || typeof val !== "object" || Array.isArray(val)) {
703703 return invalidValue(l(ref || "object"), val, key, parent);
704704 }
705- const result: any = {};
705+ const result: any = Object.create(null);
706706 Object.getOwnPropertyNames(props).forEach(key => {
707707 const prop = props[key];
708708 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -713,7 +713,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
713713 result[key] = transform(val[key], additional, getProps, key, ref);
714714 }
715715 });
716- return result;
716+ return Object.setPrototypeOf(result, Object.prototype);
717717 }
718718
719719 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -702,7 +702,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
702702 if (val === null || typeof val !== "object" || Array.isArray(val)) {
703703 return invalidValue(l(ref || "object"), val, key, parent);
704704 }
705- const result: any = {};
705+ const result: any = Object.create(null);
706706 Object.getOwnPropertyNames(props).forEach(key => {
707707 const prop = props[key];
708708 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -713,7 +713,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
713713 result[key] = transform(val[key], additional, getProps, key, ref);
714714 }
715715 });
716- return result;
716+ return Object.setPrototypeOf(result, Object.prototype);
717717 }
718718
719719 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2037.json

4 generated files · +17 −9
Melmdefault / QuickType.elm+11 −3
@@ -60,7 +60,7 @@ quickType =
6060 encodeQuickType : QuickType -> Jenc.Value
6161 encodeQuickType x =
6262 Jenc.object
63- [ ("mission_specs", Jenc.dict identity encodeMissionSpec x.missionSpecs)
63+ [ ("mission_specs", makeDictEncoder identity encodeMissionSpec x.missionSpecs)
6464 ]
6565
6666 missionSpec : Jdec.Decoder MissionSpec
@@ -71,7 +71,7 @@ missionSpec =
7171 encodeMissionSpec : MissionSpec -> Jenc.Value
7272 encodeMissionSpec x =
7373 Jenc.object
74- [ ("objectives", Jenc.dict identity encodeObjective x.objectives)
74+ [ ("objectives", makeDictEncoder identity encodeObjective x.objectives)
7575 ]
7676
7777 objective : Jdec.Decoder Objective
@@ -82,7 +82,7 @@ objective =
8282 encodeObjective : Objective -> Jenc.Value
8383 encodeObjective x =
8484 Jenc.object
85- [ ("rewards", Jenc.dict identity encodeReward x.rewards)
85+ [ ("rewards", makeDictEncoder identity encodeReward x.rewards)
8686 ]
8787
8888 reward : Jdec.Decoder Reward
@@ -97,6 +97,14 @@ encodeReward x =
9797
9898 --- encoder helpers
9999
100+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
101+makeDictEncoder f m r =
102+ r
103+ |> Dict.toList
104+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
105+ |> String.join ","
106+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
107+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2521.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2590.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2663.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2793.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug427.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -718,7 +718,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
718718 if (val === null || typeof val !== "object" || Array.isArray(val)) {
719719 return invalidValue(l(ref || "object"), val, key, parent);
720720 }
721- const result: any = {};
721+ const result: any = Object.create(null);
722722 Object.getOwnPropertyNames(props).forEach(key => {
723723 const prop = props[key];
724724 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -729,7 +729,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
729729 result[key] = transform(val[key], additional, getProps, key, ref);
730730 }
731731 });
732- return result;
732+ return Object.setPrototypeOf(result, Object.prototype);
733733 }
734734
735735 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -664,7 +664,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
664664 if (val === null || typeof val !== "object" || Array.isArray(val)) {
665665 return invalidValue(l(ref || "object"), val, key, parent);
666666 }
667- const result: any = {};
667+ const result: any = Object.create(null);
668668 Object.getOwnPropertyNames(props).forEach(key => {
669669 const prop = props[key];
670670 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -675,7 +675,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
675675 result[key] = transform(val[key], additional, getProps, key, ref);
676676 }
677677 });
678- return result;
678+ return Object.setPrototypeOf(result, Object.prototype);
679679 }
680680
681681 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug790.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug855-short.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -45,7 +45,7 @@ quickType : Jdec.Decoder QuickType
4545 quickType = Jdec.dict quickTypeValue
4646
4747 quickTypeToString : QuickType -> String
48-quickTypeToString r = Jenc.encode 0 (Jenc.dict identity encodeQuickTypeValue r)
48+quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity encodeQuickTypeValue r)
4949
5050 quickTypeValue : Jdec.Decoder QuickTypeValue
5151 quickTypeValue =
@@ -68,6 +68,14 @@ encodeQuickTypeValue x =
6868
6969 --- encoder helpers
7070
71+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
72+makeDictEncoder f m r =
73+ r
74+ |> Dict.toList
75+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
76+ |> String.join ","
77+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
78+
7179 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
7280 makeNullableEncoder f m =
7381 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug863.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
193193 if (val === null || typeof val !== "object" || Array.isArray(val)) {
194194 return invalidValue(l(ref || "object"), val, key, parent);
195195 }
196- const result: any = {};
196+ const result: any = Object.create(null);
197197 Object.getOwnPropertyNames(props).forEach(key => {
198198 const prop = props[key];
199199 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
204204 result[key] = transform(val[key], additional, getProps, key, ref);
205205 }
206206 });
207- return result;
207+ return Object.setPrototypeOf(result, Object.prototype);
208208 }
209209
210210 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
177177 if (val === null || typeof val !== "object" || Array.isArray(val)) {
178178 return invalidValue(l(ref || "object"), val, key, parent);
179179 }
180- const result: any = {};
180+ const result: any = Object.create(null);
181181 Object.getOwnPropertyNames(props).forEach(key => {
182182 const prop = props[key];
183183 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -188,7 +188,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
188188 result[key] = transform(val[key], additional, getProps, key, ref);
189189 }
190190 });
191- return result;
191+ return Object.setPrototypeOf(result, Object.prototype);
192192 }
193193
194194 if (typ === "any") return val;
Test case

test/inputs/json/priority/coin-pairs.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -59,7 +59,7 @@ quickType =
5959 encodeQuickType : QuickType -> Jenc.Value
6060 encodeQuickType x =
6161 Jenc.object
62- [ ("pairs", Jenc.dict identity encodePair x.pairs)
62+ [ ("pairs", makeDictEncoder identity encodePair x.pairs)
6363 , ("server_time", Jenc.int x.serverTime)
6464 ]
6565
@@ -90,6 +90,14 @@ encodePair x =
9090
9191 --- encoder helpers
9292
93+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
94+makeDictEncoder f m r =
95+ r
96+ |> Dict.toList
97+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
98+ |> String.join ","
99+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
100+
93101 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
94102 makeNullableEncoder f m =
95103 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations1.json

22 generated files · +83 −67
Melmarray-type-array--eed288b23e27 / QuickType.elm+17 −9
@@ -642,7 +642,7 @@ encodeQuickType x =
642642 , ("fuzzy", Jenc.array encodeFuzzy x.fuzzy)
643643 , ("gardenwards", Jenc.array encodeGardenward x.gardenwards)
644644 , ("generalissimo", Jenc.array encodeGeneralissimo x.generalissimo)
645- , ("habeas", Jenc.array (makeNullableEncoder (Jenc.dict identity Jenc.int)) x.habeas)
645+ , ("habeas", Jenc.array (makeNullableEncoder (makeDictEncoder identity Jenc.int)) x.habeas)
646646 , ("hemicrystalline", Jenc.array encodeHemicrystalline x.hemicrystalline)
647647 , ("hemocoele", Jenc.array encodeHemocoeleElement x.hemocoele)
648648 , ("hoister", Jenc.array encodeHoister x.hoister)
@@ -916,7 +916,7 @@ consilience =
916916 encodeConsilience : Consilience -> Jenc.Value
917917 encodeConsilience x = case x of
918918 DoubleInConsilience y -> Jenc.float y
919- IntegerMapInConsilience y -> Jenc.dict identity Jenc.int y
919+ IntegerMapInConsilience y -> makeDictEncoder identity Jenc.int y
920920
921921 constructor : Jdec.Decoder Constructor
922922 constructor =
@@ -928,7 +928,7 @@ constructor =
928928 encodeConstructor : Constructor -> Jenc.Value
929929 encodeConstructor x = case x of
930930 BoolInConstructor y -> Jenc.bool y
931- UnionMapInConstructor y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
931+ UnionMapInConstructor y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
932932
933933 continuative : Jdec.Decoder Continuative
934934 continuative =
@@ -940,7 +940,7 @@ continuative =
940940 encodeContinuative : Continuative -> Jenc.Value
941941 encodeContinuative x = case x of
942942 StringInContinuative y -> Jenc.string y
943- IntegerMapInContinuative y -> Jenc.dict identity Jenc.int y
943+ IntegerMapInContinuative y -> makeDictEncoder identity Jenc.int y
944944
945945 credulityElement : Jdec.Decoder CredulityElement
946946 credulityElement =
@@ -1017,7 +1017,7 @@ encodeCreviced : Creviced -> Jenc.Value
10171017 encodeCreviced x = case x of
10181018 BoolInCreviced y -> Jenc.bool y
10191019 StringInCreviced y -> Jenc.string y
1020- IntegerMapInCreviced y -> Jenc.dict identity Jenc.int y
1020+ IntegerMapInCreviced y -> makeDictEncoder identity Jenc.int y
10211021
10221022 deruralizeElement : Jdec.Decoder DeruralizeElement
10231023 deruralizeElement =
@@ -1171,7 +1171,7 @@ encodeEleutheromania : Eleutheromania -> Jenc.Value
11711171 encodeEleutheromania x = case x of
11721172 StringInEleutheromania y -> Jenc.string y
11731173 DoubleInEleutheromania y -> Jenc.float y
1174- IntegerMapInEleutheromania y -> Jenc.dict identity Jenc.int y
1174+ IntegerMapInEleutheromania y -> makeDictEncoder identity Jenc.int y
11751175
11761176 encrust : Jdec.Decoder Encrust
11771177 encrust =
@@ -1469,7 +1469,7 @@ fuzzy =
14691469 encodeFuzzy : Fuzzy -> Jenc.Value
14701470 encodeFuzzy x = case x of
14711471 IntegerInFuzzy y -> Jenc.int y
1472- UnionMapInFuzzy y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1472+ UnionMapInFuzzy y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14731473
14741474 gardenward : Jdec.Decoder Gardenward
14751475 gardenward =
@@ -1497,7 +1497,7 @@ encodeGeneralissimo : Generalissimo -> Jenc.Value
14971497 encodeGeneralissimo x = case x of
14981498 BoolInGeneralissimo y -> Jenc.bool y
14991499 NullInGeneralissimo -> Jenc.null
1500- IntegerMapInGeneralissimo y -> Jenc.dict identity Jenc.int y
1500+ IntegerMapInGeneralissimo y -> makeDictEncoder identity Jenc.int y
15011501
15021502 hemicrystalline : Jdec.Decoder Hemicrystalline
15031503 hemicrystalline =
@@ -1695,10 +1695,18 @@ jacutinga =
16951695 encodeJacutinga : Jacutinga -> Jenc.Value
16961696 encodeJacutinga x = case x of
16971697 IntegerArrayInJacutinga y -> Jenc.array Jenc.int y
1698- UnionMapInJacutinga y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1698+ UnionMapInJacutinga y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
16991699
17001700 --- encoder helpers
17011701
1702+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
1703+makeDictEncoder f m r =
1704+ r
1705+ |> Dict.toList
1706+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
1707+ |> String.join ","
1708+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
1709+
17021710 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
17031711 makeNullableEncoder f m =
17041712 case m of
Melmdefault / QuickType.elm+17 −9
@@ -641,7 +641,7 @@ encodeQuickType x =
641641 , ("fuzzy", Jenc.list encodeFuzzy x.fuzzy)
642642 , ("gardenwards", Jenc.list encodeGardenward x.gardenwards)
643643 , ("generalissimo", Jenc.list encodeGeneralissimo x.generalissimo)
644- , ("habeas", Jenc.list (makeNullableEncoder (Jenc.dict identity Jenc.int)) x.habeas)
644+ , ("habeas", Jenc.list (makeNullableEncoder (makeDictEncoder identity Jenc.int)) x.habeas)
645645 , ("hemicrystalline", Jenc.list encodeHemicrystalline x.hemicrystalline)
646646 , ("hemocoele", Jenc.list encodeHemocoeleElement x.hemocoele)
647647 , ("hoister", Jenc.list encodeHoister x.hoister)
@@ -915,7 +915,7 @@ consilience =
915915 encodeConsilience : Consilience -> Jenc.Value
916916 encodeConsilience x = case x of
917917 DoubleInConsilience y -> Jenc.float y
918- IntegerMapInConsilience y -> Jenc.dict identity Jenc.int y
918+ IntegerMapInConsilience y -> makeDictEncoder identity Jenc.int y
919919
920920 constructor : Jdec.Decoder Constructor
921921 constructor =
@@ -927,7 +927,7 @@ constructor =
927927 encodeConstructor : Constructor -> Jenc.Value
928928 encodeConstructor x = case x of
929929 BoolInConstructor y -> Jenc.bool y
930- UnionMapInConstructor y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
930+ UnionMapInConstructor y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
931931
932932 continuative : Jdec.Decoder Continuative
933933 continuative =
@@ -939,7 +939,7 @@ continuative =
939939 encodeContinuative : Continuative -> Jenc.Value
940940 encodeContinuative x = case x of
941941 StringInContinuative y -> Jenc.string y
942- IntegerMapInContinuative y -> Jenc.dict identity Jenc.int y
942+ IntegerMapInContinuative y -> makeDictEncoder identity Jenc.int y
943943
944944 credulityElement : Jdec.Decoder CredulityElement
945945 credulityElement =
@@ -1016,7 +1016,7 @@ encodeCreviced : Creviced -> Jenc.Value
10161016 encodeCreviced x = case x of
10171017 BoolInCreviced y -> Jenc.bool y
10181018 StringInCreviced y -> Jenc.string y
1019- IntegerMapInCreviced y -> Jenc.dict identity Jenc.int y
1019+ IntegerMapInCreviced y -> makeDictEncoder identity Jenc.int y
10201020
10211021 deruralizeElement : Jdec.Decoder DeruralizeElement
10221022 deruralizeElement =
@@ -1170,7 +1170,7 @@ encodeEleutheromania : Eleutheromania -> Jenc.Value
11701170 encodeEleutheromania x = case x of
11711171 StringInEleutheromania y -> Jenc.string y
11721172 DoubleInEleutheromania y -> Jenc.float y
1173- IntegerMapInEleutheromania y -> Jenc.dict identity Jenc.int y
1173+ IntegerMapInEleutheromania y -> makeDictEncoder identity Jenc.int y
11741174
11751175 encrust : Jdec.Decoder Encrust
11761176 encrust =
@@ -1468,7 +1468,7 @@ fuzzy =
14681468 encodeFuzzy : Fuzzy -> Jenc.Value
14691469 encodeFuzzy x = case x of
14701470 IntegerInFuzzy y -> Jenc.int y
1471- UnionMapInFuzzy y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1471+ UnionMapInFuzzy y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14721472
14731473 gardenward : Jdec.Decoder Gardenward
14741474 gardenward =
@@ -1496,7 +1496,7 @@ encodeGeneralissimo : Generalissimo -> Jenc.Value
14961496 encodeGeneralissimo x = case x of
14971497 BoolInGeneralissimo y -> Jenc.bool y
14981498 NullInGeneralissimo -> Jenc.null
1499- IntegerMapInGeneralissimo y -> Jenc.dict identity Jenc.int y
1499+ IntegerMapInGeneralissimo y -> makeDictEncoder identity Jenc.int y
15001500
15011501 hemicrystalline : Jdec.Decoder Hemicrystalline
15021502 hemicrystalline =
@@ -1694,10 +1694,18 @@ jacutinga =
16941694 encodeJacutinga : Jacutinga -> Jenc.Value
16951695 encodeJacutinga x = case x of
16961696 IntegerArrayInJacutinga y -> Jenc.list Jenc.int y
1697- UnionMapInJacutinga y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1697+ UnionMapInJacutinga y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
16981698
16991699 --- encoder helpers
17001700
1701+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
1702+makeDictEncoder f m r =
1703+ r
1704+ |> Dict.toList
1705+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
1706+ |> String.join ","
1707+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
1708+
17011709 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
17021710 makeNullableEncoder f m =
17031711 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = val[key];
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
@@ -603,7 +603,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
603603 if (val === null || typeof val !== "object" || Array.isArray(val)) {
604604 return invalidValue(l(ref || "object"), val, key, parent);
605605 }
606- const result: any = {};
606+ const result: any = Object.create(null);
607607 Object.getOwnPropertyNames(props).forEach(key => {
608608 const prop = props[key];
609609 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -614,7 +614,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
614614 result[key] = transform(val[key], additional, getProps, key, ref);
615615 }
616616 });
617- return result;
617+ return Object.setPrototypeOf(result, Object.prototype);
618618 }
619619
620620 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+11 −11
@@ -39,7 +39,7 @@ export interface TopLevel {
3939 readonly fuzzy: Fuzzy[];
4040 readonly gardenwards: Gardenward[];
4141 readonly generalissimo: Generalissimo[];
42- readonly habeas: ({ [key: string]: number } | null)[];
42+ readonly habeas: ({ readonly [key: string]: number } | null)[];
4343 readonly hemicrystalline: Hemicrystalline[];
4444 readonly hemocoele: HemocoeleElement[];
4545 readonly hoister: Hoister[];
@@ -150,11 +150,11 @@ export interface CoadjustClass {
150150 readonly unchargeable?: null;
151151 }
152152
153-export type Consilience = number | { [key: string]: number };
153+export type Consilience = number | { readonly [key: string]: number };
154154
155-export type Constructor = boolean | { [key: string]: number | null };
155+export type Constructor = boolean | { readonly [key: string]: number | null };
156156
157-export type Continuative = { [key: string]: number } | string;
157+export type Continuative = { readonly [key: string]: number } | string;
158158
159159 export type CredulityElement = CredulityClass | number | string;
160160
@@ -181,7 +181,7 @@ export interface CredulityClass {
181181 readonly wharp: null;
182182 }
183183
184-export type Creviced = boolean | { [key: string]: number } | string;
184+export type Creviced = boolean | { readonly [key: string]: number } | string;
185185
186186 export type DeruralizeElement = null[] | boolean | DeruralizeClass;
187187
@@ -235,7 +235,7 @@ export interface DiaereseClass {
235235
236236 export type Downstroke = null[] | boolean | string;
237237
238-export type Eleutheromania = number | { [key: string]: number } | string;
238+export type Eleutheromania = number | { readonly [key: string]: number } | string;
239239
240240 export interface Encrust {
241241 readonly Hibernia: null;
@@ -343,11 +343,11 @@ export interface FlagmakingClass {
343343
344344 export type Fluorometer = number | null | string;
345345
346-export type Fuzzy = number | { [key: string]: number | null };
346+export type Fuzzy = number | { readonly [key: string]: number | null };
347347
348348 export type Gardenward = number[] | boolean | string;
349349
350-export type Generalissimo = boolean | { [key: string]: number } | null;
350+export type Generalissimo = boolean | { readonly [key: string]: number } | null;
351351
352352 export type Hemicrystalline = CimeliaClass | string;
353353
@@ -401,7 +401,7 @@ export interface Interacinar {
401401 readonly untrimmed: null;
402402 }
403403
404-export type Jacutinga = number[] | { [key: string]: number | null };
404+export type Jacutinga = number[] | { readonly [key: string]: number | null };
405405
406406 // Converts JSON strings to/from your types
407407 // and asserts the results of JSON.parse at runtime
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
510510 result[key] = val[key];
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations2.json

22 generated files · +92 −76
Melmarray-type-array--eed288b23e27 / QuickType.elm+20 −12
@@ -579,13 +579,13 @@ encodeQuickType x =
579579 , ("amphithyron", Jenc.array (makeNullableEncoder encodeAmphithyron) x.amphithyron)
580580 , ("Andriana", Jenc.array (makeNullableEncoder Jenc.string) x.andriana)
581581 , ("ankee", Jenc.array encodeAnkeeElement x.ankee)
582- , ("annihilator", Jenc.array (makeNullableEncoder (Jenc.dict identity (makeNullableEncoder Jenc.int))) x.annihilator)
582+ , ("annihilator", Jenc.array (makeNullableEncoder (makeDictEncoder identity (makeNullableEncoder Jenc.int))) x.annihilator)
583583 , ("annulose", always Jenc.null x.annulose)
584584 , ("Ansarie", Jenc.array encodeAnsarieElement x.ansarie)
585585 , ("aphasia", Jenc.array encodeAphasia x.aphasia)
586586 , ("asprawl", Jenc.array encodeAsprawl x.asprawl)
587587 , ("attractive", Jenc.array (makeNullableEncoder Jenc.bool) x.attractive)
588- , ("barksome", Jenc.dict identity Jenc.int x.barksome)
588+ , ("barksome", makeDictEncoder identity Jenc.int x.barksome)
589589 , ("bedesman", Jenc.array encodeBedesman x.bedesman)
590590 , ("belard", Jenc.array encodeBelard x.belard)
591591 , ("bocking", Jenc.array encodeBocking x.bocking)
@@ -612,7 +612,7 @@ encodeQuickType x =
612612 , ("School", Jenc.array encodeSchool x.school)
613613 , ("Shakespearolater", Jenc.array encodeShakespearolater x.shakespearolater)
614614 , ("Svan", Jenc.array Jenc.float x.svan)
615- , ("Wayao", Jenc.dict identity Jenc.float x.wayao)
615+ , ("Wayao", makeDictEncoder identity Jenc.float x.wayao)
616616 ]
617617
618618 abranchiata : Jdec.Decoder Abranchiata
@@ -641,7 +641,7 @@ encodeAcademe : Academe -> Jenc.Value
641641 encodeAcademe x = case x of
642642 IntegerArrayInAcademe y -> Jenc.array Jenc.int y
643643 IntegerInAcademe y -> Jenc.int y
644- IntegerMapInAcademe y -> Jenc.dict identity Jenc.int y
644+ IntegerMapInAcademe y -> makeDictEncoder identity Jenc.int y
645645
646646 acquirable : Jdec.Decoder Acquirable
647647 acquirable =
@@ -653,7 +653,7 @@ acquirable =
653653 encodeAcquirable : Acquirable -> Jenc.Value
654654 encodeAcquirable x = case x of
655655 UnionArrayInAcquirable y -> Jenc.array (makeNullableEncoder Jenc.int) y
656- IntegerMapInAcquirable y -> Jenc.dict identity Jenc.int y
656+ IntegerMapInAcquirable y -> makeDictEncoder identity Jenc.int y
657657
658658 aerometry : Jdec.Decoder Aerometry
659659 aerometry =
@@ -1034,7 +1034,7 @@ encodeBocking : Bocking -> Jenc.Value
10341034 encodeBocking x = case x of
10351035 IntegerArrayInBocking y -> Jenc.array Jenc.int y
10361036 BoolInBocking y -> Jenc.bool y
1037- IntegerMapInBocking y -> Jenc.dict identity Jenc.int y
1037+ IntegerMapInBocking y -> makeDictEncoder identity Jenc.int y
10381038
10391039 brawlingly : Jdec.Decoder Brawlingly
10401040 brawlingly =
@@ -1046,7 +1046,7 @@ brawlingly =
10461046 encodeBrawlingly : Brawlingly -> Jenc.Value
10471047 encodeBrawlingly x = case x of
10481048 NullArrayInBrawlingly y -> Jenc.array (always Jenc.null) y
1049- UnionMapInBrawlingly y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1049+ UnionMapInBrawlingly y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
10501050
10511051 brookie : Jdec.Decoder Brookie
10521052 brookie =
@@ -1098,7 +1098,7 @@ encodeCatallactic : Catallactic -> Jenc.Value
10981098 encodeCatallactic x = case x of
10991099 NullArrayInCatallactic y -> Jenc.array (always Jenc.null) y
11001100 BoolInCatallactic y -> Jenc.bool y
1101- IntegerMapInCatallactic y -> Jenc.dict identity Jenc.int y
1101+ IntegerMapInCatallactic y -> makeDictEncoder identity Jenc.int y
11021102
11031103 cemental : Jdec.Decoder Cemental
11041104 cemental =
@@ -1112,7 +1112,7 @@ encodeCemental : Cemental -> Jenc.Value
11121112 encodeCemental x = case x of
11131113 IntegerArrayInCemental y -> Jenc.array Jenc.int y
11141114 DoubleInCemental y -> Jenc.float y
1115- IntegerMapInCemental y -> Jenc.dict identity Jenc.int y
1115+ IntegerMapInCemental y -> makeDictEncoder identity Jenc.int y
11161116
11171117 chytridiaceaeElement : Jdec.Decoder ChytridiaceaeElement
11181118 chytridiaceaeElement =
@@ -1284,7 +1284,7 @@ eupatorium =
12841284 encodeEupatorium : Eupatorium -> Jenc.Value
12851285 encodeEupatorium x = case x of
12861286 NullArrayInEupatorium y -> Jenc.array (always Jenc.null) y
1287- IntegerMapInEupatorium y -> Jenc.dict identity Jenc.int y
1287+ IntegerMapInEupatorium y -> makeDictEncoder identity Jenc.int y
12881288
12891289 gryphosaurusElement : Jdec.Decoder GryphosaurusElement
12901290 gryphosaurusElement =
@@ -1359,7 +1359,7 @@ koryak =
13591359 encodeKoryak : Koryak -> Jenc.Value
13601360 encodeKoryak x = case x of
13611361 StringInKoryak y -> Jenc.string y
1362- UnionMapInKoryak y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1362+ UnionMapInKoryak y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
13631363
13641364 laviniaElement : Jdec.Decoder LaviniaElement
13651365 laviniaElement =
@@ -1547,7 +1547,7 @@ encodeSchool : School -> Jenc.Value
15471547 encodeSchool x = case x of
15481548 IntegerInSchool y -> Jenc.int y
15491549 NullInSchool -> Jenc.null
1550- IntegerMapInSchool y -> Jenc.dict identity Jenc.int y
1550+ IntegerMapInSchool y -> makeDictEncoder identity Jenc.int y
15511551
15521552 shakespearolater : Jdec.Decoder Shakespearolater
15531553 shakespearolater =
@@ -1565,6 +1565,14 @@ encodeShakespearolater x = case x of
15651565
15661566 --- encoder helpers
15671567
1568+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
1569+makeDictEncoder f m r =
1570+ r
1571+ |> Dict.toList
1572+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
1573+ |> String.join ","
1574+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
1575+
15681576 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
15691577 makeNullableEncoder f m =
15701578 case m of
Melmdefault / QuickType.elm+20 −12
@@ -578,13 +578,13 @@ encodeQuickType x =
578578 , ("amphithyron", Jenc.list (makeNullableEncoder encodeAmphithyron) x.amphithyron)
579579 , ("Andriana", Jenc.list (makeNullableEncoder Jenc.string) x.andriana)
580580 , ("ankee", Jenc.list encodeAnkeeElement x.ankee)
581- , ("annihilator", Jenc.list (makeNullableEncoder (Jenc.dict identity (makeNullableEncoder Jenc.int))) x.annihilator)
581+ , ("annihilator", Jenc.list (makeNullableEncoder (makeDictEncoder identity (makeNullableEncoder Jenc.int))) x.annihilator)
582582 , ("annulose", always Jenc.null x.annulose)
583583 , ("Ansarie", Jenc.list encodeAnsarieElement x.ansarie)
584584 , ("aphasia", Jenc.list encodeAphasia x.aphasia)
585585 , ("asprawl", Jenc.list encodeAsprawl x.asprawl)
586586 , ("attractive", Jenc.list (makeNullableEncoder Jenc.bool) x.attractive)
587- , ("barksome", Jenc.dict identity Jenc.int x.barksome)
587+ , ("barksome", makeDictEncoder identity Jenc.int x.barksome)
588588 , ("bedesman", Jenc.list encodeBedesman x.bedesman)
589589 , ("belard", Jenc.list encodeBelard x.belard)
590590 , ("bocking", Jenc.list encodeBocking x.bocking)
@@ -611,7 +611,7 @@ encodeQuickType x =
611611 , ("School", Jenc.list encodeSchool x.school)
612612 , ("Shakespearolater", Jenc.list encodeShakespearolater x.shakespearolater)
613613 , ("Svan", Jenc.list Jenc.float x.svan)
614- , ("Wayao", Jenc.dict identity Jenc.float x.wayao)
614+ , ("Wayao", makeDictEncoder identity Jenc.float x.wayao)
615615 ]
616616
617617 abranchiata : Jdec.Decoder Abranchiata
@@ -640,7 +640,7 @@ encodeAcademe : Academe -> Jenc.Value
640640 encodeAcademe x = case x of
641641 IntegerArrayInAcademe y -> Jenc.list Jenc.int y
642642 IntegerInAcademe y -> Jenc.int y
643- IntegerMapInAcademe y -> Jenc.dict identity Jenc.int y
643+ IntegerMapInAcademe y -> makeDictEncoder identity Jenc.int y
644644
645645 acquirable : Jdec.Decoder Acquirable
646646 acquirable =
@@ -652,7 +652,7 @@ acquirable =
652652 encodeAcquirable : Acquirable -> Jenc.Value
653653 encodeAcquirable x = case x of
654654 UnionArrayInAcquirable y -> Jenc.list (makeNullableEncoder Jenc.int) y
655- IntegerMapInAcquirable y -> Jenc.dict identity Jenc.int y
655+ IntegerMapInAcquirable y -> makeDictEncoder identity Jenc.int y
656656
657657 aerometry : Jdec.Decoder Aerometry
658658 aerometry =
@@ -1033,7 +1033,7 @@ encodeBocking : Bocking -> Jenc.Value
10331033 encodeBocking x = case x of
10341034 IntegerArrayInBocking y -> Jenc.list Jenc.int y
10351035 BoolInBocking y -> Jenc.bool y
1036- IntegerMapInBocking y -> Jenc.dict identity Jenc.int y
1036+ IntegerMapInBocking y -> makeDictEncoder identity Jenc.int y
10371037
10381038 brawlingly : Jdec.Decoder Brawlingly
10391039 brawlingly =
@@ -1045,7 +1045,7 @@ brawlingly =
10451045 encodeBrawlingly : Brawlingly -> Jenc.Value
10461046 encodeBrawlingly x = case x of
10471047 NullArrayInBrawlingly y -> Jenc.list (always Jenc.null) y
1048- UnionMapInBrawlingly y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1048+ UnionMapInBrawlingly y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
10491049
10501050 brookie : Jdec.Decoder Brookie
10511051 brookie =
@@ -1097,7 +1097,7 @@ encodeCatallactic : Catallactic -> Jenc.Value
10971097 encodeCatallactic x = case x of
10981098 NullArrayInCatallactic y -> Jenc.list (always Jenc.null) y
10991099 BoolInCatallactic y -> Jenc.bool y
1100- IntegerMapInCatallactic y -> Jenc.dict identity Jenc.int y
1100+ IntegerMapInCatallactic y -> makeDictEncoder identity Jenc.int y
11011101
11021102 cemental : Jdec.Decoder Cemental
11031103 cemental =
@@ -1111,7 +1111,7 @@ encodeCemental : Cemental -> Jenc.Value
11111111 encodeCemental x = case x of
11121112 IntegerArrayInCemental y -> Jenc.list Jenc.int y
11131113 DoubleInCemental y -> Jenc.float y
1114- IntegerMapInCemental y -> Jenc.dict identity Jenc.int y
1114+ IntegerMapInCemental y -> makeDictEncoder identity Jenc.int y
11151115
11161116 chytridiaceaeElement : Jdec.Decoder ChytridiaceaeElement
11171117 chytridiaceaeElement =
@@ -1283,7 +1283,7 @@ eupatorium =
12831283 encodeEupatorium : Eupatorium -> Jenc.Value
12841284 encodeEupatorium x = case x of
12851285 NullArrayInEupatorium y -> Jenc.list (always Jenc.null) y
1286- IntegerMapInEupatorium y -> Jenc.dict identity Jenc.int y
1286+ IntegerMapInEupatorium y -> makeDictEncoder identity Jenc.int y
12871287
12881288 gryphosaurusElement : Jdec.Decoder GryphosaurusElement
12891289 gryphosaurusElement =
@@ -1358,7 +1358,7 @@ koryak =
13581358 encodeKoryak : Koryak -> Jenc.Value
13591359 encodeKoryak x = case x of
13601360 StringInKoryak y -> Jenc.string y
1361- UnionMapInKoryak y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1361+ UnionMapInKoryak y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
13621362
13631363 laviniaElement : Jdec.Decoder LaviniaElement
13641364 laviniaElement =
@@ -1546,7 +1546,7 @@ encodeSchool : School -> Jenc.Value
15461546 encodeSchool x = case x of
15471547 IntegerInSchool y -> Jenc.int y
15481548 NullInSchool -> Jenc.null
1549- IntegerMapInSchool y -> Jenc.dict identity Jenc.int y
1549+ IntegerMapInSchool y -> makeDictEncoder identity Jenc.int y
15501550
15511551 shakespearolater : Jdec.Decoder Shakespearolater
15521552 shakespearolater =
@@ -1564,6 +1564,14 @@ encodeShakespearolater x = case x of
15641564
15651565 --- encoder helpers
15661566
1567+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
1568+makeDictEncoder f m r =
1569+ r
1570+ |> Dict.toList
1571+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
1572+ |> String.join ","
1573+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
1574+
15671575 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
15681576 makeNullableEncoder f m =
15691577 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = val[key];
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
@@ -531,7 +531,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
531531 if (val === null || typeof val !== "object" || Array.isArray(val)) {
532532 return invalidValue(l(ref || "object"), val, key, parent);
533533 }
534- const result: any = {};
534+ const result: any = Object.create(null);
535535 Object.getOwnPropertyNames(props).forEach(key => {
536536 const prop = props[key];
537537 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -542,7 +542,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
542542 result[key] = transform(val[key], additional, getProps, key, ref);
543543 }
544544 });
545- return result;
545+ return Object.setPrototypeOf(result, Object.prototype);
546546 }
547547
548548 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+14 −14
@@ -27,7 +27,7 @@ export interface TopLevel {
2727 readonly School: School[];
2828 readonly Shakespearolater: Shakespearolater[];
2929 readonly Svan: number[];
30- readonly Wayao: { [key: string]: number };
30+ readonly Wayao: { readonly [key: string]: number };
3131 readonly academe: Academe[];
3232 readonly acquirable: Acquirable[];
3333 readonly aerometry: Aerometry[];
@@ -37,12 +37,12 @@ export interface TopLevel {
3737 readonly ambassage: Ambassage[];
3838 readonly amphithyron: (Amphithyron | null)[];
3939 readonly ankee: AnkeeElement[];
40- readonly annihilator: ({ [key: string]: number | null } | null)[];
40+ readonly annihilator: ({ readonly [key: string]: number | null } | null)[];
4141 readonly annulose: null;
4242 readonly aphasia: Aphasia[];
4343 readonly asprawl: Asprawl[];
4444 readonly attractive: (boolean | null)[];
45- readonly barksome: { [key: string]: number };
45+ readonly barksome: { readonly [key: string]: number };
4646 readonly bedesman: Bedesman[];
4747 readonly belard: Belard[];
4848 readonly bocking: Bocking[];
@@ -141,7 +141,7 @@ export type Endomyce = number | string;
141141
142142 export type Epinephelidae = boolean | number | string;
143143
144-export type Eupatorium = null[] | { [key: string]: number };
144+export type Eupatorium = null[] | { readonly [key: string]: number };
145145
146146 export type GryphosaurusElement = number[] | GryphosaurusClass | string;
147147
@@ -168,7 +168,7 @@ export interface GryphosaurusClass {
168168 readonly underntime: null;
169169 }
170170
171-export type Koryak = { [key: string]: number | null } | string;
171+export type Koryak = { readonly [key: string]: number | null } | string;
172172
173173 export type LaviniaElement = LaviniaClass | string;
174174
@@ -239,13 +239,13 @@ export type Rhomboganoidei = number[] | Rebecca | string;
239239
240240 export type Ruellia = boolean | Rebecca | string;
241241
242-export type School = number | { [key: string]: number } | null;
242+export type School = number | { readonly [key: string]: number } | null;
243243
244244 export type Shakespearolater = number[] | number | string;
245245
246-export type Academe = number[] | number | { [key: string]: number };
246+export type Academe = number[] | number | { readonly [key: string]: number };
247247
248-export type Acquirable = (number | null)[] | { [key: string]: number };
248+export type Acquirable = (number | null)[] | { readonly [key: string]: number };
249249
250250 export type Aerometry = boolean | number;
251251
@@ -341,9 +341,9 @@ export type Bedesman = boolean | number | string;
341341
342342 export type Belard = number[] | Rebecca | number;
343343
344-export type Bocking = number[] | boolean | { [key: string]: number };
344+export type Bocking = number[] | boolean | { readonly [key: string]: number };
345345
346-export type Brawlingly = null[] | { [key: string]: number | null };
346+export type Brawlingly = null[] | { readonly [key: string]: number | null };
347347
348348 export type Brookie = number[] | Rebecca;
349349
@@ -351,9 +351,9 @@ export type Bumboatman = null[] | null | string;
351351
352352 export type Calaverite = number[] | string;
353353
354-export type Catallactic = null[] | boolean | { [key: string]: number };
354+export type Catallactic = null[] | boolean | { readonly [key: string]: number };
355355
356-export type Cemental = number[] | number | { [key: string]: number };
356+export type Cemental = number[] | number | { readonly [key: string]: number };
357357
358358 // Converts JSON strings to/from your types
359359 // and asserts the results of JSON.parse at runtime
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
462462 result[key] = val[key];
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations3.json

22 generated files · +77 −61
Melmarray-type-array--eed288b23e27 / QuickType.elm+15 −7
@@ -714,7 +714,7 @@ encodeQuickType x =
714714 , ("prefreshman", Jenc.array encodePrefreshmanElement x.prefreshman)
715715 , ("prehensility", Jenc.array encodePrehensility x.prehensility)
716716 , ("prevoidance", Jenc.array encodePrevoidance x.prevoidance)
717- , ("probant", Jenc.array (Jenc.dict identity (makeNullableEncoder Jenc.int)) x.probant)
717+ , ("probant", Jenc.array (makeDictEncoder identity (makeNullableEncoder Jenc.int)) x.probant)
718718 , ("protext", Jenc.array encodeProtext x.protext)
719719 ]
720720
@@ -789,7 +789,7 @@ kongoni =
789789 encodeKongoni : Kongoni -> Jenc.Value
790790 encodeKongoni x = case x of
791791 IntegerArrayInKongoni y -> Jenc.array Jenc.int y
792- IntegerMapInKongoni y -> Jenc.dict identity Jenc.int y
792+ IntegerMapInKongoni y -> makeDictEncoder identity Jenc.int y
793793
794794 ladronismElement : Jdec.Decoder LadronismElement
795795 ladronismElement =
@@ -1462,7 +1462,7 @@ paleographically =
14621462 encodePaleographically : Paleographically -> Jenc.Value
14631463 encodePaleographically x = case x of
14641464 DoubleInPaleographically y -> Jenc.float y
1465- UnionMapInPaleographically y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1465+ UnionMapInPaleographically y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14661466
14671467 pamphletwise : Jdec.Decoder Pamphletwise
14681468 pamphletwise =
@@ -1476,7 +1476,7 @@ encodePamphletwise : Pamphletwise -> Jenc.Value
14761476 encodePamphletwise x = case x of
14771477 IntegerInPamphletwise y -> Jenc.int y
14781478 StringInPamphletwise y -> Jenc.string y
1479- IntegerMapInPamphletwise y -> Jenc.dict identity Jenc.int y
1479+ IntegerMapInPamphletwise y -> makeDictEncoder identity Jenc.int y
14801480
14811481 pediatric : Jdec.Decoder Pediatric
14821482 pediatric =
@@ -1613,7 +1613,7 @@ placuntiti =
16131613 encodePlacuntiti : Placuntiti -> Jenc.Value
16141614 encodePlacuntiti x = case x of
16151615 IntegerInPlacuntiti y -> Jenc.int y
1616- IntegerMapInPlacuntiti y -> Jenc.dict identity Jenc.int y
1616+ IntegerMapInPlacuntiti y -> makeDictEncoder identity Jenc.int y
16171617
16181618 plectopterous : Jdec.Decoder Plectopterous
16191619 plectopterous =
@@ -1625,7 +1625,7 @@ plectopterous =
16251625 encodePlectopterous : Plectopterous -> Jenc.Value
16261626 encodePlectopterous x = case x of
16271627 DoubleInPlectopterous y -> Jenc.float y
1628- IntegerMapInPlectopterous y -> Jenc.dict identity Jenc.int y
1628+ IntegerMapInPlectopterous y -> makeDictEncoder identity Jenc.int y
16291629
16301630 pneumocele : Jdec.Decoder Pneumocele
16311631 pneumocele =
@@ -1710,7 +1710,7 @@ encodePoormaster : Poormaster -> Jenc.Value
17101710 encodePoormaster x = case x of
17111711 IntegerArrayInPoormaster y -> Jenc.array Jenc.int y
17121712 NullInPoormaster -> Jenc.null
1713- IntegerMapInPoormaster y -> Jenc.dict identity Jenc.int y
1713+ IntegerMapInPoormaster y -> makeDictEncoder identity Jenc.int y
17141714
17151715 potwhiskyElement : Jdec.Decoder PotwhiskyElement
17161716 potwhiskyElement =
@@ -1896,6 +1896,14 @@ encodeProtext x = case x of
18961896
18971897 --- encoder helpers
18981898
1899+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
1900+makeDictEncoder f m r =
1901+ r
1902+ |> Dict.toList
1903+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
1904+ |> String.join ","
1905+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
1906+
18991907 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
19001908 makeNullableEncoder f m =
19011909 case m of
Melmdefault / QuickType.elm+15 −7
@@ -713,7 +713,7 @@ encodeQuickType x =
713713 , ("prefreshman", Jenc.list encodePrefreshmanElement x.prefreshman)
714714 , ("prehensility", Jenc.list encodePrehensility x.prehensility)
715715 , ("prevoidance", Jenc.list encodePrevoidance x.prevoidance)
716- , ("probant", Jenc.list (Jenc.dict identity (makeNullableEncoder Jenc.int)) x.probant)
716+ , ("probant", Jenc.list (makeDictEncoder identity (makeNullableEncoder Jenc.int)) x.probant)
717717 , ("protext", Jenc.list encodeProtext x.protext)
718718 ]
719719
@@ -788,7 +788,7 @@ kongoni =
788788 encodeKongoni : Kongoni -> Jenc.Value
789789 encodeKongoni x = case x of
790790 IntegerArrayInKongoni y -> Jenc.list Jenc.int y
791- IntegerMapInKongoni y -> Jenc.dict identity Jenc.int y
791+ IntegerMapInKongoni y -> makeDictEncoder identity Jenc.int y
792792
793793 ladronismElement : Jdec.Decoder LadronismElement
794794 ladronismElement =
@@ -1461,7 +1461,7 @@ paleographically =
14611461 encodePaleographically : Paleographically -> Jenc.Value
14621462 encodePaleographically x = case x of
14631463 DoubleInPaleographically y -> Jenc.float y
1464- UnionMapInPaleographically y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1464+ UnionMapInPaleographically y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14651465
14661466 pamphletwise : Jdec.Decoder Pamphletwise
14671467 pamphletwise =
@@ -1475,7 +1475,7 @@ encodePamphletwise : Pamphletwise -> Jenc.Value
14751475 encodePamphletwise x = case x of
14761476 IntegerInPamphletwise y -> Jenc.int y
14771477 StringInPamphletwise y -> Jenc.string y
1478- IntegerMapInPamphletwise y -> Jenc.dict identity Jenc.int y
1478+ IntegerMapInPamphletwise y -> makeDictEncoder identity Jenc.int y
14791479
14801480 pediatric : Jdec.Decoder Pediatric
14811481 pediatric =
@@ -1612,7 +1612,7 @@ placuntiti =
16121612 encodePlacuntiti : Placuntiti -> Jenc.Value
16131613 encodePlacuntiti x = case x of
16141614 IntegerInPlacuntiti y -> Jenc.int y
1615- IntegerMapInPlacuntiti y -> Jenc.dict identity Jenc.int y
1615+ IntegerMapInPlacuntiti y -> makeDictEncoder identity Jenc.int y
16161616
16171617 plectopterous : Jdec.Decoder Plectopterous
16181618 plectopterous =
@@ -1624,7 +1624,7 @@ plectopterous =
16241624 encodePlectopterous : Plectopterous -> Jenc.Value
16251625 encodePlectopterous x = case x of
16261626 DoubleInPlectopterous y -> Jenc.float y
1627- IntegerMapInPlectopterous y -> Jenc.dict identity Jenc.int y
1627+ IntegerMapInPlectopterous y -> makeDictEncoder identity Jenc.int y
16281628
16291629 pneumocele : Jdec.Decoder Pneumocele
16301630 pneumocele =
@@ -1709,7 +1709,7 @@ encodePoormaster : Poormaster -> Jenc.Value
17091709 encodePoormaster x = case x of
17101710 IntegerArrayInPoormaster y -> Jenc.list Jenc.int y
17111711 NullInPoormaster -> Jenc.null
1712- IntegerMapInPoormaster y -> Jenc.dict identity Jenc.int y
1712+ IntegerMapInPoormaster y -> makeDictEncoder identity Jenc.int y
17131713
17141714 potwhiskyElement : Jdec.Decoder PotwhiskyElement
17151715 potwhiskyElement =
@@ -1895,6 +1895,14 @@ encodeProtext x = case x of
18951895
18961896 --- encoder helpers
18971897
1898+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
1899+makeDictEncoder f m r =
1900+ r
1901+ |> Dict.toList
1902+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
1903+ |> String.join ","
1904+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
1905+
18981906 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
18991907 makeNullableEncoder f m =
19001908 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = val[key];
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
@@ -667,7 +667,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
667667 if (val === null || typeof val !== "object" || Array.isArray(val)) {
668668 return invalidValue(l(ref || "object"), val, key, parent);
669669 }
670- const result: any = {};
670+ const result: any = Object.create(null);
671671 Object.getOwnPropertyNames(props).forEach(key => {
672672 const prop = props[key];
673673 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -678,7 +678,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
678678 result[key] = transform(val[key], additional, getProps, key, ref);
679679 }
680680 });
681- return result;
681+ return Object.setPrototypeOf(result, Object.prototype);
682682 }
683683
684684 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+9 −9
@@ -48,7 +48,7 @@ export interface TopLevel {
4848 readonly prefreshman: PrefreshmanElement[];
4949 readonly prehensility: Prehensility[];
5050 readonly prevoidance: Prevoidance[];
51- readonly probant: { [key: string]: number | null }[];
51+ readonly probant: { readonly [key: string]: number | null }[];
5252 readonly protext: Protext[];
5353 }
5454
@@ -77,7 +77,7 @@ export interface JurorClass {
7777 readonly uninhabitedness: null;
7878 }
7979
80-export type Kongoni = number[] | { [key: string]: number };
80+export type Kongoni = number[] | { readonly [key: string]: number };
8181
8282 export type LadronismElement = LadronismClass | number | string;
8383
@@ -323,9 +323,9 @@ export interface OutrivalClass {
323323 readonly unpaced: null;
324324 }
325325
326-export type Paleographically = number | { [key: string]: number | null };
326+export type Paleographically = number | { readonly [key: string]: number | null };
327327
328-export type Pamphletwise = number | { [key: string]: number } | string;
328+export type Pamphletwise = number | { readonly [key: string]: number } | string;
329329
330330 export type Pediatric = boolean | number | null;
331331
@@ -365,9 +365,9 @@ export type Piffler = null[] | MonaziteClass;
365365
366366 export type Pithful = boolean | number | null;
367367
368-export type Placuntiti = number | { [key: string]: number };
368+export type Placuntiti = number | { readonly [key: string]: number };
369369
370-export type Plectopterous = number | { [key: string]: number };
370+export type Plectopterous = number | { readonly [key: string]: number };
371371
372372 export interface Pneumocele {
373373 readonly Carbonarism?: null;
@@ -399,7 +399,7 @@ export interface Pneumocele {
399399
400400 export type Poliorcetic = boolean | MonaziteClass;
401401
402-export type Poormaster = number[] | { [key: string]: number } | null;
402+export type Poormaster = number[] | { readonly [key: string]: number } | null;
403403
404404 export type PotwhiskyElement = PotwhiskyClass | number | null;
405405
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
566566 result[key] = val[key];
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations4.json

22 generated files · +89 −73
Melmarray-type-array--eed288b23e27 / QuickType.elm+19 −11
@@ -830,7 +830,7 @@ encodeQuickType x =
830830 , ("untasked", Jenc.array encodeUntasked x.untasked)
831831 , ("unvarying", Jenc.array encodeUnvarying x.unvarying)
832832 , ("vehemently", Jenc.array encodeVehemently x.vehemently)
833- , ("warriorship", Jenc.dict identity Jenc.bool x.warriorship)
833+ , ("warriorship", makeDictEncoder identity Jenc.bool x.warriorship)
834834 , ("whitepot", Jenc.array encodeWhitepot x.whitepot)
835835 , ("wrothy", Jenc.array encodeWrothyElement x.wrothy)
836836 ]
@@ -1014,7 +1014,7 @@ querier =
10141014 encodeQuerier : Querier -> Jenc.Value
10151015 encodeQuerier x = case x of
10161016 BoolInQuerier y -> Jenc.bool y
1017- IntegerMapInQuerier y -> Jenc.dict identity Jenc.int y
1017+ IntegerMapInQuerier y -> makeDictEncoder identity Jenc.int y
10181018
10191019 rebarbative : Jdec.Decoder Rebarbative
10201020 rebarbative =
@@ -1312,7 +1312,7 @@ encodeSaprophilous : Saprophilous -> Jenc.Value
13121312 encodeSaprophilous x = case x of
13131313 NullInSaprophilous -> Jenc.null
13141314 StringInSaprophilous y -> Jenc.string y
1315- IntegerMapInSaprophilous y -> Jenc.dict identity Jenc.int y
1315+ IntegerMapInSaprophilous y -> makeDictEncoder identity Jenc.int y
13161316
13171317 saxtenElement : Jdec.Decoder SaxtenElement
13181318 saxtenElement =
@@ -1446,7 +1446,7 @@ encodeScoffer : Scoffer -> Jenc.Value
14461446 encodeScoffer x = case x of
14471447 NullArrayInScoffer y -> Jenc.array (always Jenc.null) y
14481448 NullInScoffer -> Jenc.null
1449- IntegerMapInScoffer y -> Jenc.dict identity Jenc.int y
1449+ IntegerMapInScoffer y -> makeDictEncoder identity Jenc.int y
14501450
14511451 scrampum : Jdec.Decoder Scrampum
14521452 scrampum =
@@ -1632,7 +1632,7 @@ encodeStimulability : Stimulability -> Jenc.Value
16321632 encodeStimulability x = case x of
16331633 BoolInStimulability y -> Jenc.bool y
16341634 IntegerInStimulability y -> Jenc.int y
1635- IntegerMapInStimulability y -> Jenc.dict identity Jenc.int y
1635+ IntegerMapInStimulability y -> makeDictEncoder identity Jenc.int y
16361636
16371637 strangleable : Jdec.Decoder Strangleable
16381638 strangleable =
@@ -1852,7 +1852,7 @@ encodeUnbeginning : Unbeginning -> Jenc.Value
18521852 encodeUnbeginning x = case x of
18531853 NullArrayInUnbeginning y -> Jenc.array (always Jenc.null) y
18541854 StringInUnbeginning y -> Jenc.string y
1855- IntegerMapInUnbeginning y -> Jenc.dict identity Jenc.int y
1855+ IntegerMapInUnbeginning y -> makeDictEncoder identity Jenc.int y
18561856
18571857 undesirability : Jdec.Decoder Undesirability
18581858 undesirability =
@@ -1866,7 +1866,7 @@ encodeUndesirability : Undesirability -> Jenc.Value
18661866 encodeUndesirability x = case x of
18671867 IntegerArrayInUndesirability y -> Jenc.array Jenc.int y
18681868 StringInUndesirability y -> Jenc.string y
1869- IntegerMapInUndesirability y -> Jenc.dict identity Jenc.int y
1869+ IntegerMapInUndesirability y -> makeDictEncoder identity Jenc.int y
18701870
18711871 unerasing : Jdec.Decoder Unerasing
18721872 unerasing =
@@ -1880,7 +1880,7 @@ encodeUnerasing : Unerasing -> Jenc.Value
18801880 encodeUnerasing x = case x of
18811881 NullArrayInUnerasing y -> Jenc.array (always Jenc.null) y
18821882 IntegerInUnerasing y -> Jenc.int y
1883- IntegerMapInUnerasing y -> Jenc.dict identity Jenc.int y
1883+ IntegerMapInUnerasing y -> makeDictEncoder identity Jenc.int y
18841884
18851885 unguentarium : Jdec.Decoder Unguentarium
18861886 unguentarium =
@@ -1979,7 +1979,7 @@ encodeUnmortgaged : Unmortgaged -> Jenc.Value
19791979 encodeUnmortgaged x = case x of
19801980 NullInUnmortgaged -> Jenc.null
19811981 DoubleInUnmortgaged y -> Jenc.float y
1982- IntegerMapInUnmortgaged y -> Jenc.dict identity Jenc.int y
1982+ IntegerMapInUnmortgaged y -> makeDictEncoder identity Jenc.int y
19831983
19841984 unobstructed : Jdec.Decoder Unobstructed
19851985 unobstructed =
@@ -2098,7 +2098,7 @@ encodeUntasked : Untasked -> Jenc.Value
20982098 encodeUntasked x = case x of
20992099 NullArrayInUntasked y -> Jenc.array (always Jenc.null) y
21002100 DoubleInUntasked y -> Jenc.float y
2101- IntegerMapInUntasked y -> Jenc.dict identity Jenc.int y
2101+ IntegerMapInUntasked y -> makeDictEncoder identity Jenc.int y
21022102
21032103 unvarying : Jdec.Decoder Unvarying
21042104 unvarying =
@@ -2112,7 +2112,7 @@ encodeUnvarying : Unvarying -> Jenc.Value
21122112 encodeUnvarying x = case x of
21132113 BoolInUnvarying y -> Jenc.bool y
21142114 DoubleInUnvarying y -> Jenc.float y
2115- IntegerMapInUnvarying y -> Jenc.dict identity Jenc.int y
2115+ IntegerMapInUnvarying y -> makeDictEncoder identity Jenc.int y
21162116
21172117 vehemently : Jdec.Decoder Vehemently
21182118 vehemently =
@@ -2203,6 +2203,14 @@ encodeWrothyClass x =
22032203
22042204 --- encoder helpers
22052205
2206+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
2207+makeDictEncoder f m r =
2208+ r
2209+ |> Dict.toList
2210+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
2211+ |> String.join ","
2212+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
2213+
22062214 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
22072215 makeNullableEncoder f m =
22082216 case m of
Melmdefault / QuickType.elm+19 −11
@@ -829,7 +829,7 @@ encodeQuickType x =
829829 , ("untasked", Jenc.list encodeUntasked x.untasked)
830830 , ("unvarying", Jenc.list encodeUnvarying x.unvarying)
831831 , ("vehemently", Jenc.list encodeVehemently x.vehemently)
832- , ("warriorship", Jenc.dict identity Jenc.bool x.warriorship)
832+ , ("warriorship", makeDictEncoder identity Jenc.bool x.warriorship)
833833 , ("whitepot", Jenc.list encodeWhitepot x.whitepot)
834834 , ("wrothy", Jenc.list encodeWrothyElement x.wrothy)
835835 ]
@@ -1013,7 +1013,7 @@ querier =
10131013 encodeQuerier : Querier -> Jenc.Value
10141014 encodeQuerier x = case x of
10151015 BoolInQuerier y -> Jenc.bool y
1016- IntegerMapInQuerier y -> Jenc.dict identity Jenc.int y
1016+ IntegerMapInQuerier y -> makeDictEncoder identity Jenc.int y
10171017
10181018 rebarbative : Jdec.Decoder Rebarbative
10191019 rebarbative =
@@ -1311,7 +1311,7 @@ encodeSaprophilous : Saprophilous -> Jenc.Value
13111311 encodeSaprophilous x = case x of
13121312 NullInSaprophilous -> Jenc.null
13131313 StringInSaprophilous y -> Jenc.string y
1314- IntegerMapInSaprophilous y -> Jenc.dict identity Jenc.int y
1314+ IntegerMapInSaprophilous y -> makeDictEncoder identity Jenc.int y
13151315
13161316 saxtenElement : Jdec.Decoder SaxtenElement
13171317 saxtenElement =
@@ -1445,7 +1445,7 @@ encodeScoffer : Scoffer -> Jenc.Value
14451445 encodeScoffer x = case x of
14461446 NullArrayInScoffer y -> Jenc.list (always Jenc.null) y
14471447 NullInScoffer -> Jenc.null
1448- IntegerMapInScoffer y -> Jenc.dict identity Jenc.int y
1448+ IntegerMapInScoffer y -> makeDictEncoder identity Jenc.int y
14491449
14501450 scrampum : Jdec.Decoder Scrampum
14511451 scrampum =
@@ -1631,7 +1631,7 @@ encodeStimulability : Stimulability -> Jenc.Value
16311631 encodeStimulability x = case x of
16321632 BoolInStimulability y -> Jenc.bool y
16331633 IntegerInStimulability y -> Jenc.int y
1634- IntegerMapInStimulability y -> Jenc.dict identity Jenc.int y
1634+ IntegerMapInStimulability y -> makeDictEncoder identity Jenc.int y
16351635
16361636 strangleable : Jdec.Decoder Strangleable
16371637 strangleable =
@@ -1851,7 +1851,7 @@ encodeUnbeginning : Unbeginning -> Jenc.Value
18511851 encodeUnbeginning x = case x of
18521852 NullArrayInUnbeginning y -> Jenc.list (always Jenc.null) y
18531853 StringInUnbeginning y -> Jenc.string y
1854- IntegerMapInUnbeginning y -> Jenc.dict identity Jenc.int y
1854+ IntegerMapInUnbeginning y -> makeDictEncoder identity Jenc.int y
18551855
18561856 undesirability : Jdec.Decoder Undesirability
18571857 undesirability =
@@ -1865,7 +1865,7 @@ encodeUndesirability : Undesirability -> Jenc.Value
18651865 encodeUndesirability x = case x of
18661866 IntegerArrayInUndesirability y -> Jenc.list Jenc.int y
18671867 StringInUndesirability y -> Jenc.string y
1868- IntegerMapInUndesirability y -> Jenc.dict identity Jenc.int y
1868+ IntegerMapInUndesirability y -> makeDictEncoder identity Jenc.int y
18691869
18701870 unerasing : Jdec.Decoder Unerasing
18711871 unerasing =
@@ -1879,7 +1879,7 @@ encodeUnerasing : Unerasing -> Jenc.Value
18791879 encodeUnerasing x = case x of
18801880 NullArrayInUnerasing y -> Jenc.list (always Jenc.null) y
18811881 IntegerInUnerasing y -> Jenc.int y
1882- IntegerMapInUnerasing y -> Jenc.dict identity Jenc.int y
1882+ IntegerMapInUnerasing y -> makeDictEncoder identity Jenc.int y
18831883
18841884 unguentarium : Jdec.Decoder Unguentarium
18851885 unguentarium =
@@ -1978,7 +1978,7 @@ encodeUnmortgaged : Unmortgaged -> Jenc.Value
19781978 encodeUnmortgaged x = case x of
19791979 NullInUnmortgaged -> Jenc.null
19801980 DoubleInUnmortgaged y -> Jenc.float y
1981- IntegerMapInUnmortgaged y -> Jenc.dict identity Jenc.int y
1981+ IntegerMapInUnmortgaged y -> makeDictEncoder identity Jenc.int y
19821982
19831983 unobstructed : Jdec.Decoder Unobstructed
19841984 unobstructed =
@@ -2097,7 +2097,7 @@ encodeUntasked : Untasked -> Jenc.Value
20972097 encodeUntasked x = case x of
20982098 NullArrayInUntasked y -> Jenc.list (always Jenc.null) y
20992099 DoubleInUntasked y -> Jenc.float y
2100- IntegerMapInUntasked y -> Jenc.dict identity Jenc.int y
2100+ IntegerMapInUntasked y -> makeDictEncoder identity Jenc.int y
21012101
21022102 unvarying : Jdec.Decoder Unvarying
21032103 unvarying =
@@ -2111,7 +2111,7 @@ encodeUnvarying : Unvarying -> Jenc.Value
21112111 encodeUnvarying x = case x of
21122112 BoolInUnvarying y -> Jenc.bool y
21132113 DoubleInUnvarying y -> Jenc.float y
2114- IntegerMapInUnvarying y -> Jenc.dict identity Jenc.int y
2114+ IntegerMapInUnvarying y -> makeDictEncoder identity Jenc.int y
21152115
21162116 vehemently : Jdec.Decoder Vehemently
21172117 vehemently =
@@ -2202,6 +2202,14 @@ encodeWrothyClass x =
22022202
22032203 --- encoder helpers
22042204
2205+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
2206+makeDictEncoder f m r =
2207+ r
2208+ |> Dict.toList
2209+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
2210+ |> String.join ","
2211+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
2212+
22052213 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
22062214 makeNullableEncoder f m =
22072215 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = val[key];
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
@@ -753,7 +753,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
753753 if (val === null || typeof val !== "object" || Array.isArray(val)) {
754754 return invalidValue(l(ref || "object"), val, key, parent);
755755 }
756- const result: any = {};
756+ const result: any = Object.create(null);
757757 Object.getOwnPropertyNames(props).forEach(key => {
758758 const prop = props[key];
759759 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -764,7 +764,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
764764 result[key] = transform(val[key], additional, getProps, key, ref);
765765 }
766766 });
767- return result;
767+ return Object.setPrototypeOf(result, Object.prototype);
768768 }
769769
770770 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+13 −13
@@ -57,7 +57,7 @@ export interface TopLevel {
5757 readonly untasked: Untasked[];
5858 readonly unvarying: Unvarying[];
5959 readonly vehemently: Vehemently[];
60- readonly warriorship: { [key: string]: boolean };
60+ readonly warriorship: { readonly [key: string]: boolean };
6161 readonly whitepot: Whitepot[];
6262 readonly wrothy: WrothyElement[];
6363 }
@@ -124,7 +124,7 @@ export interface QuebrachineClass {
124124 readonly nonbookish: null;
125125 }
126126
127-export type Querier = boolean | { [key: string]: number };
127+export type Querier = boolean | { readonly [key: string]: number };
128128
129129 export type Rebarbative = number[] | boolean | number;
130130
@@ -235,7 +235,7 @@ export interface SantirClass {
235235 readonly vorticular: null;
236236 }
237237
238-export type Saprophilous = { [key: string]: number } | null | string;
238+export type Saprophilous = { readonly [key: string]: number } | null | string;
239239
240240 export type SaxtenElement = SaxtenClass | string;
241241
@@ -290,7 +290,7 @@ export interface Scatty {
290290 readonly uncombated: null;
291291 }
292292
293-export type Scoffer = null[] | { [key: string]: number } | null;
293+export type Scoffer = null[] | { readonly [key: string]: number } | null;
294294
295295 export type Scrampum = number[] | boolean | null;
296296
@@ -353,7 +353,7 @@ export interface Staghunting {
353353
354354 export type Stagmometer = (number | null)[] | string;
355355
356-export type Stimulability = boolean | number | { [key: string]: number };
356+export type Stimulability = boolean | number | { readonly [key: string]: number };
357357
358358 export type Strangleable = null[] | number;
359359
@@ -425,11 +425,11 @@ export interface TruantcyClass {
425425 readonly windwaywardly?: null;
426426 }
427427
428-export type Unbeginning = null[] | { [key: string]: number } | string;
428+export type Unbeginning = null[] | { readonly [key: string]: number } | string;
429429
430-export type Undesirability = number[] | { [key: string]: number } | string;
430+export type Undesirability = number[] | { readonly [key: string]: number } | string;
431431
432-export type Unerasing = null[] | number | { [key: string]: number };
432+export type Unerasing = null[] | number | { readonly [key: string]: number };
433433
434434 export type Unguentarium = null[] | number | null;
435435
@@ -463,7 +463,7 @@ export interface UnimpeachablyClass {
463463 readonly unsuggestedness?: number;
464464 }
465465
466-export type Unmortgaged = number | { [key: string]: number } | null;
466+export type Unmortgaged = number | { readonly [key: string]: number } | null;
467467
468468 export type Unobstructed = QuebrachineClass | number | null;
469469
@@ -496,9 +496,9 @@ export interface UnstressedClass {
496496 readonly vowellessness: null;
497497 }
498498
499-export type Untasked = null[] | number | { [key: string]: number };
499+export type Untasked = null[] | number | { readonly [key: string]: number };
500500
501-export type Unvarying = boolean | number | { [key: string]: number };
501+export type Unvarying = boolean | number | { readonly [key: string]: number };
502502
503503 export type Vehemently = null[] | boolean | null;
504504
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
636636 result[key] = val[key];
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Test case

test/inputs/json/priority/combined-enum.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/priority/direct-recursive.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/empty-enum.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/identifiers.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Test case

test/inputs/json/priority/issue2680-object-array.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/priority/issue2680-scalar-array.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/json/priority/keywords.json

62 generated files · +7,994 −4,394
Mcjsondefault / TopLevel.c+577 −317
@@ -6483,6 +6483,61 @@ void cJSON_DeleteFrom(struct From * x) {
64836483 }
64846484 }
64856485
6486+struct FromDict * cJSON_ParseFromDict(const char * s) {
6487+ struct FromDict * x = NULL;
6488+ if (NULL != s) {
6489+ cJSON * j = cJSON_Parse(s);
6490+ if (NULL != j) {
6491+ x = cJSON_GetFromDictValue(j);
6492+ cJSON_Delete(j);
6493+ }
6494+ }
6495+ return x;
6496+}
6497+
6498+struct FromDict * cJSON_GetFromDictValue(const cJSON * j) {
6499+ struct FromDict * x = NULL;
6500+ if (NULL != j) {
6501+ if (NULL != (x = cJSON_malloc(sizeof(struct FromDict)))) {
6502+ memset(x, 0, sizeof(struct FromDict));
6503+ if (!cJSON_HasObjectItem(j, "from_dict")) { cJSON_DeleteFromDict(x); return NULL; }
6504+ if (cJSON_HasObjectItem(j, "from_dict")) {
6505+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "from_dict"))) { cJSON_DeleteFromDict(x); return NULL; }
6506+ x->from_dict = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "from_dict"));
6507+ }
6508+ }
6509+ }
6510+ return x;
6511+}
6512+
6513+cJSON * cJSON_CreateFromDict(const struct FromDict * x) {
6514+ cJSON * j = NULL;
6515+ if (NULL != x) {
6516+ if (NULL != (j = cJSON_CreateObject())) {
6517+ cJSON_AddNumberToObject(j, "from_dict", x->from_dict);
6518+ }
6519+ }
6520+ return j;
6521+}
6522+
6523+char * cJSON_PrintFromDict(const struct FromDict * x) {
6524+ char * s = NULL;
6525+ if (NULL != x) {
6526+ cJSON * j = cJSON_CreateFromDict(x);
6527+ if (NULL != j) {
6528+ s = cJSON_Print(j);
6529+ cJSON_Delete(j);
6530+ }
6531+ }
6532+ return s;
6533+}
6534+
6535+void cJSON_DeleteFromDict(struct FromDict * x) {
6536+ if (NULL != x) {
6537+ cJSON_free(x);
6538+ }
6539+}
6540+
64866541 struct FromJson * cJSON_ParseFromJson(const char * s) {
64876542 struct FromJson * x = NULL;
64886543 if (NULL != s) {
@@ -7693,61 +7748,6 @@ void cJSON_DeleteFriend(struct Friend * x) {
76937748 }
76947749 }
76957750
7696-struct Goto * cJSON_ParseGoto(const char * s) {
7697- struct Goto * x = NULL;
7698- if (NULL != s) {
7699- cJSON * j = cJSON_Parse(s);
7700- if (NULL != j) {
7701- x = cJSON_GetGotoValue(j);
7702- cJSON_Delete(j);
7703- }
7704- }
7705- return x;
7706-}
7707-
7708-struct Goto * cJSON_GetGotoValue(const cJSON * j) {
7709- struct Goto * x = NULL;
7710- if (NULL != j) {
7711- if (NULL != (x = cJSON_malloc(sizeof(struct Goto)))) {
7712- memset(x, 0, sizeof(struct Goto));
7713- if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteGoto(x); return NULL; }
7714- if (cJSON_HasObjectItem(j, "goto")) {
7715- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteGoto(x); return NULL; }
7716- x->goto_goto = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "goto"));
7717- }
7718- }
7719- }
7720- return x;
7721-}
7722-
7723-cJSON * cJSON_CreateGoto(const struct Goto * x) {
7724- cJSON * j = NULL;
7725- if (NULL != x) {
7726- if (NULL != (j = cJSON_CreateObject())) {
7727- cJSON_AddNumberToObject(j, "goto", x->goto_goto);
7728- }
7729- }
7730- return j;
7731-}
7732-
7733-char * cJSON_PrintGoto(const struct Goto * x) {
7734- char * s = NULL;
7735- if (NULL != x) {
7736- cJSON * j = cJSON_CreateGoto(x);
7737- if (NULL != j) {
7738- s = cJSON_Print(j);
7739- cJSON_Delete(j);
7740- }
7741- }
7742- return s;
7743-}
7744-
7745-void cJSON_DeleteGoto(struct Goto * x) {
7746- if (NULL != x) {
7747- cJSON_free(x);
7748- }
7749-}
7750-
77517751 struct Obj2False * cJSON_ParseObj2False(const char * s) {
77527752 struct Obj2False * x = NULL;
77537753 if (NULL != s) {
@@ -8065,6 +8065,12 @@ struct Obj2 * cJSON_GetObj2Value(const cJSON * j) {
80658065 x->from = cJSON_GetFromValue(cJSON_GetObjectItemCaseSensitive(j, "from"));
80668066 if (NULL == x->from) { cJSON_DeleteObj2(x); return NULL; }
80678067 }
8068+ if (!cJSON_HasObjectItem(j, "from_dict")) { cJSON_DeleteObj2(x); return NULL; }
8069+ if (cJSON_HasObjectItem(j, "from_dict")) {
8070+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "from_dict"))) { cJSON_DeleteObj2(x); return NULL; }
8071+ x->from_dict = cJSON_GetFromDictValue(cJSON_GetObjectItemCaseSensitive(j, "from_dict"));
8072+ if (NULL == x->from_dict) { cJSON_DeleteObj2(x); return NULL; }
8073+ }
80688074 if (!cJSON_HasObjectItem(j, "from_json")) { cJSON_DeleteObj2(x); return NULL; }
80698075 if (cJSON_HasObjectItem(j, "from_json")) {
80708076 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "from_json"))) { cJSON_DeleteObj2(x); return NULL; }
@@ -8197,12 +8203,6 @@ struct Obj2 * cJSON_GetObj2Value(const cJSON * j) {
81978203 x->obj2_friend = cJSON_GetFriendValue(cJSON_GetObjectItemCaseSensitive(j, "friend"));
81988204 if (NULL == x->obj2_friend) { cJSON_DeleteObj2(x); return NULL; }
81998205 }
8200- if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteObj2(x); return NULL; }
8201- if (cJSON_HasObjectItem(j, "goto")) {
8202- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteObj2(x); return NULL; }
8203- x->obj2_goto = cJSON_GetGotoValue(cJSON_GetObjectItemCaseSensitive(j, "goto"));
8204- if (NULL == x->obj2_goto) { cJSON_DeleteObj2(x); return NULL; }
8205- }
82068206 if (!cJSON_HasObjectItem(j, "false")) { cJSON_DeleteObj2(x); return NULL; }
82078207 if (cJSON_HasObjectItem(j, "false")) {
82088208 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "false"))) { cJSON_DeleteObj2(x); return NULL; }
@@ -8259,6 +8259,7 @@ cJSON * cJSON_CreateObj2(const struct Obj2 * x) {
82598259 cJSON_AddItemToObject(j, "foreach", cJSON_CreateForeach(x->foreach));
82608260 cJSON_AddItemToObject(j, "FormatException", cJSON_CreateFormatException(x->format_exception));
82618261 cJSON_AddItemToObject(j, "from", cJSON_CreateFrom(x->from));
8262+ cJSON_AddItemToObject(j, "from_dict", cJSON_CreateFromDict(x->from_dict));
82628263 cJSON_AddItemToObject(j, "from_json", cJSON_CreateFromJson(x->from_json));
82638264 cJSON_AddItemToObject(j, "func", cJSON_CreateFunc(x->func));
82648265 cJSON_AddItemToObject(j, "function", cJSON_CreateFunction(x->function));
@@ -8281,7 +8282,6 @@ cJSON * cJSON_CreateObj2(const struct Obj2 * x) {
82818282 cJSON_AddItemToObject(j, "float", cJSON_CreateFloat(x->obj2_float));
82828283 cJSON_AddItemToObject(j, "for", cJSON_CreateFor(x->obj2_for));
82838284 cJSON_AddItemToObject(j, "friend", cJSON_CreateFriend(x->obj2_friend));
8284- cJSON_AddItemToObject(j, "goto", cJSON_CreateGoto(x->obj2_goto));
82858285 cJSON_AddItemToObject(j, "false", cJSON_CreateObj2False(x->purple_false));
82868286 }
82878287 }
@@ -8422,6 +8422,9 @@ void cJSON_DeleteObj2(struct Obj2 * x) {
84228422 if (NULL != x->from) {
84238423 cJSON_DeleteFrom(x->from);
84248424 }
8425+ if (NULL != x->from_dict) {
8426+ cJSON_DeleteFromDict(x->from_dict);
8427+ }
84258428 if (NULL != x->from_json) {
84268429 cJSON_DeleteFromJson(x->from_json);
84278430 }
@@ -8488,9 +8491,6 @@ void cJSON_DeleteObj2(struct Obj2 * x) {
84888491 if (NULL != x->obj2_friend) {
84898492 cJSON_DeleteFriend(x->obj2_friend);
84908493 }
8491- if (NULL != x->obj2_goto) {
8492- cJSON_DeleteGoto(x->obj2_goto);
8493- }
84948494 if (NULL != x->purple_false) {
84958495 cJSON_DeleteObj2False(x->purple_false);
84968496 }
@@ -11141,6 +11141,61 @@ void cJSON_DeleteMapEntry(struct MapEntry * x) {
1114111141 }
1114211142 }
1114311143
11144+struct MarshalJson * cJSON_ParseMarshalJson(const char * s) {
11145+ struct MarshalJson * x = NULL;
11146+ if (NULL != s) {
11147+ cJSON * j = cJSON_Parse(s);
11148+ if (NULL != j) {
11149+ x = cJSON_GetMarshalJsonValue(j);
11150+ cJSON_Delete(j);
11151+ }
11152+ }
11153+ return x;
11154+}
11155+
11156+struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j) {
11157+ struct MarshalJson * x = NULL;
11158+ if (NULL != j) {
11159+ if (NULL != (x = cJSON_malloc(sizeof(struct MarshalJson)))) {
11160+ memset(x, 0, sizeof(struct MarshalJson));
11161+ if (!cJSON_HasObjectItem(j, "MarshalJSON")) { cJSON_DeleteMarshalJson(x); return NULL; }
11162+ if (cJSON_HasObjectItem(j, "MarshalJSON")) {
11163+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"))) { cJSON_DeleteMarshalJson(x); return NULL; }
11164+ x->marshal_json = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"));
11165+ }
11166+ }
11167+ }
11168+ return x;
11169+}
11170+
11171+cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x) {
11172+ cJSON * j = NULL;
11173+ if (NULL != x) {
11174+ if (NULL != (j = cJSON_CreateObject())) {
11175+ cJSON_AddNumberToObject(j, "MarshalJSON", x->marshal_json);
11176+ }
11177+ }
11178+ return j;
11179+}
11180+
11181+char * cJSON_PrintMarshalJson(const struct MarshalJson * x) {
11182+ char * s = NULL;
11183+ if (NULL != x) {
11184+ cJSON * j = cJSON_CreateMarshalJson(x);
11185+ if (NULL != j) {
11186+ s = cJSON_Print(j);
11187+ cJSON_Delete(j);
11188+ }
11189+ }
11190+ return s;
11191+}
11192+
11193+void cJSON_DeleteMarshalJson(struct MarshalJson * x) {
11194+ if (NULL != x) {
11195+ cJSON_free(x);
11196+ }
11197+}
11198+
1114411199 struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s) {
1114511200 struct MetadataPropertyHandling * x = NULL;
1114611201 if (NULL != s) {
@@ -11471,6 +11526,61 @@ void cJSON_DeleteNo(struct No * x) {
1147111526 }
1147211527 }
1147311528
11529+struct Goto * cJSON_ParseGoto(const char * s) {
11530+ struct Goto * x = NULL;
11531+ if (NULL != s) {
11532+ cJSON * j = cJSON_Parse(s);
11533+ if (NULL != j) {
11534+ x = cJSON_GetGotoValue(j);
11535+ cJSON_Delete(j);
11536+ }
11537+ }
11538+ return x;
11539+}
11540+
11541+struct Goto * cJSON_GetGotoValue(const cJSON * j) {
11542+ struct Goto * x = NULL;
11543+ if (NULL != j) {
11544+ if (NULL != (x = cJSON_malloc(sizeof(struct Goto)))) {
11545+ memset(x, 0, sizeof(struct Goto));
11546+ if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteGoto(x); return NULL; }
11547+ if (cJSON_HasObjectItem(j, "goto")) {
11548+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteGoto(x); return NULL; }
11549+ x->goto_goto = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "goto"));
11550+ }
11551+ }
11552+ }
11553+ return x;
11554+}
11555+
11556+cJSON * cJSON_CreateGoto(const struct Goto * x) {
11557+ cJSON * j = NULL;
11558+ if (NULL != x) {
11559+ if (NULL != (j = cJSON_CreateObject())) {
11560+ cJSON_AddNumberToObject(j, "goto", x->goto_goto);
11561+ }
11562+ }
11563+ return j;
11564+}
11565+
11566+char * cJSON_PrintGoto(const struct Goto * x) {
11567+ char * s = NULL;
11568+ if (NULL != x) {
11569+ cJSON * j = cJSON_CreateGoto(x);
11570+ if (NULL != j) {
11571+ s = cJSON_Print(j);
11572+ cJSON_Delete(j);
11573+ }
11574+ }
11575+ return s;
11576+}
11577+
11578+void cJSON_DeleteGoto(struct Goto * x) {
11579+ if (NULL != x) {
11580+ cJSON_free(x);
11581+ }
11582+}
11583+
1147411584 struct If * cJSON_ParseIf(const char * s) {
1147511585 struct If * x = NULL;
1147611586 if (NULL != s) {
@@ -11966,61 +12076,6 @@ void cJSON_DeleteNew(struct New * x) {
1196612076 }
1196712077 }
1196812078
11969-struct Noexcept * cJSON_ParseNoexcept(const char * s) {
11970- struct Noexcept * x = NULL;
11971- if (NULL != s) {
11972- cJSON * j = cJSON_Parse(s);
11973- if (NULL != j) {
11974- x = cJSON_GetNoexceptValue(j);
11975- cJSON_Delete(j);
11976- }
11977- }
11978- return x;
11979-}
11980-
11981-struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j) {
11982- struct Noexcept * x = NULL;
11983- if (NULL != j) {
11984- if (NULL != (x = cJSON_malloc(sizeof(struct Noexcept)))) {
11985- memset(x, 0, sizeof(struct Noexcept));
11986- if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteNoexcept(x); return NULL; }
11987- if (cJSON_HasObjectItem(j, "noexcept")) {
11988- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteNoexcept(x); return NULL; }
11989- x->noexcept_noexcept = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept"));
11990- }
11991- }
11992- }
11993- return x;
11994-}
11995-
11996-cJSON * cJSON_CreateNoexcept(const struct Noexcept * x) {
11997- cJSON * j = NULL;
11998- if (NULL != x) {
11999- if (NULL != (j = cJSON_CreateObject())) {
12000- cJSON_AddNumberToObject(j, "noexcept", x->noexcept_noexcept);
12001- }
12002- }
12003- return j;
12004-}
12005-
12006-char * cJSON_PrintNoexcept(const struct Noexcept * x) {
12007- char * s = NULL;
12008- if (NULL != x) {
12009- cJSON * j = cJSON_CreateNoexcept(x);
12010- if (NULL != j) {
12011- s = cJSON_Print(j);
12012- cJSON_Delete(j);
12013- }
12014- }
12015- return s;
12016-}
12017-
12018-void cJSON_DeleteNoexcept(struct Noexcept * x) {
12019- if (NULL != x) {
12020- cJSON_free(x);
12021- }
12022-}
12023-
1202412079 struct Obj3 * cJSON_ParseObj3(const char * s) {
1202512080 struct Obj3 * x = NULL;
1202612081 if (NULL != s) {
@@ -12331,6 +12386,12 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) {
1233112386 x->map_entry = cJSON_GetMapEntryValue(cJSON_GetObjectItemCaseSensitive(j, "MapEntry"));
1233212387 if (NULL == x->map_entry) { cJSON_DeleteObj3(x); return NULL; }
1233312388 }
12389+ if (!cJSON_HasObjectItem(j, "MarshalJSON")) { cJSON_DeleteObj3(x); return NULL; }
12390+ if (cJSON_HasObjectItem(j, "MarshalJSON")) {
12391+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"))) { cJSON_DeleteObj3(x); return NULL; }
12392+ x->marshal_json = cJSON_GetMarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"));
12393+ if (NULL == x->marshal_json) { cJSON_DeleteObj3(x); return NULL; }
12394+ }
1233412395 if (!cJSON_HasObjectItem(j, "metadata_property_handling")) { cJSON_DeleteObj3(x); return NULL; }
1233512396 if (cJSON_HasObjectItem(j, "metadata_property_handling")) {
1233612397 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "metadata_property_handling"))) { cJSON_DeleteObj3(x); return NULL; }
@@ -12367,6 +12428,12 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) {
1236712428 x->no = cJSON_GetNoValue(cJSON_GetObjectItemCaseSensitive(j, "NO"));
1236812429 if (NULL == x->no) { cJSON_DeleteObj3(x); return NULL; }
1236912430 }
12431+ if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteObj3(x); return NULL; }
12432+ if (cJSON_HasObjectItem(j, "goto")) {
12433+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteObj3(x); return NULL; }
12434+ x->obj3_goto = cJSON_GetGotoValue(cJSON_GetObjectItemCaseSensitive(j, "goto"));
12435+ if (NULL == x->obj3_goto) { cJSON_DeleteObj3(x); return NULL; }
12436+ }
1237012437 if (!cJSON_HasObjectItem(j, "if")) { cJSON_DeleteObj3(x); return NULL; }
1237112438 if (cJSON_HasObjectItem(j, "if")) {
1237212439 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "if"))) { cJSON_DeleteObj3(x); return NULL; }
@@ -12421,12 +12488,6 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) {
1242112488 x->obj3_new = cJSON_GetNewValue(cJSON_GetObjectItemCaseSensitive(j, "new"));
1242212489 if (NULL == x->obj3_new) { cJSON_DeleteObj3(x); return NULL; }
1242312490 }
12424- if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteObj3(x); return NULL; }
12425- if (cJSON_HasObjectItem(j, "noexcept")) {
12426- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteObj3(x); return NULL; }
12427- x->obj3_noexcept = cJSON_GetNoexceptValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept"));
12428- if (NULL == x->obj3_noexcept) { cJSON_DeleteObj3(x); return NULL; }
12429- }
1243012491 }
1243112492 }
1243212493 return x;
@@ -12485,12 +12546,14 @@ cJSON * cJSON_CreateObj3(const struct Obj3 * x) {
1248512546 cJSON_AddItemToObject(j, "lock", cJSON_CreateLock(x->lock));
1248612547 cJSON_AddItemToObject(j, "map", cJSON_CreateMap(x->map));
1248712548 cJSON_AddItemToObject(j, "MapEntry", cJSON_CreateMapEntry(x->map_entry));
12549+ cJSON_AddItemToObject(j, "MarshalJSON", cJSON_CreateMarshalJson(x->marshal_json));
1248812550 cJSON_AddItemToObject(j, "metadata_property_handling", cJSON_CreateMetadataPropertyHandling(x->metadata_property_handling));
1248912551 cJSON_AddItemToObject(j, "mutating", cJSON_CreateMutating(x->mutating));
1249012552 cJSON_AddItemToObject(j, "native", cJSON_CreateNative(x->native));
1249112553 cJSON_AddItemToObject(j, "newtonsoft", cJSON_CreateNewtonsoft(x->newtonsoft));
1249212554 cJSON_AddItemToObject(j, "nil", cJSON_CreateNil(x->nil));
1249312555 cJSON_AddItemToObject(j, "NO", cJSON_CreateNo(x->no));
12556+ cJSON_AddItemToObject(j, "goto", cJSON_CreateGoto(x->obj3_goto));
1249412557 cJSON_AddItemToObject(j, "if", cJSON_CreateIf(x->obj3_if));
1249512558 cJSON_AddItemToObject(j, "import", cJSON_CreateImport(x->obj3_import));
1249612559 cJSON_AddItemToObject(j, "inline", cJSON_CreateInline(x->obj3_inline));
@@ -12500,7 +12563,6 @@ cJSON * cJSON_CreateObj3(const struct Obj3 * x) {
1250012563 cJSON_AddItemToObject(j, "mutable", cJSON_CreateMutable(x->obj3_mutable));
1250112564 cJSON_AddItemToObject(j, "namespace", cJSON_CreateNamespace(x->obj3_namespace));
1250212565 cJSON_AddItemToObject(j, "new", cJSON_CreateNew(x->obj3_new));
12503- cJSON_AddItemToObject(j, "noexcept", cJSON_CreateNoexcept(x->obj3_noexcept));
1250412566 }
1250512567 }
1250612568 return j;
@@ -12664,6 +12726,9 @@ void cJSON_DeleteObj3(struct Obj3 * x) {
1266412726 if (NULL != x->map_entry) {
1266512727 cJSON_DeleteMapEntry(x->map_entry);
1266612728 }
12729+ if (NULL != x->marshal_json) {
12730+ cJSON_DeleteMarshalJson(x->marshal_json);
12731+ }
1266712732 if (NULL != x->metadata_property_handling) {
1266812733 cJSON_DeleteMetadataPropertyHandling(x->metadata_property_handling);
1266912734 }
@@ -12682,6 +12747,9 @@ void cJSON_DeleteObj3(struct Obj3 * x) {
1268212747 if (NULL != x->no) {
1268312748 cJSON_DeleteNo(x->no);
1268412749 }
12750+ if (NULL != x->obj3_goto) {
12751+ cJSON_DeleteGoto(x->obj3_goto);
12752+ }
1268512753 if (NULL != x->obj3_if) {
1268612754 cJSON_DeleteIf(x->obj3_if);
1268712755 }
@@ -12709,9 +12777,6 @@ void cJSON_DeleteObj3(struct Obj3 * x) {
1270912777 if (NULL != x->obj3_new) {
1271012778 cJSON_DeleteNew(x->obj3_new);
1271112779 }
12712- if (NULL != x->obj3_noexcept) {
12713- cJSON_DeleteNoexcept(x->obj3_noexcept);
12714- }
1271512780 cJSON_free(x);
1271612781 }
1271712782 }
@@ -13266,6 +13331,61 @@ void cJSON_DeleteNumberClass(struct NumberClass * x) {
1326613331 }
1326713332 }
1326813333
13334+struct Noexcept * cJSON_ParseNoexcept(const char * s) {
13335+ struct Noexcept * x = NULL;
13336+ if (NULL != s) {
13337+ cJSON * j = cJSON_Parse(s);
13338+ if (NULL != j) {
13339+ x = cJSON_GetNoexceptValue(j);
13340+ cJSON_Delete(j);
13341+ }
13342+ }
13343+ return x;
13344+}
13345+
13346+struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j) {
13347+ struct Noexcept * x = NULL;
13348+ if (NULL != j) {
13349+ if (NULL != (x = cJSON_malloc(sizeof(struct Noexcept)))) {
13350+ memset(x, 0, sizeof(struct Noexcept));
13351+ if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteNoexcept(x); return NULL; }
13352+ if (cJSON_HasObjectItem(j, "noexcept")) {
13353+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteNoexcept(x); return NULL; }
13354+ x->noexcept_noexcept = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept"));
13355+ }
13356+ }
13357+ }
13358+ return x;
13359+}
13360+
13361+cJSON * cJSON_CreateNoexcept(const struct Noexcept * x) {
13362+ cJSON * j = NULL;
13363+ if (NULL != x) {
13364+ if (NULL != (j = cJSON_CreateObject())) {
13365+ cJSON_AddNumberToObject(j, "noexcept", x->noexcept_noexcept);
13366+ }
13367+ }
13368+ return j;
13369+}
13370+
13371+char * cJSON_PrintNoexcept(const struct Noexcept * x) {
13372+ char * s = NULL;
13373+ if (NULL != x) {
13374+ cJSON * j = cJSON_CreateNoexcept(x);
13375+ if (NULL != j) {
13376+ s = cJSON_Print(j);
13377+ cJSON_Delete(j);
13378+ }
13379+ }
13380+ return s;
13381+}
13382+
13383+void cJSON_DeleteNoexcept(struct Noexcept * x) {
13384+ if (NULL != x) {
13385+ cJSON_free(x);
13386+ }
13387+}
13388+
1326913389 struct NoneClass * cJSON_ParseNoneClass(const char * s) {
1327013390 struct NoneClass * x = NULL;
1327113391 if (NULL != s) {
@@ -16194,61 +16314,6 @@ void cJSON_DeleteSel(struct Sel * x) {
1619416314 }
1619516315 }
1619616316
16197-struct Select * cJSON_ParseSelect(const char * s) {
16198- struct Select * x = NULL;
16199- if (NULL != s) {
16200- cJSON * j = cJSON_Parse(s);
16201- if (NULL != j) {
16202- x = cJSON_GetSelectValue(j);
16203- cJSON_Delete(j);
16204- }
16205- }
16206- return x;
16207-}
16208-
16209-struct Select * cJSON_GetSelectValue(const cJSON * j) {
16210- struct Select * x = NULL;
16211- if (NULL != j) {
16212- if (NULL != (x = cJSON_malloc(sizeof(struct Select)))) {
16213- memset(x, 0, sizeof(struct Select));
16214- if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteSelect(x); return NULL; }
16215- if (cJSON_HasObjectItem(j, "select")) {
16216- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteSelect(x); return NULL; }
16217- x->select = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "select"));
16218- }
16219- }
16220- }
16221- return x;
16222-}
16223-
16224-cJSON * cJSON_CreateSelect(const struct Select * x) {
16225- cJSON * j = NULL;
16226- if (NULL != x) {
16227- if (NULL != (j = cJSON_CreateObject())) {
16228- cJSON_AddNumberToObject(j, "select", x->select);
16229- }
16230- }
16231- return j;
16232-}
16233-
16234-char * cJSON_PrintSelect(const struct Select * x) {
16235- char * s = NULL;
16236- if (NULL != x) {
16237- cJSON * j = cJSON_CreateSelect(x);
16238- if (NULL != j) {
16239- s = cJSON_Print(j);
16240- cJSON_Delete(j);
16241- }
16242- }
16243- return s;
16244-}
16245-
16246-void cJSON_DeleteSelect(struct Select * x) {
16247- if (NULL != x) {
16248- cJSON_free(x);
16249- }
16250-}
16251-
1625216317 struct Obj4 * cJSON_ParseObj4(const char * s) {
1625316318 struct Obj4 * x = NULL;
1625416319 if (NULL != s) {
@@ -16331,6 +16396,12 @@ struct Obj4 * cJSON_GetObj4Value(const cJSON * j) {
1633116396 x->number = cJSON_GetNumberClassValue(cJSON_GetObjectItemCaseSensitive(j, "number"));
1633216397 if (NULL == x->number) { cJSON_DeleteObj4(x); return NULL; }
1633316398 }
16399+ if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteObj4(x); return NULL; }
16400+ if (cJSON_HasObjectItem(j, "noexcept")) {
16401+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteObj4(x); return NULL; }
16402+ x->obj4_noexcept = cJSON_GetNoexceptValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept"));
16403+ if (NULL == x->obj4_noexcept) { cJSON_DeleteObj4(x); return NULL; }
16404+ }
1633416405 if (!cJSON_HasObjectItem(j, "none")) { cJSON_DeleteObj4(x); return NULL; }
1633516406 if (cJSON_HasObjectItem(j, "none")) {
1633616407 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "none"))) { cJSON_DeleteObj4(x); return NULL; }
@@ -16649,12 +16720,6 @@ struct Obj4 * cJSON_GetObj4Value(const cJSON * j) {
1664916720 x->sel = cJSON_GetSelValue(cJSON_GetObjectItemCaseSensitive(j, "SEL"));
1665016721 if (NULL == x->sel) { cJSON_DeleteObj4(x); return NULL; }
1665116722 }
16652- if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteObj4(x); return NULL; }
16653- if (cJSON_HasObjectItem(j, "select")) {
16654- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteObj4(x); return NULL; }
16655- x->select = cJSON_GetSelectValue(cJSON_GetObjectItemCaseSensitive(j, "select"));
16656- if (NULL == x->select) { cJSON_DeleteObj4(x); return NULL; }
16657- }
1665816723 }
1665916724 }
1666016725 return x;
@@ -16675,6 +16740,7 @@ cJSON * cJSON_CreateObj4(const struct Obj4 * x) {
1667516740 cJSON_AddItemToObject(j, "NSString", cJSON_CreateNsString(x->ns_string));
1667616741 cJSON_AddItemToObject(j, "NULL", cJSON_CreateNullClass(x->null));
1667716742 cJSON_AddItemToObject(j, "number", cJSON_CreateNumberClass(x->number));
16743+ cJSON_AddItemToObject(j, "noexcept", cJSON_CreateNoexcept(x->obj4_noexcept));
1667816744 cJSON_AddItemToObject(j, "none", cJSON_CreateNoneClass(x->obj4_none));
1667916745 cJSON_AddItemToObject(j, "not", cJSON_CreateNot(x->obj4_not));
1668016746 cJSON_AddItemToObject(j, "not_eq", cJSON_CreateNotEq(x->obj4_not_eq));
@@ -16728,7 +16794,6 @@ cJSON * cJSON_CreateObj4(const struct Obj4 * x) {
1672816794 cJSON_AddItemToObject(j, "sbyte", cJSON_CreateSbyte(x->sbyte));
1672916795 cJSON_AddItemToObject(j, "sealed", cJSON_CreateSealed(x->sealed));
1673016796 cJSON_AddItemToObject(j, "SEL", cJSON_CreateSel(x->sel));
16731- cJSON_AddItemToObject(j, "select", cJSON_CreateSelect(x->select));
1673216797 }
1673316798 }
1673416799 return j;
@@ -16778,6 +16843,9 @@ void cJSON_DeleteObj4(struct Obj4 * x) {
1677816843 if (NULL != x->number) {
1677916844 cJSON_DeleteNumberClass(x->number);
1678016845 }
16846+ if (NULL != x->obj4_noexcept) {
16847+ cJSON_DeleteNoexcept(x->obj4_noexcept);
16848+ }
1678116849 if (NULL != x->obj4_none) {
1678216850 cJSON_DeleteNoneClass(x->obj4_none);
1678316851 }
@@ -16937,9 +17005,6 @@ void cJSON_DeleteObj4(struct Obj4 * x) {
1693717005 if (NULL != x->sel) {
1693817006 cJSON_DeleteSel(x->sel);
1693917007 }
16940- if (NULL != x->select) {
16941- cJSON_DeleteSelect(x->select);
16942- }
1694317008 cJSON_free(x);
1694417009 }
1694517010 }
@@ -18209,47 +18274,47 @@ void cJSON_DeleteUnion(struct Union * x) {
1820918274 }
1821018275 }
1821118276
18212-struct Unsigned * cJSON_ParseUnsigned(const char * s) {
18213- struct Unsigned * x = NULL;
18277+struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s) {
18278+ struct PrimitiveKind * x = NULL;
1821418279 if (NULL != s) {
1821518280 cJSON * j = cJSON_Parse(s);
1821618281 if (NULL != j) {
18217- x = cJSON_GetUnsignedValue(j);
18282+ x = cJSON_GetPrimitiveKindValue(j);
1821818283 cJSON_Delete(j);
1821918284 }
1822018285 }
1822118286 return x;
1822218287 }
1822318288
18224-struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j) {
18225- struct Unsigned * x = NULL;
18289+struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j) {
18290+ struct PrimitiveKind * x = NULL;
1822618291 if (NULL != j) {
18227- if (NULL != (x = cJSON_malloc(sizeof(struct Unsigned)))) {
18228- memset(x, 0, sizeof(struct Unsigned));
18229- if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteUnsigned(x); return NULL; }
18230- if (cJSON_HasObjectItem(j, "unsigned")) {
18231- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteUnsigned(x); return NULL; }
18232- x->unsigned_unsigned = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned"));
18292+ if (NULL != (x = cJSON_malloc(sizeof(struct PrimitiveKind)))) {
18293+ memset(x, 0, sizeof(struct PrimitiveKind));
18294+ if (!cJSON_HasObjectItem(j, "PrimitiveKind")) { cJSON_DeletePrimitiveKind(x); return NULL; }
18295+ if (cJSON_HasObjectItem(j, "PrimitiveKind")) {
18296+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"))) { cJSON_DeletePrimitiveKind(x); return NULL; }
18297+ x->primitive_kind = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"));
1823318298 }
1823418299 }
1823518300 }
1823618301 return x;
1823718302 }
1823818303
18239-cJSON * cJSON_CreateUnsigned(const struct Unsigned * x) {
18304+cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x) {
1824018305 cJSON * j = NULL;
1824118306 if (NULL != x) {
1824218307 if (NULL != (j = cJSON_CreateObject())) {
18243- cJSON_AddNumberToObject(j, "unsigned", x->unsigned_unsigned);
18308+ cJSON_AddNumberToObject(j, "PrimitiveKind", x->primitive_kind);
1824418309 }
1824518310 }
1824618311 return j;
1824718312 }
1824818313
18249-char * cJSON_PrintUnsigned(const struct Unsigned * x) {
18314+char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) {
1825018315 char * s = NULL;
1825118316 if (NULL != x) {
18252- cJSON * j = cJSON_CreateUnsigned(x);
18317+ cJSON * j = cJSON_CreatePrimitiveKind(x);
1825318318 if (NULL != j) {
1825418319 s = cJSON_Print(j);
1825518320 cJSON_Delete(j);
@@ -18258,53 +18323,53 @@ char * cJSON_PrintUnsigned(const struct Unsigned * x) {
1825818323 return s;
1825918324 }
1826018325
18261-void cJSON_DeleteUnsigned(struct Unsigned * x) {
18326+void cJSON_DeletePrimitiveKind(struct PrimitiveKind * x) {
1826218327 if (NULL != x) {
1826318328 cJSON_free(x);
1826418329 }
1826518330 }
1826618331
18267-struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s) {
18268- struct PrimitiveKind * x = NULL;
18332+struct Obj5True * cJSON_ParseObj5True(const char * s) {
18333+ struct Obj5True * x = NULL;
1826918334 if (NULL != s) {
1827018335 cJSON * j = cJSON_Parse(s);
1827118336 if (NULL != j) {
18272- x = cJSON_GetPrimitiveKindValue(j);
18337+ x = cJSON_GetObj5TrueValue(j);
1827318338 cJSON_Delete(j);
1827418339 }
1827518340 }
1827618341 return x;
1827718342 }
1827818343
18279-struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j) {
18280- struct PrimitiveKind * x = NULL;
18344+struct Obj5True * cJSON_GetObj5TrueValue(const cJSON * j) {
18345+ struct Obj5True * x = NULL;
1828118346 if (NULL != j) {
18282- if (NULL != (x = cJSON_malloc(sizeof(struct PrimitiveKind)))) {
18283- memset(x, 0, sizeof(struct PrimitiveKind));
18284- if (!cJSON_HasObjectItem(j, "PrimitiveKind")) { cJSON_DeletePrimitiveKind(x); return NULL; }
18285- if (cJSON_HasObjectItem(j, "PrimitiveKind")) {
18286- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"))) { cJSON_DeletePrimitiveKind(x); return NULL; }
18287- x->primitive_kind = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"));
18347+ if (NULL != (x = cJSON_malloc(sizeof(struct Obj5True)))) {
18348+ memset(x, 0, sizeof(struct Obj5True));
18349+ if (!cJSON_HasObjectItem(j, "true")) { cJSON_DeleteObj5True(x); return NULL; }
18350+ if (cJSON_HasObjectItem(j, "true")) {
18351+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "true"))) { cJSON_DeleteObj5True(x); return NULL; }
18352+ x->true_true = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "true"));
1828818353 }
1828918354 }
1829018355 }
1829118356 return x;
1829218357 }
1829318358
18294-cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x) {
18359+cJSON * cJSON_CreateObj5True(const struct Obj5True * x) {
1829518360 cJSON * j = NULL;
1829618361 if (NULL != x) {
1829718362 if (NULL != (j = cJSON_CreateObject())) {
18298- cJSON_AddNumberToObject(j, "PrimitiveKind", x->primitive_kind);
18363+ cJSON_AddNumberToObject(j, "true", x->true_true);
1829918364 }
1830018365 }
1830118366 return j;
1830218367 }
1830318368
18304-char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) {
18369+char * cJSON_PrintObj5True(const struct Obj5True * x) {
1830518370 char * s = NULL;
1830618371 if (NULL != x) {
18307- cJSON * j = cJSON_CreatePrimitiveKind(x);
18372+ cJSON * j = cJSON_CreateObj5True(x);
1830818373 if (NULL != j) {
1830918374 s = cJSON_Print(j);
1831018375 cJSON_Delete(j);
@@ -18313,53 +18378,53 @@ char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) {
1831318378 return s;
1831418379 }
1831518380
18316-void cJSON_DeletePrimitiveKind(struct PrimitiveKind * x) {
18381+void cJSON_DeleteObj5True(struct Obj5True * x) {
1831718382 if (NULL != x) {
1831818383 cJSON_free(x);
1831918384 }
1832018385 }
1832118386
18322-struct Obj5True * cJSON_ParseObj5True(const char * s) {
18323- struct Obj5True * x = NULL;
18387+struct Select * cJSON_ParseSelect(const char * s) {
18388+ struct Select * x = NULL;
1832418389 if (NULL != s) {
1832518390 cJSON * j = cJSON_Parse(s);
1832618391 if (NULL != j) {
18327- x = cJSON_GetObj5TrueValue(j);
18392+ x = cJSON_GetSelectValue(j);
1832818393 cJSON_Delete(j);
1832918394 }
1833018395 }
1833118396 return x;
1833218397 }
1833318398
18334-struct Obj5True * cJSON_GetObj5TrueValue(const cJSON * j) {
18335- struct Obj5True * x = NULL;
18399+struct Select * cJSON_GetSelectValue(const cJSON * j) {
18400+ struct Select * x = NULL;
1833618401 if (NULL != j) {
18337- if (NULL != (x = cJSON_malloc(sizeof(struct Obj5True)))) {
18338- memset(x, 0, sizeof(struct Obj5True));
18339- if (!cJSON_HasObjectItem(j, "true")) { cJSON_DeleteObj5True(x); return NULL; }
18340- if (cJSON_HasObjectItem(j, "true")) {
18341- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "true"))) { cJSON_DeleteObj5True(x); return NULL; }
18342- x->true_true = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "true"));
18402+ if (NULL != (x = cJSON_malloc(sizeof(struct Select)))) {
18403+ memset(x, 0, sizeof(struct Select));
18404+ if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteSelect(x); return NULL; }
18405+ if (cJSON_HasObjectItem(j, "select")) {
18406+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteSelect(x); return NULL; }
18407+ x->select = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "select"));
1834318408 }
1834418409 }
1834518410 }
1834618411 return x;
1834718412 }
1834818413
18349-cJSON * cJSON_CreateObj5True(const struct Obj5True * x) {
18414+cJSON * cJSON_CreateSelect(const struct Select * x) {
1835018415 cJSON * j = NULL;
1835118416 if (NULL != x) {
1835218417 if (NULL != (j = cJSON_CreateObject())) {
18353- cJSON_AddNumberToObject(j, "true", x->true_true);
18418+ cJSON_AddNumberToObject(j, "select", x->select);
1835418419 }
1835518420 }
1835618421 return j;
1835718422 }
1835818423
18359-char * cJSON_PrintObj5True(const struct Obj5True * x) {
18424+char * cJSON_PrintSelect(const struct Select * x) {
1836018425 char * s = NULL;
1836118426 if (NULL != x) {
18362- cJSON * j = cJSON_CreateObj5True(x);
18427+ cJSON * j = cJSON_CreateSelect(x);
1836318428 if (NULL != j) {
1836418429 s = cJSON_Print(j);
1836518430 cJSON_Delete(j);
@@ -18368,7 +18433,7 @@ char * cJSON_PrintObj5True(const struct Obj5True * x) {
1836818433 return s;
1836918434 }
1837018435
18371-void cJSON_DeleteObj5True(struct Obj5True * x) {
18436+void cJSON_DeleteSelect(struct Select * x) {
1837218437 if (NULL != x) {
1837318438 cJSON_free(x);
1837418439 }
@@ -19694,6 +19759,61 @@ void cJSON_DeleteTimeZone(struct TimeZone * x) {
1969419759 }
1969519760 }
1969619761
19762+struct ToDict * cJSON_ParseToDict(const char * s) {
19763+ struct ToDict * x = NULL;
19764+ if (NULL != s) {
19765+ cJSON * j = cJSON_Parse(s);
19766+ if (NULL != j) {
19767+ x = cJSON_GetToDictValue(j);
19768+ cJSON_Delete(j);
19769+ }
19770+ }
19771+ return x;
19772+}
19773+
19774+struct ToDict * cJSON_GetToDictValue(const cJSON * j) {
19775+ struct ToDict * x = NULL;
19776+ if (NULL != j) {
19777+ if (NULL != (x = cJSON_malloc(sizeof(struct ToDict)))) {
19778+ memset(x, 0, sizeof(struct ToDict));
19779+ if (!cJSON_HasObjectItem(j, "to_dict")) { cJSON_DeleteToDict(x); return NULL; }
19780+ if (cJSON_HasObjectItem(j, "to_dict")) {
19781+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "to_dict"))) { cJSON_DeleteToDict(x); return NULL; }
19782+ x->to_dict = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "to_dict"));
19783+ }
19784+ }
19785+ }
19786+ return x;
19787+}
19788+
19789+cJSON * cJSON_CreateToDict(const struct ToDict * x) {
19790+ cJSON * j = NULL;
19791+ if (NULL != x) {
19792+ if (NULL != (j = cJSON_CreateObject())) {
19793+ cJSON_AddNumberToObject(j, "to_dict", x->to_dict);
19794+ }
19795+ }
19796+ return j;
19797+}
19798+
19799+char * cJSON_PrintToDict(const struct ToDict * x) {
19800+ char * s = NULL;
19801+ if (NULL != x) {
19802+ cJSON * j = cJSON_CreateToDict(x);
19803+ if (NULL != j) {
19804+ s = cJSON_Print(j);
19805+ cJSON_Delete(j);
19806+ }
19807+ }
19808+ return s;
19809+}
19810+
19811+void cJSON_DeleteToDict(struct ToDict * x) {
19812+ if (NULL != x) {
19813+ cJSON_free(x);
19814+ }
19815+}
19816+
1969719817 struct ToJson * cJSON_ParseToJson(const char * s) {
1969819818 struct ToJson * x = NULL;
1969919819 if (NULL != s) {
@@ -20244,6 +20364,61 @@ void cJSON_DeleteUndefined(struct Undefined * x) {
2024420364 }
2024520365 }
2024620366
20367+struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s) {
20368+ struct UnmarshalJson * x = NULL;
20369+ if (NULL != s) {
20370+ cJSON * j = cJSON_Parse(s);
20371+ if (NULL != j) {
20372+ x = cJSON_GetUnmarshalJsonValue(j);
20373+ cJSON_Delete(j);
20374+ }
20375+ }
20376+ return x;
20377+}
20378+
20379+struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j) {
20380+ struct UnmarshalJson * x = NULL;
20381+ if (NULL != j) {
20382+ if (NULL != (x = cJSON_malloc(sizeof(struct UnmarshalJson)))) {
20383+ memset(x, 0, sizeof(struct UnmarshalJson));
20384+ if (!cJSON_HasObjectItem(j, "UnmarshalJSON")) { cJSON_DeleteUnmarshalJson(x); return NULL; }
20385+ if (cJSON_HasObjectItem(j, "UnmarshalJSON")) {
20386+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"))) { cJSON_DeleteUnmarshalJson(x); return NULL; }
20387+ x->unmarshal_json = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"));
20388+ }
20389+ }
20390+ }
20391+ return x;
20392+}
20393+
20394+cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x) {
20395+ cJSON * j = NULL;
20396+ if (NULL != x) {
20397+ if (NULL != (j = cJSON_CreateObject())) {
20398+ cJSON_AddNumberToObject(j, "UnmarshalJSON", x->unmarshal_json);
20399+ }
20400+ }
20401+ return j;
20402+}
20403+
20404+char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x) {
20405+ char * s = NULL;
20406+ if (NULL != x) {
20407+ cJSON * j = cJSON_CreateUnmarshalJson(x);
20408+ if (NULL != j) {
20409+ s = cJSON_Print(j);
20410+ cJSON_Delete(j);
20411+ }
20412+ }
20413+ return s;
20414+}
20415+
20416+void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x) {
20417+ if (NULL != x) {
20418+ cJSON_free(x);
20419+ }
20420+}
20421+
2024720422 struct Unowned * cJSON_ParseUnowned(const char * s) {
2024820423 struct Unowned * x = NULL;
2024920424 if (NULL != s) {
@@ -20409,61 +20584,6 @@ void cJSON_DeleteUseSerializers(struct UseSerializers * x) {
2040920584 }
2041020585 }
2041120586
20412-struct Ushort * cJSON_ParseUshort(const char * s) {
20413- struct Ushort * x = NULL;
20414- if (NULL != s) {
20415- cJSON * j = cJSON_Parse(s);
20416- if (NULL != j) {
20417- x = cJSON_GetUshortValue(j);
20418- cJSON_Delete(j);
20419- }
20420- }
20421- return x;
20422-}
20423-
20424-struct Ushort * cJSON_GetUshortValue(const cJSON * j) {
20425- struct Ushort * x = NULL;
20426- if (NULL != j) {
20427- if (NULL != (x = cJSON_malloc(sizeof(struct Ushort)))) {
20428- memset(x, 0, sizeof(struct Ushort));
20429- if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteUshort(x); return NULL; }
20430- if (cJSON_HasObjectItem(j, "ushort")) {
20431- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteUshort(x); return NULL; }
20432- x->ushort = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "ushort"));
20433- }
20434- }
20435- }
20436- return x;
20437-}
20438-
20439-cJSON * cJSON_CreateUshort(const struct Ushort * x) {
20440- cJSON * j = NULL;
20441- if (NULL != x) {
20442- if (NULL != (j = cJSON_CreateObject())) {
20443- cJSON_AddNumberToObject(j, "ushort", x->ushort);
20444- }
20445- }
20446- return j;
20447-}
20448-
20449-char * cJSON_PrintUshort(const struct Ushort * x) {
20450- char * s = NULL;
20451- if (NULL != x) {
20452- cJSON * j = cJSON_CreateUshort(x);
20453- if (NULL != j) {
20454- s = cJSON_Print(j);
20455- cJSON_Delete(j);
20456- }
20457- }
20458- return s;
20459-}
20460-
20461-void cJSON_DeleteUshort(struct Ushort * x) {
20462- if (NULL != x) {
20463- cJSON_free(x);
20464- }
20465-}
20466-
2046720587 struct Obj5 * cJSON_ParseObj5(const char * s) {
2046820588 struct Obj5 * x = NULL;
2046920589 if (NULL != s) {
@@ -20624,12 +20744,6 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) {
2062420744 x->obj5_union = cJSON_GetUnionValue(cJSON_GetObjectItemCaseSensitive(j, "union"));
2062520745 if (NULL == x->obj5_union) { cJSON_DeleteObj5(x); return NULL; }
2062620746 }
20627- if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteObj5(x); return NULL; }
20628- if (cJSON_HasObjectItem(j, "unsigned")) {
20629- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteObj5(x); return NULL; }
20630- x->obj5_unsigned = cJSON_GetUnsignedValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned"));
20631- if (NULL == x->obj5_unsigned) { cJSON_DeleteObj5(x); return NULL; }
20632- }
2063320747 if (!cJSON_HasObjectItem(j, "PrimitiveKind")) { cJSON_DeleteObj5(x); return NULL; }
2063420748 if (cJSON_HasObjectItem(j, "PrimitiveKind")) {
2063520749 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"))) { cJSON_DeleteObj5(x); return NULL; }
@@ -20642,6 +20756,12 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) {
2064220756 x->purple_true = cJSON_GetObj5TrueValue(cJSON_GetObjectItemCaseSensitive(j, "true"));
2064320757 if (NULL == x->purple_true) { cJSON_DeleteObj5(x); return NULL; }
2064420758 }
20759+ if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteObj5(x); return NULL; }
20760+ if (cJSON_HasObjectItem(j, "select")) {
20761+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteObj5(x); return NULL; }
20762+ x->select = cJSON_GetSelectValue(cJSON_GetObjectItemCaseSensitive(j, "select"));
20763+ if (NULL == x->select) { cJSON_DeleteObj5(x); return NULL; }
20764+ }
2064520765 if (!cJSON_HasObjectItem(j, "Self")) { cJSON_DeleteObj5(x); return NULL; }
2064620766 if (cJSON_HasObjectItem(j, "Self")) {
2064720767 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "Self"))) { cJSON_DeleteObj5(x); return NULL; }
@@ -20786,6 +20906,12 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) {
2078620906 x->time_zone = cJSON_GetTimeZoneValue(cJSON_GetObjectItemCaseSensitive(j, "TimeZone"));
2078720907 if (NULL == x->time_zone) { cJSON_DeleteObj5(x); return NULL; }
2078820908 }
20909+ if (!cJSON_HasObjectItem(j, "to_dict")) { cJSON_DeleteObj5(x); return NULL; }
20910+ if (cJSON_HasObjectItem(j, "to_dict")) {
20911+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "to_dict"))) { cJSON_DeleteObj5(x); return NULL; }
20912+ x->to_dict = cJSON_GetToDictValue(cJSON_GetObjectItemCaseSensitive(j, "to_dict"));
20913+ if (NULL == x->to_dict) { cJSON_DeleteObj5(x); return NULL; }
20914+ }
2078920915 if (!cJSON_HasObjectItem(j, "to_json")) { cJSON_DeleteObj5(x); return NULL; }
2079020916 if (cJSON_HasObjectItem(j, "to_json")) {
2079120917 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "to_json"))) { cJSON_DeleteObj5(x); return NULL; }
@@ -20846,6 +20972,12 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) {
2084620972 x->undefined = cJSON_GetUndefinedValue(cJSON_GetObjectItemCaseSensitive(j, "undefined"));
2084720973 if (NULL == x->undefined) { cJSON_DeleteObj5(x); return NULL; }
2084820974 }
20975+ if (!cJSON_HasObjectItem(j, "UnmarshalJSON")) { cJSON_DeleteObj5(x); return NULL; }
20976+ if (cJSON_HasObjectItem(j, "UnmarshalJSON")) {
20977+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"))) { cJSON_DeleteObj5(x); return NULL; }
20978+ x->unmarshal_json = cJSON_GetUnmarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"));
20979+ if (NULL == x->unmarshal_json) { cJSON_DeleteObj5(x); return NULL; }
20980+ }
2084920981 if (!cJSON_HasObjectItem(j, "unowned")) { cJSON_DeleteObj5(x); return NULL; }
2085020982 if (cJSON_HasObjectItem(j, "unowned")) {
2085120983 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteObj5(x); return NULL; }
@@ -20864,12 +20996,6 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) {
2086420996 x->use_serializers = cJSON_GetUseSerializersValue(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"));
2086520997 if (NULL == x->use_serializers) { cJSON_DeleteObj5(x); return NULL; }
2086620998 }
20867- if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteObj5(x); return NULL; }
20868- if (cJSON_HasObjectItem(j, "ushort")) {
20869- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteObj5(x); return NULL; }
20870- x->ushort = cJSON_GetUshortValue(cJSON_GetObjectItemCaseSensitive(j, "ushort"));
20871- if (NULL == x->ushort) { cJSON_DeleteObj5(x); return NULL; }
20872- }
2087320999 }
2087421000 }
2087521001 return x;
@@ -20903,9 +21029,9 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) {
2090321029 cJSON_AddItemToObject(j, "typename", cJSON_CreateTypename(x->obj5_typename));
2090421030 cJSON_AddItemToObject(j, "typeof", cJSON_CreateTypeof(x->obj5_typeof));
2090521031 cJSON_AddItemToObject(j, "union", cJSON_CreateUnion(x->obj5_union));
20906- cJSON_AddItemToObject(j, "unsigned", cJSON_CreateUnsigned(x->obj5_unsigned));
2090721032 cJSON_AddItemToObject(j, "PrimitiveKind", cJSON_CreatePrimitiveKind(x->primitive_kind));
2090821033 cJSON_AddItemToObject(j, "true", cJSON_CreateObj5True(x->purple_true));
21034+ cJSON_AddItemToObject(j, "select", cJSON_CreateSelect(x->select));
2090921035 cJSON_AddItemToObject(j, "Self", cJSON_CreateSelf(x->self));
2091021036 cJSON_AddItemToObject(j, "Sendable", cJSON_CreateSendable(x->sendable));
2091121037 cJSON_AddItemToObject(j, "SerialDescriptor", cJSON_CreateSerialDescriptor(x->serial_descriptor));
@@ -20930,6 +21056,7 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) {
2093021056 cJSON_AddItemToObject(j, "TimeOnly", cJSON_CreateTimeOnly(x->time_only));
2093121057 cJSON_AddItemToObject(j, "TimeOnlyConverter", cJSON_CreateTimeOnlyConverter(x->time_only_converter));
2093221058 cJSON_AddItemToObject(j, "TimeZone", cJSON_CreateTimeZone(x->time_zone));
21059+ cJSON_AddItemToObject(j, "to_dict", cJSON_CreateToDict(x->to_dict));
2093321060 cJSON_AddItemToObject(j, "to_json", cJSON_CreateToJson(x->to_json));
2093421061 cJSON_AddItemToObject(j, "toString", cJSON_CreateToString(x->to_string));
2093521062 cJSON_AddItemToObject(j, "top_level", cJSON_CreateTopLevelClass(x->top_level));
@@ -20940,10 +21067,10 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) {
2094021067 cJSON_AddItemToObject(j, "ulong", cJSON_CreateUlong(x->ulong));
2094121068 cJSON_AddItemToObject(j, "unchecked", cJSON_CreateUnchecked(x->unchecked));
2094221069 cJSON_AddItemToObject(j, "undefined", cJSON_CreateUndefined(x->undefined));
21070+ cJSON_AddItemToObject(j, "UnmarshalJSON", cJSON_CreateUnmarshalJson(x->unmarshal_json));
2094321071 cJSON_AddItemToObject(j, "unowned", cJSON_CreateUnowned(x->unowned));
2094421072 cJSON_AddItemToObject(j, "unsafe", cJSON_CreateUnsafe(x->unsafe));
2094521073 cJSON_AddItemToObject(j, "UseSerializers", cJSON_CreateUseSerializers(x->use_serializers));
20946- cJSON_AddItemToObject(j, "ushort", cJSON_CreateUshort(x->ushort));
2094721074 }
2094821075 }
2094921076 return j;
@@ -21032,15 +21159,15 @@ void cJSON_DeleteObj5(struct Obj5 * x) {
2103221159 if (NULL != x->obj5_union) {
2103321160 cJSON_DeleteUnion(x->obj5_union);
2103421161 }
21035- if (NULL != x->obj5_unsigned) {
21036- cJSON_DeleteUnsigned(x->obj5_unsigned);
21037- }
2103821162 if (NULL != x->primitive_kind) {
2103921163 cJSON_DeletePrimitiveKind(x->primitive_kind);
2104021164 }
2104121165 if (NULL != x->purple_true) {
2104221166 cJSON_DeleteObj5True(x->purple_true);
2104321167 }
21168+ if (NULL != x->select) {
21169+ cJSON_DeleteSelect(x->select);
21170+ }
2104421171 if (NULL != x->self) {
2104521172 cJSON_DeleteSelf(x->self);
2104621173 }
@@ -21113,6 +21240,9 @@ void cJSON_DeleteObj5(struct Obj5 * x) {
2111321240 if (NULL != x->time_zone) {
2111421241 cJSON_DeleteTimeZone(x->time_zone);
2111521242 }
21243+ if (NULL != x->to_dict) {
21244+ cJSON_DeleteToDict(x->to_dict);
21245+ }
2111621246 if (NULL != x->to_json) {
2111721247 cJSON_DeleteToJson(x->to_json);
2111821248 }
@@ -21143,6 +21273,9 @@ void cJSON_DeleteObj5(struct Obj5 * x) {
2114321273 if (NULL != x->undefined) {
2114421274 cJSON_DeleteUndefined(x->undefined);
2114521275 }
21276+ if (NULL != x->unmarshal_json) {
21277+ cJSON_DeleteUnmarshalJson(x->unmarshal_json);
21278+ }
2114621279 if (NULL != x->unowned) {
2114721280 cJSON_DeleteUnowned(x->unowned);
2114821281 }
@@ -21152,9 +21285,61 @@ void cJSON_DeleteObj5(struct Obj5 * x) {
2115221285 if (NULL != x->use_serializers) {
2115321286 cJSON_DeleteUseSerializers(x->use_serializers);
2115421287 }
21155- if (NULL != x->ushort) {
21156- cJSON_DeleteUshort(x->ushort);
21288+ cJSON_free(x);
21289+ }
21290+}
21291+
21292+struct Unsigned * cJSON_ParseUnsigned(const char * s) {
21293+ struct Unsigned * x = NULL;
21294+ if (NULL != s) {
21295+ cJSON * j = cJSON_Parse(s);
21296+ if (NULL != j) {
21297+ x = cJSON_GetUnsignedValue(j);
21298+ cJSON_Delete(j);
2115721299 }
21300+ }
21301+ return x;
21302+}
21303+
21304+struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j) {
21305+ struct Unsigned * x = NULL;
21306+ if (NULL != j) {
21307+ if (NULL != (x = cJSON_malloc(sizeof(struct Unsigned)))) {
21308+ memset(x, 0, sizeof(struct Unsigned));
21309+ if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteUnsigned(x); return NULL; }
21310+ if (cJSON_HasObjectItem(j, "unsigned")) {
21311+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteUnsigned(x); return NULL; }
21312+ x->unsigned_unsigned = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned"));
21313+ }
21314+ }
21315+ }
21316+ return x;
21317+}
21318+
21319+cJSON * cJSON_CreateUnsigned(const struct Unsigned * x) {
21320+ cJSON * j = NULL;
21321+ if (NULL != x) {
21322+ if (NULL != (j = cJSON_CreateObject())) {
21323+ cJSON_AddNumberToObject(j, "unsigned", x->unsigned_unsigned);
21324+ }
21325+ }
21326+ return j;
21327+}
21328+
21329+char * cJSON_PrintUnsigned(const struct Unsigned * x) {
21330+ char * s = NULL;
21331+ if (NULL != x) {
21332+ cJSON * j = cJSON_CreateUnsigned(x);
21333+ if (NULL != j) {
21334+ s = cJSON_Print(j);
21335+ cJSON_Delete(j);
21336+ }
21337+ }
21338+ return s;
21339+}
21340+
21341+void cJSON_DeleteUnsigned(struct Unsigned * x) {
21342+ if (NULL != x) {
2115821343 cJSON_free(x);
2115921344 }
2116021345 }
@@ -21599,6 +21784,61 @@ void cJSON_DeleteXorEq(struct XorEq * x) {
2159921784 }
2160021785 }
2160121786
21787+struct Ushort * cJSON_ParseUshort(const char * s) {
21788+ struct Ushort * x = NULL;
21789+ if (NULL != s) {
21790+ cJSON * j = cJSON_Parse(s);
21791+ if (NULL != j) {
21792+ x = cJSON_GetUshortValue(j);
21793+ cJSON_Delete(j);
21794+ }
21795+ }
21796+ return x;
21797+}
21798+
21799+struct Ushort * cJSON_GetUshortValue(const cJSON * j) {
21800+ struct Ushort * x = NULL;
21801+ if (NULL != j) {
21802+ if (NULL != (x = cJSON_malloc(sizeof(struct Ushort)))) {
21803+ memset(x, 0, sizeof(struct Ushort));
21804+ if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteUshort(x); return NULL; }
21805+ if (cJSON_HasObjectItem(j, "ushort")) {
21806+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteUshort(x); return NULL; }
21807+ x->ushort = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "ushort"));
21808+ }
21809+ }
21810+ }
21811+ return x;
21812+}
21813+
21814+cJSON * cJSON_CreateUshort(const struct Ushort * x) {
21815+ cJSON * j = NULL;
21816+ if (NULL != x) {
21817+ if (NULL != (j = cJSON_CreateObject())) {
21818+ cJSON_AddNumberToObject(j, "ushort", x->ushort);
21819+ }
21820+ }
21821+ return j;
21822+}
21823+
21824+char * cJSON_PrintUshort(const struct Ushort * x) {
21825+ char * s = NULL;
21826+ if (NULL != x) {
21827+ cJSON * j = cJSON_CreateUshort(x);
21828+ if (NULL != j) {
21829+ s = cJSON_Print(j);
21830+ cJSON_Delete(j);
21831+ }
21832+ }
21833+ return s;
21834+}
21835+
21836+void cJSON_DeleteUshort(struct Ushort * x) {
21837+ if (NULL != x) {
21838+ cJSON_free(x);
21839+ }
21840+}
21841+
2160221842 struct Utf8JsonReader * cJSON_ParseUtf8JsonReader(const char * s) {
2160321843 struct Utf8JsonReader * x = NULL;
2160421844 if (NULL != s) {
@@ -22171,6 +22411,12 @@ struct Obj6 * cJSON_GetObj6Value(const cJSON * j) {
2217122411 if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "dummy"))) { cJSON_DeleteObj6(x); return NULL; }
2217222412 x->dummy = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "dummy"));
2217322413 }
22414+ if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteObj6(x); return NULL; }
22415+ if (cJSON_HasObjectItem(j, "unsigned")) {
22416+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteObj6(x); return NULL; }
22417+ x->obj6_unsigned = cJSON_GetUnsignedValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned"));
22418+ if (NULL == x->obj6_unsigned) { cJSON_DeleteObj6(x); return NULL; }
22419+ }
2217422420 if (!cJSON_HasObjectItem(j, "using")) { cJSON_DeleteObj6(x); return NULL; }
2217522421 if (cJSON_HasObjectItem(j, "using")) {
2217622422 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "using"))) { cJSON_DeleteObj6(x); return NULL; }
@@ -22219,6 +22465,12 @@ struct Obj6 * cJSON_GetObj6Value(const cJSON * j) {
2221922465 x->obj6_xor_eq = cJSON_GetXorEqValue(cJSON_GetObjectItemCaseSensitive(j, "xor_eq"));
2222022466 if (NULL == x->obj6_xor_eq) { cJSON_DeleteObj6(x); return NULL; }
2222122467 }
22468+ if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteObj6(x); return NULL; }
22469+ if (cJSON_HasObjectItem(j, "ushort")) {
22470+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteObj6(x); return NULL; }
22471+ x->ushort = cJSON_GetUshortValue(cJSON_GetObjectItemCaseSensitive(j, "ushort"));
22472+ if (NULL == x->ushort) { cJSON_DeleteObj6(x); return NULL; }
22473+ }
2222222474 if (!cJSON_HasObjectItem(j, "Utf8JsonReader")) { cJSON_DeleteObj6(x); return NULL; }
2222322475 if (cJSON_HasObjectItem(j, "Utf8JsonReader")) {
2222422476 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "Utf8JsonReader"))) { cJSON_DeleteObj6(x); return NULL; }
@@ -22289,6 +22541,7 @@ cJSON * cJSON_CreateObj6(const struct Obj6 * x) {
2228922541 if (NULL != x) {
2229022542 if (NULL != (j = cJSON_CreateObject())) {
2229122543 cJSON_AddNumberToObject(j, "dummy", x->dummy);
22544+ cJSON_AddItemToObject(j, "unsigned", cJSON_CreateUnsigned(x->obj6_unsigned));
2229222545 cJSON_AddItemToObject(j, "using", cJSON_CreateUsing(x->obj6_using));
2229322546 cJSON_AddItemToObject(j, "virtual", cJSON_CreateVirtual(x->obj6_virtual));
2229422547 cJSON_AddItemToObject(j, "void", cJSON_CreateVoid(x->obj6_void));
@@ -22297,6 +22550,7 @@ cJSON * cJSON_CreateObj6(const struct Obj6 * x) {
2229722550 cJSON_AddItemToObject(j, "while", cJSON_CreateWhile(x->obj6_while));
2229822551 cJSON_AddItemToObject(j, "xor", cJSON_CreateXor(x->obj6_xor));
2229922552 cJSON_AddItemToObject(j, "xor_eq", cJSON_CreateXorEq(x->obj6_xor_eq));
22553+ cJSON_AddItemToObject(j, "ushort", cJSON_CreateUshort(x->ushort));
2230022554 cJSON_AddItemToObject(j, "Utf8JsonReader", cJSON_CreateUtf8JsonReader(x->utf8_json_reader));
2230122555 cJSON_AddItemToObject(j, "Utf8JsonWriter", cJSON_CreateUtf8JsonWriter(x->utf8_json_writer));
2230222556 cJSON_AddItemToObject(j, "UUID", cJSON_CreateUuid(x->uuid));
@@ -22326,6 +22580,9 @@ char * cJSON_PrintObj6(const struct Obj6 * x) {
2232622580
2232722581 void cJSON_DeleteObj6(struct Obj6 * x) {
2232822582 if (NULL != x) {
22583+ if (NULL != x->obj6_unsigned) {
22584+ cJSON_DeleteUnsigned(x->obj6_unsigned);
22585+ }
2232922586 if (NULL != x->obj6_using) {
2233022587 cJSON_DeleteUsing(x->obj6_using);
2233122588 }
@@ -22350,6 +22607,9 @@ void cJSON_DeleteObj6(struct Obj6 * x) {
2235022607 if (NULL != x->obj6_xor_eq) {
2235122608 cJSON_DeleteXorEq(x->obj6_xor_eq);
2235222609 }
22610+ if (NULL != x->ushort) {
22611+ cJSON_DeleteUshort(x->ushort);
22612+ }
2235322613 if (NULL != x->utf8_json_reader) {
2235422614 cJSON_DeleteUtf8JsonReader(x->utf8_json_reader);
2235522615 }
Mcjsondefault / TopLevel.h+99 −55
@@ -537,6 +537,10 @@ struct From {
537537 int64_t from;
538538 };
539539
540+struct FromDict {
541+ int64_t from_dict;
542+};
543+
540544 struct FromJson {
541545 int64_t from_json;
542546 };
@@ -625,10 +629,6 @@ struct Friend {
625629 int64_t friend_friend;
626630 };
627631
628-struct Goto {
629- int64_t goto_goto;
630-};
631-
632632 struct Obj2False {
633633 int64_t false_false;
634634 };
@@ -675,6 +675,7 @@ struct Obj2 {
675675 struct Foreach * foreach;
676676 struct FormatException * format_exception;
677677 struct From * from;
678+ struct FromDict * from_dict;
678679 struct FromJson * from_json;
679680 struct Func * func;
680681 struct Function * function;
@@ -697,7 +698,6 @@ struct Obj2 {
697698 struct Float * obj2_float;
698699 struct For * obj2_for;
699700 struct Friend * obj2_friend;
700- struct Goto * obj2_goto;
701701 struct Obj2False * purple_false;
702702 };
703703
@@ -893,6 +893,10 @@ struct MapEntry {
893893 int64_t map_entry;
894894 };
895895
896+struct MarshalJson {
897+ int64_t marshal_json;
898+};
899+
896900 struct MetadataPropertyHandling {
897901 int64_t metadata_property_handling;
898902 };
@@ -917,6 +921,10 @@ struct No {
917921 int64_t no;
918922 };
919923
924+struct Goto {
925+ int64_t goto_goto;
926+};
927+
920928 struct If {
921929 int64_t if_if;
922930 };
@@ -953,10 +961,6 @@ struct New {
953961 int64_t new_new;
954962 };
955963
956-struct Noexcept {
957- int64_t noexcept_noexcept;
958-};
959-
960964 struct Obj3 {
961965 int64_t dummy;
962966 struct Guard * guard;
@@ -1007,12 +1011,14 @@ struct Obj3 {
10071011 struct Lock * lock;
10081012 struct Map * map;
10091013 struct MapEntry * map_entry;
1014+ struct MarshalJson * marshal_json;
10101015 struct MetadataPropertyHandling * metadata_property_handling;
10111016 struct Mutating * mutating;
10121017 struct Native * native;
10131018 struct Newtonsoft * newtonsoft;
10141019 struct Nil * nil;
10151020 struct No * no;
1021+ struct Goto * obj3_goto;
10161022 struct If * obj3_if;
10171023 struct Import * obj3_import;
10181024 struct Inline * obj3_inline;
@@ -1022,7 +1028,6 @@ struct Obj3 {
10221028 struct Mutable * obj3_mutable;
10231029 struct Namespace * obj3_namespace;
10241030 struct New * obj3_new;
1025- struct Noexcept * obj3_noexcept;
10261031 };
10271032
10281033 struct NoSuchMethod {
@@ -1065,6 +1070,10 @@ struct NumberClass {
10651070 int64_t number;
10661071 };
10671072
1073+struct Noexcept {
1074+ int64_t noexcept_noexcept;
1075+};
1076+
10681077 struct NoneClass {
10691078 int64_t none;
10701079 };
@@ -1277,10 +1286,6 @@ struct Sel {
12771286 int64_t sel;
12781287 };
12791288
1280-struct Select {
1281- int64_t select;
1282-};
1283-
12841289 struct Obj4 {
12851290 int64_t dummy;
12861291 struct NoSuchMethod * no_such_method;
@@ -1293,6 +1298,7 @@ struct Obj4 {
12931298 struct NsString * ns_string;
12941299 struct NullClass * null;
12951300 struct NumberClass * number;
1301+ struct Noexcept * obj4_noexcept;
12961302 struct NoneClass * obj4_none;
12971303 struct Not * obj4_not;
12981304 struct NotEq * obj4_not_eq;
@@ -1346,7 +1352,6 @@ struct Obj4 {
13461352 struct Sbyte * sbyte;
13471353 struct Sealed * sealed;
13481354 struct Sel * sel;
1349- struct Select * select;
13501355 };
13511356
13521357 struct KSerializer {
@@ -1441,10 +1446,6 @@ struct Union {
14411446 int64_t union_union;
14421447 };
14431448
1444-struct Unsigned {
1445- int64_t unsigned_unsigned;
1446-};
1447-
14481449 struct PrimitiveKind {
14491450 int64_t primitive_kind;
14501451 };
@@ -1453,6 +1454,10 @@ struct Obj5True {
14531454 int64_t true_true;
14541455 };
14551456
1457+struct Select {
1458+ int64_t select;
1459+};
1460+
14561461 struct Self {
14571462 int64_t self;
14581463 };
@@ -1549,6 +1554,10 @@ struct TimeZone {
15491554 int64_t time_zone;
15501555 };
15511556
1557+struct ToDict {
1558+ int64_t to_dict;
1559+};
1560+
15521561 struct ToJson {
15531562 int64_t to_json;
15541563 };
@@ -1589,6 +1598,10 @@ struct Undefined {
15891598 int64_t undefined;
15901599 };
15911600
1601+struct UnmarshalJson {
1602+ int64_t unmarshal_json;
1603+};
1604+
15921605 struct Unowned {
15931606 int64_t unowned;
15941607 };
@@ -1601,10 +1614,6 @@ struct UseSerializers {
16011614 int64_t use_serializers;
16021615 };
16031616
1604-struct Ushort {
1605- int64_t ushort;
1606-};
1607-
16081617 struct Obj5 {
16091618 int64_t dummy;
16101619 struct KSerializer * k_serializer;
@@ -1630,9 +1639,9 @@ struct Obj5 {
16301639 struct Typename * obj5_typename;
16311640 struct Typeof * obj5_typeof;
16321641 struct Union * obj5_union;
1633- struct Unsigned * obj5_unsigned;
16341642 struct PrimitiveKind * primitive_kind;
16351643 struct Obj5True * purple_true;
1644+ struct Select * select;
16361645 struct Self * self;
16371646 struct Sendable * sendable;
16381647 struct SerialDescriptor * serial_descriptor;
@@ -1657,6 +1666,7 @@ struct Obj5 {
16571666 struct TimeOnly * time_only;
16581667 struct TimeOnlyConverter * time_only_converter;
16591668 struct TimeZone * time_zone;
1669+ struct ToDict * to_dict;
16601670 struct ToJson * to_json;
16611671 struct ToString * to_string;
16621672 struct TopLevelClass * top_level;
@@ -1667,10 +1677,14 @@ struct Obj5 {
16671677 struct Ulong * ulong;
16681678 struct Unchecked * unchecked;
16691679 struct Undefined * undefined;
1680+ struct UnmarshalJson * unmarshal_json;
16701681 struct Unowned * unowned;
16711682 struct Unsafe * unsafe;
16721683 struct UseSerializers * use_serializers;
1673- struct Ushort * ushort;
1684+};
1685+
1686+struct Unsigned {
1687+ int64_t unsigned_unsigned;
16741688 };
16751689
16761690 struct Using {
@@ -1705,6 +1719,10 @@ struct XorEq {
17051719 int64_t xor_eq_xor_eq;
17061720 };
17071721
1722+struct Ushort {
1723+ int64_t ushort;
1724+};
1725+
17081726 struct Utf8JsonReader {
17091727 int64_t utf8_json_reader;
17101728 };
@@ -1747,6 +1765,7 @@ struct Yield {
17471765
17481766 struct Obj6 {
17491767 int64_t dummy;
1768+ struct Unsigned * obj6_unsigned;
17501769 struct Using * obj6_using;
17511770 struct Virtual * obj6_virtual;
17521771 struct Void * obj6_void;
@@ -1755,6 +1774,7 @@ struct Obj6 {
17551774 struct While * obj6_while;
17561775 struct Xor * obj6_xor;
17571776 struct XorEq * obj6_xor_eq;
1777+ struct Ushort * ushort;
17581778 struct Utf8JsonReader * utf8_json_reader;
17591779 struct Utf8JsonWriter * utf8_json_writer;
17601780 struct Uuid * uuid;
@@ -2410,6 +2430,12 @@ cJSON * cJSON_CreateFrom(const struct From * x);
24102430 char * cJSON_PrintFrom(const struct From * x);
24112431 void cJSON_DeleteFrom(struct From * x);
24122432
2433+struct FromDict * cJSON_ParseFromDict(const char * s);
2434+struct FromDict * cJSON_GetFromDictValue(const cJSON * j);
2435+cJSON * cJSON_CreateFromDict(const struct FromDict * x);
2436+char * cJSON_PrintFromDict(const struct FromDict * x);
2437+void cJSON_DeleteFromDict(struct FromDict * x);
2438+
24132439 struct FromJson * cJSON_ParseFromJson(const char * s);
24142440 struct FromJson * cJSON_GetFromJsonValue(const cJSON * j);
24152441 cJSON * cJSON_CreateFromJson(const struct FromJson * x);
@@ -2542,12 +2568,6 @@ cJSON * cJSON_CreateFriend(const struct Friend * x);
25422568 char * cJSON_PrintFriend(const struct Friend * x);
25432569 void cJSON_DeleteFriend(struct Friend * x);
25442570
2545-struct Goto * cJSON_ParseGoto(const char * s);
2546-struct Goto * cJSON_GetGotoValue(const cJSON * j);
2547-cJSON * cJSON_CreateGoto(const struct Goto * x);
2548-char * cJSON_PrintGoto(const struct Goto * x);
2549-void cJSON_DeleteGoto(struct Goto * x);
2550-
25512571 struct Obj2False * cJSON_ParseObj2False(const char * s);
25522572 struct Obj2False * cJSON_GetObj2FalseValue(const cJSON * j);
25532573 cJSON * cJSON_CreateObj2False(const struct Obj2False * x);
@@ -2848,6 +2868,12 @@ cJSON * cJSON_CreateMapEntry(const struct MapEntry * x);
28482868 char * cJSON_PrintMapEntry(const struct MapEntry * x);
28492869 void cJSON_DeleteMapEntry(struct MapEntry * x);
28502870
2871+struct MarshalJson * cJSON_ParseMarshalJson(const char * s);
2872+struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j);
2873+cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x);
2874+char * cJSON_PrintMarshalJson(const struct MarshalJson * x);
2875+void cJSON_DeleteMarshalJson(struct MarshalJson * x);
2876+
28512877 struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s);
28522878 struct MetadataPropertyHandling * cJSON_GetMetadataPropertyHandlingValue(const cJSON * j);
28532879 cJSON * cJSON_CreateMetadataPropertyHandling(const struct MetadataPropertyHandling * x);
@@ -2884,6 +2910,12 @@ cJSON * cJSON_CreateNo(const struct No * x);
28842910 char * cJSON_PrintNo(const struct No * x);
28852911 void cJSON_DeleteNo(struct No * x);
28862912
2913+struct Goto * cJSON_ParseGoto(const char * s);
2914+struct Goto * cJSON_GetGotoValue(const cJSON * j);
2915+cJSON * cJSON_CreateGoto(const struct Goto * x);
2916+char * cJSON_PrintGoto(const struct Goto * x);
2917+void cJSON_DeleteGoto(struct Goto * x);
2918+
28872919 struct If * cJSON_ParseIf(const char * s);
28882920 struct If * cJSON_GetIfValue(const cJSON * j);
28892921 cJSON * cJSON_CreateIf(const struct If * x);
@@ -2938,12 +2970,6 @@ cJSON * cJSON_CreateNew(const struct New * x);
29382970 char * cJSON_PrintNew(const struct New * x);
29392971 void cJSON_DeleteNew(struct New * x);
29402972
2941-struct Noexcept * cJSON_ParseNoexcept(const char * s);
2942-struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j);
2943-cJSON * cJSON_CreateNoexcept(const struct Noexcept * x);
2944-char * cJSON_PrintNoexcept(const struct Noexcept * x);
2945-void cJSON_DeleteNoexcept(struct Noexcept * x);
2946-
29472973 struct Obj3 * cJSON_ParseObj3(const char * s);
29482974 struct Obj3 * cJSON_GetObj3Value(const cJSON * j);
29492975 cJSON * cJSON_CreateObj3(const struct Obj3 * x);
@@ -3010,6 +3036,12 @@ cJSON * cJSON_CreateNumberClass(const struct NumberClass * x);
30103036 char * cJSON_PrintNumberClass(const struct NumberClass * x);
30113037 void cJSON_DeleteNumberClass(struct NumberClass * x);
30123038
3039+struct Noexcept * cJSON_ParseNoexcept(const char * s);
3040+struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j);
3041+cJSON * cJSON_CreateNoexcept(const struct Noexcept * x);
3042+char * cJSON_PrintNoexcept(const struct Noexcept * x);
3043+void cJSON_DeleteNoexcept(struct Noexcept * x);
3044+
30133045 struct NoneClass * cJSON_ParseNoneClass(const char * s);
30143046 struct NoneClass * cJSON_GetNoneClassValue(const cJSON * j);
30153047 cJSON * cJSON_CreateNoneClass(const struct NoneClass * x);
@@ -3328,12 +3360,6 @@ cJSON * cJSON_CreateSel(const struct Sel * x);
33283360 char * cJSON_PrintSel(const struct Sel * x);
33293361 void cJSON_DeleteSel(struct Sel * x);
33303362
3331-struct Select * cJSON_ParseSelect(const char * s);
3332-struct Select * cJSON_GetSelectValue(const cJSON * j);
3333-cJSON * cJSON_CreateSelect(const struct Select * x);
3334-char * cJSON_PrintSelect(const struct Select * x);
3335-void cJSON_DeleteSelect(struct Select * x);
3336-
33373363 struct Obj4 * cJSON_ParseObj4(const char * s);
33383364 struct Obj4 * cJSON_GetObj4Value(const cJSON * j);
33393365 cJSON * cJSON_CreateObj4(const struct Obj4 * x);
@@ -3478,12 +3504,6 @@ cJSON * cJSON_CreateUnion(const struct Union * x);
34783504 char * cJSON_PrintUnion(const struct Union * x);
34793505 void cJSON_DeleteUnion(struct Union * x);
34803506
3481-struct Unsigned * cJSON_ParseUnsigned(const char * s);
3482-struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j);
3483-cJSON * cJSON_CreateUnsigned(const struct Unsigned * x);
3484-char * cJSON_PrintUnsigned(const struct Unsigned * x);
3485-void cJSON_DeleteUnsigned(struct Unsigned * x);
3486-
34873507 struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s);
34883508 struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j);
34893509 cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x);
@@ -3496,6 +3516,12 @@ cJSON * cJSON_CreateObj5True(const struct Obj5True * x);
34963516 char * cJSON_PrintObj5True(const struct Obj5True * x);
34973517 void cJSON_DeleteObj5True(struct Obj5True * x);
34983518
3519+struct Select * cJSON_ParseSelect(const char * s);
3520+struct Select * cJSON_GetSelectValue(const cJSON * j);
3521+cJSON * cJSON_CreateSelect(const struct Select * x);
3522+char * cJSON_PrintSelect(const struct Select * x);
3523+void cJSON_DeleteSelect(struct Select * x);
3524+
34993525 struct Self * cJSON_ParseSelf(const char * s);
35003526 struct Self * cJSON_GetSelfValue(const cJSON * j);
35013527 cJSON * cJSON_CreateSelf(const struct Self * x);
@@ -3640,6 +3666,12 @@ cJSON * cJSON_CreateTimeZone(const struct TimeZone * x);
36403666 char * cJSON_PrintTimeZone(const struct TimeZone * x);
36413667 void cJSON_DeleteTimeZone(struct TimeZone * x);
36423668
3669+struct ToDict * cJSON_ParseToDict(const char * s);
3670+struct ToDict * cJSON_GetToDictValue(const cJSON * j);
3671+cJSON * cJSON_CreateToDict(const struct ToDict * x);
3672+char * cJSON_PrintToDict(const struct ToDict * x);
3673+void cJSON_DeleteToDict(struct ToDict * x);
3674+
36433675 struct ToJson * cJSON_ParseToJson(const char * s);
36443676 struct ToJson * cJSON_GetToJsonValue(const cJSON * j);
36453677 cJSON * cJSON_CreateToJson(const struct ToJson * x);
@@ -3700,6 +3732,12 @@ cJSON * cJSON_CreateUndefined(const struct Undefined * x);
37003732 char * cJSON_PrintUndefined(const struct Undefined * x);
37013733 void cJSON_DeleteUndefined(struct Undefined * x);
37023734
3735+struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s);
3736+struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j);
3737+cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x);
3738+char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x);
3739+void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x);
3740+
37033741 struct Unowned * cJSON_ParseUnowned(const char * s);
37043742 struct Unowned * cJSON_GetUnownedValue(const cJSON * j);
37053743 cJSON * cJSON_CreateUnowned(const struct Unowned * x);
@@ -3718,18 +3756,18 @@ cJSON * cJSON_CreateUseSerializers(const struct UseSerializers * x);
37183756 char * cJSON_PrintUseSerializers(const struct UseSerializers * x);
37193757 void cJSON_DeleteUseSerializers(struct UseSerializers * x);
37203758
3721-struct Ushort * cJSON_ParseUshort(const char * s);
3722-struct Ushort * cJSON_GetUshortValue(const cJSON * j);
3723-cJSON * cJSON_CreateUshort(const struct Ushort * x);
3724-char * cJSON_PrintUshort(const struct Ushort * x);
3725-void cJSON_DeleteUshort(struct Ushort * x);
3726-
37273759 struct Obj5 * cJSON_ParseObj5(const char * s);
37283760 struct Obj5 * cJSON_GetObj5Value(const cJSON * j);
37293761 cJSON * cJSON_CreateObj5(const struct Obj5 * x);
37303762 char * cJSON_PrintObj5(const struct Obj5 * x);
37313763 void cJSON_DeleteObj5(struct Obj5 * x);
37323764
3765+struct Unsigned * cJSON_ParseUnsigned(const char * s);
3766+struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j);
3767+cJSON * cJSON_CreateUnsigned(const struct Unsigned * x);
3768+char * cJSON_PrintUnsigned(const struct Unsigned * x);
3769+void cJSON_DeleteUnsigned(struct Unsigned * x);
3770+
37333771 struct Using * cJSON_ParseUsing(const char * s);
37343772 struct Using * cJSON_GetUsingValue(const cJSON * j);
37353773 cJSON * cJSON_CreateUsing(const struct Using * x);
@@ -3778,6 +3816,12 @@ cJSON * cJSON_CreateXorEq(const struct XorEq * x);
37783816 char * cJSON_PrintXorEq(const struct XorEq * x);
37793817 void cJSON_DeleteXorEq(struct XorEq * x);
37803818
3819+struct Ushort * cJSON_ParseUshort(const char * s);
3820+struct Ushort * cJSON_GetUshortValue(const cJSON * j);
3821+cJSON * cJSON_CreateUshort(const struct Ushort * x);
3822+char * cJSON_PrintUshort(const struct Ushort * x);
3823+void cJSON_DeleteUshort(struct Ushort * x);
3824+
37813825 struct Utf8JsonReader * cJSON_ParseUtf8JsonReader(const char * s);
37823826 struct Utf8JsonReader * cJSON_GetUtf8JsonReaderValue(const cJSON * j);
37833827 cJSON * cJSON_CreateUtf8JsonReader(const struct Utf8JsonReader * x);
Mcplusplusdefault / quicktype.hpp+314 −174
@@ -1823,6 +1823,20 @@ namespace quicktype {
18231823 void set_from(const int64_t & value) { this->from = value; }
18241824 };
18251825
1826+ class FromDict {
1827+ public:
1828+ FromDict() = default;
1829+ virtual ~FromDict() = default;
1830+
1831+ private:
1832+ int64_t from_dict;
1833+
1834+ public:
1835+ const int64_t & get_from_dict() const { return from_dict; }
1836+ int64_t & get_mutable_from_dict() { return from_dict; }
1837+ void set_from_dict(const int64_t & value) { this->from_dict = value; }
1838+ };
1839+
18261840 class FromJson {
18271841 public:
18281842 FromJson() = default;
@@ -2131,20 +2145,6 @@ namespace quicktype {
21312145 void set_friend_friend(const int64_t & value) { this->friend_friend = value; }
21322146 };
21332147
2134- class Goto {
2135- public:
2136- Goto() = default;
2137- virtual ~Goto() = default;
2138-
2139- private:
2140- int64_t goto_goto;
2141-
2142- public:
2143- const int64_t & get_goto_goto() const { return goto_goto; }
2144- int64_t & get_mutable_goto_goto() { return goto_goto; }
2145- void set_goto_goto(const int64_t & value) { this->goto_goto = value; }
2146- };
2147-
21482148 class FalseClass {
21492149 public:
21502150 FalseClass() = default;
@@ -2206,6 +2206,7 @@ namespace quicktype {
22062206 Foreach foreach;
22072207 FormatException format_exception;
22082208 From from;
2209+ FromDict from_dict;
22092210 FromJson from_json;
22102211 Func func;
22112212 Function function;
@@ -2228,7 +2229,6 @@ namespace quicktype {
22282229 Float obj2_float;
22292230 For obj2_for;
22302231 Friend obj2_friend;
2231- Goto obj2_goto;
22322232 FalseClass purple_false;
22332233
22342234 public:
@@ -2396,6 +2396,10 @@ namespace quicktype {
23962396 From & get_mutable_from() { return from; }
23972397 void set_from(const From & value) { this->from = value; }
23982398
2399+ const FromDict & get_from_dict() const { return from_dict; }
2400+ FromDict & get_mutable_from_dict() { return from_dict; }
2401+ void set_from_dict(const FromDict & value) { this->from_dict = value; }
2402+
23992403 const FromJson & get_from_json() const { return from_json; }
24002404 FromJson & get_mutable_from_json() { return from_json; }
24012405 void set_from_json(const FromJson & value) { this->from_json = value; }
@@ -2484,10 +2488,6 @@ namespace quicktype {
24842488 Friend & get_mutable_obj2_friend() { return obj2_friend; }
24852489 void set_obj2_friend(const Friend & value) { this->obj2_friend = value; }
24862490
2487- const Goto & get_obj2_goto() const { return obj2_goto; }
2488- Goto & get_mutable_obj2_goto() { return obj2_goto; }
2489- void set_obj2_goto(const Goto & value) { this->obj2_goto = value; }
2490-
24912491 const FalseClass & get_purple_false() const { return purple_false; }
24922492 FalseClass & get_mutable_purple_false() { return purple_false; }
24932493 void set_purple_false(const FalseClass & value) { this->purple_false = value; }
@@ -3165,6 +3165,20 @@ namespace quicktype {
31653165 void set_map_entry(const int64_t & value) { this->map_entry = value; }
31663166 };
31673167
3168+ class MarshalJson {
3169+ public:
3170+ MarshalJson() = default;
3171+ virtual ~MarshalJson() = default;
3172+
3173+ private:
3174+ int64_t marshal_json;
3175+
3176+ public:
3177+ const int64_t & get_marshal_json() const { return marshal_json; }
3178+ int64_t & get_mutable_marshal_json() { return marshal_json; }
3179+ void set_marshal_json(const int64_t & value) { this->marshal_json = value; }
3180+ };
3181+
31683182 class MetadataPropertyHandling {
31693183 public:
31703184 MetadataPropertyHandling() = default;
@@ -3249,6 +3263,20 @@ namespace quicktype {
32493263 void set_no(const int64_t & value) { this->no = value; }
32503264 };
32513265
3266+ class Goto {
3267+ public:
3268+ Goto() = default;
3269+ virtual ~Goto() = default;
3270+
3271+ private:
3272+ int64_t goto_goto;
3273+
3274+ public:
3275+ const int64_t & get_goto_goto() const { return goto_goto; }
3276+ int64_t & get_mutable_goto_goto() { return goto_goto; }
3277+ void set_goto_goto(const int64_t & value) { this->goto_goto = value; }
3278+ };
3279+
32523280 class If {
32533281 public:
32543282 If() = default;
@@ -3375,20 +3403,6 @@ namespace quicktype {
33753403 void set_new_new(const int64_t & value) { this->new_new = value; }
33763404 };
33773405
3378- class Noexcept {
3379- public:
3380- Noexcept() = default;
3381- virtual ~Noexcept() = default;
3382-
3383- private:
3384- int64_t noexcept_noexcept;
3385-
3386- public:
3387- const int64_t & get_noexcept_noexcept() const { return noexcept_noexcept; }
3388- int64_t & get_mutable_noexcept_noexcept() { return noexcept_noexcept; }
3389- void set_noexcept_noexcept(const int64_t & value) { this->noexcept_noexcept = value; }
3390- };
3391-
33923406 class Obj3 {
33933407 public:
33943408 Obj3() = default;
@@ -3444,12 +3458,14 @@ namespace quicktype {
34443458 Lock lock;
34453459 Map map;
34463460 MapEntry map_entry;
3461+ MarshalJson marshal_json;
34473462 MetadataPropertyHandling metadata_property_handling;
34483463 Mutating mutating;
34493464 Native native;
34503465 Newtonsoft newtonsoft;
34513466 Nil nil;
34523467 No no;
3468+ Goto obj3_goto;
34533469 If obj3_if;
34543470 Import obj3_import;
34553471 Inline obj3_inline;
@@ -3459,7 +3475,6 @@ namespace quicktype {
34593475 Mutable obj3_mutable;
34603476 Namespace obj3_namespace;
34613477 New obj3_new;
3462- Noexcept obj3_noexcept;
34633478
34643479 public:
34653480 const int64_t & get_dummy() const { return dummy; }
@@ -3658,6 +3673,10 @@ namespace quicktype {
36583673 MapEntry & get_mutable_map_entry() { return map_entry; }
36593674 void set_map_entry(const MapEntry & value) { this->map_entry = value; }
36603675
3676+ const MarshalJson & get_marshal_json() const { return marshal_json; }
3677+ MarshalJson & get_mutable_marshal_json() { return marshal_json; }
3678+ void set_marshal_json(const MarshalJson & value) { this->marshal_json = value; }
3679+
36613680 const MetadataPropertyHandling & get_metadata_property_handling() const { return metadata_property_handling; }
36623681 MetadataPropertyHandling & get_mutable_metadata_property_handling() { return metadata_property_handling; }
36633682 void set_metadata_property_handling(const MetadataPropertyHandling & value) { this->metadata_property_handling = value; }
@@ -3682,6 +3701,10 @@ namespace quicktype {
36823701 No & get_mutable_no() { return no; }
36833702 void set_no(const No & value) { this->no = value; }
36843703
3704+ const Goto & get_obj3_goto() const { return obj3_goto; }
3705+ Goto & get_mutable_obj3_goto() { return obj3_goto; }
3706+ void set_obj3_goto(const Goto & value) { this->obj3_goto = value; }
3707+
36853708 const If & get_obj3_if() const { return obj3_if; }
36863709 If & get_mutable_obj3_if() { return obj3_if; }
36873710 void set_obj3_if(const If & value) { this->obj3_if = value; }
@@ -3717,10 +3740,6 @@ namespace quicktype {
37173740 const New & get_obj3_new() const { return obj3_new; }
37183741 New & get_mutable_obj3_new() { return obj3_new; }
37193742 void set_obj3_new(const New & value) { this->obj3_new = value; }
3720-
3721- const Noexcept & get_obj3_noexcept() const { return obj3_noexcept; }
3722- Noexcept & get_mutable_obj3_noexcept() { return obj3_noexcept; }
3723- void set_obj3_noexcept(const Noexcept & value) { this->obj3_noexcept = value; }
37243743 };
37253744
37263745 class NoSuchMethod {
@@ -3863,6 +3882,20 @@ namespace quicktype {
38633882 void set_number(const int64_t & value) { this->number = value; }
38643883 };
38653884
3885+ class Noexcept {
3886+ public:
3887+ Noexcept() = default;
3888+ virtual ~Noexcept() = default;
3889+
3890+ private:
3891+ int64_t noexcept_noexcept;
3892+
3893+ public:
3894+ const int64_t & get_noexcept_noexcept() const { return noexcept_noexcept; }
3895+ int64_t & get_mutable_noexcept_noexcept() { return noexcept_noexcept; }
3896+ void set_noexcept_noexcept(const int64_t & value) { this->noexcept_noexcept = value; }
3897+ };
3898+
38663899 class NoneClass {
38673900 public:
38683901 NoneClass() = default;
@@ -4605,20 +4638,6 @@ namespace quicktype {
46054638 void set_sel(const int64_t & value) { this->sel = value; }
46064639 };
46074640
4608- class Select {
4609- public:
4610- Select() = default;
4611- virtual ~Select() = default;
4612-
4613- private:
4614- int64_t select;
4615-
4616- public:
4617- const int64_t & get_select() const { return select; }
4618- int64_t & get_mutable_select() { return select; }
4619- void set_select(const int64_t & value) { this->select = value; }
4620- };
4621-
46224641 class Obj4 {
46234642 public:
46244643 Obj4() = default;
@@ -4636,6 +4655,7 @@ namespace quicktype {
46364655 NsString ns_string;
46374656 Null null;
46384657 Number number;
4658+ Noexcept obj4_noexcept;
46394659 NoneClass obj4_none;
46404660 Not obj4_not;
46414661 NotEq obj4_not_eq;
@@ -4689,7 +4709,6 @@ namespace quicktype {
46894709 Sbyte sbyte;
46904710 Sealed sealed;
46914711 Sel sel;
4692- Select select;
46934712
46944713 public:
46954714 const int64_t & get_dummy() const { return dummy; }
@@ -4736,6 +4755,10 @@ namespace quicktype {
47364755 Number & get_mutable_number() { return number; }
47374756 void set_number(const Number & value) { this->number = value; }
47384757
4758+ const Noexcept & get_obj4_noexcept() const { return obj4_noexcept; }
4759+ Noexcept & get_mutable_obj4_noexcept() { return obj4_noexcept; }
4760+ void set_obj4_noexcept(const Noexcept & value) { this->obj4_noexcept = value; }
4761+
47394762 const NoneClass & get_obj4_none() const { return obj4_none; }
47404763 NoneClass & get_mutable_obj4_none() { return obj4_none; }
47414764 void set_obj4_none(const NoneClass & value) { this->obj4_none = value; }
@@ -4947,10 +4970,6 @@ namespace quicktype {
49474970 const Sel & get_sel() const { return sel; }
49484971 Sel & get_mutable_sel() { return sel; }
49494972 void set_sel(const Sel & value) { this->sel = value; }
4950-
4951- const Select & get_select() const { return select; }
4952- Select & get_mutable_select() { return select; }
4953- void set_select(const Select & value) { this->select = value; }
49544973 };
49554974
49564975 class KSerializer {
@@ -5261,20 +5280,6 @@ namespace quicktype {
52615280 void set_union_union(const int64_t & value) { this->union_union = value; }
52625281 };
52635282
5264- class Unsigned {
5265- public:
5266- Unsigned() = default;
5267- virtual ~Unsigned() = default;
5268-
5269- private:
5270- int64_t unsigned_unsigned;
5271-
5272- public:
5273- const int64_t & get_unsigned_unsigned() const { return unsigned_unsigned; }
5274- int64_t & get_mutable_unsigned_unsigned() { return unsigned_unsigned; }
5275- void set_unsigned_unsigned(const int64_t & value) { this->unsigned_unsigned = value; }
5276- };
5277-
52785283 class PrimitiveKind {
52795284 public:
52805285 PrimitiveKind() = default;
@@ -5303,6 +5308,20 @@ namespace quicktype {
53035308 void set_true_true(const int64_t & value) { this->true_true = value; }
53045309 };
53055310
5311+ class Select {
5312+ public:
5313+ Select() = default;
5314+ virtual ~Select() = default;
5315+
5316+ private:
5317+ int64_t select;
5318+
5319+ public:
5320+ const int64_t & get_select() const { return select; }
5321+ int64_t & get_mutable_select() { return select; }
5322+ void set_select(const int64_t & value) { this->select = value; }
5323+ };
5324+
53065325 class Self {
53075326 public:
53085327 Self() = default;
@@ -5639,6 +5658,20 @@ namespace quicktype {
56395658 void set_time_zone(const int64_t & value) { this->time_zone = value; }
56405659 };
56415660
5661+ class ToDict {
5662+ public:
5663+ ToDict() = default;
5664+ virtual ~ToDict() = default;
5665+
5666+ private:
5667+ int64_t to_dict;
5668+
5669+ public:
5670+ const int64_t & get_to_dict() const { return to_dict; }
5671+ int64_t & get_mutable_to_dict() { return to_dict; }
5672+ void set_to_dict(const int64_t & value) { this->to_dict = value; }
5673+ };
5674+
56425675 class ToJson {
56435676 public:
56445677 ToJson() = default;
@@ -5793,6 +5826,20 @@ namespace quicktype {
57935826 void set_undefined(const int64_t & value) { this->undefined = value; }
57945827 };
57955828
5829+ class UnmarshalJson {
5830+ public:
5831+ UnmarshalJson() = default;
5832+ virtual ~UnmarshalJson() = default;
5833+
5834+ private:
5835+ int64_t unmarshal_json;
5836+
5837+ public:
5838+ const int64_t & get_unmarshal_json() const { return unmarshal_json; }
5839+ int64_t & get_mutable_unmarshal_json() { return unmarshal_json; }
5840+ void set_unmarshal_json(const int64_t & value) { this->unmarshal_json = value; }
5841+ };
5842+
57965843 class Unowned {
57975844 public:
57985845 Unowned() = default;
@@ -5835,20 +5882,6 @@ namespace quicktype {
58355882 void set_use_serializers(const int64_t & value) { this->use_serializers = value; }
58365883 };
58375884
5838- class Ushort {
5839- public:
5840- Ushort() = default;
5841- virtual ~Ushort() = default;
5842-
5843- private:
5844- int64_t ushort;
5845-
5846- public:
5847- const int64_t & get_ushort() const { return ushort; }
5848- int64_t & get_mutable_ushort() { return ushort; }
5849- void set_ushort(const int64_t & value) { this->ushort = value; }
5850- };
5851-
58525885 class Obj5 {
58535886 public:
58545887 Obj5() = default;
@@ -5878,9 +5911,9 @@ namespace quicktype {
58785911 Typeid obj5_typeid;
58795912 Typename obj5_typename;
58805913 Union obj5_union;
5881- Unsigned obj5_unsigned;
58825914 PrimitiveKind primitive_kind;
58835915 TrueClass purple_true;
5916+ Select select;
58845917 Self self;
58855918 Sendable sendable;
58865919 SerialDescriptor serial_descriptor;
@@ -5905,6 +5938,7 @@ namespace quicktype {
59055938 TimeOnly time_only;
59065939 TimeOnlyConverter time_only_converter;
59075940 TimeZone time_zone;
5941+ ToDict to_dict;
59085942 ToJson to_json;
59095943 ToString to_string;
59105944 TopLevelClass top_level;
@@ -5916,10 +5950,10 @@ namespace quicktype {
59165950 Ulong ulong;
59175951 Unchecked unchecked;
59185952 Undefined undefined;
5953+ UnmarshalJson unmarshal_json;
59195954 Unowned unowned;
59205955 Unsafe unsafe;
59215956 UseSerializers use_serializers;
5922- Ushort ushort;
59235957
59245958 public:
59255959 const int64_t & get_dummy() const { return dummy; }
@@ -6014,10 +6048,6 @@ namespace quicktype {
60146048 Union & get_mutable_obj5_union() { return obj5_union; }
60156049 void set_obj5_union(const Union & value) { this->obj5_union = value; }
60166050
6017- const Unsigned & get_obj5_unsigned() const { return obj5_unsigned; }
6018- Unsigned & get_mutable_obj5_unsigned() { return obj5_unsigned; }
6019- void set_obj5_unsigned(const Unsigned & value) { this->obj5_unsigned = value; }
6020-
60216051 const PrimitiveKind & get_primitive_kind() const { return primitive_kind; }
60226052 PrimitiveKind & get_mutable_primitive_kind() { return primitive_kind; }
60236053 void set_primitive_kind(const PrimitiveKind & value) { this->primitive_kind = value; }
@@ -6026,6 +6056,10 @@ namespace quicktype {
60266056 TrueClass & get_mutable_purple_true() { return purple_true; }
60276057 void set_purple_true(const TrueClass & value) { this->purple_true = value; }
60286058
6059+ const Select & get_select() const { return select; }
6060+ Select & get_mutable_select() { return select; }
6061+ void set_select(const Select & value) { this->select = value; }
6062+
60296063 const Self & get_self() const { return self; }
60306064 Self & get_mutable_self() { return self; }
60316065 void set_self(const Self & value) { this->self = value; }
@@ -6122,6 +6156,10 @@ namespace quicktype {
61226156 TimeZone & get_mutable_time_zone() { return time_zone; }
61236157 void set_time_zone(const TimeZone & value) { this->time_zone = value; }
61246158
6159+ const ToDict & get_to_dict() const { return to_dict; }
6160+ ToDict & get_mutable_to_dict() { return to_dict; }
6161+ void set_to_dict(const ToDict & value) { this->to_dict = value; }
6162+
61256163 const ToJson & get_to_json() const { return to_json; }
61266164 ToJson & get_mutable_to_json() { return to_json; }
61276165 void set_to_json(const ToJson & value) { this->to_json = value; }
@@ -6166,6 +6204,10 @@ namespace quicktype {
61666204 Undefined & get_mutable_undefined() { return undefined; }
61676205 void set_undefined(const Undefined & value) { this->undefined = value; }
61686206
6207+ const UnmarshalJson & get_unmarshal_json() const { return unmarshal_json; }
6208+ UnmarshalJson & get_mutable_unmarshal_json() { return unmarshal_json; }
6209+ void set_unmarshal_json(const UnmarshalJson & value) { this->unmarshal_json = value; }
6210+
61696211 const Unowned & get_unowned() const { return unowned; }
61706212 Unowned & get_mutable_unowned() { return unowned; }
61716213 void set_unowned(const Unowned & value) { this->unowned = value; }
@@ -6177,10 +6219,20 @@ namespace quicktype {
61776219 const UseSerializers & get_use_serializers() const { return use_serializers; }
61786220 UseSerializers & get_mutable_use_serializers() { return use_serializers; }
61796221 void set_use_serializers(const UseSerializers & value) { this->use_serializers = value; }
6222+ };
61806223
6181- const Ushort & get_ushort() const { return ushort; }
6182- Ushort & get_mutable_ushort() { return ushort; }
6183- void set_ushort(const Ushort & value) { this->ushort = value; }
6224+ class Unsigned {
6225+ public:
6226+ Unsigned() = default;
6227+ virtual ~Unsigned() = default;
6228+
6229+ private:
6230+ int64_t unsigned_unsigned;
6231+
6232+ public:
6233+ const int64_t & get_unsigned_unsigned() const { return unsigned_unsigned; }
6234+ int64_t & get_mutable_unsigned_unsigned() { return unsigned_unsigned; }
6235+ void set_unsigned_unsigned(const int64_t & value) { this->unsigned_unsigned = value; }
61846236 };
61856237
61866238 class Using {
@@ -6295,6 +6347,20 @@ namespace quicktype {
62956347 void set_xor_eq_xor_eq(const int64_t & value) { this->xor_eq_xor_eq = value; }
62966348 };
62976349
6350+ class Ushort {
6351+ public:
6352+ Ushort() = default;
6353+ virtual ~Ushort() = default;
6354+
6355+ private:
6356+ int64_t ushort;
6357+
6358+ public:
6359+ const int64_t & get_ushort() const { return ushort; }
6360+ int64_t & get_mutable_ushort() { return ushort; }
6361+ void set_ushort(const int64_t & value) { this->ushort = value; }
6362+ };
6363+
62986364 class Utf8JsonReader {
62996365 public:
63006366 Utf8JsonReader() = default;
@@ -6442,6 +6508,7 @@ namespace quicktype {
64426508
64436509 private:
64446510 int64_t dummy;
6511+ Unsigned obj6_unsigned;
64456512 Using obj6_using;
64466513 Virtual obj6_virtual;
64476514 Void obj6_void;
@@ -6450,6 +6517,7 @@ namespace quicktype {
64506517 While obj6_while;
64516518 Xor obj6_xor;
64526519 XorEq obj6_xor_eq;
6520+ Ushort ushort;
64536521 Utf8JsonReader utf8_json_reader;
64546522 Utf8JsonWriter utf8_json_writer;
64556523 Uuid uuid;
@@ -6466,6 +6534,10 @@ namespace quicktype {
64666534 int64_t & get_mutable_dummy() { return dummy; }
64676535 void set_dummy(const int64_t & value) { this->dummy = value; }
64686536
6537+ const Unsigned & get_obj6_unsigned() const { return obj6_unsigned; }
6538+ Unsigned & get_mutable_obj6_unsigned() { return obj6_unsigned; }
6539+ void set_obj6_unsigned(const Unsigned & value) { this->obj6_unsigned = value; }
6540+
64696541 const Using & get_obj6_using() const { return obj6_using; }
64706542 Using & get_mutable_obj6_using() { return obj6_using; }
64716543 void set_obj6_using(const Using & value) { this->obj6_using = value; }
@@ -6498,6 +6570,10 @@ namespace quicktype {
64986570 XorEq & get_mutable_obj6_xor_eq() { return obj6_xor_eq; }
64996571 void set_obj6_xor_eq(const XorEq & value) { this->obj6_xor_eq = value; }
65006572
6573+ const Ushort & get_ushort() const { return ushort; }
6574+ Ushort & get_mutable_ushort() { return ushort; }
6575+ void set_ushort(const Ushort & value) { this->ushort = value; }
6576+
65016577 const Utf8JsonReader & get_utf8_json_reader() const { return utf8_json_reader; }
65026578 Utf8JsonReader & get_mutable_utf8_json_reader() { return utf8_json_reader; }
65036579 void set_utf8_json_reader(const Utf8JsonReader & value) { this->utf8_json_reader = value; }
@@ -6900,6 +6976,9 @@ namespace quicktype {
69006976 void from_json(const json & j, From & x);
69016977 void to_json(json & j, const From & x);
69026978
6979+ void from_json(const json & j, FromDict & x);
6980+ void to_json(json & j, const FromDict & x);
6981+
69036982 void from_json(const json & j, FromJson & x);
69046983 void to_json(json & j, const FromJson & x);
69056984
@@ -6966,9 +7045,6 @@ namespace quicktype {
69667045 void from_json(const json & j, Friend & x);
69677046 void to_json(json & j, const Friend & x);
69687047
6969- void from_json(const json & j, Goto & x);
6970- void to_json(json & j, const Goto & x);
6971-
69727048 void from_json(const json & j, FalseClass & x);
69737049 void to_json(json & j, const FalseClass & x);
69747050
@@ -7119,6 +7195,9 @@ namespace quicktype {
71197195 void from_json(const json & j, MapEntry & x);
71207196 void to_json(json & j, const MapEntry & x);
71217197
7198+ void from_json(const json & j, MarshalJson & x);
7199+ void to_json(json & j, const MarshalJson & x);
7200+
71227201 void from_json(const json & j, MetadataPropertyHandling & x);
71237202 void to_json(json & j, const MetadataPropertyHandling & x);
71247203
@@ -7137,6 +7216,9 @@ namespace quicktype {
71377216 void from_json(const json & j, No & x);
71387217 void to_json(json & j, const No & x);
71397218
7219+ void from_json(const json & j, Goto & x);
7220+ void to_json(json & j, const Goto & x);
7221+
71407222 void from_json(const json & j, If & x);
71417223 void to_json(json & j, const If & x);
71427224
@@ -7164,9 +7246,6 @@ namespace quicktype {
71647246 void from_json(const json & j, New & x);
71657247 void to_json(json & j, const New & x);
71667248
7167- void from_json(const json & j, Noexcept & x);
7168- void to_json(json & j, const Noexcept & x);
7169-
71707249 void from_json(const json & j, Obj3 & x);
71717250 void to_json(json & j, const Obj3 & x);
71727251
@@ -7200,6 +7279,9 @@ namespace quicktype {
72007279 void from_json(const json & j, Number & x);
72017280 void to_json(json & j, const Number & x);
72027281
7282+ void from_json(const json & j, Noexcept & x);
7283+ void to_json(json & j, const Noexcept & x);
7284+
72037285 void from_json(const json & j, NoneClass & x);
72047286 void to_json(json & j, const NoneClass & x);
72057287
@@ -7359,9 +7441,6 @@ namespace quicktype {
73597441 void from_json(const json & j, Sel & x);
73607442 void to_json(json & j, const Sel & x);
73617443
7362- void from_json(const json & j, Select & x);
7363- void to_json(json & j, const Select & x);
7364-
73657444 void from_json(const json & j, Obj4 & x);
73667445 void to_json(json & j, const Obj4 & x);
73677446
@@ -7431,15 +7510,15 @@ namespace quicktype {
74317510 void from_json(const json & j, Union & x);
74327511 void to_json(json & j, const Union & x);
74337512
7434- void from_json(const json & j, Unsigned & x);
7435- void to_json(json & j, const Unsigned & x);
7436-
74377513 void from_json(const json & j, PrimitiveKind & x);
74387514 void to_json(json & j, const PrimitiveKind & x);
74397515
74407516 void from_json(const json & j, TrueClass & x);
74417517 void to_json(json & j, const TrueClass & x);
74427518
7519+ void from_json(const json & j, Select & x);
7520+ void to_json(json & j, const Select & x);
7521+
74437522 void from_json(const json & j, Self & x);
74447523 void to_json(json & j, const Self & x);
74457524
@@ -7512,6 +7591,9 @@ namespace quicktype {
75127591 void from_json(const json & j, TimeZone & x);
75137592 void to_json(json & j, const TimeZone & x);
75147593
7594+ void from_json(const json & j, ToDict & x);
7595+ void to_json(json & j, const ToDict & x);
7596+
75157597 void from_json(const json & j, ToJson & x);
75167598 void to_json(json & j, const ToJson & x);
75177599
@@ -7545,6 +7627,9 @@ namespace quicktype {
75457627 void from_json(const json & j, Undefined & x);
75467628 void to_json(json & j, const Undefined & x);
75477629
7630+ void from_json(const json & j, UnmarshalJson & x);
7631+ void to_json(json & j, const UnmarshalJson & x);
7632+
75487633 void from_json(const json & j, Unowned & x);
75497634 void to_json(json & j, const Unowned & x);
75507635
@@ -7554,12 +7639,12 @@ namespace quicktype {
75547639 void from_json(const json & j, UseSerializers & x);
75557640 void to_json(json & j, const UseSerializers & x);
75567641
7557- void from_json(const json & j, Ushort & x);
7558- void to_json(json & j, const Ushort & x);
7559-
75607642 void from_json(const json & j, Obj5 & x);
75617643 void to_json(json & j, const Obj5 & x);
75627644
7645+ void from_json(const json & j, Unsigned & x);
7646+ void to_json(json & j, const Unsigned & x);
7647+
75637648 void from_json(const json & j, Using & x);
75647649 void to_json(json & j, const Using & x);
75657650
@@ -7584,6 +7669,9 @@ namespace quicktype {
75847669 void from_json(const json & j, XorEq & x);
75857670 void to_json(json & j, const XorEq & x);
75867671
7672+ void from_json(const json & j, Ushort & x);
7673+ void to_json(json & j, const Ushort & x);
7674+
75877675 void from_json(const json & j, Utf8JsonReader & x);
75887676 void to_json(json & j, const Utf8JsonReader & x);
75897677
@@ -8905,6 +8993,17 @@ namespace quicktype {
89058993 j["from"] = x.get_from();
89068994 }
89078995
8996+ inline void from_json(const json & j, FromDict& x) {
8997+ if (!j.is_object()) throw std::runtime_error("Expected object");
8998+ if (j.find("from_dict") != j.end() && !j.at("from_dict").is_number_integer()) throw std::runtime_error("Expected integer");
8999+ x.set_from_dict(j.at("from_dict").get<int64_t>());
9000+ }
9001+
9002+ inline void to_json(json & j, const FromDict & x) {
9003+ j = json::object();
9004+ j["from_dict"] = x.get_from_dict();
9005+ }
9006+
89089007 inline void from_json(const json & j, FromJson& x) {
89099008 if (!j.is_object()) throw std::runtime_error("Expected object");
89109009 if (j.find("from_json") != j.end() && !j.at("from_json").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -9147,17 +9246,6 @@ namespace quicktype {
91479246 j["friend"] = x.get_friend_friend();
91489247 }
91499248
9150- inline void from_json(const json & j, Goto& x) {
9151- if (!j.is_object()) throw std::runtime_error("Expected object");
9152- if (j.find("goto") != j.end() && !j.at("goto").is_number_integer()) throw std::runtime_error("Expected integer");
9153- x.set_goto_goto(j.at("goto").get<int64_t>());
9154- }
9155-
9156- inline void to_json(json & j, const Goto & x) {
9157- j = json::object();
9158- j["goto"] = x.get_goto_goto();
9159- }
9160-
91619249 inline void from_json(const json & j, FalseClass& x) {
91629250 if (!j.is_object()) throw std::runtime_error("Expected object");
91639251 if (j.find("false") != j.end() && !j.at("false").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -9213,6 +9301,7 @@ namespace quicktype {
92139301 x.set_foreach(j.at("foreach").get<Foreach>());
92149302 x.set_format_exception(j.at("FormatException").get<FormatException>());
92159303 x.set_from(j.at("from").get<From>());
9304+ x.set_from_dict(j.at("from_dict").get<FromDict>());
92169305 x.set_from_json(j.at("from_json").get<FromJson>());
92179306 x.set_func(j.at("func").get<Func>());
92189307 x.set_function(j.at("function").get<Function>());
@@ -9235,7 +9324,6 @@ namespace quicktype {
92359324 x.set_obj2_float(j.at("float").get<Float>());
92369325 x.set_obj2_for(j.at("for").get<For>());
92379326 x.set_obj2_friend(j.at("friend").get<Friend>());
9238- x.set_obj2_goto(j.at("goto").get<Goto>());
92399327 x.set_purple_false(j.at("false").get<FalseClass>());
92409328 }
92419329
@@ -9282,6 +9370,7 @@ namespace quicktype {
92829370 j["foreach"] = x.get_foreach();
92839371 j["FormatException"] = x.get_format_exception();
92849372 j["from"] = x.get_from();
9373+ j["from_dict"] = x.get_from_dict();
92859374 j["from_json"] = x.get_from_json();
92869375 j["func"] = x.get_func();
92879376 j["function"] = x.get_function();
@@ -9304,7 +9393,6 @@ namespace quicktype {
93049393 j["float"] = x.get_obj2_float();
93059394 j["for"] = x.get_obj2_for();
93069395 j["friend"] = x.get_obj2_friend();
9307- j["goto"] = x.get_obj2_goto();
93089396 j["false"] = x.get_purple_false();
93099397 }
93109398
@@ -9835,6 +9923,17 @@ namespace quicktype {
98359923 j["MapEntry"] = x.get_map_entry();
98369924 }
98379925
9926+ inline void from_json(const json & j, MarshalJson& x) {
9927+ if (!j.is_object()) throw std::runtime_error("Expected object");
9928+ if (j.find("MarshalJSON") != j.end() && !j.at("MarshalJSON").is_number_integer()) throw std::runtime_error("Expected integer");
9929+ x.set_marshal_json(j.at("MarshalJSON").get<int64_t>());
9930+ }
9931+
9932+ inline void to_json(json & j, const MarshalJson & x) {
9933+ j = json::object();
9934+ j["MarshalJSON"] = x.get_marshal_json();
9935+ }
9936+
98389937 inline void from_json(const json & j, MetadataPropertyHandling& x) {
98399938 if (!j.is_object()) throw std::runtime_error("Expected object");
98409939 if (j.find("metadata_property_handling") != j.end() && !j.at("metadata_property_handling").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -9901,6 +10000,17 @@ namespace quicktype {
990110000 j["NO"] = x.get_no();
990210001 }
990310002
10003+ inline void from_json(const json & j, Goto& x) {
10004+ if (!j.is_object()) throw std::runtime_error("Expected object");
10005+ if (j.find("goto") != j.end() && !j.at("goto").is_number_integer()) throw std::runtime_error("Expected integer");
10006+ x.set_goto_goto(j.at("goto").get<int64_t>());
10007+ }
10008+
10009+ inline void to_json(json & j, const Goto & x) {
10010+ j = json::object();
10011+ j["goto"] = x.get_goto_goto();
10012+ }
10013+
990410014 inline void from_json(const json & j, If& x) {
990510015 if (!j.is_object()) throw std::runtime_error("Expected object");
990610016 if (j.find("if") != j.end() && !j.at("if").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -10000,17 +10110,6 @@ namespace quicktype {
1000010110 j["new"] = x.get_new_new();
1000110111 }
1000210112
10003- inline void from_json(const json & j, Noexcept& x) {
10004- if (!j.is_object()) throw std::runtime_error("Expected object");
10005- if (j.find("noexcept") != j.end() && !j.at("noexcept").is_number_integer()) throw std::runtime_error("Expected integer");
10006- x.set_noexcept_noexcept(j.at("noexcept").get<int64_t>());
10007- }
10008-
10009- inline void to_json(json & j, const Noexcept & x) {
10010- j = json::object();
10011- j["noexcept"] = x.get_noexcept_noexcept();
10012- }
10013-
1001410113 inline void from_json(const json & j, Obj3& x) {
1001510114 if (!j.is_object()) throw std::runtime_error("Expected object");
1001610115 if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -10063,12 +10162,14 @@ namespace quicktype {
1006310162 x.set_lock(j.at("lock").get<Lock>());
1006410163 x.set_map(j.at("map").get<Map>());
1006510164 x.set_map_entry(j.at("MapEntry").get<MapEntry>());
10165+ x.set_marshal_json(j.at("MarshalJSON").get<MarshalJson>());
1006610166 x.set_metadata_property_handling(j.at("metadata_property_handling").get<MetadataPropertyHandling>());
1006710167 x.set_mutating(j.at("mutating").get<Mutating>());
1006810168 x.set_native(j.at("native").get<Native>());
1006910169 x.set_newtonsoft(j.at("newtonsoft").get<Newtonsoft>());
1007010170 x.set_nil(j.at("nil").get<Nil>());
1007110171 x.set_no(j.at("NO").get<No>());
10172+ x.set_obj3_goto(j.at("goto").get<Goto>());
1007210173 x.set_obj3_if(j.at("if").get<If>());
1007310174 x.set_obj3_import(j.at("import").get<Import>());
1007410175 x.set_obj3_inline(j.at("inline").get<Inline>());
@@ -10078,7 +10179,6 @@ namespace quicktype {
1007810179 x.set_obj3_mutable(j.at("mutable").get<Mutable>());
1007910180 x.set_obj3_namespace(j.at("namespace").get<Namespace>());
1008010181 x.set_obj3_new(j.at("new").get<New>());
10081- x.set_obj3_noexcept(j.at("noexcept").get<Noexcept>());
1008210182 }
1008310183
1008410184 inline void to_json(json & j, const Obj3 & x) {
@@ -10132,12 +10232,14 @@ namespace quicktype {
1013210232 j["lock"] = x.get_lock();
1013310233 j["map"] = x.get_map();
1013410234 j["MapEntry"] = x.get_map_entry();
10235+ j["MarshalJSON"] = x.get_marshal_json();
1013510236 j["metadata_property_handling"] = x.get_metadata_property_handling();
1013610237 j["mutating"] = x.get_mutating();
1013710238 j["native"] = x.get_native();
1013810239 j["newtonsoft"] = x.get_newtonsoft();
1013910240 j["nil"] = x.get_nil();
1014010241 j["NO"] = x.get_no();
10242+ j["goto"] = x.get_obj3_goto();
1014110243 j["if"] = x.get_obj3_if();
1014210244 j["import"] = x.get_obj3_import();
1014310245 j["inline"] = x.get_obj3_inline();
@@ -10147,7 +10249,6 @@ namespace quicktype {
1014710249 j["mutable"] = x.get_obj3_mutable();
1014810250 j["namespace"] = x.get_obj3_namespace();
1014910251 j["new"] = x.get_obj3_new();
10150- j["noexcept"] = x.get_obj3_noexcept();
1015110252 }
1015210253
1015310254 inline void from_json(const json & j, NoSuchMethod& x) {
@@ -10260,6 +10361,17 @@ namespace quicktype {
1026010361 j["number"] = x.get_number();
1026110362 }
1026210363
10364+ inline void from_json(const json & j, Noexcept& x) {
10365+ if (!j.is_object()) throw std::runtime_error("Expected object");
10366+ if (j.find("noexcept") != j.end() && !j.at("noexcept").is_number_integer()) throw std::runtime_error("Expected integer");
10367+ x.set_noexcept_noexcept(j.at("noexcept").get<int64_t>());
10368+ }
10369+
10370+ inline void to_json(json & j, const Noexcept & x) {
10371+ j = json::object();
10372+ j["noexcept"] = x.get_noexcept_noexcept();
10373+ }
10374+
1026310375 inline void from_json(const json & j, NoneClass& x) {
1026410376 if (!j.is_object()) throw std::runtime_error("Expected object");
1026510377 if (j.find("none") != j.end() && !j.at("none").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -10843,17 +10955,6 @@ namespace quicktype {
1084310955 j["SEL"] = x.get_sel();
1084410956 }
1084510957
10846- inline void from_json(const json & j, Select& x) {
10847- if (!j.is_object()) throw std::runtime_error("Expected object");
10848- if (j.find("select") != j.end() && !j.at("select").is_number_integer()) throw std::runtime_error("Expected integer");
10849- x.set_select(j.at("select").get<int64_t>());
10850- }
10851-
10852- inline void to_json(json & j, const Select & x) {
10853- j = json::object();
10854- j["select"] = x.get_select();
10855- }
10856-
1085710958 inline void from_json(const json & j, Obj4& x) {
1085810959 if (!j.is_object()) throw std::runtime_error("Expected object");
1085910960 if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -10868,6 +10969,7 @@ namespace quicktype {
1086810969 x.set_ns_string(j.at("NSString").get<NsString>());
1086910970 x.set_null(j.at("NULL").get<Null>());
1087010971 x.set_number(j.at("number").get<Number>());
10972+ x.set_obj4_noexcept(j.at("noexcept").get<Noexcept>());
1087110973 x.set_obj4_none(j.at("none").get<NoneClass>());
1087210974 x.set_obj4_not(j.at("not").get<Not>());
1087310975 x.set_obj4_not_eq(j.at("not_eq").get<NotEq>());
@@ -10921,7 +11023,6 @@ namespace quicktype {
1092111023 x.set_sbyte(j.at("sbyte").get<Sbyte>());
1092211024 x.set_sealed(j.at("sealed").get<Sealed>());
1092311025 x.set_sel(j.at("SEL").get<Sel>());
10924- x.set_select(j.at("select").get<Select>());
1092511026 }
1092611027
1092711028 inline void to_json(json & j, const Obj4 & x) {
@@ -10937,6 +11038,7 @@ namespace quicktype {
1093711038 j["NSString"] = x.get_ns_string();
1093811039 j["NULL"] = x.get_null();
1093911040 j["number"] = x.get_number();
11041+ j["noexcept"] = x.get_obj4_noexcept();
1094011042 j["none"] = x.get_obj4_none();
1094111043 j["not"] = x.get_obj4_not();
1094211044 j["not_eq"] = x.get_obj4_not_eq();
@@ -10990,7 +11092,6 @@ namespace quicktype {
1099011092 j["sbyte"] = x.get_sbyte();
1099111093 j["sealed"] = x.get_sealed();
1099211094 j["SEL"] = x.get_sel();
10993- j["select"] = x.get_select();
1099411095 }
1099511096
1099611097 inline void from_json(const json & j, KSerializer& x) {
@@ -11235,17 +11336,6 @@ namespace quicktype {
1123511336 j["union"] = x.get_union_union();
1123611337 }
1123711338
11238- inline void from_json(const json & j, Unsigned& x) {
11239- if (!j.is_object()) throw std::runtime_error("Expected object");
11240- if (j.find("unsigned") != j.end() && !j.at("unsigned").is_number_integer()) throw std::runtime_error("Expected integer");
11241- x.set_unsigned_unsigned(j.at("unsigned").get<int64_t>());
11242- }
11243-
11244- inline void to_json(json & j, const Unsigned & x) {
11245- j = json::object();
11246- j["unsigned"] = x.get_unsigned_unsigned();
11247- }
11248-
1124911339 inline void from_json(const json & j, PrimitiveKind& x) {
1125011340 if (!j.is_object()) throw std::runtime_error("Expected object");
1125111341 if (j.find("PrimitiveKind") != j.end() && !j.at("PrimitiveKind").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -11268,6 +11358,17 @@ namespace quicktype {
1126811358 j["true"] = x.get_true_true();
1126911359 }
1127011360
11361+ inline void from_json(const json & j, Select& x) {
11362+ if (!j.is_object()) throw std::runtime_error("Expected object");
11363+ if (j.find("select") != j.end() && !j.at("select").is_number_integer()) throw std::runtime_error("Expected integer");
11364+ x.set_select(j.at("select").get<int64_t>());
11365+ }
11366+
11367+ inline void to_json(json & j, const Select & x) {
11368+ j = json::object();
11369+ j["select"] = x.get_select();
11370+ }
11371+
1127111372 inline void from_json(const json & j, Self& x) {
1127211373 if (!j.is_object()) throw std::runtime_error("Expected object");
1127311374 if (j.find("Self") != j.end() && !j.at("Self").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -11532,6 +11633,17 @@ namespace quicktype {
1153211633 j["TimeZone"] = x.get_time_zone();
1153311634 }
1153411635
11636+ inline void from_json(const json & j, ToDict& x) {
11637+ if (!j.is_object()) throw std::runtime_error("Expected object");
11638+ if (j.find("to_dict") != j.end() && !j.at("to_dict").is_number_integer()) throw std::runtime_error("Expected integer");
11639+ x.set_to_dict(j.at("to_dict").get<int64_t>());
11640+ }
11641+
11642+ inline void to_json(json & j, const ToDict & x) {
11643+ j = json::object();
11644+ j["to_dict"] = x.get_to_dict();
11645+ }
11646+
1153511647 inline void from_json(const json & j, ToJson& x) {
1153611648 if (!j.is_object()) throw std::runtime_error("Expected object");
1153711649 if (j.find("to_json") != j.end() && !j.at("to_json").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -11653,6 +11765,17 @@ namespace quicktype {
1165311765 j["undefined"] = x.get_undefined();
1165411766 }
1165511767
11768+ inline void from_json(const json & j, UnmarshalJson& x) {
11769+ if (!j.is_object()) throw std::runtime_error("Expected object");
11770+ if (j.find("UnmarshalJSON") != j.end() && !j.at("UnmarshalJSON").is_number_integer()) throw std::runtime_error("Expected integer");
11771+ x.set_unmarshal_json(j.at("UnmarshalJSON").get<int64_t>());
11772+ }
11773+
11774+ inline void to_json(json & j, const UnmarshalJson & x) {
11775+ j = json::object();
11776+ j["UnmarshalJSON"] = x.get_unmarshal_json();
11777+ }
11778+
1165611779 inline void from_json(const json & j, Unowned& x) {
1165711780 if (!j.is_object()) throw std::runtime_error("Expected object");
1165811781 if (j.find("unowned") != j.end() && !j.at("unowned").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -11686,17 +11809,6 @@ namespace quicktype {
1168611809 j["UseSerializers"] = x.get_use_serializers();
1168711810 }
1168811811
11689- inline void from_json(const json & j, Ushort& x) {
11690- if (!j.is_object()) throw std::runtime_error("Expected object");
11691- if (j.find("ushort") != j.end() && !j.at("ushort").is_number_integer()) throw std::runtime_error("Expected integer");
11692- x.set_ushort(j.at("ushort").get<int64_t>());
11693- }
11694-
11695- inline void to_json(json & j, const Ushort & x) {
11696- j = json::object();
11697- j["ushort"] = x.get_ushort();
11698- }
11699-
1170011812 inline void from_json(const json & j, Obj5& x) {
1170111813 if (!j.is_object()) throw std::runtime_error("Expected object");
1170211814 if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -11723,9 +11835,9 @@ namespace quicktype {
1172311835 x.set_obj5_typeid(j.at("typeid").get<Typeid>());
1172411836 x.set_obj5_typename(j.at("typename").get<Typename>());
1172511837 x.set_obj5_union(j.at("union").get<Union>());
11726- x.set_obj5_unsigned(j.at("unsigned").get<Unsigned>());
1172711838 x.set_primitive_kind(j.at("PrimitiveKind").get<PrimitiveKind>());
1172811839 x.set_purple_true(j.at("true").get<TrueClass>());
11840+ x.set_select(j.at("select").get<Select>());
1172911841 x.set_self(j.at("Self").get<Self>());
1173011842 x.set_sendable(j.at("Sendable").get<Sendable>());
1173111843 x.set_serial_descriptor(j.at("SerialDescriptor").get<SerialDescriptor>());
@@ -11750,6 +11862,7 @@ namespace quicktype {
1175011862 x.set_time_only(j.at("TimeOnly").get<TimeOnly>());
1175111863 x.set_time_only_converter(j.at("TimeOnlyConverter").get<TimeOnlyConverter>());
1175211864 x.set_time_zone(j.at("TimeZone").get<TimeZone>());
11865+ x.set_to_dict(j.at("to_dict").get<ToDict>());
1175311866 x.set_to_json(j.at("to_json").get<ToJson>());
1175411867 x.set_to_string(j.at("toString").get<ToString>());
1175511868 x.set_top_level(j.at("top_level").get<TopLevelClass>());
@@ -11761,10 +11874,10 @@ namespace quicktype {
1176111874 x.set_ulong(j.at("ulong").get<Ulong>());
1176211875 x.set_unchecked(j.at("unchecked").get<Unchecked>());
1176311876 x.set_undefined(j.at("undefined").get<Undefined>());
11877+ x.set_unmarshal_json(j.at("UnmarshalJSON").get<UnmarshalJson>());
1176411878 x.set_unowned(j.at("unowned").get<Unowned>());
1176511879 x.set_unsafe(j.at("unsafe").get<Unsafe>());
1176611880 x.set_use_serializers(j.at("UseSerializers").get<UseSerializers>());
11767- x.set_ushort(j.at("ushort").get<Ushort>());
1176811881 }
1176911882
1177011883 inline void to_json(json & j, const Obj5 & x) {
@@ -11792,9 +11905,9 @@ namespace quicktype {
1179211905 j["typeid"] = x.get_obj5_typeid();
1179311906 j["typename"] = x.get_obj5_typename();
1179411907 j["union"] = x.get_obj5_union();
11795- j["unsigned"] = x.get_obj5_unsigned();
1179611908 j["PrimitiveKind"] = x.get_primitive_kind();
1179711909 j["true"] = x.get_purple_true();
11910+ j["select"] = x.get_select();
1179811911 j["Self"] = x.get_self();
1179911912 j["Sendable"] = x.get_sendable();
1180011913 j["SerialDescriptor"] = x.get_serial_descriptor();
@@ -11819,6 +11932,7 @@ namespace quicktype {
1181911932 j["TimeOnly"] = x.get_time_only();
1182011933 j["TimeOnlyConverter"] = x.get_time_only_converter();
1182111934 j["TimeZone"] = x.get_time_zone();
11935+ j["to_dict"] = x.get_to_dict();
1182211936 j["to_json"] = x.get_to_json();
1182311937 j["toString"] = x.get_to_string();
1182411938 j["top_level"] = x.get_top_level();
@@ -11830,10 +11944,21 @@ namespace quicktype {
1183011944 j["ulong"] = x.get_ulong();
1183111945 j["unchecked"] = x.get_unchecked();
1183211946 j["undefined"] = x.get_undefined();
11947+ j["UnmarshalJSON"] = x.get_unmarshal_json();
1183311948 j["unowned"] = x.get_unowned();
1183411949 j["unsafe"] = x.get_unsafe();
1183511950 j["UseSerializers"] = x.get_use_serializers();
11836- j["ushort"] = x.get_ushort();
11951+ }
11952+
11953+ inline void from_json(const json & j, Unsigned& x) {
11954+ if (!j.is_object()) throw std::runtime_error("Expected object");
11955+ if (j.find("unsigned") != j.end() && !j.at("unsigned").is_number_integer()) throw std::runtime_error("Expected integer");
11956+ x.set_unsigned_unsigned(j.at("unsigned").get<int64_t>());
11957+ }
11958+
11959+ inline void to_json(json & j, const Unsigned & x) {
11960+ j = json::object();
11961+ j["unsigned"] = x.get_unsigned_unsigned();
1183711962 }
1183811963
1183911964 inline void from_json(const json & j, Using& x) {
@@ -11924,6 +12049,17 @@ namespace quicktype {
1192412049 j["xor_eq"] = x.get_xor_eq_xor_eq();
1192512050 }
1192612051
12052+ inline void from_json(const json & j, Ushort& x) {
12053+ if (!j.is_object()) throw std::runtime_error("Expected object");
12054+ if (j.find("ushort") != j.end() && !j.at("ushort").is_number_integer()) throw std::runtime_error("Expected integer");
12055+ x.set_ushort(j.at("ushort").get<int64_t>());
12056+ }
12057+
12058+ inline void to_json(json & j, const Ushort & x) {
12059+ j = json::object();
12060+ j["ushort"] = x.get_ushort();
12061+ }
12062+
1192712063 inline void from_json(const json & j, Utf8JsonReader& x) {
1192812064 if (!j.is_object()) throw std::runtime_error("Expected object");
1192912065 if (j.find("Utf8JsonReader") != j.end() && !j.at("Utf8JsonReader").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -12038,6 +12174,7 @@ namespace quicktype {
1203812174 if (!j.is_object()) throw std::runtime_error("Expected object");
1203912175 if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer");
1204012176 x.set_dummy(j.at("dummy").get<int64_t>());
12177+ x.set_obj6_unsigned(j.at("unsigned").get<Unsigned>());
1204112178 x.set_obj6_using(j.at("using").get<Using>());
1204212179 x.set_obj6_virtual(j.at("virtual").get<Virtual>());
1204312180 x.set_obj6_void(j.at("void").get<Void>());
@@ -12046,6 +12183,7 @@ namespace quicktype {
1204612183 x.set_obj6_while(j.at("while").get<While>());
1204712184 x.set_obj6_xor(j.at("xor").get<Xor>());
1204812185 x.set_obj6_xor_eq(j.at("xor_eq").get<XorEq>());
12186+ x.set_ushort(j.at("ushort").get<Ushort>());
1204912187 x.set_utf8_json_reader(j.at("Utf8JsonReader").get<Utf8JsonReader>());
1205012188 x.set_utf8_json_writer(j.at("Utf8JsonWriter").get<Utf8JsonWriter>());
1205112189 x.set_uuid(j.at("UUID").get<Uuid>());
@@ -12061,6 +12199,7 @@ namespace quicktype {
1206112199 inline void to_json(json & j, const Obj6 & x) {
1206212200 j = json::object();
1206312201 j["dummy"] = x.get_dummy();
12202+ j["unsigned"] = x.get_obj6_unsigned();
1206412203 j["using"] = x.get_obj6_using();
1206512204 j["virtual"] = x.get_obj6_virtual();
1206612205 j["void"] = x.get_obj6_void();
@@ -12069,6 +12208,7 @@ namespace quicktype {
1206912208 j["while"] = x.get_obj6_while();
1207012209 j["xor"] = x.get_obj6_xor();
1207112210 j["xor_eq"] = x.get_obj6_xor_eq();
12211+ j["ushort"] = x.get_ushort();
1207212212 j["Utf8JsonReader"] = x.get_utf8_json_reader();
1207312213 j["Utf8JsonWriter"] = x.get_utf8_json_writer();
1207412214 j["UUID"] = x.get_uuid();
Mcrystaldefault / TopLevel.cr+78 −42
@@ -692,6 +692,8 @@ class Obj2
692692
693693 property from : From
694694
695+ property from_dict : FromDict
696+
695697 property from_json : FromJson
696698
697699 property func : Func
@@ -704,8 +706,6 @@ class Obj2
704706
705707 property go : Go
706708
707- property goto : Goto
708-
709709 @[JSON::Field(key: "def")]
710710 property obj2_def : Def
711711
@@ -1041,6 +1041,12 @@ class From
10411041 property from : Int64
10421042 end
10431043
1044+class FromDict
1045+ include JSON::Serializable
1046+
1047+ property from_dict : Int64
1048+end
1049+
10441050 class FromJson
10451051 include JSON::Serializable
10461052
@@ -1077,12 +1083,6 @@ class Go
10771083 property go : Int64
10781084 end
10791085
1080-class Goto
1081- include JSON::Serializable
1082-
1083- property goto : Int64
1084-end
1085-
10861086 class Def
10871087 include JSON::Serializable
10881088
@@ -1137,6 +1137,8 @@ class Obj3
11371137
11381138 property dummy : Int64
11391139
1140+ property goto : Goto
1141+
11401142 property guard : Guard
11411143
11421144 @[JSON::Field(key: "hasOwnProperty")]
@@ -1258,6 +1260,9 @@ class Obj3
12581260 @[JSON::Field(key: "MapEntry")]
12591261 property map_entry : MapEntry
12601262
1263+ @[JSON::Field(key: "MarshalJSON")]
1264+ property marshal_json : MarshalJson
1265+
12611266 property metadata_property_handling : MetadataPropertyHandling
12621267
12631268 property mutable : Mutable
@@ -1275,8 +1280,6 @@ class Obj3
12751280 @[JSON::Field(key: "NO")]
12761281 property no : No
12771282
1278- property noexcept : Noexcept
1279-
12801283 @[JSON::Field(key: "if")]
12811284 property obj3_if : If
12821285
@@ -1290,6 +1293,12 @@ class Obj3
12901293 property obj3_nil : NilClass
12911294 end
12921295
1296+class Goto
1297+ include JSON::Serializable
1298+
1299+ property goto : Int64
1300+end
1301+
12931302 class Guard
12941303 include JSON::Serializable
12951304
@@ -1615,6 +1624,13 @@ class MapEntry
16151624 property map_entry : Int64
16161625 end
16171626
1627+class MarshalJson
1628+ include JSON::Serializable
1629+
1630+ @[JSON::Field(key: "MarshalJSON")]
1631+ property marshal_json : Int64
1632+end
1633+
16181634 class MetadataPropertyHandling
16191635 include JSON::Serializable
16201636
@@ -1664,12 +1680,6 @@ class No
16641680 property no : Int64
16651681 end
16661682
1667-class Noexcept
1668- include JSON::Serializable
1669-
1670- property noexcept : Int64
1671-end
1672-
16731683 class If
16741684 include JSON::Serializable
16751685
@@ -1706,6 +1716,8 @@ class Obj4
17061716 @[JSON::Field(key: "noSuchMethod")]
17071717 property no_such_method : NoSuchMethod
17081718
1719+ property noexcept : Noexcept
1720+
17091721 property nonatomic : Nonatomic
17101722
17111723 @[JSON::Field(key: "None")]
@@ -1762,9 +1774,6 @@ class Obj4
17621774 @[JSON::Field(key: "return")]
17631775 property obj4_return : Return
17641776
1765- @[JSON::Field(key: "select")]
1766- property obj4_select : Select
1767-
17681777 property object : ObjectClass
17691778
17701779 @[JSON::Field(key: "ObjectMapper")]
@@ -1861,6 +1870,12 @@ class NoSuchMethod
18611870 property no_such_method : Int64
18621871 end
18631872
1873+class Noexcept
1874+ include JSON::Serializable
1875+
1876+ property noexcept : Int64
1877+end
1878+
18641879 class Nonatomic
18651880 include JSON::Serializable
18661881
@@ -1998,13 +2013,6 @@ class Return
19982013 property return_return : Int64
19992014 end
20002015
2001-class Select
2002- include JSON::Serializable
2003-
2004- @[JSON::Field(key: "select")]
2005- property select_select : Int64
2006-end
2007-
20082016 class ObjectClass
20092017 include JSON::Serializable
20102018
@@ -2265,6 +2273,9 @@ class Obj5
22652273 @[JSON::Field(key: "KSerializer")]
22662274 property k_serializer : KSerializer
22672275
2276+ @[JSON::Field(key: "select")]
2277+ property obj5_select : Select
2278+
22682279 @[JSON::Field(key: "Self")]
22692280 property obj5_self : Self
22702281
@@ -2383,6 +2394,8 @@ class Obj5
23832394 @[JSON::Field(key: "TimeZone")]
23842395 property time_zone : TimeZone
23852396
2397+ property to_dict : ToDict
2398+
23862399 @[JSON::Field(key: "toString")]
23872400 property to_string : ToString
23882401
@@ -2408,16 +2421,15 @@ class Obj5
24082421
24092422 property undefined : Undefined
24102423
2424+ @[JSON::Field(key: "UnmarshalJSON")]
2425+ property unmarshal_json : UnmarshalJson
2426+
24112427 property unowned : Unowned
24122428
24132429 property unsafe : Unsafe
24142430
2415- property unsigned : Unsigned
2416-
24172431 @[JSON::Field(key: "UseSerializers")]
24182432 property use_serializers : UseSerializers
2419-
2420- property ushort : Ushort
24212433 end
24222434
24232435 class KSerializer
@@ -2427,6 +2439,13 @@ class KSerializer
24272439 property k_serializer : Int64
24282440 end
24292441
2442+class Select
2443+ include JSON::Serializable
2444+
2445+ @[JSON::Field(key: "select")]
2446+ property select_select : Int64
2447+end
2448+
24302449 class Self
24312450 include JSON::Serializable
24322451
@@ -2729,6 +2748,12 @@ class TimeZone
27292748 property time_zone : Int64
27302749 end
27312750
2751+class ToDict
2752+ include JSON::Serializable
2753+
2754+ property to_dict : Int64
2755+end
2756+
27322757 class ToString
27332758 include JSON::Serializable
27342759
@@ -2802,22 +2827,23 @@ class Undefined
28022827 property undefined : Int64
28032828 end
28042829
2805-class Unowned
2830+class UnmarshalJson
28062831 include JSON::Serializable
28072832
2808- property unowned : Int64
2833+ @[JSON::Field(key: "UnmarshalJSON")]
2834+ property unmarshal_json : Int64
28092835 end
28102836
2811-class Unsafe
2837+class Unowned
28122838 include JSON::Serializable
28132839
2814- property unsafe : Int64
2840+ property unowned : Int64
28152841 end
28162842
2817-class Unsigned
2843+class Unsafe
28182844 include JSON::Serializable
28192845
2820- property unsigned : Int64
2846+ property unsafe : Int64
28212847 end
28222848
28232849 class UseSerializers
@@ -2827,12 +2853,6 @@ class UseSerializers
28272853 property use_serializers : Int64
28282854 end
28292855
2830-class Ushort
2831- include JSON::Serializable
2832-
2833- property ushort : Int64
2834-end
2835-
28362856 class Obj6
28372857 include JSON::Serializable
28382858
@@ -2847,6 +2867,10 @@ class Obj6
28472867 @[JSON::Field(key: "yield")]
28482868 property obj6_yield : Yield
28492869
2870+ property unsigned : Unsigned
2871+
2872+ property ushort : Ushort
2873+
28502874 property using : Using
28512875
28522876 @[JSON::Field(key: "Utf8JsonReader")]
@@ -2904,6 +2928,18 @@ class Yield
29042928 property yield_yield : Int64
29052929 end
29062930
2931+class Unsigned
2932+ include JSON::Serializable
2933+
2934+ property unsigned : Int64
2935+end
2936+
2937+class Ushort
2938+ include JSON::Serializable
2939+
2940+ property ushort : Int64
2941+end
2942+
29072943 class Using
29082944 include JSON::Serializable
Mcsharp-recordsdefault / QuickType.cs+80 −44
@@ -799,6 +799,9 @@ namespace QuickType
799799 [JsonProperty("from", Required = Required.Always)]
800800 public From From { get; set; }
801801
802+ [JsonProperty("from_dict", Required = Required.Always)]
803+ public FromDict FromDict { get; set; }
804+
802805 [JsonProperty("func", Required = Required.Always)]
803806 public Func Func { get; set; }
804807
@@ -814,9 +817,6 @@ namespace QuickType
814817 [JsonProperty("go", Required = Required.Always)]
815818 public Go Go { get; set; }
816819
817- [JsonProperty("goto", Required = Required.Always)]
818- public Goto Goto { get; set; }
819-
820820 [JsonProperty("equalityContract", Required = Required.Always)]
821821 public EqualityContractClass Obj2EqualityContract { get; set; }
822822
@@ -1157,6 +1157,12 @@ namespace QuickType
11571157 public long FromFrom { get; set; }
11581158 }
11591159
1160+ public partial record FromDict
1161+ {
1162+ [JsonProperty("from_dict", Required = Required.Always)]
1163+ public long FromDictFromDict { get; set; }
1164+ }
1165+
11601166 public partial record Func
11611167 {
11621168 [JsonProperty("func", Required = Required.Always)]
@@ -1187,12 +1193,6 @@ namespace QuickType
11871193 public long GoGo { get; set; }
11881194 }
11891195
1190- public partial record Goto
1191- {
1192- [JsonProperty("goto", Required = Required.Always)]
1193- public long GotoGoto { get; set; }
1194- }
1195-
11961196 public partial record EqualityContractClass
11971197 {
11981198 [JsonProperty("equalityContract", Required = Required.Always)]
@@ -1216,6 +1216,9 @@ namespace QuickType
12161216 [JsonProperty("dummy", Required = Required.Always)]
12171217 public long Dummy { get; set; }
12181218
1219+ [JsonProperty("goto", Required = Required.Always)]
1220+ public Goto Goto { get; set; }
1221+
12191222 [JsonProperty("guard", Required = Required.Always)]
12201223 public Guard Guard { get; set; }
12211224
@@ -1375,6 +1378,9 @@ namespace QuickType
13751378 [JsonProperty("MapEntry", Required = Required.Always)]
13761379 public MapEntry MapEntry { get; set; }
13771380
1381+ [JsonProperty("MarshalJSON", Required = Required.Always)]
1382+ public MarshalJson MarshalJson { get; set; }
1383+
13781384 [JsonProperty("metadata_property_handling", Required = Required.Always)]
13791385 public MetadataPropertyHandlingClass MetadataPropertyHandling { get; set; }
13801386
@@ -1404,9 +1410,12 @@ namespace QuickType
14041410
14051411 [JsonProperty("NO", Required = Required.Always)]
14061412 public No No { get; set; }
1413+ }
14071414
1408- [JsonProperty("noexcept", Required = Required.Always)]
1409- public Noexcept Noexcept { get; set; }
1415+ public partial record Goto
1416+ {
1417+ [JsonProperty("goto", Required = Required.Always)]
1418+ public long GotoGoto { get; set; }
14101419 }
14111420
14121421 public partial record Guard
@@ -1727,6 +1736,12 @@ namespace QuickType
17271736 public long MapEntryMapEntry { get; set; }
17281737 }
17291738
1739+ public partial record MarshalJson
1740+ {
1741+ [JsonProperty("MarshalJSON", Required = Required.Always)]
1742+ public long MarshalJsonMarshalJson { get; set; }
1743+ }
1744+
17301745 public partial record MetadataPropertyHandlingClass
17311746 {
17321747 [JsonProperty("metadata_property_handling", Required = Required.Always)]
@@ -1787,12 +1802,6 @@ namespace QuickType
17871802 public long NoNo { get; set; }
17881803 }
17891804
1790- public partial record Noexcept
1791- {
1792- [JsonProperty("noexcept", Required = Required.Always)]
1793- public long NoexceptNoexcept { get; set; }
1794- }
1795-
17961805 public partial record Obj4
17971806 {
17981807 [JsonProperty("dummy", Required = Required.Always)]
@@ -1801,6 +1810,9 @@ namespace QuickType
18011810 [JsonProperty("noSuchMethod", Required = Required.Always)]
18021811 public NoSuchMethod NoSuchMethod { get; set; }
18031812
1813+ [JsonProperty("noexcept", Required = Required.Always)]
1814+ public Noexcept Noexcept { get; set; }
1815+
18041816 [JsonProperty("nonatomic", Required = Required.Always)]
18051817 public Nonatomic Nonatomic { get; set; }
18061818
@@ -1986,9 +1998,6 @@ namespace QuickType
19861998
19871999 [JsonProperty("SEL", Required = Required.Always)]
19882000 public Sel Sel { get; set; }
1989-
1990- [JsonProperty("select", Required = Required.Always)]
1991- public Select Select { get; set; }
19922001 }
19932002
19942003 public partial record NoSuchMethod
@@ -1997,6 +2006,12 @@ namespace QuickType
19972006 public long NoSuchMethodNoSuchMethod { get; set; }
19982007 }
19992008
2009+ public partial record Noexcept
2010+ {
2011+ [JsonProperty("noexcept", Required = Required.Always)]
2012+ public long NoexceptNoexcept { get; set; }
2013+ }
2014+
20002015 public partial record Nonatomic
20012016 {
20022017 [JsonProperty("nonatomic", Required = Required.Always)]
@@ -2369,12 +2384,6 @@ namespace QuickType
23692384 public long SelSel { get; set; }
23702385 }
23712386
2372- public partial record Select
2373- {
2374- [JsonProperty("select", Required = Required.Always)]
2375- public long SelectSelect { get; set; }
2376- }
2377-
23782387 public partial record Obj5
23792388 {
23802389 [JsonProperty("dummy", Required = Required.Always)]
@@ -2401,6 +2410,9 @@ namespace QuickType
24012410 [JsonProperty("PrimitiveKind", Required = Required.Always)]
24022411 public PrimitiveKind PrimitiveKind { get; set; }
24032412
2413+ [JsonProperty("select", Required = Required.Always)]
2414+ public Select Select { get; set; }
2415+
24042416 [JsonProperty("Self", Required = Required.Always)]
24052417 public Self Self { get; set; }
24062418
@@ -2512,6 +2524,9 @@ namespace QuickType
25122524 [JsonProperty("TimeZone", Required = Required.Always)]
25132525 public TimeZone TimeZone { get; set; }
25142526
2527+ [JsonProperty("to_dict", Required = Required.Always)]
2528+ public ToDict ToDict { get; set; }
2529+
25152530 [JsonProperty("top_level", Required = Required.Always)]
25162531 public TopLevelClass TopLevel { get; set; }
25172532
@@ -2557,20 +2572,17 @@ namespace QuickType
25572572 [JsonProperty("union", Required = Required.Always)]
25582573 public Union Union { get; set; }
25592574
2575+ [JsonProperty("UnmarshalJSON", Required = Required.Always)]
2576+ public UnmarshalJson UnmarshalJson { get; set; }
2577+
25602578 [JsonProperty("unowned", Required = Required.Always)]
25612579 public Unowned Unowned { get; set; }
25622580
25632581 [JsonProperty("unsafe", Required = Required.Always)]
25642582 public Unsafe Unsafe { get; set; }
25652583
2566- [JsonProperty("unsigned", Required = Required.Always)]
2567- public Unsigned Unsigned { get; set; }
2568-
25692584 [JsonProperty("UseSerializers", Required = Required.Always)]
25702585 public UseSerializers UseSerializers { get; set; }
2571-
2572- [JsonProperty("ushort", Required = Required.Always)]
2573- public Ushort Ushort { get; set; }
25742586 }
25752587
25762588 public partial record KSerializer
@@ -2615,6 +2627,12 @@ namespace QuickType
26152627 public long PrimitiveKindPrimitiveKind { get; set; }
26162628 }
26172629
2630+ public partial record Select
2631+ {
2632+ [JsonProperty("select", Required = Required.Always)]
2633+ public long SelectSelect { get; set; }
2634+ }
2635+
26182636 public partial record Self
26192637 {
26202638 [JsonProperty("Self", Required = Required.Always)]
@@ -2837,6 +2855,12 @@ namespace QuickType
28372855 public long TimeZoneTimeZone { get; set; }
28382856 }
28392857
2858+ public partial record ToDict
2859+ {
2860+ [JsonProperty("to_dict", Required = Required.Always)]
2861+ public long ToDictToDict { get; set; }
2862+ }
2863+
28402864 public partial record TopLevelClass
28412865 {
28422866 [JsonProperty("top_level", Required = Required.Always)]
@@ -2927,6 +2951,12 @@ namespace QuickType
29272951 public long UnionUnion { get; set; }
29282952 }
29292953
2954+ public partial record UnmarshalJson
2955+ {
2956+ [JsonProperty("UnmarshalJSON", Required = Required.Always)]
2957+ public long UnmarshalJsonUnmarshalJson { get; set; }
2958+ }
2959+
29302960 public partial record Unowned
29312961 {
29322962 [JsonProperty("unowned", Required = Required.Always)]
@@ -2939,29 +2969,23 @@ namespace QuickType
29392969 public long UnsafeUnsafe { get; set; }
29402970 }
29412971
2942- public partial record Unsigned
2943- {
2944- [JsonProperty("unsigned", Required = Required.Always)]
2945- public long UnsignedUnsigned { get; set; }
2946- }
2947-
29482972 public partial record UseSerializers
29492973 {
29502974 [JsonProperty("UseSerializers", Required = Required.Always)]
29512975 public long UseSerializersUseSerializers { get; set; }
29522976 }
29532977
2954- public partial record Ushort
2955- {
2956- [JsonProperty("ushort", Required = Required.Always)]
2957- public long UshortUshort { get; set; }
2958- }
2959-
29602978 public partial record Obj6
29612979 {
29622980 [JsonProperty("dummy", Required = Required.Always)]
29632981 public long Dummy { get; set; }
29642982
2983+ [JsonProperty("unsigned", Required = Required.Always)]
2984+ public Unsigned Unsigned { get; set; }
2985+
2986+ [JsonProperty("ushort", Required = Required.Always)]
2987+ public Ushort Ushort { get; set; }
2988+
29652989 [JsonProperty("using", Required = Required.Always)]
29662990 public Using Using { get; set; }
29672991
@@ -3017,6 +3041,18 @@ namespace QuickType
30173041 public Yield Yield { get; set; }
30183042 }
30193043
3044+ public partial record Unsigned
3045+ {
3046+ [JsonProperty("unsigned", Required = Required.Always)]
3047+ public long UnsignedUnsigned { get; set; }
3048+ }
3049+
3050+ public partial record Ushort
3051+ {
3052+ [JsonProperty("ushort", Required = Required.Always)]
3053+ public long UshortUshort { get; set; }
3054+ }
3055+
30203056 public partial record Using
30213057 {
30223058 [JsonProperty("using", Required = Required.Always)]
Mcsharp-SystemTextJsondefault / QuickType.cs+97 −53
@@ -992,6 +992,10 @@ namespace QuickType
992992 [JsonPropertyName("from")]
993993 public From From { get; set; }
994994
995+ [JsonRequired]
996+ [JsonPropertyName("from_dict")]
997+ public FromDict FromDict { get; set; }
998+
995999 [JsonRequired]
9961000 [JsonPropertyName("func")]
9971001 public Func Func { get; set; }
@@ -1012,10 +1016,6 @@ namespace QuickType
10121016 [JsonPropertyName("go")]
10131017 public Go Go { get; set; }
10141018
1015- [JsonRequired]
1016- [JsonPropertyName("goto")]
1017- public Goto Goto { get; set; }
1018-
10191019 [JsonRequired]
10201020 [JsonPropertyName("false")]
10211021 public FalseClass Obj2False { get; set; }
@@ -1417,6 +1417,13 @@ namespace QuickType
14171417 public long FromFrom { get; set; }
14181418 }
14191419
1420+ public partial class FromDict
1421+ {
1422+ [JsonRequired]
1423+ [JsonPropertyName("from_dict")]
1424+ public long FromDictFromDict { get; set; }
1425+ }
1426+
14201427 public partial class Func
14211428 {
14221429 [JsonRequired]
@@ -1452,13 +1459,6 @@ namespace QuickType
14521459 public long GoGo { get; set; }
14531460 }
14541461
1455- public partial class Goto
1456- {
1457- [JsonRequired]
1458- [JsonPropertyName("goto")]
1459- public long GotoGoto { get; set; }
1460- }
1461-
14621462 public partial class FalseClass
14631463 {
14641464 [JsonRequired]
@@ -1479,6 +1479,10 @@ namespace QuickType
14791479 [JsonPropertyName("dummy")]
14801480 public long Dummy { get; set; }
14811481
1482+ [JsonRequired]
1483+ [JsonPropertyName("goto")]
1484+ public Goto Goto { get; set; }
1485+
14821486 [JsonRequired]
14831487 [JsonPropertyName("guard")]
14841488 public Guard Guard { get; set; }
@@ -1691,6 +1695,10 @@ namespace QuickType
16911695 [JsonPropertyName("MapEntry")]
16921696 public MapEntry MapEntry { get; set; }
16931697
1698+ [JsonRequired]
1699+ [JsonPropertyName("MarshalJSON")]
1700+ public MarshalJson MarshalJson { get; set; }
1701+
16941702 [JsonRequired]
16951703 [JsonPropertyName("metadata_property_handling")]
16961704 public MetadataPropertyHandling MetadataPropertyHandling { get; set; }
@@ -1730,10 +1738,13 @@ namespace QuickType
17301738 [JsonRequired]
17311739 [JsonPropertyName("NO")]
17321740 public No No { get; set; }
1741+ }
17331742
1743+ public partial class Goto
1744+ {
17341745 [JsonRequired]
1735- [JsonPropertyName("noexcept")]
1736- public Noexcept Noexcept { get; set; }
1746+ [JsonPropertyName("goto")]
1747+ public long GotoGoto { get; set; }
17371748 }
17381749
17391750 public partial class Guard
@@ -2107,6 +2118,13 @@ namespace QuickType
21072118 public long MapEntryMapEntry { get; set; }
21082119 }
21092120
2121+ public partial class MarshalJson
2122+ {
2123+ [JsonRequired]
2124+ [JsonPropertyName("MarshalJSON")]
2125+ public long MarshalJsonMarshalJson { get; set; }
2126+ }
2127+
21102128 public partial class MetadataPropertyHandling
21112129 {
21122130 [JsonRequired]
@@ -2177,13 +2195,6 @@ namespace QuickType
21772195 public long NoNo { get; set; }
21782196 }
21792197
2180- public partial class Noexcept
2181- {
2182- [JsonRequired]
2183- [JsonPropertyName("noexcept")]
2184- public long NoexceptNoexcept { get; set; }
2185- }
2186-
21872198 public partial class Obj4
21882199 {
21892200 [JsonRequired]
@@ -2194,6 +2205,10 @@ namespace QuickType
21942205 [JsonPropertyName("noSuchMethod")]
21952206 public NoSuchMethod NoSuchMethod { get; set; }
21962207
2208+ [JsonRequired]
2209+ [JsonPropertyName("noexcept")]
2210+ public Noexcept Noexcept { get; set; }
2211+
21972212 [JsonRequired]
21982213 [JsonPropertyName("nonatomic")]
21992214 public Nonatomic Nonatomic { get; set; }
@@ -2441,10 +2456,6 @@ namespace QuickType
24412456 [JsonRequired]
24422457 [JsonPropertyName("SEL")]
24432458 public Sel Sel { get; set; }
2444-
2445- [JsonRequired]
2446- [JsonPropertyName("select")]
2447- public Select Select { get; set; }
24482459 }
24492460
24502461 public partial class NoSuchMethod
@@ -2454,6 +2465,13 @@ namespace QuickType
24542465 public long NoSuchMethodNoSuchMethod { get; set; }
24552466 }
24562467
2468+ public partial class Noexcept
2469+ {
2470+ [JsonRequired]
2471+ [JsonPropertyName("noexcept")]
2472+ public long NoexceptNoexcept { get; set; }
2473+ }
2474+
24572475 public partial class Nonatomic
24582476 {
24592477 [JsonRequired]
@@ -2888,13 +2906,6 @@ namespace QuickType
28882906 public long SelSel { get; set; }
28892907 }
28902908
2891- public partial class Select
2892- {
2893- [JsonRequired]
2894- [JsonPropertyName("select")]
2895- public long SelectSelect { get; set; }
2896- }
2897-
28982909 public partial class Obj5
28992910 {
29002911 [JsonRequired]
@@ -2929,6 +2940,10 @@ namespace QuickType
29292940 [JsonPropertyName("PrimitiveKind")]
29302941 public PrimitiveKind PrimitiveKind { get; set; }
29312942
2943+ [JsonRequired]
2944+ [JsonPropertyName("select")]
2945+ public Select Select { get; set; }
2946+
29322947 [JsonRequired]
29332948 [JsonPropertyName("Self")]
29342949 public Self Self { get; set; }
@@ -3077,6 +3092,10 @@ namespace QuickType
30773092 [JsonPropertyName("TimeZone")]
30783093 public TimeZone TimeZone { get; set; }
30793094
3095+ [JsonRequired]
3096+ [JsonPropertyName("to_dict")]
3097+ public ToDict ToDict { get; set; }
3098+
30803099 [JsonRequired]
30813100 [JsonPropertyName("top_level")]
30823101 public TopLevelClass TopLevel { get; set; }
@@ -3137,6 +3156,10 @@ namespace QuickType
31373156 [JsonPropertyName("union")]
31383157 public Union Union { get; set; }
31393158
3159+ [JsonRequired]
3160+ [JsonPropertyName("UnmarshalJSON")]
3161+ public UnmarshalJson UnmarshalJson { get; set; }
3162+
31403163 [JsonRequired]
31413164 [JsonPropertyName("unowned")]
31423165 public Unowned Unowned { get; set; }
@@ -3145,17 +3168,9 @@ namespace QuickType
31453168 [JsonPropertyName("unsafe")]
31463169 public Unsafe Unsafe { get; set; }
31473170
3148- [JsonRequired]
3149- [JsonPropertyName("unsigned")]
3150- public Unsigned Unsigned { get; set; }
3151-
31523171 [JsonRequired]
31533172 [JsonPropertyName("UseSerializers")]
31543173 public UseSerializers UseSerializers { get; set; }
3155-
3156- [JsonRequired]
3157- [JsonPropertyName("ushort")]
3158- public Ushort Ushort { get; set; }
31593174 }
31603175
31613176 public partial class KSerializer
@@ -3207,6 +3222,13 @@ namespace QuickType
32073222 public long PrimitiveKindPrimitiveKind { get; set; }
32083223 }
32093224
3225+ public partial class Select
3226+ {
3227+ [JsonRequired]
3228+ [JsonPropertyName("select")]
3229+ public long SelectSelect { get; set; }
3230+ }
3231+
32103232 public partial class Self
32113233 {
32123234 [JsonRequired]
@@ -3466,6 +3488,13 @@ namespace QuickType
34663488 public long TimeZoneTimeZone { get; set; }
34673489 }
34683490
3491+ public partial class ToDict
3492+ {
3493+ [JsonRequired]
3494+ [JsonPropertyName("to_dict")]
3495+ public long ToDictToDict { get; set; }
3496+ }
3497+
34693498 public partial class TopLevelClass
34703499 {
34713500 [JsonRequired]
@@ -3571,6 +3600,13 @@ namespace QuickType
35713600 public long UnionUnion { get; set; }
35723601 }
35733602
3603+ public partial class UnmarshalJson
3604+ {
3605+ [JsonRequired]
3606+ [JsonPropertyName("UnmarshalJSON")]
3607+ public long UnmarshalJsonUnmarshalJson { get; set; }
3608+ }
3609+
35743610 public partial class Unowned
35753611 {
35763612 [JsonRequired]
@@ -3585,13 +3621,6 @@ namespace QuickType
35853621 public long UnsafeUnsafe { get; set; }
35863622 }
35873623
3588- public partial class Unsigned
3589- {
3590- [JsonRequired]
3591- [JsonPropertyName("unsigned")]
3592- public long UnsignedUnsigned { get; set; }
3593- }
3594-
35953624 public partial class UseSerializers
35963625 {
35973626 [JsonRequired]
@@ -3599,19 +3628,20 @@ namespace QuickType
35993628 public long UseSerializersUseSerializers { get; set; }
36003629 }
36013630
3602- public partial class Ushort
3603- {
3604- [JsonRequired]
3605- [JsonPropertyName("ushort")]
3606- public long UshortUshort { get; set; }
3607- }
3608-
36093631 public partial class Obj6
36103632 {
36113633 [JsonRequired]
36123634 [JsonPropertyName("dummy")]
36133635 public long Dummy { get; set; }
36143636
3637+ [JsonRequired]
3638+ [JsonPropertyName("unsigned")]
3639+ public Unsigned Unsigned { get; set; }
3640+
3641+ [JsonRequired]
3642+ [JsonPropertyName("ushort")]
3643+ public Ushort Ushort { get; set; }
3644+
36153645 [JsonRequired]
36163646 [JsonPropertyName("using")]
36173647 public Using Using { get; set; }
@@ -3685,6 +3715,20 @@ namespace QuickType
36853715 public Yield Yield { get; set; }
36863716 }
36873717
3718+ public partial class Unsigned
3719+ {
3720+ [JsonRequired]
3721+ [JsonPropertyName("unsigned")]
3722+ public long UnsignedUnsigned { get; set; }
3723+ }
3724+
3725+ public partial class Ushort
3726+ {
3727+ [JsonRequired]
3728+ [JsonPropertyName("ushort")]
3729+ public long UshortUshort { get; set; }
3730+ }
3731+
36883732 public partial class Using
36893733 {
36903734 [JsonRequired]
Mcsharpdefault / QuickType.cs+80 −44
@@ -802,6 +802,9 @@ namespace QuickType
802802 [JsonProperty("from", Required = Required.Always)]
803803 public From From { get; set; }
804804
805+ [JsonProperty("from_dict", Required = Required.Always)]
806+ public FromDict FromDict { get; set; }
807+
805808 [JsonProperty("func", Required = Required.Always)]
806809 public Func Func { get; set; }
807810
@@ -817,9 +820,6 @@ namespace QuickType
817820 [JsonProperty("go", Required = Required.Always)]
818821 public Go Go { get; set; }
819822
820- [JsonProperty("goto", Required = Required.Always)]
821- public Goto Goto { get; set; }
822-
823823 [JsonProperty("false", Required = Required.Always)]
824824 public FalseClass Obj2False { get; set; }
825825
@@ -1163,6 +1163,12 @@ namespace QuickType
11631163 public long FromFrom { get; set; }
11641164 }
11651165
1166+ public partial class FromDict
1167+ {
1168+ [JsonProperty("from_dict", Required = Required.Always)]
1169+ public long FromDictFromDict { get; set; }
1170+ }
1171+
11661172 public partial class Func
11671173 {
11681174 [JsonProperty("func", Required = Required.Always)]
@@ -1193,12 +1199,6 @@ namespace QuickType
11931199 public long GoGo { get; set; }
11941200 }
11951201
1196- public partial class Goto
1197- {
1198- [JsonProperty("goto", Required = Required.Always)]
1199- public long GotoGoto { get; set; }
1200- }
1201-
12021202 public partial class FalseClass
12031203 {
12041204 [JsonProperty("false", Required = Required.Always)]
@@ -1216,6 +1216,9 @@ namespace QuickType
12161216 [JsonProperty("dummy", Required = Required.Always)]
12171217 public long Dummy { get; set; }
12181218
1219+ [JsonProperty("goto", Required = Required.Always)]
1220+ public Goto Goto { get; set; }
1221+
12191222 [JsonProperty("guard", Required = Required.Always)]
12201223 public Guard Guard { get; set; }
12211224
@@ -1375,6 +1378,9 @@ namespace QuickType
13751378 [JsonProperty("MapEntry", Required = Required.Always)]
13761379 public MapEntry MapEntry { get; set; }
13771380
1381+ [JsonProperty("MarshalJSON", Required = Required.Always)]
1382+ public MarshalJson MarshalJson { get; set; }
1383+
13781384 [JsonProperty("metadata_property_handling", Required = Required.Always)]
13791385 public MetadataPropertyHandlingClass MetadataPropertyHandling { get; set; }
13801386
@@ -1404,9 +1410,12 @@ namespace QuickType
14041410
14051411 [JsonProperty("NO", Required = Required.Always)]
14061412 public No No { get; set; }
1413+ }
14071414
1408- [JsonProperty("noexcept", Required = Required.Always)]
1409- public Noexcept Noexcept { get; set; }
1415+ public partial class Goto
1416+ {
1417+ [JsonProperty("goto", Required = Required.Always)]
1418+ public long GotoGoto { get; set; }
14101419 }
14111420
14121421 public partial class Guard
@@ -1727,6 +1736,12 @@ namespace QuickType
17271736 public long MapEntryMapEntry { get; set; }
17281737 }
17291738
1739+ public partial class MarshalJson
1740+ {
1741+ [JsonProperty("MarshalJSON", Required = Required.Always)]
1742+ public long MarshalJsonMarshalJson { get; set; }
1743+ }
1744+
17301745 public partial class MetadataPropertyHandlingClass
17311746 {
17321747 [JsonProperty("metadata_property_handling", Required = Required.Always)]
@@ -1787,12 +1802,6 @@ namespace QuickType
17871802 public long NoNo { get; set; }
17881803 }
17891804
1790- public partial class Noexcept
1791- {
1792- [JsonProperty("noexcept", Required = Required.Always)]
1793- public long NoexceptNoexcept { get; set; }
1794- }
1795-
17961805 public partial class Obj4
17971806 {
17981807 [JsonProperty("dummy", Required = Required.Always)]
@@ -1801,6 +1810,9 @@ namespace QuickType
18011810 [JsonProperty("noSuchMethod", Required = Required.Always)]
18021811 public NoSuchMethod NoSuchMethod { get; set; }
18031812
1813+ [JsonProperty("noexcept", Required = Required.Always)]
1814+ public Noexcept Noexcept { get; set; }
1815+
18041816 [JsonProperty("nonatomic", Required = Required.Always)]
18051817 public Nonatomic Nonatomic { get; set; }
18061818
@@ -1986,9 +1998,6 @@ namespace QuickType
19861998
19871999 [JsonProperty("SEL", Required = Required.Always)]
19882000 public Sel Sel { get; set; }
1989-
1990- [JsonProperty("select", Required = Required.Always)]
1991- public Select Select { get; set; }
19922001 }
19932002
19942003 public partial class NoSuchMethod
@@ -1997,6 +2006,12 @@ namespace QuickType
19972006 public long NoSuchMethodNoSuchMethod { get; set; }
19982007 }
19992008
2009+ public partial class Noexcept
2010+ {
2011+ [JsonProperty("noexcept", Required = Required.Always)]
2012+ public long NoexceptNoexcept { get; set; }
2013+ }
2014+
20002015 public partial class Nonatomic
20012016 {
20022017 [JsonProperty("nonatomic", Required = Required.Always)]
@@ -2369,12 +2384,6 @@ namespace QuickType
23692384 public long SelSel { get; set; }
23702385 }
23712386
2372- public partial class Select
2373- {
2374- [JsonProperty("select", Required = Required.Always)]
2375- public long SelectSelect { get; set; }
2376- }
2377-
23782387 public partial class Obj5
23792388 {
23802389 [JsonProperty("dummy", Required = Required.Always)]
@@ -2401,6 +2410,9 @@ namespace QuickType
24012410 [JsonProperty("PrimitiveKind", Required = Required.Always)]
24022411 public PrimitiveKind PrimitiveKind { get; set; }
24032412
2413+ [JsonProperty("select", Required = Required.Always)]
2414+ public Select Select { get; set; }
2415+
24042416 [JsonProperty("Self", Required = Required.Always)]
24052417 public Self Self { get; set; }
24062418
@@ -2512,6 +2524,9 @@ namespace QuickType
25122524 [JsonProperty("TimeZone", Required = Required.Always)]
25132525 public TimeZone TimeZone { get; set; }
25142526
2527+ [JsonProperty("to_dict", Required = Required.Always)]
2528+ public ToDict ToDict { get; set; }
2529+
25152530 [JsonProperty("top_level", Required = Required.Always)]
25162531 public TopLevelClass TopLevel { get; set; }
25172532
@@ -2557,20 +2572,17 @@ namespace QuickType
25572572 [JsonProperty("union", Required = Required.Always)]
25582573 public Union Union { get; set; }
25592574
2575+ [JsonProperty("UnmarshalJSON", Required = Required.Always)]
2576+ public UnmarshalJson UnmarshalJson { get; set; }
2577+
25602578 [JsonProperty("unowned", Required = Required.Always)]
25612579 public Unowned Unowned { get; set; }
25622580
25632581 [JsonProperty("unsafe", Required = Required.Always)]
25642582 public Unsafe Unsafe { get; set; }
25652583
2566- [JsonProperty("unsigned", Required = Required.Always)]
2567- public Unsigned Unsigned { get; set; }
2568-
25692584 [JsonProperty("UseSerializers", Required = Required.Always)]
25702585 public UseSerializers UseSerializers { get; set; }
2571-
2572- [JsonProperty("ushort", Required = Required.Always)]
2573- public Ushort Ushort { get; set; }
25742586 }
25752587
25762588 public partial class KSerializer
@@ -2615,6 +2627,12 @@ namespace QuickType
26152627 public long PrimitiveKindPrimitiveKind { get; set; }
26162628 }
26172629
2630+ public partial class Select
2631+ {
2632+ [JsonProperty("select", Required = Required.Always)]
2633+ public long SelectSelect { get; set; }
2634+ }
2635+
26182636 public partial class Self
26192637 {
26202638 [JsonProperty("Self", Required = Required.Always)]
@@ -2837,6 +2855,12 @@ namespace QuickType
28372855 public long TimeZoneTimeZone { get; set; }
28382856 }
28392857
2858+ public partial class ToDict
2859+ {
2860+ [JsonProperty("to_dict", Required = Required.Always)]
2861+ public long ToDictToDict { get; set; }
2862+ }
2863+
28402864 public partial class TopLevelClass
28412865 {
28422866 [JsonProperty("top_level", Required = Required.Always)]
@@ -2927,6 +2951,12 @@ namespace QuickType
29272951 public long UnionUnion { get; set; }
29282952 }
29292953
2954+ public partial class UnmarshalJson
2955+ {
2956+ [JsonProperty("UnmarshalJSON", Required = Required.Always)]
2957+ public long UnmarshalJsonUnmarshalJson { get; set; }
2958+ }
2959+
29302960 public partial class Unowned
29312961 {
29322962 [JsonProperty("unowned", Required = Required.Always)]
@@ -2939,29 +2969,23 @@ namespace QuickType
29392969 public long UnsafeUnsafe { get; set; }
29402970 }
29412971
2942- public partial class Unsigned
2943- {
2944- [JsonProperty("unsigned", Required = Required.Always)]
2945- public long UnsignedUnsigned { get; set; }
2946- }
2947-
29482972 public partial class UseSerializers
29492973 {
29502974 [JsonProperty("UseSerializers", Required = Required.Always)]
29512975 public long UseSerializersUseSerializers { get; set; }
29522976 }
29532977
2954- public partial class Ushort
2955- {
2956- [JsonProperty("ushort", Required = Required.Always)]
2957- public long UshortUshort { get; set; }
2958- }
2959-
29602978 public partial class Obj6
29612979 {
29622980 [JsonProperty("dummy", Required = Required.Always)]
29632981 public long Dummy { get; set; }
29642982
2983+ [JsonProperty("unsigned", Required = Required.Always)]
2984+ public Unsigned Unsigned { get; set; }
2985+
2986+ [JsonProperty("ushort", Required = Required.Always)]
2987+ public Ushort Ushort { get; set; }
2988+
29652989 [JsonProperty("using", Required = Required.Always)]
29662990 public Using Using { get; set; }
29672991
@@ -3017,6 +3041,18 @@ namespace QuickType
30173041 public Yield Yield { get; set; }
30183042 }
30193043
3044+ public partial class Unsigned
3045+ {
3046+ [JsonProperty("unsigned", Required = Required.Always)]
3047+ public long UnsignedUnsigned { get; set; }
3048+ }
3049+
3050+ public partial class Ushort
3051+ {
3052+ [JsonProperty("ushort", Required = Required.Always)]
3053+ public long UshortUshort { get; set; }
3054+ }
3055+
30203056 public partial class Using
30213057 {
30223058 [JsonProperty("using", Required = Required.Always)]
Mdartdefault / TopLevel.dart+180 −100
@@ -1390,11 +1390,11 @@ class Obj2 {
13901390 final FormatExceptionClass formatException;
13911391 final Friend friend;
13921392 final From from;
1393+ final FromDict fromDict;
13931394 final Func func;
13941395 final FunctionClass function;
13951396 final Global global;
13961397 final Go go;
1397- final Goto goto;
13981398 final Default obj2Default;
13991399 final Do obj2Do;
14001400 final Double obj2Double;
@@ -1457,11 +1457,11 @@ class Obj2 {
14571457 required this.formatException,
14581458 required this.friend,
14591459 required this.from,
1460+ required this.fromDict,
14601461 required this.func,
14611462 required this.function,
14621463 required this.global,
14631464 required this.go,
1464- required this.goto,
14651465 required this.obj2Default,
14661466 required this.obj2Do,
14671467 required this.obj2Double,
@@ -1525,11 +1525,11 @@ class Obj2 {
15251525 formatException: FormatExceptionClass.fromJson(json["FormatException"]),
15261526 friend: Friend.fromJson(json["friend"]),
15271527 from: From.fromJson(json["from"]),
1528+ fromDict: FromDict.fromJson(json["from_dict"]),
15281529 func: Func.fromJson(json["func"]),
15291530 function: FunctionClass.fromJson(json["function"]),
15301531 global: Global.fromJson(json["global"]),
15311532 go: Go.fromJson(json["go"]),
1532- goto: Goto.fromJson(json["goto"]),
15331533 obj2Default: Default.fromJson(json["default"]),
15341534 obj2Do: Do.fromJson(json["do"]),
15351535 obj2Double: Double.fromJson(json["double"]),
@@ -1593,11 +1593,11 @@ class Obj2 {
15931593 "FormatException": formatException.toJson(),
15941594 "friend": friend.toJson(),
15951595 "from": from.toJson(),
1596+ "from_dict": fromDict.toJson(),
15961597 "func": func.toJson(),
15971598 "function": function.toJson(),
15981599 "global": global.toJson(),
15991600 "go": go.toJson(),
1600- "goto": goto.toJson(),
16011601 "default": obj2Default.toJson(),
16021602 "do": obj2Do.toJson(),
16031603 "double": obj2Double.toJson(),
@@ -2330,6 +2330,22 @@ class From {
23302330 };
23312331 }
23322332
2333+class FromDict {
2334+ final int fromDict;
2335+
2336+ FromDict({
2337+ required this.fromDict,
2338+ });
2339+
2340+ factory FromDict.fromJson(Map<String, dynamic> json) => FromDict(
2341+ fromDict: json["from_dict"],
2342+ );
2343+
2344+ Map<String, dynamic> toJson() => {
2345+ "from_dict": fromDict,
2346+ };
2347+}
2348+
23332349 class Func {
23342350 final int func;
23352351
@@ -2394,22 +2410,6 @@ class Go {
23942410 };
23952411 }
23962412
2397-class Goto {
2398- final int goto;
2399-
2400- Goto({
2401- required this.goto,
2402- });
2403-
2404- factory Goto.fromJson(Map<String, dynamic> json) => Goto(
2405- goto: json["goto"],
2406- );
2407-
2408- Map<String, dynamic> toJson() => {
2409- "goto": goto,
2410- };
2411-}
2412-
24132413 class Default {
24142414 final int defaultDefault;
24152415
@@ -2652,6 +2652,7 @@ class FalseClass {
26522652
26532653 class Obj3 {
26542654 final int dummy;
2655+ final Goto goto;
26552656 final Guard guard;
26562657 final HasOwnProperty hasOwnProperty;
26572658 final Hashable hashable;
@@ -2697,6 +2698,7 @@ class Obj3 {
26972698 final Long long;
26982699 final MapClass map;
26992700 final MapEntryClass mapEntry;
2701+ final MarshalJson marshalJson;
27002702 final MetadataPropertyHandling metadataPropertyHandling;
27012703 final Module module;
27022704 final Mutable mutable;
@@ -2706,7 +2708,6 @@ class Obj3 {
27062708 final Newtonsoft newtonsoft;
27072709 final Nil nil;
27082710 final No no;
2709- final Noexcept noexcept;
27102711 final HashCode obj3HashCode;
27112712 final If obj3If;
27122713 final Implements obj3Implements;
@@ -2719,6 +2720,7 @@ class Obj3 {
27192720
27202721 Obj3({
27212722 required this.dummy,
2723+ required this.goto,
27222724 required this.guard,
27232725 required this.hasOwnProperty,
27242726 required this.hashable,
@@ -2764,6 +2766,7 @@ class Obj3 {
27642766 required this.long,
27652767 required this.map,
27662768 required this.mapEntry,
2769+ required this.marshalJson,
27672770 required this.metadataPropertyHandling,
27682771 required this.module,
27692772 required this.mutable,
@@ -2773,7 +2776,6 @@ class Obj3 {
27732776 required this.newtonsoft,
27742777 required this.nil,
27752778 required this.no,
2776- required this.noexcept,
27772779 required this.obj3HashCode,
27782780 required this.obj3If,
27792781 required this.obj3Implements,
@@ -2787,6 +2789,7 @@ class Obj3 {
27872789
27882790 factory Obj3.fromJson(Map<String, dynamic> json) => Obj3(
27892791 dummy: json["dummy"],
2792+ goto: Goto.fromJson(json["goto"]),
27902793 guard: Guard.fromJson(json["guard"]),
27912794 hasOwnProperty: HasOwnProperty.fromJson(json["hasOwnProperty"]),
27922795 hashable: Hashable.fromJson(json["Hashable"]),
@@ -2832,6 +2835,7 @@ class Obj3 {
28322835 long: Long.fromJson(json["long"]),
28332836 map: MapClass.fromJson(json["map"]),
28342837 mapEntry: MapEntryClass.fromJson(json["MapEntry"]),
2838+ marshalJson: MarshalJson.fromJson(json["MarshalJSON"]),
28352839 metadataPropertyHandling: MetadataPropertyHandling.fromJson(json["metadata_property_handling"]),
28362840 module: Module.fromJson(json["module"]),
28372841 mutable: Mutable.fromJson(json["mutable"]),
@@ -2841,7 +2845,6 @@ class Obj3 {
28412845 newtonsoft: Newtonsoft.fromJson(json["newtonsoft"]),
28422846 nil: Nil.fromJson(json["nil"]),
28432847 no: No.fromJson(json["NO"]),
2844- noexcept: Noexcept.fromJson(json["noexcept"]),
28452848 obj3HashCode: HashCode.fromJson(json["hashCode"]),
28462849 obj3If: If.fromJson(json["if"]),
28472850 obj3Implements: Implements.fromJson(json["implements"]),
@@ -2855,6 +2858,7 @@ class Obj3 {
28552858
28562859 Map<String, dynamic> toJson() => {
28572860 "dummy": dummy,
2861+ "goto": goto.toJson(),
28582862 "guard": guard.toJson(),
28592863 "hasOwnProperty": hasOwnProperty.toJson(),
28602864 "Hashable": hashable.toJson(),
@@ -2900,6 +2904,7 @@ class Obj3 {
29002904 "long": long.toJson(),
29012905 "map": map.toJson(),
29022906 "MapEntry": mapEntry.toJson(),
2907+ "MarshalJSON": marshalJson.toJson(),
29032908 "metadata_property_handling": metadataPropertyHandling.toJson(),
29042909 "module": module.toJson(),
29052910 "mutable": mutable.toJson(),
@@ -2909,7 +2914,6 @@ class Obj3 {
29092914 "newtonsoft": newtonsoft.toJson(),
29102915 "nil": nil.toJson(),
29112916 "NO": no.toJson(),
2912- "noexcept": noexcept.toJson(),
29132917 "hashCode": obj3HashCode.toJson(),
29142918 "if": obj3If.toJson(),
29152919 "implements": obj3Implements.toJson(),
@@ -2922,6 +2926,22 @@ class Obj3 {
29222926 };
29232927 }
29242928
2929+class Goto {
2930+ final int goto;
2931+
2932+ Goto({
2933+ required this.goto,
2934+ });
2935+
2936+ factory Goto.fromJson(Map<String, dynamic> json) => Goto(
2937+ goto: json["goto"],
2938+ );
2939+
2940+ Map<String, dynamic> toJson() => {
2941+ "goto": goto,
2942+ };
2943+}
2944+
29252945 class Guard {
29262946 final int guard;
29272947
@@ -3642,6 +3662,22 @@ class MapEntryClass {
36423662 };
36433663 }
36443664
3665+class MarshalJson {
3666+ final int marshalJson;
3667+
3668+ MarshalJson({
3669+ required this.marshalJson,
3670+ });
3671+
3672+ factory MarshalJson.fromJson(Map<String, dynamic> json) => MarshalJson(
3673+ marshalJson: json["MarshalJSON"],
3674+ );
3675+
3676+ Map<String, dynamic> toJson() => {
3677+ "MarshalJSON": marshalJson,
3678+ };
3679+}
3680+
36453681 class MetadataPropertyHandling {
36463682 final int metadataPropertyHandling;
36473683
@@ -3786,22 +3822,6 @@ class No {
37863822 };
37873823 }
37883824
3789-class Noexcept {
3790- final int noexcept;
3791-
3792- Noexcept({
3793- required this.noexcept,
3794- });
3795-
3796- factory Noexcept.fromJson(Map<String, dynamic> json) => Noexcept(
3797- noexcept: json["noexcept"],
3798- );
3799-
3800- Map<String, dynamic> toJson() => {
3801- "noexcept": noexcept,
3802- };
3803-}
3804-
38053825 class HashCode {
38063826 final int hashCodeHashCode;
38073827
@@ -3948,6 +3968,7 @@ class New {
39483968
39493969 class Obj4 {
39503970 final int dummy;
3971+ final Noexcept noexcept;
39513972 final Nonatomic nonatomic;
39523973 final None none;
39533974 final Nonlocal nonlocal;
@@ -4011,10 +4032,10 @@ class Obj4 {
40114032 final Sbyte sbyte;
40124033 final Sealed sealed;
40134034 final Sel sel;
4014- final Select select;
40154035
40164036 Obj4({
40174037 required this.dummy,
4038+ required this.noexcept,
40184039 required this.nonatomic,
40194040 required this.none,
40204041 required this.nonlocal,
@@ -4078,11 +4099,11 @@ class Obj4 {
40784099 required this.sbyte,
40794100 required this.sealed,
40804101 required this.sel,
4081- required this.select,
40824102 });
40834103
40844104 factory Obj4.fromJson(Map<String, dynamic> json) => Obj4(
40854105 dummy: json["dummy"],
4106+ noexcept: Noexcept.fromJson(json["noexcept"]),
40864107 nonatomic: Nonatomic.fromJson(json["nonatomic"]),
40874108 none: None.fromJson(json["None"]),
40884109 nonlocal: Nonlocal.fromJson(json["nonlocal"]),
@@ -4146,11 +4167,11 @@ class Obj4 {
41464167 sbyte: Sbyte.fromJson(json["sbyte"]),
41474168 sealed: Sealed.fromJson(json["sealed"]),
41484169 sel: Sel.fromJson(json["SEL"]),
4149- select: Select.fromJson(json["select"]),
41504170 );
41514171
41524172 Map<String, dynamic> toJson() => {
41534173 "dummy": dummy,
4174+ "noexcept": noexcept.toJson(),
41544175 "nonatomic": nonatomic.toJson(),
41554176 "None": none.toJson(),
41564177 "nonlocal": nonlocal.toJson(),
@@ -4214,7 +4235,22 @@ class Obj4 {
42144235 "sbyte": sbyte.toJson(),
42154236 "sealed": sealed.toJson(),
42164237 "SEL": sel.toJson(),
4217- "select": select.toJson(),
4238+ };
4239+}
4240+
4241+class Noexcept {
4242+ final int noexcept;
4243+
4244+ Noexcept({
4245+ required this.noexcept,
4246+ });
4247+
4248+ factory Noexcept.fromJson(Map<String, dynamic> json) => Noexcept(
4249+ noexcept: json["noexcept"],
4250+ );
4251+
4252+ Map<String, dynamic> toJson() => {
4253+ "noexcept": noexcept,
42184254 };
42194255 }
42204256
@@ -5226,22 +5262,6 @@ class Sel {
52265262 };
52275263 }
52285264
5229-class Select {
5230- final int select;
5231-
5232- Select({
5233- required this.select,
5234- });
5235-
5236- factory Select.fromJson(Map<String, dynamic> json) => Select(
5237- select: json["select"],
5238- );
5239-
5240- Map<String, dynamic> toJson() => {
5241- "select": select,
5242- };
5243-}
5244-
52455265 class Obj5 {
52465266 final int dummy;
52475267 final KSerializer kSerializer;
@@ -5260,6 +5280,7 @@ class Obj5 {
52605280 final Typedef obj5Typedef;
52615281 final PrimitiveKind primitiveKind;
52625282 final TrueClass purpleTrue;
5283+ final Select select;
52635284 final Self self;
52645285 final Sendable sendable;
52655286 final SerialDescriptor serialDescriptor;
@@ -5291,6 +5312,7 @@ class Obj5 {
52915312 final TimeOnly timeOnly;
52925313 final TimeOnlyConverter timeOnlyConverter;
52935314 final TimeZone timeZone;
5315+ final ToDict toDict;
52945316 final TopLevelClass topLevel;
52955317 final Transient transient;
52965318 final Type type;
@@ -5303,11 +5325,10 @@ class Obj5 {
53035325 final Unchecked unchecked;
53045326 final Undefined undefined;
53055327 final Union union;
5328+ final UnmarshalJson unmarshalJson;
53065329 final Unowned unowned;
53075330 final Unsafe unsafe;
5308- final Unsigned unsigned;
53095331 final UseSerializers useSerializers;
5310- final Ushort ushort;
53115332
53125333 Obj5({
53135334 required this.dummy,
@@ -5327,6 +5348,7 @@ class Obj5 {
53275348 required this.obj5Typedef,
53285349 required this.primitiveKind,
53295350 required this.purpleTrue,
5351+ required this.select,
53305352 required this.self,
53315353 required this.sendable,
53325354 required this.serialDescriptor,
@@ -5358,6 +5380,7 @@ class Obj5 {
53585380 required this.timeOnly,
53595381 required this.timeOnlyConverter,
53605382 required this.timeZone,
5383+ required this.toDict,
53615384 required this.topLevel,
53625385 required this.transient,
53635386 required this.type,
@@ -5370,11 +5393,10 @@ class Obj5 {
53705393 required this.unchecked,
53715394 required this.undefined,
53725395 required this.union,
5396+ required this.unmarshalJson,
53735397 required this.unowned,
53745398 required this.unsafe,
5375- required this.unsigned,
53765399 required this.useSerializers,
5377- required this.ushort,
53785400 });
53795401
53805402 factory Obj5.fromJson(Map<String, dynamic> json) => Obj5(
@@ -5395,6 +5417,7 @@ class Obj5 {
53955417 obj5Typedef: Typedef.fromJson(json["typedef"]),
53965418 primitiveKind: PrimitiveKind.fromJson(json["PrimitiveKind"]),
53975419 purpleTrue: TrueClass.fromJson(json["true"]),
5420+ select: Select.fromJson(json["select"]),
53985421 self: Self.fromJson(json["Self"]),
53995422 sendable: Sendable.fromJson(json["Sendable"]),
54005423 serialDescriptor: SerialDescriptor.fromJson(json["SerialDescriptor"]),
@@ -5426,6 +5449,7 @@ class Obj5 {
54265449 timeOnly: TimeOnly.fromJson(json["TimeOnly"]),
54275450 timeOnlyConverter: TimeOnlyConverter.fromJson(json["TimeOnlyConverter"]),
54285451 timeZone: TimeZone.fromJson(json["TimeZone"]),
5452+ toDict: ToDict.fromJson(json["to_dict"]),
54295453 topLevel: TopLevelClass.fromJson(json["top_level"]),
54305454 transient: Transient.fromJson(json["transient"]),
54315455 type: Type.fromJson(json["Type"]),
@@ -5438,11 +5462,10 @@ class Obj5 {
54385462 unchecked: Unchecked.fromJson(json["unchecked"]),
54395463 undefined: Undefined.fromJson(json["undefined"]),
54405464 union: Union.fromJson(json["union"]),
5465+ unmarshalJson: UnmarshalJson.fromJson(json["UnmarshalJSON"]),
54415466 unowned: Unowned.fromJson(json["unowned"]),
54425467 unsafe: Unsafe.fromJson(json["unsafe"]),
5443- unsigned: Unsigned.fromJson(json["unsigned"]),
54445468 useSerializers: UseSerializers.fromJson(json["UseSerializers"]),
5445- ushort: Ushort.fromJson(json["ushort"]),
54465469 );
54475470
54485471 Map<String, dynamic> toJson() => {
@@ -5463,6 +5486,7 @@ class Obj5 {
54635486 "typedef": obj5Typedef.toJson(),
54645487 "PrimitiveKind": primitiveKind.toJson(),
54655488 "true": purpleTrue.toJson(),
5489+ "select": select.toJson(),
54665490 "Self": self.toJson(),
54675491 "Sendable": sendable.toJson(),
54685492 "SerialDescriptor": serialDescriptor.toJson(),
@@ -5494,6 +5518,7 @@ class Obj5 {
54945518 "TimeOnly": timeOnly.toJson(),
54955519 "TimeOnlyConverter": timeOnlyConverter.toJson(),
54965520 "TimeZone": timeZone.toJson(),
5521+ "to_dict": toDict.toJson(),
54975522 "top_level": topLevel.toJson(),
54985523 "transient": transient.toJson(),
54995524 "Type": type.toJson(),
@@ -5506,11 +5531,10 @@ class Obj5 {
55065531 "unchecked": unchecked.toJson(),
55075532 "undefined": undefined.toJson(),
55085533 "union": union.toJson(),
5534+ "UnmarshalJSON": unmarshalJson.toJson(),
55095535 "unowned": unowned.toJson(),
55105536 "unsafe": unsafe.toJson(),
5511- "unsigned": unsigned.toJson(),
55125537 "UseSerializers": useSerializers.toJson(),
5513- "ushort": ushort.toJson(),
55145538 };
55155539 }
55165540
@@ -5770,6 +5794,22 @@ class TrueClass {
57705794 };
57715795 }
57725796
5797+class Select {
5798+ final int select;
5799+
5800+ Select({
5801+ required this.select,
5802+ });
5803+
5804+ factory Select.fromJson(Map<String, dynamic> json) => Select(
5805+ select: json["select"],
5806+ );
5807+
5808+ Map<String, dynamic> toJson() => {
5809+ "select": select,
5810+ };
5811+}
5812+
57735813 class Self {
57745814 final int self;
57755815
@@ -6266,6 +6306,22 @@ class TimeZone {
62666306 };
62676307 }
62686308
6309+class ToDict {
6310+ final int toDict;
6311+
6312+ ToDict({
6313+ required this.toDict,
6314+ });
6315+
6316+ factory ToDict.fromJson(Map<String, dynamic> json) => ToDict(
6317+ toDict: json["to_dict"],
6318+ );
6319+
6320+ Map<String, dynamic> toJson() => {
6321+ "to_dict": toDict,
6322+ };
6323+}
6324+
62696325 class TopLevelClass {
62706326 final int topLevel;
62716327
@@ -6458,6 +6514,22 @@ class Union {
64586514 };
64596515 }
64606516
6517+class UnmarshalJson {
6518+ final int unmarshalJson;
6519+
6520+ UnmarshalJson({
6521+ required this.unmarshalJson,
6522+ });
6523+
6524+ factory UnmarshalJson.fromJson(Map<String, dynamic> json) => UnmarshalJson(
6525+ unmarshalJson: json["UnmarshalJSON"],
6526+ );
6527+
6528+ Map<String, dynamic> toJson() => {
6529+ "UnmarshalJSON": unmarshalJson,
6530+ };
6531+}
6532+
64616533 class Unowned {
64626534 final int unowned;
64636535
@@ -6490,22 +6562,6 @@ class Unsafe {
64906562 };
64916563 }
64926564
6493-class Unsigned {
6494- final int unsigned;
6495-
6496- Unsigned({
6497- required this.unsigned,
6498- });
6499-
6500- factory Unsigned.fromJson(Map<String, dynamic> json) => Unsigned(
6501- unsigned: json["unsigned"],
6502- );
6503-
6504- Map<String, dynamic> toJson() => {
6505- "unsigned": unsigned,
6506- };
6507-}
6508-
65096565 class UseSerializers {
65106566 final int useSerializers;
65116567
@@ -6522,22 +6578,6 @@ class UseSerializers {
65226578 };
65236579 }
65246580
6525-class Ushort {
6526- final int ushort;
6527-
6528- Ushort({
6529- required this.ushort,
6530- });
6531-
6532- factory Ushort.fromJson(Map<String, dynamic> json) => Ushort(
6533- ushort: json["ushort"],
6534- );
6535-
6536- Map<String, dynamic> toJson() => {
6537- "ushort": ushort,
6538- };
6539-}
6540-
65416581 class Obj6 {
65426582 final int dummy;
65436583 final Var obj6Var;
@@ -6545,6 +6585,8 @@ class Obj6 {
65456585 final While obj6While;
65466586 final With obj6With;
65476587 final Yield obj6Yield;
6588+ final Unsigned unsigned;
6589+ final Ushort ushort;
65486590 final Using using;
65496591 final Utf8JsonReader utf8JsonReader;
65506592 final Utf8JsonWriter utf8JsonWriter;
@@ -6566,6 +6608,8 @@ class Obj6 {
65666608 required this.obj6While,
65676609 required this.obj6With,
65686610 required this.obj6Yield,
6611+ required this.unsigned,
6612+ required this.ushort,
65696613 required this.using,
65706614 required this.utf8JsonReader,
65716615 required this.utf8JsonWriter,
@@ -6588,6 +6632,8 @@ class Obj6 {
65886632 obj6While: While.fromJson(json["while"]),
65896633 obj6With: With.fromJson(json["with"]),
65906634 obj6Yield: Yield.fromJson(json["yield"]),
6635+ unsigned: Unsigned.fromJson(json["unsigned"]),
6636+ ushort: Ushort.fromJson(json["ushort"]),
65916637 using: Using.fromJson(json["using"]),
65926638 utf8JsonReader: Utf8JsonReader.fromJson(json["Utf8JsonReader"]),
65936639 utf8JsonWriter: Utf8JsonWriter.fromJson(json["Utf8JsonWriter"]),
@@ -6610,6 +6656,8 @@ class Obj6 {
66106656 "while": obj6While.toJson(),
66116657 "with": obj6With.toJson(),
66126658 "yield": obj6Yield.toJson(),
6659+ "unsigned": unsigned.toJson(),
6660+ "ushort": ushort.toJson(),
66136661 "using": using.toJson(),
66146662 "Utf8JsonReader": utf8JsonReader.toJson(),
66156663 "Utf8JsonWriter": utf8JsonWriter.toJson(),
@@ -6706,6 +6754,38 @@ class Yield {
67066754 };
67076755 }
67086756
6757+class Unsigned {
6758+ final int unsigned;
6759+
6760+ Unsigned({
6761+ required this.unsigned,
6762+ });
6763+
6764+ factory Unsigned.fromJson(Map<String, dynamic> json) => Unsigned(
6765+ unsigned: json["unsigned"],
6766+ );
6767+
6768+ Map<String, dynamic> toJson() => {
6769+ "unsigned": unsigned,
6770+ };
6771+}
6772+
6773+class Ushort {
6774+ final int ushort;
6775+
6776+ Ushort({
6777+ required this.ushort,
6778+ });
6779+
6780+ factory Ushort.fromJson(Map<String, dynamic> json) => Ushort(
6781+ ushort: json["ushort"],
6782+ );
6783+
6784+ Map<String, dynamic> toJson() => {
6785+ "ushort": ushort,
6786+ };
6787+}
6788+
67096789 class Using {
67106790 final int using;
Melixirdefault / QuickType.ex+385 −217
@@ -4845,6 +4845,45 @@ defmodule From do
48454845 end
48464846 end
48474847
4848+defmodule FromDict do
4849+ @enforce_keys [:from_dict]
4850+ defstruct [:from_dict]
4851+
4852+ @type t :: %__MODULE__{
4853+ from_dict: integer()
4854+ }
4855+
4856+ def decode_from_dict(value) when is_integer(value), do: value
4857+ def decode_from_dict(_), do: {:error, "Unexpected type when decoding FromDict.from_dict"}
4858+
4859+ def encode_from_dict(value) when is_integer(value), do: value
4860+ def encode_from_dict(_), do: {:error, "Unexpected type when encoding FromDict.from_dict"}
4861+
4862+ def from_map(m) do
4863+ %FromDict{
4864+ from_dict: decode_from_dict(m["from_dict"]),
4865+ }
4866+ end
4867+
4868+ def from_json(json) do
4869+ json
4870+ |> Jason.decode!()
4871+ |> from_map()
4872+ end
4873+
4874+ def to_map(struct) do
4875+ %{
4876+ "from_dict" => struct.from_dict,
4877+ }
4878+ end
4879+
4880+ def to_json(struct) do
4881+ struct
4882+ |> to_map()
4883+ |> Jason.encode!()
4884+ end
4885+end
4886+
48484887 defmodule FromJSON do
48494888 @enforce_keys [:from_json]
48504889 defstruct [:from_json]
@@ -5079,45 +5118,6 @@ defmodule Go do
50795118 end
50805119 end
50815120
5082-defmodule Goto do
5083- @enforce_keys [:goto]
5084- defstruct [:goto]
5085-
5086- @type t :: %__MODULE__{
5087- goto: integer()
5088- }
5089-
5090- def decode_goto(value) when is_integer(value), do: value
5091- def decode_goto(_), do: {:error, "Unexpected type when decoding Goto.goto"}
5092-
5093- def encode_goto(value) when is_integer(value), do: value
5094- def encode_goto(_), do: {:error, "Unexpected type when encoding Goto.goto"}
5095-
5096- def from_map(m) do
5097- %Goto{
5098- goto: decode_goto(m["goto"]),
5099- }
5100- end
5101-
5102- def from_json(json) do
5103- json
5104- |> Jason.decode!()
5105- |> from_map()
5106- end
5107-
5108- def to_map(struct) do
5109- %{
5110- "goto" => struct.goto,
5111- }
5112- end
5113-
5114- def to_json(struct) do
5115- struct
5116- |> to_map()
5117- |> Jason.encode!()
5118- end
5119-end
5120-
51215121 defmodule DefClass do
51225122 @enforce_keys [:def_def]
51235123 defstruct [:def_def]
@@ -5275,8 +5275,8 @@ defmodule FalseClass do
52755275 end
52765276
52775277 defmodule Obj2 do
5278- @enforce_keys [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_json, :func, :function, :get, :global, :go, :goto, :obj2_def, :obj2_do, :obj2_else, :obj2_false]
5279- defstruct [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_json, :func, :function, :get, :global, :go, :goto, :obj2_def, :obj2_do, :obj2_else, :obj2_false]
5278+ @enforce_keys [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_dict, :from_json, :func, :function, :get, :global, :go, :obj2_def, :obj2_do, :obj2_else, :obj2_false]
5279+ defstruct [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_dict, :from_json, :func, :function, :get, :global, :go, :obj2_def, :obj2_do, :obj2_else, :obj2_false]
52805280
52815281 @type t :: %__MODULE__{
52825282 date_formatter: DateFormatter.t(),
@@ -5333,13 +5333,13 @@ defmodule Obj2 do
53335333 format_exception: FormatException.t(),
53345334 friend: Friend.t(),
53355335 from: From.t(),
5336+ from_dict: FromDict.t(),
53365337 from_json: FromJSON.t(),
53375338 func: Func.t(),
53385339 function: FunctionClass.t(),
53395340 get: Get.t(),
53405341 global: Global.t(),
53415342 go: Go.t(),
5342- goto: Goto.t(),
53435343 obj2_def: DefClass.t(),
53445344 obj2_do: DoClass.t(),
53455345 obj2_else: ElseClass.t(),
@@ -5408,13 +5408,13 @@ defmodule Obj2 do
54085408 format_exception: FormatException.from_map(m["FormatException"]),
54095409 friend: Friend.from_map(m["friend"]),
54105410 from: From.from_map(m["from"]),
5411+ from_dict: FromDict.from_map(m["from_dict"]),
54115412 from_json: FromJSON.from_map(m["from_json"]),
54125413 func: Func.from_map(m["func"]),
54135414 function: FunctionClass.from_map(m["function"]),
54145415 get: Get.from_map(m["get"]),
54155416 global: Global.from_map(m["global"]),
54165417 go: Go.from_map(m["go"]),
5417- goto: Goto.from_map(m["goto"]),
54185418 obj2_def: DefClass.from_map(m["def"]),
54195419 obj2_do: DoClass.from_map(m["do"]),
54205420 obj2_else: ElseClass.from_map(m["else"]),
@@ -5484,13 +5484,13 @@ defmodule Obj2 do
54845484 "FormatException" => FormatException.to_map(struct.format_exception),
54855485 "friend" => Friend.to_map(struct.friend),
54865486 "from" => From.to_map(struct.from),
5487+ "from_dict" => FromDict.to_map(struct.from_dict),
54875488 "from_json" => FromJSON.to_map(struct.from_json),
54885489 "func" => Func.to_map(struct.func),
54895490 "function" => FunctionClass.to_map(struct.function),
54905491 "get" => Get.to_map(struct.get),
54915492 "global" => Global.to_map(struct.global),
54925493 "go" => Go.to_map(struct.go),
5493- "goto" => Goto.to_map(struct.goto),
54945494 "def" => DefClass.to_map(struct.obj2_def),
54955495 "do" => DoClass.to_map(struct.obj2_do),
54965496 "else" => ElseClass.to_map(struct.obj2_else),
@@ -5505,6 +5505,45 @@ defmodule Obj2 do
55055505 end
55065506 end
55075507
5508+defmodule Goto do
5509+ @enforce_keys [:goto]
5510+ defstruct [:goto]
5511+
5512+ @type t :: %__MODULE__{
5513+ goto: integer()
5514+ }
5515+
5516+ def decode_goto(value) when is_integer(value), do: value
5517+ def decode_goto(_), do: {:error, "Unexpected type when decoding Goto.goto"}
5518+
5519+ def encode_goto(value) when is_integer(value), do: value
5520+ def encode_goto(_), do: {:error, "Unexpected type when encoding Goto.goto"}
5521+
5522+ def from_map(m) do
5523+ %Goto{
5524+ goto: decode_goto(m["goto"]),
5525+ }
5526+ end
5527+
5528+ def from_json(json) do
5529+ json
5530+ |> Jason.decode!()
5531+ |> from_map()
5532+ end
5533+
5534+ def to_map(struct) do
5535+ %{
5536+ "goto" => struct.goto,
5537+ }
5538+ end
5539+
5540+ def to_json(struct) do
5541+ struct
5542+ |> to_map()
5543+ |> Jason.encode!()
5544+ end
5545+end
5546+
55085547 defmodule Guard do
55095548 @enforce_keys [:guard]
55105549 defstruct [:guard]
@@ -7494,6 +7533,45 @@ defmodule MapEntry do
74947533 end
74957534 end
74967535
7536+defmodule MarshalJSON do
7537+ @enforce_keys [:marshal_json]
7538+ defstruct [:marshal_json]
7539+
7540+ @type t :: %__MODULE__{
7541+ marshal_json: integer()
7542+ }
7543+
7544+ def decode_marshal_json(value) when is_integer(value), do: value
7545+ def decode_marshal_json(_), do: {:error, "Unexpected type when decoding MarshalJSON.marshal_json"}
7546+
7547+ def encode_marshal_json(value) when is_integer(value), do: value
7548+ def encode_marshal_json(_), do: {:error, "Unexpected type when encoding MarshalJSON.marshal_json"}
7549+
7550+ def from_map(m) do
7551+ %MarshalJSON{
7552+ marshal_json: decode_marshal_json(m["MarshalJSON"]),
7553+ }
7554+ end
7555+
7556+ def from_json(json) do
7557+ json
7558+ |> Jason.decode!()
7559+ |> from_map()
7560+ end
7561+
7562+ def to_map(struct) do
7563+ %{
7564+ "MarshalJSON" => struct.marshal_json,
7565+ }
7566+ end
7567+
7568+ def to_json(struct) do
7569+ struct
7570+ |> to_map()
7571+ |> Jason.encode!()
7572+ end
7573+end
7574+
74977575 defmodule MetadataPropertyHandling do
74987576 @enforce_keys [:metadata_property_handling]
74997577 defstruct [:metadata_property_handling]
@@ -7845,45 +7923,6 @@ defmodule No do
78457923 end
78467924 end
78477925
7848-defmodule Noexcept do
7849- @enforce_keys [:noexcept]
7850- defstruct [:noexcept]
7851-
7852- @type t :: %__MODULE__{
7853- noexcept: integer()
7854- }
7855-
7856- def decode_noexcept(value) when is_integer(value), do: value
7857- def decode_noexcept(_), do: {:error, "Unexpected type when decoding Noexcept.noexcept"}
7858-
7859- def encode_noexcept(value) when is_integer(value), do: value
7860- def encode_noexcept(_), do: {:error, "Unexpected type when encoding Noexcept.noexcept"}
7861-
7862- def from_map(m) do
7863- %Noexcept{
7864- noexcept: decode_noexcept(m["noexcept"]),
7865- }
7866- end
7867-
7868- def from_json(json) do
7869- json
7870- |> Jason.decode!()
7871- |> from_map()
7872- end
7873-
7874- def to_map(struct) do
7875- %{
7876- "noexcept" => struct.noexcept,
7877- }
7878- end
7879-
7880- def to_json(struct) do
7881- struct
7882- |> to_map()
7883- |> Jason.encode!()
7884- end
7885-end
7886-
78877926 defmodule ImportClass do
78887927 @enforce_keys [:import_import]
78897928 defstruct [:import_import]
@@ -8002,11 +8041,12 @@ defmodule NilClass do
80028041 end
80038042
80048043 defmodule Obj3 do
8005- @enforce_keys [:dummy, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :noexcept, :obj3_import, :obj3_in, :obj3_nil]
8006- defstruct [:dummy, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :noexcept, :obj3_import, :obj3_in, :obj3_nil]
8044+ @enforce_keys [:dummy, :goto, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :obj3_import, :obj3_in, :obj3_nil]
8045+ defstruct [:dummy, :goto, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :obj3_import, :obj3_in, :obj3_nil]
80078046
80088047 @type t :: %__MODULE__{
80098048 dummy: integer(),
8049+ goto: Goto.t(),
80108050 guard: Guard.t(),
80118051 has_own_property: HasOwnProperty.t(),
80128052 hash_code: HashCode.t(),
@@ -8058,6 +8098,7 @@ defmodule Obj3 do
80588098 long: Long.t(),
80598099 map: MapClass.t(),
80608100 map_entry: MapEntry.t(),
8101+ marshal_json: MarshalJSON.t(),
80618102 metadata_property_handling: MetadataPropertyHandling.t(),
80628103 module: ModuleClass.t(),
80638104 mutable: Mutable.t(),
@@ -8067,7 +8108,6 @@ defmodule Obj3 do
80678108 new: New.t(),
80688109 newtonsoft: Newtonsoft.t(),
80698110 no: No.t(),
8070- noexcept: Noexcept.t(),
80718111 obj3_import: ImportClass.t(),
80728112 obj3_in: InClass.t(),
80738113 obj3_nil: NilClass.t()
@@ -8082,6 +8122,7 @@ defmodule Obj3 do
80828122 def from_map(m) do
80838123 %Obj3{
80848124 dummy: decode_dummy(m["dummy"]),
8125+ goto: Goto.from_map(m["goto"]),
80858126 guard: Guard.from_map(m["guard"]),
80868127 has_own_property: HasOwnProperty.from_map(m["hasOwnProperty"]),
80878128 hash_code: HashCode.from_map(m["hashCode"]),
@@ -8133,6 +8174,7 @@ defmodule Obj3 do
81338174 long: Long.from_map(m["long"]),
81348175 map: MapClass.from_map(m["map"]),
81358176 map_entry: MapEntry.from_map(m["MapEntry"]),
8177+ marshal_json: MarshalJSON.from_map(m["MarshalJSON"]),
81368178 metadata_property_handling: MetadataPropertyHandling.from_map(m["metadata_property_handling"]),
81378179 module: ModuleClass.from_map(m["module"]),
81388180 mutable: Mutable.from_map(m["mutable"]),
@@ -8142,7 +8184,6 @@ defmodule Obj3 do
81428184 new: New.from_map(m["new"]),
81438185 newtonsoft: Newtonsoft.from_map(m["newtonsoft"]),
81448186 no: No.from_map(m["NO"]),
8145- noexcept: Noexcept.from_map(m["noexcept"]),
81468187 obj3_import: ImportClass.from_map(m["import"]),
81478188 obj3_in: InClass.from_map(m["in"]),
81488189 obj3_nil: NilClass.from_map(m["nil"]),
@@ -8158,6 +8199,7 @@ defmodule Obj3 do
81588199 def to_map(struct) do
81598200 %{
81608201 "dummy" => struct.dummy,
8202+ "goto" => Goto.to_map(struct.goto),
81618203 "guard" => Guard.to_map(struct.guard),
81628204 "hasOwnProperty" => HasOwnProperty.to_map(struct.has_own_property),
81638205 "hashCode" => HashCode.to_map(struct.hash_code),
@@ -8209,6 +8251,7 @@ defmodule Obj3 do
82098251 "long" => Long.to_map(struct.long),
82108252 "map" => MapClass.to_map(struct.map),
82118253 "MapEntry" => MapEntry.to_map(struct.map_entry),
8254+ "MarshalJSON" => MarshalJSON.to_map(struct.marshal_json),
82128255 "metadata_property_handling" => MetadataPropertyHandling.to_map(struct.metadata_property_handling),
82138256 "module" => ModuleClass.to_map(struct.module),
82148257 "mutable" => Mutable.to_map(struct.mutable),
@@ -8218,7 +8261,6 @@ defmodule Obj3 do
82188261 "new" => New.to_map(struct.new),
82198262 "newtonsoft" => Newtonsoft.to_map(struct.newtonsoft),
82208263 "NO" => No.to_map(struct.no),
8221- "noexcept" => Noexcept.to_map(struct.noexcept),
82228264 "import" => ImportClass.to_map(struct.obj3_import),
82238265 "in" => InClass.to_map(struct.obj3_in),
82248266 "nil" => NilClass.to_map(struct.obj3_nil),
@@ -8271,6 +8313,45 @@ defmodule NoSuchMethod do
82718313 end
82728314 end
82738315
8316+defmodule Noexcept do
8317+ @enforce_keys [:noexcept]
8318+ defstruct [:noexcept]
8319+
8320+ @type t :: %__MODULE__{
8321+ noexcept: integer()
8322+ }
8323+
8324+ def decode_noexcept(value) when is_integer(value), do: value
8325+ def decode_noexcept(_), do: {:error, "Unexpected type when decoding Noexcept.noexcept"}
8326+
8327+ def encode_noexcept(value) when is_integer(value), do: value
8328+ def encode_noexcept(_), do: {:error, "Unexpected type when encoding Noexcept.noexcept"}
8329+
8330+ def from_map(m) do
8331+ %Noexcept{
8332+ noexcept: decode_noexcept(m["noexcept"]),
8333+ }
8334+ end
8335+
8336+ def from_json(json) do
8337+ json
8338+ |> Jason.decode!()
8339+ |> from_map()
8340+ end
8341+
8342+ def to_map(struct) do
8343+ %{
8344+ "noexcept" => struct.noexcept,
8345+ }
8346+ end
8347+
8348+ def to_json(struct) do
8349+ struct
8350+ |> to_map()
8351+ |> Jason.encode!()
8352+ end
8353+end
8354+
82748355 defmodule Nonatomic do
82758356 @enforce_keys [:nonatomic]
82768357 defstruct [:nonatomic]
@@ -10689,52 +10770,14 @@ defmodule Sel do
1068910770 end
1069010771 end
1069110772
10692-defmodule Select do
10693- @enforce_keys [:select]
10694- defstruct [:select]
10695-
10696- @type t :: %__MODULE__{
10697- select: integer()
10698- }
10699-
10700- def decode_select(value) when is_integer(value), do: value
10701- def decode_select(_), do: {:error, "Unexpected type when decoding Select.select"}
10702-
10703- def encode_select(value) when is_integer(value), do: value
10704- def encode_select(_), do: {:error, "Unexpected type when encoding Select.select"}
10705-
10706- def from_map(m) do
10707- %Select{
10708- select: decode_select(m["select"]),
10709- }
10710- end
10711-
10712- def from_json(json) do
10713- json
10714- |> Jason.decode!()
10715- |> from_map()
10716- end
10717-
10718- def to_map(struct) do
10719- %{
10720- "select" => struct.select,
10721- }
10722- end
10723-
10724- def to_json(struct) do
10725- struct
10726- |> to_map()
10727- |> Jason.encode!()
10728- end
10729-end
10730-
10731-defmodule Obj4 do
10732- @enforce_keys [:dummy, :no_such_method, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select]
10733- defstruct [:dummy, :no_such_method, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select]
10773+defmodule Obj4 do
10774+ @enforce_keys [:dummy, :no_such_method, :noexcept, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel]
10775+ defstruct [:dummy, :no_such_method, :noexcept, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel]
1073410776
1073510777 @type t :: %__MODULE__{
1073610778 dummy: integer(),
1073710779 no_such_method: NoSuchMethod.t(),
10780+ noexcept: Noexcept.t(),
1073810781 nonatomic: Nonatomic.t(),
1073910782 none: None.t(),
1074010783 nonlocal: Nonlocal.t(),
@@ -10796,8 +10839,7 @@ defmodule Obj4 do
1079610839 s: S.t(),
1079710840 sbyte: Sbyte.t(),
1079810841 sealed: Sealed.t(),
10799- sel: Sel.t(),
10800- select: Select.t()
10842+ sel: Sel.t()
1080110843 }
1080210844
1080310845 def decode_dummy(value) when is_integer(value), do: value
@@ -10810,6 +10852,7 @@ defmodule Obj4 do
1081010852 %Obj4{
1081110853 dummy: decode_dummy(m["dummy"]),
1081210854 no_such_method: NoSuchMethod.from_map(m["noSuchMethod"]),
10855+ noexcept: Noexcept.from_map(m["noexcept"]),
1081310856 nonatomic: Nonatomic.from_map(m["nonatomic"]),
1081410857 none: None.from_map(m["None"]),
1081510858 nonlocal: Nonlocal.from_map(m["nonlocal"]),
@@ -10872,7 +10915,6 @@ defmodule Obj4 do
1087210915 sbyte: Sbyte.from_map(m["sbyte"]),
1087310916 sealed: Sealed.from_map(m["sealed"]),
1087410917 sel: Sel.from_map(m["SEL"]),
10875- select: Select.from_map(m["select"]),
1087610918 }
1087710919 end
1087810920
@@ -10886,6 +10928,7 @@ defmodule Obj4 do
1088610928 %{
1088710929 "dummy" => struct.dummy,
1088810930 "noSuchMethod" => NoSuchMethod.to_map(struct.no_such_method),
10931+ "noexcept" => Noexcept.to_map(struct.noexcept),
1088910932 "nonatomic" => Nonatomic.to_map(struct.nonatomic),
1089010933 "None" => None.to_map(struct.none),
1089110934 "nonlocal" => Nonlocal.to_map(struct.nonlocal),
@@ -10948,7 +10991,6 @@ defmodule Obj4 do
1094810991 "sbyte" => Sbyte.to_map(struct.sbyte),
1094910992 "sealed" => Sealed.to_map(struct.sealed),
1095010993 "SEL" => Sel.to_map(struct.sel),
10951- "select" => Select.to_map(struct.select),
1095210994 }
1095310995 end
1095410996
@@ -11154,6 +11196,45 @@ defmodule PrimitiveKind do
1115411196 end
1115511197 end
1115611198
11199+defmodule Select do
11200+ @enforce_keys [:select]
11201+ defstruct [:select]
11202+
11203+ @type t :: %__MODULE__{
11204+ select: integer()
11205+ }
11206+
11207+ def decode_select(value) when is_integer(value), do: value
11208+ def decode_select(_), do: {:error, "Unexpected type when decoding Select.select"}
11209+
11210+ def encode_select(value) when is_integer(value), do: value
11211+ def encode_select(_), do: {:error, "Unexpected type when encoding Select.select"}
11212+
11213+ def from_map(m) do
11214+ %Select{
11215+ select: decode_select(m["select"]),
11216+ }
11217+ end
11218+
11219+ def from_json(json) do
11220+ json
11221+ |> Jason.decode!()
11222+ |> from_map()
11223+ end
11224+
11225+ def to_map(struct) do
11226+ %{
11227+ "select" => struct.select,
11228+ }
11229+ end
11230+
11231+ def to_json(struct) do
11232+ struct
11233+ |> to_map()
11234+ |> Jason.encode!()
11235+ end
11236+end
11237+
1115711238 defmodule Self do
1115811239 @enforce_keys [:self]
1115911240 defstruct [:self]
@@ -12597,6 +12678,45 @@ defmodule TimeZone do
1259712678 end
1259812679 end
1259912680
12681+defmodule ToDict do
12682+ @enforce_keys [:to_dict]
12683+ defstruct [:to_dict]
12684+
12685+ @type t :: %__MODULE__{
12686+ to_dict: integer()
12687+ }
12688+
12689+ def decode_to_dict(value) when is_integer(value), do: value
12690+ def decode_to_dict(_), do: {:error, "Unexpected type when decoding ToDict.to_dict"}
12691+
12692+ def encode_to_dict(value) when is_integer(value), do: value
12693+ def encode_to_dict(_), do: {:error, "Unexpected type when encoding ToDict.to_dict"}
12694+
12695+ def from_map(m) do
12696+ %ToDict{
12697+ to_dict: decode_to_dict(m["to_dict"]),
12698+ }
12699+ end
12700+
12701+ def from_json(json) do
12702+ json
12703+ |> Jason.decode!()
12704+ |> from_map()
12705+ end
12706+
12707+ def to_map(struct) do
12708+ %{
12709+ "to_dict" => struct.to_dict,
12710+ }
12711+ end
12712+
12713+ def to_json(struct) do
12714+ struct
12715+ |> to_map()
12716+ |> Jason.encode!()
12717+ end
12718+end
12719+
1260012720 defmodule ToJSON do
1260112721 @enforce_keys [:to_json]
1260212722 defstruct [:to_json]
@@ -13260,23 +13380,23 @@ defmodule Union do
1326013380 end
1326113381 end
1326213382
13263-defmodule Unowned do
13264- @enforce_keys [:unowned]
13265- defstruct [:unowned]
13383+defmodule UnmarshalJSON do
13384+ @enforce_keys [:unmarshal_json]
13385+ defstruct [:unmarshal_json]
1326613386
1326713387 @type t :: %__MODULE__{
13268- unowned: integer()
13388+ unmarshal_json: integer()
1326913389 }
1327013390
13271- def decode_unowned(value) when is_integer(value), do: value
13272- def decode_unowned(_), do: {:error, "Unexpected type when decoding Unowned.unowned"}
13391+ def decode_unmarshal_json(value) when is_integer(value), do: value
13392+ def decode_unmarshal_json(_), do: {:error, "Unexpected type when decoding UnmarshalJSON.unmarshal_json"}
1327313393
13274- def encode_unowned(value) when is_integer(value), do: value
13275- def encode_unowned(_), do: {:error, "Unexpected type when encoding Unowned.unowned"}
13394+ def encode_unmarshal_json(value) when is_integer(value), do: value
13395+ def encode_unmarshal_json(_), do: {:error, "Unexpected type when encoding UnmarshalJSON.unmarshal_json"}
1327613396
1327713397 def from_map(m) do
13278- %Unowned{
13279- unowned: decode_unowned(m["unowned"]),
13398+ %UnmarshalJSON{
13399+ unmarshal_json: decode_unmarshal_json(m["UnmarshalJSON"]),
1328013400 }
1328113401 end
1328213402
@@ -13288,7 +13408,7 @@ defmodule Unowned do
1328813408
1328913409 def to_map(struct) do
1329013410 %{
13291- "unowned" => struct.unowned,
13411+ "UnmarshalJSON" => struct.unmarshal_json,
1329213412 }
1329313413 end
1329413414
@@ -13299,23 +13419,23 @@ defmodule Unowned do
1329913419 end
1330013420 end
1330113421
13302-defmodule Unsafe do
13303- @enforce_keys [:unsafe]
13304- defstruct [:unsafe]
13422+defmodule Unowned do
13423+ @enforce_keys [:unowned]
13424+ defstruct [:unowned]
1330513425
1330613426 @type t :: %__MODULE__{
13307- unsafe: integer()
13427+ unowned: integer()
1330813428 }
1330913429
13310- def decode_unsafe(value) when is_integer(value), do: value
13311- def decode_unsafe(_), do: {:error, "Unexpected type when decoding Unsafe.unsafe"}
13430+ def decode_unowned(value) when is_integer(value), do: value
13431+ def decode_unowned(_), do: {:error, "Unexpected type when decoding Unowned.unowned"}
1331213432
13313- def encode_unsafe(value) when is_integer(value), do: value
13314- def encode_unsafe(_), do: {:error, "Unexpected type when encoding Unsafe.unsafe"}
13433+ def encode_unowned(value) when is_integer(value), do: value
13434+ def encode_unowned(_), do: {:error, "Unexpected type when encoding Unowned.unowned"}
1331513435
1331613436 def from_map(m) do
13317- %Unsafe{
13318- unsafe: decode_unsafe(m["unsafe"]),
13437+ %Unowned{
13438+ unowned: decode_unowned(m["unowned"]),
1331913439 }
1332013440 end
1332113441
@@ -13327,7 +13447,7 @@ defmodule Unsafe do
1332713447
1332813448 def to_map(struct) do
1332913449 %{
13330- "unsafe" => struct.unsafe,
13450+ "unowned" => struct.unowned,
1333113451 }
1333213452 end
1333313453
@@ -13338,23 +13458,23 @@ defmodule Unsafe do
1333813458 end
1333913459 end
1334013460
13341-defmodule Unsigned do
13342- @enforce_keys [:unsigned]
13343- defstruct [:unsigned]
13461+defmodule Unsafe do
13462+ @enforce_keys [:unsafe]
13463+ defstruct [:unsafe]
1334413464
1334513465 @type t :: %__MODULE__{
13346- unsigned: integer()
13466+ unsafe: integer()
1334713467 }
1334813468
13349- def decode_unsigned(value) when is_integer(value), do: value
13350- def decode_unsigned(_), do: {:error, "Unexpected type when decoding Unsigned.unsigned"}
13469+ def decode_unsafe(value) when is_integer(value), do: value
13470+ def decode_unsafe(_), do: {:error, "Unexpected type when decoding Unsafe.unsafe"}
1335113471
13352- def encode_unsigned(value) when is_integer(value), do: value
13353- def encode_unsigned(_), do: {:error, "Unexpected type when encoding Unsigned.unsigned"}
13472+ def encode_unsafe(value) when is_integer(value), do: value
13473+ def encode_unsafe(_), do: {:error, "Unexpected type when encoding Unsafe.unsafe"}
1335413474
1335513475 def from_map(m) do
13356- %Unsigned{
13357- unsigned: decode_unsigned(m["unsigned"]),
13476+ %Unsafe{
13477+ unsafe: decode_unsafe(m["unsafe"]),
1335813478 }
1335913479 end
1336013480
@@ -13366,7 +13486,7 @@ defmodule Unsigned do
1336613486
1336713487 def to_map(struct) do
1336813488 %{
13369- "unsigned" => struct.unsigned,
13489+ "unsafe" => struct.unsafe,
1337013490 }
1337113491 end
1337213492
@@ -13416,48 +13536,9 @@ defmodule UseSerializers do
1341613536 end
1341713537 end
1341813538
13419-defmodule Ushort do
13420- @enforce_keys [:ushort]
13421- defstruct [:ushort]
13422-
13423- @type t :: %__MODULE__{
13424- ushort: integer()
13425- }
13426-
13427- def decode_ushort(value) when is_integer(value), do: value
13428- def decode_ushort(_), do: {:error, "Unexpected type when decoding Ushort.ushort"}
13429-
13430- def encode_ushort(value) when is_integer(value), do: value
13431- def encode_ushort(_), do: {:error, "Unexpected type when encoding Ushort.ushort"}
13432-
13433- def from_map(m) do
13434- %Ushort{
13435- ushort: decode_ushort(m["ushort"]),
13436- }
13437- end
13438-
13439- def from_json(json) do
13440- json
13441- |> Jason.decode!()
13442- |> from_map()
13443- end
13444-
13445- def to_map(struct) do
13446- %{
13447- "ushort" => struct.ushort,
13448- }
13449- end
13450-
13451- def to_json(struct) do
13452- struct
13453- |> to_map()
13454- |> Jason.encode!()
13455- end
13456-end
13457-
1345813539 defmodule Obj5 do
13459- @enforce_keys [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unowned, :unsafe, :unsigned, :use_serializers, :ushort]
13460- defstruct [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unowned, :unsafe, :unsigned, :use_serializers, :ushort]
13540+ @enforce_keys [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :select, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_dict, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unmarshal_json, :unowned, :unsafe, :use_serializers]
13541+ defstruct [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :select, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_dict, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unmarshal_json, :unowned, :unsafe, :use_serializers]
1346113542
1346213543 @type t :: %__MODULE__{
1346313544 dummy: integer(),
@@ -13466,6 +13547,7 @@ defmodule Obj5 do
1346613547 obj5_true: TrueClass.t(),
1346713548 obj5_type: TypeClass.t(),
1346813549 primitive_kind: PrimitiveKind.t(),
13550+ select: Select.t(),
1346913551 self: Self.t(),
1347013552 sendable: Sendable.t(),
1347113553 serial_descriptor: SerialDescriptor.t(),
@@ -13503,6 +13585,7 @@ defmodule Obj5 do
1350313585 time_only: TimeOnly.t(),
1350413586 time_only_converter: TimeOnlyConverter.t(),
1350513587 time_zone: TimeZone.t(),
13588+ to_dict: ToDict.t(),
1350613589 to_json: ToJSON.t(),
1350713590 to_string: ToString.t(),
1350813591 top_level: TopLevelClass.t(),
@@ -13520,11 +13603,10 @@ defmodule Obj5 do
1352013603 unchecked: Unchecked.t(),
1352113604 undefined: Undefined.t(),
1352213605 union: Union.t(),
13606+ unmarshal_json: UnmarshalJSON.t(),
1352313607 unowned: Unowned.t(),
1352413608 unsafe: Unsafe.t(),
13525- unsigned: Unsigned.t(),
13526- use_serializers: UseSerializers.t(),
13527- ushort: Ushort.t()
13609+ use_serializers: UseSerializers.t()
1352813610 }
1352913611
1353013612 def decode_dummy(value) when is_integer(value), do: value
@@ -13541,6 +13623,7 @@ defmodule Obj5 do
1354113623 obj5_true: TrueClass.from_map(m["True"]),
1354213624 obj5_type: TypeClass.from_map(m["type"]),
1354313625 primitive_kind: PrimitiveKind.from_map(m["PrimitiveKind"]),
13626+ select: Select.from_map(m["select"]),
1354413627 self: Self.from_map(m["Self"]),
1354513628 sendable: Sendable.from_map(m["Sendable"]),
1354613629 serial_descriptor: SerialDescriptor.from_map(m["SerialDescriptor"]),
@@ -13578,6 +13661,7 @@ defmodule Obj5 do
1357813661 time_only: TimeOnly.from_map(m["TimeOnly"]),
1357913662 time_only_converter: TimeOnlyConverter.from_map(m["TimeOnlyConverter"]),
1358013663 time_zone: TimeZone.from_map(m["TimeZone"]),
13664+ to_dict: ToDict.from_map(m["to_dict"]),
1358113665 to_json: ToJSON.from_map(m["to_json"]),
1358213666 to_string: ToString.from_map(m["toString"]),
1358313667 top_level: TopLevelClass.from_map(m["top_level"]),
@@ -13595,11 +13679,10 @@ defmodule Obj5 do
1359513679 unchecked: Unchecked.from_map(m["unchecked"]),
1359613680 undefined: Undefined.from_map(m["undefined"]),
1359713681 union: Union.from_map(m["union"]),
13682+ unmarshal_json: UnmarshalJSON.from_map(m["UnmarshalJSON"]),
1359813683 unowned: Unowned.from_map(m["unowned"]),
1359913684 unsafe: Unsafe.from_map(m["unsafe"]),
13600- unsigned: Unsigned.from_map(m["unsigned"]),
1360113685 use_serializers: UseSerializers.from_map(m["UseSerializers"]),
13602- ushort: Ushort.from_map(m["ushort"]),
1360313686 }
1360413687 end
1360513688
@@ -13617,6 +13700,7 @@ defmodule Obj5 do
1361713700 "True" => TrueClass.to_map(struct.obj5_true),
1361813701 "type" => TypeClass.to_map(struct.obj5_type),
1361913702 "PrimitiveKind" => PrimitiveKind.to_map(struct.primitive_kind),
13703+ "select" => Select.to_map(struct.select),
1362013704 "Self" => Self.to_map(struct.self),
1362113705 "Sendable" => Sendable.to_map(struct.sendable),
1362213706 "SerialDescriptor" => SerialDescriptor.to_map(struct.serial_descriptor),
@@ -13654,6 +13738,7 @@ defmodule Obj5 do
1365413738 "TimeOnly" => TimeOnly.to_map(struct.time_only),
1365513739 "TimeOnlyConverter" => TimeOnlyConverter.to_map(struct.time_only_converter),
1365613740 "TimeZone" => TimeZone.to_map(struct.time_zone),
13741+ "to_dict" => ToDict.to_map(struct.to_dict),
1365713742 "to_json" => ToJSON.to_map(struct.to_json),
1365813743 "toString" => ToString.to_map(struct.to_string),
1365913744 "top_level" => TopLevelClass.to_map(struct.top_level),
@@ -13671,11 +13756,88 @@ defmodule Obj5 do
1367113756 "unchecked" => Unchecked.to_map(struct.unchecked),
1367213757 "undefined" => Undefined.to_map(struct.undefined),
1367313758 "union" => Union.to_map(struct.union),
13759+ "UnmarshalJSON" => UnmarshalJSON.to_map(struct.unmarshal_json),
1367413760 "unowned" => Unowned.to_map(struct.unowned),
1367513761 "unsafe" => Unsafe.to_map(struct.unsafe),
13676- "unsigned" => Unsigned.to_map(struct.unsigned),
1367713762 "UseSerializers" => UseSerializers.to_map(struct.use_serializers),
13678- "ushort" => Ushort.to_map(struct.ushort),
13763+ }
13764+ end
13765+
13766+ def to_json(struct) do
13767+ struct
13768+ |> to_map()
13769+ |> Jason.encode!()
13770+ end
13771+end
13772+
13773+defmodule Unsigned do
13774+ @enforce_keys [:unsigned]
13775+ defstruct [:unsigned]
13776+
13777+ @type t :: %__MODULE__{
13778+ unsigned: integer()
13779+ }
13780+
13781+ def decode_unsigned(value) when is_integer(value), do: value
13782+ def decode_unsigned(_), do: {:error, "Unexpected type when decoding Unsigned.unsigned"}
13783+
13784+ def encode_unsigned(value) when is_integer(value), do: value
13785+ def encode_unsigned(_), do: {:error, "Unexpected type when encoding Unsigned.unsigned"}
13786+
13787+ def from_map(m) do
13788+ %Unsigned{
13789+ unsigned: decode_unsigned(m["unsigned"]),
13790+ }
13791+ end
13792+
13793+ def from_json(json) do
13794+ json
13795+ |> Jason.decode!()
13796+ |> from_map()
13797+ end
13798+
13799+ def to_map(struct) do
13800+ %{
13801+ "unsigned" => struct.unsigned,
13802+ }
13803+ end
13804+
13805+ def to_json(struct) do
13806+ struct
13807+ |> to_map()
13808+ |> Jason.encode!()
13809+ end
13810+end
13811+
13812+defmodule Ushort do
13813+ @enforce_keys [:ushort]
13814+ defstruct [:ushort]
13815+
13816+ @type t :: %__MODULE__{
13817+ ushort: integer()
13818+ }
13819+
13820+ def decode_ushort(value) when is_integer(value), do: value
13821+ def decode_ushort(_), do: {:error, "Unexpected type when decoding Ushort.ushort"}
13822+
13823+ def encode_ushort(value) when is_integer(value), do: value
13824+ def encode_ushort(_), do: {:error, "Unexpected type when encoding Ushort.ushort"}
13825+
13826+ def from_map(m) do
13827+ %Ushort{
13828+ ushort: decode_ushort(m["ushort"]),
13829+ }
13830+ end
13831+
13832+ def from_json(json) do
13833+ json
13834+ |> Jason.decode!()
13835+ |> from_map()
13836+ end
13837+
13838+ def to_map(struct) do
13839+ %{
13840+ "ushort" => struct.ushort,
1367913841 }
1368013842 end
1368113843
@@ -14389,11 +14551,13 @@ defmodule Yield do
1438914551 end
1439014552
1439114553 defmodule Obj6 do
14392- @enforce_keys [:dummy, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield]
14393- defstruct [:dummy, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield]
14554+ @enforce_keys [:dummy, :unsigned, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield]
14555+ defstruct [:dummy, :unsigned, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield]
1439414556
1439514557 @type t :: %__MODULE__{
1439614558 dummy: integer(),
14559+ unsigned: Unsigned.t(),
14560+ ushort: Ushort.t(),
1439714561 using: Using.t(),
1439814562 utf8_json_reader: Utf8JSONReader.t(),
1439914563 utf8_json_writer: Utf8JSONWriter.t(),
@@ -14423,6 +14587,8 @@ defmodule Obj6 do
1442314587 def from_map(m) do
1442414588 %Obj6{
1442514589 dummy: decode_dummy(m["dummy"]),
14590+ unsigned: Unsigned.from_map(m["unsigned"]),
14591+ ushort: Ushort.from_map(m["ushort"]),
1442614592 using: Using.from_map(m["using"]),
1442714593 utf8_json_reader: Utf8JSONReader.from_map(m["Utf8JsonReader"]),
1442814594 utf8_json_writer: Utf8JSONWriter.from_map(m["Utf8JsonWriter"]),
@@ -14453,6 +14619,8 @@ defmodule Obj6 do
1445314619 def to_map(struct) do
1445414620 %{
1445514621 "dummy" => struct.dummy,
14622+ "unsigned" => Unsigned.to_map(struct.unsigned),
14623+ "ushort" => Ushort.to_map(struct.ushort),
1445614624 "using" => Using.to_map(struct.using),
1445714625 "Utf8JsonReader" => Utf8JSONReader.to_map(struct.utf8_json_reader),
1445814626 "Utf8JsonWriter" => Utf8JSONWriter.to_map(struct.utf8_json_writer),
Melmdefault / QuickType.elm+171 −95
@@ -133,19 +133,20 @@ module QuickType exposing
133133 , FormatException
134134 , Friend
135135 , From
136+ , FromDict
136137 , FromJSON
137138 , Func
138139 , Function
139140 , Get
140141 , Global
141142 , Go
142- , Goto
143143 , Decoder
144144 , Else
145145 , Exposing
146146 , Obj2False
147147 , FloatClass
148148 , Obj3
149+ , Goto
149150 , Guard
150151 , HasOwnProperty
151152 , HashCode
@@ -193,6 +194,7 @@ module QuickType exposing
193194 , Long
194195 , Map
195196 , MapEntry
197+ , MarshalJSON
196198 , MetadataPropertyHandling
197199 , Mutable
198200 , Mutating
@@ -202,7 +204,6 @@ module QuickType exposing
202204 , Newtonsoft
203205 , Nil
204206 , No
205- , Noexcept
206207 , If
207208 , Import
208209 , In
@@ -212,6 +213,7 @@ module QuickType exposing
212213 , Module
213214 , Obj4
214215 , NoSuchMethod
216+ , Noexcept
215217 , Nonatomic
216218 , None
217219 , Nonlocal
@@ -274,7 +276,6 @@ module QuickType exposing
274276 , Sbyte
275277 , Sealed
276278 , Sel
277- , Select
278279 , Obj5
279280 , KSerializer
280281 , SelfClass
@@ -284,6 +285,7 @@ module QuickType exposing
284285 , Type
285286 , PrimitiveKind
286287 , TypeClass
288+ , Select
287289 , Self
288290 , Sendable
289291 , SerialDescriptor
@@ -319,6 +321,7 @@ module QuickType exposing
319321 , TimeOnly
320322 , TimeOnlyConverter
321323 , TimeZone
324+ , ToDict
322325 , ToJSON
323326 , ToString
324327 , TopLevel
@@ -335,13 +338,14 @@ module QuickType exposing
335338 , Unchecked
336339 , Undefined
337340 , Union
341+ , UnmarshalJSON
338342 , Unowned
339343 , Unsafe
340- , Unsigned
341344 , UseSerializers
342- , Ushort
343345 , Obj6
344346 , Where
347+ , Unsigned
348+ , Ushort
345349 , Using
346350 , Utf8JSONReader
347351 , Utf8JSONWriter
@@ -755,13 +759,13 @@ type alias Obj2 =
755759 , formatException : FormatException
756760 , friend : Friend
757761 , from : From
762+ , fromDict : FromDict
758763 , fromJSON : FromJSON
759764 , func : Func
760765 , function : Function
761766 , get : Get
762767 , global : Global
763768 , go : Go
764- , goto : Goto
765769 , obj2Decoder : Decoder
766770 , obj2Else : Else
767771 , obj2Exposing : Exposing
@@ -981,6 +985,10 @@ type alias From =
981985 { from : Int
982986 }
983987
988+type alias FromDict =
989+ { fromDict : Int
990+ }
991+
984992 type alias FromJSON =
985993 { fromJSON : Int
986994 }
@@ -1005,10 +1013,6 @@ type alias Go =
10051013 { go : Int
10061014 }
10071015
1008-type alias Goto =
1009- { goto : Int
1010- }
1011-
10121016 type alias Decoder =
10131017 { decoderDecoder : Int
10141018 }
@@ -1031,6 +1035,7 @@ type alias FloatClass =
10311035
10321036 type alias Obj3 =
10331037 { dummy : Int
1038+ , goto : Goto
10341039 , guard : Guard
10351040 , hasOwnProperty : HasOwnProperty
10361041 , hashCode : HashCode
@@ -1078,6 +1083,7 @@ type alias Obj3 =
10781083 , long : Long
10791084 , map : Map
10801085 , mapEntry : MapEntry
1086+ , marshalJSON : MarshalJSON
10811087 , metadataPropertyHandling : MetadataPropertyHandling
10821088 , mutable : Mutable
10831089 , mutating : Mutating
@@ -1087,7 +1093,6 @@ type alias Obj3 =
10871093 , newtonsoft : Newtonsoft
10881094 , nil : Nil
10891095 , no : No
1090- , noexcept : Noexcept
10911096 , obj3If : If
10921097 , obj3Import : Import
10931098 , obj3In : In
@@ -1097,6 +1102,10 @@ type alias Obj3 =
10971102 , obj3Module : Module
10981103 }
10991104
1105+type alias Goto =
1106+ { goto : Int
1107+ }
1108+
11001109 type alias Guard =
11011110 { guard : Int
11021111 }
@@ -1285,6 +1294,10 @@ type alias MapEntry =
12851294 { mapEntry : Int
12861295 }
12871296
1297+type alias MarshalJSON =
1298+ { marshalJSON : Int
1299+ }
1300+
12881301 type alias MetadataPropertyHandling =
12891302 { metadataPropertyHandling : Int
12901303 }
@@ -1321,10 +1334,6 @@ type alias No =
13211334 { no : Int
13221335 }
13231336
1324-type alias Noexcept =
1325- { noexcept : Int
1326- }
1327-
13281337 type alias If =
13291338 { ifIf : Int
13301339 }
@@ -1356,6 +1365,7 @@ type alias Module =
13561365 type alias Obj4 =
13571366 { dummy : Int
13581367 , noSuchMethod : NoSuchMethod
1368+ , noexcept : Noexcept
13591369 , nonatomic : Nonatomic
13601370 , none : None
13611371 , nonlocal : Nonlocal
@@ -1418,13 +1428,16 @@ type alias Obj4 =
14181428 , sbyte : Sbyte
14191429 , sealed : Sealed
14201430 , sel : Sel
1421- , select : Select
14221431 }
14231432
14241433 type alias NoSuchMethod =
14251434 { noSuchMethod : Int
14261435 }
14271436
1437+type alias Noexcept =
1438+ { noexcept : Int
1439+ }
1440+
14281441 type alias Nonatomic =
14291442 { nonatomic : Int
14301443 }
@@ -1673,10 +1686,6 @@ type alias Sel =
16731686 { sel : Int
16741687 }
16751688
1676-type alias Select =
1677- { select : Int
1678- }
1679-
16801689 type alias Obj5 =
16811690 { dummy : Int
16821691 , kSerializer : KSerializer
@@ -1687,6 +1696,7 @@ type alias Obj5 =
16871696 , obj5Type : Type
16881697 , primitiveKind : PrimitiveKind
16891698 , purpleType : TypeClass
1699+ , select : Select
16901700 , self : Self
16911701 , sendable : Sendable
16921702 , serialDescriptor : SerialDescriptor
@@ -1722,6 +1732,7 @@ type alias Obj5 =
17221732 , timeOnly : TimeOnly
17231733 , timeOnlyConverter : TimeOnlyConverter
17241734 , timeZone : TimeZone
1735+ , toDict : ToDict
17251736 , toJSON : ToJSON
17261737 , toString : ToString
17271738 , topLevel : TopLevel
@@ -1738,11 +1749,10 @@ type alias Obj5 =
17381749 , unchecked : Unchecked
17391750 , undefined : Undefined
17401751 , union : Union
1752+ , unmarshalJSON : UnmarshalJSON
17411753 , unowned : Unowned
17421754 , unsafe : Unsafe
1743- , unsigned : Unsigned
17441755 , useSerializers : UseSerializers
1745- , ushort : Ushort
17461756 }
17471757
17481758 type alias KSerializer =
@@ -1777,6 +1787,10 @@ type alias TypeClass =
17771787 { typeType : Int
17781788 }
17791789
1790+type alias Select =
1791+ { select : Int
1792+ }
1793+
17801794 type alias Self =
17811795 { self : Int
17821796 }
@@ -1917,6 +1931,10 @@ type alias TimeZone =
19171931 { timeZone : Int
19181932 }
19191933
1934+type alias ToDict =
1935+ { toDict : Int
1936+ }
1937+
19201938 type alias ToJSON =
19211939 { toJSON : Int
19221940 }
@@ -1981,6 +1999,10 @@ type alias Union =
19811999 { union : Int
19822000 }
19832001
2002+type alias UnmarshalJSON =
2003+ { unmarshalJSON : Int
2004+ }
2005+
19842006 type alias Unowned =
19852007 { unowned : Int
19862008 }
@@ -1989,21 +2011,15 @@ type alias Unsafe =
19892011 { unsafe : Int
19902012 }
19912013
1992-type alias Unsigned =
1993- { unsigned : Int
1994- }
1995-
19962014 type alias UseSerializers =
19972015 { useSerializers : Int
19982016 }
19992017
2000-type alias Ushort =
2001- { ushort : Int
2002- }
2003-
20042018 type alias Obj6 =
20052019 { dummy : Int
20062020 , obj6Where : Where
2021+ , unsigned : Unsigned
2022+ , ushort : Ushort
20072023 , using : Using
20082024 , utf8JSONReader : Utf8JSONReader
20092025 , utf8JSONWriter : Utf8JSONWriter
@@ -2027,6 +2043,14 @@ type alias Where =
20272043 { whereWhere : Int
20282044 }
20292045
2046+type alias Unsigned =
2047+ { unsigned : Int
2048+ }
2049+
2050+type alias Ushort =
2051+ { ushort : Int
2052+ }
2053+
20302054 type alias Using =
20312055 { using : Int
20322056 }
@@ -3028,13 +3052,13 @@ obj2 =
30283052 |> Jpipe.required "FormatException" formatException
30293053 |> Jpipe.required "friend" friend
30303054 |> Jpipe.required "from" from
3055+ |> Jpipe.required "from_dict" fromDict
30313056 |> Jpipe.required "from_json" fromJSON
30323057 |> Jpipe.required "func" func
30333058 |> Jpipe.required "function" function
30343059 |> Jpipe.required "get" get
30353060 |> Jpipe.required "global" global
30363061 |> Jpipe.required "go" go
3037- |> Jpipe.required "goto" goto
30383062 |> Jpipe.required "Decoder" purpleDecoder
30393063 |> Jpipe.required "else" purpleElse
30403064 |> Jpipe.required "exposing" purpleExposing
@@ -3097,13 +3121,13 @@ encodeObj2 x =
30973121 , ("FormatException", encodeFormatException x.formatException)
30983122 , ("friend", encodeFriend x.friend)
30993123 , ("from", encodeFrom x.from)
3124+ , ("from_dict", encodeFromDict x.fromDict)
31003125 , ("from_json", encodeFromJSON x.fromJSON)
31013126 , ("func", encodeFunc x.func)
31023127 , ("function", encodeFunction x.function)
31033128 , ("get", encodeGet x.get)
31043129 , ("global", encodeGlobal x.global)
31053130 , ("go", encodeGo x.go)
3106- , ("goto", encodeGoto x.goto)
31073131 , ("Decoder", encodeDecoder x.obj2Decoder)
31083132 , ("else", encodeElse x.obj2Else)
31093133 , ("exposing", encodeExposing x.obj2Exposing)
@@ -3698,6 +3722,17 @@ encodeFrom x =
36983722 [ ("from", Jenc.int x.from)
36993723 ]
37003724
3725+fromDict : Jdec.Decoder FromDict
3726+fromDict =
3727+ Jdec.succeed FromDict
3728+ |> Jpipe.required "from_dict" Jdec.int
3729+
3730+encodeFromDict : FromDict -> Jenc.Value
3731+encodeFromDict x =
3732+ Jenc.object
3733+ [ ("from_dict", Jenc.int x.fromDict)
3734+ ]
3735+
37013736 fromJSON : Jdec.Decoder FromJSON
37023737 fromJSON =
37033738 Jdec.succeed FromJSON
@@ -3764,17 +3799,6 @@ encodeGo x =
37643799 [ ("go", Jenc.int x.go)
37653800 ]
37663801
3767-goto : Jdec.Decoder Goto
3768-goto =
3769- Jdec.succeed Goto
3770- |> Jpipe.required "goto" Jdec.int
3771-
3772-encodeGoto : Goto -> Jenc.Value
3773-encodeGoto x =
3774- Jenc.object
3775- [ ("goto", Jenc.int x.goto)
3776- ]
3777-
37783802 purpleDecoder : Jdec.Decoder Decoder
37793803 purpleDecoder =
37803804 Jdec.succeed Decoder
@@ -3834,6 +3858,7 @@ obj3 : Jdec.Decoder Obj3
38343858 obj3 =
38353859 Jdec.succeed Obj3
38363860 |> Jpipe.required "dummy" Jdec.int
3861+ |> Jpipe.required "goto" goto
38373862 |> Jpipe.required "guard" guard
38383863 |> Jpipe.required "hasOwnProperty" hasOwnProperty
38393864 |> Jpipe.required "hashCode" hashCode
@@ -3881,6 +3906,7 @@ obj3 =
38813906 |> Jpipe.required "long" long
38823907 |> Jpipe.required "map" map
38833908 |> Jpipe.required "MapEntry" mapEntry
3909+ |> Jpipe.required "MarshalJSON" marshalJSON
38843910 |> Jpipe.required "metadata_property_handling" metadataPropertyHandling
38853911 |> Jpipe.required "mutable" mutable
38863912 |> Jpipe.required "mutating" mutating
@@ -3890,7 +3916,6 @@ obj3 =
38903916 |> Jpipe.required "newtonsoft" newtonsoft
38913917 |> Jpipe.required "nil" nil
38923918 |> Jpipe.required "NO" no
3893- |> Jpipe.required "noexcept" noexcept
38943919 |> Jpipe.required "if" purpleIf
38953920 |> Jpipe.required "import" purpleImport
38963921 |> Jpipe.required "in" purpleIn
@@ -3903,6 +3928,7 @@ encodeObj3 : Obj3 -> Jenc.Value
39033928 encodeObj3 x =
39043929 Jenc.object
39053930 [ ("dummy", Jenc.int x.dummy)
3931+ , ("goto", encodeGoto x.goto)
39063932 , ("guard", encodeGuard x.guard)
39073933 , ("hasOwnProperty", encodeHasOwnProperty x.hasOwnProperty)
39083934 , ("hashCode", encodeHashCode x.hashCode)
@@ -3950,6 +3976,7 @@ encodeObj3 x =
39503976 , ("long", encodeLong x.long)
39513977 , ("map", encodeMap x.map)
39523978 , ("MapEntry", encodeMapEntry x.mapEntry)
3979+ , ("MarshalJSON", encodeMarshalJSON x.marshalJSON)
39533980 , ("metadata_property_handling", encodeMetadataPropertyHandling x.metadataPropertyHandling)
39543981 , ("mutable", encodeMutable x.mutable)
39553982 , ("mutating", encodeMutating x.mutating)
@@ -3959,7 +3986,6 @@ encodeObj3 x =
39593986 , ("newtonsoft", encodeNewtonsoft x.newtonsoft)
39603987 , ("nil", encodeNil x.nil)
39613988 , ("NO", encodeNo x.no)
3962- , ("noexcept", encodeNoexcept x.noexcept)
39633989 , ("if", encodeIf x.obj3If)
39643990 , ("import", encodeImport x.obj3Import)
39653991 , ("in", encodeIn x.obj3In)
@@ -3969,6 +3995,17 @@ encodeObj3 x =
39693995 , ("module", encodeModule x.obj3Module)
39703996 ]
39713997
3998+goto : Jdec.Decoder Goto
3999+goto =
4000+ Jdec.succeed Goto
4001+ |> Jpipe.required "goto" Jdec.int
4002+
4003+encodeGoto : Goto -> Jenc.Value
4004+encodeGoto x =
4005+ Jenc.object
4006+ [ ("goto", Jenc.int x.goto)
4007+ ]
4008+
39724009 guard : Jdec.Decoder Guard
39734010 guard =
39744011 Jdec.succeed Guard
@@ -4486,6 +4523,17 @@ encodeMapEntry x =
44864523 [ ("MapEntry", Jenc.int x.mapEntry)
44874524 ]
44884525
4526+marshalJSON : Jdec.Decoder MarshalJSON
4527+marshalJSON =
4528+ Jdec.succeed MarshalJSON
4529+ |> Jpipe.required "MarshalJSON" Jdec.int
4530+
4531+encodeMarshalJSON : MarshalJSON -> Jenc.Value
4532+encodeMarshalJSON x =
4533+ Jenc.object
4534+ [ ("MarshalJSON", Jenc.int x.marshalJSON)
4535+ ]
4536+
44894537 metadataPropertyHandling : Jdec.Decoder MetadataPropertyHandling
44904538 metadataPropertyHandling =
44914539 Jdec.succeed MetadataPropertyHandling
@@ -4585,17 +4633,6 @@ encodeNo x =
45854633 [ ("NO", Jenc.int x.no)
45864634 ]
45874635
4588-noexcept : Jdec.Decoder Noexcept
4589-noexcept =
4590- Jdec.succeed Noexcept
4591- |> Jpipe.required "noexcept" Jdec.int
4592-
4593-encodeNoexcept : Noexcept -> Jenc.Value
4594-encodeNoexcept x =
4595- Jenc.object
4596- [ ("noexcept", Jenc.int x.noexcept)
4597- ]
4598-
45994636 purpleIf : Jdec.Decoder If
46004637 purpleIf =
46014638 Jdec.succeed If
@@ -4678,6 +4715,7 @@ obj4 =
46784715 Jdec.succeed Obj4
46794716 |> Jpipe.required "dummy" Jdec.int
46804717 |> Jpipe.required "noSuchMethod" noSuchMethod
4718+ |> Jpipe.required "noexcept" noexcept
46814719 |> Jpipe.required "nonatomic" nonatomic
46824720 |> Jpipe.required "None" none
46834721 |> Jpipe.required "nonlocal" nonlocal
@@ -4740,13 +4778,13 @@ obj4 =
47404778 |> Jpipe.required "sbyte" sbyte
47414779 |> Jpipe.required "sealed" sealed
47424780 |> Jpipe.required "SEL" sel
4743- |> Jpipe.required "select" select
47444781
47454782 encodeObj4 : Obj4 -> Jenc.Value
47464783 encodeObj4 x =
47474784 Jenc.object
47484785 [ ("dummy", Jenc.int x.dummy)
47494786 , ("noSuchMethod", encodeNoSuchMethod x.noSuchMethod)
4787+ , ("noexcept", encodeNoexcept x.noexcept)
47504788 , ("nonatomic", encodeNonatomic x.nonatomic)
47514789 , ("None", encodeNone x.none)
47524790 , ("nonlocal", encodeNonlocal x.nonlocal)
@@ -4809,7 +4847,6 @@ encodeObj4 x =
48094847 , ("sbyte", encodeSbyte x.sbyte)
48104848 , ("sealed", encodeSealed x.sealed)
48114849 , ("SEL", encodeSel x.sel)
4812- , ("select", encodeSelect x.select)
48134850 ]
48144851
48154852 noSuchMethod : Jdec.Decoder NoSuchMethod
@@ -4823,6 +4860,17 @@ encodeNoSuchMethod x =
48234860 [ ("noSuchMethod", Jenc.int x.noSuchMethod)
48244861 ]
48254862
4863+noexcept : Jdec.Decoder Noexcept
4864+noexcept =
4865+ Jdec.succeed Noexcept
4866+ |> Jpipe.required "noexcept" Jdec.int
4867+
4868+encodeNoexcept : Noexcept -> Jenc.Value
4869+encodeNoexcept x =
4870+ Jenc.object
4871+ [ ("noexcept", Jenc.int x.noexcept)
4872+ ]
4873+
48264874 nonatomic : Jdec.Decoder Nonatomic
48274875 nonatomic =
48284876 Jdec.succeed Nonatomic
@@ -5505,17 +5553,6 @@ encodeSel x =
55055553 [ ("SEL", Jenc.int x.sel)
55065554 ]
55075555
5508-select : Jdec.Decoder Select
5509-select =
5510- Jdec.succeed Select
5511- |> Jpipe.required "select" Jdec.int
5512-
5513-encodeSelect : Select -> Jenc.Value
5514-encodeSelect x =
5515- Jenc.object
5516- [ ("select", Jenc.int x.select)
5517- ]
5518-
55195556 obj5 : Jdec.Decoder Obj5
55205557 obj5 =
55215558 Jdec.succeed Obj5
@@ -5528,6 +5565,7 @@ obj5 =
55285565 |> Jpipe.required "Type" purpleType
55295566 |> Jpipe.required "PrimitiveKind" primitiveKind
55305567 |> Jpipe.required "type" typeClass
5568+ |> Jpipe.required "select" select
55315569 |> Jpipe.required "Self" self
55325570 |> Jpipe.required "Sendable" sendable
55335571 |> Jpipe.required "SerialDescriptor" serialDescriptor
@@ -5563,6 +5601,7 @@ obj5 =
55635601 |> Jpipe.required "TimeOnly" timeOnly
55645602 |> Jpipe.required "TimeOnlyConverter" timeOnlyConverter
55655603 |> Jpipe.required "TimeZone" timeZone
5604+ |> Jpipe.required "to_dict" toDict
55665605 |> Jpipe.required "to_json" toJSON
55675606 |> Jpipe.required "toString" toString
55685607 |> Jpipe.required "top_level" topLevel
@@ -5579,11 +5618,10 @@ obj5 =
55795618 |> Jpipe.required "unchecked" unchecked
55805619 |> Jpipe.required "undefined" undefined
55815620 |> Jpipe.required "union" union
5621+ |> Jpipe.required "UnmarshalJSON" unmarshalJSON
55825622 |> Jpipe.required "unowned" unowned
55835623 |> Jpipe.required "unsafe" unsafe
5584- |> Jpipe.required "unsigned" unsigned
55855624 |> Jpipe.required "UseSerializers" useSerializers
5586- |> Jpipe.required "ushort" ushort
55875625
55885626 encodeObj5 : Obj5 -> Jenc.Value
55895627 encodeObj5 x =
@@ -5597,6 +5635,7 @@ encodeObj5 x =
55975635 , ("Type", encodeType x.obj5Type)
55985636 , ("PrimitiveKind", encodePrimitiveKind x.primitiveKind)
55995637 , ("type", encodeTypeClass x.purpleType)
5638+ , ("select", encodeSelect x.select)
56005639 , ("Self", encodeSelf x.self)
56015640 , ("Sendable", encodeSendable x.sendable)
56025641 , ("SerialDescriptor", encodeSerialDescriptor x.serialDescriptor)
@@ -5632,6 +5671,7 @@ encodeObj5 x =
56325671 , ("TimeOnly", encodeTimeOnly x.timeOnly)
56335672 , ("TimeOnlyConverter", encodeTimeOnlyConverter x.timeOnlyConverter)
56345673 , ("TimeZone", encodeTimeZone x.timeZone)
5674+ , ("to_dict", encodeToDict x.toDict)
56355675 , ("to_json", encodeToJSON x.toJSON)
56365676 , ("toString", encodeToString x.toString)
56375677 , ("top_level", encodeTopLevel x.topLevel)
@@ -5648,11 +5688,10 @@ encodeObj5 x =
56485688 , ("unchecked", encodeUnchecked x.unchecked)
56495689 , ("undefined", encodeUndefined x.undefined)
56505690 , ("union", encodeUnion x.union)
5691+ , ("UnmarshalJSON", encodeUnmarshalJSON x.unmarshalJSON)
56515692 , ("unowned", encodeUnowned x.unowned)
56525693 , ("unsafe", encodeUnsafe x.unsafe)
5653- , ("unsigned", encodeUnsigned x.unsigned)
56545694 , ("UseSerializers", encodeUseSerializers x.useSerializers)
5655- , ("ushort", encodeUshort x.ushort)
56565695 ]
56575696
56585697 kSerializer : Jdec.Decoder KSerializer
@@ -5743,6 +5782,17 @@ encodeTypeClass x =
57435782 [ ("type", Jenc.int x.typeType)
57445783 ]
57455784
5785+select : Jdec.Decoder Select
5786+select =
5787+ Jdec.succeed Select
5788+ |> Jpipe.required "select" Jdec.int
5789+
5790+encodeSelect : Select -> Jenc.Value
5791+encodeSelect x =
5792+ Jenc.object
5793+ [ ("select", Jenc.int x.select)
5794+ ]
5795+
57465796 self : Jdec.Decoder Self
57475797 self =
57485798 Jdec.succeed Self
@@ -6128,6 +6178,17 @@ encodeTimeZone x =
61286178 [ ("TimeZone", Jenc.int x.timeZone)
61296179 ]
61306180
6181+toDict : Jdec.Decoder ToDict
6182+toDict =
6183+ Jdec.succeed ToDict
6184+ |> Jpipe.required "to_dict" Jdec.int
6185+
6186+encodeToDict : ToDict -> Jenc.Value
6187+encodeToDict x =
6188+ Jenc.object
6189+ [ ("to_dict", Jenc.int x.toDict)
6190+ ]
6191+
61316192 toJSON : Jdec.Decoder ToJSON
61326193 toJSON =
61336194 Jdec.succeed ToJSON
@@ -6304,6 +6365,17 @@ encodeUnion x =
63046365 [ ("union", Jenc.int x.union)
63056366 ]
63066367
6368+unmarshalJSON : Jdec.Decoder UnmarshalJSON
6369+unmarshalJSON =
6370+ Jdec.succeed UnmarshalJSON
6371+ |> Jpipe.required "UnmarshalJSON" Jdec.int
6372+
6373+encodeUnmarshalJSON : UnmarshalJSON -> Jenc.Value
6374+encodeUnmarshalJSON x =
6375+ Jenc.object
6376+ [ ("UnmarshalJSON", Jenc.int x.unmarshalJSON)
6377+ ]
6378+
63076379 unowned : Jdec.Decoder Unowned
63086380 unowned =
63096381 Jdec.succeed Unowned
@@ -6326,17 +6398,6 @@ encodeUnsafe x =
63266398 [ ("unsafe", Jenc.int x.unsafe)
63276399 ]
63286400
6329-unsigned : Jdec.Decoder Unsigned
6330-unsigned =
6331- Jdec.succeed Unsigned
6332- |> Jpipe.required "unsigned" Jdec.int
6333-
6334-encodeUnsigned : Unsigned -> Jenc.Value
6335-encodeUnsigned x =
6336- Jenc.object
6337- [ ("unsigned", Jenc.int x.unsigned)
6338- ]
6339-
63406401 useSerializers : Jdec.Decoder UseSerializers
63416402 useSerializers =
63426403 Jdec.succeed UseSerializers
@@ -6348,22 +6409,13 @@ encodeUseSerializers x =
63486409 [ ("UseSerializers", Jenc.int x.useSerializers)
63496410 ]
63506411
6351-ushort : Jdec.Decoder Ushort
6352-ushort =
6353- Jdec.succeed Ushort
6354- |> Jpipe.required "ushort" Jdec.int
6355-
6356-encodeUshort : Ushort -> Jenc.Value
6357-encodeUshort x =
6358- Jenc.object
6359- [ ("ushort", Jenc.int x.ushort)
6360- ]
6361-
63626412 obj6 : Jdec.Decoder Obj6
63636413 obj6 =
63646414 Jdec.succeed Obj6
63656415 |> Jpipe.required "dummy" Jdec.int
63666416 |> Jpipe.required "where" purpleWhere
6417+ |> Jpipe.required "unsigned" unsigned
6418+ |> Jpipe.required "ushort" ushort
63676419 |> Jpipe.required "using" using
63686420 |> Jpipe.required "Utf8JsonReader" utf8JSONReader
63696421 |> Jpipe.required "Utf8JsonWriter" utf8JSONWriter
@@ -6387,6 +6439,8 @@ encodeObj6 x =
63876439 Jenc.object
63886440 [ ("dummy", Jenc.int x.dummy)
63896441 , ("where", encodeWhere x.obj6Where)
6442+ , ("unsigned", encodeUnsigned x.unsigned)
6443+ , ("ushort", encodeUshort x.ushort)
63906444 , ("using", encodeUsing x.using)
63916445 , ("Utf8JsonReader", encodeUtf8JSONReader x.utf8JSONReader)
63926446 , ("Utf8JsonWriter", encodeUtf8JSONWriter x.utf8JSONWriter)
@@ -6417,6 +6471,28 @@ encodeWhere x =
64176471 [ ("where", Jenc.int x.whereWhere)
64186472 ]
64196473
6474+unsigned : Jdec.Decoder Unsigned
6475+unsigned =
6476+ Jdec.succeed Unsigned
6477+ |> Jpipe.required "unsigned" Jdec.int
6478+
6479+encodeUnsigned : Unsigned -> Jenc.Value
6480+encodeUnsigned x =
6481+ Jenc.object
6482+ [ ("unsigned", Jenc.int x.unsigned)
6483+ ]
6484+
6485+ushort : Jdec.Decoder Ushort
6486+ushort =
6487+ Jdec.succeed Ushort
6488+ |> Jpipe.required "ushort" Jdec.int
6489+
6490+encodeUshort : Ushort -> Jenc.Value
6491+encodeUshort x =
6492+ Jenc.object
6493+ [ ("ushort", Jenc.int x.ushort)
6494+ ]
6495+
64206496 using : Jdec.Decoder Using
64216497 using =
64226498 Jdec.succeed Using
Mflowdefault / TopLevel.js+83 −47
@@ -402,13 +402,13 @@ export type Obj2 = {
402402 foreach: Foreach;
403403 friend: Friend;
404404 from: From;
405+ from_dict: FromDict;
405406 from_json: FromJSON;
406407 func: Func;
407408 function: Function;
408409 get: Get;
409410 global: Global;
410411 go: Go;
411- goto: Goto;
412412 };
413413
414414 export type DateFormatter = {
@@ -643,6 +643,10 @@ export type From = {
643643 from: number;
644644 };
645645
646+export type FromDict = {
647+ from_dict: number;
648+};
649+
646650 export type FromJSON = {
647651 from_json: number;
648652 };
@@ -667,10 +671,6 @@ export type Go = {
667671 go: number;
668672 };
669673
670-export type Goto = {
671- goto: number;
672-};
673-
674674 export type Obj3 = {
675675 Hashable: Hashable;
676676 Hasher: Hasher;
@@ -689,8 +689,10 @@ export type Obj3 = {
689689 JsonTokenType: JSONTokenType;
690690 Locale: Locale;
691691 MapEntry: MapEntry;
692+ MarshalJSON: MarshalJSON;
692693 NO: No;
693694 dummy: number;
695+ goto: Goto;
694696 guard: Guard;
695697 hasOwnProperty: HasOwnProperty;
696698 hashCode: HashCode;
@@ -736,7 +738,6 @@ export type Obj3 = {
736738 new: New;
737739 newtonsoft: Newtonsoft;
738740 nil: Nil;
739- noexcept: Noexcept;
740741 };
741742
742743 export type Hashable = {
@@ -807,10 +808,18 @@ export type MapEntry = {
807808 MapEntry: number;
808809 };
809810
811+export type MarshalJSON = {
812+ MarshalJSON: number;
813+};
814+
810815 export type No = {
811816 NO: number;
812817 };
813818
819+export type Goto = {
820+ goto: number;
821+};
822+
814823 export type Guard = {
815824 guard: number;
816825 };
@@ -991,10 +1000,6 @@ export type Nil = {
9911000 nil: number;
9921001 };
9931002
994-export type Noexcept = {
995- noexcept: number;
996-};
997-
9981003 export type Obj4 = {
9991004 NSError: NSError;
10001005 NSObject: NSObject;
@@ -1007,6 +1012,7 @@ export type Obj4 = {
10071012 SEL: Sel;
10081013 dummy: number;
10091014 noSuchMethod: NoSuchMethod;
1015+ noexcept: Noexcept;
10101016 nonatomic: Nonatomic;
10111017 none: NoneClass;
10121018 nonlocal: Nonlocal;
@@ -1060,7 +1066,6 @@ export type Obj4 = {
10601066 s: S;
10611067 sbyte: Sbyte;
10621068 sealed: Sealed;
1063- select: Select;
10641069 };
10651070
10661071 export type NSError = {
@@ -1103,6 +1108,10 @@ export type NoSuchMethod = {
11031108 noSuchMethod: number;
11041109 };
11051110
1111+export type Noexcept = {
1112+ noexcept: number;
1113+};
1114+
11061115 export type Nonatomic = {
11071116 nonatomic: number;
11081117 };
@@ -1315,10 +1324,6 @@ export type Sealed = {
13151324 sealed: number;
13161325 };
13171326
1318-export type Select = {
1319- select: number;
1320-};
1321-
13221327 export type Obj5 = {
13231328 KSerializer: KSerializer;
13241329 PrimitiveKind: PrimitiveKind;
@@ -1337,8 +1342,10 @@ export type Obj5 = {
13371342 TimeZone: TimeZone;
13381343 True: True;
13391344 Type: Type;
1345+ UnmarshalJSON: UnmarshalJSON;
13401346 UseSerializers: UseSerializers;
13411347 dummy: number;
1348+ select: Select;
13421349 self: SelfClass;
13431350 serialize: Serialize;
13441351 set: Set;
@@ -1365,6 +1372,7 @@ export type Obj5 = {
13651372 throw: Throw;
13661373 throws: Throws;
13671374 toString: ToString;
1375+ to_dict: ToDict;
13681376 to_json: ToJSON;
13691377 top_level: TopLevelClass;
13701378 transient: Transient;
@@ -1383,8 +1391,6 @@ export type Obj5 = {
13831391 union: Union;
13841392 unowned: Unowned;
13851393 unsafe: Unsafe;
1386- unsigned: Unsigned;
1387- ushort: Ushort;
13881394 };
13891395
13901396 export type KSerializer = {
@@ -1455,10 +1461,18 @@ export type Type = {
14551461 Type: number;
14561462 };
14571463
1464+export type UnmarshalJSON = {
1465+ UnmarshalJSON: number;
1466+};
1467+
14581468 export type UseSerializers = {
14591469 UseSerializers: number;
14601470 };
14611471
1472+export type Select = {
1473+ select: number;
1474+};
1475+
14621476 export type SelfClass = {
14631477 self: number;
14641478 };
@@ -1563,6 +1577,10 @@ export type ToString = {
15631577 toString: number;
15641578 };
15651579
1580+export type ToDict = {
1581+ to_dict: number;
1582+};
1583+
15661584 export type ToJSON = {
15671585 to_json: number;
15681586 };
@@ -1635,20 +1653,14 @@ export type Unsafe = {
16351653 unsafe: number;
16361654 };
16371655
1638-export type Unsigned = {
1639- unsigned: number;
1640-};
1641-
1642-export type Ushort = {
1643- ushort: number;
1644-};
1645-
16461656 export type Obj6 = {
16471657 UUID: UUID;
16481658 Utf8JsonReader: Utf8JSONReader;
16491659 Utf8JsonWriter: Utf8JSONWriter;
16501660 YES: Yes;
16511661 dummy: number;
1662+ unsigned: Unsigned;
1663+ ushort: Ushort;
16521664 using: Using;
16531665 var: Var;
16541666 virtual: Virtual;
@@ -1681,6 +1693,14 @@ export type Yes = {
16811693 YES: number;
16821694 };
16831695
1696+export type Unsigned = {
1697+ unsigned: number;
1698+};
1699+
1700+export type Ushort = {
1701+ ushort: number;
1702+};
1703+
16841704 export type Using = {
16851705 using: number;
16861706 };
@@ -1831,7 +1851,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18311851 if (val === null || typeof val !== "object" || Array.isArray(val)) {
18321852 return invalidValue(l(ref || "object"), val, key, parent);
18331853 }
1834- const result: any = {};
1854+ const result: any = Object.create(null);
18351855 Object.getOwnPropertyNames(props).forEach(key => {
18361856 const prop = props[key];
18371857 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1842,7 +1862,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18421862 result[key] = transform(val[key], additional, getProps, key, ref);
18431863 }
18441864 });
1845- return result;
1865+ return Object.setPrototypeOf(result, Object.prototype);
18461866 }
18471867
18481868 if (typ === "any") return val;
@@ -2250,13 +2270,13 @@ const typeMap: any = {
22502270 { json: "foreach", js: "foreach", typ: r("Foreach") },
22512271 { json: "friend", js: "friend", typ: r("Friend") },
22522272 { json: "from", js: "from", typ: r("From") },
2273+ { json: "from_dict", js: "from_dict", typ: r("FromDict") },
22532274 { json: "from_json", js: "from_json", typ: r("FromJSON") },
22542275 { json: "func", js: "func", typ: r("Func") },
22552276 { json: "function", js: "function", typ: r("Function") },
22562277 { json: "get", js: "get", typ: r("Get") },
22572278 { json: "global", js: "global", typ: r("Global") },
22582279 { json: "go", js: "go", typ: r("Go") },
2259- { json: "goto", js: "goto", typ: r("Goto") },
22602280 ], false),
22612281 "DateFormatter": o([
22622282 { json: "DateFormatter", js: "DateFormatter", typ: i(0) },
@@ -2429,6 +2449,9 @@ const typeMap: any = {
24292449 "From": o([
24302450 { json: "from", js: "from", typ: i(0) },
24312451 ], false),
2452+ "FromDict": o([
2453+ { json: "from_dict", js: "from_dict", typ: i(0) },
2454+ ], false),
24322455 "FromJSON": o([
24332456 { json: "from_json", js: "from_json", typ: i(0) },
24342457 ], false),
@@ -2447,9 +2470,6 @@ const typeMap: any = {
24472470 "Go": o([
24482471 { json: "go", js: "go", typ: i(0) },
24492472 ], false),
2450- "Goto": o([
2451- { json: "goto", js: "goto", typ: i(0) },
2452- ], false),
24532473 "Obj3": o([
24542474 { json: "Hashable", js: "Hashable", typ: r("Hashable") },
24552475 { json: "Hasher", js: "Hasher", typ: r("Hasher") },
@@ -2468,8 +2488,10 @@ const typeMap: any = {
24682488 { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") },
24692489 { json: "Locale", js: "Locale", typ: r("Locale") },
24702490 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
2491+ { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
24712492 { json: "NO", js: "NO", typ: r("No") },
24722493 { json: "dummy", js: "dummy", typ: i(0) },
2494+ { json: "goto", js: "goto", typ: r("Goto") },
24732495 { json: "guard", js: "guard", typ: r("Guard") },
24742496 { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") },
24752497 { json: "hashCode", js: "hashCode", typ: r("HashCode") },
@@ -2515,7 +2537,6 @@ const typeMap: any = {
25152537 { json: "new", js: "new", typ: r("New") },
25162538 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
25172539 { json: "nil", js: "nil", typ: r("Nil") },
2518- { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
25192540 ], false),
25202541 "Hashable": o([
25212542 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -2568,9 +2589,15 @@ const typeMap: any = {
25682589 "MapEntry": o([
25692590 { json: "MapEntry", js: "MapEntry", typ: i(0) },
25702591 ], false),
2592+ "MarshalJSON": o([
2593+ { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
2594+ ], false),
25712595 "No": o([
25722596 { json: "NO", js: "NO", typ: i(0) },
25732597 ], false),
2598+ "Goto": o([
2599+ { json: "goto", js: "goto", typ: i(0) },
2600+ ], false),
25742601 "Guard": o([
25752602 { json: "guard", js: "guard", typ: i(0) },
25762603 ], false),
@@ -2706,9 +2733,6 @@ const typeMap: any = {
27062733 "Nil": o([
27072734 { json: "nil", js: "nil", typ: i(0) },
27082735 ], false),
2709- "Noexcept": o([
2710- { json: "noexcept", js: "noexcept", typ: i(0) },
2711- ], false),
27122736 "Obj4": o([
27132737 { json: "NSError", js: "NSError", typ: r("NSError") },
27142738 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
@@ -2721,6 +2745,7 @@ const typeMap: any = {
27212745 { json: "SEL", js: "SEL", typ: r("Sel") },
27222746 { json: "dummy", js: "dummy", typ: i(0) },
27232747 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
2748+ { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
27242749 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
27252750 { json: "none", js: "none", typ: r("NoneClass") },
27262751 { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") },
@@ -2774,7 +2799,6 @@ const typeMap: any = {
27742799 { json: "s", js: "s", typ: r("S") },
27752800 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
27762801 { json: "sealed", js: "sealed", typ: r("Sealed") },
2777- { json: "select", js: "select", typ: r("Select") },
27782802 ], false),
27792803 "NSError": o([
27802804 { json: "NSError", js: "NSError", typ: i(0) },
@@ -2806,6 +2830,9 @@ const typeMap: any = {
28062830 "NoSuchMethod": o([
28072831 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
28082832 ], false),
2833+ "Noexcept": o([
2834+ { json: "noexcept", js: "noexcept", typ: i(0) },
2835+ ], false),
28092836 "Nonatomic": o([
28102837 { json: "nonatomic", js: "nonatomic", typ: i(0) },
28112838 ], false),
@@ -2965,9 +2992,6 @@ const typeMap: any = {
29652992 "Sealed": o([
29662993 { json: "sealed", js: "sealed", typ: i(0) },
29672994 ], false),
2968- "Select": o([
2969- { json: "select", js: "select", typ: i(0) },
2970- ], false),
29712995 "Obj5": o([
29722996 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
29732997 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
@@ -2986,8 +3010,10 @@ const typeMap: any = {
29863010 { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") },
29873011 { json: "True", js: "True", typ: r("True") },
29883012 { json: "Type", js: "Type", typ: r("Type") },
3013+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
29893014 { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
29903015 { json: "dummy", js: "dummy", typ: i(0) },
3016+ { json: "select", js: "select", typ: r("Select") },
29913017 { json: "self", js: "self", typ: r("SelfClass") },
29923018 { json: "serialize", js: "serialize", typ: r("Serialize") },
29933019 { json: "set", js: "set", typ: r("Set") },
@@ -3014,6 +3040,7 @@ const typeMap: any = {
30143040 { json: "throw", js: "throw", typ: r("Throw") },
30153041 { json: "throws", js: "throws", typ: r("Throws") },
30163042 { json: "toString", js: "toString", typ: r("ToString") },
3043+ { json: "to_dict", js: "to_dict", typ: r("ToDict") },
30173044 { json: "to_json", js: "to_json", typ: r("ToJSON") },
30183045 { json: "top_level", js: "top_level", typ: r("TopLevelClass") },
30193046 { json: "transient", js: "transient", typ: r("Transient") },
@@ -3032,8 +3059,6 @@ const typeMap: any = {
30323059 { json: "union", js: "union", typ: r("Union") },
30333060 { json: "unowned", js: "unowned", typ: r("Unowned") },
30343061 { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
3035- { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
3036- { json: "ushort", js: "ushort", typ: r("Ushort") },
30373062 ], false),
30383063 "KSerializer": o([
30393064 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -3086,9 +3111,15 @@ const typeMap: any = {
30863111 "Type": o([
30873112 { json: "Type", js: "Type", typ: i(0) },
30883113 ], false),
3114+ "UnmarshalJSON": o([
3115+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
3116+ ], false),
30893117 "UseSerializers": o([
30903118 { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
30913119 ], false),
3120+ "Select": o([
3121+ { json: "select", js: "select", typ: i(0) },
3122+ ], false),
30923123 "SelfClass": o([
30933124 { json: "self", js: "self", typ: i(0) },
30943125 ], false),
@@ -3167,6 +3198,9 @@ const typeMap: any = {
31673198 "ToString": o([
31683199 { json: "toString", js: "toString", typ: i(0) },
31693200 ], false),
3201+ "ToDict": o([
3202+ { json: "to_dict", js: "to_dict", typ: i(0) },
3203+ ], false),
31703204 "ToJSON": o([
31713205 { json: "to_json", js: "to_json", typ: i(0) },
31723206 ], false),
@@ -3221,18 +3255,14 @@ const typeMap: any = {
32213255 "Unsafe": o([
32223256 { json: "unsafe", js: "unsafe", typ: i(0) },
32233257 ], false),
3224- "Unsigned": o([
3225- { json: "unsigned", js: "unsigned", typ: i(0) },
3226- ], false),
3227- "Ushort": o([
3228- { json: "ushort", js: "ushort", typ: i(0) },
3229- ], false),
32303258 "Obj6": o([
32313259 { json: "UUID", js: "UUID", typ: r("UUID") },
32323260 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
32333261 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
32343262 { json: "YES", js: "YES", typ: r("Yes") },
32353263 { json: "dummy", js: "dummy", typ: i(0) },
3264+ { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
3265+ { json: "ushort", js: "ushort", typ: r("Ushort") },
32363266 { json: "using", js: "using", typ: r("Using") },
32373267 { json: "var", js: "var", typ: r("Var") },
32383268 { json: "virtual", js: "virtual", typ: r("Virtual") },
@@ -3260,6 +3290,12 @@ const typeMap: any = {
32603290 "Yes": o([
32613291 { json: "YES", js: "YES", typ: i(0) },
32623292 ], false),
3293+ "Unsigned": o([
3294+ { json: "unsigned", js: "unsigned", typ: i(0) },
3295+ ], false),
3296+ "Ushort": o([
3297+ { json: "ushort", js: "ushort", typ: i(0) },
3298+ ], false),
32633299 "Using": o([
32643300 { json: "using", js: "using", typ: i(0) },
32653301 ], false),
Mgolangdefault / quicktype.go+45 −25
@@ -412,13 +412,13 @@ type Obj2 struct {
412412 FormatException FormatException `json:"FormatException"`
413413 Friend Friend `json:"friend"`
414414 From From `json:"from"`
415+ FromDict FromDict `json:"from_dict"`
415416 FromJSON FromJSON `json:"from_json"`
416417 Func Func `json:"func"`
417418 Function Function `json:"function"`
418419 Get Get `json:"get"`
419420 Global Global `json:"global"`
420421 Go Go `json:"go"`
421- Goto Goto `json:"goto"`
422422 Obj2False FalseClass `json:"false"`
423423 }
424424
@@ -646,6 +646,10 @@ type From struct {
646646 From int64 `json:"from"`
647647 }
648648
649+type FromDict struct {
650+ FromDict int64 `json:"from_dict"`
651+}
652+
649653 type FromJSON struct {
650654 FromJSON int64 `json:"from_json"`
651655 }
@@ -670,16 +674,13 @@ type Go struct {
670674 Go int64 `json:"go"`
671675 }
672676
673-type Goto struct {
674- Goto int64 `json:"goto"`
675-}
676-
677677 type FalseClass struct {
678678 False int64 `json:"false"`
679679 }
680680
681681 type Obj3 struct {
682682 Dummy int64 `json:"dummy"`
683+ Goto Goto `json:"goto"`
683684 Guard Guard `json:"guard"`
684685 HasOwnProperty HasOwnProperty `json:"hasOwnProperty"`
685686 HashCode HashCode `json:"hashCode"`
@@ -733,6 +734,7 @@ type Obj3 struct {
733734 Long Long `json:"long"`
734735 Map Map `json:"map"`
735736 MapEntry MapEntry `json:"MapEntry"`
737+ MarshalJSON MarshalJSON `json:"MarshalJSON"`
736738 MetadataPropertyHandling MetadataPropertyHandling `json:"metadata_property_handling"`
737739 Module Module `json:"module"`
738740 Mutable Mutable `json:"mutable"`
@@ -743,7 +745,10 @@ type Obj3 struct {
743745 Newtonsoft Newtonsoft `json:"newtonsoft"`
744746 Nil Nil `json:"nil"`
745747 No No `json:"NO"`
746- Noexcept Noexcept `json:"noexcept"`
748+}
749+
750+type Goto struct {
751+ Goto int64 `json:"goto"`
747752 }
748753
749754 type Guard struct {
@@ -958,6 +963,10 @@ type MapEntry struct {
958963 MapEntry int64 `json:"MapEntry"`
959964 }
960965
966+type MarshalJSON struct {
967+ MarshalJSON int64 `json:"MarshalJSON"`
968+}
969+
961970 type MetadataPropertyHandling struct {
962971 MetadataPropertyHandling int64 `json:"metadata_property_handling"`
963972 }
@@ -998,16 +1007,13 @@ type No struct {
9981007 No int64 `json:"NO"`
9991008 }
10001009
1001-type Noexcept struct {
1002- Noexcept int64 `json:"noexcept"`
1003-}
1004-
10051010 type Obj4 struct {
10061011 Dummy int64 `json:"dummy"`
10071012 NSError NSError `json:"NSError"`
10081013 NSObject NSObject `json:"NSObject"`
10091014 NSString NSString `json:"NSString"`
10101015 NoSuchMethod NoSuchMethod `json:"noSuchMethod"`
1016+ Noexcept Noexcept `json:"noexcept"`
10111017 Nonatomic Nonatomic `json:"nonatomic"`
10121018 None None `json:"None"`
10131019 Nonlocal Nonlocal `json:"nonlocal"`
@@ -1067,7 +1073,6 @@ type Obj4 struct {
10671073 Sbyte Sbyte `json:"sbyte"`
10681074 Sealed Sealed `json:"sealed"`
10691075 Sel Sel `json:"SEL"`
1070- Select Select `json:"select"`
10711076 }
10721077
10731078 type NSError struct {
@@ -1086,6 +1091,10 @@ type NoSuchMethod struct {
10861091 NoSuchMethod int64 `json:"noSuchMethod"`
10871092 }
10881093
1094+type Noexcept struct {
1095+ Noexcept int64 `json:"noexcept"`
1096+}
1097+
10891098 type Nonatomic struct {
10901099 Nonatomic int64 `json:"nonatomic"`
10911100 }
@@ -1322,10 +1331,6 @@ type Sel struct {
13221331 Sel int64 `json:"SEL"`
13231332 }
13241333
1325-type Select struct {
1326- Select int64 `json:"select"`
1327-}
1328-
13291334 type Obj5 struct {
13301335 Dummy int64 `json:"dummy"`
13311336 KSerializer KSerializer `json:"KSerializer"`
@@ -1333,6 +1338,7 @@ type Obj5 struct {
13331338 Obj5True TrueClass `json:"true"`
13341339 Obj5Type TypeClass `json:"type"`
13351340 PrimitiveKind PrimitiveKind `json:"PrimitiveKind"`
1341+ Select Select `json:"select"`
13361342 Self Self `json:"Self"`
13371343 Sendable Sendable `json:"Sendable"`
13381344 SerialDescriptor SerialDescriptor `json:"SerialDescriptor"`
@@ -1370,6 +1376,7 @@ type Obj5 struct {
13701376 TimeOnly TimeOnly `json:"TimeOnly"`
13711377 TimeOnlyConverter TimeOnlyConverter `json:"TimeOnlyConverter"`
13721378 TimeZone TimeZone `json:"TimeZone"`
1379+ ToDict ToDict `json:"to_dict"`
13731380 ToJSON ToJSON `json:"to_json"`
13741381 ToString ToString `json:"toString"`
13751382 TopLevel TopLevelClass `json:"top_level"`
@@ -1387,11 +1394,10 @@ type Obj5 struct {
13871394 Unchecked Unchecked `json:"unchecked"`
13881395 Undefined Undefined `json:"undefined"`
13891396 Union Union `json:"union"`
1397+ UnmarshalJSON UnmarshalJSON `json:"UnmarshalJSON"`
13901398 Unowned Unowned `json:"unowned"`
13911399 Unsafe Unsafe `json:"unsafe"`
1392- Unsigned Unsigned `json:"unsigned"`
13931400 UseSerializers UseSerializers `json:"UseSerializers"`
1394- Ushort Ushort `json:"ushort"`
13951401 }
13961402
13971403 type KSerializer struct {
@@ -1414,6 +1420,10 @@ type PrimitiveKind struct {
14141420 PrimitiveKind int64 `json:"PrimitiveKind"`
14151421 }
14161422
1423+type Select struct {
1424+ Select int64 `json:"select"`
1425+}
1426+
14171427 type Self struct {
14181428 Self int64 `json:"Self"`
14191429 }
@@ -1562,6 +1572,10 @@ type TimeZone struct {
15621572 TimeZone int64 `json:"TimeZone"`
15631573 }
15641574
1575+type ToDict struct {
1576+ ToDict int64 `json:"to_dict"`
1577+}
1578+
15651579 type ToJSON struct {
15661580 ToJSON int64 `json:"to_json"`
15671581 }
@@ -1630,6 +1644,10 @@ type Union struct {
16301644 Union int64 `json:"union"`
16311645 }
16321646
1647+type UnmarshalJSON struct {
1648+ UnmarshalJSON int64 `json:"UnmarshalJSON"`
1649+}
1650+
16331651 type Unowned struct {
16341652 Unowned int64 `json:"unowned"`
16351653 }
@@ -1638,21 +1656,15 @@ type Unsafe struct {
16381656 Unsafe int64 `json:"unsafe"`
16391657 }
16401658
1641-type Unsigned struct {
1642- Unsigned int64 `json:"unsigned"`
1643-}
1644-
16451659 type UseSerializers struct {
16461660 UseSerializers int64 `json:"UseSerializers"`
16471661 }
16481662
1649-type Ushort struct {
1650- Ushort int64 `json:"ushort"`
1651-}
1652-
16531663 type Obj6 struct {
16541664 Dummy int64 `json:"dummy"`
16551665 UUID UUID `json:"UUID"`
1666+ Unsigned Unsigned `json:"unsigned"`
1667+ Ushort Ushort `json:"ushort"`
16561668 Using Using `json:"using"`
16571669 Utf8JSONReader Utf8JSONReader `json:"Utf8JsonReader"`
16581670 Utf8JSONWriter Utf8JSONWriter `json:"Utf8JsonWriter"`
@@ -1676,6 +1688,14 @@ type UUID struct {
16761688 UUID int64 `json:"UUID"`
16771689 }
16781690
1691+type Unsigned struct {
1692+ Unsigned int64 `json:"unsigned"`
1693+}
1694+
1695+type Ushort struct {
1696+ Ushort int64 `json:"ushort"`
1697+}
1698+
16791699 type Using struct {
16801700 Using int64 `json:"using"`
16811701 }
Mhaskelldefault / QuickType.hs+167 −95
@@ -122,18 +122,19 @@ module QuickType
122122 , FormatException (..)
123123 , Friend (..)
124124 , From (..)
125+ , FromDict (..)
125126 , FromJSONClass (..)
126127 , Func (..)
127128 , Function (..)
128129 , Get (..)
129130 , Global (..)
130131 , Go (..)
131- , Goto (..)
132132 , Default (..)
133133 , Do (..)
134134 , Else (..)
135135 , Obj2False (..)
136136 , Obj3 (..)
137+ , Goto (..)
137138 , Guard (..)
138139 , HasOwnProperty (..)
139140 , HashCode (..)
@@ -181,6 +182,7 @@ module QuickType
181182 , Long (..)
182183 , MapClass (..)
183184 , MapEntry (..)
185+ , MarshalJSON (..)
184186 , MetadataPropertyHandling (..)
185187 , Mutable (..)
186188 , Mutating (..)
@@ -190,7 +192,6 @@ module QuickType
190192 , Newtonsoft (..)
191193 , Nil (..)
192194 , No (..)
193- , Noexcept (..)
194195 , ID (..)
195196 , If (..)
196197 , Import (..)
@@ -200,6 +201,7 @@ module QuickType
200201 , Module (..)
201202 , Obj4 (..)
202203 , NoSuchMethod (..)
204+ , Noexcept (..)
203205 , Nonatomic (..)
204206 , None (..)
205207 , Nonlocal (..)
@@ -262,7 +264,6 @@ module QuickType
262264 , Sbyte (..)
263265 , Sealed (..)
264266 , Sel (..)
265- , Select (..)
266267 , Obj5 (..)
267268 , KSerializer (..)
268269 , SelfClass (..)
@@ -271,6 +272,7 @@ module QuickType
271272 , Type (..)
272273 , PrimitiveKind (..)
273274 , TypeClass (..)
275+ , Select (..)
274276 , Self (..)
275277 , Sendable (..)
276278 , SerialDescriptor (..)
@@ -307,6 +309,7 @@ module QuickType
307309 , TimeOnly (..)
308310 , TimeOnlyConverter (..)
309311 , TimeZone (..)
312+ , ToDict (..)
310313 , ToJSONClass (..)
311314 , ToString (..)
312315 , TopLevel (..)
@@ -323,13 +326,14 @@ module QuickType
323326 , Unchecked (..)
324327 , Undefined (..)
325328 , Union (..)
329+ , UnmarshalJSON (..)
326330 , Unowned (..)
327331 , Unsafe (..)
328- , Unsigned (..)
329332 , UseSerializers (..)
330- , Ushort (..)
331333 , Obj6 (..)
332334 , Where (..)
335+ , Unsigned (..)
336+ , Ushort (..)
333337 , Using (..)
334338 , Utf8JSONReader (..)
335339 , Utf8JSONWriter (..)
@@ -746,13 +750,13 @@ data Obj2 = Obj2
746750 , formatExceptionObj2 :: FormatException
747751 , friendObj2 :: Friend
748752 , fromObj2 :: From
753+ , fromDictObj2 :: FromDict
749754 , fromJSONObj2 :: FromJSONClass
750755 , funcObj2 :: Func
751756 , functionObj2 :: Function
752757 , getObj2 :: Get
753758 , globalObj2 :: Global
754759 , goObj2 :: Go
755- , gotoObj2 :: Goto
756760 , obj2DefaultObj2 :: Default
757761 , obj2DoObj2 :: Do
758762 , obj2ElseObj2 :: Else
@@ -976,6 +980,10 @@ data From = From
976980 { fromFrom :: Int
977981 } deriving (Show)
978982
983+data FromDict = FromDict
984+ { fromDictFromDict :: Int
985+ } deriving (Show)
986+
979987 data FromJSONClass = FromJSONClass
980988 { fromJSONFromJSONClass :: Int
981989 } deriving (Show)
@@ -1000,10 +1008,6 @@ data Go = Go
10001008 { goGo :: Int
10011009 } deriving (Show)
10021010
1003-data Goto = Goto
1004- { gotoGoto :: Int
1005- } deriving (Show)
1006-
10071011 data Default = Default
10081012 { defaultDefaultDefault :: Int
10091013 } deriving (Show)
@@ -1022,6 +1026,7 @@ data Obj2False = Obj2False
10221026
10231027 data Obj3 = Obj3
10241028 { dummyObj3 :: Int
1029+ , gotoObj3 :: Goto
10251030 , guardObj3 :: Guard
10261031 , hasOwnPropertyObj3 :: HasOwnProperty
10271032 , hashCodeObj3 :: HashCode
@@ -1069,6 +1074,7 @@ data Obj3 = Obj3
10691074 , longObj3 :: Long
10701075 , mapObj3 :: MapClass
10711076 , mapEntryObj3 :: MapEntry
1077+ , marshalJSONObj3 :: MarshalJSON
10721078 , metadataPropertyHandlingObj3 :: MetadataPropertyHandling
10731079 , mutableObj3 :: Mutable
10741080 , mutatingObj3 :: Mutating
@@ -1078,7 +1084,6 @@ data Obj3 = Obj3
10781084 , newtonsoftObj3 :: Newtonsoft
10791085 , nilObj3 :: Nil
10801086 , noObj3 :: No
1081- , noexceptObj3 :: Noexcept
10821087 , obj3IDObj3 :: ID
10831088 , obj3IfObj3 :: If
10841089 , obj3ImportObj3 :: Import
@@ -1088,6 +1093,10 @@ data Obj3 = Obj3
10881093 , obj3ModuleObj3 :: Module
10891094 } deriving (Show)
10901095
1096+data Goto = Goto
1097+ { gotoGoto :: Int
1098+ } deriving (Show)
1099+
10911100 data Guard = Guard
10921101 { guardGuard :: Int
10931102 } deriving (Show)
@@ -1276,6 +1285,10 @@ data MapEntry = MapEntry
12761285 { mapEntryMapEntry :: Int
12771286 } deriving (Show)
12781287
1288+data MarshalJSON = MarshalJSON
1289+ { marshalJSONMarshalJSON :: Int
1290+ } deriving (Show)
1291+
12791292 data MetadataPropertyHandling = MetadataPropertyHandling
12801293 { metadataPropertyHandlingMetadataPropertyHandling :: Int
12811294 } deriving (Show)
@@ -1312,10 +1325,6 @@ data No = No
13121325 { noNo :: Int
13131326 } deriving (Show)
13141327
1315-data Noexcept = Noexcept
1316- { noexceptNoexcept :: Int
1317- } deriving (Show)
1318-
13191328 data ID = ID
13201329 { idIDID :: Int
13211330 } deriving (Show)
@@ -1347,6 +1356,7 @@ data Module = Module
13471356 data Obj4 = Obj4
13481357 { dummyObj4 :: Int
13491358 , noSuchMethodObj4 :: NoSuchMethod
1359+ , noexceptObj4 :: Noexcept
13501360 , nonatomicObj4 :: Nonatomic
13511361 , noneObj4 :: None
13521362 , nonlocalObj4 :: Nonlocal
@@ -1409,13 +1419,16 @@ data Obj4 = Obj4
14091419 , sbyteObj4 :: Sbyte
14101420 , sealedObj4 :: Sealed
14111421 , selObj4 :: Sel
1412- , selectObj4 :: Select
14131422 } deriving (Show)
14141423
14151424 data NoSuchMethod = NoSuchMethod
14161425 { noSuchMethodNoSuchMethod :: Int
14171426 } deriving (Show)
14181427
1428+data Noexcept = Noexcept
1429+ { noexceptNoexcept :: Int
1430+ } deriving (Show)
1431+
14191432 data Nonatomic = Nonatomic
14201433 { nonatomicNonatomic :: Int
14211434 } deriving (Show)
@@ -1664,10 +1677,6 @@ data Sel = Sel
16641677 { selSel :: Int
16651678 } deriving (Show)
16661679
1667-data Select = Select
1668- { selectSelect :: Int
1669- } deriving (Show)
1670-
16711680 data Obj5 = Obj5
16721681 { dummyObj5 :: Int
16731682 , kSerializerObj5 :: KSerializer
@@ -1677,6 +1686,7 @@ data Obj5 = Obj5
16771686 , obj5TypeObj5 :: Type
16781687 , primitiveKindObj5 :: PrimitiveKind
16791688 , purpleTypeObj5 :: TypeClass
1689+ , selectObj5 :: Select
16801690 , selfObj5 :: Self
16811691 , sendableObj5 :: Sendable
16821692 , serialDescriptorObj5 :: SerialDescriptor
@@ -1713,6 +1723,7 @@ data Obj5 = Obj5
17131723 , timeOnlyObj5 :: TimeOnly
17141724 , timeOnlyConverterObj5 :: TimeOnlyConverter
17151725 , timeZoneObj5 :: TimeZone
1726+ , toDictObj5 :: ToDict
17161727 , toJSONObj5 :: ToJSONClass
17171728 , toStringObj5 :: ToString
17181729 , topLevelObj5 :: TopLevel
@@ -1729,11 +1740,10 @@ data Obj5 = Obj5
17291740 , uncheckedObj5 :: Unchecked
17301741 , undefinedObj5 :: Undefined
17311742 , unionObj5 :: Union
1743+ , unmarshalJSONObj5 :: UnmarshalJSON
17321744 , unownedObj5 :: Unowned
17331745 , unsafeObj5 :: Unsafe
1734- , unsignedObj5 :: Unsigned
17351746 , useSerializersObj5 :: UseSerializers
1736- , ushortObj5 :: Ushort
17371747 } deriving (Show)
17381748
17391749 data KSerializer = KSerializer
@@ -1764,6 +1774,10 @@ data TypeClass = TypeClass
17641774 { typeTypeTypeClass :: Int
17651775 } deriving (Show)
17661776
1777+data Select = Select
1778+ { selectSelect :: Int
1779+ } deriving (Show)
1780+
17671781 data Self = Self
17681782 { selfSelf :: Int
17691783 } deriving (Show)
@@ -1908,6 +1922,10 @@ data TimeZone = TimeZone
19081922 { timeZoneTimeZone :: Int
19091923 } deriving (Show)
19101924
1925+data ToDict = ToDict
1926+ { toDictToDict :: Int
1927+ } deriving (Show)
1928+
19111929 data ToJSONClass = ToJSONClass
19121930 { toJSONToJSONClass :: Int
19131931 } deriving (Show)
@@ -1972,6 +1990,10 @@ data Union = Union
19721990 { unionUnion :: Int
19731991 } deriving (Show)
19741992
1993+data UnmarshalJSON = UnmarshalJSON
1994+ { unmarshalJSONUnmarshalJSON :: Int
1995+ } deriving (Show)
1996+
19751997 data Unowned = Unowned
19761998 { unownedUnowned :: Int
19771999 } deriving (Show)
@@ -1980,21 +2002,15 @@ data Unsafe = Unsafe
19802002 { unsafeUnsafe :: Int
19812003 } deriving (Show)
19822004
1983-data Unsigned = Unsigned
1984- { unsignedUnsigned :: Int
1985- } deriving (Show)
1986-
19872005 data UseSerializers = UseSerializers
19882006 { useSerializersUseSerializers :: Int
19892007 } deriving (Show)
19902008
1991-data Ushort = Ushort
1992- { ushortUshort :: Int
1993- } deriving (Show)
1994-
19952009 data Obj6 = Obj6
19962010 { dummyObj6 :: Int
19972011 , obj6WhereObj6 :: Where
2012+ , unsignedObj6 :: Unsigned
2013+ , ushortObj6 :: Ushort
19982014 , usingObj6 :: Using
19992015 , utf8JSONReaderObj6 :: Utf8JSONReader
20002016 , utf8JSONWriterObj6 :: Utf8JSONWriter
@@ -2018,6 +2034,14 @@ data Where = Where
20182034 { whereWhereWhere :: Int
20192035 } deriving (Show)
20202036
2037+data Unsigned = Unsigned
2038+ { unsignedUnsigned :: Int
2039+ } deriving (Show)
2040+
2041+data Ushort = Ushort
2042+ { ushortUshort :: Int
2043+ } deriving (Show)
2044+
20212045 data Using = Using
20222046 { usingUsing :: Int
20232047 } deriving (Show)
@@ -2890,7 +2914,7 @@ instance FromJSON ClassClass where
28902914 <$> v .: "class"
28912915
28922916 instance ToJSON Obj2 where
2893- toJSON (Obj2 dateFormatterObj2 dateOnlyObj2 dateOnlyConverterObj2 dateParseHandlingObj2 dateTimeObj2 dateTimeStylesObj2 debuggerObj2 decimalObj2 declareObj2 decltypeObj2 decodeStringObj2 decoderObj2 decodingErrorObj2 defObj2 deferObj2 deinitObj2 delObj2 delegateObj2 deleteObj2 dictObj2 dictionaryObj2 didSetObj2 doubleObj2 dummyObj2 dynamicObj2 dynamicCastObj2 elifObj2 encodeQuickTypeObj2 encoderObj2 enumObj2 enumValuesObj2 equalityContractObj2 equatableObj2 eventObj2 exceptObj2 exceptionObj2 explicitObj2 exportObj2 exposingObj2 extendsObj2 extensionObj2 externObj2 fallthroughObj2 falseObj2 fileprivateObj2 finalObj2 finallyObj2 fixedObj2 floatObj2 forObj2 foreachObj2 formatExceptionObj2 friendObj2 fromObj2 fromJSONObj2 funcObj2 functionObj2 getObj2 globalObj2 goObj2 gotoObj2 obj2DefaultObj2 obj2DoObj2 obj2ElseObj2 obj2FalseObj2) =
2917+ toJSON (Obj2 dateFormatterObj2 dateOnlyObj2 dateOnlyConverterObj2 dateParseHandlingObj2 dateTimeObj2 dateTimeStylesObj2 debuggerObj2 decimalObj2 declareObj2 decltypeObj2 decodeStringObj2 decoderObj2 decodingErrorObj2 defObj2 deferObj2 deinitObj2 delObj2 delegateObj2 deleteObj2 dictObj2 dictionaryObj2 didSetObj2 doubleObj2 dummyObj2 dynamicObj2 dynamicCastObj2 elifObj2 encodeQuickTypeObj2 encoderObj2 enumObj2 enumValuesObj2 equalityContractObj2 equatableObj2 eventObj2 exceptObj2 exceptionObj2 explicitObj2 exportObj2 exposingObj2 extendsObj2 extensionObj2 externObj2 fallthroughObj2 falseObj2 fileprivateObj2 finalObj2 finallyObj2 fixedObj2 floatObj2 forObj2 foreachObj2 formatExceptionObj2 friendObj2 fromObj2 fromDictObj2 fromJSONObj2 funcObj2 functionObj2 getObj2 globalObj2 goObj2 obj2DefaultObj2 obj2DoObj2 obj2ElseObj2 obj2FalseObj2) =
28942918 object $ foldMap (maybe [] pure)
28952919 [ Just $ "DateFormatter" .= dateFormatterObj2
28962920 , Just $ "DateOnly" .= dateOnlyObj2
@@ -2946,13 +2970,13 @@ instance ToJSON Obj2 where
29462970 , Just $ "FormatException" .= formatExceptionObj2
29472971 , Just $ "friend" .= friendObj2
29482972 , Just $ "from" .= fromObj2
2973+ , Just $ "from_dict" .= fromDictObj2
29492974 , Just $ "from_json" .= fromJSONObj2
29502975 , Just $ "func" .= funcObj2
29512976 , Just $ "function" .= functionObj2
29522977 , Just $ "get" .= getObj2
29532978 , Just $ "global" .= globalObj2
29542979 , Just $ "go" .= goObj2
2955- , Just $ "goto" .= gotoObj2
29562980 , Just $ "default" .= obj2DefaultObj2
29572981 , Just $ "do" .= obj2DoObj2
29582982 , Just $ "else" .= obj2ElseObj2
@@ -3015,13 +3039,13 @@ instance FromJSON Obj2 where
30153039 <*> v .: "FormatException"
30163040 <*> v .: "friend"
30173041 <*> v .: "from"
3042+ <*> v .: "from_dict"
30183043 <*> v .: "from_json"
30193044 <*> v .: "func"
30203045 <*> v .: "function"
30213046 <*> v .: "get"
30223047 <*> v .: "global"
30233048 <*> v .: "go"
3024- <*> v .: "goto"
30253049 <*> v .: "default"
30263050 <*> v .: "do"
30273051 <*> v .: "else"
@@ -3567,6 +3591,16 @@ instance FromJSON From where
35673591 parseJSON (Object v) = From
35683592 <$> v .: "from"
35693593
3594+instance ToJSON FromDict where
3595+ toJSON (FromDict fromDictFromDict) =
3596+ object $ foldMap (maybe [] pure)
3597+ [ Just $ "from_dict" .= fromDictFromDict
3598+ ]
3599+
3600+instance FromJSON FromDict where
3601+ parseJSON (Object v) = FromDict
3602+ <$> v .: "from_dict"
3603+
35703604 instance ToJSON FromJSONClass where
35713605 toJSON (FromJSONClass fromJSONFromJSONClass) =
35723606 object $ foldMap (maybe [] pure)
@@ -3627,16 +3661,6 @@ instance FromJSON Go where
36273661 parseJSON (Object v) = Go
36283662 <$> v .: "go"
36293663
3630-instance ToJSON Goto where
3631- toJSON (Goto gotoGoto) =
3632- object $ foldMap (maybe [] pure)
3633- [ Just $ "goto" .= gotoGoto
3634- ]
3635-
3636-instance FromJSON Goto where
3637- parseJSON (Object v) = Goto
3638- <$> v .: "goto"
3639-
36403664 instance ToJSON Default where
36413665 toJSON (Default defaultDefaultDefault) =
36423666 object $ foldMap (maybe [] pure)
@@ -3678,9 +3702,10 @@ instance FromJSON Obj2False where
36783702 <$> v .: "false"
36793703
36803704 instance ToJSON Obj3 where
3681- toJSON (Obj3 dummyObj3 guardObj3 hasOwnPropertyObj3 hashCodeObj3 hashableObj3 hasherObj3 impObj3 implementsObj3 implicitObj3 indirectObj3 initObj3 inlineObj3 inoutObj3 instanceofObj3 intObj3 interfaceObj3 internalObj3 isObj3 isoDateTimeOffsetConverterObj3 iterableObj3 jdecObj3 jencObj3 jpipeObj3 jsonObj3 jsonAnyObj3 jsonCodingKeyObj3 jsonConverterObj3 jsonDecoderObj3 jsonEncoderObj3 jsonExceptionObj3 jsonGeneratorObj3 jsonNodeObj3 jsonNullObj3 jsonParserObj3 jsonReaderObj3 jsonSerializerObj3 jsonTokenObj3 jsonTokenTypeObj3 jsonWriterObj3 lambdaObj3 lazyObj3 leftObj3 listObj3 localeObj3 lockObj3 longObj3 mapObj3 mapEntryObj3 metadataPropertyHandlingObj3 mutableObj3 mutatingObj3 namespaceObj3 nativeObj3 newObj3 newtonsoftObj3 nilObj3 noObj3 noexceptObj3 obj3IDObj3 obj3IfObj3 obj3ImportObj3 obj3InObj3 obj3InfixObj3 obj3LetObj3 obj3ModuleObj3) =
3705+ toJSON (Obj3 dummyObj3 gotoObj3 guardObj3 hasOwnPropertyObj3 hashCodeObj3 hashableObj3 hasherObj3 impObj3 implementsObj3 implicitObj3 indirectObj3 initObj3 inlineObj3 inoutObj3 instanceofObj3 intObj3 interfaceObj3 internalObj3 isObj3 isoDateTimeOffsetConverterObj3 iterableObj3 jdecObj3 jencObj3 jpipeObj3 jsonObj3 jsonAnyObj3 jsonCodingKeyObj3 jsonConverterObj3 jsonDecoderObj3 jsonEncoderObj3 jsonExceptionObj3 jsonGeneratorObj3 jsonNodeObj3 jsonNullObj3 jsonParserObj3 jsonReaderObj3 jsonSerializerObj3 jsonTokenObj3 jsonTokenTypeObj3 jsonWriterObj3 lambdaObj3 lazyObj3 leftObj3 listObj3 localeObj3 lockObj3 longObj3 mapObj3 mapEntryObj3 marshalJSONObj3 metadataPropertyHandlingObj3 mutableObj3 mutatingObj3 namespaceObj3 nativeObj3 newObj3 newtonsoftObj3 nilObj3 noObj3 obj3IDObj3 obj3IfObj3 obj3ImportObj3 obj3InObj3 obj3InfixObj3 obj3LetObj3 obj3ModuleObj3) =
36823706 object $ foldMap (maybe [] pure)
36833707 [ Just $ "dummy" .= dummyObj3
3708+ , Just $ "goto" .= gotoObj3
36843709 , Just $ "guard" .= guardObj3
36853710 , Just $ "hasOwnProperty" .= hasOwnPropertyObj3
36863711 , Just $ "hashCode" .= hashCodeObj3
@@ -3728,6 +3753,7 @@ instance ToJSON Obj3 where
37283753 , Just $ "long" .= longObj3
37293754 , Just $ "map" .= mapObj3
37303755 , Just $ "MapEntry" .= mapEntryObj3
3756+ , Just $ "MarshalJSON" .= marshalJSONObj3
37313757 , Just $ "metadata_property_handling" .= metadataPropertyHandlingObj3
37323758 , Just $ "mutable" .= mutableObj3
37333759 , Just $ "mutating" .= mutatingObj3
@@ -3737,7 +3763,6 @@ instance ToJSON Obj3 where
37373763 , Just $ "newtonsoft" .= newtonsoftObj3
37383764 , Just $ "nil" .= nilObj3
37393765 , Just $ "NO" .= noObj3
3740- , Just $ "noexcept" .= noexceptObj3
37413766 , Just $ "id" .= obj3IDObj3
37423767 , Just $ "if" .= obj3IfObj3
37433768 , Just $ "import" .= obj3ImportObj3
@@ -3750,6 +3775,7 @@ instance ToJSON Obj3 where
37503775 instance FromJSON Obj3 where
37513776 parseJSON (Object v) = Obj3
37523777 <$> v .: "dummy"
3778+ <*> v .: "goto"
37533779 <*> v .: "guard"
37543780 <*> v .: "hasOwnProperty"
37553781 <*> v .: "hashCode"
@@ -3797,6 +3823,7 @@ instance FromJSON Obj3 where
37973823 <*> v .: "long"
37983824 <*> v .: "map"
37993825 <*> v .: "MapEntry"
3826+ <*> v .: "MarshalJSON"
38003827 <*> v .: "metadata_property_handling"
38013828 <*> v .: "mutable"
38023829 <*> v .: "mutating"
@@ -3806,7 +3833,6 @@ instance FromJSON Obj3 where
38063833 <*> v .: "newtonsoft"
38073834 <*> v .: "nil"
38083835 <*> v .: "NO"
3809- <*> v .: "noexcept"
38103836 <*> v .: "id"
38113837 <*> v .: "if"
38123838 <*> v .: "import"
@@ -3815,6 +3841,16 @@ instance FromJSON Obj3 where
38153841 <*> v .: "let"
38163842 <*> v .: "module"
38173843
3844+instance ToJSON Goto where
3845+ toJSON (Goto gotoGoto) =
3846+ object $ foldMap (maybe [] pure)
3847+ [ Just $ "goto" .= gotoGoto
3848+ ]
3849+
3850+instance FromJSON Goto where
3851+ parseJSON (Object v) = Goto
3852+ <$> v .: "goto"
3853+
38183854 instance ToJSON Guard where
38193855 toJSON (Guard guardGuard) =
38203856 object $ foldMap (maybe [] pure)
@@ -4285,6 +4321,16 @@ instance FromJSON MapEntry where
42854321 parseJSON (Object v) = MapEntry
42864322 <$> v .: "MapEntry"
42874323
4324+instance ToJSON MarshalJSON where
4325+ toJSON (MarshalJSON marshalJSONMarshalJSON) =
4326+ object $ foldMap (maybe [] pure)
4327+ [ Just $ "MarshalJSON" .= marshalJSONMarshalJSON
4328+ ]
4329+
4330+instance FromJSON MarshalJSON where
4331+ parseJSON (Object v) = MarshalJSON
4332+ <$> v .: "MarshalJSON"
4333+
42884334 instance ToJSON MetadataPropertyHandling where
42894335 toJSON (MetadataPropertyHandling metadataPropertyHandlingMetadataPropertyHandling) =
42904336 object $ foldMap (maybe [] pure)
@@ -4375,16 +4421,6 @@ instance FromJSON No where
43754421 parseJSON (Object v) = No
43764422 <$> v .: "NO"
43774423
4378-instance ToJSON Noexcept where
4379- toJSON (Noexcept noexceptNoexcept) =
4380- object $ foldMap (maybe [] pure)
4381- [ Just $ "noexcept" .= noexceptNoexcept
4382- ]
4383-
4384-instance FromJSON Noexcept where
4385- parseJSON (Object v) = Noexcept
4386- <$> v .: "noexcept"
4387-
43884424 instance ToJSON ID where
43894425 toJSON (ID idIDID) =
43904426 object $ foldMap (maybe [] pure)
@@ -4456,10 +4492,11 @@ instance FromJSON Module where
44564492 <$> v .: "module"
44574493
44584494 instance ToJSON Obj4 where
4459- toJSON (Obj4 dummyObj4 noSuchMethodObj4 nonatomicObj4 noneObj4 nonlocalObj4 nonmutatingObj4 notObj4 notEqObj4 nsErrorObj4 nsObjectObj4 nsStringObj4 nullObj4 nullptrObj4 numberObj4 obj4NoneObj4 obj4NullObj4 obj4OfObj4 obj4ProtocolObj4 objectObj4 objectMapperObj4 onewayObj4 openObj4 operatorObj4 optionalObj4 orObj4 orEqObj4 outObj4 overrideObj4 packageObj4 paramsObj4 passObj4 portObj4 postfixObj4 precedenceObj4 prefixObj4 printObj4 printMembersObj4 printfObj4 privateObj4 protectedObj4 protocolObj4 publicObj4 quicktypeObj4 raiseObj4 rangeObj4 readonlyObj4 refObj4 regExpObj4 registerObj4 reinterpretCastObj4 repeatObj4 requireObj4 requiredObj4 requiresObj4 restrictObj4 retainObj4 rethrowsObj4 returnObj4 rightObj4 runtimeTypeObj4 sObj4 sbyteObj4 sealedObj4 selObj4 selectObj4) =
4495+ toJSON (Obj4 dummyObj4 noSuchMethodObj4 noexceptObj4 nonatomicObj4 noneObj4 nonlocalObj4 nonmutatingObj4 notObj4 notEqObj4 nsErrorObj4 nsObjectObj4 nsStringObj4 nullObj4 nullptrObj4 numberObj4 obj4NoneObj4 obj4NullObj4 obj4OfObj4 obj4ProtocolObj4 objectObj4 objectMapperObj4 onewayObj4 openObj4 operatorObj4 optionalObj4 orObj4 orEqObj4 outObj4 overrideObj4 packageObj4 paramsObj4 passObj4 portObj4 postfixObj4 precedenceObj4 prefixObj4 printObj4 printMembersObj4 printfObj4 privateObj4 protectedObj4 protocolObj4 publicObj4 quicktypeObj4 raiseObj4 rangeObj4 readonlyObj4 refObj4 regExpObj4 registerObj4 reinterpretCastObj4 repeatObj4 requireObj4 requiredObj4 requiresObj4 restrictObj4 retainObj4 rethrowsObj4 returnObj4 rightObj4 runtimeTypeObj4 sObj4 sbyteObj4 sealedObj4 selObj4) =
44604496 object $ foldMap (maybe [] pure)
44614497 [ Just $ "dummy" .= dummyObj4
44624498 , Just $ "noSuchMethod" .= noSuchMethodObj4
4499+ , Just $ "noexcept" .= noexceptObj4
44634500 , Just $ "nonatomic" .= nonatomicObj4
44644501 , Just $ "None" .= noneObj4
44654502 , Just $ "nonlocal" .= nonlocalObj4
@@ -4522,13 +4559,13 @@ instance ToJSON Obj4 where
45224559 , Just $ "sbyte" .= sbyteObj4
45234560 , Just $ "sealed" .= sealedObj4
45244561 , Just $ "SEL" .= selObj4
4525- , Just $ "select" .= selectObj4
45264562 ]
45274563
45284564 instance FromJSON Obj4 where
45294565 parseJSON (Object v) = Obj4
45304566 <$> v .: "dummy"
45314567 <*> v .: "noSuchMethod"
4568+ <*> v .: "noexcept"
45324569 <*> v .: "nonatomic"
45334570 <*> v .: "None"
45344571 <*> v .: "nonlocal"
@@ -4591,7 +4628,6 @@ instance FromJSON Obj4 where
45914628 <*> v .: "sbyte"
45924629 <*> v .: "sealed"
45934630 <*> v .: "SEL"
4594- <*> v .: "select"
45954631
45964632 instance ToJSON NoSuchMethod where
45974633 toJSON (NoSuchMethod noSuchMethodNoSuchMethod) =
@@ -4603,6 +4639,16 @@ instance FromJSON NoSuchMethod where
46034639 parseJSON (Object v) = NoSuchMethod
46044640 <$> v .: "noSuchMethod"
46054641
4642+instance ToJSON Noexcept where
4643+ toJSON (Noexcept noexceptNoexcept) =
4644+ object $ foldMap (maybe [] pure)
4645+ [ Just $ "noexcept" .= noexceptNoexcept
4646+ ]
4647+
4648+instance FromJSON Noexcept where
4649+ parseJSON (Object v) = Noexcept
4650+ <$> v .: "noexcept"
4651+
46064652 instance ToJSON Nonatomic where
46074653 toJSON (Nonatomic nonatomicNonatomic) =
46084654 object $ foldMap (maybe [] pure)
@@ -5223,18 +5269,8 @@ instance FromJSON Sel where
52235269 parseJSON (Object v) = Sel
52245270 <$> v .: "SEL"
52255271
5226-instance ToJSON Select where
5227- toJSON (Select selectSelect) =
5228- object $ foldMap (maybe [] pure)
5229- [ Just $ "select" .= selectSelect
5230- ]
5231-
5232-instance FromJSON Select where
5233- parseJSON (Object v) = Select
5234- <$> v .: "select"
5235-
52365272 instance ToJSON Obj5 where
5237- toJSON (Obj5 dummyObj5 kSerializerObj5 obj5SelfObj5 obj5ThenObj5 obj5TrueObj5 obj5TypeObj5 primitiveKindObj5 purpleTypeObj5 selfObj5 sendableObj5 serialDescriptorObj5 serialNameObj5 serializableObj5 serializeObj5 serializerProviderObj5 setObj5 shortObj5 signedObj5 simpleModuleObj5 sizeofObj5 stackallocObj5 standardsObj5 staticObj5 staticAssertObj5 staticCastObj5 stdDeserializerObj5 stdSerializerObj5 strictfpObj5 stringObj5 structObj5 subscriptObj5 superObj5 switchObj5 symbolObj5 synchronizedObj5 systemObj5 templateObj5 thisObj5 threadLocalObj5 throwObj5 throwsObj5 timeOnlyObj5 timeOnlyConverterObj5 timeZoneObj5 toJSONObj5 toStringObj5 topLevelObj5 transientObj5 trueObj5 tryObj5 typealiasObj5 typedefObj5 typeidObj5 typenameObj5 typeofObj5 uintObj5 ulongObj5 uncheckedObj5 undefinedObj5 unionObj5 unownedObj5 unsafeObj5 unsignedObj5 useSerializersObj5 ushortObj5) =
5273+ toJSON (Obj5 dummyObj5 kSerializerObj5 obj5SelfObj5 obj5ThenObj5 obj5TrueObj5 obj5TypeObj5 primitiveKindObj5 purpleTypeObj5 selectObj5 selfObj5 sendableObj5 serialDescriptorObj5 serialNameObj5 serializableObj5 serializeObj5 serializerProviderObj5 setObj5 shortObj5 signedObj5 simpleModuleObj5 sizeofObj5 stackallocObj5 standardsObj5 staticObj5 staticAssertObj5 staticCastObj5 stdDeserializerObj5 stdSerializerObj5 strictfpObj5 stringObj5 structObj5 subscriptObj5 superObj5 switchObj5 symbolObj5 synchronizedObj5 systemObj5 templateObj5 thisObj5 threadLocalObj5 throwObj5 throwsObj5 timeOnlyObj5 timeOnlyConverterObj5 timeZoneObj5 toDictObj5 toJSONObj5 toStringObj5 topLevelObj5 transientObj5 trueObj5 tryObj5 typealiasObj5 typedefObj5 typeidObj5 typenameObj5 typeofObj5 uintObj5 ulongObj5 uncheckedObj5 undefinedObj5 unionObj5 unmarshalJSONObj5 unownedObj5 unsafeObj5 useSerializersObj5) =
52385274 object $ foldMap (maybe [] pure)
52395275 [ Just $ "dummy" .= dummyObj5
52405276 , Just $ "KSerializer" .= kSerializerObj5
@@ -5244,6 +5280,7 @@ instance ToJSON Obj5 where
52445280 , Just $ "Type" .= obj5TypeObj5
52455281 , Just $ "PrimitiveKind" .= primitiveKindObj5
52465282 , Just $ "type" .= purpleTypeObj5
5283+ , Just $ "select" .= selectObj5
52475284 , Just $ "Self" .= selfObj5
52485285 , Just $ "Sendable" .= sendableObj5
52495286 , Just $ "SerialDescriptor" .= serialDescriptorObj5
@@ -5280,6 +5317,7 @@ instance ToJSON Obj5 where
52805317 , Just $ "TimeOnly" .= timeOnlyObj5
52815318 , Just $ "TimeOnlyConverter" .= timeOnlyConverterObj5
52825319 , Just $ "TimeZone" .= timeZoneObj5
5320+ , Just $ "to_dict" .= toDictObj5
52835321 , Just $ "to_json" .= toJSONObj5
52845322 , Just $ "toString" .= toStringObj5
52855323 , Just $ "top_level" .= topLevelObj5
@@ -5296,11 +5334,10 @@ instance ToJSON Obj5 where
52965334 , Just $ "unchecked" .= uncheckedObj5
52975335 , Just $ "undefined" .= undefinedObj5
52985336 , Just $ "union" .= unionObj5
5337+ , Just $ "UnmarshalJSON" .= unmarshalJSONObj5
52995338 , Just $ "unowned" .= unownedObj5
53005339 , Just $ "unsafe" .= unsafeObj5
5301- , Just $ "unsigned" .= unsignedObj5
53025340 , Just $ "UseSerializers" .= useSerializersObj5
5303- , Just $ "ushort" .= ushortObj5
53045341 ]
53055342
53065343 instance FromJSON Obj5 where
@@ -5313,6 +5350,7 @@ instance FromJSON Obj5 where
53135350 <*> v .: "Type"
53145351 <*> v .: "PrimitiveKind"
53155352 <*> v .: "type"
5353+ <*> v .: "select"
53165354 <*> v .: "Self"
53175355 <*> v .: "Sendable"
53185356 <*> v .: "SerialDescriptor"
@@ -5349,6 +5387,7 @@ instance FromJSON Obj5 where
53495387 <*> v .: "TimeOnly"
53505388 <*> v .: "TimeOnlyConverter"
53515389 <*> v .: "TimeZone"
5390+ <*> v .: "to_dict"
53525391 <*> v .: "to_json"
53535392 <*> v .: "toString"
53545393 <*> v .: "top_level"
@@ -5365,11 +5404,10 @@ instance FromJSON Obj5 where
53655404 <*> v .: "unchecked"
53665405 <*> v .: "undefined"
53675406 <*> v .: "union"
5407+ <*> v .: "UnmarshalJSON"
53685408 <*> v .: "unowned"
53695409 <*> v .: "unsafe"
5370- <*> v .: "unsigned"
53715410 <*> v .: "UseSerializers"
5372- <*> v .: "ushort"
53735411
53745412 instance ToJSON KSerializer where
53755413 toJSON (KSerializer kSerializerKSerializer) =
@@ -5441,6 +5479,16 @@ instance FromJSON TypeClass where
54415479 parseJSON (Object v) = TypeClass
54425480 <$> v .: "type"
54435481
5482+instance ToJSON Select where
5483+ toJSON (Select selectSelect) =
5484+ object $ foldMap (maybe [] pure)
5485+ [ Just $ "select" .= selectSelect
5486+ ]
5487+
5488+instance FromJSON Select where
5489+ parseJSON (Object v) = Select
5490+ <$> v .: "select"
5491+
54445492 instance ToJSON Self where
54455493 toJSON (Self selfSelf) =
54465494 object $ foldMap (maybe [] pure)
@@ -5801,6 +5849,16 @@ instance FromJSON TimeZone where
58015849 parseJSON (Object v) = TimeZone
58025850 <$> v .: "TimeZone"
58035851
5852+instance ToJSON ToDict where
5853+ toJSON (ToDict toDictToDict) =
5854+ object $ foldMap (maybe [] pure)
5855+ [ Just $ "to_dict" .= toDictToDict
5856+ ]
5857+
5858+instance FromJSON ToDict where
5859+ parseJSON (Object v) = ToDict
5860+ <$> v .: "to_dict"
5861+
58045862 instance ToJSON ToJSONClass where
58055863 toJSON (ToJSONClass toJSONToJSONClass) =
58065864 object $ foldMap (maybe [] pure)
@@ -5961,6 +6019,16 @@ instance FromJSON Union where
59616019 parseJSON (Object v) = Union
59626020 <$> v .: "union"
59636021
6022+instance ToJSON UnmarshalJSON where
6023+ toJSON (UnmarshalJSON unmarshalJSONUnmarshalJSON) =
6024+ object $ foldMap (maybe [] pure)
6025+ [ Just $ "UnmarshalJSON" .= unmarshalJSONUnmarshalJSON
6026+ ]
6027+
6028+instance FromJSON UnmarshalJSON where
6029+ parseJSON (Object v) = UnmarshalJSON
6030+ <$> v .: "UnmarshalJSON"
6031+
59646032 instance ToJSON Unowned where
59656033 toJSON (Unowned unownedUnowned) =
59666034 object $ foldMap (maybe [] pure)
@@ -5981,16 +6049,6 @@ instance FromJSON Unsafe where
59816049 parseJSON (Object v) = Unsafe
59826050 <$> v .: "unsafe"
59836051
5984-instance ToJSON Unsigned where
5985- toJSON (Unsigned unsignedUnsigned) =
5986- object $ foldMap (maybe [] pure)
5987- [ Just $ "unsigned" .= unsignedUnsigned
5988- ]
5989-
5990-instance FromJSON Unsigned where
5991- parseJSON (Object v) = Unsigned
5992- <$> v .: "unsigned"
5993-
59946052 instance ToJSON UseSerializers where
59956053 toJSON (UseSerializers useSerializersUseSerializers) =
59966054 object $ foldMap (maybe [] pure)
@@ -6001,21 +6059,13 @@ instance FromJSON UseSerializers where
60016059 parseJSON (Object v) = UseSerializers
60026060 <$> v .: "UseSerializers"
60036061
6004-instance ToJSON Ushort where
6005- toJSON (Ushort ushortUshort) =
6006- object $ foldMap (maybe [] pure)
6007- [ Just $ "ushort" .= ushortUshort
6008- ]
6009-
6010-instance FromJSON Ushort where
6011- parseJSON (Object v) = Ushort
6012- <$> v .: "ushort"
6013-
60146062 instance ToJSON Obj6 where
6015- toJSON (Obj6 dummyObj6 obj6WhereObj6 usingObj6 utf8JSONReaderObj6 utf8JSONWriterObj6 uuidObj6 varObj6 virtualObj6 voidObj6 volatileObj6 wcharTObj6 weakObj6 whileObj6 willSetObj6 withObj6 xorObj6 xorEqObj6 yesObj6 yieldObj6) =
6063+ toJSON (Obj6 dummyObj6 obj6WhereObj6 unsignedObj6 ushortObj6 usingObj6 utf8JSONReaderObj6 utf8JSONWriterObj6 uuidObj6 varObj6 virtualObj6 voidObj6 volatileObj6 wcharTObj6 weakObj6 whileObj6 willSetObj6 withObj6 xorObj6 xorEqObj6 yesObj6 yieldObj6) =
60166064 object $ foldMap (maybe [] pure)
60176065 [ Just $ "dummy" .= dummyObj6
60186066 , Just $ "where" .= obj6WhereObj6
6067+ , Just $ "unsigned" .= unsignedObj6
6068+ , Just $ "ushort" .= ushortObj6
60196069 , Just $ "using" .= usingObj6
60206070 , Just $ "Utf8JsonReader" .= utf8JSONReaderObj6
60216071 , Just $ "Utf8JsonWriter" .= utf8JSONWriterObj6
@@ -6039,6 +6089,8 @@ instance FromJSON Obj6 where
60396089 parseJSON (Object v) = Obj6
60406090 <$> v .: "dummy"
60416091 <*> v .: "where"
6092+ <*> v .: "unsigned"
6093+ <*> v .: "ushort"
60426094 <*> v .: "using"
60436095 <*> v .: "Utf8JsonReader"
60446096 <*> v .: "Utf8JsonWriter"
@@ -6067,6 +6119,26 @@ instance FromJSON Where where
60676119 parseJSON (Object v) = Where
60686120 <$> v .: "where"
60696121
6122+instance ToJSON Unsigned where
6123+ toJSON (Unsigned unsignedUnsigned) =
6124+ object $ foldMap (maybe [] pure)
6125+ [ Just $ "unsigned" .= unsignedUnsigned
6126+ ]
6127+
6128+instance FromJSON Unsigned where
6129+ parseJSON (Object v) = Unsigned
6130+ <$> v .: "unsigned"
6131+
6132+instance ToJSON Ushort where
6133+ toJSON (Ushort ushortUshort) =
6134+ object $ foldMap (maybe [] pure)
6135+ [ Just $ "ushort" .= ushortUshort
6136+ ]
6137+
6138+instance FromJSON Ushort where
6139+ parseJSON (Object v) = Ushort
6140+ <$> v .: "ushort"
6141+
60706142 instance ToJSON Using where
60716143 toJSON (Using usingUsing) =
60726144 object $ foldMap (maybe [] pure)
Ajava-datetime-legacydefault / src / main / java / io / quicktype / FromDict.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class FromDict {
6+ private long fromDict;
7+
8+ @JsonProperty("from_dict")
9+ public long getFromDict() { return fromDict; }
10+ @JsonProperty("from_dict")
11+ public void setFromDict(long value) { this.fromDict = value; }
12+}
Ajava-datetime-legacydefault / src / main / java / io / quicktype / MarshalJSON.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class MarshalJSON {
6+ private long marshalJSON;
7+
8+ @JsonProperty("MarshalJSON")
9+ public long getMarshalJSON() { return marshalJSON; }
10+ @JsonProperty("MarshalJSON")
11+ public void setMarshalJSON(long value) { this.marshalJSON = value; }
12+}
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj2.java+6 −6
@@ -49,6 +49,7 @@ public class Obj2 {
4949 private FormatException formatException;
5050 private Friend friend;
5151 private From from;
52+ private FromDict fromDict;
5253 private FromJSON fromJSON;
5354 private Func func;
5455 private Function function;
@@ -66,7 +67,6 @@ public class Obj2 {
6667 private Finally obj2Finally;
6768 private Float obj2Float;
6869 private For obj2For;
69- private Goto obj2Goto;
7070 private FalseClass purpleFalse;
7171
7272 @JsonProperty("DateFormatter")
@@ -299,6 +299,11 @@ public class Obj2 {
299299 @JsonProperty("from")
300300 public void setFrom(From value) { this.from = value; }
301301
302+ @JsonProperty("from_dict")
303+ public FromDict getFromDict() { return fromDict; }
304+ @JsonProperty("from_dict")
305+ public void setFromDict(FromDict value) { this.fromDict = value; }
306+
302307 @JsonProperty("from_json")
303308 public FromJSON getFromJSON() { return fromJSON; }
304309 @JsonProperty("from_json")
@@ -384,11 +389,6 @@ public class Obj2 {
384389 @JsonProperty("for")
385390 public void setObj2For(For value) { this.obj2For = value; }
386391
387- @JsonProperty("goto")
388- public Goto getObj2Goto() { return obj2Goto; }
389- @JsonProperty("goto")
390- public void setObj2Goto(Goto value) { this.obj2Goto = value; }
391-
392392 @JsonProperty("false")
393393 public FalseClass getPurpleFalse() { return purpleFalse; }
394394 @JsonProperty("false")
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj3.java+11 −5
@@ -50,6 +50,7 @@ public class Obj3 {
5050 private Lock lock;
5151 private MapClass map;
5252 private MapEntry mapEntry;
53+ private MarshalJSON marshalJSON;
5354 private MetadataPropertyHandling metadataPropertyHandling;
5455 private Module module;
5556 private Mutable mutable;
@@ -58,7 +59,7 @@ public class Obj3 {
5859 private Newtonsoft newtonsoft;
5960 private Nil nil;
6061 private No no;
61- private Noexcept noexcept;
62+ private Goto obj3Goto;
6263 private If obj3If;
6364 private Implements obj3Implements;
6465 private Import obj3Import;
@@ -304,6 +305,11 @@ public class Obj3 {
304305 @JsonProperty("MapEntry")
305306 public void setMapEntry(MapEntry value) { this.mapEntry = value; }
306307
308+ @JsonProperty("MarshalJSON")
309+ public MarshalJSON getMarshalJSON() { return marshalJSON; }
310+ @JsonProperty("MarshalJSON")
311+ public void setMarshalJSON(MarshalJSON value) { this.marshalJSON = value; }
312+
307313 @JsonProperty("metadata_property_handling")
308314 public MetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; }
309315 @JsonProperty("metadata_property_handling")
@@ -344,10 +350,10 @@ public class Obj3 {
344350 @JsonProperty("NO")
345351 public void setNo(No value) { this.no = value; }
346352
347- @JsonProperty("noexcept")
348- public Noexcept getNoexcept() { return noexcept; }
349- @JsonProperty("noexcept")
350- public void setNoexcept(Noexcept value) { this.noexcept = value; }
353+ @JsonProperty("goto")
354+ public Goto getObj3Goto() { return obj3Goto; }
355+ @JsonProperty("goto")
356+ public void setObj3Goto(Goto value) { this.obj3Goto = value; }
351357
352358 @JsonProperty("if")
353359 public If getObj3If() { return obj3If; }
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj4.java+6 −6
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*;
55 public class Obj4 {
66 private long dummy;
77 private NoSuchMethod noSuchMethod;
8+ private Noexcept noexcept;
89 private Nonatomic nonatomic;
910 private NoneClass none;
1011 private Nonlocal nonlocal;
@@ -67,7 +68,6 @@ public class Obj4 {
6768 private Sbyte sbyte;
6869 private Sealed sealed;
6970 private Sel sel;
70- private Select select;
7171
7272 @JsonProperty("dummy")
7373 public long getDummy() { return dummy; }
@@ -79,6 +79,11 @@ public class Obj4 {
7979 @JsonProperty("noSuchMethod")
8080 public void setNoSuchMethod(NoSuchMethod value) { this.noSuchMethod = value; }
8181
82+ @JsonProperty("noexcept")
83+ public Noexcept getNoexcept() { return noexcept; }
84+ @JsonProperty("noexcept")
85+ public void setNoexcept(Noexcept value) { this.noexcept = value; }
86+
8287 @JsonProperty("nonatomic")
8388 public Nonatomic getNonatomic() { return nonatomic; }
8489 @JsonProperty("nonatomic")
@@ -388,9 +393,4 @@ public class Obj4 {
388393 public Sel getSel() { return sel; }
389394 @JsonProperty("SEL")
390395 public void setSel(Sel value) { this.sel = value; }
391-
392- @JsonProperty("select")
393- public Select getSelect() { return select; }
394- @JsonProperty("select")
395- public void setSelect(Select value) { this.select = value; }
396396 }
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj5.java+18 −12
@@ -21,6 +21,7 @@ public class Obj5 {
2121 private TypeClass obj5Type;
2222 private PrimitiveKind primitiveKind;
2323 private TrueClass purpleTrue;
24+ private Select select;
2425 private Self self;
2526 private Sendable sendable;
2627 private SerialDescriptor serialDescriptor;
@@ -49,6 +50,7 @@ public class Obj5 {
4950 private TimeOnly timeOnly;
5051 private TimeOnlyConverter timeOnlyConverter;
5152 private TimeZone timeZone;
53+ private ToDict toDict;
5254 private ToJSON toJSON;
5355 private ToString toString;
5456 private TopLevelClass topLevel;
@@ -63,11 +65,10 @@ public class Obj5 {
6365 private Unchecked unchecked;
6466 private Undefined undefined;
6567 private Union union;
68+ private UnmarshalJSON unmarshalJSON;
6669 private Unowned unowned;
6770 private Unsafe unsafe;
68- private Unsigned unsigned;
6971 private UseSerializers useSerializers;
70- private Ushort ushort;
7172
7273 @JsonProperty("dummy")
7374 public long getDummy() { return dummy; }
@@ -159,6 +160,11 @@ public class Obj5 {
159160 @JsonProperty("true")
160161 public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; }
161162
163+ @JsonProperty("select")
164+ public Select getSelect() { return select; }
165+ @JsonProperty("select")
166+ public void setSelect(Select value) { this.select = value; }
167+
162168 @JsonProperty("Self")
163169 public Self getSelf() { return self; }
164170 @JsonProperty("Self")
@@ -299,6 +305,11 @@ public class Obj5 {
299305 @JsonProperty("TimeZone")
300306 public void setTimeZone(TimeZone value) { this.timeZone = value; }
301307
308+ @JsonProperty("to_dict")
309+ public ToDict getToDict() { return toDict; }
310+ @JsonProperty("to_dict")
311+ public void setToDict(ToDict value) { this.toDict = value; }
312+
302313 @JsonProperty("to_json")
303314 public ToJSON getToJSON() { return toJSON; }
304315 @JsonProperty("to_json")
@@ -369,6 +380,11 @@ public class Obj5 {
369380 @JsonProperty("union")
370381 public void setUnion(Union value) { this.union = value; }
371382
383+ @JsonProperty("UnmarshalJSON")
384+ public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
385+ @JsonProperty("UnmarshalJSON")
386+ public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; }
387+
372388 @JsonProperty("unowned")
373389 public Unowned getUnowned() { return unowned; }
374390 @JsonProperty("unowned")
@@ -379,18 +395,8 @@ public class Obj5 {
379395 @JsonProperty("unsafe")
380396 public void setUnsafe(Unsafe value) { this.unsafe = value; }
381397
382- @JsonProperty("unsigned")
383- public Unsigned getUnsigned() { return unsigned; }
384- @JsonProperty("unsigned")
385- public void setUnsigned(Unsigned value) { this.unsigned = value; }
386-
387398 @JsonProperty("UseSerializers")
388399 public UseSerializers getUseSerializers() { return useSerializers; }
389400 @JsonProperty("UseSerializers")
390401 public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
391-
392- @JsonProperty("ushort")
393- public Ushort getUshort() { return ushort; }
394- @JsonProperty("ushort")
395- public void setUshort(Ushort value) { this.ushort = value; }
396402 }
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj6.java+12 −0
@@ -7,6 +7,8 @@ public class Obj6 {
77 private Void obj6Void;
88 private Volatile obj6Volatile;
99 private While obj6While;
10+ private Unsigned unsigned;
11+ private Ushort ushort;
1012 private Using using;
1113 private Utf8JSONReader utf8JSONReader;
1214 private Utf8JSONWriter utf8JSONWriter;
@@ -43,6 +45,16 @@ public class Obj6 {
4345 @JsonProperty("while")
4446 public void setObj6While(While value) { this.obj6While = value; }
4547
48+ @JsonProperty("unsigned")
49+ public Unsigned getUnsigned() { return unsigned; }
50+ @JsonProperty("unsigned")
51+ public void setUnsigned(Unsigned value) { this.unsigned = value; }
52+
53+ @JsonProperty("ushort")
54+ public Ushort getUshort() { return ushort; }
55+ @JsonProperty("ushort")
56+ public void setUshort(Ushort value) { this.ushort = value; }
57+
4658 @JsonProperty("using")
4759 public Using getUsing() { return using; }
4860 @JsonProperty("using")
Ajava-datetime-legacydefault / src / main / java / io / quicktype / ToDict.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class ToDict {
6+ private long toDict;
7+
8+ @JsonProperty("to_dict")
9+ public long getToDict() { return toDict; }
10+ @JsonProperty("to_dict")
11+ public void setToDict(long value) { this.toDict = value; }
12+}
Ajava-datetime-legacydefault / src / main / java / io / quicktype / UnmarshalJSON.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class UnmarshalJSON {
6+ private long unmarshalJSON;
7+
8+ @JsonProperty("UnmarshalJSON")
9+ public long getUnmarshalJSON() { return unmarshalJSON; }
10+ @JsonProperty("UnmarshalJSON")
11+ public void setUnmarshalJSON(long value) { this.unmarshalJSON = value; }
12+}
Ajava-lombokdefault / src / main / java / io / quicktype / FromDict.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class FromDict {
6+ private long fromDict;
7+
8+ @JsonProperty("from_dict")
9+ public long getFromDict() { return fromDict; }
10+ @JsonProperty("from_dict")
11+ public void setFromDict(long value) { this.fromDict = value; }
12+}
Ajava-lombokdefault / src / main / java / io / quicktype / MarshalJSON.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class MarshalJSON {
6+ private long marshalJSON;
7+
8+ @JsonProperty("MarshalJSON")
9+ public long getMarshalJSON() { return marshalJSON; }
10+ @JsonProperty("MarshalJSON")
11+ public void setMarshalJSON(long value) { this.marshalJSON = value; }
12+}
Mjava-lombokdefault / src / main / java / io / quicktype / Obj2.java+6 −6
@@ -49,6 +49,7 @@ public class Obj2 {
4949 private FormatException formatException;
5050 private Friend friend;
5151 private From from;
52+ private FromDict fromDict;
5253 private FromJSON fromJSON;
5354 private Func func;
5455 private Function function;
@@ -66,7 +67,6 @@ public class Obj2 {
6667 private Finally obj2Finally;
6768 private Float obj2Float;
6869 private For obj2For;
69- private Goto obj2Goto;
7070 private FalseClass purpleFalse;
7171
7272 @JsonProperty("DateFormatter")
@@ -299,6 +299,11 @@ public class Obj2 {
299299 @JsonProperty("from")
300300 public void setFrom(From value) { this.from = value; }
301301
302+ @JsonProperty("from_dict")
303+ public FromDict getFromDict() { return fromDict; }
304+ @JsonProperty("from_dict")
305+ public void setFromDict(FromDict value) { this.fromDict = value; }
306+
302307 @JsonProperty("from_json")
303308 public FromJSON getFromJSON() { return fromJSON; }
304309 @JsonProperty("from_json")
@@ -384,11 +389,6 @@ public class Obj2 {
384389 @JsonProperty("for")
385390 public void setObj2For(For value) { this.obj2For = value; }
386391
387- @JsonProperty("goto")
388- public Goto getObj2Goto() { return obj2Goto; }
389- @JsonProperty("goto")
390- public void setObj2Goto(Goto value) { this.obj2Goto = value; }
391-
392392 @JsonProperty("false")
393393 public FalseClass getPurpleFalse() { return purpleFalse; }
394394 @JsonProperty("false")
Mjava-lombokdefault / src / main / java / io / quicktype / Obj3.java+11 −5
@@ -50,6 +50,7 @@ public class Obj3 {
5050 private Lock lock;
5151 private MapClass map;
5252 private MapEntry mapEntry;
53+ private MarshalJSON marshalJSON;
5354 private MetadataPropertyHandling metadataPropertyHandling;
5455 private Module module;
5556 private Mutable mutable;
@@ -58,7 +59,7 @@ public class Obj3 {
5859 private Newtonsoft newtonsoft;
5960 private Nil nil;
6061 private No no;
61- private Noexcept noexcept;
62+ private Goto obj3Goto;
6263 private If obj3If;
6364 private Implements obj3Implements;
6465 private Import obj3Import;
@@ -304,6 +305,11 @@ public class Obj3 {
304305 @JsonProperty("MapEntry")
305306 public void setMapEntry(MapEntry value) { this.mapEntry = value; }
306307
308+ @JsonProperty("MarshalJSON")
309+ public MarshalJSON getMarshalJSON() { return marshalJSON; }
310+ @JsonProperty("MarshalJSON")
311+ public void setMarshalJSON(MarshalJSON value) { this.marshalJSON = value; }
312+
307313 @JsonProperty("metadata_property_handling")
308314 public MetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; }
309315 @JsonProperty("metadata_property_handling")
@@ -344,10 +350,10 @@ public class Obj3 {
344350 @JsonProperty("NO")
345351 public void setNo(No value) { this.no = value; }
346352
347- @JsonProperty("noexcept")
348- public Noexcept getNoexcept() { return noexcept; }
349- @JsonProperty("noexcept")
350- public void setNoexcept(Noexcept value) { this.noexcept = value; }
353+ @JsonProperty("goto")
354+ public Goto getObj3Goto() { return obj3Goto; }
355+ @JsonProperty("goto")
356+ public void setObj3Goto(Goto value) { this.obj3Goto = value; }
351357
352358 @JsonProperty("if")
353359 public If getObj3If() { return obj3If; }
Mjava-lombokdefault / src / main / java / io / quicktype / Obj4.java+6 −6
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*;
55 public class Obj4 {
66 private long dummy;
77 private NoSuchMethod noSuchMethod;
8+ private Noexcept noexcept;
89 private Nonatomic nonatomic;
910 private NoneClass none;
1011 private Nonlocal nonlocal;
@@ -67,7 +68,6 @@ public class Obj4 {
6768 private Sbyte sbyte;
6869 private Sealed sealed;
6970 private Sel sel;
70- private Select select;
7171
7272 @JsonProperty("dummy")
7373 public long getDummy() { return dummy; }
@@ -79,6 +79,11 @@ public class Obj4 {
7979 @JsonProperty("noSuchMethod")
8080 public void setNoSuchMethod(NoSuchMethod value) { this.noSuchMethod = value; }
8181
82+ @JsonProperty("noexcept")
83+ public Noexcept getNoexcept() { return noexcept; }
84+ @JsonProperty("noexcept")
85+ public void setNoexcept(Noexcept value) { this.noexcept = value; }
86+
8287 @JsonProperty("nonatomic")
8388 public Nonatomic getNonatomic() { return nonatomic; }
8489 @JsonProperty("nonatomic")
@@ -388,9 +393,4 @@ public class Obj4 {
388393 public Sel getSel() { return sel; }
389394 @JsonProperty("SEL")
390395 public void setSel(Sel value) { this.sel = value; }
391-
392- @JsonProperty("select")
393- public Select getSelect() { return select; }
394- @JsonProperty("select")
395- public void setSelect(Select value) { this.select = value; }
396396 }
Mjava-lombokdefault / src / main / java / io / quicktype / Obj5.java+18 −12
@@ -21,6 +21,7 @@ public class Obj5 {
2121 private TypeClass obj5Type;
2222 private PrimitiveKind primitiveKind;
2323 private TrueClass purpleTrue;
24+ private Select select;
2425 private Self self;
2526 private Sendable sendable;
2627 private SerialDescriptor serialDescriptor;
@@ -49,6 +50,7 @@ public class Obj5 {
4950 private TimeOnly timeOnly;
5051 private TimeOnlyConverter timeOnlyConverter;
5152 private TimeZone timeZone;
53+ private ToDict toDict;
5254 private ToJSON toJSON;
5355 private ToString toString;
5456 private TopLevelClass topLevel;
@@ -63,11 +65,10 @@ public class Obj5 {
6365 private Unchecked unchecked;
6466 private Undefined undefined;
6567 private Union union;
68+ private UnmarshalJSON unmarshalJSON;
6669 private Unowned unowned;
6770 private Unsafe unsafe;
68- private Unsigned unsigned;
6971 private UseSerializers useSerializers;
70- private Ushort ushort;
7172
7273 @JsonProperty("dummy")
7374 public long getDummy() { return dummy; }
@@ -159,6 +160,11 @@ public class Obj5 {
159160 @JsonProperty("true")
160161 public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; }
161162
163+ @JsonProperty("select")
164+ public Select getSelect() { return select; }
165+ @JsonProperty("select")
166+ public void setSelect(Select value) { this.select = value; }
167+
162168 @JsonProperty("Self")
163169 public Self getSelf() { return self; }
164170 @JsonProperty("Self")
@@ -299,6 +305,11 @@ public class Obj5 {
299305 @JsonProperty("TimeZone")
300306 public void setTimeZone(TimeZone value) { this.timeZone = value; }
301307
308+ @JsonProperty("to_dict")
309+ public ToDict getToDict() { return toDict; }
310+ @JsonProperty("to_dict")
311+ public void setToDict(ToDict value) { this.toDict = value; }
312+
302313 @JsonProperty("to_json")
303314 public ToJSON getToJSON() { return toJSON; }
304315 @JsonProperty("to_json")
@@ -369,6 +380,11 @@ public class Obj5 {
369380 @JsonProperty("union")
370381 public void setUnion(Union value) { this.union = value; }
371382
383+ @JsonProperty("UnmarshalJSON")
384+ public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
385+ @JsonProperty("UnmarshalJSON")
386+ public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; }
387+
372388 @JsonProperty("unowned")
373389 public Unowned getUnowned() { return unowned; }
374390 @JsonProperty("unowned")
@@ -379,18 +395,8 @@ public class Obj5 {
379395 @JsonProperty("unsafe")
380396 public void setUnsafe(Unsafe value) { this.unsafe = value; }
381397
382- @JsonProperty("unsigned")
383- public Unsigned getUnsigned() { return unsigned; }
384- @JsonProperty("unsigned")
385- public void setUnsigned(Unsigned value) { this.unsigned = value; }
386-
387398 @JsonProperty("UseSerializers")
388399 public UseSerializers getUseSerializers() { return useSerializers; }
389400 @JsonProperty("UseSerializers")
390401 public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
391-
392- @JsonProperty("ushort")
393- public Ushort getUshort() { return ushort; }
394- @JsonProperty("ushort")
395- public void setUshort(Ushort value) { this.ushort = value; }
396402 }
Mjava-lombokdefault / src / main / java / io / quicktype / Obj6.java+12 −0
@@ -7,6 +7,8 @@ public class Obj6 {
77 private Void obj6Void;
88 private Volatile obj6Volatile;
99 private While obj6While;
10+ private Unsigned unsigned;
11+ private Ushort ushort;
1012 private Using using;
1113 private Utf8JSONReader utf8JSONReader;
1214 private Utf8JSONWriter utf8JSONWriter;
@@ -43,6 +45,16 @@ public class Obj6 {
4345 @JsonProperty("while")
4446 public void setObj6While(While value) { this.obj6While = value; }
4547
48+ @JsonProperty("unsigned")
49+ public Unsigned getUnsigned() { return unsigned; }
50+ @JsonProperty("unsigned")
51+ public void setUnsigned(Unsigned value) { this.unsigned = value; }
52+
53+ @JsonProperty("ushort")
54+ public Ushort getUshort() { return ushort; }
55+ @JsonProperty("ushort")
56+ public void setUshort(Ushort value) { this.ushort = value; }
57+
4658 @JsonProperty("using")
4759 public Using getUsing() { return using; }
4860 @JsonProperty("using")
Ajava-lombokdefault / src / main / java / io / quicktype / ToDict.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class ToDict {
6+ private long toDict;
7+
8+ @JsonProperty("to_dict")
9+ public long getToDict() { return toDict; }
10+ @JsonProperty("to_dict")
11+ public void setToDict(long value) { this.toDict = value; }
12+}
Ajava-lombokdefault / src / main / java / io / quicktype / UnmarshalJSON.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class UnmarshalJSON {
6+ private long unmarshalJSON;
7+
8+ @JsonProperty("UnmarshalJSON")
9+ public long getUnmarshalJSON() { return unmarshalJSON; }
10+ @JsonProperty("UnmarshalJSON")
11+ public void setUnmarshalJSON(long value) { this.unmarshalJSON = value; }
12+}
Ajavadefault / src / main / java / io / quicktype / FromDict.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class FromDict {
6+ private long fromDict;
7+
8+ @JsonProperty("from_dict")
9+ public long getFromDict() { return fromDict; }
10+ @JsonProperty("from_dict")
11+ public void setFromDict(long value) { this.fromDict = value; }
12+}
Ajavadefault / src / main / java / io / quicktype / MarshalJSON.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class MarshalJSON {
6+ private long marshalJSON;
7+
8+ @JsonProperty("MarshalJSON")
9+ public long getMarshalJSON() { return marshalJSON; }
10+ @JsonProperty("MarshalJSON")
11+ public void setMarshalJSON(long value) { this.marshalJSON = value; }
12+}
Mjavadefault / src / main / java / io / quicktype / Obj2.java+6 −6
@@ -49,6 +49,7 @@ public class Obj2 {
4949 private FormatException formatException;
5050 private Friend friend;
5151 private From from;
52+ private FromDict fromDict;
5253 private FromJSON fromJSON;
5354 private Func func;
5455 private Function function;
@@ -66,7 +67,6 @@ public class Obj2 {
6667 private Finally obj2Finally;
6768 private Float obj2Float;
6869 private For obj2For;
69- private Goto obj2Goto;
7070 private FalseClass purpleFalse;
7171
7272 @JsonProperty("DateFormatter")
@@ -299,6 +299,11 @@ public class Obj2 {
299299 @JsonProperty("from")
300300 public void setFrom(From value) { this.from = value; }
301301
302+ @JsonProperty("from_dict")
303+ public FromDict getFromDict() { return fromDict; }
304+ @JsonProperty("from_dict")
305+ public void setFromDict(FromDict value) { this.fromDict = value; }
306+
302307 @JsonProperty("from_json")
303308 public FromJSON getFromJSON() { return fromJSON; }
304309 @JsonProperty("from_json")
@@ -384,11 +389,6 @@ public class Obj2 {
384389 @JsonProperty("for")
385390 public void setObj2For(For value) { this.obj2For = value; }
386391
387- @JsonProperty("goto")
388- public Goto getObj2Goto() { return obj2Goto; }
389- @JsonProperty("goto")
390- public void setObj2Goto(Goto value) { this.obj2Goto = value; }
391-
392392 @JsonProperty("false")
393393 public FalseClass getPurpleFalse() { return purpleFalse; }
394394 @JsonProperty("false")
Mjavadefault / src / main / java / io / quicktype / Obj3.java+11 −5
@@ -50,6 +50,7 @@ public class Obj3 {
5050 private Lock lock;
5151 private MapClass map;
5252 private MapEntry mapEntry;
53+ private MarshalJSON marshalJSON;
5354 private MetadataPropertyHandling metadataPropertyHandling;
5455 private Module module;
5556 private Mutable mutable;
@@ -58,7 +59,7 @@ public class Obj3 {
5859 private Newtonsoft newtonsoft;
5960 private Nil nil;
6061 private No no;
61- private Noexcept noexcept;
62+ private Goto obj3Goto;
6263 private If obj3If;
6364 private Implements obj3Implements;
6465 private Import obj3Import;
@@ -304,6 +305,11 @@ public class Obj3 {
304305 @JsonProperty("MapEntry")
305306 public void setMapEntry(MapEntry value) { this.mapEntry = value; }
306307
308+ @JsonProperty("MarshalJSON")
309+ public MarshalJSON getMarshalJSON() { return marshalJSON; }
310+ @JsonProperty("MarshalJSON")
311+ public void setMarshalJSON(MarshalJSON value) { this.marshalJSON = value; }
312+
307313 @JsonProperty("metadata_property_handling")
308314 public MetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; }
309315 @JsonProperty("metadata_property_handling")
@@ -344,10 +350,10 @@ public class Obj3 {
344350 @JsonProperty("NO")
345351 public void setNo(No value) { this.no = value; }
346352
347- @JsonProperty("noexcept")
348- public Noexcept getNoexcept() { return noexcept; }
349- @JsonProperty("noexcept")
350- public void setNoexcept(Noexcept value) { this.noexcept = value; }
353+ @JsonProperty("goto")
354+ public Goto getObj3Goto() { return obj3Goto; }
355+ @JsonProperty("goto")
356+ public void setObj3Goto(Goto value) { this.obj3Goto = value; }
351357
352358 @JsonProperty("if")
353359 public If getObj3If() { return obj3If; }
Mjavadefault / src / main / java / io / quicktype / Obj4.java+6 −6
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*;
55 public class Obj4 {
66 private long dummy;
77 private NoSuchMethod noSuchMethod;
8+ private Noexcept noexcept;
89 private Nonatomic nonatomic;
910 private NoneClass none;
1011 private Nonlocal nonlocal;
@@ -67,7 +68,6 @@ public class Obj4 {
6768 private Sbyte sbyte;
6869 private Sealed sealed;
6970 private Sel sel;
70- private Select select;
7171
7272 @JsonProperty("dummy")
7373 public long getDummy() { return dummy; }
@@ -79,6 +79,11 @@ public class Obj4 {
7979 @JsonProperty("noSuchMethod")
8080 public void setNoSuchMethod(NoSuchMethod value) { this.noSuchMethod = value; }
8181
82+ @JsonProperty("noexcept")
83+ public Noexcept getNoexcept() { return noexcept; }
84+ @JsonProperty("noexcept")
85+ public void setNoexcept(Noexcept value) { this.noexcept = value; }
86+
8287 @JsonProperty("nonatomic")
8388 public Nonatomic getNonatomic() { return nonatomic; }
8489 @JsonProperty("nonatomic")
@@ -388,9 +393,4 @@ public class Obj4 {
388393 public Sel getSel() { return sel; }
389394 @JsonProperty("SEL")
390395 public void setSel(Sel value) { this.sel = value; }
391-
392- @JsonProperty("select")
393- public Select getSelect() { return select; }
394- @JsonProperty("select")
395- public void setSelect(Select value) { this.select = value; }
396396 }
Mjavadefault / src / main / java / io / quicktype / Obj5.java+18 −12
@@ -21,6 +21,7 @@ public class Obj5 {
2121 private TypeClass obj5Type;
2222 private PrimitiveKind primitiveKind;
2323 private TrueClass purpleTrue;
24+ private Select select;
2425 private Self self;
2526 private Sendable sendable;
2627 private SerialDescriptor serialDescriptor;
@@ -49,6 +50,7 @@ public class Obj5 {
4950 private TimeOnly timeOnly;
5051 private TimeOnlyConverter timeOnlyConverter;
5152 private TimeZone timeZone;
53+ private ToDict toDict;
5254 private ToJSON toJSON;
5355 private ToString toString;
5456 private TopLevelClass topLevel;
@@ -63,11 +65,10 @@ public class Obj5 {
6365 private Unchecked unchecked;
6466 private Undefined undefined;
6567 private Union union;
68+ private UnmarshalJSON unmarshalJSON;
6669 private Unowned unowned;
6770 private Unsafe unsafe;
68- private Unsigned unsigned;
6971 private UseSerializers useSerializers;
70- private Ushort ushort;
7172
7273 @JsonProperty("dummy")
7374 public long getDummy() { return dummy; }
@@ -159,6 +160,11 @@ public class Obj5 {
159160 @JsonProperty("true")
160161 public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; }
161162
163+ @JsonProperty("select")
164+ public Select getSelect() { return select; }
165+ @JsonProperty("select")
166+ public void setSelect(Select value) { this.select = value; }
167+
162168 @JsonProperty("Self")
163169 public Self getSelf() { return self; }
164170 @JsonProperty("Self")
@@ -299,6 +305,11 @@ public class Obj5 {
299305 @JsonProperty("TimeZone")
300306 public void setTimeZone(TimeZone value) { this.timeZone = value; }
301307
308+ @JsonProperty("to_dict")
309+ public ToDict getToDict() { return toDict; }
310+ @JsonProperty("to_dict")
311+ public void setToDict(ToDict value) { this.toDict = value; }
312+
302313 @JsonProperty("to_json")
303314 public ToJSON getToJSON() { return toJSON; }
304315 @JsonProperty("to_json")
@@ -369,6 +380,11 @@ public class Obj5 {
369380 @JsonProperty("union")
370381 public void setUnion(Union value) { this.union = value; }
371382
383+ @JsonProperty("UnmarshalJSON")
384+ public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
385+ @JsonProperty("UnmarshalJSON")
386+ public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; }
387+
372388 @JsonProperty("unowned")
373389 public Unowned getUnowned() { return unowned; }
374390 @JsonProperty("unowned")
@@ -379,18 +395,8 @@ public class Obj5 {
379395 @JsonProperty("unsafe")
380396 public void setUnsafe(Unsafe value) { this.unsafe = value; }
381397
382- @JsonProperty("unsigned")
383- public Unsigned getUnsigned() { return unsigned; }
384- @JsonProperty("unsigned")
385- public void setUnsigned(Unsigned value) { this.unsigned = value; }
386-
387398 @JsonProperty("UseSerializers")
388399 public UseSerializers getUseSerializers() { return useSerializers; }
389400 @JsonProperty("UseSerializers")
390401 public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
391-
392- @JsonProperty("ushort")
393- public Ushort getUshort() { return ushort; }
394- @JsonProperty("ushort")
395- public void setUshort(Ushort value) { this.ushort = value; }
396402 }
Mjavadefault / src / main / java / io / quicktype / Obj6.java+12 −0
@@ -7,6 +7,8 @@ public class Obj6 {
77 private Void obj6Void;
88 private Volatile obj6Volatile;
99 private While obj6While;
10+ private Unsigned unsigned;
11+ private Ushort ushort;
1012 private Using using;
1113 private Utf8JSONReader utf8JSONReader;
1214 private Utf8JSONWriter utf8JSONWriter;
@@ -43,6 +45,16 @@ public class Obj6 {
4345 @JsonProperty("while")
4446 public void setObj6While(While value) { this.obj6While = value; }
4547
48+ @JsonProperty("unsigned")
49+ public Unsigned getUnsigned() { return unsigned; }
50+ @JsonProperty("unsigned")
51+ public void setUnsigned(Unsigned value) { this.unsigned = value; }
52+
53+ @JsonProperty("ushort")
54+ public Ushort getUshort() { return ushort; }
55+ @JsonProperty("ushort")
56+ public void setUshort(Ushort value) { this.ushort = value; }
57+
4658 @JsonProperty("using")
4759 public Using getUsing() { return using; }
4860 @JsonProperty("using")
Ajavadefault / src / main / java / io / quicktype / ToDict.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class ToDict {
6+ private long toDict;
7+
8+ @JsonProperty("to_dict")
9+ public long getToDict() { return toDict; }
10+ @JsonProperty("to_dict")
11+ public void setToDict(long value) { this.toDict = value; }
12+}
Ajavadefault / src / main / java / io / quicktype / UnmarshalJSON.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class UnmarshalJSON {
6+ private long unmarshalJSON;
7+
8+ @JsonProperty("UnmarshalJSON")
9+ public long getUnmarshalJSON() { return unmarshalJSON; }
10+ @JsonProperty("UnmarshalJSON")
11+ public void setUnmarshalJSON(long value) { this.unmarshalJSON = value; }
12+}
Mjavascript-prop-typesdefault / toplevel.js+45 −25
@@ -137,13 +137,13 @@ let _For;
137137 let _Foreach;
138138 let _Friend;
139139 let _From;
140+let _FromDict;
140141 let _FromJSON;
141142 let _Func;
142143 let _Function;
143144 let _Get;
144145 let _Global;
145146 let _Go;
146-let _Goto;
147147 let _Obj3;
148148 let _Hashable;
149149 let _Hasher;
@@ -162,7 +162,9 @@ let _JSONReader;
162162 let _JSONTokenType;
163163 let _Locale;
164164 let _MapEntry;
165+let _MarshalJSON;
165166 let _No;
167+let _Goto;
166168 let _Guard;
167169 let _HasOwnProperty;
168170 let _HashCode;
@@ -208,7 +210,6 @@ let _Native;
208210 let _New;
209211 let _Newtonsoft;
210212 let _Nil;
211-let _Noexcept;
212213 let _Obj4;
213214 let _NSError;
214215 let _NSObject;
@@ -220,6 +221,7 @@ let _Protocol;
220221 let _RegExp;
221222 let _Sel;
222223 let _NoSuchMethod;
224+let _Noexcept;
223225 let _Nonatomic;
224226 let _NoneClass;
225227 let _Nonlocal;
@@ -273,7 +275,6 @@ let _RuntimeType;
273275 let _S;
274276 let _Sbyte;
275277 let _Sealed;
276-let _Select;
277278 let _Obj5;
278279 let _KSerializer;
279280 let _PrimitiveKind;
@@ -292,7 +293,9 @@ let _TimeOnlyConverter;
292293 let _TimeZone;
293294 let _True;
294295 let _Type;
296+let _UnmarshalJSON;
295297 let _UseSerializers;
298+let _Select;
296299 let _SelfClass;
297300 let _Serialize;
298301 let _Set;
@@ -319,6 +322,7 @@ let _ThreadLocal;
319322 let _Throw;
320323 let _Throws;
321324 let _ToString;
325+let _ToDict;
322326 let _ToJSON;
323327 let _TopLevelClass;
324328 let _Transient;
@@ -337,13 +341,13 @@ let _Undefined;
337341 let _Union;
338342 let _Unowned;
339343 let _Unsafe;
340-let _Unsigned;
341-let _Ushort;
342344 let _Obj6;
343345 let _UUID;
344346 let _Utf8JSONReader;
345347 let _Utf8JSONWriter;
346348 let _Yes;
349+let _Unsigned;
350+let _Ushort;
347351 let _Using;
348352 let _Var;
349353 let _Virtual;
@@ -789,6 +793,9 @@ _Friend = PropTypes.shape({
789793 _From = PropTypes.shape({
790794 "from": PropTypes.oneOfType([Integer]).isRequired,
791795 });
796+_FromDict = PropTypes.shape({
797+ "from_dict": PropTypes.oneOfType([Integer]).isRequired,
798+});
792799 _FromJSON = PropTypes.shape({
793800 "from_json": PropTypes.oneOfType([Integer]).isRequired,
794801 });
@@ -807,9 +814,6 @@ _Global = PropTypes.shape({
807814 _Go = PropTypes.shape({
808815 "go": PropTypes.oneOfType([Integer]).isRequired,
809816 });
810-_Goto = PropTypes.shape({
811- "goto": PropTypes.oneOfType([Integer]).isRequired,
812-});
813817 _Obj2 = PropTypes.shape({
814818 "DateFormatter": _DateFormatter,
815819 "DateOnly": _DateOnly,
@@ -869,13 +873,13 @@ _Obj2 = PropTypes.shape({
869873 "foreach": _Foreach,
870874 "friend": _Friend,
871875 "from": _From,
876+ "from_dict": _FromDict,
872877 "from_json": _FromJSON,
873878 "func": _Func,
874879 "function": _Function,
875880 "get": _Get,
876881 "global": _Global,
877882 "go": _Go,
878- "goto": _Goto,
879883 });
880884 _Hashable = PropTypes.shape({
881885 "Hashable": PropTypes.oneOfType([Integer]).isRequired,
@@ -928,9 +932,15 @@ _Locale = PropTypes.shape({
928932 _MapEntry = PropTypes.shape({
929933 "MapEntry": PropTypes.oneOfType([Integer]).isRequired,
930934 });
935+_MarshalJSON = PropTypes.shape({
936+ "MarshalJSON": PropTypes.oneOfType([Integer]).isRequired,
937+});
931938 _No = PropTypes.shape({
932939 "NO": PropTypes.oneOfType([Integer]).isRequired,
933940 });
941+_Goto = PropTypes.shape({
942+ "goto": PropTypes.oneOfType([Integer]).isRequired,
943+});
934944 _Guard = PropTypes.shape({
935945 "guard": PropTypes.oneOfType([Integer]).isRequired,
936946 });
@@ -1066,9 +1076,6 @@ _Newtonsoft = PropTypes.shape({
10661076 _Nil = PropTypes.shape({
10671077 "nil": PropTypes.oneOfType([Integer]).isRequired,
10681078 });
1069-_Noexcept = PropTypes.shape({
1070- "noexcept": PropTypes.oneOfType([Integer]).isRequired,
1071-});
10721079 _Obj3 = PropTypes.shape({
10731080 "Hashable": _Hashable,
10741081 "Hasher": _Hasher,
@@ -1087,8 +1094,10 @@ _Obj3 = PropTypes.shape({
10871094 "JsonTokenType": _JSONTokenType,
10881095 "Locale": _Locale,
10891096 "MapEntry": _MapEntry,
1097+ "MarshalJSON": _MarshalJSON,
10901098 "NO": _No,
10911099 "dummy": PropTypes.oneOfType([Integer]).isRequired,
1100+ "goto": _Goto,
10921101 "guard": _Guard,
10931102 "hasOwnProperty": _HasOwnProperty,
10941103 "hashCode": _HashCode,
@@ -1134,7 +1143,6 @@ _Obj3 = PropTypes.shape({
11341143 "new": _New,
11351144 "newtonsoft": _Newtonsoft,
11361145 "nil": _Nil,
1137- "noexcept": _Noexcept,
11381146 });
11391147 _NSError = PropTypes.shape({
11401148 "NSError": PropTypes.oneOfType([Integer]).isRequired,
@@ -1166,6 +1174,9 @@ _Sel = PropTypes.shape({
11661174 _NoSuchMethod = PropTypes.shape({
11671175 "noSuchMethod": PropTypes.oneOfType([Integer]).isRequired,
11681176 });
1177+_Noexcept = PropTypes.shape({
1178+ "noexcept": PropTypes.oneOfType([Integer]).isRequired,
1179+});
11691180 _Nonatomic = PropTypes.shape({
11701181 "nonatomic": PropTypes.oneOfType([Integer]).isRequired,
11711182 });
@@ -1325,9 +1336,6 @@ _Sbyte = PropTypes.shape({
13251336 _Sealed = PropTypes.shape({
13261337 "sealed": PropTypes.oneOfType([Integer]).isRequired,
13271338 });
1328-_Select = PropTypes.shape({
1329- "select": PropTypes.oneOfType([Integer]).isRequired,
1330-});
13311339 _Obj4 = PropTypes.shape({
13321340 "NSError": _NSError,
13331341 "NSObject": _NSObject,
@@ -1340,6 +1348,7 @@ _Obj4 = PropTypes.shape({
13401348 "SEL": _Sel,
13411349 "dummy": PropTypes.oneOfType([Integer]).isRequired,
13421350 "noSuchMethod": _NoSuchMethod,
1351+ "noexcept": _Noexcept,
13431352 "nonatomic": _Nonatomic,
13441353 "none": _NoneClass,
13451354 "nonlocal": _Nonlocal,
@@ -1393,7 +1402,6 @@ _Obj4 = PropTypes.shape({
13931402 "s": _S,
13941403 "sbyte": _Sbyte,
13951404 "sealed": _Sealed,
1396- "select": _Select,
13971405 });
13981406 _KSerializer = PropTypes.shape({
13991407 "KSerializer": PropTypes.oneOfType([Integer]).isRequired,
@@ -1446,9 +1454,15 @@ _True = PropTypes.shape({
14461454 _Type = PropTypes.shape({
14471455 "Type": PropTypes.oneOfType([Integer]).isRequired,
14481456 });
1457+_UnmarshalJSON = PropTypes.shape({
1458+ "UnmarshalJSON": PropTypes.oneOfType([Integer]).isRequired,
1459+});
14491460 _UseSerializers = PropTypes.shape({
14501461 "UseSerializers": PropTypes.oneOfType([Integer]).isRequired,
14511462 });
1463+_Select = PropTypes.shape({
1464+ "select": PropTypes.oneOfType([Integer]).isRequired,
1465+});
14521466 _SelfClass = PropTypes.shape({
14531467 "self": PropTypes.oneOfType([Integer]).isRequired,
14541468 });
@@ -1527,6 +1541,9 @@ _Throws = PropTypes.shape({
15271541 _ToString = PropTypes.shape({
15281542 "toString": PropTypes.oneOfType([Integer]).isRequired,
15291543 });
1544+_ToDict = PropTypes.shape({
1545+ "to_dict": PropTypes.oneOfType([Integer]).isRequired,
1546+});
15301547 _ToJSON = PropTypes.shape({
15311548 "to_json": PropTypes.oneOfType([Integer]).isRequired,
15321549 });
@@ -1581,12 +1598,6 @@ _Unowned = PropTypes.shape({
15811598 _Unsafe = PropTypes.shape({
15821599 "unsafe": PropTypes.oneOfType([Integer]).isRequired,
15831600 });
1584-_Unsigned = PropTypes.shape({
1585- "unsigned": PropTypes.oneOfType([Integer]).isRequired,
1586-});
1587-_Ushort = PropTypes.shape({
1588- "ushort": PropTypes.oneOfType([Integer]).isRequired,
1589-});
15901601 _Obj5 = PropTypes.shape({
15911602 "KSerializer": _KSerializer,
15921603 "PrimitiveKind": _PrimitiveKind,
@@ -1605,8 +1616,10 @@ _Obj5 = PropTypes.shape({
16051616 "TimeZone": _TimeZone,
16061617 "True": _True,
16071618 "Type": _Type,
1619+ "UnmarshalJSON": _UnmarshalJSON,
16081620 "UseSerializers": _UseSerializers,
16091621 "dummy": PropTypes.oneOfType([Integer]).isRequired,
1622+ "select": _Select,
16101623 "self": _SelfClass,
16111624 "serialize": _Serialize,
16121625 "set": _Set,
@@ -1633,6 +1646,7 @@ _Obj5 = PropTypes.shape({
16331646 "throw": _Throw,
16341647 "throws": _Throws,
16351648 "toString": _ToString,
1649+ "to_dict": _ToDict,
16361650 "to_json": _ToJSON,
16371651 "top_level": _TopLevelClass,
16381652 "transient": _Transient,
@@ -1651,8 +1665,6 @@ _Obj5 = PropTypes.shape({
16511665 "union": _Union,
16521666 "unowned": _Unowned,
16531667 "unsafe": _Unsafe,
1654- "unsigned": _Unsigned,
1655- "ushort": _Ushort,
16561668 });
16571669 _UUID = PropTypes.shape({
16581670 "UUID": PropTypes.oneOfType([Integer]).isRequired,
@@ -1666,6 +1678,12 @@ _Utf8JSONWriter = PropTypes.shape({
16661678 _Yes = PropTypes.shape({
16671679 "YES": PropTypes.oneOfType([Integer]).isRequired,
16681680 });
1681+_Unsigned = PropTypes.shape({
1682+ "unsigned": PropTypes.oneOfType([Integer]).isRequired,
1683+});
1684+_Ushort = PropTypes.shape({
1685+ "ushort": PropTypes.oneOfType([Integer]).isRequired,
1686+});
16691687 _Using = PropTypes.shape({
16701688 "using": PropTypes.oneOfType([Integer]).isRequired,
16711689 });
@@ -1714,6 +1732,8 @@ _Obj6 = PropTypes.shape({
17141732 "Utf8JsonWriter": _Utf8JSONWriter,
17151733 "YES": _Yes,
17161734 "dummy": PropTypes.oneOfType([Integer]).isRequired,
1735+ "unsigned": _Unsigned,
1736+ "ushort": _Ushort,
17171737 "using": _Using,
17181738 "var": _Var,
17191739 "virtual": _Virtual,
Mjavascriptdefault / TopLevel.js+38 −22
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
@@ -520,13 +520,13 @@ const typeMap = {
520520 { json: "foreach", js: "foreach", typ: r("Foreach") },
521521 { json: "friend", js: "friend", typ: r("Friend") },
522522 { json: "from", js: "from", typ: r("From") },
523+ { json: "from_dict", js: "from_dict", typ: r("FromDict") },
523524 { json: "from_json", js: "from_json", typ: r("FromJSON") },
524525 { json: "func", js: "func", typ: r("Func") },
525526 { json: "function", js: "function", typ: r("Function") },
526527 { json: "get", js: "get", typ: r("Get") },
527528 { json: "global", js: "global", typ: r("Global") },
528529 { json: "go", js: "go", typ: r("Go") },
529- { json: "goto", js: "goto", typ: r("Goto") },
530530 ], false),
531531 "DateFormatter": o([
532532 { json: "DateFormatter", js: "DateFormatter", typ: i(0) },
@@ -699,6 +699,9 @@ const typeMap = {
699699 "From": o([
700700 { json: "from", js: "from", typ: i(0) },
701701 ], false),
702+ "FromDict": o([
703+ { json: "from_dict", js: "from_dict", typ: i(0) },
704+ ], false),
702705 "FromJSON": o([
703706 { json: "from_json", js: "from_json", typ: i(0) },
704707 ], false),
@@ -717,9 +720,6 @@ const typeMap = {
717720 "Go": o([
718721 { json: "go", js: "go", typ: i(0) },
719722 ], false),
720- "Goto": o([
721- { json: "goto", js: "goto", typ: i(0) },
722- ], false),
723723 "Obj3": o([
724724 { json: "Hashable", js: "Hashable", typ: r("Hashable") },
725725 { json: "Hasher", js: "Hasher", typ: r("Hasher") },
@@ -738,8 +738,10 @@ const typeMap = {
738738 { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") },
739739 { json: "Locale", js: "Locale", typ: r("Locale") },
740740 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
741+ { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
741742 { json: "NO", js: "NO", typ: r("No") },
742743 { json: "dummy", js: "dummy", typ: i(0) },
744+ { json: "goto", js: "goto", typ: r("Goto") },
743745 { json: "guard", js: "guard", typ: r("Guard") },
744746 { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") },
745747 { json: "hashCode", js: "hashCode", typ: r("HashCode") },
@@ -785,7 +787,6 @@ const typeMap = {
785787 { json: "new", js: "new", typ: r("New") },
786788 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
787789 { json: "nil", js: "nil", typ: r("Nil") },
788- { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
789790 ], false),
790791 "Hashable": o([
791792 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -838,9 +839,15 @@ const typeMap = {
838839 "MapEntry": o([
839840 { json: "MapEntry", js: "MapEntry", typ: i(0) },
840841 ], false),
842+ "MarshalJSON": o([
843+ { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
844+ ], false),
841845 "No": o([
842846 { json: "NO", js: "NO", typ: i(0) },
843847 ], false),
848+ "Goto": o([
849+ { json: "goto", js: "goto", typ: i(0) },
850+ ], false),
844851 "Guard": o([
845852 { json: "guard", js: "guard", typ: i(0) },
846853 ], false),
@@ -976,9 +983,6 @@ const typeMap = {
976983 "Nil": o([
977984 { json: "nil", js: "nil", typ: i(0) },
978985 ], false),
979- "Noexcept": o([
980- { json: "noexcept", js: "noexcept", typ: i(0) },
981- ], false),
982986 "Obj4": o([
983987 { json: "NSError", js: "NSError", typ: r("NSError") },
984988 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
@@ -991,6 +995,7 @@ const typeMap = {
991995 { json: "SEL", js: "SEL", typ: r("Sel") },
992996 { json: "dummy", js: "dummy", typ: i(0) },
993997 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
998+ { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
994999 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
9951000 { json: "none", js: "none", typ: r("NoneClass") },
9961001 { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") },
@@ -1044,7 +1049,6 @@ const typeMap = {
10441049 { json: "s", js: "s", typ: r("S") },
10451050 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
10461051 { json: "sealed", js: "sealed", typ: r("Sealed") },
1047- { json: "select", js: "select", typ: r("Select") },
10481052 ], false),
10491053 "NSError": o([
10501054 { json: "NSError", js: "NSError", typ: i(0) },
@@ -1076,6 +1080,9 @@ const typeMap = {
10761080 "NoSuchMethod": o([
10771081 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
10781082 ], false),
1083+ "Noexcept": o([
1084+ { json: "noexcept", js: "noexcept", typ: i(0) },
1085+ ], false),
10791086 "Nonatomic": o([
10801087 { json: "nonatomic", js: "nonatomic", typ: i(0) },
10811088 ], false),
@@ -1235,9 +1242,6 @@ const typeMap = {
12351242 "Sealed": o([
12361243 { json: "sealed", js: "sealed", typ: i(0) },
12371244 ], false),
1238- "Select": o([
1239- { json: "select", js: "select", typ: i(0) },
1240- ], false),
12411245 "Obj5": o([
12421246 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
12431247 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
@@ -1256,8 +1260,10 @@ const typeMap = {
12561260 { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") },
12571261 { json: "True", js: "True", typ: r("True") },
12581262 { json: "Type", js: "Type", typ: r("Type") },
1263+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
12591264 { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
12601265 { json: "dummy", js: "dummy", typ: i(0) },
1266+ { json: "select", js: "select", typ: r("Select") },
12611267 { json: "self", js: "self", typ: r("SelfClass") },
12621268 { json: "serialize", js: "serialize", typ: r("Serialize") },
12631269 { json: "set", js: "set", typ: r("Set") },
@@ -1284,6 +1290,7 @@ const typeMap = {
12841290 { json: "throw", js: "throw", typ: r("Throw") },
12851291 { json: "throws", js: "throws", typ: r("Throws") },
12861292 { json: "toString", js: "toString", typ: r("ToString") },
1293+ { json: "to_dict", js: "to_dict", typ: r("ToDict") },
12871294 { json: "to_json", js: "to_json", typ: r("ToJSON") },
12881295 { json: "top_level", js: "top_level", typ: r("TopLevelClass") },
12891296 { json: "transient", js: "transient", typ: r("Transient") },
@@ -1302,8 +1309,6 @@ const typeMap = {
13021309 { json: "union", js: "union", typ: r("Union") },
13031310 { json: "unowned", js: "unowned", typ: r("Unowned") },
13041311 { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
1305- { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
1306- { json: "ushort", js: "ushort", typ: r("Ushort") },
13071312 ], false),
13081313 "KSerializer": o([
13091314 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -1356,9 +1361,15 @@ const typeMap = {
13561361 "Type": o([
13571362 { json: "Type", js: "Type", typ: i(0) },
13581363 ], false),
1364+ "UnmarshalJSON": o([
1365+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
1366+ ], false),
13591367 "UseSerializers": o([
13601368 { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
13611369 ], false),
1370+ "Select": o([
1371+ { json: "select", js: "select", typ: i(0) },
1372+ ], false),
13621373 "SelfClass": o([
13631374 { json: "self", js: "self", typ: i(0) },
13641375 ], false),
@@ -1437,6 +1448,9 @@ const typeMap = {
14371448 "ToString": o([
14381449 { json: "toString", js: "toString", typ: i(0) },
14391450 ], false),
1451+ "ToDict": o([
1452+ { json: "to_dict", js: "to_dict", typ: i(0) },
1453+ ], false),
14401454 "ToJSON": o([
14411455 { json: "to_json", js: "to_json", typ: i(0) },
14421456 ], false),
@@ -1491,18 +1505,14 @@ const typeMap = {
14911505 "Unsafe": o([
14921506 { json: "unsafe", js: "unsafe", typ: i(0) },
14931507 ], false),
1494- "Unsigned": o([
1495- { json: "unsigned", js: "unsigned", typ: i(0) },
1496- ], false),
1497- "Ushort": o([
1498- { json: "ushort", js: "ushort", typ: i(0) },
1499- ], false),
15001508 "Obj6": o([
15011509 { json: "UUID", js: "UUID", typ: r("UUID") },
15021510 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
15031511 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
15041512 { json: "YES", js: "YES", typ: r("Yes") },
15051513 { json: "dummy", js: "dummy", typ: i(0) },
1514+ { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
1515+ { json: "ushort", js: "ushort", typ: r("Ushort") },
15061516 { json: "using", js: "using", typ: r("Using") },
15071517 { json: "var", js: "var", typ: r("Var") },
15081518 { json: "virtual", js: "virtual", typ: r("Virtual") },
@@ -1530,6 +1540,12 @@ const typeMap = {
15301540 "Yes": o([
15311541 { json: "YES", js: "YES", typ: i(0) },
15321542 ], false),
1543+ "Unsigned": o([
1544+ { json: "unsigned", js: "unsigned", typ: i(0) },
1545+ ], false),
1546+ "Ushort": o([
1547+ { json: "ushort", js: "ushort", typ: i(0) },
1548+ ], false),
15331549 "Using": o([
15341550 { json: "using", js: "using", typ: i(0) },
15351551 ], false),
Mkotlin-jacksondefault / TopLevel.kt+74 −42
@@ -740,6 +740,9 @@ data class Obj2 (
740740 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
741741 val from: From,
742742
743+ @get:JsonProperty("from_dict", required=true)@field:JsonProperty("from_dict", required=true)
744+ val fromDict: FromDict,
745+
743746 @get:JsonProperty("from_json", required=true)@field:JsonProperty("from_json", required=true)
744747 val fromJSON: FromJSON,
745748
@@ -758,9 +761,6 @@ data class Obj2 (
758761 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
759762 val go: Go,
760763
761- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
762- val goto: Goto,
763-
764764 @get:JsonProperty("do", required=true)@field:JsonProperty("do", required=true)
765765 val obj2Do: Do,
766766
@@ -1050,6 +1050,11 @@ data class From (
10501050 val from: Long
10511051 )
10521052
1053+data class FromDict (
1054+ @get:JsonProperty("from_dict", required=true)@field:JsonProperty("from_dict", required=true)
1055+ val fromDict: Long
1056+)
1057+
10531058 data class FromJSON (
10541059 @get:JsonProperty("from_json", required=true)@field:JsonProperty("from_json", required=true)
10551060 val fromJSON: Long
@@ -1080,11 +1085,6 @@ data class Go (
10801085 val go: Long
10811086 )
10821087
1083-data class Goto (
1084- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1085- val goto: Long
1086-)
1087-
10881088 data class Do (
10891089 @get:JsonProperty("do", required=true)@field:JsonProperty("do", required=true)
10901090 val doDo: Long
@@ -1114,6 +1114,9 @@ data class Obj3 (
11141114 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
11151115 val dummy: Long,
11161116
1117+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1118+ val goto: Goto,
1119+
11171120 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
11181121 val guard: Guard,
11191122
@@ -1261,6 +1264,9 @@ data class Obj3 (
12611264 @get:JsonProperty("MapEntry", required=true)@field:JsonProperty("MapEntry", required=true)
12621265 val mapEntry: MapEntry,
12631266
1267+ @get:JsonProperty("MarshalJSON", required=true)@field:JsonProperty("MarshalJSON", required=true)
1268+ val marshalJSON: MarshalJSON,
1269+
12641270 @get:JsonProperty("metadata_property_handling", required=true)@field:JsonProperty("metadata_property_handling", required=true)
12651271 val metadataPropertyHandling: MetadataPropertyHandling,
12661272
@@ -1291,9 +1297,6 @@ data class Obj3 (
12911297 @get:JsonProperty("NO", required=true)@field:JsonProperty("NO", required=true)
12921298 val no: No,
12931299
1294- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1295- val noexcept: Noexcept,
1296-
12971300 @get:JsonProperty("if", required=true)@field:JsonProperty("if", required=true)
12981301 val obj3If: If,
12991302
@@ -1307,6 +1310,11 @@ data class Obj3 (
13071310 val obj3Is: Is
13081311 )
13091312
1313+data class Goto (
1314+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1315+ val goto: Long
1316+)
1317+
13101318 data class Guard (
13111319 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
13121320 val guard: Long
@@ -1552,6 +1560,11 @@ data class MapEntry (
15521560 val mapEntry: Long
15531561 )
15541562
1563+data class MarshalJSON (
1564+ @get:JsonProperty("MarshalJSON", required=true)@field:JsonProperty("MarshalJSON", required=true)
1565+ val marshalJSON: Long
1566+)
1567+
15551568 data class MetadataPropertyHandling (
15561569 @get:JsonProperty("metadata_property_handling", required=true)@field:JsonProperty("metadata_property_handling", required=true)
15571570 val metadataPropertyHandling: Long
@@ -1602,11 +1615,6 @@ data class No (
16021615 val no: Long
16031616 )
16041617
1605-data class Noexcept (
1606- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1607- val noexcept: Long
1608-)
1609-
16101618 data class If (
16111619 @get:JsonProperty("if", required=true)@field:JsonProperty("if", required=true)
16121620 val ifIf: Long
@@ -1634,6 +1642,9 @@ data class Obj4 (
16341642 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
16351643 val noSuchMethod: NoSuchMethod,
16361644
1645+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1646+ val noexcept: Noexcept,
1647+
16371648 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
16381649 val nonatomic: Nonatomic,
16391650
@@ -1818,10 +1829,7 @@ data class Obj4 (
18181829 val sealed: Sealed,
18191830
18201831 @get:JsonProperty("SEL", required=true)@field:JsonProperty("SEL", required=true)
1821- val sel: Sel,
1822-
1823- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1824- val select: Select
1832+ val sel: Sel
18251833 )
18261834
18271835 data class NoSuchMethod (
@@ -1829,6 +1837,11 @@ data class NoSuchMethod (
18291837 val noSuchMethod: Long
18301838 )
18311839
1840+data class Noexcept (
1841+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1842+ val noexcept: Long
1843+)
1844+
18321845 data class Nonatomic (
18331846 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
18341847 val nonatomic: Long
@@ -2139,11 +2152,6 @@ data class Sel (
21392152 val sel: Long
21402153 )
21412154
2142-data class Select (
2143- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2144- val select: Long
2145-)
2146-
21472155 data class Obj5 (
21482156 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
21492157 val dummy: Long,
@@ -2184,6 +2192,9 @@ data class Obj5 (
21842192 @get:JsonProperty("true", required=true)@field:JsonProperty("true", required=true)
21852193 val purpleTrue: TrueClass,
21862194
2195+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2196+ val select: Select,
2197+
21872198 @get:JsonProperty("Self", required=true)@field:JsonProperty("Self", required=true)
21882199 val self: Self,
21892200
@@ -2286,6 +2297,9 @@ data class Obj5 (
22862297 @get:JsonProperty("TimeZone", required=true)@field:JsonProperty("TimeZone", required=true)
22872298 val timeZone: TimeZone,
22882299
2300+ @get:JsonProperty("to_dict", required=true)@field:JsonProperty("to_dict", required=true)
2301+ val toDict: ToDict,
2302+
22892303 @get:JsonProperty("to_json", required=true)@field:JsonProperty("to_json", required=true)
22902304 val toJSON: ToJSON,
22912305
@@ -2325,20 +2339,17 @@ data class Obj5 (
23252339 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
23262340 val union: Union,
23272341
2342+ @get:JsonProperty("UnmarshalJSON", required=true)@field:JsonProperty("UnmarshalJSON", required=true)
2343+ val unmarshalJSON: UnmarshalJSON,
2344+
23282345 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
23292346 val unowned: Unowned,
23302347
23312348 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
23322349 val unsafe: Unsafe,
23332350
2334- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2335- val unsigned: Unsigned,
2336-
23372351 @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true)
2338- val useSerializers: UseSerializers,
2339-
2340- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2341- val ushort: Ushort
2352+ val useSerializers: UseSerializers
23422353 )
23432354
23442355 data class KSerializer (
@@ -2401,6 +2412,11 @@ data class TrueClass (
24012412 val trueTrue: Long
24022413 )
24032414
2415+data class Select (
2416+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2417+ val select: Long
2418+)
2419+
24042420 data class Self (
24052421 @get:JsonProperty("Self", required=true)@field:JsonProperty("Self", required=true)
24062422 val self: Long
@@ -2571,6 +2587,11 @@ data class TimeZone (
25712587 val timeZone: Long
25722588 )
25732589
2590+data class ToDict (
2591+ @get:JsonProperty("to_dict", required=true)@field:JsonProperty("to_dict", required=true)
2592+ val toDict: Long
2593+)
2594+
25742595 data class ToJSON (
25752596 @get:JsonProperty("to_json", required=true)@field:JsonProperty("to_json", required=true)
25762597 val toJSON: Long
@@ -2636,6 +2657,11 @@ data class Union (
26362657 val union: Long
26372658 )
26382659
2660+data class UnmarshalJSON (
2661+ @get:JsonProperty("UnmarshalJSON", required=true)@field:JsonProperty("UnmarshalJSON", required=true)
2662+ val unmarshalJSON: Long
2663+)
2664+
26392665 data class Unowned (
26402666 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
26412667 val unowned: Long
@@ -2646,21 +2672,11 @@ data class Unsafe (
26462672 val unsafe: Long
26472673 )
26482674
2649-data class Unsigned (
2650- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2651- val unsigned: Long
2652-)
2653-
26542675 data class UseSerializers (
26552676 @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true)
26562677 val useSerializers: Long
26572678 )
26582679
2659-data class Ushort (
2660- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2661- val ushort: Long
2662-)
2663-
26642680 data class Obj6 (
26652681 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
26662682 val dummy: Long,
@@ -2671,6 +2687,12 @@ data class Obj6 (
26712687 @get:JsonProperty("while", required=true)@field:JsonProperty("while", required=true)
26722688 val obj6While: While,
26732689
2690+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2691+ val unsigned: Unsigned,
2692+
2693+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2694+ val ushort: Ushort,
2695+
26742696 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
26752697 val using: Using,
26762698
@@ -2730,6 +2752,16 @@ data class While (
27302752 val whileWhile: Long
27312753 )
27322754
2755+data class Unsigned (
2756+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2757+ val unsigned: Long
2758+)
2759+
2760+data class Ushort (
2761+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2762+ val ushort: Long
2763+)
2764+
27332765 data class Using (
27342766 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
27352767 val using: Long
Mkotlindefault / TopLevel.kt+61 −30
@@ -542,6 +542,9 @@ data class Obj2 (
542542 val friend: Friend,
543543 val from: From,
544544
545+ @Json(name = "from_dict")
546+ val fromDict: FromDict,
547+
545548 @Json(name = "from_json")
546549 val fromJSON: FromJSON,
547550
@@ -550,7 +553,6 @@ data class Obj2 (
550553 val get: Get,
551554 val global: Global,
552555 val go: Go,
553- val goto: Goto,
554556
555557 @Json(name = "do")
556558 val obj2Do: Do,
@@ -804,6 +806,11 @@ data class From (
804806 val from: Long
805807 )
806808
809+data class FromDict (
810+ @Json(name = "from_dict")
811+ val fromDict: Long
812+)
813+
807814 data class FromJSON (
808815 @Json(name = "from_json")
809816 val fromJSON: Long
@@ -829,10 +836,6 @@ data class Go (
829836 val go: Long
830837 )
831838
832-data class Goto (
833- val goto: Long
834-)
835-
836839 data class Do (
837840 @Json(name = "do")
838841 val doDo: Long
@@ -860,6 +863,7 @@ data class FalseClass (
860863
861864 data class Obj3 (
862865 val dummy: Long,
866+ val goto: Goto,
863867 val guard: Guard,
864868 val hasOwnProperty: HasOwnProperty,
865869 val hashCode: HashCode,
@@ -957,6 +961,9 @@ data class Obj3 (
957961 @Json(name = "MapEntry")
958962 val mapEntry: MapEntry,
959963
964+ @Json(name = "MarshalJSON")
965+ val marshalJSON: MarshalJSON,
966+
960967 @Json(name = "metadata_property_handling")
961968 val metadataPropertyHandling: MetadataPropertyHandling,
962969
@@ -972,8 +979,6 @@ data class Obj3 (
972979 @Json(name = "NO")
973980 val no: No,
974981
975- val noexcept: Noexcept,
976-
977982 @Json(name = "if")
978983 val obj3If: If,
979984
@@ -987,6 +992,10 @@ data class Obj3 (
987992 val obj3Is: Is
988993 )
989994
995+data class Goto (
996+ val goto: Long
997+)
998+
990999 data class Guard (
9911000 val guard: Long
9921001 )
@@ -1204,6 +1213,11 @@ data class MapEntry (
12041213 val mapEntry: Long
12051214 )
12061215
1216+data class MarshalJSON (
1217+ @Json(name = "MarshalJSON")
1218+ val marshalJSON: Long
1219+)
1220+
12071221 data class MetadataPropertyHandling (
12081222 @Json(name = "metadata_property_handling")
12091223 val metadataPropertyHandling: Long
@@ -1246,10 +1260,6 @@ data class No (
12461260 val no: Long
12471261 )
12481262
1249-data class Noexcept (
1250- val noexcept: Long
1251-)
1252-
12531263 data class If (
12541264 @Json(name = "if")
12551265 val ifIf: Long
@@ -1273,6 +1283,7 @@ data class Is (
12731283 data class Obj4 (
12741284 val dummy: Long,
12751285 val noSuchMethod: NoSuchMethod,
1286+ val noexcept: Noexcept,
12761287 val nonatomic: Nonatomic,
12771288
12781289 @Json(name = "None")
@@ -1377,15 +1388,17 @@ data class Obj4 (
13771388 val sealed: Sealed,
13781389
13791390 @Json(name = "SEL")
1380- val sel: Sel,
1381-
1382- val select: Select
1391+ val sel: Sel
13831392 )
13841393
13851394 data class NoSuchMethod (
13861395 val noSuchMethod: Long
13871396 )
13881397
1398+data class Noexcept (
1399+ val noexcept: Long
1400+)
1401+
13891402 data class Nonatomic (
13901403 val nonatomic: Long
13911404 )
@@ -1650,10 +1663,6 @@ data class Sel (
16501663 val sel: Long
16511664 )
16521665
1653-data class Select (
1654- val select: Long
1655-)
1656-
16571666 data class Obj5 (
16581667 val dummy: Long,
16591668
@@ -1693,6 +1702,8 @@ data class Obj5 (
16931702 @Json(name = "true")
16941703 val purpleTrue: TrueClass,
16951704
1705+ val select: Select,
1706+
16961707 @Json(name = "Self")
16971708 val self: Self,
16981709
@@ -1765,6 +1776,9 @@ data class Obj5 (
17651776 @Json(name = "TimeZone")
17661777 val timeZone: TimeZone,
17671778
1779+ @Json(name = "to_dict")
1780+ val toDict: ToDict,
1781+
17681782 @Json(name = "to_json")
17691783 val toJSON: ToJSON,
17701784
@@ -1786,14 +1800,15 @@ data class Obj5 (
17861800 val unchecked: Unchecked,
17871801 val undefined: Undefined,
17881802 val union: Union,
1803+
1804+ @Json(name = "UnmarshalJSON")
1805+ val unmarshalJSON: UnmarshalJSON,
1806+
17891807 val unowned: Unowned,
17901808 val unsafe: Unsafe,
1791- val unsigned: Unsigned,
17921809
17931810 @Json(name = "UseSerializers")
1794- val useSerializers: UseSerializers,
1795-
1796- val ushort: Ushort
1811+ val useSerializers: UseSerializers
17971812 )
17981813
17991814 data class KSerializer (
@@ -1854,6 +1869,10 @@ data class TrueClass (
18541869 val trueTrue: Long
18551870 )
18561871
1872+data class Select (
1873+ val select: Long
1874+)
1875+
18571876 data class Self (
18581877 @Json(name = "Self")
18591878 val self: Long
@@ -2006,6 +2025,11 @@ data class TimeZone (
20062025 val timeZone: Long
20072026 )
20082027
2028+data class ToDict (
2029+ @Json(name = "to_dict")
2030+ val toDict: Long
2031+)
2032+
20092033 data class ToJSON (
20102034 @Json(name = "to_json")
20112035 val toJSON: Long
@@ -2061,6 +2085,11 @@ data class Union (
20612085 val union: Long
20622086 )
20632087
2088+data class UnmarshalJSON (
2089+ @Json(name = "UnmarshalJSON")
2090+ val unmarshalJSON: Long
2091+)
2092+
20642093 data class Unowned (
20652094 val unowned: Long
20662095 )
@@ -2069,19 +2098,11 @@ data class Unsafe (
20692098 val unsafe: Long
20702099 )
20712100
2072-data class Unsigned (
2073- val unsigned: Long
2074-)
2075-
20762101 data class UseSerializers (
20772102 @Json(name = "UseSerializers")
20782103 val useSerializers: Long
20792104 )
20802105
2081-data class Ushort (
2082- val ushort: Long
2083-)
2084-
20852106 data class Obj6 (
20862107 val dummy: Long,
20872108
@@ -2091,6 +2112,8 @@ data class Obj6 (
20912112 @Json(name = "while")
20922113 val obj6While: While,
20932114
2115+ val unsigned: Unsigned,
2116+ val ushort: Ushort,
20942117 val using: Using,
20952118
20962119 @Json(name = "Utf8JsonReader")
@@ -2134,6 +2157,14 @@ data class While (
21342157 val whileWhile: Long
21352158 )
21362159
2160+data class Unsigned (
2161+ val unsigned: Long
2162+)
2163+
2164+data class Ushort (
2165+ val ushort: Long
2166+)
2167+
21372168 data class Using (
21382169 val using: Long
21392170 )
Mkotlinxdefault / TopLevel.kt+70 −35
@@ -597,6 +597,9 @@ data class Obj2 (
597597 val friend: Friend,
598598 val from: From,
599599
600+ @SerialName("from_dict")
601+ val fromDict: FromDict,
602+
600603 @SerialName("from_json")
601604 val fromJSON: FromJSON,
602605
@@ -605,7 +608,6 @@ data class Obj2 (
605608 val get: Get,
606609 val global: Global,
607610 val go: Go,
608- val goto: Goto,
609611
610612 @SerialName("do")
611613 val obj2Do: Do,
@@ -904,6 +906,12 @@ data class From (
904906 val from: Long
905907 )
906908
909+@Serializable
910+data class FromDict (
911+ @SerialName("from_dict")
912+ val fromDict: Long
913+)
914+
907915 @Serializable
908916 data class FromJSON (
909917 @SerialName("from_json")
@@ -935,11 +943,6 @@ data class Go (
935943 val go: Long
936944 )
937945
938-@Serializable
939-data class Goto (
940- val goto: Long
941-)
942-
943946 @Serializable
944947 data class Do (
945948 @SerialName("do")
@@ -973,6 +976,7 @@ data class FalseClass (
973976 @Serializable
974977 data class Obj3 (
975978 val dummy: Long,
979+ val goto: Goto,
976980 val guard: Guard,
977981 val hasOwnProperty: HasOwnProperty,
978982 val hashCode: HashCode,
@@ -1070,6 +1074,9 @@ data class Obj3 (
10701074 @SerialName("MapEntry")
10711075 val mapEntry: MapEntry,
10721076
1077+ @SerialName("MarshalJSON")
1078+ val marshalJSON: MarshalJSON,
1079+
10731080 @SerialName("metadata_property_handling")
10741081 val metadataPropertyHandling: MetadataPropertyHandling,
10751082
@@ -1085,8 +1092,6 @@ data class Obj3 (
10851092 @SerialName("NO")
10861093 val no: No,
10871094
1088- val noexcept: Noexcept,
1089-
10901095 @SerialName("if")
10911096 val obj3If: If,
10921097
@@ -1100,6 +1105,11 @@ data class Obj3 (
11001105 val obj3Is: Is
11011106 )
11021107
1108+@Serializable
1109+data class Goto (
1110+ val goto: Long
1111+)
1112+
11031113 @Serializable
11041114 data class Guard (
11051115 val guard: Long
@@ -1366,6 +1376,12 @@ data class MapEntry (
13661376 val mapEntry: Long
13671377 )
13681378
1379+@Serializable
1380+data class MarshalJSON (
1381+ @SerialName("MarshalJSON")
1382+ val marshalJSON: Long
1383+)
1384+
13691385 @Serializable
13701386 data class MetadataPropertyHandling (
13711387 @SerialName("metadata_property_handling")
@@ -1418,11 +1434,6 @@ data class No (
14181434 val no: Long
14191435 )
14201436
1421-@Serializable
1422-data class Noexcept (
1423- val noexcept: Long
1424-)
1425-
14261437 @Serializable
14271438 data class If (
14281439 @SerialName("if")
@@ -1451,6 +1462,7 @@ data class Is (
14511462 data class Obj4 (
14521463 val dummy: Long,
14531464 val noSuchMethod: NoSuchMethod,
1465+ val noexcept: Noexcept,
14541466 val nonatomic: Nonatomic,
14551467
14561468 @SerialName("None")
@@ -1555,9 +1567,7 @@ data class Obj4 (
15551567 val sealed: Sealed,
15561568
15571569 @SerialName("SEL")
1558- val sel: Sel,
1559-
1560- val select: Select
1570+ val sel: Sel
15611571 )
15621572
15631573 @Serializable
@@ -1565,6 +1575,11 @@ data class NoSuchMethod (
15651575 val noSuchMethod: Long
15661576 )
15671577
1578+@Serializable
1579+data class Noexcept (
1580+ val noexcept: Long
1581+)
1582+
15681583 @Serializable
15691584 data class Nonatomic (
15701585 val nonatomic: Long
@@ -1891,11 +1906,6 @@ data class Sel (
18911906 val sel: Long
18921907 )
18931908
1894-@Serializable
1895-data class Select (
1896- val select: Long
1897-)
1898-
18991909 @Serializable
19001910 data class Obj5 (
19011911 val dummy: Long,
@@ -1936,6 +1946,8 @@ data class Obj5 (
19361946 @SerialName("true")
19371947 val purpleTrue: TrueClass,
19381948
1949+ val select: Select,
1950+
19391951 @SerialName("Self")
19401952 val self: Self,
19411953
@@ -2008,6 +2020,9 @@ data class Obj5 (
20082020 @SerialName("TimeZone")
20092021 val timeZone: TimeZone,
20102022
2023+ @SerialName("to_dict")
2024+ val toDict: ToDict,
2025+
20112026 @SerialName("to_json")
20122027 val toJSON: ToJSON,
20132028
@@ -2029,14 +2044,15 @@ data class Obj5 (
20292044 val unchecked: Unchecked,
20302045 val undefined: Undefined,
20312046 val union: Union,
2047+
2048+ @SerialName("UnmarshalJSON")
2049+ val unmarshalJSON: UnmarshalJSON,
2050+
20322051 val unowned: Unowned,
20332052 val unsafe: Unsafe,
2034- val unsigned: Unsigned,
20352053
20362054 @SerialName("UseSerializers")
2037- val useSerializers: UseSerializersClass,
2038-
2039- val ushort: Ushort
2055+ val useSerializers: UseSerializersClass
20402056 )
20412057
20422058 @Serializable
@@ -2109,6 +2125,11 @@ data class TrueClass (
21092125 val trueTrue: Long
21102126 )
21112127
2128+@Serializable
2129+data class Select (
2130+ val select: Long
2131+)
2132+
21122133 @Serializable
21132134 data class Self (
21142135 @SerialName("Self")
@@ -2295,6 +2316,12 @@ data class TimeZone (
22952316 val timeZone: Long
22962317 )
22972318
2319+@Serializable
2320+data class ToDict (
2321+ @SerialName("to_dict")
2322+ val toDict: Long
2323+)
2324+
22982325 @Serializable
22992326 data class ToJSON (
23002327 @SerialName("to_json")
@@ -2363,6 +2390,12 @@ data class Union (
23632390 val union: Long
23642391 )
23652392
2393+@Serializable
2394+data class UnmarshalJSON (
2395+ @SerialName("UnmarshalJSON")
2396+ val unmarshalJSON: Long
2397+)
2398+
23662399 @Serializable
23672400 data class Unowned (
23682401 val unowned: Long
@@ -2373,22 +2406,12 @@ data class Unsafe (
23732406 val unsafe: Long
23742407 )
23752408
2376-@Serializable
2377-data class Unsigned (
2378- val unsigned: Long
2379-)
2380-
23812409 @Serializable
23822410 data class UseSerializersClass (
23832411 @SerialName("UseSerializers")
23842412 val useSerializers: Long
23852413 )
23862414
2387-@Serializable
2388-data class Ushort (
2389- val ushort: Long
2390-)
2391-
23922415 @Serializable
23932416 data class Obj6 (
23942417 val dummy: Long,
@@ -2399,6 +2422,8 @@ data class Obj6 (
23992422 @SerialName("while")
24002423 val obj6While: While,
24012424
2425+ val unsigned: Unsigned,
2426+ val ushort: Ushort,
24022427 val using: Using,
24032428
24042429 @SerialName("Utf8JsonReader")
@@ -2444,6 +2469,16 @@ data class While (
24442469 val whileWhile: Long
24452470 )
24462471
2472+@Serializable
2473+data class Unsigned (
2474+ val unsigned: Long
2475+)
2476+
2477+@Serializable
2478+data class Ushort (
2479+ val ushort: Long
2480+)
2481+
24472482 @Serializable
24482483 data class Using (
24492484 val using: Long
Mobjective-cdefault / QTTopLevel.h+52 −28
@@ -120,6 +120,7 @@
120120 @class QTFormatException;
121121 @class QTFriend;
122122 @class QTFrom;
123+@class QTFromDict;
123124 @class QTFromJSON;
124125 @class QTFunc;
125126 @class QTFunction;
@@ -135,7 +136,6 @@
135136 @class QTFalse;
136137 @class QTFloat;
137138 @class QTFor;
138-@class QTGoto;
139139 @class QTFalseClass;
140140 @class QTObj3;
141141 @class QTGuard;
@@ -185,6 +185,7 @@
185185 @class QTLock;
186186 @class QTMap;
187187 @class QTMapEntry;
188+@class QTMarshalJSON;
188189 @class QTMetadataPropertyHandling;
189190 @class QTModule;
190191 @class QTMutable;
@@ -193,7 +194,7 @@
193194 @class QTNative;
194195 @class QTNewtonsoft;
195196 @class QTNo;
196-@class QTNoexcept;
197+@class QTGoto;
197198 @class QTIf;
198199 @class QTInline;
199200 @class QTInt;
@@ -204,6 +205,7 @@
204205 @class QTNew;
205206 @class QTObj4;
206207 @class QTNoSuchMethod;
208+@class QTNoexcept;
207209 @class QTNone;
208210 @class QTNonlocal;
209211 @class QTNonmutating;
@@ -266,7 +268,6 @@
266268 @class QTSbyte;
267269 @class QTSealed;
268270 @class QTSel;
269-@class QTSelect;
270271 @class QTObj5;
271272 @class QTKSerializer;
272273 @class QTSelfClass;
@@ -281,8 +282,8 @@
281282 @class QTTypedef;
282283 @class QTTypeof;
283284 @class QTUnion;
284-@class QTUnsigned;
285285 @class QTPrimitiveKind;
286+@class QTSelect;
286287 @class QTSelf;
287288 @class QTSendable;
288289 @class QTSerialDescriptor;
@@ -315,6 +316,7 @@
315316 @class QTTimeOnly;
316317 @class QTTimeOnlyConverter;
317318 @class QTTimeZone;
319+@class QTToDict;
318320 @class QTToJSON;
319321 @class QTToString;
320322 @class QTTopLevelClass;
@@ -328,14 +330,16 @@
328330 @class QTUlong;
329331 @class QTUnchecked;
330332 @class QTUndefined;
333+@class QTUnmarshalJSON;
331334 @class QTUnowned;
332335 @class QTUnsafe;
333336 @class QTUseSerializers;
334-@class QTUshort;
335337 @class QTObj6;
338+@class QTUnsigned;
336339 @class QTVoid;
337340 @class QTVolatile;
338341 @class QTWhile;
342+@class QTUshort;
339343 @class QTUsing;
340344 @class QTUtf8JSONReader;
341345 @class QTUtf8JSONWriter;
@@ -760,6 +764,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
760764 @property (nonatomic, strong) QTFormatException *formatException;
761765 @property (nonatomic, strong) QTFriend *friend;
762766 @property (nonatomic, strong) QTFrom *from;
767+@property (nonatomic, strong) QTFromDict *fromDict;
763768 @property (nonatomic, strong) QTFromJSON *fromJSON;
764769 @property (nonatomic, strong) QTFunc *func;
765770 @property (nonatomic, strong) QTFunction *function;
@@ -775,7 +780,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
775780 @property (nonatomic, strong) QTFalse *obj2False;
776781 @property (nonatomic, strong) QTFloat *obj2Float;
777782 @property (nonatomic, strong) QTFor *obj2For;
778-@property (nonatomic, strong) QTGoto *obj2Goto;
779783 @property (nonatomic, strong) QTFalseClass *theFalse;
780784 @end
781785
@@ -967,6 +971,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
967971 @property (nonatomic, assign) NSInteger from;
968972 @end
969973
974+@interface QTFromDict : NSObject
975+@property (nonatomic, assign) NSInteger fromDict;
976+@end
977+
970978 @interface QTFromJSON : NSObject
971979 @property (nonatomic, assign) NSInteger fromJSON;
972980 @end
@@ -1027,10 +1035,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
10271035 @property (nonatomic, assign) NSInteger forFor;
10281036 @end
10291037
1030-@interface QTGoto : NSObject
1031-@property (nonatomic, assign) NSInteger gotoGoto;
1032-@end
1033-
10341038 @interface QTFalseClass : NSObject
10351039 @property (nonatomic, assign) NSInteger falseFalse;
10361040 @end
@@ -1084,6 +1088,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
10841088 @property (nonatomic, strong) QTLock *lock;
10851089 @property (nonatomic, strong) QTMap *map;
10861090 @property (nonatomic, strong) QTMapEntry *mapEntry;
1091+@property (nonatomic, strong) QTMarshalJSON *marshalJSON;
10871092 @property (nonatomic, strong) QTMetadataPropertyHandling *metadataPropertyHandling;
10881093 @property (nonatomic, strong) QTModule *module;
10891094 @property (nonatomic, strong) QTMutable *mutable;
@@ -1092,7 +1097,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
10921097 @property (nonatomic, strong) QTNative *native;
10931098 @property (nonatomic, strong) QTNewtonsoft *newtonsoft;
10941099 @property (nonatomic, strong) QTNo *no;
1095-@property (nonatomic, strong) QTNoexcept *noexcept;
1100+@property (nonatomic, strong) QTGoto *obj3Goto;
10961101 @property (nonatomic, strong) QTIf *obj3If;
10971102 @property (nonatomic, strong) QTInline *obj3Inline;
10981103 @property (nonatomic, strong) QTInt *obj3Int;
@@ -1291,6 +1296,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
12911296 @property (nonatomic, assign) NSInteger mapEntry;
12921297 @end
12931298
1299+@interface QTMarshalJSON : NSObject
1300+@property (nonatomic, assign) NSInteger marshalJSON;
1301+@end
1302+
12941303 @interface QTMetadataPropertyHandling : NSObject
12951304 @property (nonatomic, assign) NSInteger metadataPropertyHandling;
12961305 @end
@@ -1323,8 +1332,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
13231332 @property (nonatomic, assign) NSInteger no;
13241333 @end
13251334
1326-@interface QTNoexcept : NSObject
1327-@property (nonatomic, assign) NSInteger noexcept;
1335+@interface QTGoto : NSObject
1336+@property (nonatomic, assign) NSInteger gotoGoto;
13281337 @end
13291338
13301339 @interface QTIf : NSObject
@@ -1362,6 +1371,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
13621371 @interface QTObj4 : NSObject
13631372 @property (nonatomic, assign) NSInteger dummy;
13641373 @property (nonatomic, strong) QTNoSuchMethod *noSuchMethod;
1374+@property (nonatomic, strong) QTNoexcept *noexcept;
13651375 @property (nonatomic, strong) QTNone *none;
13661376 @property (nonatomic, strong) QTNonlocal *nonlocal;
13671377 @property (nonatomic, strong) QTNonmutating *nonmutating;
@@ -1424,13 +1434,16 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
14241434 @property (nonatomic, strong) QTSbyte *sbyte;
14251435 @property (nonatomic, strong) QTSealed *sealed;
14261436 @property (nonatomic, strong) QTSel *sel;
1427-@property (nonatomic, strong) QTSelect *select;
14281437 @end
14291438
14301439 @interface QTNoSuchMethod : NSObject
14311440 @property (nonatomic, assign) NSInteger noSuchMethod;
14321441 @end
14331442
1443+@interface QTNoexcept : NSObject
1444+@property (nonatomic, assign) NSInteger noexcept;
1445+@end
1446+
14341447 @interface QTNone : NSObject
14351448 @property (nonatomic, assign) NSInteger none;
14361449 @end
@@ -1679,10 +1692,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
16791692 @property (nonatomic, assign) NSInteger sel;
16801693 @end
16811694
1682-@interface QTSelect : NSObject
1683-@property (nonatomic, assign) NSInteger select;
1684-@end
1685-
16861695 @interface QTObj5 : NSObject
16871696 @property (nonatomic, assign) NSInteger dummy;
16881697 @property (nonatomic, strong) QTKSerializer *kSerializer;
@@ -1698,8 +1707,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
16981707 @property (nonatomic, strong) QTTypedef *obj5Typedef;
16991708 @property (nonatomic, strong) QTTypeof *obj5Typeof;
17001709 @property (nonatomic, strong) QTUnion *obj5Union;
1701-@property (nonatomic, strong) QTUnsigned *obj5Unsigned;
17021710 @property (nonatomic, strong) QTPrimitiveKind *primitiveKind;
1711+@property (nonatomic, strong) QTSelect *select;
17031712 @property (nonatomic, strong) QTSelf *self;
17041713 @property (nonatomic, strong) QTSendable *sendable;
17051714 @property (nonatomic, strong) QTSerialDescriptor *serialDescriptor;
@@ -1732,6 +1741,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
17321741 @property (nonatomic, strong) QTTimeOnly *timeOnly;
17331742 @property (nonatomic, strong) QTTimeOnlyConverter *timeOnlyConverter;
17341743 @property (nonatomic, strong) QTTimeZone *timeZone;
1744+@property (nonatomic, strong) QTToDict *toDict;
17351745 @property (nonatomic, strong) QTToJSON *toJSON;
17361746 @property (nonatomic, strong) QTToString *toString;
17371747 @property (nonatomic, strong) QTTopLevelClass *topLevel;
@@ -1745,10 +1755,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
17451755 @property (nonatomic, strong) QTUlong *ulong;
17461756 @property (nonatomic, strong) QTUnchecked *unchecked;
17471757 @property (nonatomic, strong) QTUndefined *undefined;
1758+@property (nonatomic, strong) QTUnmarshalJSON *unmarshalJSON;
17481759 @property (nonatomic, strong) QTUnowned *unowned;
17491760 @property (nonatomic, strong) QTUnsafe *unsafe;
17501761 @property (nonatomic, strong) QTUseSerializers *useSerializers;
1751-@property (nonatomic, strong) QTUshort *ushort;
17521762 @end
17531763
17541764 @interface QTKSerializer : NSObject
@@ -1803,14 +1813,14 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
18031813 @property (nonatomic, assign) NSInteger unionUnion;
18041814 @end
18051815
1806-@interface QTUnsigned : NSObject
1807-@property (nonatomic, assign) NSInteger unsignedUnsigned;
1808-@end
1809-
18101816 @interface QTPrimitiveKind : NSObject
18111817 @property (nonatomic, assign) NSInteger primitiveKind;
18121818 @end
18131819
1820+@interface QTSelect : NSObject
1821+@property (nonatomic, assign) NSInteger select;
1822+@end
1823+
18141824 @interface QTSelf : NSObject
18151825 @property (nonatomic, assign) NSInteger self;
18161826 @end
@@ -1939,6 +1949,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
19391949 @property (nonatomic, assign) NSInteger timeZone;
19401950 @end
19411951
1952+@interface QTToDict : NSObject
1953+@property (nonatomic, assign) NSInteger toDict;
1954+@end
1955+
19421956 @interface QTToJSON : NSObject
19431957 @property (nonatomic, assign) NSInteger toJSON;
19441958 @end
@@ -1991,6 +2005,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
19912005 @property (nonatomic, assign) NSInteger undefined;
19922006 @end
19932007
2008+@interface QTUnmarshalJSON : NSObject
2009+@property (nonatomic, assign) NSInteger unmarshalJSON;
2010+@end
2011+
19942012 @interface QTUnowned : NSObject
19952013 @property (nonatomic, assign) NSInteger unowned;
19962014 @end
@@ -2003,15 +2021,13 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
20032021 @property (nonatomic, assign) NSInteger useSerializers;
20042022 @end
20052023
2006-@interface QTUshort : NSObject
2007-@property (nonatomic, assign) NSInteger ushort;
2008-@end
2009-
20102024 @interface QTObj6 : NSObject
20112025 @property (nonatomic, assign) NSInteger dummy;
2026+@property (nonatomic, strong) QTUnsigned *obj6Unsigned;
20122027 @property (nonatomic, strong) QTVoid *obj6Void;
20132028 @property (nonatomic, strong) QTVolatile *obj6Volatile;
20142029 @property (nonatomic, strong) QTWhile *obj6While;
2030+@property (nonatomic, strong) QTUshort *ushort;
20152031 @property (nonatomic, strong) QTUsing *using;
20162032 @property (nonatomic, strong) QTUtf8JSONReader *utf8JSONReader;
20172033 @property (nonatomic, strong) QTUtf8JSONWriter *utf8JSONWriter;
@@ -2029,6 +2045,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
20292045 @property (nonatomic, strong) QTYield *yield;
20302046 @end
20312047
2048+@interface QTUnsigned : NSObject
2049+@property (nonatomic, assign) NSInteger unsignedUnsigned;
2050+@end
2051+
20322052 @interface QTVoid : NSObject
20332053 @property (nonatomic, assign) NSInteger voidVoid;
20342054 @end
@@ -2041,6 +2061,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
20412061 @property (nonatomic, assign) NSInteger whileWhile;
20422062 @end
20432063
2064+@interface QTUshort : NSObject
2065+@property (nonatomic, assign) NSInteger ushort;
2066+@end
2067+
20442068 @interface QTUsing : NSObject
20452069 @property (nonatomic, assign) NSInteger using;
20462070 @end
Mobjective-cdefault / QTTopLevel.m+481 −233
@@ -578,6 +578,11 @@ NS_ASSUME_NONNULL_BEGIN
578578 - (NSDictionary *)JSONDictionary;
579579 @end
580580
581+@interface QTFromDict (JSONConversion)
582++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
583+- (NSDictionary *)JSONDictionary;
584+@end
585+
581586 @interface QTFromJSON (JSONConversion)
582587 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
583588 - (NSDictionary *)JSONDictionary;
@@ -653,11 +658,6 @@ NS_ASSUME_NONNULL_BEGIN
653658 - (NSDictionary *)JSONDictionary;
654659 @end
655660
656-@interface QTGoto (JSONConversion)
657-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
658-- (NSDictionary *)JSONDictionary;
659-@end
660-
661661 @interface QTFalseClass (JSONConversion)
662662 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
663663 - (NSDictionary *)JSONDictionary;
@@ -903,6 +903,11 @@ NS_ASSUME_NONNULL_BEGIN
903903 - (NSDictionary *)JSONDictionary;
904904 @end
905905
906+@interface QTMarshalJSON (JSONConversion)
907++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
908+- (NSDictionary *)JSONDictionary;
909+@end
910+
906911 @interface QTMetadataPropertyHandling (JSONConversion)
907912 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
908913 - (NSDictionary *)JSONDictionary;
@@ -943,7 +948,7 @@ NS_ASSUME_NONNULL_BEGIN
943948 - (NSDictionary *)JSONDictionary;
944949 @end
945950
946-@interface QTNoexcept (JSONConversion)
951+@interface QTGoto (JSONConversion)
947952 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
948953 - (NSDictionary *)JSONDictionary;
949954 @end
@@ -998,6 +1003,11 @@ NS_ASSUME_NONNULL_BEGIN
9981003 - (NSDictionary *)JSONDictionary;
9991004 @end
10001005
1006+@interface QTNoexcept (JSONConversion)
1007++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1008+- (NSDictionary *)JSONDictionary;
1009+@end
1010+
10011011 @interface QTNone (JSONConversion)
10021012 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
10031013 - (NSDictionary *)JSONDictionary;
@@ -1308,11 +1318,6 @@ NS_ASSUME_NONNULL_BEGIN
13081318 - (NSDictionary *)JSONDictionary;
13091319 @end
13101320
1311-@interface QTSelect (JSONConversion)
1312-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1313-- (NSDictionary *)JSONDictionary;
1314-@end
1315-
13161321 @interface QTObj5 (JSONConversion)
13171322 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
13181323 - (NSDictionary *)JSONDictionary;
@@ -1383,12 +1388,12 @@ NS_ASSUME_NONNULL_BEGIN
13831388 - (NSDictionary *)JSONDictionary;
13841389 @end
13851390
1386-@interface QTUnsigned (JSONConversion)
1391+@interface QTPrimitiveKind (JSONConversion)
13871392 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
13881393 - (NSDictionary *)JSONDictionary;
13891394 @end
13901395
1391-@interface QTPrimitiveKind (JSONConversion)
1396+@interface QTSelect (JSONConversion)
13921397 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
13931398 - (NSDictionary *)JSONDictionary;
13941399 @end
@@ -1553,6 +1558,11 @@ NS_ASSUME_NONNULL_BEGIN
15531558 - (NSDictionary *)JSONDictionary;
15541559 @end
15551560
1561+@interface QTToDict (JSONConversion)
1562++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1563+- (NSDictionary *)JSONDictionary;
1564+@end
1565+
15561566 @interface QTToJSON (JSONConversion)
15571567 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
15581568 - (NSDictionary *)JSONDictionary;
@@ -1618,6 +1628,11 @@ NS_ASSUME_NONNULL_BEGIN
16181628 - (NSDictionary *)JSONDictionary;
16191629 @end
16201630
1631+@interface QTUnmarshalJSON (JSONConversion)
1632++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1633+- (NSDictionary *)JSONDictionary;
1634+@end
1635+
16211636 @interface QTUnowned (JSONConversion)
16221637 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16231638 - (NSDictionary *)JSONDictionary;
@@ -1633,12 +1648,12 @@ NS_ASSUME_NONNULL_BEGIN
16331648 - (NSDictionary *)JSONDictionary;
16341649 @end
16351650
1636-@interface QTUshort (JSONConversion)
1651+@interface QTObj6 (JSONConversion)
16371652 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16381653 - (NSDictionary *)JSONDictionary;
16391654 @end
16401655
1641-@interface QTObj6 (JSONConversion)
1656+@interface QTUnsigned (JSONConversion)
16421657 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16431658 - (NSDictionary *)JSONDictionary;
16441659 @end
@@ -1658,6 +1673,11 @@ NS_ASSUME_NONNULL_BEGIN
16581673 - (NSDictionary *)JSONDictionary;
16591674 @end
16601675
1676+@interface QTUshort (JSONConversion)
1677++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1678+- (NSDictionary *)JSONDictionary;
1679+@end
1680+
16611681 @interface QTUsing (JSONConversion)
16621682 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16631683 - (NSDictionary *)JSONDictionary;
@@ -5331,6 +5351,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
53315351 @"FormatException": @"formatException",
53325352 @"friend": @"friend",
53335353 @"from": @"from",
5354+ @"from_dict": @"fromDict",
53345355 @"from_json": @"fromJSON",
53355356 @"func": @"func",
53365357 @"function": @"function",
@@ -5346,7 +5367,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
53465367 @"False": @"obj2False",
53475368 @"float": @"obj2Float",
53485369 @"for": @"obj2For",
5349- @"goto": @"obj2Goto",
53505370 @"false": @"theFalse",
53515371 };
53525372 }
@@ -5408,6 +5428,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
54085428 if (![dict[@"FormatException"] isKindOfClass:NSDictionary.class]) return nil;
54095429 if (![dict[@"friend"] isKindOfClass:NSDictionary.class]) return nil;
54105430 if (![dict[@"from"] isKindOfClass:NSDictionary.class]) return nil;
5431+ if (![dict[@"from_dict"] isKindOfClass:NSDictionary.class]) return nil;
54115432 if (![dict[@"from_json"] isKindOfClass:NSDictionary.class]) return nil;
54125433 if (![dict[@"func"] isKindOfClass:NSDictionary.class]) return nil;
54135434 if (![dict[@"function"] isKindOfClass:NSDictionary.class]) return nil;
@@ -5423,7 +5444,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
54235444 if (![dict[@"False"] isKindOfClass:NSDictionary.class]) return nil;
54245445 if (![dict[@"float"] isKindOfClass:NSDictionary.class]) return nil;
54255446 if (![dict[@"for"] isKindOfClass:NSDictionary.class]) return nil;
5426- if (![dict[@"goto"] isKindOfClass:NSDictionary.class]) return nil;
54275447 if (![dict[@"false"] isKindOfClass:NSDictionary.class]) return nil;
54285448 [self setValuesForKeysWithDictionary:dict];
54295449 _dateFormatter = [QTDateFormatter fromJSONDictionary:(id)_dateFormatter];
@@ -5520,6 +5540,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
55205540 if (!_friend && dict[@"friend"] && ![dict[@"friend"] isKindOfClass:NSNull.class]) return nil;
55215541 _from = [QTFrom fromJSONDictionary:(id)_from];
55225542 if (!_from && dict[@"from"] && ![dict[@"from"] isKindOfClass:NSNull.class]) return nil;
5543+ _fromDict = [QTFromDict fromJSONDictionary:(id)_fromDict];
5544+ if (!_fromDict && dict[@"from_dict"] && ![dict[@"from_dict"] isKindOfClass:NSNull.class]) return nil;
55235545 _fromJSON = [QTFromJSON fromJSONDictionary:(id)_fromJSON];
55245546 if (!_fromJSON && dict[@"from_json"] && ![dict[@"from_json"] isKindOfClass:NSNull.class]) return nil;
55255547 _func = [QTFunc fromJSONDictionary:(id)_func];
@@ -5550,8 +5572,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
55505572 if (!_obj2Float && dict[@"float"] && ![dict[@"float"] isKindOfClass:NSNull.class]) return nil;
55515573 _obj2For = [QTFor fromJSONDictionary:(id)_obj2For];
55525574 if (!_obj2For && dict[@"for"] && ![dict[@"for"] isKindOfClass:NSNull.class]) return nil;
5553- _obj2Goto = [QTGoto fromJSONDictionary:(id)_obj2Goto];
5554- if (!_obj2Goto && dict[@"goto"] && ![dict[@"goto"] isKindOfClass:NSNull.class]) return nil;
55555575 _theFalse = [QTFalseClass fromJSONDictionary:(id)_theFalse];
55565576 if (!_theFalse && dict[@"false"] && ![dict[@"false"] isKindOfClass:NSNull.class]) return nil;
55575577 }
@@ -5630,6 +5650,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
56305650 @"FormatException": [_formatException JSONDictionary],
56315651 @"friend": [_friend JSONDictionary],
56325652 @"from": [_from JSONDictionary],
5653+ @"from_dict": [_fromDict JSONDictionary],
56335654 @"from_json": [_fromJSON JSONDictionary],
56345655 @"func": [_func JSONDictionary],
56355656 @"function": [_function JSONDictionary],
@@ -5645,7 +5666,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
56455666 @"False": [_obj2False JSONDictionary],
56465667 @"float": [_obj2Float JSONDictionary],
56475668 @"for": [_obj2For JSONDictionary],
5648- @"goto": [_obj2Goto JSONDictionary],
56495669 @"false": [_theFalse JSONDictionary],
56505670 }];
56515671
@@ -7781,6 +7801,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
77817801 }
77827802 @end
77837803
7804+@implementation QTFromDict
7805++ (NSDictionary<NSString *, NSString *> *)properties
7806+{
7807+ static NSDictionary<NSString *, NSString *> *properties;
7808+ return properties = properties ? properties : @{
7809+ @"from_dict": @"fromDict",
7810+ };
7811+}
7812+
7813++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
7814+{
7815+ return [dict isKindOfClass:NSDictionary.class] ? [[QTFromDict alloc] initWithJSONDictionary:dict] : nil;
7816+}
7817+
7818+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
7819+{
7820+ if (self = [super init]) {
7821+ if (![dict[@"from_dict"] isKindOfClass:NSNumber.class]) return nil;
7822+ if ([dict[@"from_dict"] doubleValue] != [dict[@"from_dict"] longLongValue]) return nil;
7823+ [self setValuesForKeysWithDictionary:dict];
7824+ }
7825+ return self;
7826+}
7827+
7828+- (void)setValue:(nullable id)value forKey:(NSString *)key
7829+{
7830+ id resolved = QTFromDict.properties[key];
7831+ if (resolved) [super setValue:value forKey:resolved];
7832+}
7833+
7834+- (void)setNilValueForKey:(NSString *)key
7835+{
7836+ id resolved = QTFromDict.properties[key];
7837+ if (resolved) [super setValue:@(0) forKey:resolved];
7838+}
7839+
7840+- (NSDictionary *)JSONDictionary
7841+{
7842+ id dict = [[self dictionaryWithValuesForKeys:QTFromDict.properties.allValues] mutableCopy];
7843+
7844+ for (id jsonName in QTFromDict.properties) {
7845+ id propertyName = QTFromDict.properties[jsonName];
7846+ if (![jsonName isEqualToString:propertyName]) {
7847+ dict[jsonName] = dict[propertyName];
7848+ [dict removeObjectForKey:propertyName];
7849+ }
7850+ }
7851+
7852+ return dict;
7853+}
7854+@end
7855+
77847856 @implementation QTFromJSON
77857857 + (NSDictionary<NSString *, NSString *> *)properties
77867858 {
@@ -8511,58 +8583,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
85118583 }
85128584 @end
85138585
8514-@implementation QTGoto
8515-+ (NSDictionary<NSString *, NSString *> *)properties
8516-{
8517- static NSDictionary<NSString *, NSString *> *properties;
8518- return properties = properties ? properties : @{
8519- @"goto": @"gotoGoto",
8520- };
8521-}
8522-
8523-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
8524-{
8525- return [dict isKindOfClass:NSDictionary.class] ? [[QTGoto alloc] initWithJSONDictionary:dict] : nil;
8526-}
8527-
8528-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
8529-{
8530- if (self = [super init]) {
8531- if (![dict[@"goto"] isKindOfClass:NSNumber.class]) return nil;
8532- if ([dict[@"goto"] doubleValue] != [dict[@"goto"] longLongValue]) return nil;
8533- [self setValuesForKeysWithDictionary:dict];
8534- }
8535- return self;
8536-}
8537-
8538-- (void)setValue:(nullable id)value forKey:(NSString *)key
8539-{
8540- id resolved = QTGoto.properties[key];
8541- if (resolved) [super setValue:value forKey:resolved];
8542-}
8543-
8544-- (void)setNilValueForKey:(NSString *)key
8545-{
8546- id resolved = QTGoto.properties[key];
8547- if (resolved) [super setValue:@(0) forKey:resolved];
8548-}
8549-
8550-- (NSDictionary *)JSONDictionary
8551-{
8552- id dict = [[self dictionaryWithValuesForKeys:QTGoto.properties.allValues] mutableCopy];
8553-
8554- for (id jsonName in QTGoto.properties) {
8555- id propertyName = QTGoto.properties[jsonName];
8556- if (![jsonName isEqualToString:propertyName]) {
8557- dict[jsonName] = dict[propertyName];
8558- [dict removeObjectForKey:propertyName];
8559- }
8560- }
8561-
8562- return dict;
8563-}
8564-@end
8565-
85668586 @implementation QTFalseClass
85678587 + (NSDictionary<NSString *, NSString *> *)properties
85688588 {
@@ -8668,6 +8688,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
86688688 @"lock": @"lock",
86698689 @"map": @"map",
86708690 @"MapEntry": @"mapEntry",
8691+ @"MarshalJSON": @"marshalJSON",
86718692 @"metadata_property_handling": @"metadataPropertyHandling",
86728693 @"module": @"module",
86738694 @"mutable": @"mutable",
@@ -8676,7 +8697,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
86768697 @"native": @"native",
86778698 @"newtonsoft": @"newtonsoft",
86788699 @"NO": @"no",
8679- @"noexcept": @"noexcept",
8700+ @"goto": @"obj3Goto",
86808701 @"if": @"obj3If",
86818702 @"inline": @"obj3Inline",
86828703 @"int": @"obj3Int",
@@ -8745,6 +8766,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
87458766 if (![dict[@"lock"] isKindOfClass:NSDictionary.class]) return nil;
87468767 if (![dict[@"map"] isKindOfClass:NSDictionary.class]) return nil;
87478768 if (![dict[@"MapEntry"] isKindOfClass:NSDictionary.class]) return nil;
8769+ if (![dict[@"MarshalJSON"] isKindOfClass:NSDictionary.class]) return nil;
87488770 if (![dict[@"metadata_property_handling"] isKindOfClass:NSDictionary.class]) return nil;
87498771 if (![dict[@"module"] isKindOfClass:NSDictionary.class]) return nil;
87508772 if (![dict[@"mutable"] isKindOfClass:NSDictionary.class]) return nil;
@@ -8753,7 +8775,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
87538775 if (![dict[@"native"] isKindOfClass:NSDictionary.class]) return nil;
87548776 if (![dict[@"newtonsoft"] isKindOfClass:NSDictionary.class]) return nil;
87558777 if (![dict[@"NO"] isKindOfClass:NSDictionary.class]) return nil;
8756- if (![dict[@"noexcept"] isKindOfClass:NSDictionary.class]) return nil;
8778+ if (![dict[@"goto"] isKindOfClass:NSDictionary.class]) return nil;
87578779 if (![dict[@"if"] isKindOfClass:NSDictionary.class]) return nil;
87588780 if (![dict[@"inline"] isKindOfClass:NSDictionary.class]) return nil;
87598781 if (![dict[@"int"] isKindOfClass:NSDictionary.class]) return nil;
@@ -8857,6 +8879,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
88578879 if (!_map && dict[@"map"] && ![dict[@"map"] isKindOfClass:NSNull.class]) return nil;
88588880 _mapEntry = [QTMapEntry fromJSONDictionary:(id)_mapEntry];
88598881 if (!_mapEntry && dict[@"MapEntry"] && ![dict[@"MapEntry"] isKindOfClass:NSNull.class]) return nil;
8882+ _marshalJSON = [QTMarshalJSON fromJSONDictionary:(id)_marshalJSON];
8883+ if (!_marshalJSON && dict[@"MarshalJSON"] && ![dict[@"MarshalJSON"] isKindOfClass:NSNull.class]) return nil;
88608884 _metadataPropertyHandling = [QTMetadataPropertyHandling fromJSONDictionary:(id)_metadataPropertyHandling];
88618885 if (!_metadataPropertyHandling && dict[@"metadata_property_handling"] && ![dict[@"metadata_property_handling"] isKindOfClass:NSNull.class]) return nil;
88628886 _module = [QTModule fromJSONDictionary:(id)_module];
@@ -8873,8 +8897,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
88738897 if (!_newtonsoft && dict[@"newtonsoft"] && ![dict[@"newtonsoft"] isKindOfClass:NSNull.class]) return nil;
88748898 _no = [QTNo fromJSONDictionary:(id)_no];
88758899 if (!_no && dict[@"NO"] && ![dict[@"NO"] isKindOfClass:NSNull.class]) return nil;
8876- _noexcept = [QTNoexcept fromJSONDictionary:(id)_noexcept];
8877- if (!_noexcept && dict[@"noexcept"] && ![dict[@"noexcept"] isKindOfClass:NSNull.class]) return nil;
8900+ _obj3Goto = [QTGoto fromJSONDictionary:(id)_obj3Goto];
8901+ if (!_obj3Goto && dict[@"goto"] && ![dict[@"goto"] isKindOfClass:NSNull.class]) return nil;
88788902 _obj3If = [QTIf fromJSONDictionary:(id)_obj3If];
88798903 if (!_obj3If && dict[@"if"] && ![dict[@"if"] isKindOfClass:NSNull.class]) return nil;
88808904 _obj3Inline = [QTInline fromJSONDictionary:(id)_obj3Inline];
@@ -8967,6 +8991,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
89678991 @"lock": [_lock JSONDictionary],
89688992 @"map": [_map JSONDictionary],
89698993 @"MapEntry": [_mapEntry JSONDictionary],
8994+ @"MarshalJSON": [_marshalJSON JSONDictionary],
89708995 @"metadata_property_handling": [_metadataPropertyHandling JSONDictionary],
89718996 @"module": [_module JSONDictionary],
89728997 @"mutable": [_mutable JSONDictionary],
@@ -8975,7 +9000,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
89759000 @"native": [_native JSONDictionary],
89769001 @"newtonsoft": [_newtonsoft JSONDictionary],
89779002 @"NO": [_no JSONDictionary],
8978- @"noexcept": [_noexcept JSONDictionary],
9003+ @"goto": [_obj3Goto JSONDictionary],
89799004 @"if": [_obj3If JSONDictionary],
89809005 @"inline": [_obj3Inline JSONDictionary],
89819006 @"int": [_obj3Int JSONDictionary],
@@ -11183,6 +11208,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1118311208 }
1118411209 @end
1118511210
11211+@implementation QTMarshalJSON
11212++ (NSDictionary<NSString *, NSString *> *)properties
11213+{
11214+ static NSDictionary<NSString *, NSString *> *properties;
11215+ return properties = properties ? properties : @{
11216+ @"MarshalJSON": @"marshalJSON",
11217+ };
11218+}
11219+
11220++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
11221+{
11222+ return [dict isKindOfClass:NSDictionary.class] ? [[QTMarshalJSON alloc] initWithJSONDictionary:dict] : nil;
11223+}
11224+
11225+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
11226+{
11227+ if (self = [super init]) {
11228+ if (![dict[@"MarshalJSON"] isKindOfClass:NSNumber.class]) return nil;
11229+ if ([dict[@"MarshalJSON"] doubleValue] != [dict[@"MarshalJSON"] longLongValue]) return nil;
11230+ [self setValuesForKeysWithDictionary:dict];
11231+ }
11232+ return self;
11233+}
11234+
11235+- (void)setValue:(nullable id)value forKey:(NSString *)key
11236+{
11237+ id resolved = QTMarshalJSON.properties[key];
11238+ if (resolved) [super setValue:value forKey:resolved];
11239+}
11240+
11241+- (void)setNilValueForKey:(NSString *)key
11242+{
11243+ id resolved = QTMarshalJSON.properties[key];
11244+ if (resolved) [super setValue:@(0) forKey:resolved];
11245+}
11246+
11247+- (NSDictionary *)JSONDictionary
11248+{
11249+ id dict = [[self dictionaryWithValuesForKeys:QTMarshalJSON.properties.allValues] mutableCopy];
11250+
11251+ for (id jsonName in QTMarshalJSON.properties) {
11252+ id propertyName = QTMarshalJSON.properties[jsonName];
11253+ if (![jsonName isEqualToString:propertyName]) {
11254+ dict[jsonName] = dict[propertyName];
11255+ [dict removeObjectForKey:propertyName];
11256+ }
11257+ }
11258+
11259+ return dict;
11260+}
11261+@end
11262+
1118611263 @implementation QTMetadataPropertyHandling
1118711264 + (NSDictionary<NSString *, NSString *> *)properties
1118811265 {
@@ -11539,25 +11616,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1153911616 }
1154011617 @end
1154111618
11542-@implementation QTNoexcept
11619+@implementation QTGoto
1154311620 + (NSDictionary<NSString *, NSString *> *)properties
1154411621 {
1154511622 static NSDictionary<NSString *, NSString *> *properties;
1154611623 return properties = properties ? properties : @{
11547- @"noexcept": @"noexcept",
11624+ @"goto": @"gotoGoto",
1154811625 };
1154911626 }
1155011627
1155111628 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1155211629 {
11553- return [dict isKindOfClass:NSDictionary.class] ? [[QTNoexcept alloc] initWithJSONDictionary:dict] : nil;
11630+ return [dict isKindOfClass:NSDictionary.class] ? [[QTGoto alloc] initWithJSONDictionary:dict] : nil;
1155411631 }
1155511632
1155611633 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1155711634 {
1155811635 if (self = [super init]) {
11559- if (![dict[@"noexcept"] isKindOfClass:NSNumber.class]) return nil;
11560- if ([dict[@"noexcept"] doubleValue] != [dict[@"noexcept"] longLongValue]) return nil;
11636+ if (![dict[@"goto"] isKindOfClass:NSNumber.class]) return nil;
11637+ if ([dict[@"goto"] doubleValue] != [dict[@"goto"] longLongValue]) return nil;
1156111638 [self setValuesForKeysWithDictionary:dict];
1156211639 }
1156311640 return self;
@@ -11565,19 +11642,29 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1156511642
1156611643 - (void)setValue:(nullable id)value forKey:(NSString *)key
1156711644 {
11568- id resolved = QTNoexcept.properties[key];
11645+ id resolved = QTGoto.properties[key];
1156911646 if (resolved) [super setValue:value forKey:resolved];
1157011647 }
1157111648
1157211649 - (void)setNilValueForKey:(NSString *)key
1157311650 {
11574- id resolved = QTNoexcept.properties[key];
11651+ id resolved = QTGoto.properties[key];
1157511652 if (resolved) [super setValue:@(0) forKey:resolved];
1157611653 }
1157711654
1157811655 - (NSDictionary *)JSONDictionary
1157911656 {
11580- return [self dictionaryWithValuesForKeys:QTNoexcept.properties.allValues];
11657+ id dict = [[self dictionaryWithValuesForKeys:QTGoto.properties.allValues] mutableCopy];
11658+
11659+ for (id jsonName in QTGoto.properties) {
11660+ id propertyName = QTGoto.properties[jsonName];
11661+ if (![jsonName isEqualToString:propertyName]) {
11662+ dict[jsonName] = dict[propertyName];
11663+ [dict removeObjectForKey:propertyName];
11664+ }
11665+ }
11666+
11667+ return dict;
1158111668 }
1158211669 @end
1158311670
@@ -12004,6 +12091,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1200412091 return properties = properties ? properties : @{
1200512092 @"dummy": @"dummy",
1200612093 @"noSuchMethod": @"noSuchMethod",
12094+ @"noexcept": @"noexcept",
1200712095 @"None": @"none",
1200812096 @"nonlocal": @"nonlocal",
1200912097 @"nonmutating": @"nonmutating",
@@ -12066,7 +12154,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1206612154 @"sbyte": @"sbyte",
1206712155 @"sealed": @"sealed",
1206812156 @"SEL": @"sel",
12069- @"select": @"select",
1207012157 };
1207112158 }
1207212159
@@ -12081,6 +12168,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1208112168 if (![dict[@"dummy"] isKindOfClass:NSNumber.class]) return nil;
1208212169 if ([dict[@"dummy"] doubleValue] != [dict[@"dummy"] longLongValue]) return nil;
1208312170 if (![dict[@"noSuchMethod"] isKindOfClass:NSDictionary.class]) return nil;
12171+ if (![dict[@"noexcept"] isKindOfClass:NSDictionary.class]) return nil;
1208412172 if (![dict[@"None"] isKindOfClass:NSDictionary.class]) return nil;
1208512173 if (![dict[@"nonlocal"] isKindOfClass:NSDictionary.class]) return nil;
1208612174 if (![dict[@"nonmutating"] isKindOfClass:NSDictionary.class]) return nil;
@@ -12143,10 +12231,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1214312231 if (![dict[@"sbyte"] isKindOfClass:NSDictionary.class]) return nil;
1214412232 if (![dict[@"sealed"] isKindOfClass:NSDictionary.class]) return nil;
1214512233 if (![dict[@"SEL"] isKindOfClass:NSDictionary.class]) return nil;
12146- if (![dict[@"select"] isKindOfClass:NSDictionary.class]) return nil;
1214712234 [self setValuesForKeysWithDictionary:dict];
1214812235 _noSuchMethod = [QTNoSuchMethod fromJSONDictionary:(id)_noSuchMethod];
1214912236 if (!_noSuchMethod && dict[@"noSuchMethod"] && ![dict[@"noSuchMethod"] isKindOfClass:NSNull.class]) return nil;
12237+ _noexcept = [QTNoexcept fromJSONDictionary:(id)_noexcept];
12238+ if (!_noexcept && dict[@"noexcept"] && ![dict[@"noexcept"] isKindOfClass:NSNull.class]) return nil;
1215012239 _none = [QTNone fromJSONDictionary:(id)_none];
1215112240 if (!_none && dict[@"None"] && ![dict[@"None"] isKindOfClass:NSNull.class]) return nil;
1215212241 _nonlocal = [QTNonlocal fromJSONDictionary:(id)_nonlocal];
@@ -12271,8 +12360,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1227112360 if (!_sealed && dict[@"sealed"] && ![dict[@"sealed"] isKindOfClass:NSNull.class]) return nil;
1227212361 _sel = [QTSel fromJSONDictionary:(id)_sel];
1227312362 if (!_sel && dict[@"SEL"] && ![dict[@"SEL"] isKindOfClass:NSNull.class]) return nil;
12274- _select = [QTSelect fromJSONDictionary:(id)_select];
12275- if (!_select && dict[@"select"] && ![dict[@"select"] isKindOfClass:NSNull.class]) return nil;
1227612363 }
1227712364 return self;
1227812365 }
@@ -12303,6 +12390,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1230312390
1230412391 [dict addEntriesFromDictionary:@{
1230512392 @"noSuchMethod": [_noSuchMethod JSONDictionary],
12393+ @"noexcept": [_noexcept JSONDictionary],
1230612394 @"None": [_none JSONDictionary],
1230712395 @"nonlocal": [_nonlocal JSONDictionary],
1230812396 @"nonmutating": [_nonmutating JSONDictionary],
@@ -12365,7 +12453,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1236512453 @"sbyte": [_sbyte JSONDictionary],
1236612454 @"sealed": [_sealed JSONDictionary],
1236712455 @"SEL": [_sel JSONDictionary],
12368- @"select": [_select JSONDictionary],
1236912456 }];
1237012457
1237112458 return dict;
@@ -12414,25 +12501,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1241412501 }
1241512502 @end
1241612503
12417-@implementation QTNone
12504+@implementation QTNoexcept
1241812505 + (NSDictionary<NSString *, NSString *> *)properties
1241912506 {
1242012507 static NSDictionary<NSString *, NSString *> *properties;
1242112508 return properties = properties ? properties : @{
12422- @"None": @"none",
12509+ @"noexcept": @"noexcept",
1242312510 };
1242412511 }
1242512512
1242612513 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1242712514 {
12428- return [dict isKindOfClass:NSDictionary.class] ? [[QTNone alloc] initWithJSONDictionary:dict] : nil;
12515+ return [dict isKindOfClass:NSDictionary.class] ? [[QTNoexcept alloc] initWithJSONDictionary:dict] : nil;
1242912516 }
1243012517
1243112518 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1243212519 {
1243312520 if (self = [super init]) {
12434- if (![dict[@"None"] isKindOfClass:NSNumber.class]) return nil;
12435- if ([dict[@"None"] doubleValue] != [dict[@"None"] longLongValue]) return nil;
12521+ if (![dict[@"noexcept"] isKindOfClass:NSNumber.class]) return nil;
12522+ if ([dict[@"noexcept"] doubleValue] != [dict[@"noexcept"] longLongValue]) return nil;
1243612523 [self setValuesForKeysWithDictionary:dict];
1243712524 }
1243812525 return self;
@@ -12440,44 +12527,86 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1244012527
1244112528 - (void)setValue:(nullable id)value forKey:(NSString *)key
1244212529 {
12443- id resolved = QTNone.properties[key];
12530+ id resolved = QTNoexcept.properties[key];
1244412531 if (resolved) [super setValue:value forKey:resolved];
1244512532 }
1244612533
1244712534 - (void)setNilValueForKey:(NSString *)key
1244812535 {
12449- id resolved = QTNone.properties[key];
12536+ id resolved = QTNoexcept.properties[key];
1245012537 if (resolved) [super setValue:@(0) forKey:resolved];
1245112538 }
1245212539
1245312540 - (NSDictionary *)JSONDictionary
1245412541 {
12455- id dict = [[self dictionaryWithValuesForKeys:QTNone.properties.allValues] mutableCopy];
12456-
12457- for (id jsonName in QTNone.properties) {
12458- id propertyName = QTNone.properties[jsonName];
12459- if (![jsonName isEqualToString:propertyName]) {
12460- dict[jsonName] = dict[propertyName];
12461- [dict removeObjectForKey:propertyName];
12462- }
12463- }
12464-
12465- return dict;
12542+ return [self dictionaryWithValuesForKeys:QTNoexcept.properties.allValues];
1246612543 }
1246712544 @end
1246812545
12469-@implementation QTNonlocal
12546+@implementation QTNone
1247012547 + (NSDictionary<NSString *, NSString *> *)properties
1247112548 {
1247212549 static NSDictionary<NSString *, NSString *> *properties;
1247312550 return properties = properties ? properties : @{
12474- @"nonlocal": @"nonlocal",
12551+ @"None": @"none",
1247512552 };
1247612553 }
1247712554
1247812555 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1247912556 {
12480- return [dict isKindOfClass:NSDictionary.class] ? [[QTNonlocal alloc] initWithJSONDictionary:dict] : nil;
12557+ return [dict isKindOfClass:NSDictionary.class] ? [[QTNone alloc] initWithJSONDictionary:dict] : nil;
12558+}
12559+
12560+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
12561+{
12562+ if (self = [super init]) {
12563+ if (![dict[@"None"] isKindOfClass:NSNumber.class]) return nil;
12564+ if ([dict[@"None"] doubleValue] != [dict[@"None"] longLongValue]) return nil;
12565+ [self setValuesForKeysWithDictionary:dict];
12566+ }
12567+ return self;
12568+}
12569+
12570+- (void)setValue:(nullable id)value forKey:(NSString *)key
12571+{
12572+ id resolved = QTNone.properties[key];
12573+ if (resolved) [super setValue:value forKey:resolved];
12574+}
12575+
12576+- (void)setNilValueForKey:(NSString *)key
12577+{
12578+ id resolved = QTNone.properties[key];
12579+ if (resolved) [super setValue:@(0) forKey:resolved];
12580+}
12581+
12582+- (NSDictionary *)JSONDictionary
12583+{
12584+ id dict = [[self dictionaryWithValuesForKeys:QTNone.properties.allValues] mutableCopy];
12585+
12586+ for (id jsonName in QTNone.properties) {
12587+ id propertyName = QTNone.properties[jsonName];
12588+ if (![jsonName isEqualToString:propertyName]) {
12589+ dict[jsonName] = dict[propertyName];
12590+ [dict removeObjectForKey:propertyName];
12591+ }
12592+ }
12593+
12594+ return dict;
12595+}
12596+@end
12597+
12598+@implementation QTNonlocal
12599++ (NSDictionary<NSString *, NSString *> *)properties
12600+{
12601+ static NSDictionary<NSString *, NSString *> *properties;
12602+ return properties = properties ? properties : @{
12603+ @"nonlocal": @"nonlocal",
12604+ };
12605+}
12606+
12607++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
12608+{
12609+ return [dict isKindOfClass:NSDictionary.class] ? [[QTNonlocal alloc] initWithJSONDictionary:dict] : nil;
1248112610 }
1248212611
1248312612 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
@@ -15188,48 +15317,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1518815317 }
1518915318 @end
1519015319
15191-@implementation QTSelect
15192-+ (NSDictionary<NSString *, NSString *> *)properties
15193-{
15194- static NSDictionary<NSString *, NSString *> *properties;
15195- return properties = properties ? properties : @{
15196- @"select": @"select",
15197- };
15198-}
15199-
15200-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
15201-{
15202- return [dict isKindOfClass:NSDictionary.class] ? [[QTSelect alloc] initWithJSONDictionary:dict] : nil;
15203-}
15204-
15205-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
15206-{
15207- if (self = [super init]) {
15208- if (![dict[@"select"] isKindOfClass:NSNumber.class]) return nil;
15209- if ([dict[@"select"] doubleValue] != [dict[@"select"] longLongValue]) return nil;
15210- [self setValuesForKeysWithDictionary:dict];
15211- }
15212- return self;
15213-}
15214-
15215-- (void)setValue:(nullable id)value forKey:(NSString *)key
15216-{
15217- id resolved = QTSelect.properties[key];
15218- if (resolved) [super setValue:value forKey:resolved];
15219-}
15220-
15221-- (void)setNilValueForKey:(NSString *)key
15222-{
15223- id resolved = QTSelect.properties[key];
15224- if (resolved) [super setValue:@(0) forKey:resolved];
15225-}
15226-
15227-- (NSDictionary *)JSONDictionary
15228-{
15229- return [self dictionaryWithValuesForKeys:QTSelect.properties.allValues];
15230-}
15231-@end
15232-
1523315320 @implementation QTObj5
1523415321 + (NSDictionary<NSString *, NSString *> *)properties
1523515322 {
@@ -15249,8 +15336,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1524915336 @"typedef": @"obj5Typedef",
1525015337 @"typeof": @"obj5Typeof",
1525115338 @"union": @"obj5Union",
15252- @"unsigned": @"obj5Unsigned",
1525315339 @"PrimitiveKind": @"primitiveKind",
15340+ @"select": @"select",
1525415341 @"Self": @"self",
1525515342 @"Sendable": @"sendable",
1525615343 @"SerialDescriptor": @"serialDescriptor",
@@ -15283,6 +15370,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1528315370 @"TimeOnly": @"timeOnly",
1528415371 @"TimeOnlyConverter": @"timeOnlyConverter",
1528515372 @"TimeZone": @"timeZone",
15373+ @"to_dict": @"toDict",
1528615374 @"to_json": @"toJSON",
1528715375 @"toString": @"toString",
1528815376 @"top_level": @"topLevel",
@@ -15296,10 +15384,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1529615384 @"ulong": @"ulong",
1529715385 @"unchecked": @"unchecked",
1529815386 @"undefined": @"undefined",
15387+ @"UnmarshalJSON": @"unmarshalJSON",
1529915388 @"unowned": @"unowned",
1530015389 @"unsafe": @"unsafe",
1530115390 @"UseSerializers": @"useSerializers",
15302- @"ushort": @"ushort",
1530315391 };
1530415392 }
1530515393
@@ -15326,8 +15414,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1532615414 if (![dict[@"typedef"] isKindOfClass:NSDictionary.class]) return nil;
1532715415 if (![dict[@"typeof"] isKindOfClass:NSDictionary.class]) return nil;
1532815416 if (![dict[@"union"] isKindOfClass:NSDictionary.class]) return nil;
15329- if (![dict[@"unsigned"] isKindOfClass:NSDictionary.class]) return nil;
1533015417 if (![dict[@"PrimitiveKind"] isKindOfClass:NSDictionary.class]) return nil;
15418+ if (![dict[@"select"] isKindOfClass:NSDictionary.class]) return nil;
1533115419 if (![dict[@"Self"] isKindOfClass:NSDictionary.class]) return nil;
1533215420 if (![dict[@"Sendable"] isKindOfClass:NSDictionary.class]) return nil;
1533315421 if (![dict[@"SerialDescriptor"] isKindOfClass:NSDictionary.class]) return nil;
@@ -15360,6 +15448,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1536015448 if (![dict[@"TimeOnly"] isKindOfClass:NSDictionary.class]) return nil;
1536115449 if (![dict[@"TimeOnlyConverter"] isKindOfClass:NSDictionary.class]) return nil;
1536215450 if (![dict[@"TimeZone"] isKindOfClass:NSDictionary.class]) return nil;
15451+ if (![dict[@"to_dict"] isKindOfClass:NSDictionary.class]) return nil;
1536315452 if (![dict[@"to_json"] isKindOfClass:NSDictionary.class]) return nil;
1536415453 if (![dict[@"toString"] isKindOfClass:NSDictionary.class]) return nil;
1536515454 if (![dict[@"top_level"] isKindOfClass:NSDictionary.class]) return nil;
@@ -15373,10 +15462,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1537315462 if (![dict[@"ulong"] isKindOfClass:NSDictionary.class]) return nil;
1537415463 if (![dict[@"unchecked"] isKindOfClass:NSDictionary.class]) return nil;
1537515464 if (![dict[@"undefined"] isKindOfClass:NSDictionary.class]) return nil;
15465+ if (![dict[@"UnmarshalJSON"] isKindOfClass:NSDictionary.class]) return nil;
1537615466 if (![dict[@"unowned"] isKindOfClass:NSDictionary.class]) return nil;
1537715467 if (![dict[@"unsafe"] isKindOfClass:NSDictionary.class]) return nil;
1537815468 if (![dict[@"UseSerializers"] isKindOfClass:NSDictionary.class]) return nil;
15379- if (![dict[@"ushort"] isKindOfClass:NSDictionary.class]) return nil;
1538015469 [self setValuesForKeysWithDictionary:dict];
1538115470 _kSerializer = [QTKSerializer fromJSONDictionary:(id)_kSerializer];
1538215471 if (!_kSerializer && dict[@"KSerializer"] && ![dict[@"KSerializer"] isKindOfClass:NSNull.class]) return nil;
@@ -15404,10 +15493,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1540415493 if (!_obj5Typeof && dict[@"typeof"] && ![dict[@"typeof"] isKindOfClass:NSNull.class]) return nil;
1540515494 _obj5Union = [QTUnion fromJSONDictionary:(id)_obj5Union];
1540615495 if (!_obj5Union && dict[@"union"] && ![dict[@"union"] isKindOfClass:NSNull.class]) return nil;
15407- _obj5Unsigned = [QTUnsigned fromJSONDictionary:(id)_obj5Unsigned];
15408- if (!_obj5Unsigned && dict[@"unsigned"] && ![dict[@"unsigned"] isKindOfClass:NSNull.class]) return nil;
1540915496 _primitiveKind = [QTPrimitiveKind fromJSONDictionary:(id)_primitiveKind];
1541015497 if (!_primitiveKind && dict[@"PrimitiveKind"] && ![dict[@"PrimitiveKind"] isKindOfClass:NSNull.class]) return nil;
15498+ _select = [QTSelect fromJSONDictionary:(id)_select];
15499+ if (!_select && dict[@"select"] && ![dict[@"select"] isKindOfClass:NSNull.class]) return nil;
1541115500 _self = [QTSelf fromJSONDictionary:(id)_self];
1541215501 if (!_self && dict[@"Self"] && ![dict[@"Self"] isKindOfClass:NSNull.class]) return nil;
1541315502 _sendable = [QTSendable fromJSONDictionary:(id)_sendable];
@@ -15472,6 +15561,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1547215561 if (!_timeOnlyConverter && dict[@"TimeOnlyConverter"] && ![dict[@"TimeOnlyConverter"] isKindOfClass:NSNull.class]) return nil;
1547315562 _timeZone = [QTTimeZone fromJSONDictionary:(id)_timeZone];
1547415563 if (!_timeZone && dict[@"TimeZone"] && ![dict[@"TimeZone"] isKindOfClass:NSNull.class]) return nil;
15564+ _toDict = [QTToDict fromJSONDictionary:(id)_toDict];
15565+ if (!_toDict && dict[@"to_dict"] && ![dict[@"to_dict"] isKindOfClass:NSNull.class]) return nil;
1547515566 _toJSON = [QTToJSON fromJSONDictionary:(id)_toJSON];
1547615567 if (!_toJSON && dict[@"to_json"] && ![dict[@"to_json"] isKindOfClass:NSNull.class]) return nil;
1547715568 _toString = [QTToString fromJSONDictionary:(id)_toString];
@@ -15498,14 +15589,14 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1549815589 if (!_unchecked && dict[@"unchecked"] && ![dict[@"unchecked"] isKindOfClass:NSNull.class]) return nil;
1549915590 _undefined = [QTUndefined fromJSONDictionary:(id)_undefined];
1550015591 if (!_undefined && dict[@"undefined"] && ![dict[@"undefined"] isKindOfClass:NSNull.class]) return nil;
15592+ _unmarshalJSON = [QTUnmarshalJSON fromJSONDictionary:(id)_unmarshalJSON];
15593+ if (!_unmarshalJSON && dict[@"UnmarshalJSON"] && ![dict[@"UnmarshalJSON"] isKindOfClass:NSNull.class]) return nil;
1550115594 _unowned = [QTUnowned fromJSONDictionary:(id)_unowned];
1550215595 if (!_unowned && dict[@"unowned"] && ![dict[@"unowned"] isKindOfClass:NSNull.class]) return nil;
1550315596 _unsafe = [QTUnsafe fromJSONDictionary:(id)_unsafe];
1550415597 if (!_unsafe && dict[@"unsafe"] && ![dict[@"unsafe"] isKindOfClass:NSNull.class]) return nil;
1550515598 _useSerializers = [QTUseSerializers fromJSONDictionary:(id)_useSerializers];
1550615599 if (!_useSerializers && dict[@"UseSerializers"] && ![dict[@"UseSerializers"] isKindOfClass:NSNull.class]) return nil;
15507- _ushort = [QTUshort fromJSONDictionary:(id)_ushort];
15508- if (!_ushort && dict[@"ushort"] && ![dict[@"ushort"] isKindOfClass:NSNull.class]) return nil;
1550915600 }
1551015601 return self;
1551115602 }
@@ -15548,8 +15639,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1554815639 @"typedef": [_obj5Typedef JSONDictionary],
1554915640 @"typeof": [_obj5Typeof JSONDictionary],
1555015641 @"union": [_obj5Union JSONDictionary],
15551- @"unsigned": [_obj5Unsigned JSONDictionary],
1555215642 @"PrimitiveKind": [_primitiveKind JSONDictionary],
15643+ @"select": [_select JSONDictionary],
1555315644 @"Self": [_self JSONDictionary],
1555415645 @"Sendable": [_sendable JSONDictionary],
1555515646 @"SerialDescriptor": [_serialDescriptor JSONDictionary],
@@ -15582,6 +15673,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1558215673 @"TimeOnly": [_timeOnly JSONDictionary],
1558315674 @"TimeOnlyConverter": [_timeOnlyConverter JSONDictionary],
1558415675 @"TimeZone": [_timeZone JSONDictionary],
15676+ @"to_dict": [_toDict JSONDictionary],
1558515677 @"to_json": [_toJSON JSONDictionary],
1558615678 @"toString": [_toString JSONDictionary],
1558715679 @"top_level": [_topLevel JSONDictionary],
@@ -15595,10 +15687,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1559515687 @"ulong": [_ulong JSONDictionary],
1559615688 @"unchecked": [_unchecked JSONDictionary],
1559715689 @"undefined": [_undefined JSONDictionary],
15690+ @"UnmarshalJSON": [_unmarshalJSON JSONDictionary],
1559815691 @"unowned": [_unowned JSONDictionary],
1559915692 @"unsafe": [_unsafe JSONDictionary],
1560015693 @"UseSerializers": [_useSerializers JSONDictionary],
15601- @"ushort": [_ushort JSONDictionary],
1560215694 }];
1560315695
1560415696 return dict;
@@ -16261,25 +16353,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1626116353 }
1626216354 @end
1626316355
16264-@implementation QTUnsigned
16356+@implementation QTPrimitiveKind
1626516357 + (NSDictionary<NSString *, NSString *> *)properties
1626616358 {
1626716359 static NSDictionary<NSString *, NSString *> *properties;
1626816360 return properties = properties ? properties : @{
16269- @"unsigned": @"unsignedUnsigned",
16361+ @"PrimitiveKind": @"primitiveKind",
1627016362 };
1627116363 }
1627216364
1627316365 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1627416366 {
16275- return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsigned alloc] initWithJSONDictionary:dict] : nil;
16367+ return [dict isKindOfClass:NSDictionary.class] ? [[QTPrimitiveKind alloc] initWithJSONDictionary:dict] : nil;
1627616368 }
1627716369
1627816370 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1627916371 {
1628016372 if (self = [super init]) {
16281- if (![dict[@"unsigned"] isKindOfClass:NSNumber.class]) return nil;
16282- if ([dict[@"unsigned"] doubleValue] != [dict[@"unsigned"] longLongValue]) return nil;
16373+ if (![dict[@"PrimitiveKind"] isKindOfClass:NSNumber.class]) return nil;
16374+ if ([dict[@"PrimitiveKind"] doubleValue] != [dict[@"PrimitiveKind"] longLongValue]) return nil;
1628316375 [self setValuesForKeysWithDictionary:dict];
1628416376 }
1628516377 return self;
@@ -16287,22 +16379,22 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1628716379
1628816380 - (void)setValue:(nullable id)value forKey:(NSString *)key
1628916381 {
16290- id resolved = QTUnsigned.properties[key];
16382+ id resolved = QTPrimitiveKind.properties[key];
1629116383 if (resolved) [super setValue:value forKey:resolved];
1629216384 }
1629316385
1629416386 - (void)setNilValueForKey:(NSString *)key
1629516387 {
16296- id resolved = QTUnsigned.properties[key];
16388+ id resolved = QTPrimitiveKind.properties[key];
1629716389 if (resolved) [super setValue:@(0) forKey:resolved];
1629816390 }
1629916391
1630016392 - (NSDictionary *)JSONDictionary
1630116393 {
16302- id dict = [[self dictionaryWithValuesForKeys:QTUnsigned.properties.allValues] mutableCopy];
16394+ id dict = [[self dictionaryWithValuesForKeys:QTPrimitiveKind.properties.allValues] mutableCopy];
1630316395
16304- for (id jsonName in QTUnsigned.properties) {
16305- id propertyName = QTUnsigned.properties[jsonName];
16396+ for (id jsonName in QTPrimitiveKind.properties) {
16397+ id propertyName = QTPrimitiveKind.properties[jsonName];
1630616398 if (![jsonName isEqualToString:propertyName]) {
1630716399 dict[jsonName] = dict[propertyName];
1630816400 [dict removeObjectForKey:propertyName];
@@ -16313,25 +16405,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1631316405 }
1631416406 @end
1631516407
16316-@implementation QTPrimitiveKind
16408+@implementation QTSelect
1631716409 + (NSDictionary<NSString *, NSString *> *)properties
1631816410 {
1631916411 static NSDictionary<NSString *, NSString *> *properties;
1632016412 return properties = properties ? properties : @{
16321- @"PrimitiveKind": @"primitiveKind",
16413+ @"select": @"select",
1632216414 };
1632316415 }
1632416416
1632516417 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1632616418 {
16327- return [dict isKindOfClass:NSDictionary.class] ? [[QTPrimitiveKind alloc] initWithJSONDictionary:dict] : nil;
16419+ return [dict isKindOfClass:NSDictionary.class] ? [[QTSelect alloc] initWithJSONDictionary:dict] : nil;
1632816420 }
1632916421
1633016422 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1633116423 {
1633216424 if (self = [super init]) {
16333- if (![dict[@"PrimitiveKind"] isKindOfClass:NSNumber.class]) return nil;
16334- if ([dict[@"PrimitiveKind"] doubleValue] != [dict[@"PrimitiveKind"] longLongValue]) return nil;
16425+ if (![dict[@"select"] isKindOfClass:NSNumber.class]) return nil;
16426+ if ([dict[@"select"] doubleValue] != [dict[@"select"] longLongValue]) return nil;
1633516427 [self setValuesForKeysWithDictionary:dict];
1633616428 }
1633716429 return self;
@@ -16339,29 +16431,19 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1633916431
1634016432 - (void)setValue:(nullable id)value forKey:(NSString *)key
1634116433 {
16342- id resolved = QTPrimitiveKind.properties[key];
16434+ id resolved = QTSelect.properties[key];
1634316435 if (resolved) [super setValue:value forKey:resolved];
1634416436 }
1634516437
1634616438 - (void)setNilValueForKey:(NSString *)key
1634716439 {
16348- id resolved = QTPrimitiveKind.properties[key];
16440+ id resolved = QTSelect.properties[key];
1634916441 if (resolved) [super setValue:@(0) forKey:resolved];
1635016442 }
1635116443
1635216444 - (NSDictionary *)JSONDictionary
1635316445 {
16354- id dict = [[self dictionaryWithValuesForKeys:QTPrimitiveKind.properties.allValues] mutableCopy];
16355-
16356- for (id jsonName in QTPrimitiveKind.properties) {
16357- id propertyName = QTPrimitiveKind.properties[jsonName];
16358- if (![jsonName isEqualToString:propertyName]) {
16359- dict[jsonName] = dict[propertyName];
16360- [dict removeObjectForKey:propertyName];
16361- }
16362- }
16363-
16364- return dict;
16446+ return [self dictionaryWithValuesForKeys:QTSelect.properties.allValues];
1636516447 }
1636616448 @end
1636716449
@@ -17879,6 +17961,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1787917961 }
1788017962 @end
1788117963
17964+@implementation QTToDict
17965++ (NSDictionary<NSString *, NSString *> *)properties
17966+{
17967+ static NSDictionary<NSString *, NSString *> *properties;
17968+ return properties = properties ? properties : @{
17969+ @"to_dict": @"toDict",
17970+ };
17971+}
17972+
17973++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
17974+{
17975+ return [dict isKindOfClass:NSDictionary.class] ? [[QTToDict alloc] initWithJSONDictionary:dict] : nil;
17976+}
17977+
17978+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
17979+{
17980+ if (self = [super init]) {
17981+ if (![dict[@"to_dict"] isKindOfClass:NSNumber.class]) return nil;
17982+ if ([dict[@"to_dict"] doubleValue] != [dict[@"to_dict"] longLongValue]) return nil;
17983+ [self setValuesForKeysWithDictionary:dict];
17984+ }
17985+ return self;
17986+}
17987+
17988+- (void)setValue:(nullable id)value forKey:(NSString *)key
17989+{
17990+ id resolved = QTToDict.properties[key];
17991+ if (resolved) [super setValue:value forKey:resolved];
17992+}
17993+
17994+- (void)setNilValueForKey:(NSString *)key
17995+{
17996+ id resolved = QTToDict.properties[key];
17997+ if (resolved) [super setValue:@(0) forKey:resolved];
17998+}
17999+
18000+- (NSDictionary *)JSONDictionary
18001+{
18002+ id dict = [[self dictionaryWithValuesForKeys:QTToDict.properties.allValues] mutableCopy];
18003+
18004+ for (id jsonName in QTToDict.properties) {
18005+ id propertyName = QTToDict.properties[jsonName];
18006+ if (![jsonName isEqualToString:propertyName]) {
18007+ dict[jsonName] = dict[propertyName];
18008+ [dict removeObjectForKey:propertyName];
18009+ }
18010+ }
18011+
18012+ return dict;
18013+}
18014+@end
18015+
1788218016 @implementation QTToJSON
1788318017 + (NSDictionary<NSString *, NSString *> *)properties
1788418018 {
@@ -18455,25 +18589,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1845518589 }
1845618590 @end
1845718591
18458-@implementation QTUnowned
18592+@implementation QTUnmarshalJSON
1845918593 + (NSDictionary<NSString *, NSString *> *)properties
1846018594 {
1846118595 static NSDictionary<NSString *, NSString *> *properties;
1846218596 return properties = properties ? properties : @{
18463- @"unowned": @"unowned",
18597+ @"UnmarshalJSON": @"unmarshalJSON",
1846418598 };
1846518599 }
1846618600
1846718601 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1846818602 {
18469- return [dict isKindOfClass:NSDictionary.class] ? [[QTUnowned alloc] initWithJSONDictionary:dict] : nil;
18603+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUnmarshalJSON alloc] initWithJSONDictionary:dict] : nil;
1847018604 }
1847118605
1847218606 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1847318607 {
1847418608 if (self = [super init]) {
18475- if (![dict[@"unowned"] isKindOfClass:NSNumber.class]) return nil;
18476- if ([dict[@"unowned"] doubleValue] != [dict[@"unowned"] longLongValue]) return nil;
18609+ if (![dict[@"UnmarshalJSON"] isKindOfClass:NSNumber.class]) return nil;
18610+ if ([dict[@"UnmarshalJSON"] doubleValue] != [dict[@"UnmarshalJSON"] longLongValue]) return nil;
1847718611 [self setValuesForKeysWithDictionary:dict];
1847818612 }
1847918613 return self;
@@ -18481,41 +18615,51 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1848118615
1848218616 - (void)setValue:(nullable id)value forKey:(NSString *)key
1848318617 {
18484- id resolved = QTUnowned.properties[key];
18618+ id resolved = QTUnmarshalJSON.properties[key];
1848518619 if (resolved) [super setValue:value forKey:resolved];
1848618620 }
1848718621
1848818622 - (void)setNilValueForKey:(NSString *)key
1848918623 {
18490- id resolved = QTUnowned.properties[key];
18624+ id resolved = QTUnmarshalJSON.properties[key];
1849118625 if (resolved) [super setValue:@(0) forKey:resolved];
1849218626 }
1849318627
1849418628 - (NSDictionary *)JSONDictionary
1849518629 {
18496- return [self dictionaryWithValuesForKeys:QTUnowned.properties.allValues];
18630+ id dict = [[self dictionaryWithValuesForKeys:QTUnmarshalJSON.properties.allValues] mutableCopy];
18631+
18632+ for (id jsonName in QTUnmarshalJSON.properties) {
18633+ id propertyName = QTUnmarshalJSON.properties[jsonName];
18634+ if (![jsonName isEqualToString:propertyName]) {
18635+ dict[jsonName] = dict[propertyName];
18636+ [dict removeObjectForKey:propertyName];
18637+ }
18638+ }
18639+
18640+ return dict;
1849718641 }
1849818642 @end
1849918643
18500-@implementation QTUnsafe
18644+@implementation QTUnowned
1850118645 + (NSDictionary<NSString *, NSString *> *)properties
1850218646 {
1850318647 static NSDictionary<NSString *, NSString *> *properties;
1850418648 return properties = properties ? properties : @{
18505- @"unsafe": @"unsafe",
18649+ @"unowned": @"unowned",
1850618650 };
1850718651 }
1850818652
1850918653 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1851018654 {
18511- return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsafe alloc] initWithJSONDictionary:dict] : nil;
18655+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUnowned alloc] initWithJSONDictionary:dict] : nil;
1851218656 }
1851318657
1851418658 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1851518659 {
1851618660 if (self = [super init]) {
18517- if (![dict[@"unsafe"] isKindOfClass:NSNumber.class]) return nil;
18518- if ([dict[@"unsafe"] doubleValue] != [dict[@"unsafe"] longLongValue]) return nil;
18661+ if (![dict[@"unowned"] isKindOfClass:NSNumber.class]) return nil;
18662+ if ([dict[@"unowned"] doubleValue] != [dict[@"unowned"] longLongValue]) return nil;
1851918663 [self setValuesForKeysWithDictionary:dict];
1852018664 }
1852118665 return self;
@@ -18523,41 +18667,41 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1852318667
1852418668 - (void)setValue:(nullable id)value forKey:(NSString *)key
1852518669 {
18526- id resolved = QTUnsafe.properties[key];
18670+ id resolved = QTUnowned.properties[key];
1852718671 if (resolved) [super setValue:value forKey:resolved];
1852818672 }
1852918673
1853018674 - (void)setNilValueForKey:(NSString *)key
1853118675 {
18532- id resolved = QTUnsafe.properties[key];
18676+ id resolved = QTUnowned.properties[key];
1853318677 if (resolved) [super setValue:@(0) forKey:resolved];
1853418678 }
1853518679
1853618680 - (NSDictionary *)JSONDictionary
1853718681 {
18538- return [self dictionaryWithValuesForKeys:QTUnsafe.properties.allValues];
18682+ return [self dictionaryWithValuesForKeys:QTUnowned.properties.allValues];
1853918683 }
1854018684 @end
1854118685
18542-@implementation QTUseSerializers
18686+@implementation QTUnsafe
1854318687 + (NSDictionary<NSString *, NSString *> *)properties
1854418688 {
1854518689 static NSDictionary<NSString *, NSString *> *properties;
1854618690 return properties = properties ? properties : @{
18547- @"UseSerializers": @"useSerializers",
18691+ @"unsafe": @"unsafe",
1854818692 };
1854918693 }
1855018694
1855118695 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1855218696 {
18553- return [dict isKindOfClass:NSDictionary.class] ? [[QTUseSerializers alloc] initWithJSONDictionary:dict] : nil;
18697+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsafe alloc] initWithJSONDictionary:dict] : nil;
1855418698 }
1855518699
1855618700 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1855718701 {
1855818702 if (self = [super init]) {
18559- if (![dict[@"UseSerializers"] isKindOfClass:NSNumber.class]) return nil;
18560- if ([dict[@"UseSerializers"] doubleValue] != [dict[@"UseSerializers"] longLongValue]) return nil;
18703+ if (![dict[@"unsafe"] isKindOfClass:NSNumber.class]) return nil;
18704+ if ([dict[@"unsafe"] doubleValue] != [dict[@"unsafe"] longLongValue]) return nil;
1856118705 [self setValuesForKeysWithDictionary:dict];
1856218706 }
1856318707 return self;
@@ -18565,51 +18709,41 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1856518709
1856618710 - (void)setValue:(nullable id)value forKey:(NSString *)key
1856718711 {
18568- id resolved = QTUseSerializers.properties[key];
18712+ id resolved = QTUnsafe.properties[key];
1856918713 if (resolved) [super setValue:value forKey:resolved];
1857018714 }
1857118715
1857218716 - (void)setNilValueForKey:(NSString *)key
1857318717 {
18574- id resolved = QTUseSerializers.properties[key];
18718+ id resolved = QTUnsafe.properties[key];
1857518719 if (resolved) [super setValue:@(0) forKey:resolved];
1857618720 }
1857718721
1857818722 - (NSDictionary *)JSONDictionary
1857918723 {
18580- id dict = [[self dictionaryWithValuesForKeys:QTUseSerializers.properties.allValues] mutableCopy];
18581-
18582- for (id jsonName in QTUseSerializers.properties) {
18583- id propertyName = QTUseSerializers.properties[jsonName];
18584- if (![jsonName isEqualToString:propertyName]) {
18585- dict[jsonName] = dict[propertyName];
18586- [dict removeObjectForKey:propertyName];
18587- }
18588- }
18589-
18590- return dict;
18724+ return [self dictionaryWithValuesForKeys:QTUnsafe.properties.allValues];
1859118725 }
1859218726 @end
1859318727
18594-@implementation QTUshort
18728+@implementation QTUseSerializers
1859518729 + (NSDictionary<NSString *, NSString *> *)properties
1859618730 {
1859718731 static NSDictionary<NSString *, NSString *> *properties;
1859818732 return properties = properties ? properties : @{
18599- @"ushort": @"ushort",
18733+ @"UseSerializers": @"useSerializers",
1860018734 };
1860118735 }
1860218736
1860318737 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1860418738 {
18605- return [dict isKindOfClass:NSDictionary.class] ? [[QTUshort alloc] initWithJSONDictionary:dict] : nil;
18739+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUseSerializers alloc] initWithJSONDictionary:dict] : nil;
1860618740 }
1860718741
1860818742 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1860918743 {
1861018744 if (self = [super init]) {
18611- if (![dict[@"ushort"] isKindOfClass:NSNumber.class]) return nil;
18612- if ([dict[@"ushort"] doubleValue] != [dict[@"ushort"] longLongValue]) return nil;
18745+ if (![dict[@"UseSerializers"] isKindOfClass:NSNumber.class]) return nil;
18746+ if ([dict[@"UseSerializers"] doubleValue] != [dict[@"UseSerializers"] longLongValue]) return nil;
1861318747 [self setValuesForKeysWithDictionary:dict];
1861418748 }
1861518749 return self;
@@ -18617,19 +18751,29 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1861718751
1861818752 - (void)setValue:(nullable id)value forKey:(NSString *)key
1861918753 {
18620- id resolved = QTUshort.properties[key];
18754+ id resolved = QTUseSerializers.properties[key];
1862118755 if (resolved) [super setValue:value forKey:resolved];
1862218756 }
1862318757
1862418758 - (void)setNilValueForKey:(NSString *)key
1862518759 {
18626- id resolved = QTUshort.properties[key];
18760+ id resolved = QTUseSerializers.properties[key];
1862718761 if (resolved) [super setValue:@(0) forKey:resolved];
1862818762 }
1862918763
1863018764 - (NSDictionary *)JSONDictionary
1863118765 {
18632- return [self dictionaryWithValuesForKeys:QTUshort.properties.allValues];
18766+ id dict = [[self dictionaryWithValuesForKeys:QTUseSerializers.properties.allValues] mutableCopy];
18767+
18768+ for (id jsonName in QTUseSerializers.properties) {
18769+ id propertyName = QTUseSerializers.properties[jsonName];
18770+ if (![jsonName isEqualToString:propertyName]) {
18771+ dict[jsonName] = dict[propertyName];
18772+ [dict removeObjectForKey:propertyName];
18773+ }
18774+ }
18775+
18776+ return dict;
1863318777 }
1863418778 @end
1863518779
@@ -18639,9 +18783,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1863918783 static NSDictionary<NSString *, NSString *> *properties;
1864018784 return properties = properties ? properties : @{
1864118785 @"dummy": @"dummy",
18786+ @"unsigned": @"obj6Unsigned",
1864218787 @"void": @"obj6Void",
1864318788 @"volatile": @"obj6Volatile",
1864418789 @"while": @"obj6While",
18790+ @"ushort": @"ushort",
1864518791 @"using": @"using",
1864618792 @"Utf8JsonReader": @"utf8JSONReader",
1864718793 @"Utf8JsonWriter": @"utf8JSONWriter",
@@ -18670,9 +18816,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1867018816 if (self = [super init]) {
1867118817 if (![dict[@"dummy"] isKindOfClass:NSNumber.class]) return nil;
1867218818 if ([dict[@"dummy"] doubleValue] != [dict[@"dummy"] longLongValue]) return nil;
18819+ if (![dict[@"unsigned"] isKindOfClass:NSDictionary.class]) return nil;
1867318820 if (![dict[@"void"] isKindOfClass:NSDictionary.class]) return nil;
1867418821 if (![dict[@"volatile"] isKindOfClass:NSDictionary.class]) return nil;
1867518822 if (![dict[@"while"] isKindOfClass:NSDictionary.class]) return nil;
18823+ if (![dict[@"ushort"] isKindOfClass:NSDictionary.class]) return nil;
1867618824 if (![dict[@"using"] isKindOfClass:NSDictionary.class]) return nil;
1867718825 if (![dict[@"Utf8JsonReader"] isKindOfClass:NSDictionary.class]) return nil;
1867818826 if (![dict[@"Utf8JsonWriter"] isKindOfClass:NSDictionary.class]) return nil;
@@ -18689,12 +18837,16 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1868918837 if (![dict[@"YES"] isKindOfClass:NSDictionary.class]) return nil;
1869018838 if (![dict[@"yield"] isKindOfClass:NSDictionary.class]) return nil;
1869118839 [self setValuesForKeysWithDictionary:dict];
18840+ _obj6Unsigned = [QTUnsigned fromJSONDictionary:(id)_obj6Unsigned];
18841+ if (!_obj6Unsigned && dict[@"unsigned"] && ![dict[@"unsigned"] isKindOfClass:NSNull.class]) return nil;
1869218842 _obj6Void = [QTVoid fromJSONDictionary:(id)_obj6Void];
1869318843 if (!_obj6Void && dict[@"void"] && ![dict[@"void"] isKindOfClass:NSNull.class]) return nil;
1869418844 _obj6Volatile = [QTVolatile fromJSONDictionary:(id)_obj6Volatile];
1869518845 if (!_obj6Volatile && dict[@"volatile"] && ![dict[@"volatile"] isKindOfClass:NSNull.class]) return nil;
1869618846 _obj6While = [QTWhile fromJSONDictionary:(id)_obj6While];
1869718847 if (!_obj6While && dict[@"while"] && ![dict[@"while"] isKindOfClass:NSNull.class]) return nil;
18848+ _ushort = [QTUshort fromJSONDictionary:(id)_ushort];
18849+ if (!_ushort && dict[@"ushort"] && ![dict[@"ushort"] isKindOfClass:NSNull.class]) return nil;
1869818850 _using = [QTUsing fromJSONDictionary:(id)_using];
1869918851 if (!_using && dict[@"using"] && ![dict[@"using"] isKindOfClass:NSNull.class]) return nil;
1870018852 _utf8JSONReader = [QTUtf8JSONReader fromJSONDictionary:(id)_utf8JSONReader];
@@ -18754,9 +18906,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1875418906 }
1875518907
1875618908 [dict addEntriesFromDictionary:@{
18909+ @"unsigned": [_obj6Unsigned JSONDictionary],
1875718910 @"void": [_obj6Void JSONDictionary],
1875818911 @"volatile": [_obj6Volatile JSONDictionary],
1875918912 @"while": [_obj6While JSONDictionary],
18913+ @"ushort": [_ushort JSONDictionary],
1876018914 @"using": [_using JSONDictionary],
1876118915 @"Utf8JsonReader": [_utf8JSONReader JSONDictionary],
1876218916 @"Utf8JsonWriter": [_utf8JSONWriter JSONDictionary],
@@ -18778,6 +18932,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1877818932 }
1877918933 @end
1878018934
18935+@implementation QTUnsigned
18936++ (NSDictionary<NSString *, NSString *> *)properties
18937+{
18938+ static NSDictionary<NSString *, NSString *> *properties;
18939+ return properties = properties ? properties : @{
18940+ @"unsigned": @"unsignedUnsigned",
18941+ };
18942+}
18943+
18944++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
18945+{
18946+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsigned alloc] initWithJSONDictionary:dict] : nil;
18947+}
18948+
18949+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
18950+{
18951+ if (self = [super init]) {
18952+ if (![dict[@"unsigned"] isKindOfClass:NSNumber.class]) return nil;
18953+ if ([dict[@"unsigned"] doubleValue] != [dict[@"unsigned"] longLongValue]) return nil;
18954+ [self setValuesForKeysWithDictionary:dict];
18955+ }
18956+ return self;
18957+}
18958+
18959+- (void)setValue:(nullable id)value forKey:(NSString *)key
18960+{
18961+ id resolved = QTUnsigned.properties[key];
18962+ if (resolved) [super setValue:value forKey:resolved];
18963+}
18964+
18965+- (void)setNilValueForKey:(NSString *)key
18966+{
18967+ id resolved = QTUnsigned.properties[key];
18968+ if (resolved) [super setValue:@(0) forKey:resolved];
18969+}
18970+
18971+- (NSDictionary *)JSONDictionary
18972+{
18973+ id dict = [[self dictionaryWithValuesForKeys:QTUnsigned.properties.allValues] mutableCopy];
18974+
18975+ for (id jsonName in QTUnsigned.properties) {
18976+ id propertyName = QTUnsigned.properties[jsonName];
18977+ if (![jsonName isEqualToString:propertyName]) {
18978+ dict[jsonName] = dict[propertyName];
18979+ [dict removeObjectForKey:propertyName];
18980+ }
18981+ }
18982+
18983+ return dict;
18984+}
18985+@end
18986+
1878118987 @implementation QTVoid
1878218988 + (NSDictionary<NSString *, NSString *> *)properties
1878318989 {
@@ -18934,6 +19140,48 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1893419140 }
1893519141 @end
1893619142
19143+@implementation QTUshort
19144++ (NSDictionary<NSString *, NSString *> *)properties
19145+{
19146+ static NSDictionary<NSString *, NSString *> *properties;
19147+ return properties = properties ? properties : @{
19148+ @"ushort": @"ushort",
19149+ };
19150+}
19151+
19152++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
19153+{
19154+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUshort alloc] initWithJSONDictionary:dict] : nil;
19155+}
19156+
19157+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
19158+{
19159+ if (self = [super init]) {
19160+ if (![dict[@"ushort"] isKindOfClass:NSNumber.class]) return nil;
19161+ if ([dict[@"ushort"] doubleValue] != [dict[@"ushort"] longLongValue]) return nil;
19162+ [self setValuesForKeysWithDictionary:dict];
19163+ }
19164+ return self;
19165+}
19166+
19167+- (void)setValue:(nullable id)value forKey:(NSString *)key
19168+{
19169+ id resolved = QTUshort.properties[key];
19170+ if (resolved) [super setValue:value forKey:resolved];
19171+}
19172+
19173+- (void)setNilValueForKey:(NSString *)key
19174+{
19175+ id resolved = QTUshort.properties[key];
19176+ if (resolved) [super setValue:@(0) forKey:resolved];
19177+}
19178+
19179+- (NSDictionary *)JSONDictionary
19180+{
19181+ return [self dictionaryWithValuesForKeys:QTUshort.properties.allValues];
19182+}
19183+@end
19184+
1893719185 @implementation QTUsing
1893819186 + (NSDictionary<NSString *, NSString *> *)properties
1893919187 {
Mphpdefault / TopLevel.php+1,632 −996
@@ -10787,13 +10787,13 @@ class Obj2 {
1078710787 private FormatException $formatException; // json:FormatException Required
1078810788 private Friend $friend; // json:friend Required
1078910789 private From $from; // json:from Required
10790+ private FromDict $fromDict; // json:from_dict Required
1079010791 private FromJSON $fromJSON; // json:from_json Required
1079110792 private Func $func; // json:func Required
1079210793 private FunctionClass $function; // json:function Required
1079310794 private Get $get; // json:get Required
1079410795 private GlobalClass $global; // json:global Required
1079510796 private Go $go; // json:go Required
10796- private GotoClass $goto; // json:goto Required
1079710797 private Obj2False $obj2False; // json:false Required
1079810798
1079910799 /**
@@ -10854,16 +10854,16 @@ class Obj2 {
1085410854 * @param FormatException $formatException
1085510855 * @param Friend $friend
1085610856 * @param From $from
10857+ * @param FromDict $fromDict
1085710858 * @param FromJSON $fromJSON
1085810859 * @param Func $func
1085910860 * @param FunctionClass $function
1086010861 * @param Get $get
1086110862 * @param GlobalClass $global
1086210863 * @param Go $go
10863- * @param GotoClass $goto
1086410864 * @param Obj2False $obj2False
1086510865 */
10866- public function __construct(DateFormatter $dateFormatter, DateOnly $dateOnly, DateOnlyConverter $dateOnlyConverter, DateParseHandling $dateParseHandling, DateTimeClass $dateTime, DateTimeStyles $dateTimeStyles, Debugger $debugger, Decimal $decimal, DeclareClass $declare, Decltype $decltype, DecodeString $decodeString, Decoder $decoder, DecodingError $decodingError, Def $def, DefaultClass $default, Defer $defer, Deinit $deinit, Del $del, Delegate $delegate, Delete $delete, Dict $dict, Dictionary $dictionary, DidSet $didSet, DoClass $do, Double $double, int $dummy, Dynamic $dynamic, DynamicCast $dynamicCast, Elif $elif, ElseClass $else, EncodeQuickType $encodeQuickType, Encoder $encoder, EnumClass $enum, EnumValues $enumValues, EqualityContract $equalityContract, Equatable $equatable, Event $event, Except $except, ExceptionClass $exception, Explicit $explicit, Export $export, Exposing $exposing, ExtendsClass $extends, Extension $extension, Extern $extern, Fallthrough $fallthrough, FalseClass $false, Fileprivate $fileprivate, FinalClass $final, FinallyClass $finally, Fixed $fixed, FloatClass $float, ForClass $for, ForeachClass $foreach, FormatException $formatException, Friend $friend, From $from, FromJSON $fromJSON, Func $func, FunctionClass $function, Get $get, GlobalClass $global, Go $go, GotoClass $goto, Obj2False $obj2False) {
10866+ public function __construct(DateFormatter $dateFormatter, DateOnly $dateOnly, DateOnlyConverter $dateOnlyConverter, DateParseHandling $dateParseHandling, DateTimeClass $dateTime, DateTimeStyles $dateTimeStyles, Debugger $debugger, Decimal $decimal, DeclareClass $declare, Decltype $decltype, DecodeString $decodeString, Decoder $decoder, DecodingError $decodingError, Def $def, DefaultClass $default, Defer $defer, Deinit $deinit, Del $del, Delegate $delegate, Delete $delete, Dict $dict, Dictionary $dictionary, DidSet $didSet, DoClass $do, Double $double, int $dummy, Dynamic $dynamic, DynamicCast $dynamicCast, Elif $elif, ElseClass $else, EncodeQuickType $encodeQuickType, Encoder $encoder, EnumClass $enum, EnumValues $enumValues, EqualityContract $equalityContract, Equatable $equatable, Event $event, Except $except, ExceptionClass $exception, Explicit $explicit, Export $export, Exposing $exposing, ExtendsClass $extends, Extension $extension, Extern $extern, Fallthrough $fallthrough, FalseClass $false, Fileprivate $fileprivate, FinalClass $final, FinallyClass $finally, Fixed $fixed, FloatClass $float, ForClass $for, ForeachClass $foreach, FormatException $formatException, Friend $friend, From $from, FromDict $fromDict, FromJSON $fromJSON, Func $func, FunctionClass $function, Get $get, GlobalClass $global, Go $go, Obj2False $obj2False) {
1086710867 $this->dateFormatter = $dateFormatter;
1086810868 $this->dateOnly = $dateOnly;
1086910869 $this->dateOnlyConverter = $dateOnlyConverter;
@@ -10921,13 +10921,13 @@ class Obj2 {
1092110921 $this->formatException = $formatException;
1092210922 $this->friend = $friend;
1092310923 $this->from = $from;
10924+ $this->fromDict = $fromDict;
1092410925 $this->fromJSON = $fromJSON;
1092510926 $this->func = $func;
1092610927 $this->function = $function;
1092710928 $this->get = $get;
1092810929 $this->global = $global;
1092910930 $this->go = $go;
10930- $this->goto = $goto;
1093110931 $this->obj2False = $obj2False;
1093210932 }
1093310933
@@ -11896,7 +11896,7 @@ class Obj2 {
1189611896 * @throws Exception
1189711897 * @return Dict
1189811898 */
11899- public static function fromDict(stdClass $value): Dict {
11899+ public static function purpleFromDict(stdClass $value): Dict {
1190011900 return Dict::from($value); /*class*/
1190111901 }
1190211902
@@ -13666,6 +13666,54 @@ class Obj2 {
1366613666 return From::sample(); /*87:from*/
1366713667 }
1366813668
13669+ /**
13670+ * @param stdClass $value
13671+ * @throws Exception
13672+ * @return FromDict
13673+ */
13674+ public static function fromFromDict(stdClass $value): FromDict {
13675+ return FromDict::from($value); /*class*/
13676+ }
13677+
13678+ /**
13679+ * @throws Exception
13680+ * @return stdClass
13681+ */
13682+ public function toFromDict(): stdClass {
13683+ if (Obj2::validateFromDict($this->fromDict)) {
13684+ return $this->fromDict->to(); /*class*/
13685+ }
13686+ throw new Exception('never get to this Obj2::fromDict');
13687+ }
13688+
13689+ /**
13690+ * @param FromDict
13691+ * @return bool
13692+ * @throws Exception
13693+ */
13694+ public static function validateFromDict(FromDict $value): bool {
13695+ $value->validate();
13696+ return true;
13697+ }
13698+
13699+ /**
13700+ * @throws Exception
13701+ * @return FromDict
13702+ */
13703+ public function getFromDict(): FromDict {
13704+ if (Obj2::validateFromDict($this->fromDict)) {
13705+ return $this->fromDict;
13706+ }
13707+ throw new Exception('never get to getFromDict Obj2::fromDict');
13708+ }
13709+
13710+ /**
13711+ * @return FromDict
13712+ */
13713+ public static function sampleFromDict(): FromDict {
13714+ return FromDict::sample(); /*88:fromDict*/
13715+ }
13716+
1366913717 /**
1367013718 * @param stdClass $value
1367113719 * @throws Exception
@@ -13711,7 +13759,7 @@ class Obj2 {
1371113759 * @return FromJSON
1371213760 */
1371313761 public static function sampleFromJSON(): FromJSON {
13714- return FromJSON::sample(); /*88:fromJSON*/
13762+ return FromJSON::sample(); /*89:fromJSON*/
1371513763 }
1371613764
1371713765 /**
@@ -13759,7 +13807,7 @@ class Obj2 {
1375913807 * @return Func
1376013808 */
1376113809 public static function sampleFunc(): Func {
13762- return Func::sample(); /*89:func*/
13810+ return Func::sample(); /*90:func*/
1376313811 }
1376413812
1376513813 /**
@@ -13807,7 +13855,7 @@ class Obj2 {
1380713855 * @return FunctionClass
1380813856 */
1380913857 public static function sampleFunction(): FunctionClass {
13810- return FunctionClass::sample(); /*90:function*/
13858+ return FunctionClass::sample(); /*91:function*/
1381113859 }
1381213860
1381313861 /**
@@ -13855,7 +13903,7 @@ class Obj2 {
1385513903 * @return Get
1385613904 */
1385713905 public static function sampleGet(): Get {
13858- return Get::sample(); /*91:get*/
13906+ return Get::sample(); /*92:get*/
1385913907 }
1386013908
1386113909 /**
@@ -13903,7 +13951,7 @@ class Obj2 {
1390313951 * @return GlobalClass
1390413952 */
1390513953 public static function sampleGlobal(): GlobalClass {
13906- return GlobalClass::sample(); /*92:global*/
13954+ return GlobalClass::sample(); /*93:global*/
1390713955 }
1390813956
1390913957 /**
@@ -13951,55 +13999,7 @@ class Obj2 {
1395113999 * @return Go
1395214000 */
1395314001 public static function sampleGo(): Go {
13954- return Go::sample(); /*93:go*/
13955- }
13956-
13957- /**
13958- * @param stdClass $value
13959- * @throws Exception
13960- * @return GotoClass
13961- */
13962- public static function fromGoto(stdClass $value): GotoClass {
13963- return GotoClass::from($value); /*class*/
13964- }
13965-
13966- /**
13967- * @throws Exception
13968- * @return stdClass
13969- */
13970- public function toGoto(): stdClass {
13971- if (Obj2::validateGoto($this->goto)) {
13972- return $this->goto->to(); /*class*/
13973- }
13974- throw new Exception('never get to this Obj2::goto');
13975- }
13976-
13977- /**
13978- * @param GotoClass
13979- * @return bool
13980- * @throws Exception
13981- */
13982- public static function validateGoto(GotoClass $value): bool {
13983- $value->validate();
13984- return true;
13985- }
13986-
13987- /**
13988- * @throws Exception
13989- * @return GotoClass
13990- */
13991- public function getGoto(): GotoClass {
13992- if (Obj2::validateGoto($this->goto)) {
13993- return $this->goto;
13994- }
13995- throw new Exception('never get to getGoto Obj2::goto');
13996- }
13997-
13998- /**
13999- * @return GotoClass
14000- */
14001- public static function sampleGoto(): GotoClass {
14002- return GotoClass::sample(); /*94:goto*/
14002+ return Go::sample(); /*94:go*/
1400314003 }
1400414004
1400514005 /**
@@ -14112,13 +14112,13 @@ class Obj2 {
1411214112 || Obj2::validateFormatException($this->formatException)
1411314113 || Obj2::validateFriend($this->friend)
1411414114 || Obj2::validateFrom($this->from)
14115+ || Obj2::validateFromDict($this->fromDict)
1411514116 || Obj2::validateFromJSON($this->fromJSON)
1411614117 || Obj2::validateFunc($this->func)
1411714118 || Obj2::validateFunction($this->function)
1411814119 || Obj2::validateGet($this->get)
1411914120 || Obj2::validateGlobal($this->global)
1412014121 || Obj2::validateGo($this->go)
14121- || Obj2::validateGoto($this->goto)
1412214122 || Obj2::validateObj2False($this->obj2False);
1412314123 }
1412414124
@@ -14185,13 +14185,13 @@ class Obj2 {
1418514185 $out->{'FormatException'} = $this->toFormatException();
1418614186 $out->{'friend'} = $this->toFriend();
1418714187 $out->{'from'} = $this->toFrom();
14188+ $out->{'from_dict'} = $this->toFromDict();
1418814189 $out->{'from_json'} = $this->toFromJSON();
1418914190 $out->{'func'} = $this->toFunc();
1419014191 $out->{'function'} = $this->toFunction();
1419114192 $out->{'get'} = $this->toGet();
1419214193 $out->{'global'} = $this->toGlobal();
1419314194 $out->{'go'} = $this->toGo();
14194- $out->{'goto'} = $this->toGoto();
1419514195 $out->{'false'} = $this->toObj2False();
1419614196 return $out;
1419714197 }
@@ -14373,6 +14373,9 @@ class Obj2 {
1437314373 if (!property_exists($obj, 'from')) {
1437414374 throw new Exception("Missing required property");
1437514375 }
14376+ if (!property_exists($obj, 'from_dict')) {
14377+ throw new Exception("Missing required property");
14378+ }
1437614379 if (!property_exists($obj, 'from_json')) {
1437714380 throw new Exception("Missing required property");
1437814381 }
@@ -14391,9 +14394,6 @@ class Obj2 {
1439114394 if (!property_exists($obj, 'go')) {
1439214395 throw new Exception("Missing required property");
1439314396 }
14394- if (!property_exists($obj, 'goto')) {
14395- throw new Exception("Missing required property");
14396- }
1439714397 if (!property_exists($obj, 'false')) {
1439814398 throw new Exception("Missing required property");
1439914399 }
@@ -14418,7 +14418,7 @@ class Obj2 {
1441814418 ,Obj2::fromDel($obj->{'del'})
1441914419 ,Obj2::fromDelegate($obj->{'delegate'})
1442014420 ,Obj2::fromDelete($obj->{'delete'})
14421- ,Obj2::fromDict($obj->{'dict'})
14421+ ,Obj2::purpleFromDict($obj->{'dict'})
1442214422 ,Obj2::fromDictionary($obj->{'dictionary'})
1442314423 ,Obj2::fromDidSet($obj->{'didSet'})
1442414424 ,Obj2::fromDo($obj->{'do'})
@@ -14455,13 +14455,13 @@ class Obj2 {
1445514455 ,Obj2::fromFormatException($obj->{'FormatException'})
1445614456 ,Obj2::fromFriend($obj->{'friend'})
1445714457 ,Obj2::fromFrom($obj->{'from'})
14458+ ,Obj2::fromFromDict($obj->{'from_dict'})
1445814459 ,Obj2::fromFromJSON($obj->{'from_json'})
1445914460 ,Obj2::fromFunc($obj->{'func'})
1446014461 ,Obj2::fromFunction($obj->{'function'})
1446114462 ,Obj2::fromGet($obj->{'get'})
1446214463 ,Obj2::fromGlobal($obj->{'global'})
1446314464 ,Obj2::fromGo($obj->{'go'})
14464- ,Obj2::fromGoto($obj->{'goto'})
1446514465 ,Obj2::fromObj2False($obj->{'false'})
1446614466 );
1446714467 }
@@ -14528,13 +14528,13 @@ class Obj2 {
1452814528 ,Obj2::sampleFormatException()
1452914529 ,Obj2::sampleFriend()
1453014530 ,Obj2::sampleFrom()
14531+ ,Obj2::sampleFromDict()
1453114532 ,Obj2::sampleFromJSON()
1453214533 ,Obj2::sampleFunc()
1453314534 ,Obj2::sampleFunction()
1453414535 ,Obj2::sampleGet()
1453514536 ,Obj2::sampleGlobal()
1453614537 ,Obj2::sampleGo()
14537- ,Obj2::sampleGoto()
1453814538 ,Obj2::sampleObj2False()
1453914539 );
1454014540 }
@@ -20264,6 +20264,107 @@ class From {
2026420264 }
2026520265 }
2026620266
20267+// This is an autogenerated file:FromDict
20268+
20269+class FromDict {
20270+ private int $fromDict; // json:from_dict Required
20271+
20272+ /**
20273+ * @param int $fromDict
20274+ */
20275+ public function __construct(int $fromDict) {
20276+ $this->fromDict = $fromDict;
20277+ }
20278+
20279+ /**
20280+ * @param int $value
20281+ * @throws Exception
20282+ * @return int
20283+ */
20284+ public static function fromFromDict(int $value): int {
20285+ return $value; /*int*/
20286+ }
20287+
20288+ /**
20289+ * @throws Exception
20290+ * @return int
20291+ */
20292+ public function toFromDict(): int {
20293+ if (FromDict::validateFromDict($this->fromDict)) {
20294+ return $this->fromDict; /*int*/
20295+ }
20296+ throw new Exception('never get to this FromDict::fromDict');
20297+ }
20298+
20299+ /**
20300+ * @param int
20301+ * @return bool
20302+ * @throws Exception
20303+ */
20304+ public static function validateFromDict(int $value): bool {
20305+ return true;
20306+ }
20307+
20308+ /**
20309+ * @throws Exception
20310+ * @return int
20311+ */
20312+ public function getFromDict(): int {
20313+ if (FromDict::validateFromDict($this->fromDict)) {
20314+ return $this->fromDict;
20315+ }
20316+ throw new Exception('never get to getFromDict FromDict::fromDict');
20317+ }
20318+
20319+ /**
20320+ * @return int
20321+ */
20322+ public static function sampleFromDict(): int {
20323+ return 31; /*31:fromDict*/
20324+ }
20325+
20326+ /**
20327+ * @throws Exception
20328+ * @return bool
20329+ */
20330+ public function validate(): bool {
20331+ return FromDict::validateFromDict($this->fromDict);
20332+ }
20333+
20334+ /**
20335+ * @return stdClass
20336+ * @throws Exception
20337+ */
20338+ public function to(): stdClass {
20339+ $out = new stdClass();
20340+ $out->{'from_dict'} = $this->toFromDict();
20341+ return $out;
20342+ }
20343+
20344+ /**
20345+ * @param stdClass $obj
20346+ * @return FromDict
20347+ * @throws Exception
20348+ */
20349+ public static function from(stdClass $obj): FromDict {
20350+ if (!property_exists($obj, 'from_dict')) {
20351+ throw new Exception("Missing required property");
20352+ }
20353+ return new FromDict(
20354+ FromDict::fromFromDict($obj->{'from_dict'})
20355+ );
20356+ }
20357+
20358+ /**
20359+ * @return FromDict
20360+ */
20361+ public static function sample(): FromDict {
20362+ return new FromDict(
20363+ FromDict::sampleFromDict()
20364+ );
20365+ }
20366+}
20367+
2026720368 // This is an autogenerated file:FromJSON
2026820369
2026920370 class FromJSON {
@@ -20870,107 +20971,6 @@ class Go {
2087020971 }
2087120972 }
2087220973
20873-// This is an autogenerated file:GotoClass
20874-
20875-class GotoClass {
20876- private int $goto; // json:goto Required
20877-
20878- /**
20879- * @param int $goto
20880- */
20881- public function __construct(int $goto) {
20882- $this->goto = $goto;
20883- }
20884-
20885- /**
20886- * @param int $value
20887- * @throws Exception
20888- * @return int
20889- */
20890- public static function fromGoto(int $value): int {
20891- return $value; /*int*/
20892- }
20893-
20894- /**
20895- * @throws Exception
20896- * @return int
20897- */
20898- public function toGoto(): int {
20899- if (GotoClass::validateGoto($this->goto)) {
20900- return $this->goto; /*int*/
20901- }
20902- throw new Exception('never get to this GotoClass::goto');
20903- }
20904-
20905- /**
20906- * @param int
20907- * @return bool
20908- * @throws Exception
20909- */
20910- public static function validateGoto(int $value): bool {
20911- return true;
20912- }
20913-
20914- /**
20915- * @throws Exception
20916- * @return int
20917- */
20918- public function getGoto(): int {
20919- if (GotoClass::validateGoto($this->goto)) {
20920- return $this->goto;
20921- }
20922- throw new Exception('never get to getGoto GotoClass::goto');
20923- }
20924-
20925- /**
20926- * @return int
20927- */
20928- public static function sampleGoto(): int {
20929- return 31; /*31:goto*/
20930- }
20931-
20932- /**
20933- * @throws Exception
20934- * @return bool
20935- */
20936- public function validate(): bool {
20937- return GotoClass::validateGoto($this->goto);
20938- }
20939-
20940- /**
20941- * @return stdClass
20942- * @throws Exception
20943- */
20944- public function to(): stdClass {
20945- $out = new stdClass();
20946- $out->{'goto'} = $this->toGoto();
20947- return $out;
20948- }
20949-
20950- /**
20951- * @param stdClass $obj
20952- * @return GotoClass
20953- * @throws Exception
20954- */
20955- public static function from(stdClass $obj): GotoClass {
20956- if (!property_exists($obj, 'goto')) {
20957- throw new Exception("Missing required property");
20958- }
20959- return new GotoClass(
20960- GotoClass::fromGoto($obj->{'goto'})
20961- );
20962- }
20963-
20964- /**
20965- * @return GotoClass
20966- */
20967- public static function sample(): GotoClass {
20968- return new GotoClass(
20969- GotoClass::sampleGoto()
20970- );
20971- }
20972-}
20973-
2097420974 // This is an autogenerated file:Obj2False
2097520975
2097620976 class Obj2False {
@@ -21076,6 +21076,7 @@ class Obj2False {
2107621076
2107721077 class Obj3 {
2107821078 private int $dummy; // json:dummy Required
21079+ private GotoClass $goto; // json:goto Required
2107921080 private Guard $guard; // json:guard Required
2108021081 private HasOwnProperty $hasOwnProperty; // json:hasOwnProperty Required
2108121082 private HashCode $hashCode; // json:hashCode Required
@@ -21129,6 +21130,7 @@ class Obj3 {
2112921130 private Long $long; // json:long Required
2113021131 private Map $map; // json:map Required
2113121132 private MapEntry $mapEntry; // json:MapEntry Required
21133+ private MarshalJSON $marshalJSON; // json:MarshalJSON Required
2113221134 private MetadataPropertyHandling $metadataPropertyHandling; // json:metadata_property_handling Required
2113321135 private Module $module; // json:module Required
2113421136 private Mutable $mutable; // json:mutable Required
@@ -21139,10 +21141,10 @@ class Obj3 {
2113921141 private Newtonsoft $newtonsoft; // json:newtonsoft Required
2114021142 private Nil $nil; // json:nil Required
2114121143 private No $no; // json:NO Required
21142- private Noexcept $noexcept; // json:noexcept Required
2114321144
2114421145 /**
2114521146 * @param int $dummy
21147+ * @param GotoClass $goto
2114621148 * @param Guard $guard
2114721149 * @param HasOwnProperty $hasOwnProperty
2114821150 * @param HashCode $hashCode
@@ -21196,6 +21198,7 @@ class Obj3 {
2119621198 * @param Long $long
2119721199 * @param Map $map
2119821200 * @param MapEntry $mapEntry
21201+ * @param MarshalJSON $marshalJSON
2119921202 * @param MetadataPropertyHandling $metadataPropertyHandling
2120021203 * @param Module $module
2120121204 * @param Mutable $mutable
@@ -21206,10 +21209,10 @@ class Obj3 {
2120621209 * @param Newtonsoft $newtonsoft
2120721210 * @param Nil $nil
2120821211 * @param No $no
21209- * @param Noexcept $noexcept
2121021212 */
21211- public function __construct(int $dummy, Guard $guard, HasOwnProperty $hasOwnProperty, HashCode $hashCode, Hashable $hashable, Hasher $hasher, ID $id, IfClass $if, Imp $imp, ImplementsClass $implements, Implicit $implicit, Import $import, In $in, Indirect $indirect, Infix $infix, Init $init, Inline $inline, Inout $inout, InstanceofClass $instanceof, IntClass $int, InterfaceClass $interface, Internal $internal, Is $is, ISODateTimeOffsetConverter $isoDateTimeOffsetConverter, IterableClass $iterable, Jdec $jdec, Jenc $jenc, Jpipe $jpipe, JSON $json, JSONAny $jsonAny, JSONCodingKey $jsonCodingKey, JSONConverter $jsonConverter, JSONDecoder $jsonDecoder, JSONEncoder $jsonEncoder, JSONExceptionClass $jsonException, JSONGenerator $jsonGenerator, JSONNode $jsonNode, JSONNull $jsonNull, JSONParser $jsonParser, JSONReader $jsonReader, JSONSerializer $jsonSerializer, JSONToken $jsonToken, JSONTokenType $jsonTokenType, JSONWriter $jsonWriter, Lambda $lambda, Lazy $lazy, Left $left, Let $let, ListClass $list, LocaleClass $locale, Lock $lock, Long $long, Map $map, MapEntry $mapEntry, MetadataPropertyHandling $metadataPropertyHandling, Module $module, Mutable $mutable, Mutating $mutating, NamespaceClass $namespace, Native $native, NewClass $new, Newtonsoft $newtonsoft, Nil $nil, No $no, Noexcept $noexcept) {
21213+ public function __construct(int $dummy, GotoClass $goto, Guard $guard, HasOwnProperty $hasOwnProperty, HashCode $hashCode, Hashable $hashable, Hasher $hasher, ID $id, IfClass $if, Imp $imp, ImplementsClass $implements, Implicit $implicit, Import $import, In $in, Indirect $indirect, Infix $infix, Init $init, Inline $inline, Inout $inout, InstanceofClass $instanceof, IntClass $int, InterfaceClass $interface, Internal $internal, Is $is, ISODateTimeOffsetConverter $isoDateTimeOffsetConverter, IterableClass $iterable, Jdec $jdec, Jenc $jenc, Jpipe $jpipe, JSON $json, JSONAny $jsonAny, JSONCodingKey $jsonCodingKey, JSONConverter $jsonConverter, JSONDecoder $jsonDecoder, JSONEncoder $jsonEncoder, JSONExceptionClass $jsonException, JSONGenerator $jsonGenerator, JSONNode $jsonNode, JSONNull $jsonNull, JSONParser $jsonParser, JSONReader $jsonReader, JSONSerializer $jsonSerializer, JSONToken $jsonToken, JSONTokenType $jsonTokenType, JSONWriter $jsonWriter, Lambda $lambda, Lazy $lazy, Left $left, Let $let, ListClass $list, LocaleClass $locale, Lock $lock, Long $long, Map $map, MapEntry $mapEntry, MarshalJSON $marshalJSON, MetadataPropertyHandling $metadataPropertyHandling, Module $module, Mutable $mutable, Mutating $mutating, NamespaceClass $namespace, Native $native, NewClass $new, Newtonsoft $newtonsoft, Nil $nil, No $no) {
2121221214 $this->dummy = $dummy;
21215+ $this->goto = $goto;
2121321216 $this->guard = $guard;
2121421217 $this->hasOwnProperty = $hasOwnProperty;
2121521218 $this->hashCode = $hashCode;
@@ -21263,6 +21266,7 @@ class Obj3 {
2126321266 $this->long = $long;
2126421267 $this->map = $map;
2126521268 $this->mapEntry = $mapEntry;
21269+ $this->marshalJSON = $marshalJSON;
2126621270 $this->metadataPropertyHandling = $metadataPropertyHandling;
2126721271 $this->module = $module;
2126821272 $this->mutable = $mutable;
@@ -21273,7 +21277,6 @@ class Obj3 {
2127321277 $this->newtonsoft = $newtonsoft;
2127421278 $this->nil = $nil;
2127521279 $this->no = $no;
21276- $this->noexcept = $noexcept;
2127721280 }
2127821281
2127921282 /**
@@ -21323,6 +21326,54 @@ class Obj3 {
2132321326 return 31; /*31:dummy*/
2132421327 }
2132521328
21329+ /**
21330+ * @param stdClass $value
21331+ * @throws Exception
21332+ * @return GotoClass
21333+ */
21334+ public static function fromGoto(stdClass $value): GotoClass {
21335+ return GotoClass::from($value); /*class*/
21336+ }
21337+
21338+ /**
21339+ * @throws Exception
21340+ * @return stdClass
21341+ */
21342+ public function toGoto(): stdClass {
21343+ if (Obj3::validateGoto($this->goto)) {
21344+ return $this->goto->to(); /*class*/
21345+ }
21346+ throw new Exception('never get to this Obj3::goto');
21347+ }
21348+
21349+ /**
21350+ * @param GotoClass
21351+ * @return bool
21352+ * @throws Exception
21353+ */
21354+ public static function validateGoto(GotoClass $value): bool {
21355+ $value->validate();
21356+ return true;
21357+ }
21358+
21359+ /**
21360+ * @throws Exception
21361+ * @return GotoClass
21362+ */
21363+ public function getGoto(): GotoClass {
21364+ if (Obj3::validateGoto($this->goto)) {
21365+ return $this->goto;
21366+ }
21367+ throw new Exception('never get to getGoto Obj3::goto');
21368+ }
21369+
21370+ /**
21371+ * @return GotoClass
21372+ */
21373+ public static function sampleGoto(): GotoClass {
21374+ return GotoClass::sample(); /*32:goto*/
21375+ }
21376+
2132621377 /**
2132721378 * @param stdClass $value
2132821379 * @throws Exception
@@ -21368,7 +21419,7 @@ class Obj3 {
2136821419 * @return Guard
2136921420 */
2137021421 public static function sampleGuard(): Guard {
21371- return Guard::sample(); /*32:guard*/
21422+ return Guard::sample(); /*33:guard*/
2137221423 }
2137321424
2137421425 /**
@@ -21416,7 +21467,7 @@ class Obj3 {
2141621467 * @return HasOwnProperty
2141721468 */
2141821469 public static function sampleHasOwnProperty(): HasOwnProperty {
21419- return HasOwnProperty::sample(); /*33:hasOwnProperty*/
21470+ return HasOwnProperty::sample(); /*34:hasOwnProperty*/
2142021471 }
2142121472
2142221473 /**
@@ -21464,7 +21515,7 @@ class Obj3 {
2146421515 * @return HashCode
2146521516 */
2146621517 public static function sampleHashCode(): HashCode {
21467- return HashCode::sample(); /*34:hashCode*/
21518+ return HashCode::sample(); /*35:hashCode*/
2146821519 }
2146921520
2147021521 /**
@@ -21512,7 +21563,7 @@ class Obj3 {
2151221563 * @return Hashable
2151321564 */
2151421565 public static function sampleHashable(): Hashable {
21515- return Hashable::sample(); /*35:hashable*/
21566+ return Hashable::sample(); /*36:hashable*/
2151621567 }
2151721568
2151821569 /**
@@ -21560,7 +21611,7 @@ class Obj3 {
2156021611 * @return Hasher
2156121612 */
2156221613 public static function sampleHasher(): Hasher {
21563- return Hasher::sample(); /*36:hasher*/
21614+ return Hasher::sample(); /*37:hasher*/
2156421615 }
2156521616
2156621617 /**
@@ -21608,7 +21659,7 @@ class Obj3 {
2160821659 * @return ID
2160921660 */
2161021661 public static function sampleID(): ID {
21611- return ID::sample(); /*37:id*/
21662+ return ID::sample(); /*38:id*/
2161221663 }
2161321664
2161421665 /**
@@ -21656,7 +21707,7 @@ class Obj3 {
2165621707 * @return IfClass
2165721708 */
2165821709 public static function sampleIf(): IfClass {
21659- return IfClass::sample(); /*38:if*/
21710+ return IfClass::sample(); /*39:if*/
2166021711 }
2166121712
2166221713 /**
@@ -21704,7 +21755,7 @@ class Obj3 {
2170421755 * @return Imp
2170521756 */
2170621757 public static function sampleImp(): Imp {
21707- return Imp::sample(); /*39:imp*/
21758+ return Imp::sample(); /*40:imp*/
2170821759 }
2170921760
2171021761 /**
@@ -21752,7 +21803,7 @@ class Obj3 {
2175221803 * @return ImplementsClass
2175321804 */
2175421805 public static function sampleImplements(): ImplementsClass {
21755- return ImplementsClass::sample(); /*40:implements*/
21806+ return ImplementsClass::sample(); /*41:implements*/
2175621807 }
2175721808
2175821809 /**
@@ -21800,7 +21851,7 @@ class Obj3 {
2180021851 * @return Implicit
2180121852 */
2180221853 public static function sampleImplicit(): Implicit {
21803- return Implicit::sample(); /*41:implicit*/
21854+ return Implicit::sample(); /*42:implicit*/
2180421855 }
2180521856
2180621857 /**
@@ -21848,7 +21899,7 @@ class Obj3 {
2184821899 * @return Import
2184921900 */
2185021901 public static function sampleImport(): Import {
21851- return Import::sample(); /*42:import*/
21902+ return Import::sample(); /*43:import*/
2185221903 }
2185321904
2185421905 /**
@@ -21896,7 +21947,7 @@ class Obj3 {
2189621947 * @return In
2189721948 */
2189821949 public static function sampleIn(): In {
21899- return In::sample(); /*43:in*/
21950+ return In::sample(); /*44:in*/
2190021951 }
2190121952
2190221953 /**
@@ -21944,7 +21995,7 @@ class Obj3 {
2194421995 * @return Indirect
2194521996 */
2194621997 public static function sampleIndirect(): Indirect {
21947- return Indirect::sample(); /*44:indirect*/
21998+ return Indirect::sample(); /*45:indirect*/
2194821999 }
2194922000
2195022001 /**
@@ -21992,7 +22043,7 @@ class Obj3 {
2199222043 * @return Infix
2199322044 */
2199422045 public static function sampleInfix(): Infix {
21995- return Infix::sample(); /*45:infix*/
22046+ return Infix::sample(); /*46:infix*/
2199622047 }
2199722048
2199822049 /**
@@ -22040,7 +22091,7 @@ class Obj3 {
2204022091 * @return Init
2204122092 */
2204222093 public static function sampleInit(): Init {
22043- return Init::sample(); /*46:init*/
22094+ return Init::sample(); /*47:init*/
2204422095 }
2204522096
2204622097 /**
@@ -22088,7 +22139,7 @@ class Obj3 {
2208822139 * @return Inline
2208922140 */
2209022141 public static function sampleInline(): Inline {
22091- return Inline::sample(); /*47:inline*/
22142+ return Inline::sample(); /*48:inline*/
2209222143 }
2209322144
2209422145 /**
@@ -22136,7 +22187,7 @@ class Obj3 {
2213622187 * @return Inout
2213722188 */
2213822189 public static function sampleInout(): Inout {
22139- return Inout::sample(); /*48:inout*/
22190+ return Inout::sample(); /*49:inout*/
2214022191 }
2214122192
2214222193 /**
@@ -22184,7 +22235,7 @@ class Obj3 {
2218422235 * @return InstanceofClass
2218522236 */
2218622237 public static function sampleInstanceof(): InstanceofClass {
22187- return InstanceofClass::sample(); /*49:instanceof*/
22238+ return InstanceofClass::sample(); /*50:instanceof*/
2218822239 }
2218922240
2219022241 /**
@@ -22232,7 +22283,7 @@ class Obj3 {
2223222283 * @return IntClass
2223322284 */
2223422285 public static function sampleInt(): IntClass {
22235- return IntClass::sample(); /*50:int*/
22286+ return IntClass::sample(); /*51:int*/
2223622287 }
2223722288
2223822289 /**
@@ -22280,7 +22331,7 @@ class Obj3 {
2228022331 * @return InterfaceClass
2228122332 */
2228222333 public static function sampleInterface(): InterfaceClass {
22283- return InterfaceClass::sample(); /*51:interface*/
22334+ return InterfaceClass::sample(); /*52:interface*/
2228422335 }
2228522336
2228622337 /**
@@ -22328,7 +22379,7 @@ class Obj3 {
2232822379 * @return Internal
2232922380 */
2233022381 public static function sampleInternal(): Internal {
22331- return Internal::sample(); /*52:internal*/
22382+ return Internal::sample(); /*53:internal*/
2233222383 }
2233322384
2233422385 /**
@@ -22376,7 +22427,7 @@ class Obj3 {
2237622427 * @return Is
2237722428 */
2237822429 public static function sampleIs(): Is {
22379- return Is::sample(); /*53:is*/
22430+ return Is::sample(); /*54:is*/
2238022431 }
2238122432
2238222433 /**
@@ -22424,7 +22475,7 @@ class Obj3 {
2242422475 * @return ISODateTimeOffsetConverter
2242522476 */
2242622477 public static function sampleISODateTimeOffsetConverter(): ISODateTimeOffsetConverter {
22427- return ISODateTimeOffsetConverter::sample(); /*54:isoDateTimeOffsetConverter*/
22478+ return ISODateTimeOffsetConverter::sample(); /*55:isoDateTimeOffsetConverter*/
2242822479 }
2242922480
2243022481 /**
@@ -22472,7 +22523,7 @@ class Obj3 {
2247222523 * @return IterableClass
2247322524 */
2247422525 public static function sampleIterable(): IterableClass {
22475- return IterableClass::sample(); /*55:iterable*/
22526+ return IterableClass::sample(); /*56:iterable*/
2247622527 }
2247722528
2247822529 /**
@@ -22520,7 +22571,7 @@ class Obj3 {
2252022571 * @return Jdec
2252122572 */
2252222573 public static function sampleJdec(): Jdec {
22523- return Jdec::sample(); /*56:jdec*/
22574+ return Jdec::sample(); /*57:jdec*/
2252422575 }
2252522576
2252622577 /**
@@ -22568,7 +22619,7 @@ class Obj3 {
2256822619 * @return Jenc
2256922620 */
2257022621 public static function sampleJenc(): Jenc {
22571- return Jenc::sample(); /*57:jenc*/
22622+ return Jenc::sample(); /*58:jenc*/
2257222623 }
2257322624
2257422625 /**
@@ -22616,7 +22667,7 @@ class Obj3 {
2261622667 * @return Jpipe
2261722668 */
2261822669 public static function sampleJpipe(): Jpipe {
22619- return Jpipe::sample(); /*58:jpipe*/
22670+ return Jpipe::sample(); /*59:jpipe*/
2262022671 }
2262122672
2262222673 /**
@@ -22664,7 +22715,7 @@ class Obj3 {
2266422715 * @return JSON
2266522716 */
2266622717 public static function sampleJSON(): JSON {
22667- return JSON::sample(); /*59:json*/
22718+ return JSON::sample(); /*60:json*/
2266822719 }
2266922720
2267022721 /**
@@ -22712,7 +22763,7 @@ class Obj3 {
2271222763 * @return JSONAny
2271322764 */
2271422765 public static function sampleJSONAny(): JSONAny {
22715- return JSONAny::sample(); /*60:jsonAny*/
22766+ return JSONAny::sample(); /*61:jsonAny*/
2271622767 }
2271722768
2271822769 /**
@@ -22760,7 +22811,7 @@ class Obj3 {
2276022811 * @return JSONCodingKey
2276122812 */
2276222813 public static function sampleJSONCodingKey(): JSONCodingKey {
22763- return JSONCodingKey::sample(); /*61:jsonCodingKey*/
22814+ return JSONCodingKey::sample(); /*62:jsonCodingKey*/
2276422815 }
2276522816
2276622817 /**
@@ -22808,7 +22859,7 @@ class Obj3 {
2280822859 * @return JSONConverter
2280922860 */
2281022861 public static function sampleJSONConverter(): JSONConverter {
22811- return JSONConverter::sample(); /*62:jsonConverter*/
22862+ return JSONConverter::sample(); /*63:jsonConverter*/
2281222863 }
2281322864
2281422865 /**
@@ -22856,7 +22907,7 @@ class Obj3 {
2285622907 * @return JSONDecoder
2285722908 */
2285822909 public static function sampleJSONDecoder(): JSONDecoder {
22859- return JSONDecoder::sample(); /*63:jsonDecoder*/
22910+ return JSONDecoder::sample(); /*64:jsonDecoder*/
2286022911 }
2286122912
2286222913 /**
@@ -22904,7 +22955,7 @@ class Obj3 {
2290422955 * @return JSONEncoder
2290522956 */
2290622957 public static function sampleJSONEncoder(): JSONEncoder {
22907- return JSONEncoder::sample(); /*64:jsonEncoder*/
22958+ return JSONEncoder::sample(); /*65:jsonEncoder*/
2290822959 }
2290922960
2291022961 /**
@@ -22952,7 +23003,7 @@ class Obj3 {
2295223003 * @return JSONExceptionClass
2295323004 */
2295423005 public static function sampleJSONException(): JSONExceptionClass {
22955- return JSONExceptionClass::sample(); /*65:jsonException*/
23006+ return JSONExceptionClass::sample(); /*66:jsonException*/
2295623007 }
2295723008
2295823009 /**
@@ -23000,7 +23051,7 @@ class Obj3 {
2300023051 * @return JSONGenerator
2300123052 */
2300223053 public static function sampleJSONGenerator(): JSONGenerator {
23003- return JSONGenerator::sample(); /*66:jsonGenerator*/
23054+ return JSONGenerator::sample(); /*67:jsonGenerator*/
2300423055 }
2300523056
2300623057 /**
@@ -23048,7 +23099,7 @@ class Obj3 {
2304823099 * @return JSONNode
2304923100 */
2305023101 public static function sampleJSONNode(): JSONNode {
23051- return JSONNode::sample(); /*67:jsonNode*/
23102+ return JSONNode::sample(); /*68:jsonNode*/
2305223103 }
2305323104
2305423105 /**
@@ -23096,7 +23147,7 @@ class Obj3 {
2309623147 * @return JSONNull
2309723148 */
2309823149 public static function sampleJSONNull(): JSONNull {
23099- return JSONNull::sample(); /*68:jsonNull*/
23150+ return JSONNull::sample(); /*69:jsonNull*/
2310023151 }
2310123152
2310223153 /**
@@ -23144,7 +23195,7 @@ class Obj3 {
2314423195 * @return JSONParser
2314523196 */
2314623197 public static function sampleJSONParser(): JSONParser {
23147- return JSONParser::sample(); /*69:jsonParser*/
23198+ return JSONParser::sample(); /*70:jsonParser*/
2314823199 }
2314923200
2315023201 /**
@@ -23192,7 +23243,7 @@ class Obj3 {
2319223243 * @return JSONReader
2319323244 */
2319423245 public static function sampleJSONReader(): JSONReader {
23195- return JSONReader::sample(); /*70:jsonReader*/
23246+ return JSONReader::sample(); /*71:jsonReader*/
2319623247 }
2319723248
2319823249 /**
@@ -23240,7 +23291,7 @@ class Obj3 {
2324023291 * @return JSONSerializer
2324123292 */
2324223293 public static function sampleJSONSerializer(): JSONSerializer {
23243- return JSONSerializer::sample(); /*71:jsonSerializer*/
23294+ return JSONSerializer::sample(); /*72:jsonSerializer*/
2324423295 }
2324523296
2324623297 /**
@@ -23288,7 +23339,7 @@ class Obj3 {
2328823339 * @return JSONToken
2328923340 */
2329023341 public static function sampleJSONToken(): JSONToken {
23291- return JSONToken::sample(); /*72:jsonToken*/
23342+ return JSONToken::sample(); /*73:jsonToken*/
2329223343 }
2329323344
2329423345 /**
@@ -23336,7 +23387,7 @@ class Obj3 {
2333623387 * @return JSONTokenType
2333723388 */
2333823389 public static function sampleJSONTokenType(): JSONTokenType {
23339- return JSONTokenType::sample(); /*73:jsonTokenType*/
23390+ return JSONTokenType::sample(); /*74:jsonTokenType*/
2334023391 }
2334123392
2334223393 /**
@@ -23384,7 +23435,7 @@ class Obj3 {
2338423435 * @return JSONWriter
2338523436 */
2338623437 public static function sampleJSONWriter(): JSONWriter {
23387- return JSONWriter::sample(); /*74:jsonWriter*/
23438+ return JSONWriter::sample(); /*75:jsonWriter*/
2338823439 }
2338923440
2339023441 /**
@@ -23432,7 +23483,7 @@ class Obj3 {
2343223483 * @return Lambda
2343323484 */
2343423485 public static function sampleLambda(): Lambda {
23435- return Lambda::sample(); /*75:lambda*/
23486+ return Lambda::sample(); /*76:lambda*/
2343623487 }
2343723488
2343823489 /**
@@ -23480,7 +23531,7 @@ class Obj3 {
2348023531 * @return Lazy
2348123532 */
2348223533 public static function sampleLazy(): Lazy {
23483- return Lazy::sample(); /*76:lazy*/
23534+ return Lazy::sample(); /*77:lazy*/
2348423535 }
2348523536
2348623537 /**
@@ -23528,7 +23579,7 @@ class Obj3 {
2352823579 * @return Left
2352923580 */
2353023581 public static function sampleLeft(): Left {
23531- return Left::sample(); /*77:left*/
23582+ return Left::sample(); /*78:left*/
2353223583 }
2353323584
2353423585 /**
@@ -23576,7 +23627,7 @@ class Obj3 {
2357623627 * @return Let
2357723628 */
2357823629 public static function sampleLet(): Let {
23579- return Let::sample(); /*78:let*/
23630+ return Let::sample(); /*79:let*/
2358023631 }
2358123632
2358223633 /**
@@ -23624,7 +23675,7 @@ class Obj3 {
2362423675 * @return ListClass
2362523676 */
2362623677 public static function sampleList(): ListClass {
23627- return ListClass::sample(); /*79:list*/
23678+ return ListClass::sample(); /*80:list*/
2362823679 }
2362923680
2363023681 /**
@@ -23672,7 +23723,7 @@ class Obj3 {
2367223723 * @return LocaleClass
2367323724 */
2367423725 public static function sampleLocale(): LocaleClass {
23675- return LocaleClass::sample(); /*80:locale*/
23726+ return LocaleClass::sample(); /*81:locale*/
2367623727 }
2367723728
2367823729 /**
@@ -23720,7 +23771,7 @@ class Obj3 {
2372023771 * @return Lock
2372123772 */
2372223773 public static function sampleLock(): Lock {
23723- return Lock::sample(); /*81:lock*/
23774+ return Lock::sample(); /*82:lock*/
2372423775 }
2372523776
2372623777 /**
@@ -23768,7 +23819,7 @@ class Obj3 {
2376823819 * @return Long
2376923820 */
2377023821 public static function sampleLong(): Long {
23771- return Long::sample(); /*82:long*/
23822+ return Long::sample(); /*83:long*/
2377223823 }
2377323824
2377423825 /**
@@ -23816,7 +23867,7 @@ class Obj3 {
2381623867 * @return Map
2381723868 */
2381823869 public static function sampleMap(): Map {
23819- return Map::sample(); /*83:map*/
23870+ return Map::sample(); /*84:map*/
2382023871 }
2382123872
2382223873 /**
@@ -23864,7 +23915,55 @@ class Obj3 {
2386423915 * @return MapEntry
2386523916 */
2386623917 public static function sampleMapEntry(): MapEntry {
23867- return MapEntry::sample(); /*84:mapEntry*/
23918+ return MapEntry::sample(); /*85:mapEntry*/
23919+ }
23920+
23921+ /**
23922+ * @param stdClass $value
23923+ * @throws Exception
23924+ * @return MarshalJSON
23925+ */
23926+ public static function fromMarshalJSON(stdClass $value): MarshalJSON {
23927+ return MarshalJSON::from($value); /*class*/
23928+ }
23929+
23930+ /**
23931+ * @throws Exception
23932+ * @return stdClass
23933+ */
23934+ public function toMarshalJSON(): stdClass {
23935+ if (Obj3::validateMarshalJSON($this->marshalJSON)) {
23936+ return $this->marshalJSON->to(); /*class*/
23937+ }
23938+ throw new Exception('never get to this Obj3::marshalJSON');
23939+ }
23940+
23941+ /**
23942+ * @param MarshalJSON
23943+ * @return bool
23944+ * @throws Exception
23945+ */
23946+ public static function validateMarshalJSON(MarshalJSON $value): bool {
23947+ $value->validate();
23948+ return true;
23949+ }
23950+
23951+ /**
23952+ * @throws Exception
23953+ * @return MarshalJSON
23954+ */
23955+ public function getMarshalJSON(): MarshalJSON {
23956+ if (Obj3::validateMarshalJSON($this->marshalJSON)) {
23957+ return $this->marshalJSON;
23958+ }
23959+ throw new Exception('never get to getMarshalJSON Obj3::marshalJSON');
23960+ }
23961+
23962+ /**
23963+ * @return MarshalJSON
23964+ */
23965+ public static function sampleMarshalJSON(): MarshalJSON {
23966+ return MarshalJSON::sample(); /*86:marshalJSON*/
2386823967 }
2386923968
2387023969 /**
@@ -23912,7 +24011,7 @@ class Obj3 {
2391224011 * @return MetadataPropertyHandling
2391324012 */
2391424013 public static function sampleMetadataPropertyHandling(): MetadataPropertyHandling {
23915- return MetadataPropertyHandling::sample(); /*85:metadataPropertyHandling*/
24014+ return MetadataPropertyHandling::sample(); /*87:metadataPropertyHandling*/
2391624015 }
2391724016
2391824017 /**
@@ -23960,7 +24059,7 @@ class Obj3 {
2396024059 * @return Module
2396124060 */
2396224061 public static function sampleModule(): Module {
23963- return Module::sample(); /*86:module*/
24062+ return Module::sample(); /*88:module*/
2396424063 }
2396524064
2396624065 /**
@@ -24008,7 +24107,7 @@ class Obj3 {
2400824107 * @return Mutable
2400924108 */
2401024109 public static function sampleMutable(): Mutable {
24011- return Mutable::sample(); /*87:mutable*/
24110+ return Mutable::sample(); /*89:mutable*/
2401224111 }
2401324112
2401424113 /**
@@ -24056,7 +24155,7 @@ class Obj3 {
2405624155 * @return Mutating
2405724156 */
2405824157 public static function sampleMutating(): Mutating {
24059- return Mutating::sample(); /*88:mutating*/
24158+ return Mutating::sample(); /*90:mutating*/
2406024159 }
2406124160
2406224161 /**
@@ -24104,7 +24203,7 @@ class Obj3 {
2410424203 * @return NamespaceClass
2410524204 */
2410624205 public static function sampleNamespace(): NamespaceClass {
24107- return NamespaceClass::sample(); /*89:namespace*/
24206+ return NamespaceClass::sample(); /*91:namespace*/
2410824207 }
2410924208
2411024209 /**
@@ -24152,7 +24251,7 @@ class Obj3 {
2415224251 * @return Native
2415324252 */
2415424253 public static function sampleNative(): Native {
24155- return Native::sample(); /*90:native*/
24254+ return Native::sample(); /*92:native*/
2415624255 }
2415724256
2415824257 /**
@@ -24200,7 +24299,7 @@ class Obj3 {
2420024299 * @return NewClass
2420124300 */
2420224301 public static function sampleNew(): NewClass {
24203- return NewClass::sample(); /*91:new*/
24302+ return NewClass::sample(); /*93:new*/
2420424303 }
2420524304
2420624305 /**
@@ -24248,7 +24347,7 @@ class Obj3 {
2424824347 * @return Newtonsoft
2424924348 */
2425024349 public static function sampleNewtonsoft(): Newtonsoft {
24251- return Newtonsoft::sample(); /*92:newtonsoft*/
24350+ return Newtonsoft::sample(); /*94:newtonsoft*/
2425224351 }
2425324352
2425424353 /**
@@ -24296,7 +24395,7 @@ class Obj3 {
2429624395 * @return Nil
2429724396 */
2429824397 public static function sampleNil(): Nil {
24299- return Nil::sample(); /*93:nil*/
24398+ return Nil::sample(); /*95:nil*/
2430024399 }
2430124400
2430224401 /**
@@ -24344,55 +24443,7 @@ class Obj3 {
2434424443 * @return No
2434524444 */
2434624445 public static function sampleNo(): No {
24347- return No::sample(); /*94:no*/
24348- }
24349-
24350- /**
24351- * @param stdClass $value
24352- * @throws Exception
24353- * @return Noexcept
24354- */
24355- public static function fromNoexcept(stdClass $value): Noexcept {
24356- return Noexcept::from($value); /*class*/
24357- }
24358-
24359- /**
24360- * @throws Exception
24361- * @return stdClass
24362- */
24363- public function toNoexcept(): stdClass {
24364- if (Obj3::validateNoexcept($this->noexcept)) {
24365- return $this->noexcept->to(); /*class*/
24366- }
24367- throw new Exception('never get to this Obj3::noexcept');
24368- }
24369-
24370- /**
24371- * @param Noexcept
24372- * @return bool
24373- * @throws Exception
24374- */
24375- public static function validateNoexcept(Noexcept $value): bool {
24376- $value->validate();
24377- return true;
24378- }
24379-
24380- /**
24381- * @throws Exception
24382- * @return Noexcept
24383- */
24384- public function getNoexcept(): Noexcept {
24385- if (Obj3::validateNoexcept($this->noexcept)) {
24386- return $this->noexcept;
24387- }
24388- throw new Exception('never get to getNoexcept Obj3::noexcept');
24389- }
24390-
24391- /**
24392- * @return Noexcept
24393- */
24394- public static function sampleNoexcept(): Noexcept {
24395- return Noexcept::sample(); /*95:noexcept*/
24446+ return No::sample(); /*96:no*/
2439624447 }
2439724448
2439824449 /**
@@ -24401,6 +24452,7 @@ class Obj3 {
2440124452 */
2440224453 public function validate(): bool {
2440324454 return Obj3::validateDummy($this->dummy)
24455+ || Obj3::validateGoto($this->goto)
2440424456 || Obj3::validateGuard($this->guard)
2440524457 || Obj3::validateHasOwnProperty($this->hasOwnProperty)
2440624458 || Obj3::validateHashCode($this->hashCode)
@@ -24454,6 +24506,7 @@ class Obj3 {
2445424506 || Obj3::validateLong($this->long)
2445524507 || Obj3::validateMap($this->map)
2445624508 || Obj3::validateMapEntry($this->mapEntry)
24509+ || Obj3::validateMarshalJSON($this->marshalJSON)
2445724510 || Obj3::validateMetadataPropertyHandling($this->metadataPropertyHandling)
2445824511 || Obj3::validateModule($this->module)
2445924512 || Obj3::validateMutable($this->mutable)
@@ -24463,8 +24516,7 @@ class Obj3 {
2446324516 || Obj3::validateNew($this->new)
2446424517 || Obj3::validateNewtonsoft($this->newtonsoft)
2446524518 || Obj3::validateNil($this->nil)
24466- || Obj3::validateNo($this->no)
24467- || Obj3::validateNoexcept($this->noexcept);
24519+ || Obj3::validateNo($this->no);
2446824520 }
2446924521
2447024522 /**
@@ -24474,6 +24526,7 @@ class Obj3 {
2447424526 public function to(): stdClass {
2447524527 $out = new stdClass();
2447624528 $out->{'dummy'} = $this->toDummy();
24529+ $out->{'goto'} = $this->toGoto();
2447724530 $out->{'guard'} = $this->toGuard();
2447824531 $out->{'hasOwnProperty'} = $this->toHasOwnProperty();
2447924532 $out->{'hashCode'} = $this->toHashCode();
@@ -24527,6 +24580,7 @@ class Obj3 {
2452724580 $out->{'long'} = $this->toLong();
2452824581 $out->{'map'} = $this->toMap();
2452924582 $out->{'MapEntry'} = $this->toMapEntry();
24583+ $out->{'MarshalJSON'} = $this->toMarshalJSON();
2453024584 $out->{'metadata_property_handling'} = $this->toMetadataPropertyHandling();
2453124585 $out->{'module'} = $this->toModule();
2453224586 $out->{'mutable'} = $this->toMutable();
@@ -24537,7 +24591,6 @@ class Obj3 {
2453724591 $out->{'newtonsoft'} = $this->toNewtonsoft();
2453824592 $out->{'nil'} = $this->toNil();
2453924593 $out->{'NO'} = $this->toNo();
24540- $out->{'noexcept'} = $this->toNoexcept();
2454124594 return $out;
2454224595 }
2454324596
@@ -24550,6 +24603,9 @@ class Obj3 {
2455024603 if (!property_exists($obj, 'dummy')) {
2455124604 throw new Exception("Missing required property");
2455224605 }
24606+ if (!property_exists($obj, 'goto')) {
24607+ throw new Exception("Missing required property");
24608+ }
2455324609 if (!property_exists($obj, 'guard')) {
2455424610 throw new Exception("Missing required property");
2455524611 }
@@ -24709,6 +24765,9 @@ class Obj3 {
2470924765 if (!property_exists($obj, 'MapEntry')) {
2471024766 throw new Exception("Missing required property");
2471124767 }
24768+ if (!property_exists($obj, 'MarshalJSON')) {
24769+ throw new Exception("Missing required property");
24770+ }
2471224771 if (!property_exists($obj, 'metadata_property_handling')) {
2471324772 throw new Exception("Missing required property");
2471424773 }
@@ -24739,11 +24798,9 @@ class Obj3 {
2473924798 if (!property_exists($obj, 'NO')) {
2474024799 throw new Exception("Missing required property");
2474124800 }
24742- if (!property_exists($obj, 'noexcept')) {
24743- throw new Exception("Missing required property");
24744- }
2474524801 return new Obj3(
2474624802 Obj3::fromDummy($obj->{'dummy'})
24803+ ,Obj3::fromGoto($obj->{'goto'})
2474724804 ,Obj3::fromGuard($obj->{'guard'})
2474824805 ,Obj3::fromHasOwnProperty($obj->{'hasOwnProperty'})
2474924806 ,Obj3::fromHashCode($obj->{'hashCode'})
@@ -24797,6 +24854,7 @@ class Obj3 {
2479724854 ,Obj3::fromLong($obj->{'long'})
2479824855 ,Obj3::fromMap($obj->{'map'})
2479924856 ,Obj3::fromMapEntry($obj->{'MapEntry'})
24857+ ,Obj3::fromMarshalJSON($obj->{'MarshalJSON'})
2480024858 ,Obj3::fromMetadataPropertyHandling($obj->{'metadata_property_handling'})
2480124859 ,Obj3::fromModule($obj->{'module'})
2480224860 ,Obj3::fromMutable($obj->{'mutable'})
@@ -24807,7 +24865,6 @@ class Obj3 {
2480724865 ,Obj3::fromNewtonsoft($obj->{'newtonsoft'})
2480824866 ,Obj3::fromNil($obj->{'nil'})
2480924867 ,Obj3::fromNo($obj->{'NO'})
24810- ,Obj3::fromNoexcept($obj->{'noexcept'})
2481124868 );
2481224869 }
2481324870
@@ -24817,6 +24874,7 @@ class Obj3 {
2481724874 public static function sample(): Obj3 {
2481824875 return new Obj3(
2481924876 Obj3::sampleDummy()
24877+ ,Obj3::sampleGoto()
2482024878 ,Obj3::sampleGuard()
2482124879 ,Obj3::sampleHasOwnProperty()
2482224880 ,Obj3::sampleHashCode()
@@ -24870,6 +24928,7 @@ class Obj3 {
2487024928 ,Obj3::sampleLong()
2487124929 ,Obj3::sampleMap()
2487224930 ,Obj3::sampleMapEntry()
24931+ ,Obj3::sampleMarshalJSON()
2487324932 ,Obj3::sampleMetadataPropertyHandling()
2487424933 ,Obj3::sampleModule()
2487524934 ,Obj3::sampleMutable()
@@ -24880,7 +24939,107 @@ class Obj3 {
2488024939 ,Obj3::sampleNewtonsoft()
2488124940 ,Obj3::sampleNil()
2488224941 ,Obj3::sampleNo()
24883- ,Obj3::sampleNoexcept()
24942+ );
24943+ }
24944+}
24945+
24946+// This is an autogenerated file:GotoClass
24947+
24948+class GotoClass {
24949+ private int $goto; // json:goto Required
24950+
24951+ /**
24952+ * @param int $goto
24953+ */
24954+ public function __construct(int $goto) {
24955+ $this->goto = $goto;
24956+ }
24957+
24958+ /**
24959+ * @param int $value
24960+ * @throws Exception
24961+ * @return int
24962+ */
24963+ public static function fromGoto(int $value): int {
24964+ return $value; /*int*/
24965+ }
24966+
24967+ /**
24968+ * @throws Exception
24969+ * @return int
24970+ */
24971+ public function toGoto(): int {
24972+ if (GotoClass::validateGoto($this->goto)) {
24973+ return $this->goto; /*int*/
24974+ }
24975+ throw new Exception('never get to this GotoClass::goto');
24976+ }
24977+
24978+ /**
24979+ * @param int
24980+ * @return bool
24981+ * @throws Exception
24982+ */
24983+ public static function validateGoto(int $value): bool {
24984+ return true;
24985+ }
24986+
24987+ /**
24988+ * @throws Exception
24989+ * @return int
24990+ */
24991+ public function getGoto(): int {
24992+ if (GotoClass::validateGoto($this->goto)) {
24993+ return $this->goto;
24994+ }
24995+ throw new Exception('never get to getGoto GotoClass::goto');
24996+ }
24997+
24998+ /**
24999+ * @return int
25000+ */
25001+ public static function sampleGoto(): int {
25002+ return 31; /*31:goto*/
25003+ }
25004+
25005+ /**
25006+ * @throws Exception
25007+ * @return bool
25008+ */
25009+ public function validate(): bool {
25010+ return GotoClass::validateGoto($this->goto);
25011+ }
25012+
25013+ /**
25014+ * @return stdClass
25015+ * @throws Exception
25016+ */
25017+ public function to(): stdClass {
25018+ $out = new stdClass();
25019+ $out->{'goto'} = $this->toGoto();
25020+ return $out;
25021+ }
25022+
25023+ /**
25024+ * @param stdClass $obj
25025+ * @return GotoClass
25026+ * @throws Exception
25027+ */
25028+ public static function from(stdClass $obj): GotoClass {
25029+ if (!property_exists($obj, 'goto')) {
25030+ throw new Exception("Missing required property");
25031+ }
25032+ return new GotoClass(
25033+ GotoClass::fromGoto($obj->{'goto'})
25034+ );
25035+ }
25036+
25037+ /**
25038+ * @return GotoClass
25039+ */
25040+ public static function sample(): GotoClass {
25041+ return new GotoClass(
25042+ GotoClass::sampleGoto()
2488425043 );
2488525044 }
2488625045 }
@@ -30241,6 +30400,107 @@ class MapEntry {
3024130400 }
3024230401 }
3024330402
30403+// This is an autogenerated file:MarshalJSON
30404+
30405+class MarshalJSON {
30406+ private int $marshalJSON; // json:MarshalJSON Required
30407+
30408+ /**
30409+ * @param int $marshalJSON
30410+ */
30411+ public function __construct(int $marshalJSON) {
30412+ $this->marshalJSON = $marshalJSON;
30413+ }
30414+
30415+ /**
30416+ * @param int $value
30417+ * @throws Exception
30418+ * @return int
30419+ */
30420+ public static function fromMarshalJSON(int $value): int {
30421+ return $value; /*int*/
30422+ }
30423+
30424+ /**
30425+ * @throws Exception
30426+ * @return int
30427+ */
30428+ public function toMarshalJSON(): int {
30429+ if (MarshalJSON::validateMarshalJSON($this->marshalJSON)) {
30430+ return $this->marshalJSON; /*int*/
30431+ }
30432+ throw new Exception('never get to this MarshalJSON::marshalJSON');
30433+ }
30434+
30435+ /**
30436+ * @param int
30437+ * @return bool
30438+ * @throws Exception
30439+ */
30440+ public static function validateMarshalJSON(int $value): bool {
30441+ return true;
30442+ }
30443+
30444+ /**
30445+ * @throws Exception
30446+ * @return int
30447+ */
30448+ public function getMarshalJSON(): int {
30449+ if (MarshalJSON::validateMarshalJSON($this->marshalJSON)) {
30450+ return $this->marshalJSON;
30451+ }
30452+ throw new Exception('never get to getMarshalJSON MarshalJSON::marshalJSON');
30453+ }
30454+
30455+ /**
30456+ * @return int
30457+ */
30458+ public static function sampleMarshalJSON(): int {
30459+ return 31; /*31:marshalJSON*/
30460+ }
30461+
30462+ /**
30463+ * @throws Exception
30464+ * @return bool
30465+ */
30466+ public function validate(): bool {
30467+ return MarshalJSON::validateMarshalJSON($this->marshalJSON);
30468+ }
30469+
30470+ /**
30471+ * @return stdClass
30472+ * @throws Exception
30473+ */
30474+ public function to(): stdClass {
30475+ $out = new stdClass();
30476+ $out->{'MarshalJSON'} = $this->toMarshalJSON();
30477+ return $out;
30478+ }
30479+
30480+ /**
30481+ * @param stdClass $obj
30482+ * @return MarshalJSON
30483+ * @throws Exception
30484+ */
30485+ public static function from(stdClass $obj): MarshalJSON {
30486+ if (!property_exists($obj, 'MarshalJSON')) {
30487+ throw new Exception("Missing required property");
30488+ }
30489+ return new MarshalJSON(
30490+ MarshalJSON::fromMarshalJSON($obj->{'MarshalJSON'})
30491+ );
30492+ }
30493+
30494+ /**
30495+ * @return MarshalJSON
30496+ */
30497+ public static function sample(): MarshalJSON {
30498+ return new MarshalJSON(
30499+ MarshalJSON::sampleMarshalJSON()
30500+ );
30501+ }
30502+}
30503+
3024430504 // This is an autogenerated file:MetadataPropertyHandling
3024530505
3024630506 class MetadataPropertyHandling {
@@ -31251,112 +31511,12 @@ class No {
3125131511 }
3125231512 }
3125331513
31254-// This is an autogenerated file:Noexcept
31255-
31256-class Noexcept {
31257- private int $noexcept; // json:noexcept Required
31258-
31259- /**
31260- * @param int $noexcept
31261- */
31262- public function __construct(int $noexcept) {
31263- $this->noexcept = $noexcept;
31264- }
31265-
31266- /**
31267- * @param int $value
31268- * @throws Exception
31269- * @return int
31270- */
31271- public static function fromNoexcept(int $value): int {
31272- return $value; /*int*/
31273- }
31274-
31275- /**
31276- * @throws Exception
31277- * @return int
31278- */
31279- public function toNoexcept(): int {
31280- if (Noexcept::validateNoexcept($this->noexcept)) {
31281- return $this->noexcept; /*int*/
31282- }
31283- throw new Exception('never get to this Noexcept::noexcept');
31284- }
31285-
31286- /**
31287- * @param int
31288- * @return bool
31289- * @throws Exception
31290- */
31291- public static function validateNoexcept(int $value): bool {
31292- return true;
31293- }
31294-
31295- /**
31296- * @throws Exception
31297- * @return int
31298- */
31299- public function getNoexcept(): int {
31300- if (Noexcept::validateNoexcept($this->noexcept)) {
31301- return $this->noexcept;
31302- }
31303- throw new Exception('never get to getNoexcept Noexcept::noexcept');
31304- }
31305-
31306- /**
31307- * @return int
31308- */
31309- public static function sampleNoexcept(): int {
31310- return 31; /*31:noexcept*/
31311- }
31312-
31313- /**
31314- * @throws Exception
31315- * @return bool
31316- */
31317- public function validate(): bool {
31318- return Noexcept::validateNoexcept($this->noexcept);
31319- }
31320-
31321- /**
31322- * @return stdClass
31323- * @throws Exception
31324- */
31325- public function to(): stdClass {
31326- $out = new stdClass();
31327- $out->{'noexcept'} = $this->toNoexcept();
31328- return $out;
31329- }
31330-
31331- /**
31332- * @param stdClass $obj
31333- * @return Noexcept
31334- * @throws Exception
31335- */
31336- public static function from(stdClass $obj): Noexcept {
31337- if (!property_exists($obj, 'noexcept')) {
31338- throw new Exception("Missing required property");
31339- }
31340- return new Noexcept(
31341- Noexcept::fromNoexcept($obj->{'noexcept'})
31342- );
31343- }
31344-
31345- /**
31346- * @return Noexcept
31347- */
31348- public static function sample(): Noexcept {
31349- return new Noexcept(
31350- Noexcept::sampleNoexcept()
31351- );
31352- }
31353-}
31354-
3135531514 // This is an autogenerated file:Obj4
3135631515
3135731516 class Obj4 {
3135831517 private int $dummy; // json:dummy Required
3135931518 private NoSuchMethod $noSuchMethod; // json:noSuchMethod Required
31519+ private Noexcept $noexcept; // json:noexcept Required
3136031520 private Nonatomic $nonatomic; // json:nonatomic Required
3136131521 private None $none; // json:None Required
3136231522 private Nonlocal $nonlocal; // json:nonlocal Required
@@ -31419,11 +31579,11 @@ class Obj4 {
3141931579 private Sbyte $sbyte; // json:sbyte Required
3142031580 private Sealed $sealed; // json:sealed Required
3142131581 private Sel $sel; // json:SEL Required
31422- private Select $select; // json:select Required
3142331582
3142431583 /**
3142531584 * @param int $dummy
3142631585 * @param NoSuchMethod $noSuchMethod
31586+ * @param Noexcept $noexcept
3142731587 * @param Nonatomic $nonatomic
3142831588 * @param None $none
3142931589 * @param Nonlocal $nonlocal
@@ -31486,11 +31646,11 @@ class Obj4 {
3148631646 * @param Sbyte $sbyte
3148731647 * @param Sealed $sealed
3148831648 * @param Sel $sel
31489- * @param Select $select
3149031649 */
31491- public function __construct(int $dummy, NoSuchMethod $noSuchMethod, Nonatomic $nonatomic, None $none, Nonlocal $nonlocal, Nonmutating $nonmutating, Not $not, NotEq $notEq, NSError $nsError, NSObject $nsObject, NSString $nsString, NULLClass $null, Nullptr $nullptr, Number $number, NoneClass $obj4None, Obj4Null $obj4Null, ProtocolClass $obj4Protocol, ObjectClass $object, ObjectMapper $objectMapper, Of $of, Oneway $oneway, Open $open, Operator $operator, Optional $optional, OrClass $or, OrEq $orEq, Out $out, OverrideClass $override, Package $package, Params $params, Pass $pass, Port $port, Postfix $postfix, Precedence $precedence, Prefix $prefix, PrintClass $print, PrintMembers $printMembers, Printf $printf, PrivateClass $private, ProtectedClass $protected, Protocol $protocol, PublicClass $public, Quicktype $quicktype, Raise $raise, Range $range, ReadonlyClass $readonly, Ref $ref, RegExp $regExp, Register $register, ReinterpretCast $reinterpretCast, Repeat $repeat, RequireClass $require, Required $required, Requires $requires, Restrict $restrict, Retain $retain, Rethrows $rethrows, ReturnClass $return, Right $right, RuntimeType $runtimeType, S $s, Sbyte $sbyte, Sealed $sealed, Sel $sel, Select $select) {
31650+ public function __construct(int $dummy, NoSuchMethod $noSuchMethod, Noexcept $noexcept, Nonatomic $nonatomic, None $none, Nonlocal $nonlocal, Nonmutating $nonmutating, Not $not, NotEq $notEq, NSError $nsError, NSObject $nsObject, NSString $nsString, NULLClass $null, Nullptr $nullptr, Number $number, NoneClass $obj4None, Obj4Null $obj4Null, ProtocolClass $obj4Protocol, ObjectClass $object, ObjectMapper $objectMapper, Of $of, Oneway $oneway, Open $open, Operator $operator, Optional $optional, OrClass $or, OrEq $orEq, Out $out, OverrideClass $override, Package $package, Params $params, Pass $pass, Port $port, Postfix $postfix, Precedence $precedence, Prefix $prefix, PrintClass $print, PrintMembers $printMembers, Printf $printf, PrivateClass $private, ProtectedClass $protected, Protocol $protocol, PublicClass $public, Quicktype $quicktype, Raise $raise, Range $range, ReadonlyClass $readonly, Ref $ref, RegExp $regExp, Register $register, ReinterpretCast $reinterpretCast, Repeat $repeat, RequireClass $require, Required $required, Requires $requires, Restrict $restrict, Retain $retain, Rethrows $rethrows, ReturnClass $return, Right $right, RuntimeType $runtimeType, S $s, Sbyte $sbyte, Sealed $sealed, Sel $sel) {
3149231651 $this->dummy = $dummy;
3149331652 $this->noSuchMethod = $noSuchMethod;
31653+ $this->noexcept = $noexcept;
3149431654 $this->nonatomic = $nonatomic;
3149531655 $this->none = $none;
3149631656 $this->nonlocal = $nonlocal;
@@ -31553,7 +31713,6 @@ class Obj4 {
3155331713 $this->sbyte = $sbyte;
3155431714 $this->sealed = $sealed;
3155531715 $this->sel = $sel;
31556- $this->select = $select;
3155731716 }
3155831717
3155931718 /**
@@ -31651,6 +31810,54 @@ class Obj4 {
3165131810 return NoSuchMethod::sample(); /*32:noSuchMethod*/
3165231811 }
3165331812
31813+ /**
31814+ * @param stdClass $value
31815+ * @throws Exception
31816+ * @return Noexcept
31817+ */
31818+ public static function fromNoexcept(stdClass $value): Noexcept {
31819+ return Noexcept::from($value); /*class*/
31820+ }
31821+
31822+ /**
31823+ * @throws Exception
31824+ * @return stdClass
31825+ */
31826+ public function toNoexcept(): stdClass {
31827+ if (Obj4::validateNoexcept($this->noexcept)) {
31828+ return $this->noexcept->to(); /*class*/
31829+ }
31830+ throw new Exception('never get to this Obj4::noexcept');
31831+ }
31832+
31833+ /**
31834+ * @param Noexcept
31835+ * @return bool
31836+ * @throws Exception
31837+ */
31838+ public static function validateNoexcept(Noexcept $value): bool {
31839+ $value->validate();
31840+ return true;
31841+ }
31842+
31843+ /**
31844+ * @throws Exception
31845+ * @return Noexcept
31846+ */
31847+ public function getNoexcept(): Noexcept {
31848+ if (Obj4::validateNoexcept($this->noexcept)) {
31849+ return $this->noexcept;
31850+ }
31851+ throw new Exception('never get to getNoexcept Obj4::noexcept');
31852+ }
31853+
31854+ /**
31855+ * @return Noexcept
31856+ */
31857+ public static function sampleNoexcept(): Noexcept {
31858+ return Noexcept::sample(); /*33:noexcept*/
31859+ }
31860+
3165431861 /**
3165531862 * @param stdClass $value
3165631863 * @throws Exception
@@ -31696,7 +31903,7 @@ class Obj4 {
3169631903 * @return Nonatomic
3169731904 */
3169831905 public static function sampleNonatomic(): Nonatomic {
31699- return Nonatomic::sample(); /*33:nonatomic*/
31906+ return Nonatomic::sample(); /*34:nonatomic*/
3170031907 }
3170131908
3170231909 /**
@@ -31744,7 +31951,7 @@ class Obj4 {
3174431951 * @return None
3174531952 */
3174631953 public static function sampleNone(): None {
31747- return None::sample(); /*34:none*/
31954+ return None::sample(); /*35:none*/
3174831955 }
3174931956
3175031957 /**
@@ -31792,7 +31999,7 @@ class Obj4 {
3179231999 * @return Nonlocal
3179332000 */
3179432001 public static function sampleNonlocal(): Nonlocal {
31795- return Nonlocal::sample(); /*35:nonlocal*/
32002+ return Nonlocal::sample(); /*36:nonlocal*/
3179632003 }
3179732004
3179832005 /**
@@ -31840,7 +32047,7 @@ class Obj4 {
3184032047 * @return Nonmutating
3184132048 */
3184232049 public static function sampleNonmutating(): Nonmutating {
31843- return Nonmutating::sample(); /*36:nonmutating*/
32050+ return Nonmutating::sample(); /*37:nonmutating*/
3184432051 }
3184532052
3184632053 /**
@@ -31888,7 +32095,7 @@ class Obj4 {
3188832095 * @return Not
3188932096 */
3189032097 public static function sampleNot(): Not {
31891- return Not::sample(); /*37:not*/
32098+ return Not::sample(); /*38:not*/
3189232099 }
3189332100
3189432101 /**
@@ -31936,7 +32143,7 @@ class Obj4 {
3193632143 * @return NotEq
3193732144 */
3193832145 public static function sampleNotEq(): NotEq {
31939- return NotEq::sample(); /*38:notEq*/
32146+ return NotEq::sample(); /*39:notEq*/
3194032147 }
3194132148
3194232149 /**
@@ -31984,7 +32191,7 @@ class Obj4 {
3198432191 * @return NSError
3198532192 */
3198632193 public static function sampleNSError(): NSError {
31987- return NSError::sample(); /*39:nsError*/
32194+ return NSError::sample(); /*40:nsError*/
3198832195 }
3198932196
3199032197 /**
@@ -32032,7 +32239,7 @@ class Obj4 {
3203232239 * @return NSObject
3203332240 */
3203432241 public static function sampleNSObject(): NSObject {
32035- return NSObject::sample(); /*40:nsObject*/
32242+ return NSObject::sample(); /*41:nsObject*/
3203632243 }
3203732244
3203832245 /**
@@ -32080,7 +32287,7 @@ class Obj4 {
3208032287 * @return NSString
3208132288 */
3208232289 public static function sampleNSString(): NSString {
32083- return NSString::sample(); /*41:nsString*/
32290+ return NSString::sample(); /*42:nsString*/
3208432291 }
3208532292
3208632293 /**
@@ -32128,7 +32335,7 @@ class Obj4 {
3212832335 * @return NULLClass
3212932336 */
3213032337 public static function sampleNull(): NULLClass {
32131- return NULLClass::sample(); /*42:null*/
32338+ return NULLClass::sample(); /*43:null*/
3213232339 }
3213332340
3213432341 /**
@@ -32176,7 +32383,7 @@ class Obj4 {
3217632383 * @return Nullptr
3217732384 */
3217832385 public static function sampleNullptr(): Nullptr {
32179- return Nullptr::sample(); /*43:nullptr*/
32386+ return Nullptr::sample(); /*44:nullptr*/
3218032387 }
3218132388
3218232389 /**
@@ -32224,7 +32431,7 @@ class Obj4 {
3222432431 * @return Number
3222532432 */
3222632433 public static function sampleNumber(): Number {
32227- return Number::sample(); /*44:number*/
32434+ return Number::sample(); /*45:number*/
3222832435 }
3222932436
3223032437 /**
@@ -32272,7 +32479,7 @@ class Obj4 {
3227232479 * @return NoneClass
3227332480 */
3227432481 public static function sampleObj4None(): NoneClass {
32275- return NoneClass::sample(); /*45:obj4None*/
32482+ return NoneClass::sample(); /*46:obj4None*/
3227632483 }
3227732484
3227832485 /**
@@ -32320,7 +32527,7 @@ class Obj4 {
3232032527 * @return Obj4Null
3232132528 */
3232232529 public static function sampleObj4Null(): Obj4Null {
32323- return Obj4Null::sample(); /*46:obj4Null*/
32530+ return Obj4Null::sample(); /*47:obj4Null*/
3232432531 }
3232532532
3232632533 /**
@@ -32368,7 +32575,7 @@ class Obj4 {
3236832575 * @return ProtocolClass
3236932576 */
3237032577 public static function sampleObj4Protocol(): ProtocolClass {
32371- return ProtocolClass::sample(); /*47:obj4Protocol*/
32578+ return ProtocolClass::sample(); /*48:obj4Protocol*/
3237232579 }
3237332580
3237432581 /**
@@ -32416,7 +32623,7 @@ class Obj4 {
3241632623 * @return ObjectClass
3241732624 */
3241832625 public static function sampleObject(): ObjectClass {
32419- return ObjectClass::sample(); /*48:object*/
32626+ return ObjectClass::sample(); /*49:object*/
3242032627 }
3242132628
3242232629 /**
@@ -32464,7 +32671,7 @@ class Obj4 {
3246432671 * @return ObjectMapper
3246532672 */
3246632673 public static function sampleObjectMapper(): ObjectMapper {
32467- return ObjectMapper::sample(); /*49:objectMapper*/
32674+ return ObjectMapper::sample(); /*50:objectMapper*/
3246832675 }
3246932676
3247032677 /**
@@ -32512,7 +32719,7 @@ class Obj4 {
3251232719 * @return Of
3251332720 */
3251432721 public static function sampleOf(): Of {
32515- return Of::sample(); /*50:of*/
32722+ return Of::sample(); /*51:of*/
3251632723 }
3251732724
3251832725 /**
@@ -32560,7 +32767,7 @@ class Obj4 {
3256032767 * @return Oneway
3256132768 */
3256232769 public static function sampleOneway(): Oneway {
32563- return Oneway::sample(); /*51:oneway*/
32770+ return Oneway::sample(); /*52:oneway*/
3256432771 }
3256532772
3256632773 /**
@@ -32608,7 +32815,7 @@ class Obj4 {
3260832815 * @return Open
3260932816 */
3261032817 public static function sampleOpen(): Open {
32611- return Open::sample(); /*52:open*/
32818+ return Open::sample(); /*53:open*/
3261232819 }
3261332820
3261432821 /**
@@ -32656,7 +32863,7 @@ class Obj4 {
3265632863 * @return Operator
3265732864 */
3265832865 public static function sampleOperator(): Operator {
32659- return Operator::sample(); /*53:operator*/
32866+ return Operator::sample(); /*54:operator*/
3266032867 }
3266132868
3266232869 /**
@@ -32704,7 +32911,7 @@ class Obj4 {
3270432911 * @return Optional
3270532912 */
3270632913 public static function sampleOptional(): Optional {
32707- return Optional::sample(); /*54:optional*/
32914+ return Optional::sample(); /*55:optional*/
3270832915 }
3270932916
3271032917 /**
@@ -32752,7 +32959,7 @@ class Obj4 {
3275232959 * @return OrClass
3275332960 */
3275432961 public static function sampleOr(): OrClass {
32755- return OrClass::sample(); /*55:or*/
32962+ return OrClass::sample(); /*56:or*/
3275632963 }
3275732964
3275832965 /**
@@ -32800,7 +33007,7 @@ class Obj4 {
3280033007 * @return OrEq
3280133008 */
3280233009 public static function sampleOrEq(): OrEq {
32803- return OrEq::sample(); /*56:orEq*/
33010+ return OrEq::sample(); /*57:orEq*/
3280433011 }
3280533012
3280633013 /**
@@ -32848,7 +33055,7 @@ class Obj4 {
3284833055 * @return Out
3284933056 */
3285033057 public static function sampleOut(): Out {
32851- return Out::sample(); /*57:out*/
33058+ return Out::sample(); /*58:out*/
3285233059 }
3285333060
3285433061 /**
@@ -32896,7 +33103,7 @@ class Obj4 {
3289633103 * @return OverrideClass
3289733104 */
3289833105 public static function sampleOverride(): OverrideClass {
32899- return OverrideClass::sample(); /*58:override*/
33106+ return OverrideClass::sample(); /*59:override*/
3290033107 }
3290133108
3290233109 /**
@@ -32944,7 +33151,7 @@ class Obj4 {
3294433151 * @return Package
3294533152 */
3294633153 public static function samplePackage(): Package {
32947- return Package::sample(); /*59:package*/
33154+ return Package::sample(); /*60:package*/
3294833155 }
3294933156
3295033157 /**
@@ -32992,7 +33199,7 @@ class Obj4 {
3299233199 * @return Params
3299333200 */
3299433201 public static function sampleParams(): Params {
32995- return Params::sample(); /*60:params*/
33202+ return Params::sample(); /*61:params*/
3299633203 }
3299733204
3299833205 /**
@@ -33040,7 +33247,7 @@ class Obj4 {
3304033247 * @return Pass
3304133248 */
3304233249 public static function samplePass(): Pass {
33043- return Pass::sample(); /*61:pass*/
33250+ return Pass::sample(); /*62:pass*/
3304433251 }
3304533252
3304633253 /**
@@ -33088,7 +33295,7 @@ class Obj4 {
3308833295 * @return Port
3308933296 */
3309033297 public static function samplePort(): Port {
33091- return Port::sample(); /*62:port*/
33298+ return Port::sample(); /*63:port*/
3309233299 }
3309333300
3309433301 /**
@@ -33136,7 +33343,7 @@ class Obj4 {
3313633343 * @return Postfix
3313733344 */
3313833345 public static function samplePostfix(): Postfix {
33139- return Postfix::sample(); /*63:postfix*/
33346+ return Postfix::sample(); /*64:postfix*/
3314033347 }
3314133348
3314233349 /**
@@ -33184,7 +33391,7 @@ class Obj4 {
3318433391 * @return Precedence
3318533392 */
3318633393 public static function samplePrecedence(): Precedence {
33187- return Precedence::sample(); /*64:precedence*/
33394+ return Precedence::sample(); /*65:precedence*/
3318833395 }
3318933396
3319033397 /**
@@ -33232,7 +33439,7 @@ class Obj4 {
3323233439 * @return Prefix
3323333440 */
3323433441 public static function samplePrefix(): Prefix {
33235- return Prefix::sample(); /*65:prefix*/
33442+ return Prefix::sample(); /*66:prefix*/
3323633443 }
3323733444
3323833445 /**
@@ -33280,7 +33487,7 @@ class Obj4 {
3328033487 * @return PrintClass
3328133488 */
3328233489 public static function samplePrint(): PrintClass {
33283- return PrintClass::sample(); /*66:print*/
33490+ return PrintClass::sample(); /*67:print*/
3328433491 }
3328533492
3328633493 /**
@@ -33328,7 +33535,7 @@ class Obj4 {
3332833535 * @return PrintMembers
3332933536 */
3333033537 public static function samplePrintMembers(): PrintMembers {
33331- return PrintMembers::sample(); /*67:printMembers*/
33538+ return PrintMembers::sample(); /*68:printMembers*/
3333233539 }
3333333540
3333433541 /**
@@ -33376,7 +33583,7 @@ class Obj4 {
3337633583 * @return Printf
3337733584 */
3337833585 public static function samplePrintf(): Printf {
33379- return Printf::sample(); /*68:printf*/
33586+ return Printf::sample(); /*69:printf*/
3338033587 }
3338133588
3338233589 /**
@@ -33424,7 +33631,7 @@ class Obj4 {
3342433631 * @return PrivateClass
3342533632 */
3342633633 public static function samplePrivate(): PrivateClass {
33427- return PrivateClass::sample(); /*69:private*/
33634+ return PrivateClass::sample(); /*70:private*/
3342833635 }
3342933636
3343033637 /**
@@ -33472,7 +33679,7 @@ class Obj4 {
3347233679 * @return ProtectedClass
3347333680 */
3347433681 public static function sampleProtected(): ProtectedClass {
33475- return ProtectedClass::sample(); /*70:protected*/
33682+ return ProtectedClass::sample(); /*71:protected*/
3347633683 }
3347733684
3347833685 /**
@@ -33520,7 +33727,7 @@ class Obj4 {
3352033727 * @return Protocol
3352133728 */
3352233729 public static function sampleProtocol(): Protocol {
33523- return Protocol::sample(); /*71:protocol*/
33730+ return Protocol::sample(); /*72:protocol*/
3352433731 }
3352533732
3352633733 /**
@@ -33568,7 +33775,7 @@ class Obj4 {
3356833775 * @return PublicClass
3356933776 */
3357033777 public static function samplePublic(): PublicClass {
33571- return PublicClass::sample(); /*72:public*/
33778+ return PublicClass::sample(); /*73:public*/
3357233779 }
3357333780
3357433781 /**
@@ -33616,7 +33823,7 @@ class Obj4 {
3361633823 * @return Quicktype
3361733824 */
3361833825 public static function sampleQuicktype(): Quicktype {
33619- return Quicktype::sample(); /*73:quicktype*/
33826+ return Quicktype::sample(); /*74:quicktype*/
3362033827 }
3362133828
3362233829 /**
@@ -33664,7 +33871,7 @@ class Obj4 {
3366433871 * @return Raise
3366533872 */
3366633873 public static function sampleRaise(): Raise {
33667- return Raise::sample(); /*74:raise*/
33874+ return Raise::sample(); /*75:raise*/
3366833875 }
3366933876
3367033877 /**
@@ -33712,7 +33919,7 @@ class Obj4 {
3371233919 * @return Range
3371333920 */
3371433921 public static function sampleRange(): Range {
33715- return Range::sample(); /*75:range*/
33922+ return Range::sample(); /*76:range*/
3371633923 }
3371733924
3371833925 /**
@@ -33760,7 +33967,7 @@ class Obj4 {
3376033967 * @return ReadonlyClass
3376133968 */
3376233969 public static function sampleReadonly(): ReadonlyClass {
33763- return ReadonlyClass::sample(); /*76:readonly*/
33970+ return ReadonlyClass::sample(); /*77:readonly*/
3376433971 }
3376533972
3376633973 /**
@@ -33808,7 +34015,7 @@ class Obj4 {
3380834015 * @return Ref
3380934016 */
3381034017 public static function sampleRef(): Ref {
33811- return Ref::sample(); /*77:ref*/
34018+ return Ref::sample(); /*78:ref*/
3381234019 }
3381334020
3381434021 /**
@@ -33856,7 +34063,7 @@ class Obj4 {
3385634063 * @return RegExp
3385734064 */
3385834065 public static function sampleRegExp(): RegExp {
33859- return RegExp::sample(); /*78:regExp*/
34066+ return RegExp::sample(); /*79:regExp*/
3386034067 }
3386134068
3386234069 /**
@@ -33904,7 +34111,7 @@ class Obj4 {
3390434111 * @return Register
3390534112 */
3390634113 public static function sampleRegister(): Register {
33907- return Register::sample(); /*79:register*/
34114+ return Register::sample(); /*80:register*/
3390834115 }
3390934116
3391034117 /**
@@ -33952,7 +34159,7 @@ class Obj4 {
3395234159 * @return ReinterpretCast
3395334160 */
3395434161 public static function sampleReinterpretCast(): ReinterpretCast {
33955- return ReinterpretCast::sample(); /*80:reinterpretCast*/
34162+ return ReinterpretCast::sample(); /*81:reinterpretCast*/
3395634163 }
3395734164
3395834165 /**
@@ -34000,7 +34207,7 @@ class Obj4 {
3400034207 * @return Repeat
3400134208 */
3400234209 public static function sampleRepeat(): Repeat {
34003- return Repeat::sample(); /*81:repeat*/
34210+ return Repeat::sample(); /*82:repeat*/
3400434211 }
3400534212
3400634213 /**
@@ -34048,7 +34255,7 @@ class Obj4 {
3404834255 * @return RequireClass
3404934256 */
3405034257 public static function sampleRequire(): RequireClass {
34051- return RequireClass::sample(); /*82:require*/
34258+ return RequireClass::sample(); /*83:require*/
3405234259 }
3405334260
3405434261 /**
@@ -34096,7 +34303,7 @@ class Obj4 {
3409634303 * @return Required
3409734304 */
3409834305 public static function sampleRequired(): Required {
34099- return Required::sample(); /*83:required*/
34306+ return Required::sample(); /*84:required*/
3410034307 }
3410134308
3410234309 /**
@@ -34144,7 +34351,7 @@ class Obj4 {
3414434351 * @return Requires
3414534352 */
3414634353 public static function sampleRequires(): Requires {
34147- return Requires::sample(); /*84:requires*/
34354+ return Requires::sample(); /*85:requires*/
3414834355 }
3414934356
3415034357 /**
@@ -34192,7 +34399,7 @@ class Obj4 {
3419234399 * @return Restrict
3419334400 */
3419434401 public static function sampleRestrict(): Restrict {
34195- return Restrict::sample(); /*85:restrict*/
34402+ return Restrict::sample(); /*86:restrict*/
3419634403 }
3419734404
3419834405 /**
@@ -34240,7 +34447,7 @@ class Obj4 {
3424034447 * @return Retain
3424134448 */
3424234449 public static function sampleRetain(): Retain {
34243- return Retain::sample(); /*86:retain*/
34450+ return Retain::sample(); /*87:retain*/
3424434451 }
3424534452
3424634453 /**
@@ -34288,7 +34495,7 @@ class Obj4 {
3428834495 * @return Rethrows
3428934496 */
3429034497 public static function sampleRethrows(): Rethrows {
34291- return Rethrows::sample(); /*87:rethrows*/
34498+ return Rethrows::sample(); /*88:rethrows*/
3429234499 }
3429334500
3429434501 /**
@@ -34336,7 +34543,7 @@ class Obj4 {
3433634543 * @return ReturnClass
3433734544 */
3433834545 public static function sampleReturn(): ReturnClass {
34339- return ReturnClass::sample(); /*88:return*/
34546+ return ReturnClass::sample(); /*89:return*/
3434034547 }
3434134548
3434234549 /**
@@ -34384,7 +34591,7 @@ class Obj4 {
3438434591 * @return Right
3438534592 */
3438634593 public static function sampleRight(): Right {
34387- return Right::sample(); /*89:right*/
34594+ return Right::sample(); /*90:right*/
3438834595 }
3438934596
3439034597 /**
@@ -34432,7 +34639,7 @@ class Obj4 {
3443234639 * @return RuntimeType
3443334640 */
3443434641 public static function sampleRuntimeType(): RuntimeType {
34435- return RuntimeType::sample(); /*90:runtimeType*/
34642+ return RuntimeType::sample(); /*91:runtimeType*/
3443634643 }
3443734644
3443834645 /**
@@ -34480,7 +34687,7 @@ class Obj4 {
3448034687 * @return S
3448134688 */
3448234689 public static function sampleS(): S {
34483- return S::sample(); /*91:s*/
34690+ return S::sample(); /*92:s*/
3448434691 }
3448534692
3448634693 /**
@@ -34528,7 +34735,7 @@ class Obj4 {
3452834735 * @return Sbyte
3452934736 */
3453034737 public static function sampleSbyte(): Sbyte {
34531- return Sbyte::sample(); /*92:sbyte*/
34738+ return Sbyte::sample(); /*93:sbyte*/
3453234739 }
3453334740
3453434741 /**
@@ -34576,7 +34783,7 @@ class Obj4 {
3457634783 * @return Sealed
3457734784 */
3457834785 public static function sampleSealed(): Sealed {
34579- return Sealed::sample(); /*93:sealed*/
34786+ return Sealed::sample(); /*94:sealed*/
3458034787 }
3458134788
3458234789 /**
@@ -34624,55 +34831,7 @@ class Obj4 {
3462434831 * @return Sel
3462534832 */
3462634833 public static function sampleSel(): Sel {
34627- return Sel::sample(); /*94:sel*/
34628- }
34629-
34630- /**
34631- * @param stdClass $value
34632- * @throws Exception
34633- * @return Select
34634- */
34635- public static function fromSelect(stdClass $value): Select {
34636- return Select::from($value); /*class*/
34637- }
34638-
34639- /**
34640- * @throws Exception
34641- * @return stdClass
34642- */
34643- public function toSelect(): stdClass {
34644- if (Obj4::validateSelect($this->select)) {
34645- return $this->select->to(); /*class*/
34646- }
34647- throw new Exception('never get to this Obj4::select');
34648- }
34649-
34650- /**
34651- * @param Select
34652- * @return bool
34653- * @throws Exception
34654- */
34655- public static function validateSelect(Select $value): bool {
34656- $value->validate();
34657- return true;
34658- }
34659-
34660- /**
34661- * @throws Exception
34662- * @return Select
34663- */
34664- public function getSelect(): Select {
34665- if (Obj4::validateSelect($this->select)) {
34666- return $this->select;
34667- }
34668- throw new Exception('never get to getSelect Obj4::select');
34669- }
34670-
34671- /**
34672- * @return Select
34673- */
34674- public static function sampleSelect(): Select {
34675- return Select::sample(); /*95:select*/
34834+ return Sel::sample(); /*95:sel*/
3467634835 }
3467734836
3467834837 /**
@@ -34682,6 +34841,7 @@ class Obj4 {
3468234841 public function validate(): bool {
3468334842 return Obj4::validateDummy($this->dummy)
3468434843 || Obj4::validateNoSuchMethod($this->noSuchMethod)
34844+ || Obj4::validateNoexcept($this->noexcept)
3468534845 || Obj4::validateNonatomic($this->nonatomic)
3468634846 || Obj4::validateNone($this->none)
3468734847 || Obj4::validateNonlocal($this->nonlocal)
@@ -34743,8 +34903,7 @@ class Obj4 {
3474334903 || Obj4::validateS($this->s)
3474434904 || Obj4::validateSbyte($this->sbyte)
3474534905 || Obj4::validateSealed($this->sealed)
34746- || Obj4::validateSel($this->sel)
34747- || Obj4::validateSelect($this->select);
34906+ || Obj4::validateSel($this->sel);
3474834907 }
3474934908
3475034909 /**
@@ -34755,6 +34914,7 @@ class Obj4 {
3475534914 $out = new stdClass();
3475634915 $out->{'dummy'} = $this->toDummy();
3475734916 $out->{'noSuchMethod'} = $this->toNoSuchMethod();
34917+ $out->{'noexcept'} = $this->toNoexcept();
3475834918 $out->{'nonatomic'} = $this->toNonatomic();
3475934919 $out->{'None'} = $this->toNone();
3476034920 $out->{'nonlocal'} = $this->toNonlocal();
@@ -34817,7 +34977,6 @@ class Obj4 {
3481734977 $out->{'sbyte'} = $this->toSbyte();
3481834978 $out->{'sealed'} = $this->toSealed();
3481934979 $out->{'SEL'} = $this->toSel();
34820- $out->{'select'} = $this->toSelect();
3482134980 return $out;
3482234981 }
3482334982
@@ -34833,6 +34992,9 @@ class Obj4 {
3483334992 if (!property_exists($obj, 'noSuchMethod')) {
3483434993 throw new Exception("Missing required property");
3483534994 }
34995+ if (!property_exists($obj, 'noexcept')) {
34996+ throw new Exception("Missing required property");
34997+ }
3483634998 if (!property_exists($obj, 'nonatomic')) {
3483734999 throw new Exception("Missing required property");
3483835000 }
@@ -35019,12 +35181,10 @@ class Obj4 {
3501935181 if (!property_exists($obj, 'SEL')) {
3502035182 throw new Exception("Missing required property");
3502135183 }
35022- if (!property_exists($obj, 'select')) {
35023- throw new Exception("Missing required property");
35024- }
3502535184 return new Obj4(
3502635185 Obj4::fromDummy($obj->{'dummy'})
3502735186 ,Obj4::fromNoSuchMethod($obj->{'noSuchMethod'})
35187+ ,Obj4::fromNoexcept($obj->{'noexcept'})
3502835188 ,Obj4::fromNonatomic($obj->{'nonatomic'})
3502935189 ,Obj4::fromNone($obj->{'None'})
3503035190 ,Obj4::fromNonlocal($obj->{'nonlocal'})
@@ -35087,7 +35247,6 @@ class Obj4 {
3508735247 ,Obj4::fromSbyte($obj->{'sbyte'})
3508835248 ,Obj4::fromSealed($obj->{'sealed'})
3508935249 ,Obj4::fromSel($obj->{'SEL'})
35090- ,Obj4::fromSelect($obj->{'select'})
3509135250 );
3509235251 }
3509335252
@@ -35098,6 +35257,7 @@ class Obj4 {
3509835257 return new Obj4(
3509935258 Obj4::sampleDummy()
3510035259 ,Obj4::sampleNoSuchMethod()
35260+ ,Obj4::sampleNoexcept()
3510135261 ,Obj4::sampleNonatomic()
3510235262 ,Obj4::sampleNone()
3510335263 ,Obj4::sampleNonlocal()
@@ -35160,7 +35320,6 @@ class Obj4 {
3516035320 ,Obj4::sampleSbyte()
3516135321 ,Obj4::sampleSealed()
3516235322 ,Obj4::sampleSel()
35163- ,Obj4::sampleSelect()
3516435323 );
3516535324 }
3516635325 }
@@ -35266,6 +35425,107 @@ class NoSuchMethod {
3526635425 }
3526735426 }
3526835427
35428+// This is an autogenerated file:Noexcept
35429+
35430+class Noexcept {
35431+ private int $noexcept; // json:noexcept Required
35432+
35433+ /**
35434+ * @param int $noexcept
35435+ */
35436+ public function __construct(int $noexcept) {
35437+ $this->noexcept = $noexcept;
35438+ }
35439+
35440+ /**
35441+ * @param int $value
35442+ * @throws Exception
35443+ * @return int
35444+ */
35445+ public static function fromNoexcept(int $value): int {
35446+ return $value; /*int*/
35447+ }
35448+
35449+ /**
35450+ * @throws Exception
35451+ * @return int
35452+ */
35453+ public function toNoexcept(): int {
35454+ if (Noexcept::validateNoexcept($this->noexcept)) {
35455+ return $this->noexcept; /*int*/
35456+ }
35457+ throw new Exception('never get to this Noexcept::noexcept');
35458+ }
35459+
35460+ /**
35461+ * @param int
35462+ * @return bool
35463+ * @throws Exception
35464+ */
35465+ public static function validateNoexcept(int $value): bool {
35466+ return true;
35467+ }
35468+
35469+ /**
35470+ * @throws Exception
35471+ * @return int
35472+ */
35473+ public function getNoexcept(): int {
35474+ if (Noexcept::validateNoexcept($this->noexcept)) {
35475+ return $this->noexcept;
35476+ }
35477+ throw new Exception('never get to getNoexcept Noexcept::noexcept');
35478+ }
35479+
35480+ /**
35481+ * @return int
35482+ */
35483+ public static function sampleNoexcept(): int {
35484+ return 31; /*31:noexcept*/
35485+ }
35486+
35487+ /**
35488+ * @throws Exception
35489+ * @return bool
35490+ */
35491+ public function validate(): bool {
35492+ return Noexcept::validateNoexcept($this->noexcept);
35493+ }
35494+
35495+ /**
35496+ * @return stdClass
35497+ * @throws Exception
35498+ */
35499+ public function to(): stdClass {
35500+ $out = new stdClass();
35501+ $out->{'noexcept'} = $this->toNoexcept();
35502+ return $out;
35503+ }
35504+
35505+ /**
35506+ * @param stdClass $obj
35507+ * @return Noexcept
35508+ * @throws Exception
35509+ */
35510+ public static function from(stdClass $obj): Noexcept {
35511+ if (!property_exists($obj, 'noexcept')) {
35512+ throw new Exception("Missing required property");
35513+ }
35514+ return new Noexcept(
35515+ Noexcept::fromNoexcept($obj->{'noexcept'})
35516+ );
35517+ }
35518+
35519+ /**
35520+ * @return Noexcept
35521+ */
35522+ public static function sample(): Noexcept {
35523+ return new Noexcept(
35524+ Noexcept::sampleNoexcept()
35525+ );
35526+ }
35527+}
35528+
3526935529 // This is an autogenerated file:Nonatomic
3527035530
3527135531 class Nonatomic {
@@ -41531,107 +41791,6 @@ class Sel {
4153141791 }
4153241792 }
4153341793
41534-// This is an autogenerated file:Select
41535-
41536-class Select {
41537- private int $select; // json:select Required
41538-
41539- /**
41540- * @param int $select
41541- */
41542- public function __construct(int $select) {
41543- $this->select = $select;
41544- }
41545-
41546- /**
41547- * @param int $value
41548- * @throws Exception
41549- * @return int
41550- */
41551- public static function fromSelect(int $value): int {
41552- return $value; /*int*/
41553- }
41554-
41555- /**
41556- * @throws Exception
41557- * @return int
41558- */
41559- public function toSelect(): int {
41560- if (Select::validateSelect($this->select)) {
41561- return $this->select; /*int*/
41562- }
41563- throw new Exception('never get to this Select::select');
41564- }
41565-
41566- /**
41567- * @param int
41568- * @return bool
41569- * @throws Exception
41570- */
41571- public static function validateSelect(int $value): bool {
41572- return true;
41573- }
41574-
41575- /**
41576- * @throws Exception
41577- * @return int
41578- */
41579- public function getSelect(): int {
41580- if (Select::validateSelect($this->select)) {
41581- return $this->select;
41582- }
41583- throw new Exception('never get to getSelect Select::select');
41584- }
41585-
41586- /**
41587- * @return int
41588- */
41589- public static function sampleSelect(): int {
41590- return 31; /*31:select*/
41591- }
41592-
41593- /**
41594- * @throws Exception
41595- * @return bool
41596- */
41597- public function validate(): bool {
41598- return Select::validateSelect($this->select);
41599- }
41600-
41601- /**
41602- * @return stdClass
41603- * @throws Exception
41604- */
41605- public function to(): stdClass {
41606- $out = new stdClass();
41607- $out->{'select'} = $this->toSelect();
41608- return $out;
41609- }
41610-
41611- /**
41612- * @param stdClass $obj
41613- * @return Select
41614- * @throws Exception
41615- */
41616- public static function from(stdClass $obj): Select {
41617- if (!property_exists($obj, 'select')) {
41618- throw new Exception("Missing required property");
41619- }
41620- return new Select(
41621- Select::fromSelect($obj->{'select'})
41622- );
41623- }
41624-
41625- /**
41626- * @return Select
41627- */
41628- public static function sample(): Select {
41629- return new Select(
41630- Select::sampleSelect()
41631- );
41632- }
41633-}
41634-
4163541794 // This is an autogenerated file:Obj5
4163641795
4163741796 class Obj5 {
@@ -41642,6 +41801,7 @@ class Obj5 {
4164241801 private Obj5True $obj5True; // json:true Required
4164341802 private TypeClass $obj5Type; // json:type Required
4164441803 private PrimitiveKind $primitiveKind; // json:PrimitiveKind Required
41804+ private Select $select; // json:select Required
4164541805 private SelfClass $self; // json:Self Required
4164641806 private Sendable $sendable; // json:Sendable Required
4164741807 private SerialDescriptor $serialDescriptor; // json:SerialDescriptor Required
@@ -41678,6 +41838,7 @@ class Obj5 {
4167841838 private TimeOnly $timeOnly; // json:TimeOnly Required
4167941839 private TimeOnlyConverter $timeOnlyConverter; // json:TimeOnlyConverter Required
4168041840 private TimeZone $timeZone; // json:TimeZone Required
41841+ private ToDict $toDict; // json:to_dict Required
4168141842 private ToJSON $toJSON; // json:to_json Required
4168241843 private ToString $toString; // json:toString Required
4168341844 private TopLevelClass $topLevel; // json:top_level Required
@@ -41695,11 +41856,10 @@ class Obj5 {
4169541856 private Unchecked $unchecked; // json:unchecked Required
4169641857 private Undefined $undefined; // json:undefined Required
4169741858 private Union $union; // json:union Required
41859+ private UnmarshalJSON $unmarshalJSON; // json:UnmarshalJSON Required
4169841860 private Unowned $unowned; // json:unowned Required
4169941861 private Unsafe $unsafe; // json:unsafe Required
41700- private Unsigned $unsigned; // json:unsigned Required
4170141862 private UseSerializers $useSerializers; // json:UseSerializers Required
41702- private Ushort $ushort; // json:ushort Required
4170341863
4170441864 /**
4170541865 * @param int $dummy
@@ -41709,6 +41869,7 @@ class Obj5 {
4170941869 * @param Obj5True $obj5True
4171041870 * @param TypeClass $obj5Type
4171141871 * @param PrimitiveKind $primitiveKind
41872+ * @param Select $select
4171241873 * @param SelfClass $self
4171341874 * @param Sendable $sendable
4171441875 * @param SerialDescriptor $serialDescriptor
@@ -41745,6 +41906,7 @@ class Obj5 {
4174541906 * @param TimeOnly $timeOnly
4174641907 * @param TimeOnlyConverter $timeOnlyConverter
4174741908 * @param TimeZone $timeZone
41909+ * @param ToDict $toDict
4174841910 * @param ToJSON $toJSON
4174941911 * @param ToString $toString
4175041912 * @param TopLevelClass $topLevel
@@ -41762,13 +41924,12 @@ class Obj5 {
4176241924 * @param Unchecked $unchecked
4176341925 * @param Undefined $undefined
4176441926 * @param Union $union
41927+ * @param UnmarshalJSON $unmarshalJSON
4176541928 * @param Unowned $unowned
4176641929 * @param Unsafe $unsafe
41767- * @param Unsigned $unsigned
4176841930 * @param UseSerializers $useSerializers
41769- * @param Ushort $ushort
4177041931 */
41771- public function __construct(int $dummy, KSerializer $kSerializer, Obj5Self $obj5Self, This $obj5This, Obj5True $obj5True, TypeClass $obj5Type, PrimitiveKind $primitiveKind, SelfClass $self, Sendable $sendable, SerialDescriptor $serialDescriptor, SerialName $serialName, SerializableClass $serializable, Serialize $serialize, SerializerProvider $serializerProvider, Set $set, Short $short, Signed $signed, SimpleModule $simpleModule, Sizeof $sizeof, Stackalloc $stackalloc, Standards $standards, StaticClass $static, StaticAssert $staticAssert, StaticCast $staticCast, StdDeserializer $stdDeserializer, StdSerializer $stdSerializer, Strictfp $strictfp, StringClass $string, Struct $struct, Subscript $subscript, Super $super, SwitchClass $switch, Symbol $symbol, Synchronized $synchronized, System $system, Template $template, Then $then, ThreadLocal $threadLocal, ThrowClass $throw, Throws $throws, TimeOnly $timeOnly, TimeOnlyConverter $timeOnlyConverter, TimeZone $timeZone, ToJSON $toJSON, ToString $toString, TopLevelClass $topLevel, Transient $transient, TrueClass $true, TryClass $try, Type $type, Typealias $typealias, Typedef $typedef, Typeid $typeid, Typename $typename, Typeof $typeof, Uint $uint, Ulong $ulong, Unchecked $unchecked, Undefined $undefined, Union $union, Unowned $unowned, Unsafe $unsafe, Unsigned $unsigned, UseSerializers $useSerializers, Ushort $ushort) {
41932+ public function __construct(int $dummy, KSerializer $kSerializer, Obj5Self $obj5Self, This $obj5This, Obj5True $obj5True, TypeClass $obj5Type, PrimitiveKind $primitiveKind, Select $select, SelfClass $self, Sendable $sendable, SerialDescriptor $serialDescriptor, SerialName $serialName, SerializableClass $serializable, Serialize $serialize, SerializerProvider $serializerProvider, Set $set, Short $short, Signed $signed, SimpleModule $simpleModule, Sizeof $sizeof, Stackalloc $stackalloc, Standards $standards, StaticClass $static, StaticAssert $staticAssert, StaticCast $staticCast, StdDeserializer $stdDeserializer, StdSerializer $stdSerializer, Strictfp $strictfp, StringClass $string, Struct $struct, Subscript $subscript, Super $super, SwitchClass $switch, Symbol $symbol, Synchronized $synchronized, System $system, Template $template, Then $then, ThreadLocal $threadLocal, ThrowClass $throw, Throws $throws, TimeOnly $timeOnly, TimeOnlyConverter $timeOnlyConverter, TimeZone $timeZone, ToDict $toDict, ToJSON $toJSON, ToString $toString, TopLevelClass $topLevel, Transient $transient, TrueClass $true, TryClass $try, Type $type, Typealias $typealias, Typedef $typedef, Typeid $typeid, Typename $typename, Typeof $typeof, Uint $uint, Ulong $ulong, Unchecked $unchecked, Undefined $undefined, Union $union, UnmarshalJSON $unmarshalJSON, Unowned $unowned, Unsafe $unsafe, UseSerializers $useSerializers) {
4177241933 $this->dummy = $dummy;
4177341934 $this->kSerializer = $kSerializer;
4177441935 $this->obj5Self = $obj5Self;
@@ -41776,6 +41937,7 @@ class Obj5 {
4177641937 $this->obj5True = $obj5True;
4177741938 $this->obj5Type = $obj5Type;
4177841939 $this->primitiveKind = $primitiveKind;
41940+ $this->select = $select;
4177941941 $this->self = $self;
4178041942 $this->sendable = $sendable;
4178141943 $this->serialDescriptor = $serialDescriptor;
@@ -41812,6 +41974,7 @@ class Obj5 {
4181241974 $this->timeOnly = $timeOnly;
4181341975 $this->timeOnlyConverter = $timeOnlyConverter;
4181441976 $this->timeZone = $timeZone;
41977+ $this->toDict = $toDict;
4181541978 $this->toJSON = $toJSON;
4181641979 $this->toString = $toString;
4181741980 $this->topLevel = $topLevel;
@@ -41829,11 +41992,10 @@ class Obj5 {
4182941992 $this->unchecked = $unchecked;
4183041993 $this->undefined = $undefined;
4183141994 $this->union = $union;
41995+ $this->unmarshalJSON = $unmarshalJSON;
4183241996 $this->unowned = $unowned;
4183341997 $this->unsafe = $unsafe;
41834- $this->unsigned = $unsigned;
4183541998 $this->useSerializers = $useSerializers;
41836- $this->ushort = $ushort;
4183741999 }
4183842000
4183942001 /**
@@ -42171,6 +42333,54 @@ class Obj5 {
4217142333 return PrimitiveKind::sample(); /*37:primitiveKind*/
4217242334 }
4217342335
42336+ /**
42337+ * @param stdClass $value
42338+ * @throws Exception
42339+ * @return Select
42340+ */
42341+ public static function fromSelect(stdClass $value): Select {
42342+ return Select::from($value); /*class*/
42343+ }
42344+
42345+ /**
42346+ * @throws Exception
42347+ * @return stdClass
42348+ */
42349+ public function toSelect(): stdClass {
42350+ if (Obj5::validateSelect($this->select)) {
42351+ return $this->select->to(); /*class*/
42352+ }
42353+ throw new Exception('never get to this Obj5::select');
42354+ }
42355+
42356+ /**
42357+ * @param Select
42358+ * @return bool
42359+ * @throws Exception
42360+ */
42361+ public static function validateSelect(Select $value): bool {
42362+ $value->validate();
42363+ return true;
42364+ }
42365+
42366+ /**
42367+ * @throws Exception
42368+ * @return Select
42369+ */
42370+ public function getSelect(): Select {
42371+ if (Obj5::validateSelect($this->select)) {
42372+ return $this->select;
42373+ }
42374+ throw new Exception('never get to getSelect Obj5::select');
42375+ }
42376+
42377+ /**
42378+ * @return Select
42379+ */
42380+ public static function sampleSelect(): Select {
42381+ return Select::sample(); /*38:select*/
42382+ }
42383+
4217442384 /**
4217542385 * @param stdClass $value
4217642386 * @throws Exception
@@ -42216,7 +42426,7 @@ class Obj5 {
4221642426 * @return SelfClass
4221742427 */
4221842428 public static function sampleSelf(): SelfClass {
42219- return SelfClass::sample(); /*38:self*/
42429+ return SelfClass::sample(); /*39:self*/
4222042430 }
4222142431
4222242432 /**
@@ -42264,7 +42474,7 @@ class Obj5 {
4226442474 * @return Sendable
4226542475 */
4226642476 public static function sampleSendable(): Sendable {
42267- return Sendable::sample(); /*39:sendable*/
42477+ return Sendable::sample(); /*40:sendable*/
4226842478 }
4226942479
4227042480 /**
@@ -42312,7 +42522,7 @@ class Obj5 {
4231242522 * @return SerialDescriptor
4231342523 */
4231442524 public static function sampleSerialDescriptor(): SerialDescriptor {
42315- return SerialDescriptor::sample(); /*40:serialDescriptor*/
42525+ return SerialDescriptor::sample(); /*41:serialDescriptor*/
4231642526 }
4231742527
4231842528 /**
@@ -42360,7 +42570,7 @@ class Obj5 {
4236042570 * @return SerialName
4236142571 */
4236242572 public static function sampleSerialName(): SerialName {
42363- return SerialName::sample(); /*41:serialName*/
42573+ return SerialName::sample(); /*42:serialName*/
4236442574 }
4236542575
4236642576 /**
@@ -42408,7 +42618,7 @@ class Obj5 {
4240842618 * @return SerializableClass
4240942619 */
4241042620 public static function sampleSerializable(): SerializableClass {
42411- return SerializableClass::sample(); /*42:serializable*/
42621+ return SerializableClass::sample(); /*43:serializable*/
4241242622 }
4241342623
4241442624 /**
@@ -42456,7 +42666,7 @@ class Obj5 {
4245642666 * @return Serialize
4245742667 */
4245842668 public static function sampleSerialize(): Serialize {
42459- return Serialize::sample(); /*43:serialize*/
42669+ return Serialize::sample(); /*44:serialize*/
4246042670 }
4246142671
4246242672 /**
@@ -42504,7 +42714,7 @@ class Obj5 {
4250442714 * @return SerializerProvider
4250542715 */
4250642716 public static function sampleSerializerProvider(): SerializerProvider {
42507- return SerializerProvider::sample(); /*44:serializerProvider*/
42717+ return SerializerProvider::sample(); /*45:serializerProvider*/
4250842718 }
4250942719
4251042720 /**
@@ -42552,7 +42762,7 @@ class Obj5 {
4255242762 * @return Set
4255342763 */
4255442764 public static function sampleSet(): Set {
42555- return Set::sample(); /*45:set*/
42765+ return Set::sample(); /*46:set*/
4255642766 }
4255742767
4255842768 /**
@@ -42600,7 +42810,7 @@ class Obj5 {
4260042810 * @return Short
4260142811 */
4260242812 public static function sampleShort(): Short {
42603- return Short::sample(); /*46:short*/
42813+ return Short::sample(); /*47:short*/
4260442814 }
4260542815
4260642816 /**
@@ -42648,7 +42858,7 @@ class Obj5 {
4264842858 * @return Signed
4264942859 */
4265042860 public static function sampleSigned(): Signed {
42651- return Signed::sample(); /*47:signed*/
42861+ return Signed::sample(); /*48:signed*/
4265242862 }
4265342863
4265442864 /**
@@ -42696,7 +42906,7 @@ class Obj5 {
4269642906 * @return SimpleModule
4269742907 */
4269842908 public static function sampleSimpleModule(): SimpleModule {
42699- return SimpleModule::sample(); /*48:simpleModule*/
42909+ return SimpleModule::sample(); /*49:simpleModule*/
4270042910 }
4270142911
4270242912 /**
@@ -42744,7 +42954,7 @@ class Obj5 {
4274442954 * @return Sizeof
4274542955 */
4274642956 public static function sampleSizeof(): Sizeof {
42747- return Sizeof::sample(); /*49:sizeof*/
42957+ return Sizeof::sample(); /*50:sizeof*/
4274842958 }
4274942959
4275042960 /**
@@ -42792,7 +43002,7 @@ class Obj5 {
4279243002 * @return Stackalloc
4279343003 */
4279443004 public static function sampleStackalloc(): Stackalloc {
42795- return Stackalloc::sample(); /*50:stackalloc*/
43005+ return Stackalloc::sample(); /*51:stackalloc*/
4279643006 }
4279743007
4279843008 /**
@@ -42840,7 +43050,7 @@ class Obj5 {
4284043050 * @return Standards
4284143051 */
4284243052 public static function sampleStandards(): Standards {
42843- return Standards::sample(); /*51:standards*/
43053+ return Standards::sample(); /*52:standards*/
4284443054 }
4284543055
4284643056 /**
@@ -42888,7 +43098,7 @@ class Obj5 {
4288843098 * @return StaticClass
4288943099 */
4289043100 public static function sampleStatic(): StaticClass {
42891- return StaticClass::sample(); /*52:static*/
43101+ return StaticClass::sample(); /*53:static*/
4289243102 }
4289343103
4289443104 /**
@@ -42936,7 +43146,7 @@ class Obj5 {
4293643146 * @return StaticAssert
4293743147 */
4293843148 public static function sampleStaticAssert(): StaticAssert {
42939- return StaticAssert::sample(); /*53:staticAssert*/
43149+ return StaticAssert::sample(); /*54:staticAssert*/
4294043150 }
4294143151
4294243152 /**
@@ -42984,7 +43194,7 @@ class Obj5 {
4298443194 * @return StaticCast
4298543195 */
4298643196 public static function sampleStaticCast(): StaticCast {
42987- return StaticCast::sample(); /*54:staticCast*/
43197+ return StaticCast::sample(); /*55:staticCast*/
4298843198 }
4298943199
4299043200 /**
@@ -43032,7 +43242,7 @@ class Obj5 {
4303243242 * @return StdDeserializer
4303343243 */
4303443244 public static function sampleStdDeserializer(): StdDeserializer {
43035- return StdDeserializer::sample(); /*55:stdDeserializer*/
43245+ return StdDeserializer::sample(); /*56:stdDeserializer*/
4303643246 }
4303743247
4303843248 /**
@@ -43080,7 +43290,7 @@ class Obj5 {
4308043290 * @return StdSerializer
4308143291 */
4308243292 public static function sampleStdSerializer(): StdSerializer {
43083- return StdSerializer::sample(); /*56:stdSerializer*/
43293+ return StdSerializer::sample(); /*57:stdSerializer*/
4308443294 }
4308543295
4308643296 /**
@@ -43128,7 +43338,7 @@ class Obj5 {
4312843338 * @return Strictfp
4312943339 */
4313043340 public static function sampleStrictfp(): Strictfp {
43131- return Strictfp::sample(); /*57:strictfp*/
43341+ return Strictfp::sample(); /*58:strictfp*/
4313243342 }
4313343343
4313443344 /**
@@ -43176,7 +43386,7 @@ class Obj5 {
4317643386 * @return StringClass
4317743387 */
4317843388 public static function sampleString(): StringClass {
43179- return StringClass::sample(); /*58:string*/
43389+ return StringClass::sample(); /*59:string*/
4318043390 }
4318143391
4318243392 /**
@@ -43224,7 +43434,7 @@ class Obj5 {
4322443434 * @return Struct
4322543435 */
4322643436 public static function sampleStruct(): Struct {
43227- return Struct::sample(); /*59:struct*/
43437+ return Struct::sample(); /*60:struct*/
4322843438 }
4322943439
4323043440 /**
@@ -43272,7 +43482,7 @@ class Obj5 {
4327243482 * @return Subscript
4327343483 */
4327443484 public static function sampleSubscript(): Subscript {
43275- return Subscript::sample(); /*60:subscript*/
43485+ return Subscript::sample(); /*61:subscript*/
4327643486 }
4327743487
4327843488 /**
@@ -43320,7 +43530,7 @@ class Obj5 {
4332043530 * @return Super
4332143531 */
4332243532 public static function sampleSuper(): Super {
43323- return Super::sample(); /*61:super*/
43533+ return Super::sample(); /*62:super*/
4332443534 }
4332543535
4332643536 /**
@@ -43368,7 +43578,7 @@ class Obj5 {
4336843578 * @return SwitchClass
4336943579 */
4337043580 public static function sampleSwitch(): SwitchClass {
43371- return SwitchClass::sample(); /*62:switch*/
43581+ return SwitchClass::sample(); /*63:switch*/
4337243582 }
4337343583
4337443584 /**
@@ -43416,7 +43626,7 @@ class Obj5 {
4341643626 * @return Symbol
4341743627 */
4341843628 public static function sampleSymbol(): Symbol {
43419- return Symbol::sample(); /*63:symbol*/
43629+ return Symbol::sample(); /*64:symbol*/
4342043630 }
4342143631
4342243632 /**
@@ -43464,7 +43674,7 @@ class Obj5 {
4346443674 * @return Synchronized
4346543675 */
4346643676 public static function sampleSynchronized(): Synchronized {
43467- return Synchronized::sample(); /*64:synchronized*/
43677+ return Synchronized::sample(); /*65:synchronized*/
4346843678 }
4346943679
4347043680 /**
@@ -43512,7 +43722,7 @@ class Obj5 {
4351243722 * @return System
4351343723 */
4351443724 public static function sampleSystem(): System {
43515- return System::sample(); /*65:system*/
43725+ return System::sample(); /*66:system*/
4351643726 }
4351743727
4351843728 /**
@@ -43560,7 +43770,7 @@ class Obj5 {
4356043770 * @return Template
4356143771 */
4356243772 public static function sampleTemplate(): Template {
43563- return Template::sample(); /*66:template*/
43773+ return Template::sample(); /*67:template*/
4356443774 }
4356543775
4356643776 /**
@@ -43608,7 +43818,7 @@ class Obj5 {
4360843818 * @return Then
4360943819 */
4361043820 public static function sampleThen(): Then {
43611- return Then::sample(); /*67:then*/
43821+ return Then::sample(); /*68:then*/
4361243822 }
4361343823
4361443824 /**
@@ -43656,7 +43866,7 @@ class Obj5 {
4365643866 * @return ThreadLocal
4365743867 */
4365843868 public static function sampleThreadLocal(): ThreadLocal {
43659- return ThreadLocal::sample(); /*68:threadLocal*/
43869+ return ThreadLocal::sample(); /*69:threadLocal*/
4366043870 }
4366143871
4366243872 /**
@@ -43704,7 +43914,7 @@ class Obj5 {
4370443914 * @return ThrowClass
4370543915 */
4370643916 public static function sampleThrow(): ThrowClass {
43707- return ThrowClass::sample(); /*69:throw*/
43917+ return ThrowClass::sample(); /*70:throw*/
4370843918 }
4370943919
4371043920 /**
@@ -43752,7 +43962,7 @@ class Obj5 {
4375243962 * @return Throws
4375343963 */
4375443964 public static function sampleThrows(): Throws {
43755- return Throws::sample(); /*70:throws*/
43965+ return Throws::sample(); /*71:throws*/
4375643966 }
4375743967
4375843968 /**
@@ -43800,7 +44010,7 @@ class Obj5 {
4380044010 * @return TimeOnly
4380144011 */
4380244012 public static function sampleTimeOnly(): TimeOnly {
43803- return TimeOnly::sample(); /*71:timeOnly*/
44013+ return TimeOnly::sample(); /*72:timeOnly*/
4380444014 }
4380544015
4380644016 /**
@@ -43848,7 +44058,7 @@ class Obj5 {
4384844058 * @return TimeOnlyConverter
4384944059 */
4385044060 public static function sampleTimeOnlyConverter(): TimeOnlyConverter {
43851- return TimeOnlyConverter::sample(); /*72:timeOnlyConverter*/
44061+ return TimeOnlyConverter::sample(); /*73:timeOnlyConverter*/
4385244062 }
4385344063
4385444064 /**
@@ -43896,7 +44106,55 @@ class Obj5 {
4389644106 * @return TimeZone
4389744107 */
4389844108 public static function sampleTimeZone(): TimeZone {
43899- return TimeZone::sample(); /*73:timeZone*/
44109+ return TimeZone::sample(); /*74:timeZone*/
44110+ }
44111+
44112+ /**
44113+ * @param stdClass $value
44114+ * @throws Exception
44115+ * @return ToDict
44116+ */
44117+ public static function fromToDict(stdClass $value): ToDict {
44118+ return ToDict::from($value); /*class*/
44119+ }
44120+
44121+ /**
44122+ * @throws Exception
44123+ * @return stdClass
44124+ */
44125+ public function toToDict(): stdClass {
44126+ if (Obj5::validateToDict($this->toDict)) {
44127+ return $this->toDict->to(); /*class*/
44128+ }
44129+ throw new Exception('never get to this Obj5::toDict');
44130+ }
44131+
44132+ /**
44133+ * @param ToDict
44134+ * @return bool
44135+ * @throws Exception
44136+ */
44137+ public static function validateToDict(ToDict $value): bool {
44138+ $value->validate();
44139+ return true;
44140+ }
44141+
44142+ /**
44143+ * @throws Exception
44144+ * @return ToDict
44145+ */
44146+ public function getToDict(): ToDict {
44147+ if (Obj5::validateToDict($this->toDict)) {
44148+ return $this->toDict;
44149+ }
44150+ throw new Exception('never get to getToDict Obj5::toDict');
44151+ }
44152+
44153+ /**
44154+ * @return ToDict
44155+ */
44156+ public static function sampleToDict(): ToDict {
44157+ return ToDict::sample(); /*75:toDict*/
4390044158 }
4390144159
4390244160 /**
@@ -43944,7 +44202,7 @@ class Obj5 {
4394444202 * @return ToJSON
4394544203 */
4394644204 public static function sampleToJSON(): ToJSON {
43947- return ToJSON::sample(); /*74:toJSON*/
44205+ return ToJSON::sample(); /*76:toJSON*/
4394844206 }
4394944207
4395044208 /**
@@ -43992,7 +44250,7 @@ class Obj5 {
4399244250 * @return ToString
4399344251 */
4399444252 public static function sampleToString(): ToString {
43995- return ToString::sample(); /*75:toString*/
44253+ return ToString::sample(); /*77:toString*/
4399644254 }
4399744255
4399844256 /**
@@ -44040,7 +44298,7 @@ class Obj5 {
4404044298 * @return TopLevelClass
4404144299 */
4404244300 public static function sampleTopLevel(): TopLevelClass {
44043- return TopLevelClass::sample(); /*76:topLevel*/
44301+ return TopLevelClass::sample(); /*78:topLevel*/
4404444302 }
4404544303
4404644304 /**
@@ -44088,7 +44346,7 @@ class Obj5 {
4408844346 * @return Transient
4408944347 */
4409044348 public static function sampleTransient(): Transient {
44091- return Transient::sample(); /*77:transient*/
44349+ return Transient::sample(); /*79:transient*/
4409244350 }
4409344351
4409444352 /**
@@ -44136,7 +44394,7 @@ class Obj5 {
4413644394 * @return TrueClass
4413744395 */
4413844396 public static function sampleTrue(): TrueClass {
44139- return TrueClass::sample(); /*78:true*/
44397+ return TrueClass::sample(); /*80:true*/
4414044398 }
4414144399
4414244400 /**
@@ -44184,7 +44442,7 @@ class Obj5 {
4418444442 * @return TryClass
4418544443 */
4418644444 public static function sampleTry(): TryClass {
44187- return TryClass::sample(); /*79:try*/
44445+ return TryClass::sample(); /*81:try*/
4418844446 }
4418944447
4419044448 /**
@@ -44232,7 +44490,7 @@ class Obj5 {
4423244490 * @return Type
4423344491 */
4423444492 public static function sampleType(): Type {
44235- return Type::sample(); /*80:type*/
44493+ return Type::sample(); /*82:type*/
4423644494 }
4423744495
4423844496 /**
@@ -44280,7 +44538,7 @@ class Obj5 {
4428044538 * @return Typealias
4428144539 */
4428244540 public static function sampleTypealias(): Typealias {
44283- return Typealias::sample(); /*81:typealias*/
44541+ return Typealias::sample(); /*83:typealias*/
4428444542 }
4428544543
4428644544 /**
@@ -44328,7 +44586,7 @@ class Obj5 {
4432844586 * @return Typedef
4432944587 */
4433044588 public static function sampleTypedef(): Typedef {
44331- return Typedef::sample(); /*82:typedef*/
44589+ return Typedef::sample(); /*84:typedef*/
4433244590 }
4433344591
4433444592 /**
@@ -44376,7 +44634,7 @@ class Obj5 {
4437644634 * @return Typeid
4437744635 */
4437844636 public static function sampleTypeid(): Typeid {
44379- return Typeid::sample(); /*83:typeid*/
44637+ return Typeid::sample(); /*85:typeid*/
4438044638 }
4438144639
4438244640 /**
@@ -44424,7 +44682,7 @@ class Obj5 {
4442444682 * @return Typename
4442544683 */
4442644684 public static function sampleTypename(): Typename {
44427- return Typename::sample(); /*84:typename*/
44685+ return Typename::sample(); /*86:typename*/
4442844686 }
4442944687
4443044688 /**
@@ -44472,7 +44730,7 @@ class Obj5 {
4447244730 * @return Typeof
4447344731 */
4447444732 public static function sampleTypeof(): Typeof {
44475- return Typeof::sample(); /*85:typeof*/
44733+ return Typeof::sample(); /*87:typeof*/
4447644734 }
4447744735
4447844736 /**
@@ -44520,7 +44778,7 @@ class Obj5 {
4452044778 * @return Uint
4452144779 */
4452244780 public static function sampleUint(): Uint {
44523- return Uint::sample(); /*86:uint*/
44781+ return Uint::sample(); /*88:uint*/
4452444782 }
4452544783
4452644784 /**
@@ -44568,7 +44826,7 @@ class Obj5 {
4456844826 * @return Ulong
4456944827 */
4457044828 public static function sampleUlong(): Ulong {
44571- return Ulong::sample(); /*87:ulong*/
44829+ return Ulong::sample(); /*89:ulong*/
4457244830 }
4457344831
4457444832 /**
@@ -44616,7 +44874,7 @@ class Obj5 {
4461644874 * @return Unchecked
4461744875 */
4461844876 public static function sampleUnchecked(): Unchecked {
44619- return Unchecked::sample(); /*88:unchecked*/
44877+ return Unchecked::sample(); /*90:unchecked*/
4462044878 }
4462144879
4462244880 /**
@@ -44664,7 +44922,7 @@ class Obj5 {
4466444922 * @return Undefined
4466544923 */
4466644924 public static function sampleUndefined(): Undefined {
44667- return Undefined::sample(); /*89:undefined*/
44925+ return Undefined::sample(); /*91:undefined*/
4466844926 }
4466944927
4467044928 /**
@@ -44712,7 +44970,55 @@ class Obj5 {
4471244970 * @return Union
4471344971 */
4471444972 public static function sampleUnion(): Union {
44715- return Union::sample(); /*90:union*/
44973+ return Union::sample(); /*92:union*/
44974+ }
44975+
44976+ /**
44977+ * @param stdClass $value
44978+ * @throws Exception
44979+ * @return UnmarshalJSON
44980+ */
44981+ public static function fromUnmarshalJSON(stdClass $value): UnmarshalJSON {
44982+ return UnmarshalJSON::from($value); /*class*/
44983+ }
44984+
44985+ /**
44986+ * @throws Exception
44987+ * @return stdClass
44988+ */
44989+ public function toUnmarshalJSON(): stdClass {
44990+ if (Obj5::validateUnmarshalJSON($this->unmarshalJSON)) {
44991+ return $this->unmarshalJSON->to(); /*class*/
44992+ }
44993+ throw new Exception('never get to this Obj5::unmarshalJSON');
44994+ }
44995+
44996+ /**
44997+ * @param UnmarshalJSON
44998+ * @return bool
44999+ * @throws Exception
45000+ */
45001+ public static function validateUnmarshalJSON(UnmarshalJSON $value): bool {
45002+ $value->validate();
45003+ return true;
45004+ }
45005+
45006+ /**
45007+ * @throws Exception
45008+ * @return UnmarshalJSON
45009+ */
45010+ public function getUnmarshalJSON(): UnmarshalJSON {
45011+ if (Obj5::validateUnmarshalJSON($this->unmarshalJSON)) {
45012+ return $this->unmarshalJSON;
45013+ }
45014+ throw new Exception('never get to getUnmarshalJSON Obj5::unmarshalJSON');
45015+ }
45016+
45017+ /**
45018+ * @return UnmarshalJSON
45019+ */
45020+ public static function sampleUnmarshalJSON(): UnmarshalJSON {
45021+ return UnmarshalJSON::sample(); /*93:unmarshalJSON*/
4471645022 }
4471745023
4471845024 /**
@@ -44760,7 +45066,7 @@ class Obj5 {
4476045066 * @return Unowned
4476145067 */
4476245068 public static function sampleUnowned(): Unowned {
44763- return Unowned::sample(); /*91:unowned*/
45069+ return Unowned::sample(); /*94:unowned*/
4476445070 }
4476545071
4476645072 /**
@@ -44808,55 +45114,7 @@ class Obj5 {
4480845114 * @return Unsafe
4480945115 */
4481045116 public static function sampleUnsafe(): Unsafe {
44811- return Unsafe::sample(); /*92:unsafe*/
44812- }
44813-
44814- /**
44815- * @param stdClass $value
44816- * @throws Exception
44817- * @return Unsigned
44818- */
44819- public static function fromUnsigned(stdClass $value): Unsigned {
44820- return Unsigned::from($value); /*class*/
44821- }
44822-
44823- /**
44824- * @throws Exception
44825- * @return stdClass
44826- */
44827- public function toUnsigned(): stdClass {
44828- if (Obj5::validateUnsigned($this->unsigned)) {
44829- return $this->unsigned->to(); /*class*/
44830- }
44831- throw new Exception('never get to this Obj5::unsigned');
44832- }
44833-
44834- /**
44835- * @param Unsigned
44836- * @return bool
44837- * @throws Exception
44838- */
44839- public static function validateUnsigned(Unsigned $value): bool {
44840- $value->validate();
44841- return true;
44842- }
44843-
44844- /**
44845- * @throws Exception
44846- * @return Unsigned
44847- */
44848- public function getUnsigned(): Unsigned {
44849- if (Obj5::validateUnsigned($this->unsigned)) {
44850- return $this->unsigned;
44851- }
44852- throw new Exception('never get to getUnsigned Obj5::unsigned');
44853- }
44854-
44855- /**
44856- * @return Unsigned
44857- */
44858- public static function sampleUnsigned(): Unsigned {
44859- return Unsigned::sample(); /*93:unsigned*/
45117+ return Unsafe::sample(); /*95:unsafe*/
4486045118 }
4486145119
4486245120 /**
@@ -44904,55 +45162,7 @@ class Obj5 {
4490445162 * @return UseSerializers
4490545163 */
4490645164 public static function sampleUseSerializers(): UseSerializers {
44907- return UseSerializers::sample(); /*94:useSerializers*/
44908- }
44909-
44910- /**
44911- * @param stdClass $value
44912- * @throws Exception
44913- * @return Ushort
44914- */
44915- public static function fromUshort(stdClass $value): Ushort {
44916- return Ushort::from($value); /*class*/
44917- }
44918-
44919- /**
44920- * @throws Exception
44921- * @return stdClass
44922- */
44923- public function toUshort(): stdClass {
44924- if (Obj5::validateUshort($this->ushort)) {
44925- return $this->ushort->to(); /*class*/
44926- }
44927- throw new Exception('never get to this Obj5::ushort');
44928- }
44929-
44930- /**
44931- * @param Ushort
44932- * @return bool
44933- * @throws Exception
44934- */
44935- public static function validateUshort(Ushort $value): bool {
44936- $value->validate();
44937- return true;
44938- }
44939-
44940- /**
44941- * @throws Exception
44942- * @return Ushort
44943- */
44944- public function getUshort(): Ushort {
44945- if (Obj5::validateUshort($this->ushort)) {
44946- return $this->ushort;
44947- }
44948- throw new Exception('never get to getUshort Obj5::ushort');
44949- }
44950-
44951- /**
44952- * @return Ushort
44953- */
44954- public static function sampleUshort(): Ushort {
44955- return Ushort::sample(); /*95:ushort*/
45165+ return UseSerializers::sample(); /*96:useSerializers*/
4495645166 }
4495745167
4495845168 /**
@@ -44967,6 +45177,7 @@ class Obj5 {
4496745177 || Obj5::validateObj5True($this->obj5True)
4496845178 || Obj5::validateObj5Type($this->obj5Type)
4496945179 || Obj5::validatePrimitiveKind($this->primitiveKind)
45180+ || Obj5::validateSelect($this->select)
4497045181 || Obj5::validateSelf($this->self)
4497145182 || Obj5::validateSendable($this->sendable)
4497245183 || Obj5::validateSerialDescriptor($this->serialDescriptor)
@@ -45003,6 +45214,7 @@ class Obj5 {
4500345214 || Obj5::validateTimeOnly($this->timeOnly)
4500445215 || Obj5::validateTimeOnlyConverter($this->timeOnlyConverter)
4500545216 || Obj5::validateTimeZone($this->timeZone)
45217+ || Obj5::validateToDict($this->toDict)
4500645218 || Obj5::validateToJSON($this->toJSON)
4500745219 || Obj5::validateToString($this->toString)
4500845220 || Obj5::validateTopLevel($this->topLevel)
@@ -45020,11 +45232,10 @@ class Obj5 {
4502045232 || Obj5::validateUnchecked($this->unchecked)
4502145233 || Obj5::validateUndefined($this->undefined)
4502245234 || Obj5::validateUnion($this->union)
45235+ || Obj5::validateUnmarshalJSON($this->unmarshalJSON)
4502345236 || Obj5::validateUnowned($this->unowned)
4502445237 || Obj5::validateUnsafe($this->unsafe)
45025- || Obj5::validateUnsigned($this->unsigned)
45026- || Obj5::validateUseSerializers($this->useSerializers)
45027- || Obj5::validateUshort($this->ushort);
45238+ || Obj5::validateUseSerializers($this->useSerializers);
4502845239 }
4502945240
4503045241 /**
@@ -45040,6 +45251,7 @@ class Obj5 {
4504045251 $out->{'true'} = $this->toObj5True();
4504145252 $out->{'type'} = $this->toObj5Type();
4504245253 $out->{'PrimitiveKind'} = $this->toPrimitiveKind();
45254+ $out->{'select'} = $this->toSelect();
4504345255 $out->{'Self'} = $this->toSelf();
4504445256 $out->{'Sendable'} = $this->toSendable();
4504545257 $out->{'SerialDescriptor'} = $this->toSerialDescriptor();
@@ -45076,6 +45288,7 @@ class Obj5 {
4507645288 $out->{'TimeOnly'} = $this->toTimeOnly();
4507745289 $out->{'TimeOnlyConverter'} = $this->toTimeOnlyConverter();
4507845290 $out->{'TimeZone'} = $this->toTimeZone();
45291+ $out->{'to_dict'} = $this->toToDict();
4507945292 $out->{'to_json'} = $this->toToJSON();
4508045293 $out->{'toString'} = $this->toToString();
4508145294 $out->{'top_level'} = $this->toTopLevel();
@@ -45093,11 +45306,10 @@ class Obj5 {
4509345306 $out->{'unchecked'} = $this->toUnchecked();
4509445307 $out->{'undefined'} = $this->toUndefined();
4509545308 $out->{'union'} = $this->toUnion();
45309+ $out->{'UnmarshalJSON'} = $this->toUnmarshalJSON();
4509645310 $out->{'unowned'} = $this->toUnowned();
4509745311 $out->{'unsafe'} = $this->toUnsafe();
45098- $out->{'unsigned'} = $this->toUnsigned();
4509945312 $out->{'UseSerializers'} = $this->toUseSerializers();
45100- $out->{'ushort'} = $this->toUshort();
4510145313 return $out;
4510245314 }
4510345315
@@ -45128,6 +45340,9 @@ class Obj5 {
4512845340 if (!property_exists($obj, 'PrimitiveKind')) {
4512945341 throw new Exception("Missing required property");
4513045342 }
45343+ if (!property_exists($obj, 'select')) {
45344+ throw new Exception("Missing required property");
45345+ }
4513145346 if (!property_exists($obj, 'Self')) {
4513245347 throw new Exception("Missing required property");
4513345348 }
@@ -45236,6 +45451,9 @@ class Obj5 {
4523645451 if (!property_exists($obj, 'TimeZone')) {
4523745452 throw new Exception("Missing required property");
4523845453 }
45454+ if (!property_exists($obj, 'to_dict')) {
45455+ throw new Exception("Missing required property");
45456+ }
4523945457 if (!property_exists($obj, 'to_json')) {
4524045458 throw new Exception("Missing required property");
4524145459 }
@@ -45287,21 +45505,18 @@ class Obj5 {
4528745505 if (!property_exists($obj, 'union')) {
4528845506 throw new Exception("Missing required property");
4528945507 }
45290- if (!property_exists($obj, 'unowned')) {
45508+ if (!property_exists($obj, 'UnmarshalJSON')) {
4529145509 throw new Exception("Missing required property");
4529245510 }
45293- if (!property_exists($obj, 'unsafe')) {
45511+ if (!property_exists($obj, 'unowned')) {
4529445512 throw new Exception("Missing required property");
4529545513 }
45296- if (!property_exists($obj, 'unsigned')) {
45514+ if (!property_exists($obj, 'unsafe')) {
4529745515 throw new Exception("Missing required property");
4529845516 }
4529945517 if (!property_exists($obj, 'UseSerializers')) {
4530045518 throw new Exception("Missing required property");
4530145519 }
45302- if (!property_exists($obj, 'ushort')) {
45303- throw new Exception("Missing required property");
45304- }
4530545520 return new Obj5(
4530645521 Obj5::fromDummy($obj->{'dummy'})
4530745522 ,Obj5::fromKSerializer($obj->{'KSerializer'})
@@ -45310,6 +45525,7 @@ class Obj5 {
4531045525 ,Obj5::fromObj5True($obj->{'true'})
4531145526 ,Obj5::fromObj5Type($obj->{'type'})
4531245527 ,Obj5::fromPrimitiveKind($obj->{'PrimitiveKind'})
45528+ ,Obj5::fromSelect($obj->{'select'})
4531345529 ,Obj5::fromSelf($obj->{'Self'})
4531445530 ,Obj5::fromSendable($obj->{'Sendable'})
4531545531 ,Obj5::fromSerialDescriptor($obj->{'SerialDescriptor'})
@@ -45346,6 +45562,7 @@ class Obj5 {
4534645562 ,Obj5::fromTimeOnly($obj->{'TimeOnly'})
4534745563 ,Obj5::fromTimeOnlyConverter($obj->{'TimeOnlyConverter'})
4534845564 ,Obj5::fromTimeZone($obj->{'TimeZone'})
45565+ ,Obj5::fromToDict($obj->{'to_dict'})
4534945566 ,Obj5::fromToJSON($obj->{'to_json'})
4535045567 ,Obj5::fromToString($obj->{'toString'})
4535145568 ,Obj5::fromTopLevel($obj->{'top_level'})
@@ -45363,11 +45580,10 @@ class Obj5 {
4536345580 ,Obj5::fromUnchecked($obj->{'unchecked'})
4536445581 ,Obj5::fromUndefined($obj->{'undefined'})
4536545582 ,Obj5::fromUnion($obj->{'union'})
45583+ ,Obj5::fromUnmarshalJSON($obj->{'UnmarshalJSON'})
4536645584 ,Obj5::fromUnowned($obj->{'unowned'})
4536745585 ,Obj5::fromUnsafe($obj->{'unsafe'})
45368- ,Obj5::fromUnsigned($obj->{'unsigned'})
4536945586 ,Obj5::fromUseSerializers($obj->{'UseSerializers'})
45370- ,Obj5::fromUshort($obj->{'ushort'})
4537145587 );
4537245588 }
4537345589
@@ -45383,6 +45599,7 @@ class Obj5 {
4538345599 ,Obj5::sampleObj5True()
4538445600 ,Obj5::sampleObj5Type()
4538545601 ,Obj5::samplePrimitiveKind()
45602+ ,Obj5::sampleSelect()
4538645603 ,Obj5::sampleSelf()
4538745604 ,Obj5::sampleSendable()
4538845605 ,Obj5::sampleSerialDescriptor()
@@ -45419,6 +45636,7 @@ class Obj5 {
4541945636 ,Obj5::sampleTimeOnly()
4542045637 ,Obj5::sampleTimeOnlyConverter()
4542145638 ,Obj5::sampleTimeZone()
45639+ ,Obj5::sampleToDict()
4542245640 ,Obj5::sampleToJSON()
4542345641 ,Obj5::sampleToString()
4542445642 ,Obj5::sampleTopLevel()
@@ -45436,11 +45654,10 @@ class Obj5 {
4543645654 ,Obj5::sampleUnchecked()
4543745655 ,Obj5::sampleUndefined()
4543845656 ,Obj5::sampleUnion()
45657+ ,Obj5::sampleUnmarshalJSON()
4543945658 ,Obj5::sampleUnowned()
4544045659 ,Obj5::sampleUnsafe()
45441- ,Obj5::sampleUnsigned()
4544245660 ,Obj5::sampleUseSerializers()
45443- ,Obj5::sampleUshort()
4544445661 );
4544545662 }
4544645663 }
@@ -46051,6 +46268,107 @@ class PrimitiveKind {
4605146268 }
4605246269 }
4605346270
46271+// This is an autogenerated file:Select
46272+
46273+class Select {
46274+ private int $select; // json:select Required
46275+
46276+ /**
46277+ * @param int $select
46278+ */
46279+ public function __construct(int $select) {
46280+ $this->select = $select;
46281+ }
46282+
46283+ /**
46284+ * @param int $value
46285+ * @throws Exception
46286+ * @return int
46287+ */
46288+ public static function fromSelect(int $value): int {
46289+ return $value; /*int*/
46290+ }
46291+
46292+ /**
46293+ * @throws Exception
46294+ * @return int
46295+ */
46296+ public function toSelect(): int {
46297+ if (Select::validateSelect($this->select)) {
46298+ return $this->select; /*int*/
46299+ }
46300+ throw new Exception('never get to this Select::select');
46301+ }
46302+
46303+ /**
46304+ * @param int
46305+ * @return bool
46306+ * @throws Exception
46307+ */
46308+ public static function validateSelect(int $value): bool {
46309+ return true;
46310+ }
46311+
46312+ /**
46313+ * @throws Exception
46314+ * @return int
46315+ */
46316+ public function getSelect(): int {
46317+ if (Select::validateSelect($this->select)) {
46318+ return $this->select;
46319+ }
46320+ throw new Exception('never get to getSelect Select::select');
46321+ }
46322+
46323+ /**
46324+ * @return int
46325+ */
46326+ public static function sampleSelect(): int {
46327+ return 31; /*31:select*/
46328+ }
46329+
46330+ /**
46331+ * @throws Exception
46332+ * @return bool
46333+ */
46334+ public function validate(): bool {
46335+ return Select::validateSelect($this->select);
46336+ }
46337+
46338+ /**
46339+ * @return stdClass
46340+ * @throws Exception
46341+ */
46342+ public function to(): stdClass {
46343+ $out = new stdClass();
46344+ $out->{'select'} = $this->toSelect();
46345+ return $out;
46346+ }
46347+
46348+ /**
46349+ * @param stdClass $obj
46350+ * @return Select
46351+ * @throws Exception
46352+ */
46353+ public static function from(stdClass $obj): Select {
46354+ if (!property_exists($obj, 'select')) {
46355+ throw new Exception("Missing required property");
46356+ }
46357+ return new Select(
46358+ Select::fromSelect($obj->{'select'})
46359+ );
46360+ }
46361+
46362+ /**
46363+ * @return Select
46364+ */
46365+ public static function sample(): Select {
46366+ return new Select(
46367+ Select::sampleSelect()
46368+ );
46369+ }
46370+}
46371+
4605446372 // This is an autogenerated file:SelfClass
4605546373
4605646374 class SelfClass {
@@ -49687,6 +50005,107 @@ class TimeZone {
4968750005 }
4968850006 }
4968950007
50008+// This is an autogenerated file:ToDict
50009+
50010+class ToDict {
50011+ private int $toDict; // json:to_dict Required
50012+
50013+ /**
50014+ * @param int $toDict
50015+ */
50016+ public function __construct(int $toDict) {
50017+ $this->toDict = $toDict;
50018+ }
50019+
50020+ /**
50021+ * @param int $value
50022+ * @throws Exception
50023+ * @return int
50024+ */
50025+ public static function fromToDict(int $value): int {
50026+ return $value; /*int*/
50027+ }
50028+
50029+ /**
50030+ * @throws Exception
50031+ * @return int
50032+ */
50033+ public function toToDict(): int {
50034+ if (ToDict::validateToDict($this->toDict)) {
50035+ return $this->toDict; /*int*/
50036+ }
50037+ throw new Exception('never get to this ToDict::toDict');
50038+ }
50039+
50040+ /**
50041+ * @param int
50042+ * @return bool
50043+ * @throws Exception
50044+ */
50045+ public static function validateToDict(int $value): bool {
50046+ return true;
50047+ }
50048+
50049+ /**
50050+ * @throws Exception
50051+ * @return int
50052+ */
50053+ public function getToDict(): int {
50054+ if (ToDict::validateToDict($this->toDict)) {
50055+ return $this->toDict;
50056+ }
50057+ throw new Exception('never get to getToDict ToDict::toDict');
50058+ }
50059+
50060+ /**
50061+ * @return int
50062+ */
50063+ public static function sampleToDict(): int {
50064+ return 31; /*31:toDict*/
50065+ }
50066+
50067+ /**
50068+ * @throws Exception
50069+ * @return bool
50070+ */
50071+ public function validate(): bool {
50072+ return ToDict::validateToDict($this->toDict);
50073+ }
50074+
50075+ /**
50076+ * @return stdClass
50077+ * @throws Exception
50078+ */
50079+ public function to(): stdClass {
50080+ $out = new stdClass();
50081+ $out->{'to_dict'} = $this->toToDict();
50082+ return $out;
50083+ }
50084+
50085+ /**
50086+ * @param stdClass $obj
50087+ * @return ToDict
50088+ * @throws Exception
50089+ */
50090+ public static function from(stdClass $obj): ToDict {
50091+ if (!property_exists($obj, 'to_dict')) {
50092+ throw new Exception("Missing required property");
50093+ }
50094+ return new ToDict(
50095+ ToDict::fromToDict($obj->{'to_dict'})
50096+ );
50097+ }
50098+
50099+ /**
50100+ * @return ToDict
50101+ */
50102+ public static function sample(): ToDict {
50103+ return new ToDict(
50104+ ToDict::sampleToDict()
50105+ );
50106+ }
50107+}
50108+
4969050109 // This is an autogenerated file:ToJSON
4969150110
4969250111 class ToJSON {
@@ -51404,16 +51823,16 @@ class Union {
5140451823 }
5140551824 }
5140651825
51407-// This is an autogenerated file:Unowned
51826+// This is an autogenerated file:UnmarshalJSON
5140851827
51409-class Unowned {
51410- private int $unowned; // json:unowned Required
51828+class UnmarshalJSON {
51829+ private int $unmarshalJSON; // json:UnmarshalJSON Required
5141151830
5141251831 /**
51413- * @param int $unowned
51832+ * @param int $unmarshalJSON
5141451833 */
51415- public function __construct(int $unowned) {
51416- $this->unowned = $unowned;
51834+ public function __construct(int $unmarshalJSON) {
51835+ $this->unmarshalJSON = $unmarshalJSON;
5141751836 }
5141851837
5141951838 /**
@@ -51421,7 +51840,7 @@ class Unowned {
5142151840 * @throws Exception
5142251841 * @return int
5142351842 */
51424- public static function fromUnowned(int $value): int {
51843+ public static function fromUnmarshalJSON(int $value): int {
5142551844 return $value; /*int*/
5142651845 }
5142751846
@@ -51429,11 +51848,11 @@ class Unowned {
5142951848 * @throws Exception
5143051849 * @return int
5143151850 */
51432- public function toUnowned(): int {
51433- if (Unowned::validateUnowned($this->unowned)) {
51434- return $this->unowned; /*int*/
51851+ public function toUnmarshalJSON(): int {
51852+ if (UnmarshalJSON::validateUnmarshalJSON($this->unmarshalJSON)) {
51853+ return $this->unmarshalJSON; /*int*/
5143551854 }
51436- throw new Exception('never get to this Unowned::unowned');
51855+ throw new Exception('never get to this UnmarshalJSON::unmarshalJSON');
5143751856 }
5143851857
5143951858 /**
@@ -51441,7 +51860,7 @@ class Unowned {
5144151860 * @return bool
5144251861 * @throws Exception
5144351862 */
51444- public static function validateUnowned(int $value): bool {
51863+ public static function validateUnmarshalJSON(int $value): bool {
5144551864 return true;
5144651865 }
5144751866
@@ -51449,18 +51868,18 @@ class Unowned {
5144951868 * @throws Exception
5145051869 * @return int
5145151870 */
51452- public function getUnowned(): int {
51453- if (Unowned::validateUnowned($this->unowned)) {
51454- return $this->unowned;
51871+ public function getUnmarshalJSON(): int {
51872+ if (UnmarshalJSON::validateUnmarshalJSON($this->unmarshalJSON)) {
51873+ return $this->unmarshalJSON;
5145551874 }
51456- throw new Exception('never get to getUnowned Unowned::unowned');
51875+ throw new Exception('never get to getUnmarshalJSON UnmarshalJSON::unmarshalJSON');
5145751876 }
5145851877
5145951878 /**
5146051879 * @return int
5146151880 */
51462- public static function sampleUnowned(): int {
51463- return 31; /*31:unowned*/
51881+ public static function sampleUnmarshalJSON(): int {
51882+ return 31; /*31:unmarshalJSON*/
5146451883 }
5146551884
5146651885 /**
@@ -51468,7 +51887,7 @@ class Unowned {
5146851887 * @return bool
5146951888 */
5147051889 public function validate(): bool {
51471- return Unowned::validateUnowned($this->unowned);
51890+ return UnmarshalJSON::validateUnmarshalJSON($this->unmarshalJSON);
5147251891 }
5147351892
5147451893 /**
@@ -51477,44 +51896,44 @@ class Unowned {
5147751896 */
5147851897 public function to(): stdClass {
5147951898 $out = new stdClass();
51480- $out->{'unowned'} = $this->toUnowned();
51899+ $out->{'UnmarshalJSON'} = $this->toUnmarshalJSON();
5148151900 return $out;
5148251901 }
5148351902
5148451903 /**
5148551904 * @param stdClass $obj
51486- * @return Unowned
51905+ * @return UnmarshalJSON
5148751906 * @throws Exception
5148851907 */
51489- public static function from(stdClass $obj): Unowned {
51490- if (!property_exists($obj, 'unowned')) {
51908+ public static function from(stdClass $obj): UnmarshalJSON {
51909+ if (!property_exists($obj, 'UnmarshalJSON')) {
5149151910 throw new Exception("Missing required property");
5149251911 }
51493- return new Unowned(
51494- Unowned::fromUnowned($obj->{'unowned'})
51912+ return new UnmarshalJSON(
51913+ UnmarshalJSON::fromUnmarshalJSON($obj->{'UnmarshalJSON'})
5149551914 );
5149651915 }
5149751916
5149851917 /**
51499- * @return Unowned
51918+ * @return UnmarshalJSON
5150051919 */
51501- public static function sample(): Unowned {
51502- return new Unowned(
51503- Unowned::sampleUnowned()
51920+ public static function sample(): UnmarshalJSON {
51921+ return new UnmarshalJSON(
51922+ UnmarshalJSON::sampleUnmarshalJSON()
5150451923 );
5150551924 }
5150651925 }
5150751926
51508-// This is an autogenerated file:Unsafe
51927+// This is an autogenerated file:Unowned
5150951928
51510-class Unsafe {
51511- private int $unsafe; // json:unsafe Required
51929+class Unowned {
51930+ private int $unowned; // json:unowned Required
5151251931
5151351932 /**
51514- * @param int $unsafe
51933+ * @param int $unowned
5151551934 */
51516- public function __construct(int $unsafe) {
51517- $this->unsafe = $unsafe;
51935+ public function __construct(int $unowned) {
51936+ $this->unowned = $unowned;
5151851937 }
5151951938
5152051939 /**
@@ -51522,7 +51941,7 @@ class Unsafe {
5152251941 * @throws Exception
5152351942 * @return int
5152451943 */
51525- public static function fromUnsafe(int $value): int {
51944+ public static function fromUnowned(int $value): int {
5152651945 return $value; /*int*/
5152751946 }
5152851947
@@ -51530,11 +51949,11 @@ class Unsafe {
5153051949 * @throws Exception
5153151950 * @return int
5153251951 */
51533- public function toUnsafe(): int {
51534- if (Unsafe::validateUnsafe($this->unsafe)) {
51535- return $this->unsafe; /*int*/
51952+ public function toUnowned(): int {
51953+ if (Unowned::validateUnowned($this->unowned)) {
51954+ return $this->unowned; /*int*/
5153651955 }
51537- throw new Exception('never get to this Unsafe::unsafe');
51956+ throw new Exception('never get to this Unowned::unowned');
5153851957 }
5153951958
5154051959 /**
@@ -51542,7 +51961,7 @@ class Unsafe {
5154251961 * @return bool
5154351962 * @throws Exception
5154451963 */
51545- public static function validateUnsafe(int $value): bool {
51964+ public static function validateUnowned(int $value): bool {
5154651965 return true;
5154751966 }
5154851967
@@ -51550,18 +51969,18 @@ class Unsafe {
5155051969 * @throws Exception
5155151970 * @return int
5155251971 */
51553- public function getUnsafe(): int {
51554- if (Unsafe::validateUnsafe($this->unsafe)) {
51555- return $this->unsafe;
51972+ public function getUnowned(): int {
51973+ if (Unowned::validateUnowned($this->unowned)) {
51974+ return $this->unowned;
5155651975 }
51557- throw new Exception('never get to getUnsafe Unsafe::unsafe');
51976+ throw new Exception('never get to getUnowned Unowned::unowned');
5155851977 }
5155951978
5156051979 /**
5156151980 * @return int
5156251981 */
51563- public static function sampleUnsafe(): int {
51564- return 31; /*31:unsafe*/
51982+ public static function sampleUnowned(): int {
51983+ return 31; /*31:unowned*/
5156551984 }
5156651985
5156751986 /**
@@ -51569,7 +51988,7 @@ class Unsafe {
5156951988 * @return bool
5157051989 */
5157151990 public function validate(): bool {
51572- return Unsafe::validateUnsafe($this->unsafe);
51991+ return Unowned::validateUnowned($this->unowned);
5157351992 }
5157451993
5157551994 /**
@@ -51578,44 +51997,44 @@ class Unsafe {
5157851997 */
5157951998 public function to(): stdClass {
5158051999 $out = new stdClass();
51581- $out->{'unsafe'} = $this->toUnsafe();
52000+ $out->{'unowned'} = $this->toUnowned();
5158252001 return $out;
5158352002 }
5158452003
5158552004 /**
5158652005 * @param stdClass $obj
51587- * @return Unsafe
52006+ * @return Unowned
5158852007 * @throws Exception
5158952008 */
51590- public static function from(stdClass $obj): Unsafe {
51591- if (!property_exists($obj, 'unsafe')) {
52009+ public static function from(stdClass $obj): Unowned {
52010+ if (!property_exists($obj, 'unowned')) {
5159252011 throw new Exception("Missing required property");
5159352012 }
51594- return new Unsafe(
51595- Unsafe::fromUnsafe($obj->{'unsafe'})
52013+ return new Unowned(
52014+ Unowned::fromUnowned($obj->{'unowned'})
5159652015 );
5159752016 }
5159852017
5159952018 /**
51600- * @return Unsafe
52019+ * @return Unowned
5160152020 */
51602- public static function sample(): Unsafe {
51603- return new Unsafe(
51604- Unsafe::sampleUnsafe()
52021+ public static function sample(): Unowned {
52022+ return new Unowned(
52023+ Unowned::sampleUnowned()
5160552024 );
5160652025 }
5160752026 }
5160852027
51609-// This is an autogenerated file:Unsigned
52028+// This is an autogenerated file:Unsafe
5161052029
51611-class Unsigned {
51612- private int $unsigned; // json:unsigned Required
52030+class Unsafe {
52031+ private int $unsafe; // json:unsafe Required
5161352032
5161452033 /**
51615- * @param int $unsigned
52034+ * @param int $unsafe
5161652035 */
51617- public function __construct(int $unsigned) {
51618- $this->unsigned = $unsigned;
52036+ public function __construct(int $unsafe) {
52037+ $this->unsafe = $unsafe;
5161952038 }
5162052039
5162152040 /**
@@ -51623,7 +52042,7 @@ class Unsigned {
5162352042 * @throws Exception
5162452043 * @return int
5162552044 */
51626- public static function fromUnsigned(int $value): int {
52045+ public static function fromUnsafe(int $value): int {
5162752046 return $value; /*int*/
5162852047 }
5162952048
@@ -51631,11 +52050,11 @@ class Unsigned {
5163152050 * @throws Exception
5163252051 * @return int
5163352052 */
51634- public function toUnsigned(): int {
51635- if (Unsigned::validateUnsigned($this->unsigned)) {
51636- return $this->unsigned; /*int*/
52053+ public function toUnsafe(): int {
52054+ if (Unsafe::validateUnsafe($this->unsafe)) {
52055+ return $this->unsafe; /*int*/
5163752056 }
51638- throw new Exception('never get to this Unsigned::unsigned');
52057+ throw new Exception('never get to this Unsafe::unsafe');
5163952058 }
5164052059
5164152060 /**
@@ -51643,7 +52062,7 @@ class Unsigned {
5164352062 * @return bool
5164452063 * @throws Exception
5164552064 */
51646- public static function validateUnsigned(int $value): bool {
52065+ public static function validateUnsafe(int $value): bool {
5164752066 return true;
5164852067 }
5164952068
@@ -51651,18 +52070,18 @@ class Unsigned {
5165152070 * @throws Exception
5165252071 * @return int
5165352072 */
51654- public function getUnsigned(): int {
51655- if (Unsigned::validateUnsigned($this->unsigned)) {
51656- return $this->unsigned;
52073+ public function getUnsafe(): int {
52074+ if (Unsafe::validateUnsafe($this->unsafe)) {
52075+ return $this->unsafe;
5165752076 }
51658- throw new Exception('never get to getUnsigned Unsigned::unsigned');
52077+ throw new Exception('never get to getUnsafe Unsafe::unsafe');
5165952078 }
5166052079
5166152080 /**
5166252081 * @return int
5166352082 */
51664- public static function sampleUnsigned(): int {
51665- return 31; /*31:unsigned*/
52083+ public static function sampleUnsafe(): int {
52084+ return 31; /*31:unsafe*/
5166652085 }
5166752086
5166852087 /**
@@ -51670,7 +52089,7 @@ class Unsigned {
5167052089 * @return bool
5167152090 */
5167252091 public function validate(): bool {
51673- return Unsigned::validateUnsigned($this->unsigned);
52092+ return Unsafe::validateUnsafe($this->unsafe);
5167452093 }
5167552094
5167652095 /**
@@ -51679,30 +52098,30 @@ class Unsigned {
5167952098 */
5168052099 public function to(): stdClass {
5168152100 $out = new stdClass();
51682- $out->{'unsigned'} = $this->toUnsigned();
52101+ $out->{'unsafe'} = $this->toUnsafe();
5168352102 return $out;
5168452103 }
5168552104
5168652105 /**
5168752106 * @param stdClass $obj
51688- * @return Unsigned
52107+ * @return Unsafe
5168952108 * @throws Exception
5169052109 */
51691- public static function from(stdClass $obj): Unsigned {
51692- if (!property_exists($obj, 'unsigned')) {
52110+ public static function from(stdClass $obj): Unsafe {
52111+ if (!property_exists($obj, 'unsafe')) {
5169352112 throw new Exception("Missing required property");
5169452113 }
51695- return new Unsigned(
51696- Unsigned::fromUnsigned($obj->{'unsigned'})
52114+ return new Unsafe(
52115+ Unsafe::fromUnsafe($obj->{'unsafe'})
5169752116 );
5169852117 }
5169952118
5170052119 /**
51701- * @return Unsigned
52120+ * @return Unsafe
5170252121 */
51703- public static function sample(): Unsigned {
51704- return new Unsigned(
51705- Unsigned::sampleUnsigned()
52122+ public static function sample(): Unsafe {
52123+ return new Unsafe(
52124+ Unsafe::sampleUnsafe()
5170652125 );
5170752126 }
5170852127 }
@@ -51808,111 +52227,12 @@ class UseSerializers {
5180852227 }
5180952228 }
5181052229
51811-// This is an autogenerated file:Ushort
51812-
51813-class Ushort {
51814- private int $ushort; // json:ushort Required
51815-
51816- /**
51817- * @param int $ushort
51818- */
51819- public function __construct(int $ushort) {
51820- $this->ushort = $ushort;
51821- }
51822-
51823- /**
51824- * @param int $value
51825- * @throws Exception
51826- * @return int
51827- */
51828- public static function fromUshort(int $value): int {
51829- return $value; /*int*/
51830- }
51831-
51832- /**
51833- * @throws Exception
51834- * @return int
51835- */
51836- public function toUshort(): int {
51837- if (Ushort::validateUshort($this->ushort)) {
51838- return $this->ushort; /*int*/
51839- }
51840- throw new Exception('never get to this Ushort::ushort');
51841- }
51842-
51843- /**
51844- * @param int
51845- * @return bool
51846- * @throws Exception
51847- */
51848- public static function validateUshort(int $value): bool {
51849- return true;
51850- }
51851-
51852- /**
51853- * @throws Exception
51854- * @return int
51855- */
51856- public function getUshort(): int {
51857- if (Ushort::validateUshort($this->ushort)) {
51858- return $this->ushort;
51859- }
51860- throw new Exception('never get to getUshort Ushort::ushort');
51861- }
51862-
51863- /**
51864- * @return int
51865- */
51866- public static function sampleUshort(): int {
51867- return 31; /*31:ushort*/
51868- }
51869-
51870- /**
51871- * @throws Exception
51872- * @return bool
51873- */
51874- public function validate(): bool {
51875- return Ushort::validateUshort($this->ushort);
51876- }
51877-
51878- /**
51879- * @return stdClass
51880- * @throws Exception
51881- */
51882- public function to(): stdClass {
51883- $out = new stdClass();
51884- $out->{'ushort'} = $this->toUshort();
51885- return $out;
51886- }
51887-
51888- /**
51889- * @param stdClass $obj
51890- * @return Ushort
51891- * @throws Exception
51892- */
51893- public static function from(stdClass $obj): Ushort {
51894- if (!property_exists($obj, 'ushort')) {
51895- throw new Exception("Missing required property");
51896- }
51897- return new Ushort(
51898- Ushort::fromUshort($obj->{'ushort'})
51899- );
51900- }
51901-
51902- /**
51903- * @return Ushort
51904- */
51905- public static function sample(): Ushort {
51906- return new Ushort(
51907- Ushort::sampleUshort()
51908- );
51909- }
51910-}
51911-
5191252230 // This is an autogenerated file:Obj6
5191352231
5191452232 class Obj6 {
5191552233 private int $dummy; // json:dummy Required
52234+ private Unsigned $unsigned; // json:unsigned Required
52235+ private Ushort $ushort; // json:ushort Required
5191652236 private Using $using; // json:using Required
5191752237 private Utf8JSONReader $utf8JSONReader; // json:Utf8JsonReader Required
5191852238 private Utf8JSONWriter $utf8JSONWriter; // json:Utf8JsonWriter Required
@@ -51934,6 +52254,8 @@ class Obj6 {
5193452254
5193552255 /**
5193652256 * @param int $dummy
52257+ * @param Unsigned $unsigned
52258+ * @param Ushort $ushort
5193752259 * @param Using $using
5193852260 * @param Utf8JSONReader $utf8JSONReader
5193952261 * @param Utf8JSONWriter $utf8JSONWriter
@@ -51953,8 +52275,10 @@ class Obj6 {
5195352275 * @param Yes $yes
5195452276 * @param YieldClass $yield
5195552277 */
51956- public function __construct(int $dummy, Using $using, Utf8JSONReader $utf8JSONReader, Utf8JSONWriter $utf8JSONWriter, UUID $uuid, VarClass $var, Virtual $virtual, VoidClass $void, Volatile $volatile, WcharT $wcharT, Weak $weak, Where $where, WhileClass $while, WillSet $willSet, With $with, XorClass $xor, XorEq $xorEq, Yes $yes, YieldClass $yield) {
52278+ public function __construct(int $dummy, Unsigned $unsigned, Ushort $ushort, Using $using, Utf8JSONReader $utf8JSONReader, Utf8JSONWriter $utf8JSONWriter, UUID $uuid, VarClass $var, Virtual $virtual, VoidClass $void, Volatile $volatile, WcharT $wcharT, Weak $weak, Where $where, WhileClass $while, WillSet $willSet, With $with, XorClass $xor, XorEq $xorEq, Yes $yes, YieldClass $yield) {
5195752279 $this->dummy = $dummy;
52280+ $this->unsigned = $unsigned;
52281+ $this->ushort = $ushort;
5195852282 $this->using = $using;
5195952283 $this->utf8JSONReader = $utf8JSONReader;
5196052284 $this->utf8JSONWriter = $utf8JSONWriter;
@@ -52022,6 +52346,102 @@ class Obj6 {
5202252346 return 31; /*31:dummy*/
5202352347 }
5202452348
52349+ /**
52350+ * @param stdClass $value
52351+ * @throws Exception
52352+ * @return Unsigned
52353+ */
52354+ public static function fromUnsigned(stdClass $value): Unsigned {
52355+ return Unsigned::from($value); /*class*/
52356+ }
52357+
52358+ /**
52359+ * @throws Exception
52360+ * @return stdClass
52361+ */
52362+ public function toUnsigned(): stdClass {
52363+ if (Obj6::validateUnsigned($this->unsigned)) {
52364+ return $this->unsigned->to(); /*class*/
52365+ }
52366+ throw new Exception('never get to this Obj6::unsigned');
52367+ }
52368+
52369+ /**
52370+ * @param Unsigned
52371+ * @return bool
52372+ * @throws Exception
52373+ */
52374+ public static function validateUnsigned(Unsigned $value): bool {
52375+ $value->validate();
52376+ return true;
52377+ }
52378+
52379+ /**
52380+ * @throws Exception
52381+ * @return Unsigned
52382+ */
52383+ public function getUnsigned(): Unsigned {
52384+ if (Obj6::validateUnsigned($this->unsigned)) {
52385+ return $this->unsigned;
52386+ }
52387+ throw new Exception('never get to getUnsigned Obj6::unsigned');
52388+ }
52389+
52390+ /**
52391+ * @return Unsigned
52392+ */
52393+ public static function sampleUnsigned(): Unsigned {
52394+ return Unsigned::sample(); /*32:unsigned*/
52395+ }
52396+
52397+ /**
52398+ * @param stdClass $value
52399+ * @throws Exception
52400+ * @return Ushort
52401+ */
52402+ public static function fromUshort(stdClass $value): Ushort {
52403+ return Ushort::from($value); /*class*/
52404+ }
52405+
52406+ /**
52407+ * @throws Exception
52408+ * @return stdClass
52409+ */
52410+ public function toUshort(): stdClass {
52411+ if (Obj6::validateUshort($this->ushort)) {
52412+ return $this->ushort->to(); /*class*/
52413+ }
52414+ throw new Exception('never get to this Obj6::ushort');
52415+ }
52416+
52417+ /**
52418+ * @param Ushort
52419+ * @return bool
52420+ * @throws Exception
52421+ */
52422+ public static function validateUshort(Ushort $value): bool {
52423+ $value->validate();
52424+ return true;
52425+ }
52426+
52427+ /**
52428+ * @throws Exception
52429+ * @return Ushort
52430+ */
52431+ public function getUshort(): Ushort {
52432+ if (Obj6::validateUshort($this->ushort)) {
52433+ return $this->ushort;
52434+ }
52435+ throw new Exception('never get to getUshort Obj6::ushort');
52436+ }
52437+
52438+ /**
52439+ * @return Ushort
52440+ */
52441+ public static function sampleUshort(): Ushort {
52442+ return Ushort::sample(); /*33:ushort*/
52443+ }
52444+
5202552445 /**
5202652446 * @param stdClass $value
5202752447 * @throws Exception
@@ -52067,7 +52487,7 @@ class Obj6 {
5206752487 * @return Using
5206852488 */
5206952489 public static function sampleUsing(): Using {
52070- return Using::sample(); /*32:using*/
52490+ return Using::sample(); /*34:using*/
5207152491 }
5207252492
5207352493 /**
@@ -52115,7 +52535,7 @@ class Obj6 {
5211552535 * @return Utf8JSONReader
5211652536 */
5211752537 public static function sampleUtf8JSONReader(): Utf8JSONReader {
52118- return Utf8JSONReader::sample(); /*33:utf8JSONReader*/
52538+ return Utf8JSONReader::sample(); /*35:utf8JSONReader*/
5211952539 }
5212052540
5212152541 /**
@@ -52163,7 +52583,7 @@ class Obj6 {
5216352583 * @return Utf8JSONWriter
5216452584 */
5216552585 public static function sampleUtf8JSONWriter(): Utf8JSONWriter {
52166- return Utf8JSONWriter::sample(); /*34:utf8JSONWriter*/
52586+ return Utf8JSONWriter::sample(); /*36:utf8JSONWriter*/
5216752587 }
5216852588
5216952589 /**
@@ -52211,7 +52631,7 @@ class Obj6 {
5221152631 * @return UUID
5221252632 */
5221352633 public static function sampleUUID(): UUID {
52214- return UUID::sample(); /*35:uuid*/
52634+ return UUID::sample(); /*37:uuid*/
5221552635 }
5221652636
5221752637 /**
@@ -52259,7 +52679,7 @@ class Obj6 {
5225952679 * @return VarClass
5226052680 */
5226152681 public static function sampleVar(): VarClass {
52262- return VarClass::sample(); /*36:var*/
52682+ return VarClass::sample(); /*38:var*/
5226352683 }
5226452684
5226552685 /**
@@ -52307,7 +52727,7 @@ class Obj6 {
5230752727 * @return Virtual
5230852728 */
5230952729 public static function sampleVirtual(): Virtual {
52310- return Virtual::sample(); /*37:virtual*/
52730+ return Virtual::sample(); /*39:virtual*/
5231152731 }
5231252732
5231352733 /**
@@ -52355,7 +52775,7 @@ class Obj6 {
5235552775 * @return VoidClass
5235652776 */
5235752777 public static function sampleVoid(): VoidClass {
52358- return VoidClass::sample(); /*38:void*/
52778+ return VoidClass::sample(); /*40:void*/
5235952779 }
5236052780
5236152781 /**
@@ -52403,7 +52823,7 @@ class Obj6 {
5240352823 * @return Volatile
5240452824 */
5240552825 public static function sampleVolatile(): Volatile {
52406- return Volatile::sample(); /*39:volatile*/
52826+ return Volatile::sample(); /*41:volatile*/
5240752827 }
5240852828
5240952829 /**
@@ -52451,7 +52871,7 @@ class Obj6 {
5245152871 * @return WcharT
5245252872 */
5245352873 public static function sampleWcharT(): WcharT {
52454- return WcharT::sample(); /*40:wcharT*/
52874+ return WcharT::sample(); /*42:wcharT*/
5245552875 }
5245652876
5245752877 /**
@@ -52499,7 +52919,7 @@ class Obj6 {
5249952919 * @return Weak
5250052920 */
5250152921 public static function sampleWeak(): Weak {
52502- return Weak::sample(); /*41:weak*/
52922+ return Weak::sample(); /*43:weak*/
5250352923 }
5250452924
5250552925 /**
@@ -52547,7 +52967,7 @@ class Obj6 {
5254752967 * @return Where
5254852968 */
5254952969 public static function sampleWhere(): Where {
52550- return Where::sample(); /*42:where*/
52970+ return Where::sample(); /*44:where*/
5255152971 }
5255252972
5255352973 /**
@@ -52595,7 +53015,7 @@ class Obj6 {
5259553015 * @return WhileClass
5259653016 */
5259753017 public static function sampleWhile(): WhileClass {
52598- return WhileClass::sample(); /*43:while*/
53018+ return WhileClass::sample(); /*45:while*/
5259953019 }
5260053020
5260153021 /**
@@ -52643,7 +53063,7 @@ class Obj6 {
5264353063 * @return WillSet
5264453064 */
5264553065 public static function sampleWillSet(): WillSet {
52646- return WillSet::sample(); /*44:willSet*/
53066+ return WillSet::sample(); /*46:willSet*/
5264753067 }
5264853068
5264953069 /**
@@ -52691,7 +53111,7 @@ class Obj6 {
5269153111 * @return With
5269253112 */
5269353113 public static function sampleWith(): With {
52694- return With::sample(); /*45:with*/
53114+ return With::sample(); /*47:with*/
5269553115 }
5269653116
5269753117 /**
@@ -52739,7 +53159,7 @@ class Obj6 {
5273953159 * @return XorClass
5274053160 */
5274153161 public static function sampleXor(): XorClass {
52742- return XorClass::sample(); /*46:xor*/
53162+ return XorClass::sample(); /*48:xor*/
5274353163 }
5274453164
5274553165 /**
@@ -52787,7 +53207,7 @@ class Obj6 {
5278753207 * @return XorEq
5278853208 */
5278953209 public static function sampleXorEq(): XorEq {
52790- return XorEq::sample(); /*47:xorEq*/
53210+ return XorEq::sample(); /*49:xorEq*/
5279153211 }
5279253212
5279353213 /**
@@ -52835,7 +53255,7 @@ class Obj6 {
5283553255 * @return Yes
5283653256 */
5283753257 public static function sampleYes(): Yes {
52838- return Yes::sample(); /*48:yes*/
53258+ return Yes::sample(); /*50:yes*/
5283953259 }
5284053260
5284153261 /**
@@ -52883,7 +53303,7 @@ class Obj6 {
5288353303 * @return YieldClass
5288453304 */
5288553305 public static function sampleYield(): YieldClass {
52886- return YieldClass::sample(); /*49:yield*/
53306+ return YieldClass::sample(); /*51:yield*/
5288753307 }
5288853308
5288953309 /**
@@ -52892,6 +53312,8 @@ class Obj6 {
5289253312 */
5289353313 public function validate(): bool {
5289453314 return Obj6::validateDummy($this->dummy)
53315+ || Obj6::validateUnsigned($this->unsigned)
53316+ || Obj6::validateUshort($this->ushort)
5289553317 || Obj6::validateUsing($this->using)
5289653318 || Obj6::validateUtf8JSONReader($this->utf8JSONReader)
5289753319 || Obj6::validateUtf8JSONWriter($this->utf8JSONWriter)
@@ -52919,6 +53341,8 @@ class Obj6 {
5291953341 public function to(): stdClass {
5292053342 $out = new stdClass();
5292153343 $out->{'dummy'} = $this->toDummy();
53344+ $out->{'unsigned'} = $this->toUnsigned();
53345+ $out->{'ushort'} = $this->toUshort();
5292253346 $out->{'using'} = $this->toUsing();
5292353347 $out->{'Utf8JsonReader'} = $this->toUtf8JSONReader();
5292453348 $out->{'Utf8JsonWriter'} = $this->toUtf8JSONWriter();
@@ -52949,6 +53373,12 @@ class Obj6 {
5294953373 if (!property_exists($obj, 'dummy')) {
5295053374 throw new Exception("Missing required property");
5295153375 }
53376+ if (!property_exists($obj, 'unsigned')) {
53377+ throw new Exception("Missing required property");
53378+ }
53379+ if (!property_exists($obj, 'ushort')) {
53380+ throw new Exception("Missing required property");
53381+ }
5295253382 if (!property_exists($obj, 'using')) {
5295353383 throw new Exception("Missing required property");
5295453384 }
@@ -53005,6 +53435,8 @@ class Obj6 {
5300553435 }
5300653436 return new Obj6(
5300753437 Obj6::fromDummy($obj->{'dummy'})
53438+ ,Obj6::fromUnsigned($obj->{'unsigned'})
53439+ ,Obj6::fromUshort($obj->{'ushort'})
5300853440 ,Obj6::fromUsing($obj->{'using'})
5300953441 ,Obj6::fromUtf8JSONReader($obj->{'Utf8JsonReader'})
5301053442 ,Obj6::fromUtf8JSONWriter($obj->{'Utf8JsonWriter'})
@@ -53032,6 +53464,8 @@ class Obj6 {
5303253464 public static function sample(): Obj6 {
5303353465 return new Obj6(
5303453466 Obj6::sampleDummy()
53467+ ,Obj6::sampleUnsigned()
53468+ ,Obj6::sampleUshort()
5303553469 ,Obj6::sampleUsing()
5303653470 ,Obj6::sampleUtf8JSONReader()
5303753471 ,Obj6::sampleUtf8JSONWriter()
@@ -53054,6 +53488,208 @@ class Obj6 {
5305453488 }
5305553489 }
5305653490
53491+// This is an autogenerated file:Unsigned
53492+
53493+class Unsigned {
53494+ private int $unsigned; // json:unsigned Required
53495+
53496+ /**
53497+ * @param int $unsigned
53498+ */
53499+ public function __construct(int $unsigned) {
53500+ $this->unsigned = $unsigned;
53501+ }
53502+
53503+ /**
53504+ * @param int $value
53505+ * @throws Exception
53506+ * @return int
53507+ */
53508+ public static function fromUnsigned(int $value): int {
53509+ return $value; /*int*/
53510+ }
53511+
53512+ /**
53513+ * @throws Exception
53514+ * @return int
53515+ */
53516+ public function toUnsigned(): int {
53517+ if (Unsigned::validateUnsigned($this->unsigned)) {
53518+ return $this->unsigned; /*int*/
53519+ }
53520+ throw new Exception('never get to this Unsigned::unsigned');
53521+ }
53522+
53523+ /**
53524+ * @param int
53525+ * @return bool
53526+ * @throws Exception
53527+ */
53528+ public static function validateUnsigned(int $value): bool {
53529+ return true;
53530+ }
53531+
53532+ /**
53533+ * @throws Exception
53534+ * @return int
53535+ */
53536+ public function getUnsigned(): int {
53537+ if (Unsigned::validateUnsigned($this->unsigned)) {
53538+ return $this->unsigned;
53539+ }
53540+ throw new Exception('never get to getUnsigned Unsigned::unsigned');
53541+ }
53542+
53543+ /**
53544+ * @return int
53545+ */
53546+ public static function sampleUnsigned(): int {
53547+ return 31; /*31:unsigned*/
53548+ }
53549+
53550+ /**
53551+ * @throws Exception
53552+ * @return bool
53553+ */
53554+ public function validate(): bool {
53555+ return Unsigned::validateUnsigned($this->unsigned);
53556+ }
53557+
53558+ /**
53559+ * @return stdClass
53560+ * @throws Exception
53561+ */
53562+ public function to(): stdClass {
53563+ $out = new stdClass();
53564+ $out->{'unsigned'} = $this->toUnsigned();
53565+ return $out;
53566+ }
53567+
53568+ /**
53569+ * @param stdClass $obj
53570+ * @return Unsigned
53571+ * @throws Exception
53572+ */
53573+ public static function from(stdClass $obj): Unsigned {
53574+ if (!property_exists($obj, 'unsigned')) {
53575+ throw new Exception("Missing required property");
53576+ }
53577+ return new Unsigned(
53578+ Unsigned::fromUnsigned($obj->{'unsigned'})
53579+ );
53580+ }
53581+
53582+ /**
53583+ * @return Unsigned
53584+ */
53585+ public static function sample(): Unsigned {
53586+ return new Unsigned(
53587+ Unsigned::sampleUnsigned()
53588+ );
53589+ }
53590+}
53591+
53592+// This is an autogenerated file:Ushort
53593+
53594+class Ushort {
53595+ private int $ushort; // json:ushort Required
53596+
53597+ /**
53598+ * @param int $ushort
53599+ */
53600+ public function __construct(int $ushort) {
53601+ $this->ushort = $ushort;
53602+ }
53603+
53604+ /**
53605+ * @param int $value
53606+ * @throws Exception
53607+ * @return int
53608+ */
53609+ public static function fromUshort(int $value): int {
53610+ return $value; /*int*/
53611+ }
53612+
53613+ /**
53614+ * @throws Exception
53615+ * @return int
53616+ */
53617+ public function toUshort(): int {
53618+ if (Ushort::validateUshort($this->ushort)) {
53619+ return $this->ushort; /*int*/
53620+ }
53621+ throw new Exception('never get to this Ushort::ushort');
53622+ }
53623+
53624+ /**
53625+ * @param int
53626+ * @return bool
53627+ * @throws Exception
53628+ */
53629+ public static function validateUshort(int $value): bool {
53630+ return true;
53631+ }
53632+
53633+ /**
53634+ * @throws Exception
53635+ * @return int
53636+ */
53637+ public function getUshort(): int {
53638+ if (Ushort::validateUshort($this->ushort)) {
53639+ return $this->ushort;
53640+ }
53641+ throw new Exception('never get to getUshort Ushort::ushort');
53642+ }
53643+
53644+ /**
53645+ * @return int
53646+ */
53647+ public static function sampleUshort(): int {
53648+ return 31; /*31:ushort*/
53649+ }
53650+
53651+ /**
53652+ * @throws Exception
53653+ * @return bool
53654+ */
53655+ public function validate(): bool {
53656+ return Ushort::validateUshort($this->ushort);
53657+ }
53658+
53659+ /**
53660+ * @return stdClass
53661+ * @throws Exception
53662+ */
53663+ public function to(): stdClass {
53664+ $out = new stdClass();
53665+ $out->{'ushort'} = $this->toUshort();
53666+ return $out;
53667+ }
53668+
53669+ /**
53670+ * @param stdClass $obj
53671+ * @return Ushort
53672+ * @throws Exception
53673+ */
53674+ public static function from(stdClass $obj): Ushort {
53675+ if (!property_exists($obj, 'ushort')) {
53676+ throw new Exception("Missing required property");
53677+ }
53678+ return new Ushort(
53679+ Ushort::fromUshort($obj->{'ushort'})
53680+ );
53681+ }
53682+
53683+ /**
53684+ * @return Ushort
53685+ */
53686+ public static function sample(): Ushort {
53687+ return new Ushort(
53688+ Ushort::sampleUshort()
53689+ );
53690+ }
53691+}
53692+
5305753693 // This is an autogenerated file:Using
5305853694
5305953695 class Using {
Mpikedefault / TopLevel.pmod+225 −125
@@ -1727,11 +1727,11 @@ class Obj2 {
17271727 FormatException format_exception; // json: "FormatException"
17281728 Friend friend; // json: "friend"
17291729 From from; // json: "from"
1730+ FromDict from_dict; // json: "from_dict"
17301731 FromJson from_json; // json: "from_json"
17311732 Func func; // json: "func"
17321733 Get get; // json: "get"
17331734 Go go; // json: "go"
1734- Goto goto; // json: "goto"
17351735 Default obj2_default; // json: "default"
17361736 Do obj2_do; // json: "do"
17371737 Else obj2_else; // json: "else"
@@ -1795,11 +1795,11 @@ class Obj2 {
17951795 "FormatException" : format_exception,
17961796 "friend" : friend,
17971797 "from" : from,
1798+ "from_dict" : from_dict,
17981799 "from_json" : from_json,
17991800 "func" : func,
18001801 "get" : get,
18011802 "go" : go,
1802- "goto" : goto,
18031803 "default" : obj2_default,
18041804 "do" : obj2_do,
18051805 "else" : obj2_else,
@@ -1917,6 +1917,8 @@ Obj2 Obj2_from_JSON(mixed json) {
19171917 retval.friend = json["friend"];
19181918 if (!mappingp(json["from"])) error("Expected object");
19191919 retval.from = json["from"];
1920+ if (!mappingp(json["from_dict"])) error("Expected object");
1921+ retval.from_dict = json["from_dict"];
19201922 if (!mappingp(json["from_json"])) error("Expected object");
19211923 retval.from_json = json["from_json"];
19221924 if (!mappingp(json["func"])) error("Expected object");
@@ -1925,8 +1927,6 @@ Obj2 Obj2_from_JSON(mixed json) {
19251927 retval.get = json["get"];
19261928 if (!mappingp(json["go"])) error("Expected object");
19271929 retval.go = json["go"];
1928- if (!mappingp(json["goto"])) error("Expected object");
1929- retval.goto = json["goto"];
19301930 if (!mappingp(json["default"])) error("Expected object");
19311931 retval.obj2_default = json["default"];
19321932 if (!mappingp(json["do"])) error("Expected object");
@@ -2949,6 +2949,27 @@ From From_from_JSON(mixed json) {
29492949 return retval;
29502950 }
29512951
2952+class FromDict {
2953+ int from_dict; // json: "from_dict"
2954+
2955+ string encode_json() {
2956+ mapping(string:mixed) json = ([
2957+ "from_dict" : from_dict,
2958+ ]);
2959+
2960+ return Standards.JSON.encode(json);
2961+ }
2962+}
2963+
2964+FromDict FromDict_from_JSON(mixed json) {
2965+ FromDict retval = FromDict();
2966+
2967+ if (!intp(json["from_dict"])) error("Expected integer");
2968+ retval.from_dict = json["from_dict"];
2969+
2970+ return retval;
2971+}
2972+
29522973 class FromJson {
29532974 int from_json; // json: "from_json"
29542975
@@ -3033,27 +3054,6 @@ Go Go_from_JSON(mixed json) {
30333054 return retval;
30343055 }
30353056
3036-class Goto {
3037- int goto; // json: "goto"
3038-
3039- string encode_json() {
3040- mapping(string:mixed) json = ([
3041- "goto" : goto,
3042- ]);
3043-
3044- return Standards.JSON.encode(json);
3045- }
3046-}
3047-
3048-Goto Goto_from_JSON(mixed json) {
3049- Goto retval = Goto();
3050-
3051- if (!intp(json["goto"])) error("Expected integer");
3052- retval.goto = json["goto"];
3053-
3054- return retval;
3055-}
3056-
30573057 class Default {
30583058 int default_default; // json: "default"
30593059
@@ -3308,6 +3308,7 @@ Global Global_from_JSON(mixed json) {
33083308
33093309 class Obj3 {
33103310 int dummy; // json: "dummy"
3311+ Goto goto; // json: "goto"
33113312 Guard guard; // json: "guard"
33123313 HasOwnProperty has_own_property; // json: "hasOwnProperty"
33133314 HashCode hash_code; // json: "hashCode"
@@ -3356,6 +3357,7 @@ class Obj3 {
33563357 Long long; // json: "long"
33573358 Map map; // json: "map"
33583359 MapEntry map_entry; // json: "MapEntry"
3360+ MarshalJson marshal_json; // json: "MarshalJSON"
33593361 MetadataPropertyHandling metadata_property_handling; // json: "metadata_property_handling"
33603362 Module module; // json: "module"
33613363 Mutable mutable; // json: "mutable"
@@ -3366,7 +3368,6 @@ class Obj3 {
33663368 Newtonsoft newtonsoft; // json: "newtonsoft"
33673369 Nil nil; // json: "nil"
33683370 No no; // json: "NO"
3369- Noexcept noexcept; // json: "noexcept"
33703371 If obj3_if; // json: "if"
33713372 Import obj3_import; // json: "import"
33723373 Inline obj3_inline; // json: "inline"
@@ -3376,6 +3377,7 @@ class Obj3 {
33763377 string encode_json() {
33773378 mapping(string:mixed) json = ([
33783379 "dummy" : dummy,
3380+ "goto" : goto,
33793381 "guard" : guard,
33803382 "hasOwnProperty" : has_own_property,
33813383 "hashCode" : hash_code,
@@ -3424,6 +3426,7 @@ class Obj3 {
34243426 "long" : long,
34253427 "map" : map,
34263428 "MapEntry" : map_entry,
3429+ "MarshalJSON" : marshal_json,
34273430 "metadata_property_handling" : metadata_property_handling,
34283431 "module" : module,
34293432 "mutable" : mutable,
@@ -3434,7 +3437,6 @@ class Obj3 {
34343437 "newtonsoft" : newtonsoft,
34353438 "nil" : nil,
34363439 "NO" : no,
3437- "noexcept" : noexcept,
34383440 "if" : obj3_if,
34393441 "import" : obj3_import,
34403442 "inline" : obj3_inline,
@@ -3451,6 +3453,8 @@ Obj3 Obj3_from_JSON(mixed json) {
34513453
34523454 if (!intp(json["dummy"])) error("Expected integer");
34533455 retval.dummy = json["dummy"];
3456+ if (!mappingp(json["goto"])) error("Expected object");
3457+ retval.goto = json["goto"];
34543458 if (!mappingp(json["guard"])) error("Expected object");
34553459 retval.guard = json["guard"];
34563460 if (!mappingp(json["hasOwnProperty"])) error("Expected object");
@@ -3547,6 +3551,8 @@ Obj3 Obj3_from_JSON(mixed json) {
35473551 retval.map = json["map"];
35483552 if (!mappingp(json["MapEntry"])) error("Expected object");
35493553 retval.map_entry = json["MapEntry"];
3554+ if (!mappingp(json["MarshalJSON"])) error("Expected object");
3555+ retval.marshal_json = json["MarshalJSON"];
35503556 if (!mappingp(json["metadata_property_handling"])) error("Expected object");
35513557 retval.metadata_property_handling = json["metadata_property_handling"];
35523558 if (!mappingp(json["module"])) error("Expected object");
@@ -3567,8 +3573,6 @@ Obj3 Obj3_from_JSON(mixed json) {
35673573 retval.nil = json["nil"];
35683574 if (!mappingp(json["NO"])) error("Expected object");
35693575 retval.no = json["NO"];
3570- if (!mappingp(json["noexcept"])) error("Expected object");
3571- retval.noexcept = json["noexcept"];
35723576 if (!mappingp(json["if"])) error("Expected object");
35733577 retval.obj3_if = json["if"];
35743578 if (!mappingp(json["import"])) error("Expected object");
@@ -3583,6 +3587,27 @@ Obj3 Obj3_from_JSON(mixed json) {
35833587 return retval;
35843588 }
35853589
3590+class Goto {
3591+ int goto; // json: "goto"
3592+
3593+ string encode_json() {
3594+ mapping(string:mixed) json = ([
3595+ "goto" : goto,
3596+ ]);
3597+
3598+ return Standards.JSON.encode(json);
3599+ }
3600+}
3601+
3602+Goto Goto_from_JSON(mixed json) {
3603+ Goto retval = Goto();
3604+
3605+ if (!intp(json["goto"])) error("Expected integer");
3606+ retval.goto = json["goto"];
3607+
3608+ return retval;
3609+}
3610+
35863611 class Guard {
35873612 int guard; // json: "guard"
35883613
@@ -4590,6 +4615,27 @@ MapEntry MapEntry_from_JSON(mixed json) {
45904615 return retval;
45914616 }
45924617
4618+class MarshalJson {
4619+ int marshal_json; // json: "MarshalJSON"
4620+
4621+ string encode_json() {
4622+ mapping(string:mixed) json = ([
4623+ "MarshalJSON" : marshal_json,
4624+ ]);
4625+
4626+ return Standards.JSON.encode(json);
4627+ }
4628+}
4629+
4630+MarshalJson MarshalJson_from_JSON(mixed json) {
4631+ MarshalJson retval = MarshalJson();
4632+
4633+ if (!intp(json["MarshalJSON"])) error("Expected integer");
4634+ retval.marshal_json = json["MarshalJSON"];
4635+
4636+ return retval;
4637+}
4638+
45934639 class MetadataPropertyHandling {
45944640 int metadata_property_handling; // json: "metadata_property_handling"
45954641
@@ -4800,27 +4846,6 @@ No No_from_JSON(mixed json) {
48004846 return retval;
48014847 }
48024848
4803-class Noexcept {
4804- int noexcept; // json: "noexcept"
4805-
4806- string encode_json() {
4807- mapping(string:mixed) json = ([
4808- "noexcept" : noexcept,
4809- ]);
4810-
4811- return Standards.JSON.encode(json);
4812- }
4813-}
4814-
4815-Noexcept Noexcept_from_JSON(mixed json) {
4816- Noexcept retval = Noexcept();
4817-
4818- if (!intp(json["noexcept"])) error("Expected integer");
4819- retval.noexcept = json["noexcept"];
4820-
4821- return retval;
4822-}
4823-
48244849 class If {
48254850 int if_if; // json: "if"
48264851
@@ -4929,6 +4954,7 @@ Lambda Lambda_from_JSON(mixed json) {
49294954 class Obj4 {
49304955 int dummy; // json: "dummy"
49314956 NoSuchMethod no_such_method; // json: "noSuchMethod"
4957+ Noexcept noexcept; // json: "noexcept"
49324958 Nonatomic nonatomic; // json: "nonatomic"
49334959 None none; // json: "None"
49344960 Nonlocal nonlocal; // json: "nonlocal"
@@ -4991,12 +5017,12 @@ class Obj4 {
49915017 Sbyte sbyte; // json: "sbyte"
49925018 Sealed sealed; // json: "sealed"
49935019 Sel sel; // json: "SEL"
4994- Select select; // json: "select"
49955020
49965021 string encode_json() {
49975022 mapping(string:mixed) json = ([
49985023 "dummy" : dummy,
49995024 "noSuchMethod" : no_such_method,
5025+ "noexcept" : noexcept,
50005026 "nonatomic" : nonatomic,
50015027 "None" : none,
50025028 "nonlocal" : nonlocal,
@@ -5059,7 +5085,6 @@ class Obj4 {
50595085 "sbyte" : sbyte,
50605086 "sealed" : sealed,
50615087 "SEL" : sel,
5062- "select" : select,
50635088 ]);
50645089
50655090 return Standards.JSON.encode(json);
@@ -5073,6 +5098,8 @@ Obj4 Obj4_from_JSON(mixed json) {
50735098 retval.dummy = json["dummy"];
50745099 if (!mappingp(json["noSuchMethod"])) error("Expected object");
50755100 retval.no_such_method = json["noSuchMethod"];
5101+ if (!mappingp(json["noexcept"])) error("Expected object");
5102+ retval.noexcept = json["noexcept"];
50765103 if (!mappingp(json["nonatomic"])) error("Expected object");
50775104 retval.nonatomic = json["nonatomic"];
50785105 if (!mappingp(json["None"])) error("Expected object");
@@ -5197,8 +5224,6 @@ Obj4 Obj4_from_JSON(mixed json) {
51975224 retval.sealed = json["sealed"];
51985225 if (!mappingp(json["SEL"])) error("Expected object");
51995226 retval.sel = json["SEL"];
5200- if (!mappingp(json["select"])) error("Expected object");
5201- retval.select = json["select"];
52025227
52035228 return retval;
52045229 }
@@ -5224,6 +5249,27 @@ NoSuchMethod NoSuchMethod_from_JSON(mixed json) {
52245249 return retval;
52255250 }
52265251
5252+class Noexcept {
5253+ int noexcept; // json: "noexcept"
5254+
5255+ string encode_json() {
5256+ mapping(string:mixed) json = ([
5257+ "noexcept" : noexcept,
5258+ ]);
5259+
5260+ return Standards.JSON.encode(json);
5261+ }
5262+}
5263+
5264+Noexcept Noexcept_from_JSON(mixed json) {
5265+ Noexcept retval = Noexcept();
5266+
5267+ if (!intp(json["noexcept"])) error("Expected integer");
5268+ retval.noexcept = json["noexcept"];
5269+
5270+ return retval;
5271+}
5272+
52275273 class Nonatomic {
52285274 int nonatomic; // json: "nonatomic"
52295275
@@ -6525,27 +6571,6 @@ Sel Sel_from_JSON(mixed json) {
65256571 return retval;
65266572 }
65276573
6528-class Select {
6529- int select; // json: "select"
6530-
6531- string encode_json() {
6532- mapping(string:mixed) json = ([
6533- "select" : select,
6534- ]);
6535-
6536- return Standards.JSON.encode(json);
6537- }
6538-}
6539-
6540-Select Select_from_JSON(mixed json) {
6541- Select retval = Select();
6542-
6543- if (!intp(json["select"])) error("Expected integer");
6544- retval.select = json["select"];
6545-
6546- return retval;
6547-}
6548-
65496574 class Obj5 {
65506575 int dummy; // json: "dummy"
65516576 KSerializer k_serializer; // json: "KSerializer"
@@ -6558,6 +6583,7 @@ class Obj5 {
65586583 Typedef obj5_typedef; // json: "typedef"
65596584 Typeof obj5_typeof; // json: "typeof"
65606585 PrimitiveKind primitive_kind; // json: "PrimitiveKind"
6586+ Select select; // json: "select"
65616587 Self self; // json: "Self"
65626588 Sendable sendable; // json: "Sendable"
65636589 SerialDescriptor serial_descriptor; // json: "SerialDescriptor"
@@ -6592,6 +6618,7 @@ class Obj5 {
65926618 TimeOnly time_only; // json: "TimeOnly"
65936619 TimeOnlyConverter time_only_converter; // json: "TimeOnlyConverter"
65946620 TimeZone time_zone; // json: "TimeZone"
6621+ ToDict to_dict; // json: "to_dict"
65956622 ToJson to_json; // json: "to_json"
65966623 ToString to_string; // json: "toString"
65976624 TopLevelClass top_level; // json: "top_level"
@@ -6607,11 +6634,10 @@ class Obj5 {
66076634 Unchecked unchecked; // json: "unchecked"
66086635 Undefined undefined; // json: "undefined"
66096636 Union union; // json: "union"
6637+ UnmarshalJson unmarshal_json; // json: "UnmarshalJSON"
66106638 Unowned unowned; // json: "unowned"
66116639 Unsafe unsafe; // json: "unsafe"
6612- Unsigned unsigned; // json: "unsigned"
66136640 UseSerializers use_serializers; // json: "UseSerializers"
6614- Ushort ushort; // json: "ushort"
66156641
66166642 string encode_json() {
66176643 mapping(string:mixed) json = ([
@@ -6626,6 +6652,7 @@ class Obj5 {
66266652 "typedef" : obj5_typedef,
66276653 "typeof" : obj5_typeof,
66286654 "PrimitiveKind" : primitive_kind,
6655+ "select" : select,
66296656 "Self" : self,
66306657 "Sendable" : sendable,
66316658 "SerialDescriptor" : serial_descriptor,
@@ -6660,6 +6687,7 @@ class Obj5 {
66606687 "TimeOnly" : time_only,
66616688 "TimeOnlyConverter" : time_only_converter,
66626689 "TimeZone" : time_zone,
6690+ "to_dict" : to_dict,
66636691 "to_json" : to_json,
66646692 "toString" : to_string,
66656693 "top_level" : top_level,
@@ -6675,11 +6703,10 @@ class Obj5 {
66756703 "unchecked" : unchecked,
66766704 "undefined" : undefined,
66776705 "union" : union,
6706+ "UnmarshalJSON" : unmarshal_json,
66786707 "unowned" : unowned,
66796708 "unsafe" : unsafe,
6680- "unsigned" : unsigned,
66816709 "UseSerializers" : use_serializers,
6682- "ushort" : ushort,
66836710 ]);
66846711
66856712 return Standards.JSON.encode(json);
@@ -6711,6 +6738,8 @@ Obj5 Obj5_from_JSON(mixed json) {
67116738 retval.obj5_typeof = json["typeof"];
67126739 if (!mappingp(json["PrimitiveKind"])) error("Expected object");
67136740 retval.primitive_kind = json["PrimitiveKind"];
6741+ if (!mappingp(json["select"])) error("Expected object");
6742+ retval.select = json["select"];
67146743 if (!mappingp(json["Self"])) error("Expected object");
67156744 retval.self = json["Self"];
67166745 if (!mappingp(json["Sendable"])) error("Expected object");
@@ -6779,6 +6808,8 @@ Obj5 Obj5_from_JSON(mixed json) {
67796808 retval.time_only_converter = json["TimeOnlyConverter"];
67806809 if (!mappingp(json["TimeZone"])) error("Expected object");
67816810 retval.time_zone = json["TimeZone"];
6811+ if (!mappingp(json["to_dict"])) error("Expected object");
6812+ retval.to_dict = json["to_dict"];
67826813 if (!mappingp(json["to_json"])) error("Expected object");
67836814 retval.to_json = json["to_json"];
67846815 if (!mappingp(json["toString"])) error("Expected object");
@@ -6809,16 +6840,14 @@ Obj5 Obj5_from_JSON(mixed json) {
68096840 retval.undefined = json["undefined"];
68106841 if (!mappingp(json["union"])) error("Expected object");
68116842 retval.union = json["union"];
6843+ if (!mappingp(json["UnmarshalJSON"])) error("Expected object");
6844+ retval.unmarshal_json = json["UnmarshalJSON"];
68126845 if (!mappingp(json["unowned"])) error("Expected object");
68136846 retval.unowned = json["unowned"];
68146847 if (!mappingp(json["unsafe"])) error("Expected object");
68156848 retval.unsafe = json["unsafe"];
6816- if (!mappingp(json["unsigned"])) error("Expected object");
6817- retval.unsigned = json["unsigned"];
68186849 if (!mappingp(json["UseSerializers"])) error("Expected object");
68196850 retval.use_serializers = json["UseSerializers"];
6820- if (!mappingp(json["ushort"])) error("Expected object");
6821- retval.ushort = json["ushort"];
68226851
68236852 return retval;
68246853 }
@@ -7033,6 +7062,27 @@ PrimitiveKind PrimitiveKind_from_JSON(mixed json) {
70337062 return retval;
70347063 }
70357064
7065+class Select {
7066+ int select; // json: "select"
7067+
7068+ string encode_json() {
7069+ mapping(string:mixed) json = ([
7070+ "select" : select,
7071+ ]);
7072+
7073+ return Standards.JSON.encode(json);
7074+ }
7075+}
7076+
7077+Select Select_from_JSON(mixed json) {
7078+ Select retval = Select();
7079+
7080+ if (!intp(json["select"])) error("Expected integer");
7081+ retval.select = json["select"];
7082+
7083+ return retval;
7084+}
7085+
70367086 class Self {
70377087 int self; // json: "Self"
70387088
@@ -7747,6 +7797,27 @@ TimeZone TimeZone_from_JSON(mixed json) {
77477797 return retval;
77487798 }
77497799
7800+class ToDict {
7801+ int to_dict; // json: "to_dict"
7802+
7803+ string encode_json() {
7804+ mapping(string:mixed) json = ([
7805+ "to_dict" : to_dict,
7806+ ]);
7807+
7808+ return Standards.JSON.encode(json);
7809+ }
7810+}
7811+
7812+ToDict ToDict_from_JSON(mixed json) {
7813+ ToDict retval = ToDict();
7814+
7815+ if (!intp(json["to_dict"])) error("Expected integer");
7816+ retval.to_dict = json["to_dict"];
7817+
7818+ return retval;
7819+}
7820+
77507821 class ToJson {
77517822 int to_json; // json: "to_json"
77527823
@@ -8062,65 +8133,65 @@ Union Union_from_JSON(mixed json) {
80628133 return retval;
80638134 }
80648135
8065-class Unowned {
8066- int unowned; // json: "unowned"
8136+class UnmarshalJson {
8137+ int unmarshal_json; // json: "UnmarshalJSON"
80678138
80688139 string encode_json() {
80698140 mapping(string:mixed) json = ([
8070- "unowned" : unowned,
8141+ "UnmarshalJSON" : unmarshal_json,
80718142 ]);
80728143
80738144 return Standards.JSON.encode(json);
80748145 }
80758146 }
80768147
8077-Unowned Unowned_from_JSON(mixed json) {
8078- Unowned retval = Unowned();
8148+UnmarshalJson UnmarshalJson_from_JSON(mixed json) {
8149+ UnmarshalJson retval = UnmarshalJson();
80798150
8080- if (!intp(json["unowned"])) error("Expected integer");
8081- retval.unowned = json["unowned"];
8151+ if (!intp(json["UnmarshalJSON"])) error("Expected integer");
8152+ retval.unmarshal_json = json["UnmarshalJSON"];
80828153
80838154 return retval;
80848155 }
80858156
8086-class Unsafe {
8087- int unsafe; // json: "unsafe"
8157+class Unowned {
8158+ int unowned; // json: "unowned"
80888159
80898160 string encode_json() {
80908161 mapping(string:mixed) json = ([
8091- "unsafe" : unsafe,
8162+ "unowned" : unowned,
80928163 ]);
80938164
80948165 return Standards.JSON.encode(json);
80958166 }
80968167 }
80978168
8098-Unsafe Unsafe_from_JSON(mixed json) {
8099- Unsafe retval = Unsafe();
8169+Unowned Unowned_from_JSON(mixed json) {
8170+ Unowned retval = Unowned();
81008171
8101- if (!intp(json["unsafe"])) error("Expected integer");
8102- retval.unsafe = json["unsafe"];
8172+ if (!intp(json["unowned"])) error("Expected integer");
8173+ retval.unowned = json["unowned"];
81038174
81048175 return retval;
81058176 }
81068177
8107-class Unsigned {
8108- int unsigned; // json: "unsigned"
8178+class Unsafe {
8179+ int unsafe; // json: "unsafe"
81098180
81108181 string encode_json() {
81118182 mapping(string:mixed) json = ([
8112- "unsigned" : unsigned,
8183+ "unsafe" : unsafe,
81138184 ]);
81148185
81158186 return Standards.JSON.encode(json);
81168187 }
81178188 }
81188189
8119-Unsigned Unsigned_from_JSON(mixed json) {
8120- Unsigned retval = Unsigned();
8190+Unsafe Unsafe_from_JSON(mixed json) {
8191+ Unsafe retval = Unsafe();
81218192
8122- if (!intp(json["unsigned"])) error("Expected integer");
8123- retval.unsigned = json["unsigned"];
8193+ if (!intp(json["unsafe"])) error("Expected integer");
8194+ retval.unsafe = json["unsafe"];
81248195
81258196 return retval;
81268197 }
@@ -8146,31 +8217,12 @@ UseSerializers UseSerializers_from_JSON(mixed json) {
81468217 return retval;
81478218 }
81488219
8149-class Ushort {
8150- int ushort; // json: "ushort"
8151-
8152- string encode_json() {
8153- mapping(string:mixed) json = ([
8154- "ushort" : ushort,
8155- ]);
8156-
8157- return Standards.JSON.encode(json);
8158- }
8159-}
8160-
8161-Ushort Ushort_from_JSON(mixed json) {
8162- Ushort retval = Ushort();
8163-
8164- if (!intp(json["ushort"])) error("Expected integer");
8165- retval.ushort = json["ushort"];
8166-
8167- return retval;
8168-}
8169-
81708220 class Obj6 {
81718221 int dummy; // json: "dummy"
81728222 Void obj6_void; // json: "void"
81738223 While obj6_while; // json: "while"
8224+ Unsigned unsigned; // json: "unsigned"
8225+ Ushort ushort; // json: "ushort"
81748226 Using using; // json: "using"
81758227 Utf8JsonReader utf8_json_reader; // json: "Utf8JsonReader"
81768228 Utf8JsonWriter utf8_json_writer; // json: "Utf8JsonWriter"
@@ -8193,6 +8245,8 @@ class Obj6 {
81938245 "dummy" : dummy,
81948246 "void" : obj6_void,
81958247 "while" : obj6_while,
8248+ "unsigned" : unsigned,
8249+ "ushort" : ushort,
81968250 "using" : using,
81978251 "Utf8JsonReader" : utf8_json_reader,
81988252 "Utf8JsonWriter" : utf8_json_writer,
@@ -8224,6 +8278,10 @@ Obj6 Obj6_from_JSON(mixed json) {
82248278 retval.obj6_void = json["void"];
82258279 if (!mappingp(json["while"])) error("Expected object");
82268280 retval.obj6_while = json["while"];
8281+ if (!mappingp(json["unsigned"])) error("Expected object");
8282+ retval.unsigned = json["unsigned"];
8283+ if (!mappingp(json["ushort"])) error("Expected object");
8284+ retval.ushort = json["ushort"];
82278285 if (!mappingp(json["using"])) error("Expected object");
82288286 retval.using = json["using"];
82298287 if (!mappingp(json["Utf8JsonReader"])) error("Expected object");
@@ -8302,6 +8360,48 @@ While While_from_JSON(mixed json) {
83028360 return retval;
83038361 }
83048362
8363+class Unsigned {
8364+ int unsigned; // json: "unsigned"
8365+
8366+ string encode_json() {
8367+ mapping(string:mixed) json = ([
8368+ "unsigned" : unsigned,
8369+ ]);
8370+
8371+ return Standards.JSON.encode(json);
8372+ }
8373+}
8374+
8375+Unsigned Unsigned_from_JSON(mixed json) {
8376+ Unsigned retval = Unsigned();
8377+
8378+ if (!intp(json["unsigned"])) error("Expected integer");
8379+ retval.unsigned = json["unsigned"];
8380+
8381+ return retval;
8382+}
8383+
8384+class Ushort {
8385+ int ushort; // json: "ushort"
8386+
8387+ string encode_json() {
8388+ mapping(string:mixed) json = ([
8389+ "ushort" : ushort,
8390+ ]);
8391+
8392+ return Standards.JSON.encode(json);
8393+ }
8394+}
8395+
8396+Ushort Ushort_from_JSON(mixed json) {
8397+ Ushort retval = Ushort();
8398+
8399+ if (!intp(json["ushort"])) error("Expected integer");
8400+ retval.ushort = json["ushort"];
8401+
8402+ return retval;
8403+}
8404+
83058405 class Using {
83068406 int using; // json: "using"
Mpythondefault / quicktype.py+176 −100
@@ -2092,22 +2092,6 @@ class Go:
20922092 return result
20932093
20942094
2095-@dataclass
2096-class Goto:
2097- goto: int
2098-
2099- @staticmethod
2100- def from_dict(obj: Any) -> 'Goto':
2101- assert isinstance(obj, dict)
2102- goto = from_int(obj["goto"])
2103- return Goto(goto)
2104-
2105- def to_dict(self) -> dict:
2106- result: dict = {}
2107- result["goto"] = from_int(self.goto)
2108- return result
2109-
2110-
21112095 @dataclass
21122096 class Def:
21132097 def_def: int
@@ -2284,6 +2268,22 @@ class From:
22842268 return result
22852269
22862270
2271+@dataclass
2272+class FromDict:
2273+ from_dict_from_dict: int
2274+
2275+ @staticmethod
2276+ def from_dict(obj: Any) -> 'FromDict':
2277+ assert isinstance(obj, dict)
2278+ from_dict_from_dict = from_int(obj["from_dict"])
2279+ return FromDict(from_dict_from_dict)
2280+
2281+ def to_dict(self) -> dict:
2282+ result: dict = {}
2283+ result["from_dict"] = from_int(self.from_dict_from_dict)
2284+ return result
2285+
2286+
22872287 @dataclass
22882288 class Global:
22892289 global_global: int
@@ -2360,13 +2360,13 @@ class Obj2:
23602360 foreach: Foreach
23612361 friend: Friend
23622362 obj2_from: From
2363+ obj2_from_dict: FromDict
23632364 from_json: FromJSON
23642365 func: Func
23652366 function: Function
23662367 get: Get
23672368 obj2_global: Global
23682369 go: Go
2369- goto: Goto
23702370
23712371 @staticmethod
23722372 def from_dict(obj: Any) -> 'Obj2':
@@ -2429,14 +2429,14 @@ class Obj2:
24292429 foreach = Foreach.from_dict(obj["foreach"])
24302430 friend = Friend.from_dict(obj["friend"])
24312431 obj2_from = From.from_dict(obj["from"])
2432+ obj2_from_dict = FromDict.from_dict(obj["from_dict"])
24322433 from_json = FromJSON.from_dict(obj["from_json"])
24332434 func = Func.from_dict(obj["func"])
24342435 function = Function.from_dict(obj["function"])
24352436 get = Get.from_dict(obj["get"])
24362437 obj2_global = Global.from_dict(obj["global"])
24372438 go = Go.from_dict(obj["go"])
2438- goto = Goto.from_dict(obj["goto"])
2439- return Obj2(date_formatter, date_only, date_only_converter, date_time, date_time_styles, decoder, decoding_error, encoder, enum_values, equatable, false, format_exception, date_parse_handling, debugger, decimal, declare, decltype, decode_string, obj2_def, default, defer, deinit, obj2_del, delegate, delete, obj2_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, obj2_elif, obj2_else, encode_quick_type, enum, equality_contract, event, obj2_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, obj2_false, fileprivate, final, obj2_finally, fixed, obj2_float, obj2_for, foreach, friend, obj2_from, from_json, func, function, get, obj2_global, go, goto)
2439+ return Obj2(date_formatter, date_only, date_only_converter, date_time, date_time_styles, decoder, decoding_error, encoder, enum_values, equatable, false, format_exception, date_parse_handling, debugger, decimal, declare, decltype, decode_string, obj2_def, default, defer, deinit, obj2_del, delegate, delete, obj2_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, obj2_elif, obj2_else, encode_quick_type, enum, equality_contract, event, obj2_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, obj2_false, fileprivate, final, obj2_finally, fixed, obj2_float, obj2_for, foreach, friend, obj2_from, obj2_from_dict, from_json, func, function, get, obj2_global, go)
24402440
24412441 def to_dict(self) -> dict:
24422442 result: dict = {}
@@ -2498,13 +2498,29 @@ class Obj2:
24982498 result["foreach"] = to_class(Foreach, self.foreach)
24992499 result["friend"] = to_class(Friend, self.friend)
25002500 result["from"] = to_class(From, self.obj2_from)
2501+ result["from_dict"] = to_class(FromDict, self.obj2_from_dict)
25012502 result["from_json"] = to_class(FromJSON, self.from_json)
25022503 result["func"] = to_class(Func, self.func)
25032504 result["function"] = to_class(Function, self.function)
25042505 result["get"] = to_class(Get, self.get)
25052506 result["global"] = to_class(Global, self.obj2_global)
25062507 result["go"] = to_class(Go, self.go)
2507- result["goto"] = to_class(Goto, self.goto)
2508+ return result
2509+
2510+
2511+@dataclass
2512+class Goto:
2513+ goto: int
2514+
2515+ @staticmethod
2516+ def from_dict(obj: Any) -> 'Goto':
2517+ assert isinstance(obj, dict)
2518+ goto = from_int(obj["goto"])
2519+ return Goto(goto)
2520+
2521+ def to_dict(self) -> dict:
2522+ result: dict = {}
2523+ result["goto"] = from_int(self.goto)
25082524 return result
25092525
25102526
@@ -3260,6 +3276,22 @@ class MapEntry:
32603276 return result
32613277
32623278
3279+@dataclass
3280+class MarshalJSON:
3281+ marshal_json: int
3282+
3283+ @staticmethod
3284+ def from_dict(obj: Any) -> 'MarshalJSON':
3285+ assert isinstance(obj, dict)
3286+ marshal_json = from_int(obj["MarshalJSON"])
3287+ return MarshalJSON(marshal_json)
3288+
3289+ def to_dict(self) -> dict:
3290+ result: dict = {}
3291+ result["MarshalJSON"] = from_int(self.marshal_json)
3292+ return result
3293+
3294+
32633295 @dataclass
32643296 class MetadataPropertyHandling:
32653297 metadata_property_handling: int
@@ -3420,22 +3452,6 @@ class No:
34203452 return result
34213453
34223454
3423-@dataclass
3424-class Noexcept:
3425- noexcept: int
3426-
3427- @staticmethod
3428- def from_dict(obj: Any) -> 'Noexcept':
3429- assert isinstance(obj, dict)
3430- noexcept = from_int(obj["noexcept"])
3431- return Noexcept(noexcept)
3432-
3433- def to_dict(self) -> dict:
3434- result: dict = {}
3435- result["noexcept"] = from_int(self.noexcept)
3436- return result
3437-
3438-
34393455 @dataclass
34403456 class If:
34413457 if_if: int
@@ -3551,8 +3567,10 @@ class Obj3:
35513567 json_token_type: JSONTokenType
35523568 locale: Locale
35533569 map_entry: MapEntry
3570+ marshal_json: MarshalJSON
35543571 no: No
35553572 dummy: int
3573+ goto: Goto
35563574 guard: Guard
35573575 has_own_property: HasOwnProperty
35583576 hash_code: HashCode
@@ -3598,7 +3616,6 @@ class Obj3:
35983616 new: New
35993617 newtonsoft: Newtonsoft
36003618 nil: Nil
3601- noexcept: Noexcept
36023619
36033620 @staticmethod
36043621 def from_dict(obj: Any) -> 'Obj3':
@@ -3620,8 +3637,10 @@ class Obj3:
36203637 json_token_type = JSONTokenType.from_dict(obj["JsonTokenType"])
36213638 locale = Locale.from_dict(obj["Locale"])
36223639 map_entry = MapEntry.from_dict(obj["MapEntry"])
3640+ marshal_json = MarshalJSON.from_dict(obj["MarshalJSON"])
36233641 no = No.from_dict(obj["NO"])
36243642 dummy = from_int(obj["dummy"])
3643+ goto = Goto.from_dict(obj["goto"])
36253644 guard = Guard.from_dict(obj["guard"])
36263645 has_own_property = HasOwnProperty.from_dict(obj["hasOwnProperty"])
36273646 hash_code = HashCode.from_dict(obj["hashCode"])
@@ -3667,8 +3686,7 @@ class Obj3:
36673686 new = New.from_dict(obj["new"])
36683687 newtonsoft = Newtonsoft.from_dict(obj["newtonsoft"])
36693688 nil = Nil.from_dict(obj["nil"])
3670- noexcept = Noexcept.from_dict(obj["noexcept"])
3671- return Obj3(hashable, hasher, imp, iso_date_time_offset_converter, json_any, json_coding_key, json_decoder, json_encoder, json_null, json_exception, json_generator, json_node, json_parser, json_reader, json_token_type, locale, map_entry, no, dummy, guard, has_own_property, hash_code, id, obj3_if, implements, implicit, obj3_import, obj3_in, indirect, infix, init, inline, inout, instanceof, obj3_int, interface, internal, obj3_is, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, obj3_lambda, lazy, left, let, list, lock, long, map, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil, noexcept)
3689+ return Obj3(hashable, hasher, imp, iso_date_time_offset_converter, json_any, json_coding_key, json_decoder, json_encoder, json_null, json_exception, json_generator, json_node, json_parser, json_reader, json_token_type, locale, map_entry, marshal_json, no, dummy, goto, guard, has_own_property, hash_code, id, obj3_if, implements, implicit, obj3_import, obj3_in, indirect, infix, init, inline, inout, instanceof, obj3_int, interface, internal, obj3_is, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, obj3_lambda, lazy, left, let, list, lock, long, map, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil)
36723690
36733691 def to_dict(self) -> dict:
36743692 result: dict = {}
@@ -3689,8 +3707,10 @@ class Obj3:
36893707 result["JsonTokenType"] = to_class(JSONTokenType, self.json_token_type)
36903708 result["Locale"] = to_class(Locale, self.locale)
36913709 result["MapEntry"] = to_class(MapEntry, self.map_entry)
3710+ result["MarshalJSON"] = to_class(MarshalJSON, self.marshal_json)
36923711 result["NO"] = to_class(No, self.no)
36933712 result["dummy"] = from_int(self.dummy)
3713+ result["goto"] = to_class(Goto, self.goto)
36943714 result["guard"] = to_class(Guard, self.guard)
36953715 result["hasOwnProperty"] = to_class(HasOwnProperty, self.has_own_property)
36963716 result["hashCode"] = to_class(HashCode, self.hash_code)
@@ -3736,7 +3756,6 @@ class Obj3:
37363756 result["new"] = to_class(New, self.new)
37373757 result["newtonsoft"] = to_class(Newtonsoft, self.newtonsoft)
37383758 result["nil"] = to_class(Nil, self.nil)
3739- result["noexcept"] = to_class(Noexcept, self.noexcept)
37403759 return result
37413760
37423761
@@ -3756,6 +3775,22 @@ class NoSuchMethod:
37563775 return result
37573776
37583777
3778+@dataclass
3779+class Noexcept:
3780+ noexcept: int
3781+
3782+ @staticmethod
3783+ def from_dict(obj: Any) -> 'Noexcept':
3784+ assert isinstance(obj, dict)
3785+ noexcept = from_int(obj["noexcept"])
3786+ return Noexcept(noexcept)
3787+
3788+ def to_dict(self) -> dict:
3789+ result: dict = {}
3790+ result["noexcept"] = from_int(self.noexcept)
3791+ return result
3792+
3793+
37593794 @dataclass
37603795 class Nonatomic:
37613796 nonatomic: int
@@ -4748,22 +4783,6 @@ class Sel:
47484783 return result
47494784
47504785
4751-@dataclass
4752-class Select:
4753- select: int
4754-
4755- @staticmethod
4756- def from_dict(obj: Any) -> 'Select':
4757- assert isinstance(obj, dict)
4758- select = from_int(obj["select"])
4759- return Select(select)
4760-
4761- def to_dict(self) -> dict:
4762- result: dict = {}
4763- result["select"] = from_int(self.select)
4764- return result
4765-
4766-
47674786 @dataclass
47684787 class Obj4:
47694788 ns_error: NSError
@@ -4777,6 +4796,7 @@ class Obj4:
47774796 sel: Sel
47784797 dummy: int
47794798 no_such_method: NoSuchMethod
4799+ noexcept: Noexcept
47804800 nonatomic: Nonatomic
47814801 obj4_none: Obj4None
47824802 obj4_nonlocal: Nonlocal
@@ -4830,7 +4850,6 @@ class Obj4:
48304850 s: S
48314851 sbyte: Sbyte
48324852 sealed: Sealed
4833- select: Select
48344853
48354854 @staticmethod
48364855 def from_dict(obj: Any) -> 'Obj4':
@@ -4846,6 +4865,7 @@ class Obj4:
48464865 sel = Sel.from_dict(obj["SEL"])
48474866 dummy = from_int(obj["dummy"])
48484867 no_such_method = NoSuchMethod.from_dict(obj["noSuchMethod"])
4868+ noexcept = Noexcept.from_dict(obj["noexcept"])
48494869 nonatomic = Nonatomic.from_dict(obj["nonatomic"])
48504870 obj4_none = Obj4None.from_dict(obj["none"])
48514871 obj4_nonlocal = Nonlocal.from_dict(obj["nonlocal"])
@@ -4899,8 +4919,7 @@ class Obj4:
48994919 s = S.from_dict(obj["s"])
49004920 sbyte = Sbyte.from_dict(obj["sbyte"])
49014921 sealed = Sealed.from_dict(obj["sealed"])
4902- select = Select.from_dict(obj["select"])
4903- return Obj4(ns_error, ns_object, ns_string, null, none, object_mapper, protocol, reg_exp, sel, dummy, no_such_method, nonatomic, obj4_none, obj4_nonlocal, nonmutating, obj4_not, not_eq, obj4_null, nullptr, number, object, of, oneway, open, operator, optional, obj4_or, or_eq, out, override, package, params, obj4_pass, port, postfix, precedence, prefix, obj4_print, print_members, printf, private, protected, obj4_protocol, public, quicktype, obj4_raise, range, readonly, ref, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, obj4_return, right, runtime_type, s, sbyte, sealed, select)
4922+ return Obj4(ns_error, ns_object, ns_string, null, none, object_mapper, protocol, reg_exp, sel, dummy, no_such_method, noexcept, nonatomic, obj4_none, obj4_nonlocal, nonmutating, obj4_not, not_eq, obj4_null, nullptr, number, object, of, oneway, open, operator, optional, obj4_or, or_eq, out, override, package, params, obj4_pass, port, postfix, precedence, prefix, obj4_print, print_members, printf, private, protected, obj4_protocol, public, quicktype, obj4_raise, range, readonly, ref, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, obj4_return, right, runtime_type, s, sbyte, sealed)
49044923
49054924 def to_dict(self) -> dict:
49064925 result: dict = {}
@@ -4915,6 +4934,7 @@ class Obj4:
49154934 result["SEL"] = to_class(Sel, self.sel)
49164935 result["dummy"] = from_int(self.dummy)
49174936 result["noSuchMethod"] = to_class(NoSuchMethod, self.no_such_method)
4937+ result["noexcept"] = to_class(Noexcept, self.noexcept)
49184938 result["nonatomic"] = to_class(Nonatomic, self.nonatomic)
49194939 result["none"] = to_class(Obj4None, self.obj4_none)
49204940 result["nonlocal"] = to_class(Nonlocal, self.obj4_nonlocal)
@@ -4968,7 +4988,6 @@ class Obj4:
49684988 result["s"] = to_class(S, self.s)
49694989 result["sbyte"] = to_class(Sbyte, self.sbyte)
49704990 result["sealed"] = to_class(Sealed, self.sealed)
4971- result["select"] = to_class(Select, self.select)
49724991 return result
49734992
49744993
@@ -5004,6 +5023,22 @@ class Self:
50045023 return result
50055024
50065025
5026+@dataclass
5027+class ToDict:
5028+ to_dict_to_dict: int
5029+
5030+ @staticmethod
5031+ def from_dict(obj: Any) -> 'ToDict':
5032+ assert isinstance(obj, dict)
5033+ to_dict_to_dict = from_int(obj["to_dict"])
5034+ return ToDict(to_dict_to_dict)
5035+
5036+ def to_dict(self) -> dict:
5037+ result: dict = {}
5038+ result["to_dict"] = from_int(self.to_dict_to_dict)
5039+ return result
5040+
5041+
50075042 @dataclass
50085043 class Obj5True:
50095044 true: int
@@ -5084,6 +5119,22 @@ class SelfClass:
50845119 return result
50855120
50865121
5122+@dataclass
5123+class Select:
5124+ select: int
5125+
5126+ @staticmethod
5127+ def from_dict(obj: Any) -> 'Select':
5128+ assert isinstance(obj, dict)
5129+ select = from_int(obj["select"])
5130+ return Select(select)
5131+
5132+ def to_dict(self) -> dict:
5133+ result: dict = {}
5134+ result["select"] = from_int(self.select)
5135+ return result
5136+
5137+
50875138 @dataclass
50885139 class Sendable:
50895140 sendable: int
@@ -5916,6 +5967,22 @@ class UnionClass:
59165967 return result
59175968
59185969
5970+@dataclass
5971+class UnmarshalJSON:
5972+ unmarshal_json: int
5973+
5974+ @staticmethod
5975+ def from_dict(obj: Any) -> 'UnmarshalJSON':
5976+ assert isinstance(obj, dict)
5977+ unmarshal_json = from_int(obj["UnmarshalJSON"])
5978+ return UnmarshalJSON(unmarshal_json)
5979+
5980+ def to_dict(self) -> dict:
5981+ result: dict = {}
5982+ result["UnmarshalJSON"] = from_int(self.unmarshal_json)
5983+ return result
5984+
5985+
59195986 @dataclass
59205987 class Unowned:
59215988 unowned: int
@@ -5948,22 +6015,6 @@ class Unsafe:
59486015 return result
59496016
59506017
5951-@dataclass
5952-class Unsigned:
5953- unsigned: int
5954-
5955- @staticmethod
5956- def from_dict(obj: Any) -> 'Unsigned':
5957- assert isinstance(obj, dict)
5958- unsigned = from_int(obj["unsigned"])
5959- return Unsigned(unsigned)
5960-
5961- def to_dict(self) -> dict:
5962- result: dict = {}
5963- result["unsigned"] = from_int(self.unsigned)
5964- return result
5965-
5966-
59676018 @dataclass
59686019 class UseSerializers:
59696020 use_serializers: int
@@ -5980,22 +6031,6 @@ class UseSerializers:
59806031 return result
59816032
59826033
5983-@dataclass
5984-class Ushort:
5985- ushort: int
5986-
5987- @staticmethod
5988- def from_dict(obj: Any) -> 'Ushort':
5989- assert isinstance(obj, dict)
5990- ushort = from_int(obj["ushort"])
5991- return Ushort(ushort)
5992-
5993- def to_dict(self) -> dict:
5994- result: dict = {}
5995- result["ushort"] = from_int(self.ushort)
5996- return result
5997-
5998-
59996034 @dataclass
60006035 class Obj5:
60016036 k_serializer: KSerializer
@@ -6015,8 +6050,10 @@ class Obj5:
60156050 time_zone: TimeZone
60166051 true: TrueClass
60176052 type: TypeClass
6053+ unmarshal_json: UnmarshalJSON
60186054 use_serializers: UseSerializers
60196055 dummy: int
6056+ select: Select
60206057 purple_self: SelfClass
60216058 serialize: Serialize
60226059 set: Set
@@ -6043,6 +6080,7 @@ class Obj5:
60436080 throw: Throw
60446081 throws: Throws
60456082 to_string: ToString
6083+ obj5_to_dict: ToDict
60466084 to_json: ToJSON
60476085 top_level: TopLevelClass
60486086 transient: Transient
@@ -6061,8 +6099,6 @@ class Obj5:
60616099 union: UnionClass
60626100 unowned: Unowned
60636101 unsafe: Unsafe
6064- unsigned: Unsigned
6065- ushort: Ushort
60666102
60676103 @staticmethod
60686104 def from_dict(obj: Any) -> 'Obj5':
@@ -6084,8 +6120,10 @@ class Obj5:
60846120 time_zone = TimeZone.from_dict(obj["TimeZone"])
60856121 true = TrueClass.from_dict(obj["True"])
60866122 type = TypeClass.from_dict(obj["Type"])
6123+ unmarshal_json = UnmarshalJSON.from_dict(obj["UnmarshalJSON"])
60876124 use_serializers = UseSerializers.from_dict(obj["UseSerializers"])
60886125 dummy = from_int(obj["dummy"])
6126+ select = Select.from_dict(obj["select"])
60896127 purple_self = SelfClass.from_dict(obj["self"])
60906128 serialize = Serialize.from_dict(obj["serialize"])
60916129 set = Set.from_dict(obj["set"])
@@ -6112,6 +6150,7 @@ class Obj5:
61126150 throw = Throw.from_dict(obj["throw"])
61136151 throws = Throws.from_dict(obj["throws"])
61146152 to_string = ToString.from_dict(obj["toString"])
6153+ obj5_to_dict = ToDict.from_dict(obj["to_dict"])
61156154 to_json = ToJSON.from_dict(obj["to_json"])
61166155 top_level = TopLevelClass.from_dict(obj["top_level"])
61176156 transient = Transient.from_dict(obj["transient"])
@@ -6130,9 +6169,7 @@ class Obj5:
61306169 union = UnionClass.from_dict(obj["union"])
61316170 unowned = Unowned.from_dict(obj["unowned"])
61326171 unsafe = Unsafe.from_dict(obj["unsafe"])
6133- unsigned = Unsigned.from_dict(obj["unsigned"])
6134- ushort = Ushort.from_dict(obj["ushort"])
6135- return Obj5(k_serializer, primitive_kind, obj5_self, sendable, serial_descriptor, serial_name, serializable, serializer_provider, simple_module, standards, std_deserializer, std_serializer, time_only, time_only_converter, time_zone, true, type, use_serializers, dummy, purple_self, serialize, set, short, signed, sizeof, stackalloc, static, static_assert, static_cast, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, to_string, to_json, top_level, transient, obj5_true, obj5_try, obj5_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unowned, unsafe, unsigned, ushort)
6172+ return Obj5(k_serializer, primitive_kind, obj5_self, sendable, serial_descriptor, serial_name, serializable, serializer_provider, simple_module, standards, std_deserializer, std_serializer, time_only, time_only_converter, time_zone, true, type, unmarshal_json, use_serializers, dummy, select, purple_self, serialize, set, short, signed, sizeof, stackalloc, static, static_assert, static_cast, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, to_string, obj5_to_dict, to_json, top_level, transient, obj5_true, obj5_try, obj5_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unowned, unsafe)
61366173
61376174 def to_dict(self) -> dict:
61386175 result: dict = {}
@@ -6153,8 +6190,10 @@ class Obj5:
61536190 result["TimeZone"] = to_class(TimeZone, self.time_zone)
61546191 result["True"] = to_class(TrueClass, self.true)
61556192 result["Type"] = to_class(TypeClass, self.type)
6193+ result["UnmarshalJSON"] = to_class(UnmarshalJSON, self.unmarshal_json)
61566194 result["UseSerializers"] = to_class(UseSerializers, self.use_serializers)
61576195 result["dummy"] = from_int(self.dummy)
6196+ result["select"] = to_class(Select, self.select)
61586197 result["self"] = to_class(SelfClass, self.purple_self)
61596198 result["serialize"] = to_class(Serialize, self.serialize)
61606199 result["set"] = to_class(Set, self.set)
@@ -6181,6 +6220,7 @@ class Obj5:
61816220 result["throw"] = to_class(Throw, self.throw)
61826221 result["throws"] = to_class(Throws, self.throws)
61836222 result["toString"] = to_class(ToString, self.to_string)
6223+ result["to_dict"] = to_class(ToDict, self.obj5_to_dict)
61846224 result["to_json"] = to_class(ToJSON, self.to_json)
61856225 result["top_level"] = to_class(TopLevelClass, self.top_level)
61866226 result["transient"] = to_class(Transient, self.transient)
@@ -6199,8 +6239,6 @@ class Obj5:
61996239 result["union"] = to_class(UnionClass, self.union)
62006240 result["unowned"] = to_class(Unowned, self.unowned)
62016241 result["unsafe"] = to_class(Unsafe, self.unsafe)
6202- result["unsigned"] = to_class(Unsigned, self.unsigned)
6203- result["ushort"] = to_class(Ushort, self.ushort)
62046242 return result
62056243
62066244
@@ -6252,6 +6290,38 @@ class Yield:
62526290 return result
62536291
62546292
6293+@dataclass
6294+class Unsigned:
6295+ unsigned: int
6296+
6297+ @staticmethod
6298+ def from_dict(obj: Any) -> 'Unsigned':
6299+ assert isinstance(obj, dict)
6300+ unsigned = from_int(obj["unsigned"])
6301+ return Unsigned(unsigned)
6302+
6303+ def to_dict(self) -> dict:
6304+ result: dict = {}
6305+ result["unsigned"] = from_int(self.unsigned)
6306+ return result
6307+
6308+
6309+@dataclass
6310+class Ushort:
6311+ ushort: int
6312+
6313+ @staticmethod
6314+ def from_dict(obj: Any) -> 'Ushort':
6315+ assert isinstance(obj, dict)
6316+ ushort = from_int(obj["ushort"])
6317+ return Ushort(ushort)
6318+
6319+ def to_dict(self) -> dict:
6320+ result: dict = {}
6321+ result["ushort"] = from_int(self.ushort)
6322+ return result
6323+
6324+
62556325 @dataclass
62566326 class Using:
62576327 using: int
@@ -6499,6 +6569,8 @@ class Obj6:
64996569 utf8_json_writer: Utf8JSONWriter
65006570 yes: Yes
65016571 dummy: int
6572+ unsigned: Unsigned
6573+ ushort: Ushort
65026574 using: Using
65036575 var: Var
65046576 virtual: Virtual
@@ -6522,6 +6594,8 @@ class Obj6:
65226594 utf8_json_writer = Utf8JSONWriter.from_dict(obj["Utf8JsonWriter"])
65236595 yes = Yes.from_dict(obj["YES"])
65246596 dummy = from_int(obj["dummy"])
6597+ unsigned = Unsigned.from_dict(obj["unsigned"])
6598+ ushort = Ushort.from_dict(obj["ushort"])
65256599 using = Using.from_dict(obj["using"])
65266600 var = Var.from_dict(obj["var"])
65276601 virtual = Virtual.from_dict(obj["virtual"])
@@ -6536,7 +6610,7 @@ class Obj6:
65366610 xor = Xor.from_dict(obj["xor"])
65376611 xor_eq = XorEq.from_dict(obj["xor_eq"])
65386612 obj6_yield = Yield.from_dict(obj["yield"])
6539- return Obj6(uuid, utf8_json_reader, utf8_json_writer, yes, dummy, using, var, virtual, void, volatile, wchar_t, weak, where, obj6_while, will_set, obj6_with, xor, xor_eq, obj6_yield)
6613+ return Obj6(uuid, utf8_json_reader, utf8_json_writer, yes, dummy, unsigned, ushort, using, var, virtual, void, volatile, wchar_t, weak, where, obj6_while, will_set, obj6_with, xor, xor_eq, obj6_yield)
65406614
65416615 def to_dict(self) -> dict:
65426616 result: dict = {}
@@ -6545,6 +6619,8 @@ class Obj6:
65456619 result["Utf8JsonWriter"] = to_class(Utf8JSONWriter, self.utf8_json_writer)
65466620 result["YES"] = to_class(Yes, self.yes)
65476621 result["dummy"] = from_int(self.dummy)
6622+ result["unsigned"] = to_class(Unsigned, self.unsigned)
6623+ result["ushort"] = to_class(Ushort, self.ushort)
65486624 result["using"] = to_class(Using, self.using)
65496625 result["var"] = to_class(Var, self.var)
65506626 result["virtual"] = to_class(Virtual, self.virtual)
Mrubydefault / TopLevel.rb+239 −127
@@ -3094,6 +3094,31 @@ class From < Dry::Struct
30943094 end
30953095 end
30963096
3097+class FromDict < Dry::Struct
3098+ attribute :from_dict, Types::Integer
3099+
3100+ def self.from_dynamic!(d)
3101+ d = Types::Hash[d]
3102+ new(
3103+ from_dict: d.fetch("from_dict"),
3104+ )
3105+ end
3106+
3107+ def self.from_json!(json)
3108+ from_dynamic!(JSON.parse(json))
3109+ end
3110+
3111+ def to_dynamic
3112+ {
3113+ "from_dict" => from_dict,
3114+ }
3115+ end
3116+
3117+ def to_json(options = nil)
3118+ JSON.generate(to_dynamic, options)
3119+ end
3120+end
3121+
30973122 class FromJSON < Dry::Struct
30983123 attribute :from_json, Types::Integer
30993124
@@ -3244,31 +3269,6 @@ class Go < Dry::Struct
32443269 end
32453270 end
32463271
3247-class Goto < Dry::Struct
3248- attribute :goto, Types::Integer
3249-
3250- def self.from_dynamic!(d)
3251- d = Types::Hash[d]
3252- new(
3253- goto: d.fetch("goto"),
3254- )
3255- end
3256-
3257- def self.from_json!(json)
3258- from_dynamic!(JSON.parse(json))
3259- end
3260-
3261- def to_dynamic
3262- {
3263- "goto" => goto,
3264- }
3265- end
3266-
3267- def to_json(options = nil)
3268- JSON.generate(to_dynamic, options)
3269- end
3270-end
3271-
32723272 class Def < Dry::Struct
32733273 attribute :def_def, Types::Integer
32743274
@@ -3496,13 +3496,13 @@ class Obj2 < Dry::Struct
34963496 attribute :format_exception, FormatException
34973497 attribute :friend, Friend
34983498 attribute :from, From
3499+ attribute :from_dict, FromDict
34993500 attribute :from_json, FromJSON
35003501 attribute :func, Func
35013502 attribute :function, Function
35023503 attribute :get, Get
35033504 attribute :global, Global
35043505 attribute :go, Go
3505- attribute :goto, Goto
35063506 attribute :obj2_def, Def
35073507 attribute :obj2_default, Default
35083508 attribute :obj2_do, Do
@@ -3565,13 +3565,13 @@ class Obj2 < Dry::Struct
35653565 format_exception: FormatException.from_dynamic!(d.fetch("FormatException")),
35663566 friend: Friend.from_dynamic!(d.fetch("friend")),
35673567 from: From.from_dynamic!(d.fetch("from")),
3568+ from_dict: FromDict.from_dynamic!(d.fetch("from_dict")),
35683569 from_json: FromJSON.from_dynamic!(d.fetch("from_json")),
35693570 func: Func.from_dynamic!(d.fetch("func")),
35703571 function: Function.from_dynamic!(d.fetch("function")),
35713572 get: Get.from_dynamic!(d.fetch("get")),
35723573 global: Global.from_dynamic!(d.fetch("global")),
35733574 go: Go.from_dynamic!(d.fetch("go")),
3574- goto: Goto.from_dynamic!(d.fetch("goto")),
35753575 obj2_def: Def.from_dynamic!(d.fetch("def")),
35763576 obj2_default: Default.from_dynamic!(d.fetch("default")),
35773577 obj2_do: Do.from_dynamic!(d.fetch("do")),
@@ -3639,13 +3639,13 @@ class Obj2 < Dry::Struct
36393639 "FormatException" => format_exception.to_dynamic,
36403640 "friend" => friend.to_dynamic,
36413641 "from" => from.to_dynamic,
3642+ "from_dict" => from_dict.to_dynamic,
36423643 "from_json" => from_json.to_dynamic,
36433644 "func" => func.to_dynamic,
36443645 "function" => function.to_dynamic,
36453646 "get" => get.to_dynamic,
36463647 "global" => global.to_dynamic,
36473648 "go" => go.to_dynamic,
3648- "goto" => goto.to_dynamic,
36493649 "def" => obj2_def.to_dynamic,
36503650 "default" => obj2_default.to_dynamic,
36513651 "do" => obj2_do.to_dynamic,
@@ -3661,6 +3661,31 @@ class Obj2 < Dry::Struct
36613661 end
36623662 end
36633663
3664+class Goto < Dry::Struct
3665+ attribute :goto, Types::Integer
3666+
3667+ def self.from_dynamic!(d)
3668+ d = Types::Hash[d]
3669+ new(
3670+ goto: d.fetch("goto"),
3671+ )
3672+ end
3673+
3674+ def self.from_json!(json)
3675+ from_dynamic!(JSON.parse(json))
3676+ end
3677+
3678+ def to_dynamic
3679+ {
3680+ "goto" => goto,
3681+ }
3682+ end
3683+
3684+ def to_json(options = nil)
3685+ JSON.generate(to_dynamic, options)
3686+ end
3687+end
3688+
36643689 class Guard < Dry::Struct
36653690 attribute :guard, Types::Integer
36663691
@@ -4911,6 +4936,31 @@ class MapEntry < Dry::Struct
49114936 end
49124937 end
49134938
4939+class MarshalJSON < Dry::Struct
4940+ attribute :marshal_json, Types::Integer
4941+
4942+ def self.from_dynamic!(d)
4943+ d = Types::Hash[d]
4944+ new(
4945+ marshal_json: d.fetch("MarshalJSON"),
4946+ )
4947+ end
4948+
4949+ def self.from_json!(json)
4950+ from_dynamic!(JSON.parse(json))
4951+ end
4952+
4953+ def to_dynamic
4954+ {
4955+ "MarshalJSON" => marshal_json,
4956+ }
4957+ end
4958+
4959+ def to_json(options = nil)
4960+ JSON.generate(to_dynamic, options)
4961+ end
4962+end
4963+
49144964 class MetadataPropertyHandling < Dry::Struct
49154965 attribute :metadata_property_handling, Types::Integer
49164966
@@ -5086,31 +5136,6 @@ class No < Dry::Struct
50865136 end
50875137 end
50885138
5089-class Noexcept < Dry::Struct
5090- attribute :noexcept, Types::Integer
5091-
5092- def self.from_dynamic!(d)
5093- d = Types::Hash[d]
5094- new(
5095- noexcept: d.fetch("noexcept"),
5096- )
5097- end
5098-
5099- def self.from_json!(json)
5100- from_dynamic!(JSON.parse(json))
5101- end
5102-
5103- def to_dynamic
5104- {
5105- "noexcept" => noexcept,
5106- }
5107- end
5108-
5109- def to_json(options = nil)
5110- JSON.generate(to_dynamic, options)
5111- end
5112-end
5113-
51145139 class If < Dry::Struct
51155140 attribute :if_if, Types::Integer
51165141
@@ -5263,6 +5288,7 @@ end
52635288
52645289 class Obj3 < Dry::Struct
52655290 attribute :dummy, Types::Integer
5291+ attribute :goto, Goto
52665292 attribute :guard, Guard
52675293 attribute :has_own_property, HasOwnProperty
52685294 attribute :hash_code, HashCode
@@ -5313,6 +5339,7 @@ class Obj3 < Dry::Struct
53135339 attribute :long, Long
53145340 attribute :map, Map
53155341 attribute :map_entry, MapEntry
5342+ attribute :marshal_json, MarshalJSON
53165343 attribute :metadata_property_handling, MetadataPropertyHandling
53175344 attribute :mutable, Mutable
53185345 attribute :mutating, Mutating
@@ -5320,7 +5347,6 @@ class Obj3 < Dry::Struct
53205347 attribute :native, Native
53215348 attribute :newtonsoft, Newtonsoft
53225349 attribute :no, No
5323- attribute :noexcept, Noexcept
53245350 attribute :obj3_if, If
53255351 attribute :obj3_in, In
53265352 attribute :obj3_lambda, Lambda
@@ -5332,6 +5358,7 @@ class Obj3 < Dry::Struct
53325358 d = Types::Hash[d]
53335359 new(
53345360 dummy: d.fetch("dummy"),
5361+ goto: Goto.from_dynamic!(d.fetch("goto")),
53355362 guard: Guard.from_dynamic!(d.fetch("guard")),
53365363 has_own_property: HasOwnProperty.from_dynamic!(d.fetch("hasOwnProperty")),
53375364 hash_code: HashCode.from_dynamic!(d.fetch("hashCode")),
@@ -5382,6 +5409,7 @@ class Obj3 < Dry::Struct
53825409 long: Long.from_dynamic!(d.fetch("long")),
53835410 map: Map.from_dynamic!(d.fetch("map")),
53845411 map_entry: MapEntry.from_dynamic!(d.fetch("MapEntry")),
5412+ marshal_json: MarshalJSON.from_dynamic!(d.fetch("MarshalJSON")),
53855413 metadata_property_handling: MetadataPropertyHandling.from_dynamic!(d.fetch("metadata_property_handling")),
53865414 mutable: Mutable.from_dynamic!(d.fetch("mutable")),
53875415 mutating: Mutating.from_dynamic!(d.fetch("mutating")),
@@ -5389,7 +5417,6 @@ class Obj3 < Dry::Struct
53895417 native: Native.from_dynamic!(d.fetch("native")),
53905418 newtonsoft: Newtonsoft.from_dynamic!(d.fetch("newtonsoft")),
53915419 no: No.from_dynamic!(d.fetch("NO")),
5392- noexcept: Noexcept.from_dynamic!(d.fetch("noexcept")),
53935420 obj3_if: If.from_dynamic!(d.fetch("if")),
53945421 obj3_in: In.from_dynamic!(d.fetch("in")),
53955422 obj3_lambda: Lambda.from_dynamic!(d.fetch("lambda")),
@@ -5406,6 +5433,7 @@ class Obj3 < Dry::Struct
54065433 def to_dynamic
54075434 {
54085435 "dummy" => dummy,
5436+ "goto" => goto.to_dynamic,
54095437 "guard" => guard.to_dynamic,
54105438 "hasOwnProperty" => has_own_property.to_dynamic,
54115439 "hashCode" => hash_code.to_dynamic,
@@ -5456,6 +5484,7 @@ class Obj3 < Dry::Struct
54565484 "long" => long.to_dynamic,
54575485 "map" => map.to_dynamic,
54585486 "MapEntry" => map_entry.to_dynamic,
5487+ "MarshalJSON" => marshal_json.to_dynamic,
54595488 "metadata_property_handling" => metadata_property_handling.to_dynamic,
54605489 "mutable" => mutable.to_dynamic,
54615490 "mutating" => mutating.to_dynamic,
@@ -5463,7 +5492,6 @@ class Obj3 < Dry::Struct
54635492 "native" => native.to_dynamic,
54645493 "newtonsoft" => newtonsoft.to_dynamic,
54655494 "NO" => no.to_dynamic,
5466- "noexcept" => noexcept.to_dynamic,
54675495 "if" => obj3_if.to_dynamic,
54685496 "in" => obj3_in.to_dynamic,
54695497 "lambda" => obj3_lambda.to_dynamic,
@@ -5503,6 +5531,31 @@ class NoSuchMethod < Dry::Struct
55035531 end
55045532 end
55055533
5534+class Noexcept < Dry::Struct
5535+ attribute :noexcept, Types::Integer
5536+
5537+ def self.from_dynamic!(d)
5538+ d = Types::Hash[d]
5539+ new(
5540+ noexcept: d.fetch("noexcept"),
5541+ )
5542+ end
5543+
5544+ def self.from_json!(json)
5545+ from_dynamic!(JSON.parse(json))
5546+ end
5547+
5548+ def to_dynamic
5549+ {
5550+ "noexcept" => noexcept,
5551+ }
5552+ end
5553+
5554+ def to_json(options = nil)
5555+ JSON.generate(to_dynamic, options)
5556+ end
5557+end
5558+
55065559 class Nonatomic < Dry::Struct
55075560 attribute :nonatomic, Types::Integer
55085561
@@ -6078,31 +6131,6 @@ class Return < Dry::Struct
60786131 end
60796132 end
60806133
6081-class Select < Dry::Struct
6082- attribute :select_select, Types::Integer
6083-
6084- def self.from_dynamic!(d)
6085- d = Types::Hash[d]
6086- new(
6087- select_select: d.fetch("select"),
6088- )
6089- end
6090-
6091- def self.from_json!(json)
6092- from_dynamic!(JSON.parse(json))
6093- end
6094-
6095- def to_dynamic
6096- {
6097- "select" => select_select,
6098- }
6099- end
6100-
6101- def to_json(options = nil)
6102- JSON.generate(to_dynamic, options)
6103- end
6104-end
6105-
61066134 class ObjectClass < Dry::Struct
61076135 attribute :object, Types::Integer
61086136
@@ -7081,6 +7109,7 @@ end
70817109 class Obj4 < Dry::Struct
70827110 attribute :dummy, Types::Integer
70837111 attribute :no_such_method, NoSuchMethod
7112+ attribute :noexcept, Noexcept
70847113 attribute :nonatomic, Nonatomic
70857114 attribute :none, None
70867115 attribute :nonlocal, Nonlocal
@@ -7104,7 +7133,6 @@ class Obj4 < Dry::Struct
71047133 attribute :obj4_raise, Raise
71057134 attribute :obj4_require, Require
71067135 attribute :obj4_return, Return
7107- attribute :obj4_select, Select
71087136 attribute :object, ObjectClass
71097137 attribute :object_mapper, ObjectMapper
71107138 attribute :of, Of
@@ -7150,6 +7178,7 @@ class Obj4 < Dry::Struct
71507178 new(
71517179 dummy: d.fetch("dummy"),
71527180 no_such_method: NoSuchMethod.from_dynamic!(d.fetch("noSuchMethod")),
7181+ noexcept: Noexcept.from_dynamic!(d.fetch("noexcept")),
71537182 nonatomic: Nonatomic.from_dynamic!(d.fetch("nonatomic")),
71547183 none: None.from_dynamic!(d.fetch("None")),
71557184 nonlocal: Nonlocal.from_dynamic!(d.fetch("nonlocal")),
@@ -7173,7 +7202,6 @@ class Obj4 < Dry::Struct
71737202 obj4_raise: Raise.from_dynamic!(d.fetch("raise")),
71747203 obj4_require: Require.from_dynamic!(d.fetch("require")),
71757204 obj4_return: Return.from_dynamic!(d.fetch("return")),
7176- obj4_select: Select.from_dynamic!(d.fetch("select")),
71777205 object: ObjectClass.from_dynamic!(d.fetch("object")),
71787206 object_mapper: ObjectMapper.from_dynamic!(d.fetch("ObjectMapper")),
71797207 of: Of.from_dynamic!(d.fetch("of")),
@@ -7224,6 +7252,7 @@ class Obj4 < Dry::Struct
72247252 {
72257253 "dummy" => dummy,
72267254 "noSuchMethod" => no_such_method.to_dynamic,
7255+ "noexcept" => noexcept.to_dynamic,
72277256 "nonatomic" => nonatomic.to_dynamic,
72287257 "None" => none.to_dynamic,
72297258 "nonlocal" => nonlocal.to_dynamic,
@@ -7247,7 +7276,6 @@ class Obj4 < Dry::Struct
72477276 "raise" => obj4_raise.to_dynamic,
72487277 "require" => obj4_require.to_dynamic,
72497278 "return" => obj4_return.to_dynamic,
7250- "select" => obj4_select.to_dynamic,
72517279 "object" => object.to_dynamic,
72527280 "ObjectMapper" => object_mapper.to_dynamic,
72537281 "of" => of.to_dynamic,
@@ -7320,6 +7348,31 @@ class KSerializer < Dry::Struct
73207348 end
73217349 end
73227350
7351+class Select < Dry::Struct
7352+ attribute :select_select, Types::Integer
7353+
7354+ def self.from_dynamic!(d)
7355+ d = Types::Hash[d]
7356+ new(
7357+ select_select: d.fetch("select"),
7358+ )
7359+ end
7360+
7361+ def self.from_json!(json)
7362+ from_dynamic!(JSON.parse(json))
7363+ end
7364+
7365+ def to_dynamic
7366+ {
7367+ "select" => select_select,
7368+ }
7369+ end
7370+
7371+ def to_json(options = nil)
7372+ JSON.generate(to_dynamic, options)
7373+ end
7374+end
7375+
73237376 class SelfClass < Dry::Struct
73247377 attribute :self_self, Types::Integer
73257378
@@ -8395,6 +8448,31 @@ class TimeZone < Dry::Struct
83958448 end
83968449 end
83978450
8451+class ToDict < Dry::Struct
8452+ attribute :to_dict, Types::Integer
8453+
8454+ def self.from_dynamic!(d)
8455+ d = Types::Hash[d]
8456+ new(
8457+ to_dict: d.fetch("to_dict"),
8458+ )
8459+ end
8460+
8461+ def self.from_json!(json)
8462+ from_dynamic!(JSON.parse(json))
8463+ end
8464+
8465+ def to_dynamic
8466+ {
8467+ "to_dict" => to_dict,
8468+ }
8469+ end
8470+
8471+ def to_json(options = nil)
8472+ JSON.generate(to_dynamic, options)
8473+ end
8474+end
8475+
83988476 class ToString < Dry::Struct
83998477 attribute :to_string, Types::Integer
84008478
@@ -8770,13 +8848,13 @@ class Union < Dry::Struct
87708848 end
87718849 end
87728850
8773-class Unowned < Dry::Struct
8774- attribute :unowned, Types::Integer
8851+class UnmarshalJSON < Dry::Struct
8852+ attribute :unmarshal_json, Types::Integer
87758853
87768854 def self.from_dynamic!(d)
87778855 d = Types::Hash[d]
87788856 new(
8779- unowned: d.fetch("unowned"),
8857+ unmarshal_json: d.fetch("UnmarshalJSON"),
87808858 )
87818859 end
87828860
@@ -8786,7 +8864,7 @@ class Unowned < Dry::Struct
87868864
87878865 def to_dynamic
87888866 {
8789- "unowned" => unowned,
8867+ "UnmarshalJSON" => unmarshal_json,
87908868 }
87918869 end
87928870
@@ -8795,13 +8873,13 @@ class Unowned < Dry::Struct
87958873 end
87968874 end
87978875
8798-class Unsafe < Dry::Struct
8799- attribute :unsafe, Types::Integer
8876+class Unowned < Dry::Struct
8877+ attribute :unowned, Types::Integer
88008878
88018879 def self.from_dynamic!(d)
88028880 d = Types::Hash[d]
88038881 new(
8804- unsafe: d.fetch("unsafe"),
8882+ unowned: d.fetch("unowned"),
88058883 )
88068884 end
88078885
@@ -8811,7 +8889,7 @@ class Unsafe < Dry::Struct
88118889
88128890 def to_dynamic
88138891 {
8814- "unsafe" => unsafe,
8892+ "unowned" => unowned,
88158893 }
88168894 end
88178895
@@ -8820,13 +8898,13 @@ class Unsafe < Dry::Struct
88208898 end
88218899 end
88228900
8823-class Unsigned < Dry::Struct
8824- attribute :unsigned, Types::Integer
8901+class Unsafe < Dry::Struct
8902+ attribute :unsafe, Types::Integer
88258903
88268904 def self.from_dynamic!(d)
88278905 d = Types::Hash[d]
88288906 new(
8829- unsigned: d.fetch("unsigned"),
8907+ unsafe: d.fetch("unsafe"),
88308908 )
88318909 end
88328910
@@ -8836,7 +8914,7 @@ class Unsigned < Dry::Struct
88368914
88378915 def to_dynamic
88388916 {
8839- "unsigned" => unsigned,
8917+ "unsafe" => unsafe,
88408918 }
88418919 end
88428920
@@ -8870,34 +8948,10 @@ class UseSerializers < Dry::Struct
88708948 end
88718949 end
88728950
8873-class Ushort < Dry::Struct
8874- attribute :ushort, Types::Integer
8875-
8876- def self.from_dynamic!(d)
8877- d = Types::Hash[d]
8878- new(
8879- ushort: d.fetch("ushort"),
8880- )
8881- end
8882-
8883- def self.from_json!(json)
8884- from_dynamic!(JSON.parse(json))
8885- end
8886-
8887- def to_dynamic
8888- {
8889- "ushort" => ushort,
8890- }
8891- end
8892-
8893- def to_json(options = nil)
8894- JSON.generate(to_dynamic, options)
8895- end
8896-end
8897-
88988951 class Obj5 < Dry::Struct
88998952 attribute :dummy, Types::Integer
89008953 attribute :k_serializer, KSerializer
8954+ attribute :obj5_select, Select
89018955 attribute :obj5_self, SelfClass
89028956 attribute :obj5_super, Super
89038957 attribute :obj5_system, System
@@ -8941,6 +8995,7 @@ class Obj5 < Dry::Struct
89418995 attribute :time_only, TimeOnly
89428996 attribute :time_only_converter, TimeOnlyConverter
89438997 attribute :time_zone, TimeZone
8998+ attribute :to_dict, ToDict
89448999 attribute :to_string, ToString
89459000 attribute :top_level, TopLevelClass
89469001 attribute :transient, Transient
@@ -8956,17 +9011,17 @@ class Obj5 < Dry::Struct
89569011 attribute :unchecked, Unchecked
89579012 attribute :undefined, UndefinedClass
89589013 attribute :union, Union
9014+ attribute :unmarshal_json, UnmarshalJSON
89599015 attribute :unowned, Unowned
89609016 attribute :unsafe, Unsafe
8961- attribute :unsigned, Unsigned
89629017 attribute :use_serializers, UseSerializers
8963- attribute :ushort, Ushort
89649018
89659019 def self.from_dynamic!(d)
89669020 d = Types::Hash[d]
89679021 new(
89689022 dummy: d.fetch("dummy"),
89699023 k_serializer: KSerializer.from_dynamic!(d.fetch("KSerializer")),
9024+ obj5_select: Select.from_dynamic!(d.fetch("select")),
89709025 obj5_self: SelfClass.from_dynamic!(d.fetch("Self")),
89719026 obj5_super: Super.from_dynamic!(d.fetch("super")),
89729027 obj5_system: System.from_dynamic!(d.fetch("system")),
@@ -9010,6 +9065,7 @@ class Obj5 < Dry::Struct
90109065 time_only: TimeOnly.from_dynamic!(d.fetch("TimeOnly")),
90119066 time_only_converter: TimeOnlyConverter.from_dynamic!(d.fetch("TimeOnlyConverter")),
90129067 time_zone: TimeZone.from_dynamic!(d.fetch("TimeZone")),
9068+ to_dict: ToDict.from_dynamic!(d.fetch("to_dict")),
90139069 to_string: ToString.from_dynamic!(d.fetch("toString")),
90149070 top_level: TopLevelClass.from_dynamic!(d.fetch("top_level")),
90159071 transient: Transient.from_dynamic!(d.fetch("transient")),
@@ -9025,11 +9081,10 @@ class Obj5 < Dry::Struct
90259081 unchecked: Unchecked.from_dynamic!(d.fetch("unchecked")),
90269082 undefined: UndefinedClass.from_dynamic!(d.fetch("undefined")),
90279083 union: Union.from_dynamic!(d.fetch("union")),
9084+ unmarshal_json: UnmarshalJSON.from_dynamic!(d.fetch("UnmarshalJSON")),
90289085 unowned: Unowned.from_dynamic!(d.fetch("unowned")),
90299086 unsafe: Unsafe.from_dynamic!(d.fetch("unsafe")),
9030- unsigned: Unsigned.from_dynamic!(d.fetch("unsigned")),
90319087 use_serializers: UseSerializers.from_dynamic!(d.fetch("UseSerializers")),
9032- ushort: Ushort.from_dynamic!(d.fetch("ushort")),
90339088 )
90349089 end
90359090
@@ -9041,6 +9096,7 @@ class Obj5 < Dry::Struct
90419096 {
90429097 "dummy" => dummy,
90439098 "KSerializer" => k_serializer.to_dynamic,
9099+ "select" => obj5_select.to_dynamic,
90449100 "Self" => obj5_self.to_dynamic,
90459101 "super" => obj5_super.to_dynamic,
90469102 "system" => obj5_system.to_dynamic,
@@ -9084,6 +9140,7 @@ class Obj5 < Dry::Struct
90849140 "TimeOnly" => time_only.to_dynamic,
90859141 "TimeOnlyConverter" => time_only_converter.to_dynamic,
90869142 "TimeZone" => time_zone.to_dynamic,
9143+ "to_dict" => to_dict.to_dynamic,
90879144 "toString" => to_string.to_dynamic,
90889145 "top_level" => top_level.to_dynamic,
90899146 "transient" => transient.to_dynamic,
@@ -9099,11 +9156,10 @@ class Obj5 < Dry::Struct
90999156 "unchecked" => unchecked.to_dynamic,
91009157 "undefined" => undefined.to_dynamic,
91019158 "union" => union.to_dynamic,
9159+ "UnmarshalJSON" => unmarshal_json.to_dynamic,
91029160 "unowned" => unowned.to_dynamic,
91039161 "unsafe" => unsafe.to_dynamic,
9104- "unsigned" => unsigned.to_dynamic,
91059162 "UseSerializers" => use_serializers.to_dynamic,
9106- "ushort" => ushort.to_dynamic,
91079163 }
91089164 end
91099165
@@ -9187,6 +9243,56 @@ class Yield < Dry::Struct
91879243 end
91889244 end
91899245
9246+class Unsigned < Dry::Struct
9247+ attribute :unsigned, Types::Integer
9248+
9249+ def self.from_dynamic!(d)
9250+ d = Types::Hash[d]
9251+ new(
9252+ unsigned: d.fetch("unsigned"),
9253+ )
9254+ end
9255+
9256+ def self.from_json!(json)
9257+ from_dynamic!(JSON.parse(json))
9258+ end
9259+
9260+ def to_dynamic
9261+ {
9262+ "unsigned" => unsigned,
9263+ }
9264+ end
9265+
9266+ def to_json(options = nil)
9267+ JSON.generate(to_dynamic, options)
9268+ end
9269+end
9270+
9271+class Ushort < Dry::Struct
9272+ attribute :ushort, Types::Integer
9273+
9274+ def self.from_dynamic!(d)
9275+ d = Types::Hash[d]
9276+ new(
9277+ ushort: d.fetch("ushort"),
9278+ )
9279+ end
9280+
9281+ def self.from_json!(json)
9282+ from_dynamic!(JSON.parse(json))
9283+ end
9284+
9285+ def to_dynamic
9286+ {
9287+ "ushort" => ushort,
9288+ }
9289+ end
9290+
9291+ def to_json(options = nil)
9292+ JSON.generate(to_dynamic, options)
9293+ end
9294+end
9295+
91909296 class Using < Dry::Struct
91919297 attribute :using, Types::Integer
91929298
@@ -9567,6 +9673,8 @@ class Obj6 < Dry::Struct
95679673 attribute :obj6_while, While
95689674 attribute :obj6_with, With
95699675 attribute :obj6_yield, Yield
9676+ attribute :unsigned, Unsigned
9677+ attribute :ushort, Ushort
95709678 attribute :using, Using
95719679 attribute :utf8_json_reader, Utf8JSONReader
95729680 attribute :utf8_json_writer, Utf8JSONWriter
@@ -9590,6 +9698,8 @@ class Obj6 < Dry::Struct
95909698 obj6_while: While.from_dynamic!(d.fetch("while")),
95919699 obj6_with: With.from_dynamic!(d.fetch("with")),
95929700 obj6_yield: Yield.from_dynamic!(d.fetch("yield")),
9701+ unsigned: Unsigned.from_dynamic!(d.fetch("unsigned")),
9702+ ushort: Ushort.from_dynamic!(d.fetch("ushort")),
95939703 using: Using.from_dynamic!(d.fetch("using")),
95949704 utf8_json_reader: Utf8JSONReader.from_dynamic!(d.fetch("Utf8JsonReader")),
95959705 utf8_json_writer: Utf8JSONWriter.from_dynamic!(d.fetch("Utf8JsonWriter")),
@@ -9618,6 +9728,8 @@ class Obj6 < Dry::Struct
96189728 "while" => obj6_while.to_dynamic,
96199729 "with" => obj6_with.to_dynamic,
96209730 "yield" => obj6_yield.to_dynamic,
9731+ "unsigned" => unsigned.to_dynamic,
9732+ "ushort" => ushort.to_dynamic,
96219733 "using" => using.to_dynamic,
96229734 "Utf8JsonReader" => utf8_json_reader.to_dynamic,
96239735 "Utf8JsonWriter" => utf8_json_writer.to_dynamic,
Mrustdefault / module_under_test.rs+68 −34
@@ -639,6 +639,8 @@ pub struct Obj2 {
639639
640640 pub from: From,
641641
642+ pub from_dict: FromDict,
643+
642644 pub from_json: FromJson,
643645
644646 pub func: Func,
@@ -651,8 +653,6 @@ pub struct Obj2 {
651653
652654 pub go: Go,
653655
654- pub goto: Goto,
655-
656656 #[serde(rename = "default")]
657657 pub obj2_default: Default,
658658
@@ -942,6 +942,11 @@ pub struct From {
942942 pub from: i64,
943943 }
944944
945+#[derive(Debug, Clone, Serialize, Deserialize)]
946+pub struct FromDict {
947+ pub from_dict: i64,
948+}
949+
945950 #[derive(Debug, Clone, Serialize, Deserialize)]
946951 pub struct FromJson {
947952 pub from_json: i64,
@@ -972,11 +977,6 @@ pub struct Go {
972977 pub go: i64,
973978 }
974979
975-#[derive(Debug, Clone, Serialize, Deserialize)]
976-pub struct Goto {
977- pub goto: i64,
978-}
979-
980980 #[derive(Debug, Clone, Serialize, Deserialize)]
981981 pub struct Default {
982982 #[serde(rename = "default")]
@@ -1036,6 +1036,8 @@ pub struct FalseClass {
10361036 pub struct Obj3 {
10371037 pub dummy: i64,
10381038
1039+ pub goto: Goto,
1040+
10391041 pub guard: Guard,
10401042
10411043 #[serde(rename = "hasOwnProperty")]
@@ -1155,6 +1157,9 @@ pub struct Obj3 {
11551157 #[serde(rename = "MapEntry")]
11561158 pub map_entry: MapEntry,
11571159
1160+ #[serde(rename = "MarshalJSON")]
1161+ pub marshal_json: MarshalJson,
1162+
11581163 pub metadata_property_handling: MetadataPropertyHandling,
11591164
11601165 pub module: Module,
@@ -1176,8 +1181,6 @@ pub struct Obj3 {
11761181 #[serde(rename = "NO")]
11771182 pub no: No,
11781183
1179- pub noexcept: Noexcept,
1180-
11811184 #[serde(rename = "if")]
11821185 pub obj3_if: If,
11831186
@@ -1188,6 +1191,11 @@ pub struct Obj3 {
11881191 pub obj3_let: Let,
11891192 }
11901193
1194+#[derive(Debug, Clone, Serialize, Deserialize)]
1195+pub struct Goto {
1196+ pub goto: i64,
1197+}
1198+
11911199 #[derive(Debug, Clone, Serialize, Deserialize)]
11921200 pub struct Guard {
11931201 pub guard: i64,
@@ -1462,6 +1470,13 @@ pub struct MapEntry {
14621470 pub map_entry: i64,
14631471 }
14641472
1473+#[derive(Debug, Clone, Serialize, Deserialize)]
1474+#[serde(rename_all = "PascalCase")]
1475+pub struct MarshalJson {
1476+ #[serde(rename = "MarshalJSON")]
1477+ pub marshal_json: i64,
1478+}
1479+
14651480 #[derive(Debug, Clone, Serialize, Deserialize)]
14661481 pub struct MetadataPropertyHandling {
14671482 pub metadata_property_handling: i64,
@@ -1513,11 +1528,6 @@ pub struct No {
15131528 pub no: i64,
15141529 }
15151530
1516-#[derive(Debug, Clone, Serialize, Deserialize)]
1517-pub struct Noexcept {
1518- pub noexcept: i64,
1519-}
1520-
15211531 #[derive(Debug, Clone, Serialize, Deserialize)]
15221532 pub struct If {
15231533 #[serde(rename = "if")]
@@ -1543,6 +1553,8 @@ pub struct Obj4 {
15431553 #[serde(rename = "noSuchMethod")]
15441554 pub no_such_method: NoSuchMethod,
15451555
1556+ pub noexcept: Noexcept,
1557+
15461558 pub nonatomic: Nonatomic,
15471559
15481560 #[serde(rename = "None")]
@@ -1683,8 +1695,6 @@ pub struct Obj4 {
16831695
16841696 #[serde(rename = "SEL")]
16851697 pub sel: Sel,
1686-
1687- pub select: Select,
16881698 }
16891699
16901700 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -1693,6 +1703,11 @@ pub struct NoSuchMethod {
16931703 pub no_such_method: i64,
16941704 }
16951705
1706+#[derive(Debug, Clone, Serialize, Deserialize)]
1707+pub struct Noexcept {
1708+ pub noexcept: i64,
1709+}
1710+
16961711 #[derive(Debug, Clone, Serialize, Deserialize)]
16971712 pub struct Nonatomic {
16981713 pub nonatomic: i64,
@@ -2020,11 +2035,6 @@ pub struct Sel {
20202035 pub sel: i64,
20212036 }
20222037
2023-#[derive(Debug, Clone, Serialize, Deserialize)]
2024-pub struct Select {
2025- pub select: i64,
2026-}
2027-
20282038 #[derive(Debug, Clone, Serialize, Deserialize)]
20292039 pub struct Obj5 {
20302040 pub dummy: i64,
@@ -2074,6 +2084,8 @@ pub struct Obj5 {
20742084 #[serde(rename = "type")]
20752085 pub purple_type: TypeClass,
20762086
2087+ pub select: Select,
2088+
20772089 #[serde(rename = "Sendable")]
20782090 pub sendable: Sendable,
20792091
@@ -2150,6 +2162,8 @@ pub struct Obj5 {
21502162 #[serde(rename = "TimeZone")]
21512163 pub time_zone: TimeZone,
21522164
2165+ pub to_dict: ToDict,
2166+
21532167 pub to_json: ToJson,
21542168
21552169 #[serde(rename = "toString")]
@@ -2177,14 +2191,13 @@ pub struct Obj5 {
21772191
21782192 pub undefined: Undefined,
21792193
2180- pub unowned: Unowned,
2194+ #[serde(rename = "UnmarshalJSON")]
2195+ pub unmarshal_json: UnmarshalJson,
21812196
2182- pub unsigned: Unsigned,
2197+ pub unowned: Unowned,
21832198
21842199 #[serde(rename = "UseSerializers")]
21852200 pub use_serializers: UseSerializers,
2186-
2187- pub ushort: Ushort,
21882201 }
21892202
21902203 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -2280,6 +2293,11 @@ pub struct TypeClass {
22802293 pub type_type: i64,
22812294 }
22822295
2296+#[derive(Debug, Clone, Serialize, Deserialize)]
2297+pub struct Select {
2298+ pub select: i64,
2299+}
2300+
22832301 #[derive(Debug, Clone, Serialize, Deserialize)]
22842302 #[serde(rename_all = "PascalCase")]
22852303 pub struct Sendable {
@@ -2452,6 +2470,11 @@ pub struct TimeZone {
24522470 pub time_zone: i64,
24532471 }
24542472
2473+#[derive(Debug, Clone, Serialize, Deserialize)]
2474+pub struct ToDict {
2475+ pub to_dict: i64,
2476+}
2477+
24552478 #[derive(Debug, Clone, Serialize, Deserialize)]
24562479 pub struct ToJson {
24572480 pub to_json: i64,
@@ -2519,13 +2542,15 @@ pub struct Undefined {
25192542 }
25202543
25212544 #[derive(Debug, Clone, Serialize, Deserialize)]
2522-pub struct Unowned {
2523- pub unowned: i64,
2545+#[serde(rename_all = "PascalCase")]
2546+pub struct UnmarshalJson {
2547+ #[serde(rename = "UnmarshalJSON")]
2548+ pub unmarshal_json: i64,
25242549 }
25252550
25262551 #[derive(Debug, Clone, Serialize, Deserialize)]
2527-pub struct Unsigned {
2528- pub unsigned: i64,
2552+pub struct Unowned {
2553+ pub unowned: i64,
25292554 }
25302555
25312556 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -2534,11 +2559,6 @@ pub struct UseSerializers {
25342559 pub use_serializers: i64,
25352560 }
25362561
2537-#[derive(Debug, Clone, Serialize, Deserialize)]
2538-pub struct Ushort {
2539- pub ushort: i64,
2540-}
2541-
25422562 #[derive(Debug, Clone, Serialize, Deserialize)]
25432563 pub struct Obj6 {
25442564 pub dummy: i64,
@@ -2555,6 +2575,10 @@ pub struct Obj6 {
25552575 #[serde(rename = "yield")]
25562576 pub obj6_yield: Yield,
25572577
2578+ pub unsigned: Unsigned,
2579+
2580+ pub ushort: Ushort,
2581+
25582582 pub using: Using,
25592583
25602584 #[serde(rename = "Utf8JsonReader")]
@@ -2613,6 +2637,16 @@ pub struct Yield {
26132637 pub yield_yield: i64,
26142638 }
26152639
2640+#[derive(Debug, Clone, Serialize, Deserialize)]
2641+pub struct Unsigned {
2642+ pub unsigned: i64,
2643+}
2644+
2645+#[derive(Debug, Clone, Serialize, Deserialize)]
2646+pub struct Ushort {
2647+ pub ushort: i64,
2648+}
2649+
26162650 #[derive(Debug, Clone, Serialize, Deserialize)]
26172651 pub struct Using {
26182652 pub using: i64,
Mscala3-upickledefault / TopLevel.scala+47 −27
@@ -464,13 +464,13 @@ case class Obj2 (
464464 val FormatException : FormatException,
465465 val friend : Friend,
466466 val from : From,
467+ val from_dict : FromDict,
467468 val from_json : FromJSON,
468469 val func : Func,
469470 val function : Function,
470471 val get : Get,
471472 val global : Global,
472473 val go : Go,
473- val goto : Goto,
474474 val `def` : Def,
475475 val `do` : Do,
476476 val `else` : Else,
@@ -684,6 +684,10 @@ case class From (
684684 val from : Long
685685 ) derives OptionPickler.ReadWriter
686686
687+case class FromDict (
688+ val from_dict : Long
689+) derives OptionPickler.ReadWriter
690+
687691 case class FromJSON (
688692 val from_json : Long
689693 ) derives OptionPickler.ReadWriter
@@ -708,10 +712,6 @@ case class Go (
708712 val go : Long
709713 ) derives OptionPickler.ReadWriter
710714
711-case class Goto (
712- val goto : Long
713-) derives OptionPickler.ReadWriter
714-
715715 case class Def (
716716 val `def` : Long
717717 ) derives OptionPickler.ReadWriter
@@ -758,6 +758,7 @@ case class FalseClass (
758758
759759 case class Obj3 (
760760 val dummy : Long,
761+ val goto : Goto,
761762 val guard : Guard,
762763 val hasOwnProperty : HasOwnProperty,
763764 @upickle.implicits.key("hashCode")
@@ -808,6 +809,7 @@ case class Obj3 (
808809 val long : LongClass,
809810 val map : MapClass,
810811 val MapEntry : MapEntry,
812+ val MarshalJSON : MarshalJSON,
811813 val metadata_property_handling : MetadataPropertyHandling,
812814 val module : Module,
813815 val mutable : Mutable,
@@ -817,7 +819,6 @@ case class Obj3 (
817819 val newtonsoft : Newtonsoft,
818820 val nil : Nil,
819821 val NO : No,
820- val noexcept : Noexcept,
821822 val `if` : If,
822823 val `implicit` : Implicit,
823824 val `import` : Import,
@@ -825,6 +826,10 @@ case class Obj3 (
825826 val `new` : New
826827 ) derives OptionPickler.ReadWriter
827828
829+case class Goto (
830+ val goto : Long
831+) derives OptionPickler.ReadWriter
832+
828833 case class Guard (
829834 val guard : Long
830835 ) derives OptionPickler.ReadWriter
@@ -1022,6 +1027,10 @@ case class MapEntry (
10221027 val MapEntry : Long
10231028 ) derives OptionPickler.ReadWriter
10241029
1030+case class MarshalJSON (
1031+ val MarshalJSON : Long
1032+) derives OptionPickler.ReadWriter
1033+
10251034 case class MetadataPropertyHandling (
10261035 val metadata_property_handling : Long
10271036 ) derives OptionPickler.ReadWriter
@@ -1058,10 +1067,6 @@ case class No (
10581067 val NO : Long
10591068 ) derives OptionPickler.ReadWriter
10601069
1061-case class Noexcept (
1062- val noexcept : Long
1063-) derives OptionPickler.ReadWriter
1064-
10651070 case class If (
10661071 val `if` : Long
10671072 ) derives OptionPickler.ReadWriter
@@ -1085,6 +1090,7 @@ case class New (
10851090 case class Obj4 (
10861091 val dummy : Long,
10871092 val noSuchMethod : NoSuchMethod,
1093+ val noexcept : Noexcept,
10881094 val nonatomic : Nonatomic,
10891095 val None : NoneClass,
10901096 val nonlocal : Nonlocal,
@@ -1146,14 +1152,17 @@ case class Obj4 (
11461152 val runtimeType : RuntimeType,
11471153 val s : S,
11481154 val sbyte : Sbyte,
1149- val SEL : Sel,
1150- val select : Select
1155+ val SEL : Sel
11511156 ) derives OptionPickler.ReadWriter
11521157
11531158 case class NoSuchMethod (
11541159 val noSuchMethod : Long
11551160 ) derives OptionPickler.ReadWriter
11561161
1162+case class Noexcept (
1163+ val noexcept : Long
1164+) derives OptionPickler.ReadWriter
1165+
11571166 case class Nonatomic (
11581167 val nonatomic : Long
11591168 ) derives OptionPickler.ReadWriter
@@ -1402,10 +1411,6 @@ case class Sel (
14021411 val SEL : Long
14031412 ) derives OptionPickler.ReadWriter
14041413
1405-case class Select (
1406- val select : Long
1407-) derives OptionPickler.ReadWriter
1408-
14091414 case class Obj5 (
14101415 val dummy : Long,
14111416 val KSerializer : KSerializer,
@@ -1420,6 +1425,7 @@ case class Obj5 (
14201425 val PrimitiveKind : PrimitiveKind,
14211426 val `true` : TrueClass,
14221427 val `type` : TypeClass,
1428+ val select : Select,
14231429 val Self : Self,
14241430 val Sendable : Sendable,
14251431 val SerialDescriptor : SerialDescriptor,
@@ -1454,6 +1460,7 @@ case class Obj5 (
14541460 val TimeOnly : TimeOnly,
14551461 val TimeOnlyConverter : TimeOnlyConverter,
14561462 val TimeZone : TimeZone,
1463+ val to_dict : ToDict,
14571464 val to_json : ToJSON,
14581465 @upickle.implicits.key("toString")
14591466 val toStringValue : ToString,
@@ -1469,11 +1476,10 @@ case class Obj5 (
14691476 val unchecked : Unchecked,
14701477 val undefined : Undefined,
14711478 val union : Union,
1479+ val UnmarshalJSON : UnmarshalJSON,
14721480 val unowned : Unowned,
14731481 val unsafe : Unsafe,
1474- val unsigned : Unsigned,
1475- val UseSerializers : UseSerializers,
1476- val ushort : Ushort
1482+ val UseSerializers : UseSerializers
14771483 ) derives OptionPickler.ReadWriter
14781484
14791485 case class KSerializer (
@@ -1524,6 +1530,10 @@ case class TypeClass (
15241530 val `type` : Long
15251531 ) derives OptionPickler.ReadWriter
15261532
1533+case class Select (
1534+ val select : Long
1535+) derives OptionPickler.ReadWriter
1536+
15271537 case class Self (
15281538 val Self : Long
15291539 ) derives OptionPickler.ReadWriter
@@ -1657,6 +1667,10 @@ case class TimeZone (
16571667 val TimeZone : Long
16581668 ) derives OptionPickler.ReadWriter
16591669
1670+case class ToDict (
1671+ val to_dict : Long
1672+) derives OptionPickler.ReadWriter
1673+
16601674 case class ToJSON (
16611675 val to_json : Long
16621676 ) derives OptionPickler.ReadWriter
@@ -1714,6 +1728,10 @@ case class Union (
17141728 val union : Long
17151729 ) derives OptionPickler.ReadWriter
17161730
1731+case class UnmarshalJSON (
1732+ val UnmarshalJSON : Long
1733+) derives OptionPickler.ReadWriter
1734+
17171735 case class Unowned (
17181736 val unowned : Long
17191737 ) derives OptionPickler.ReadWriter
@@ -1722,24 +1740,18 @@ case class Unsafe (
17221740 val unsafe : Long
17231741 ) derives OptionPickler.ReadWriter
17241742
1725-case class Unsigned (
1726- val unsigned : Long
1727-) derives OptionPickler.ReadWriter
1728-
17291743 case class UseSerializers (
17301744 val UseSerializers : Long
17311745 ) derives OptionPickler.ReadWriter
17321746
1733-case class Ushort (
1734- val ushort : Long
1735-) derives OptionPickler.ReadWriter
1736-
17371747 case class Obj6 (
17381748 val dummy : Long,
17391749 val `var` : Var,
17401750 val `while` : While,
17411751 val `with` : With,
17421752 val `yield` : Yield,
1753+ val unsigned : Unsigned,
1754+ val ushort : Ushort,
17431755 val using : Using,
17441756 val Utf8JsonReader : Utf8JSONReader,
17451757 val Utf8JsonWriter : Utf8JSONWriter,
@@ -1772,6 +1784,14 @@ case class Yield (
17721784 val `yield` : Long
17731785 ) derives OptionPickler.ReadWriter
17741786
1787+case class Unsigned (
1788+ val unsigned : Long
1789+) derives OptionPickler.ReadWriter
1790+
1791+case class Ushort (
1792+ val ushort : Long
1793+) derives OptionPickler.ReadWriter
1794+
17751795 case class Using (
17761796 val using : Long
17771797 ) derives OptionPickler.ReadWriter
Mscala3default / TopLevel.scala+47 −27
@@ -417,13 +417,13 @@ case class Obj2 (
417417 val FormatException : FormatException,
418418 val friend : Friend,
419419 val from : From,
420+ val from_dict : FromDict,
420421 val from_json : FromJSON,
421422 val func : Func,
422423 val function : Function,
423424 val get : Get,
424425 val global : Global,
425426 val go : Go,
426- val goto : Goto,
427427 val `def` : Def,
428428 val `do` : Do,
429429 val `else` : Else,
@@ -635,6 +635,10 @@ case class From (
635635 val from : Long
636636 ) derives Encoder.AsObject, Decoder
637637
638+case class FromDict (
639+ val from_dict : Long
640+) derives Encoder.AsObject, Decoder
641+
638642 case class FromJSON (
639643 val from_json : Long
640644 ) derives Encoder.AsObject, Decoder
@@ -659,10 +663,6 @@ case class Go (
659663 val go : Long
660664 ) derives Encoder.AsObject, Decoder
661665
662-case class Goto (
663- val goto : Long
664-) derives Encoder.AsObject, Decoder
665-
666666 case class Def (
667667 val `def` : Long
668668 ) derives Encoder.AsObject, Decoder
@@ -709,6 +709,7 @@ case class FalseClass (
709709
710710 case class Obj3 (
711711 val dummy : Long,
712+ val goto : Goto,
712713 val guard : Guard,
713714 val hasOwnProperty : HasOwnProperty,
714715 val hashCodeValue : HashCode,
@@ -758,6 +759,7 @@ case class Obj3 (
758759 val long : LongClass,
759760 val map : MapClass,
760761 val MapEntry : MapEntry,
762+ val MarshalJSON : MarshalJSON,
761763 val metadata_property_handling : MetadataPropertyHandling,
762764 val module : Module,
763765 val mutable : Mutable,
@@ -767,7 +769,6 @@ case class Obj3 (
767769 val newtonsoft : Newtonsoft,
768770 val nil : Nil,
769771 val NO : No,
770- val noexcept : Noexcept,
771772 val `if` : If,
772773 val `implicit` : Implicit,
773774 val `import` : Import,
@@ -784,6 +785,10 @@ object Obj3:
784785 )
785786 given io.circe.Codec.AsObject[Obj3] = io.circe.derivation.ConfiguredCodec.derived
786787
788+case class Goto (
789+ val goto : Long
790+) derives Encoder.AsObject, Decoder
791+
787792 case class Guard (
788793 val guard : Long
789794 ) derives Encoder.AsObject, Decoder
@@ -989,6 +994,10 @@ case class MapEntry (
989994 val MapEntry : Long
990995 ) derives Encoder.AsObject, Decoder
991996
997+case class MarshalJSON (
998+ val MarshalJSON : Long
999+) derives Encoder.AsObject, Decoder
1000+
9921001 case class MetadataPropertyHandling (
9931002 val metadata_property_handling : Long
9941003 ) derives Encoder.AsObject, Decoder
@@ -1025,10 +1034,6 @@ case class No (
10251034 val NO : Long
10261035 ) derives Encoder.AsObject, Decoder
10271036
1028-case class Noexcept (
1029- val noexcept : Long
1030-) derives Encoder.AsObject, Decoder
1031-
10321037 case class If (
10331038 val `if` : Long
10341039 ) derives Encoder.AsObject, Decoder
@@ -1052,6 +1057,7 @@ case class New (
10521057 case class Obj4 (
10531058 val dummy : Long,
10541059 val noSuchMethod : NoSuchMethod,
1060+ val noexcept : Noexcept,
10551061 val nonatomic : Nonatomic,
10561062 val None : NoneClass,
10571063 val nonlocal : Nonlocal,
@@ -1113,14 +1119,17 @@ case class Obj4 (
11131119 val runtimeType : RuntimeType,
11141120 val s : S,
11151121 val sbyte : Sbyte,
1116- val SEL : Sel,
1117- val select : Select
1122+ val SEL : Sel
11181123 ) derives Encoder.AsObject, Decoder
11191124
11201125 case class NoSuchMethod (
11211126 val noSuchMethod : Long
11221127 ) derives Encoder.AsObject, Decoder
11231128
1129+case class Noexcept (
1130+ val noexcept : Long
1131+) derives Encoder.AsObject, Decoder
1132+
11241133 case class Nonatomic (
11251134 val nonatomic : Long
11261135 ) derives Encoder.AsObject, Decoder
@@ -1369,10 +1378,6 @@ case class Sel (
13691378 val SEL : Long
13701379 ) derives Encoder.AsObject, Decoder
13711380
1372-case class Select (
1373- val select : Long
1374-) derives Encoder.AsObject, Decoder
1375-
13761381 case class Obj5 (
13771382 val dummy : Long,
13781383 val KSerializer : KSerializer,
@@ -1387,6 +1392,7 @@ case class Obj5 (
13871392 val PrimitiveKind : PrimitiveKind,
13881393 val `true` : TrueClass,
13891394 val `type` : TypeClass,
1395+ val select : Select,
13901396 val Self : Self,
13911397 val Sendable : Sendable,
13921398 val SerialDescriptor : SerialDescriptor,
@@ -1420,6 +1426,7 @@ case class Obj5 (
14201426 val TimeOnly : TimeOnly,
14211427 val TimeOnlyConverter : TimeOnlyConverter,
14221428 val TimeZone : TimeZone,
1429+ val to_dict : ToDict,
14231430 val to_json : ToJSON,
14241431 val toStringValue : ToString,
14251432 val top_level : TopLevelClass,
@@ -1434,11 +1441,10 @@ case class Obj5 (
14341441 val unchecked : Unchecked,
14351442 val undefined : Undefined,
14361443 val union : Union,
1444+ val UnmarshalJSON : UnmarshalJSON,
14371445 val unowned : Unowned,
14381446 val unsafe : Unsafe,
1439- val unsigned : Unsigned,
1440- val UseSerializers : UseSerializers,
1441- val ushort : Ushort
1447+ val UseSerializers : UseSerializers
14421448 )
14431449
14441450 object Obj5:
@@ -1499,6 +1505,10 @@ case class TypeClass (
14991505 val `type` : Long
15001506 ) derives Encoder.AsObject, Decoder
15011507
1508+case class Select (
1509+ val select : Long
1510+) derives Encoder.AsObject, Decoder
1511+
15021512 case class Self (
15031513 val Self : Long
15041514 ) derives Encoder.AsObject, Decoder
@@ -1640,6 +1650,10 @@ case class TimeZone (
16401650 val TimeZone : Long
16411651 ) derives Encoder.AsObject, Decoder
16421652
1653+case class ToDict (
1654+ val to_dict : Long
1655+) derives Encoder.AsObject, Decoder
1656+
16431657 case class ToJSON (
16441658 val to_json : Long
16451659 ) derives Encoder.AsObject, Decoder
@@ -1705,6 +1719,10 @@ case class Union (
17051719 val union : Long
17061720 ) derives Encoder.AsObject, Decoder
17071721
1722+case class UnmarshalJSON (
1723+ val UnmarshalJSON : Long
1724+) derives Encoder.AsObject, Decoder
1725+
17081726 case class Unowned (
17091727 val unowned : Long
17101728 ) derives Encoder.AsObject, Decoder
@@ -1713,24 +1731,18 @@ case class Unsafe (
17131731 val unsafe : Long
17141732 ) derives Encoder.AsObject, Decoder
17151733
1716-case class Unsigned (
1717- val unsigned : Long
1718-) derives Encoder.AsObject, Decoder
1719-
17201734 case class UseSerializers (
17211735 val UseSerializers : Long
17221736 ) derives Encoder.AsObject, Decoder
17231737
1724-case class Ushort (
1725- val ushort : Long
1726-) derives Encoder.AsObject, Decoder
1727-
17281738 case class Obj6 (
17291739 val dummy : Long,
17301740 val `var` : Var,
17311741 val `while` : While,
17321742 val `with` : With,
17331743 val `yield` : Yield,
1744+ val unsigned : Unsigned,
1745+ val ushort : Ushort,
17341746 val using : Using,
17351747 val Utf8JsonReader : Utf8JSONReader,
17361748 val Utf8JsonWriter : Utf8JSONWriter,
@@ -1763,6 +1775,14 @@ case class Yield (
17631775 val `yield` : Long
17641776 ) derives Encoder.AsObject, Decoder
17651777
1778+case class Unsigned (
1779+ val unsigned : Long
1780+) derives Encoder.AsObject, Decoder
1781+
1782+case class Ushort (
1783+ val ushort : Long
1784+) derives Encoder.AsObject, Decoder
1785+
17661786 case class Using (
17671787 val using : Long
17681788 ) derives Encoder.AsObject, Decoder
Mswiftdefault / quicktype.swift+434 −242
@@ -3234,11 +3234,11 @@ struct Obj2: Codable {
32343234 let formatException: FormatException
32353235 let friend: Friend
32363236 let from: From
3237+ let fromDict: FromDict
32373238 let fromJSON: FromJSON
32383239 let function: Function
32393240 let global: Global
32403241 let go: Go
3241- let goto: Goto
32423242 let obj2Default: Default
32433243 let obj2Defer: Defer
32443244 let obj2Deinit: Deinit
@@ -3301,11 +3301,11 @@ struct Obj2: Codable {
33013301 case formatException = "FormatException"
33023302 case friend = "friend"
33033303 case from = "from"
3304+ case fromDict = "from_dict"
33043305 case fromJSON = "from_json"
33053306 case function = "function"
33063307 case global = "global"
33073308 case go = "go"
3308- case goto = "goto"
33093309 case obj2Default = "default"
33103310 case obj2Defer = "defer"
33113311 case obj2Deinit = "deinit"
@@ -3388,11 +3388,11 @@ extension Obj2 {
33883388 formatException: FormatException? = nil,
33893389 friend: Friend? = nil,
33903390 from: From? = nil,
3391+ fromDict: FromDict? = nil,
33913392 fromJSON: FromJSON? = nil,
33923393 function: Function? = nil,
33933394 global: Global? = nil,
33943395 go: Go? = nil,
3395- goto: Goto? = nil,
33963396 obj2Default: Default? = nil,
33973397 obj2Defer: Defer? = nil,
33983398 obj2Deinit: Deinit? = nil,
@@ -3455,11 +3455,11 @@ extension Obj2 {
34553455 formatException: formatException ?? self.formatException,
34563456 friend: friend ?? self.friend,
34573457 from: from ?? self.from,
3458+ fromDict: fromDict ?? self.fromDict,
34583459 fromJSON: fromJSON ?? self.fromJSON,
34593460 function: function ?? self.function,
34603461 global: global ?? self.global,
34613462 go: go ?? self.go,
3462- goto: goto ?? self.goto,
34633463 obj2Default: obj2Default ?? self.obj2Default,
34643464 obj2Defer: obj2Defer ?? self.obj2Defer,
34653465 obj2Deinit: obj2Deinit ?? self.obj2Deinit,
@@ -5342,6 +5342,50 @@ extension From {
53425342 }
53435343 }
53445344
5345+// MARK: - FromDict
5346+struct FromDict: Codable {
5347+ let fromDict: Int
5348+
5349+ enum CodingKeys: String, CodingKey {
5350+ case fromDict = "from_dict"
5351+ }
5352+}
5353+
5354+// MARK: FromDict convenience initializers and mutators
5355+
5356+extension FromDict {
5357+ init(data: Data) throws {
5358+ self = try newJSONDecoder().decode(FromDict.self, from: data)
5359+ }
5360+
5361+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
5362+ guard let data = json.data(using: encoding) else {
5363+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
5364+ }
5365+ try self.init(data: data)
5366+ }
5367+
5368+ init(fromURL url: URL) throws {
5369+ try self.init(data: try Data(contentsOf: url))
5370+ }
5371+
5372+ func with(
5373+ fromDict: Int? = nil
5374+ ) -> FromDict {
5375+ return FromDict(
5376+ fromDict: fromDict ?? self.fromDict
5377+ )
5378+ }
5379+
5380+ func jsonData() throws -> Data {
5381+ return try newJSONEncoder().encode(self)
5382+ }
5383+
5384+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
5385+ return String(data: try self.jsonData(), encoding: encoding)
5386+ }
5387+}
5388+
53455389 // MARK: - FromJSON
53465390 struct FromJSON: Codable {
53475391 let fromJSON: Int
@@ -5518,50 +5562,6 @@ extension Go {
55185562 }
55195563 }
55205564
5521-// MARK: - Goto
5522-struct Goto: Codable {
5523- let goto: Int
5524-
5525- enum CodingKeys: String, CodingKey {
5526- case goto = "goto"
5527- }
5528-}
5529-
5530-// MARK: Goto convenience initializers and mutators
5531-
5532-extension Goto {
5533- init(data: Data) throws {
5534- self = try newJSONDecoder().decode(Goto.self, from: data)
5535- }
5536-
5537- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
5538- guard let data = json.data(using: encoding) else {
5539- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
5540- }
5541- try self.init(data: data)
5542- }
5543-
5544- init(fromURL url: URL) throws {
5545- try self.init(data: try Data(contentsOf: url))
5546- }
5547-
5548- func with(
5549- goto: Int? = nil
5550- ) -> Goto {
5551- return Goto(
5552- goto: goto ?? self.goto
5553- )
5554- }
5555-
5556- func jsonData() throws -> Data {
5557- return try newJSONEncoder().encode(self)
5558- }
5559-
5560- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
5561- return String(data: try self.jsonData(), encoding: encoding)
5562- }
5563-}
5564-
55655565 // MARK: - Default
55665566 struct Default: Codable {
55675567 let defaultDefault: Int
@@ -6313,6 +6313,7 @@ extension FalseClass {
63136313 // MARK: - Obj3
63146314 struct Obj3: Codable {
63156315 let dummy: Int
6316+ let goto: Goto
63166317 let hasOwnProperty: HasOwnProperty
63176318 let hashCode: HashCode
63186319 let hashable: HashableClass
@@ -6352,6 +6353,7 @@ struct Obj3: Codable {
63526353 let long: Long
63536354 let map: Map
63546355 let mapEntry: MapEntry
6356+ let marshalJSON: MarshalJSON
63556357 let metadataPropertyHandling: MetadataPropertyHandling
63566358 let module: Module
63576359 let mutable: Mutable
@@ -6360,7 +6362,6 @@ struct Obj3: Codable {
63606362 let new: New
63616363 let newtonsoft: Newtonsoft
63626364 let no: No
6363- let noexcept: Noexcept
63646365 let obj3Guard: Guard
63656366 let obj3If: If
63666367 let obj3Import: Import
@@ -6380,6 +6381,7 @@ struct Obj3: Codable {
63806381
63816382 enum CodingKeys: String, CodingKey {
63826383 case dummy = "dummy"
6384+ case goto = "goto"
63836385 case hasOwnProperty = "hasOwnProperty"
63846386 case hashCode = "hashCode"
63856387 case hashable = "Hashable"
@@ -6419,6 +6421,7 @@ struct Obj3: Codable {
64196421 case long = "long"
64206422 case map = "map"
64216423 case mapEntry = "MapEntry"
6424+ case marshalJSON = "MarshalJSON"
64226425 case metadataPropertyHandling = "metadata_property_handling"
64236426 case module = "module"
64246427 case mutable = "mutable"
@@ -6427,7 +6430,6 @@ struct Obj3: Codable {
64276430 case new = "new"
64286431 case newtonsoft = "newtonsoft"
64296432 case no = "NO"
6430- case noexcept = "noexcept"
64316433 case obj3Guard = "guard"
64326434 case obj3If = "if"
64336435 case obj3Import = "import"
@@ -6467,6 +6469,7 @@ extension Obj3 {
64676469
64686470 func with(
64696471 dummy: Int? = nil,
6472+ goto: Goto? = nil,
64706473 hasOwnProperty: HasOwnProperty? = nil,
64716474 hashCode: HashCode? = nil,
64726475 hashable: HashableClass? = nil,
@@ -6506,6 +6509,7 @@ extension Obj3 {
65066509 long: Long? = nil,
65076510 map: Map? = nil,
65086511 mapEntry: MapEntry? = nil,
6512+ marshalJSON: MarshalJSON? = nil,
65096513 metadataPropertyHandling: MetadataPropertyHandling? = nil,
65106514 module: Module? = nil,
65116515 mutable: Mutable? = nil,
@@ -6514,7 +6518,6 @@ extension Obj3 {
65146518 new: New? = nil,
65156519 newtonsoft: Newtonsoft? = nil,
65166520 no: No? = nil,
6517- noexcept: Noexcept? = nil,
65186521 obj3Guard: Guard? = nil,
65196522 obj3If: If? = nil,
65206523 obj3Import: Import? = nil,
@@ -6534,6 +6537,7 @@ extension Obj3 {
65346537 ) -> Obj3 {
65356538 return Obj3(
65366539 dummy: dummy ?? self.dummy,
6540+ goto: goto ?? self.goto,
65376541 hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty,
65386542 hashCode: hashCode ?? self.hashCode,
65396543 hashable: hashable ?? self.hashable,
@@ -6573,6 +6577,7 @@ extension Obj3 {
65736577 long: long ?? self.long,
65746578 map: map ?? self.map,
65756579 mapEntry: mapEntry ?? self.mapEntry,
6580+ marshalJSON: marshalJSON ?? self.marshalJSON,
65766581 metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling,
65776582 module: module ?? self.module,
65786583 mutable: mutable ?? self.mutable,
@@ -6581,7 +6586,6 @@ extension Obj3 {
65816586 new: new ?? self.new,
65826587 newtonsoft: newtonsoft ?? self.newtonsoft,
65836588 no: no ?? self.no,
6584- noexcept: noexcept ?? self.noexcept,
65856589 obj3Guard: obj3Guard ?? self.obj3Guard,
65866590 obj3If: obj3If ?? self.obj3If,
65876591 obj3Import: obj3Import ?? self.obj3Import,
@@ -6610,6 +6614,50 @@ extension Obj3 {
66106614 }
66116615 }
66126616
6617+// MARK: - Goto
6618+struct Goto: Codable {
6619+ let goto: Int
6620+
6621+ enum CodingKeys: String, CodingKey {
6622+ case goto = "goto"
6623+ }
6624+}
6625+
6626+// MARK: Goto convenience initializers and mutators
6627+
6628+extension Goto {
6629+ init(data: Data) throws {
6630+ self = try newJSONDecoder().decode(Goto.self, from: data)
6631+ }
6632+
6633+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
6634+ guard let data = json.data(using: encoding) else {
6635+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
6636+ }
6637+ try self.init(data: data)
6638+ }
6639+
6640+ init(fromURL url: URL) throws {
6641+ try self.init(data: try Data(contentsOf: url))
6642+ }
6643+
6644+ func with(
6645+ goto: Int? = nil
6646+ ) -> Goto {
6647+ return Goto(
6648+ goto: goto ?? self.goto
6649+ )
6650+ }
6651+
6652+ func jsonData() throws -> Data {
6653+ return try newJSONEncoder().encode(self)
6654+ }
6655+
6656+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
6657+ return String(data: try self.jsonData(), encoding: encoding)
6658+ }
6659+}
6660+
66136661 // MARK: - HasOwnProperty
66146662 struct HasOwnProperty: Codable {
66156663 let hasOwnProperty: Int
@@ -8326,6 +8374,50 @@ extension MapEntry {
83268374 }
83278375 }
83288376
8377+// MARK: - MarshalJSON
8378+struct MarshalJSON: Codable {
8379+ let marshalJSON: Int
8380+
8381+ enum CodingKeys: String, CodingKey {
8382+ case marshalJSON = "MarshalJSON"
8383+ }
8384+}
8385+
8386+// MARK: MarshalJSON convenience initializers and mutators
8387+
8388+extension MarshalJSON {
8389+ init(data: Data) throws {
8390+ self = try newJSONDecoder().decode(MarshalJSON.self, from: data)
8391+ }
8392+
8393+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8394+ guard let data = json.data(using: encoding) else {
8395+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8396+ }
8397+ try self.init(data: data)
8398+ }
8399+
8400+ init(fromURL url: URL) throws {
8401+ try self.init(data: try Data(contentsOf: url))
8402+ }
8403+
8404+ func with(
8405+ marshalJSON: Int? = nil
8406+ ) -> MarshalJSON {
8407+ return MarshalJSON(
8408+ marshalJSON: marshalJSON ?? self.marshalJSON
8409+ )
8410+ }
8411+
8412+ func jsonData() throws -> Data {
8413+ return try newJSONEncoder().encode(self)
8414+ }
8415+
8416+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8417+ return String(data: try self.jsonData(), encoding: encoding)
8418+ }
8419+}
8420+
83298421 // MARK: - MetadataPropertyHandling
83308422 struct MetadataPropertyHandling: Codable {
83318423 let metadataPropertyHandling: Int
@@ -8678,50 +8770,6 @@ extension No {
86788770 }
86798771 }
86808772
8681-// MARK: - Noexcept
8682-struct Noexcept: Codable {
8683- let noexcept: Int
8684-
8685- enum CodingKeys: String, CodingKey {
8686- case noexcept = "noexcept"
8687- }
8688-}
8689-
8690-// MARK: Noexcept convenience initializers and mutators
8691-
8692-extension Noexcept {
8693- init(data: Data) throws {
8694- self = try newJSONDecoder().decode(Noexcept.self, from: data)
8695- }
8696-
8697- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8698- guard let data = json.data(using: encoding) else {
8699- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8700- }
8701- try self.init(data: data)
8702- }
8703-
8704- init(fromURL url: URL) throws {
8705- try self.init(data: try Data(contentsOf: url))
8706- }
8707-
8708- func with(
8709- noexcept: Int? = nil
8710- ) -> Noexcept {
8711- return Noexcept(
8712- noexcept: noexcept ?? self.noexcept
8713- )
8714- }
8715-
8716- func jsonData() throws -> Data {
8717- return try newJSONEncoder().encode(self)
8718- }
8719-
8720- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8721- return String(data: try self.jsonData(), encoding: encoding)
8722- }
8723-}
8724-
87258773 // MARK: - Guard
87268774 struct Guard: Codable {
87278775 let guardGuard: Int
@@ -9430,6 +9478,7 @@ extension Nil {
94309478 struct Obj4: Codable {
94319479 let dummy: Int
94329480 let noSuchMethod: NoSuchMethod
9481+ let noexcept: Noexcept
94339482 let nonatomic: Nonatomic
94349483 let none: None
94359484 let nonlocal: Nonlocal
@@ -9492,11 +9541,11 @@ struct Obj4: Codable {
94929541 let sbyte: Sbyte
94939542 let sealed: Sealed
94949543 let sel: Sel
9495- let select: Select
94969544
94979545 enum CodingKeys: String, CodingKey {
94989546 case dummy = "dummy"
94999547 case noSuchMethod = "noSuchMethod"
9548+ case noexcept = "noexcept"
95009549 case nonatomic = "nonatomic"
95019550 case none = "None"
95029551 case nonlocal = "nonlocal"
@@ -9559,7 +9608,6 @@ struct Obj4: Codable {
95599608 case sbyte = "sbyte"
95609609 case sealed = "sealed"
95619610 case sel = "SEL"
9562- case select = "select"
95639611 }
95649612 }
95659613
@@ -9584,6 +9632,7 @@ extension Obj4 {
95849632 func with(
95859633 dummy: Int? = nil,
95869634 noSuchMethod: NoSuchMethod? = nil,
9635+ noexcept: Noexcept? = nil,
95879636 nonatomic: Nonatomic? = nil,
95889637 none: None? = nil,
95899638 nonlocal: Nonlocal? = nil,
@@ -9645,12 +9694,12 @@ extension Obj4 {
96459694 s: S? = nil,
96469695 sbyte: Sbyte? = nil,
96479696 sealed: Sealed? = nil,
9648- sel: Sel? = nil,
9649- select: Select? = nil
9697+ sel: Sel? = nil
96509698 ) -> Obj4 {
96519699 return Obj4(
96529700 dummy: dummy ?? self.dummy,
96539701 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
9702+ noexcept: noexcept ?? self.noexcept,
96549703 nonatomic: nonatomic ?? self.nonatomic,
96559704 none: none ?? self.none,
96569705 nonlocal: nonlocal ?? self.nonlocal,
@@ -9712,8 +9761,7 @@ extension Obj4 {
97129761 s: s ?? self.s,
97139762 sbyte: sbyte ?? self.sbyte,
97149763 sealed: sealed ?? self.sealed,
9715- sel: sel ?? self.sel,
9716- select: select ?? self.select
9764+ sel: sel ?? self.sel
97179765 )
97189766 }
97199767
@@ -9770,20 +9818,20 @@ extension NoSuchMethod {
97709818 }
97719819 }
97729820
9773-// MARK: - Nonatomic
9774-struct Nonatomic: Codable {
9775- let nonatomic: Int
9821+// MARK: - Noexcept
9822+struct Noexcept: Codable {
9823+ let noexcept: Int
97769824
97779825 enum CodingKeys: String, CodingKey {
9778- case nonatomic = "nonatomic"
9826+ case noexcept = "noexcept"
97799827 }
97809828 }
97819829
9782-// MARK: Nonatomic convenience initializers and mutators
9830+// MARK: Noexcept convenience initializers and mutators
97839831
9784-extension Nonatomic {
9832+extension Noexcept {
97859833 init(data: Data) throws {
9786- self = try newJSONDecoder().decode(Nonatomic.self, from: data)
9834+ self = try newJSONDecoder().decode(Noexcept.self, from: data)
97879835 }
97889836
97899837 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -9798,10 +9846,10 @@ extension Nonatomic {
97989846 }
97999847
98009848 func with(
9801- nonatomic: Int? = nil
9802- ) -> Nonatomic {
9803- return Nonatomic(
9804- nonatomic: nonatomic ?? self.nonatomic
9849+ noexcept: Int? = nil
9850+ ) -> Noexcept {
9851+ return Noexcept(
9852+ noexcept: noexcept ?? self.noexcept
98059853 )
98069854 }
98079855
@@ -9814,20 +9862,20 @@ extension Nonatomic {
98149862 }
98159863 }
98169864
9817-// MARK: - None
9818-struct None: Codable {
9819- let none: Int
9865+// MARK: - Nonatomic
9866+struct Nonatomic: Codable {
9867+ let nonatomic: Int
98209868
98219869 enum CodingKeys: String, CodingKey {
9822- case none = "None"
9870+ case nonatomic = "nonatomic"
98239871 }
98249872 }
98259873
9826-// MARK: None convenience initializers and mutators
9874+// MARK: Nonatomic convenience initializers and mutators
98279875
9828-extension None {
9876+extension Nonatomic {
98299877 init(data: Data) throws {
9830- self = try newJSONDecoder().decode(None.self, from: data)
9878+ self = try newJSONDecoder().decode(Nonatomic.self, from: data)
98319879 }
98329880
98339881 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -9842,8 +9890,52 @@ extension None {
98429890 }
98439891
98449892 func with(
9845- none: Int? = nil
9846- ) -> None {
9893+ nonatomic: Int? = nil
9894+ ) -> Nonatomic {
9895+ return Nonatomic(
9896+ nonatomic: nonatomic ?? self.nonatomic
9897+ )
9898+ }
9899+
9900+ func jsonData() throws -> Data {
9901+ return try newJSONEncoder().encode(self)
9902+ }
9903+
9904+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9905+ return String(data: try self.jsonData(), encoding: encoding)
9906+ }
9907+}
9908+
9909+// MARK: - None
9910+struct None: Codable {
9911+ let none: Int
9912+
9913+ enum CodingKeys: String, CodingKey {
9914+ case none = "None"
9915+ }
9916+}
9917+
9918+// MARK: None convenience initializers and mutators
9919+
9920+extension None {
9921+ init(data: Data) throws {
9922+ self = try newJSONDecoder().decode(None.self, from: data)
9923+ }
9924+
9925+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9926+ guard let data = json.data(using: encoding) else {
9927+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9928+ }
9929+ try self.init(data: data)
9930+ }
9931+
9932+ init(fromURL url: URL) throws {
9933+ try self.init(data: try Data(contentsOf: url))
9934+ }
9935+
9936+ func with(
9937+ none: Int? = nil
9938+ ) -> None {
98479939 return None(
98489940 none: none ?? self.none
98499941 )
@@ -12498,50 +12590,6 @@ extension Sel {
1249812590 }
1249912591 }
1250012592
12501-// MARK: - Select
12502-struct Select: Codable {
12503- let select: Int
12504-
12505- enum CodingKeys: String, CodingKey {
12506- case select = "select"
12507- }
12508-}
12509-
12510-// MARK: Select convenience initializers and mutators
12511-
12512-extension Select {
12513- init(data: Data) throws {
12514- self = try newJSONDecoder().decode(Select.self, from: data)
12515- }
12516-
12517- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
12518- guard let data = json.data(using: encoding) else {
12519- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
12520- }
12521- try self.init(data: data)
12522- }
12523-
12524- init(fromURL url: URL) throws {
12525- try self.init(data: try Data(contentsOf: url))
12526- }
12527-
12528- func with(
12529- select: Int? = nil
12530- ) -> Select {
12531- return Select(
12532- select: select ?? self.select
12533- )
12534- }
12535-
12536- func jsonData() throws -> Data {
12537- return try newJSONEncoder().encode(self)
12538- }
12539-
12540- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
12541- return String(data: try self.jsonData(), encoding: encoding)
12542- }
12543-}
12544-
1254512593 // MARK: - Obj5
1254612594 struct Obj5: Codable {
1254712595 let dummy: Int
@@ -12563,6 +12611,7 @@ struct Obj5: Codable {
1256312611 let primitiveKind: PrimitiveKind
1256412612 let purpleSelf: Obj5Self
1256512613 let purpleTrue: TrueClass
12614+ let select: Select
1256612615 let sendable: Sendable
1256712616 let serialDescriptor: SerialDescriptor
1256812617 let serialName: SerialName
@@ -12591,6 +12640,7 @@ struct Obj5: Codable {
1259112640 let timeOnly: TimeOnly
1259212641 let timeOnlyConverter: TimeOnlyConverter
1259312642 let timeZone: TimeZoneClass
12643+ let toDict: ToDict
1259412644 let toJSON: ToJSON
1259512645 let toString: ToString
1259612646 let topLevel: TopLevelClass
@@ -12605,10 +12655,9 @@ struct Obj5: Codable {
1260512655 let unchecked: Unchecked
1260612656 let undefined: Undefined
1260712657 let union: Union
12658+ let unmarshalJSON: UnmarshalJSON
1260812659 let unsafe: Unsafe
12609- let unsigned: Unsigned
1261012660 let useSerializers: UseSerializers
12611- let ushort: Ushort
1261212661
1261312662 enum CodingKeys: String, CodingKey {
1261412663 case dummy = "dummy"
@@ -12630,6 +12679,7 @@ struct Obj5: Codable {
1263012679 case primitiveKind = "PrimitiveKind"
1263112680 case purpleSelf = "self"
1263212681 case purpleTrue = "true"
12682+ case select = "select"
1263312683 case sendable = "Sendable"
1263412684 case serialDescriptor = "SerialDescriptor"
1263512685 case serialName = "SerialName"
@@ -12658,6 +12708,7 @@ struct Obj5: Codable {
1265812708 case timeOnly = "TimeOnly"
1265912709 case timeOnlyConverter = "TimeOnlyConverter"
1266012710 case timeZone = "TimeZone"
12711+ case toDict = "to_dict"
1266112712 case toJSON = "to_json"
1266212713 case toString = "toString"
1266312714 case topLevel = "top_level"
@@ -12672,10 +12723,9 @@ struct Obj5: Codable {
1267212723 case unchecked = "unchecked"
1267312724 case undefined = "undefined"
1267412725 case union = "union"
12726+ case unmarshalJSON = "UnmarshalJSON"
1267512727 case unsafe = "unsafe"
12676- case unsigned = "unsigned"
1267712728 case useSerializers = "UseSerializers"
12678- case ushort = "ushort"
1267912729 }
1268012730 }
1268112731
@@ -12717,6 +12767,7 @@ extension Obj5 {
1271712767 primitiveKind: PrimitiveKind? = nil,
1271812768 purpleSelf: Obj5Self? = nil,
1271912769 purpleTrue: TrueClass? = nil,
12770+ select: Select? = nil,
1272012771 sendable: Sendable? = nil,
1272112772 serialDescriptor: SerialDescriptor? = nil,
1272212773 serialName: SerialName? = nil,
@@ -12745,6 +12796,7 @@ extension Obj5 {
1274512796 timeOnly: TimeOnly? = nil,
1274612797 timeOnlyConverter: TimeOnlyConverter? = nil,
1274712798 timeZone: TimeZoneClass? = nil,
12799+ toDict: ToDict? = nil,
1274812800 toJSON: ToJSON? = nil,
1274912801 toString: ToString? = nil,
1275012802 topLevel: TopLevelClass? = nil,
@@ -12759,10 +12811,9 @@ extension Obj5 {
1275912811 unchecked: Unchecked? = nil,
1276012812 undefined: Undefined? = nil,
1276112813 union: Union? = nil,
12814+ unmarshalJSON: UnmarshalJSON? = nil,
1276212815 unsafe: Unsafe? = nil,
12763- unsigned: Unsigned? = nil,
12764- useSerializers: UseSerializers? = nil,
12765- ushort: Ushort? = nil
12816+ useSerializers: UseSerializers? = nil
1276612817 ) -> Obj5 {
1276712818 return Obj5(
1276812819 dummy: dummy ?? self.dummy,
@@ -12784,6 +12835,7 @@ extension Obj5 {
1278412835 primitiveKind: primitiveKind ?? self.primitiveKind,
1278512836 purpleSelf: purpleSelf ?? self.purpleSelf,
1278612837 purpleTrue: purpleTrue ?? self.purpleTrue,
12838+ select: select ?? self.select,
1278712839 sendable: sendable ?? self.sendable,
1278812840 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
1278912841 serialName: serialName ?? self.serialName,
@@ -12812,6 +12864,7 @@ extension Obj5 {
1281212864 timeOnly: timeOnly ?? self.timeOnly,
1281312865 timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter,
1281412866 timeZone: timeZone ?? self.timeZone,
12867+ toDict: toDict ?? self.toDict,
1281512868 toJSON: toJSON ?? self.toJSON,
1281612869 toString: toString ?? self.toString,
1281712870 topLevel: topLevel ?? self.topLevel,
@@ -12826,10 +12879,9 @@ extension Obj5 {
1282612879 unchecked: unchecked ?? self.unchecked,
1282712880 undefined: undefined ?? self.undefined,
1282812881 union: union ?? self.union,
12882+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
1282912883 unsafe: unsafe ?? self.unsafe,
12830- unsigned: unsigned ?? self.unsigned,
12831- useSerializers: useSerializers ?? self.useSerializers,
12832- ushort: ushort ?? self.ushort
12884+ useSerializers: useSerializers ?? self.useSerializers
1283312885 )
1283412886 }
1283512887
@@ -13634,6 +13686,50 @@ extension TrueClass {
1363413686 }
1363513687 }
1363613688
13689+// MARK: - Select
13690+struct Select: Codable {
13691+ let select: Int
13692+
13693+ enum CodingKeys: String, CodingKey {
13694+ case select = "select"
13695+ }
13696+}
13697+
13698+// MARK: Select convenience initializers and mutators
13699+
13700+extension Select {
13701+ init(data: Data) throws {
13702+ self = try newJSONDecoder().decode(Select.self, from: data)
13703+ }
13704+
13705+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13706+ guard let data = json.data(using: encoding) else {
13707+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13708+ }
13709+ try self.init(data: data)
13710+ }
13711+
13712+ init(fromURL url: URL) throws {
13713+ try self.init(data: try Data(contentsOf: url))
13714+ }
13715+
13716+ func with(
13717+ select: Int? = nil
13718+ ) -> Select {
13719+ return Select(
13720+ select: select ?? self.select
13721+ )
13722+ }
13723+
13724+ func jsonData() throws -> Data {
13725+ return try newJSONEncoder().encode(self)
13726+ }
13727+
13728+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13729+ return String(data: try self.jsonData(), encoding: encoding)
13730+ }
13731+}
13732+
1363713733 // MARK: - Sendable
1363813734 struct Sendable: Codable {
1363913735 let sendable: Int
@@ -14866,6 +14962,50 @@ extension TimeZoneClass {
1486614962 }
1486714963 }
1486814964
14965+// MARK: - ToDict
14966+struct ToDict: Codable {
14967+ let toDict: Int
14968+
14969+ enum CodingKeys: String, CodingKey {
14970+ case toDict = "to_dict"
14971+ }
14972+}
14973+
14974+// MARK: ToDict convenience initializers and mutators
14975+
14976+extension ToDict {
14977+ init(data: Data) throws {
14978+ self = try newJSONDecoder().decode(ToDict.self, from: data)
14979+ }
14980+
14981+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14982+ guard let data = json.data(using: encoding) else {
14983+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14984+ }
14985+ try self.init(data: data)
14986+ }
14987+
14988+ init(fromURL url: URL) throws {
14989+ try self.init(data: try Data(contentsOf: url))
14990+ }
14991+
14992+ func with(
14993+ toDict: Int? = nil
14994+ ) -> ToDict {
14995+ return ToDict(
14996+ toDict: toDict ?? self.toDict
14997+ )
14998+ }
14999+
15000+ func jsonData() throws -> Data {
15001+ return try newJSONEncoder().encode(self)
15002+ }
15003+
15004+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15005+ return String(data: try self.jsonData(), encoding: encoding)
15006+ }
15007+}
15008+
1486915009 // MARK: - ToJSON
1487015010 struct ToJSON: Codable {
1487115011 let toJSON: Int
@@ -15482,20 +15622,20 @@ extension Union {
1548215622 }
1548315623 }
1548415624
15485-// MARK: - Unsafe
15486-struct Unsafe: Codable {
15487- let unsafe: Int
15625+// MARK: - UnmarshalJSON
15626+struct UnmarshalJSON: Codable {
15627+ let unmarshalJSON: Int
1548815628
1548915629 enum CodingKeys: String, CodingKey {
15490- case unsafe = "unsafe"
15630+ case unmarshalJSON = "UnmarshalJSON"
1549115631 }
1549215632 }
1549315633
15494-// MARK: Unsafe convenience initializers and mutators
15634+// MARK: UnmarshalJSON convenience initializers and mutators
1549515635
15496-extension Unsafe {
15636+extension UnmarshalJSON {
1549715637 init(data: Data) throws {
15498- self = try newJSONDecoder().decode(Unsafe.self, from: data)
15638+ self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data)
1549915639 }
1550015640
1550115641 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15510,10 +15650,10 @@ extension Unsafe {
1551015650 }
1551115651
1551215652 func with(
15513- unsafe: Int? = nil
15514- ) -> Unsafe {
15515- return Unsafe(
15516- unsafe: unsafe ?? self.unsafe
15653+ unmarshalJSON: Int? = nil
15654+ ) -> UnmarshalJSON {
15655+ return UnmarshalJSON(
15656+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1551715657 )
1551815658 }
1551915659
@@ -15526,20 +15666,20 @@ extension Unsafe {
1552615666 }
1552715667 }
1552815668
15529-// MARK: - Unsigned
15530-struct Unsigned: Codable {
15531- let unsigned: Int
15669+// MARK: - Unsafe
15670+struct Unsafe: Codable {
15671+ let unsafe: Int
1553215672
1553315673 enum CodingKeys: String, CodingKey {
15534- case unsigned = "unsigned"
15674+ case unsafe = "unsafe"
1553515675 }
1553615676 }
1553715677
15538-// MARK: Unsigned convenience initializers and mutators
15678+// MARK: Unsafe convenience initializers and mutators
1553915679
15540-extension Unsigned {
15680+extension Unsafe {
1554115681 init(data: Data) throws {
15542- self = try newJSONDecoder().decode(Unsigned.self, from: data)
15682+ self = try newJSONDecoder().decode(Unsafe.self, from: data)
1554315683 }
1554415684
1554515685 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15554,10 +15694,10 @@ extension Unsigned {
1555415694 }
1555515695
1555615696 func with(
15557- unsigned: Int? = nil
15558- ) -> Unsigned {
15559- return Unsigned(
15560- unsigned: unsigned ?? self.unsigned
15697+ unsafe: Int? = nil
15698+ ) -> Unsafe {
15699+ return Unsafe(
15700+ unsafe: unsafe ?? self.unsafe
1556115701 )
1556215702 }
1556315703
@@ -15614,50 +15754,6 @@ extension UseSerializers {
1561415754 }
1561515755 }
1561615756
15617-// MARK: - Ushort
15618-struct Ushort: Codable {
15619- let ushort: Int
15620-
15621- enum CodingKeys: String, CodingKey {
15622- case ushort = "ushort"
15623- }
15624-}
15625-
15626-// MARK: Ushort convenience initializers and mutators
15627-
15628-extension Ushort {
15629- init(data: Data) throws {
15630- self = try newJSONDecoder().decode(Ushort.self, from: data)
15631- }
15632-
15633- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15634- guard let data = json.data(using: encoding) else {
15635- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15636- }
15637- try self.init(data: data)
15638- }
15639-
15640- init(fromURL url: URL) throws {
15641- try self.init(data: try Data(contentsOf: url))
15642- }
15643-
15644- func with(
15645- ushort: Int? = nil
15646- ) -> Ushort {
15647- return Ushort(
15648- ushort: ushort ?? self.ushort
15649- )
15650- }
15651-
15652- func jsonData() throws -> Data {
15653- return try newJSONEncoder().encode(self)
15654- }
15655-
15656- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15657- return String(data: try self.jsonData(), encoding: encoding)
15658- }
15659-}
15660-
1566115757 // MARK: - Obj6
1566215758 struct Obj6: Codable {
1566315759 let dummy: Int
@@ -15666,6 +15762,8 @@ struct Obj6: Codable {
1566615762 let obj6Where: Where
1566715763 let obj6While: While
1566815764 let obj6WillSet: WillSet
15765+ let unsigned: Unsigned
15766+ let ushort: Ushort
1566915767 let using: Using
1567015768 let utf8JSONReader: Utf8JSONReader
1567115769 let utf8JSONWriter: Utf8JSONWriter
@@ -15687,6 +15785,8 @@ struct Obj6: Codable {
1568715785 case obj6Where = "where"
1568815786 case obj6While = "while"
1568915787 case obj6WillSet = "willSet"
15788+ case unsigned = "unsigned"
15789+ case ushort = "ushort"
1569015790 case using = "using"
1569115791 case utf8JSONReader = "Utf8JsonReader"
1569215792 case utf8JSONWriter = "Utf8JsonWriter"
@@ -15728,6 +15828,8 @@ extension Obj6 {
1572815828 obj6Where: Where? = nil,
1572915829 obj6While: While? = nil,
1573015830 obj6WillSet: WillSet? = nil,
15831+ unsigned: Unsigned? = nil,
15832+ ushort: Ushort? = nil,
1573115833 using: Using? = nil,
1573215834 utf8JSONReader: Utf8JSONReader? = nil,
1573315835 utf8JSONWriter: Utf8JSONWriter? = nil,
@@ -15749,6 +15851,8 @@ extension Obj6 {
1574915851 obj6Where: obj6Where ?? self.obj6Where,
1575015852 obj6While: obj6While ?? self.obj6While,
1575115853 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
15854+ unsigned: unsigned ?? self.unsigned,
15855+ ushort: ushort ?? self.ushort,
1575215856 using: using ?? self.using,
1575315857 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
1575415858 utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter,
@@ -15994,6 +16098,94 @@ extension WillSet {
1599416098 }
1599516099 }
1599616100
16101+// MARK: - Unsigned
16102+struct Unsigned: Codable {
16103+ let unsigned: Int
16104+
16105+ enum CodingKeys: String, CodingKey {
16106+ case unsigned = "unsigned"
16107+ }
16108+}
16109+
16110+// MARK: Unsigned convenience initializers and mutators
16111+
16112+extension Unsigned {
16113+ init(data: Data) throws {
16114+ self = try newJSONDecoder().decode(Unsigned.self, from: data)
16115+ }
16116+
16117+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16118+ guard let data = json.data(using: encoding) else {
16119+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16120+ }
16121+ try self.init(data: data)
16122+ }
16123+
16124+ init(fromURL url: URL) throws {
16125+ try self.init(data: try Data(contentsOf: url))
16126+ }
16127+
16128+ func with(
16129+ unsigned: Int? = nil
16130+ ) -> Unsigned {
16131+ return Unsigned(
16132+ unsigned: unsigned ?? self.unsigned
16133+ )
16134+ }
16135+
16136+ func jsonData() throws -> Data {
16137+ return try newJSONEncoder().encode(self)
16138+ }
16139+
16140+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16141+ return String(data: try self.jsonData(), encoding: encoding)
16142+ }
16143+}
16144+
16145+// MARK: - Ushort
16146+struct Ushort: Codable {
16147+ let ushort: Int
16148+
16149+ enum CodingKeys: String, CodingKey {
16150+ case ushort = "ushort"
16151+ }
16152+}
16153+
16154+// MARK: Ushort convenience initializers and mutators
16155+
16156+extension Ushort {
16157+ init(data: Data) throws {
16158+ self = try newJSONDecoder().decode(Ushort.self, from: data)
16159+ }
16160+
16161+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16162+ guard let data = json.data(using: encoding) else {
16163+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16164+ }
16165+ try self.init(data: data)
16166+ }
16167+
16168+ init(fromURL url: URL) throws {
16169+ try self.init(data: try Data(contentsOf: url))
16170+ }
16171+
16172+ func with(
16173+ ushort: Int? = nil
16174+ ) -> Ushort {
16175+ return Ushort(
16176+ ushort: ushort ?? self.ushort
16177+ )
16178+ }
16179+
16180+ func jsonData() throws -> Data {
16181+ return try newJSONEncoder().encode(self)
16182+ }
16183+
16184+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16185+ return String(data: try self.jsonData(), encoding: encoding)
16186+ }
16187+}
16188+
1599716189 // MARK: - Using
1599816190 struct Using: Codable {
1599916191 let using: Int
Mswiftobjective-c-support-true__struct-or-class-class--f14372afa3e4 / quicktype.swift+486 −270
@@ -3634,11 +3634,11 @@ extension ClassClass {
36343634 let formatException: FormatException
36353635 let friend: Friend
36363636 let from: From
3637+ let fromDict: FromDict
36373638 let fromJSON: FromJSON
36383639 let function: Function
36393640 let global: Global
36403641 let go: Go
3641- let goto: Goto
36423642 let obj2Default: Default
36433643 let obj2Defer: Defer
36443644 let obj2Deinit: Deinit
@@ -3701,11 +3701,11 @@ extension ClassClass {
37013701 case formatException = "FormatException"
37023702 case friend = "friend"
37033703 case from = "from"
3704+ case fromDict = "from_dict"
37043705 case fromJSON = "from_json"
37053706 case function = "function"
37063707 case global = "global"
37073708 case go = "go"
3708- case goto = "goto"
37093709 case obj2Default = "default"
37103710 case obj2Defer = "defer"
37113711 case obj2Deinit = "deinit"
@@ -3725,7 +3725,7 @@ extension ClassClass {
37253725 case purpleFalse = "false"
37263726 }
37273727
3728- init(dateFormatter: DateFormatterClass, dateOnly: DateOnly, dateOnlyConverter: DateOnlyConverter, dateParseHandling: DateParseHandling, dateTime: DateTime, dateTimeStyles: DateTimeStyles, debugger: Debugger, decimal: Decimal, declare: Declare, decltype: Decltype, decodeString: DecodeString, decoder: DecoderClass, decodingError: DecodingErrorClass, def: Def, del: Del, delegate: Delegate, delete: Delete, dict: Dict, dictionary: Dictionary, double: DoubleClass, dummy: Int, dynamicCast: DynamicCast, elif: Elif, encodeQuickType: EncodeQuickType, encoder: EncoderClass, enumValues: EnumValues, equalityContract: EqualityContract, equatable: Equatable, event: Event, except: Except, exception: Exception, explicit: Explicit, export: Export, exposing: Exposing, extends: Extends, extern: Extern, finally: Finally, fixed: Fixed, float: Float, foreach: Foreach, formatException: FormatException, friend: Friend, from: From, fromJSON: FromJSON, function: Function, global: Global, go: Go, goto: Goto, obj2Default: Default, obj2Defer: Defer, obj2Deinit: Deinit, obj2DidSet: DidSet, obj2Do: Do, obj2Dynamic: Dynamic, obj2Else: Else, obj2Enum: Enum, obj2Extension: Extension, obj2Fallthrough: Fallthrough, obj2False: False, obj2Fileprivate: Fileprivate, obj2Final: Final, obj2For: For, obj2Func: Func, obj2Get: Get, purpleFalse: FalseClass) {
3728+ init(dateFormatter: DateFormatterClass, dateOnly: DateOnly, dateOnlyConverter: DateOnlyConverter, dateParseHandling: DateParseHandling, dateTime: DateTime, dateTimeStyles: DateTimeStyles, debugger: Debugger, decimal: Decimal, declare: Declare, decltype: Decltype, decodeString: DecodeString, decoder: DecoderClass, decodingError: DecodingErrorClass, def: Def, del: Del, delegate: Delegate, delete: Delete, dict: Dict, dictionary: Dictionary, double: DoubleClass, dummy: Int, dynamicCast: DynamicCast, elif: Elif, encodeQuickType: EncodeQuickType, encoder: EncoderClass, enumValues: EnumValues, equalityContract: EqualityContract, equatable: Equatable, event: Event, except: Except, exception: Exception, explicit: Explicit, export: Export, exposing: Exposing, extends: Extends, extern: Extern, finally: Finally, fixed: Fixed, float: Float, foreach: Foreach, formatException: FormatException, friend: Friend, from: From, fromDict: FromDict, fromJSON: FromJSON, function: Function, global: Global, go: Go, obj2Default: Default, obj2Defer: Defer, obj2Deinit: Deinit, obj2DidSet: DidSet, obj2Do: Do, obj2Dynamic: Dynamic, obj2Else: Else, obj2Enum: Enum, obj2Extension: Extension, obj2Fallthrough: Fallthrough, obj2False: False, obj2Fileprivate: Fileprivate, obj2Final: Final, obj2For: For, obj2Func: Func, obj2Get: Get, purpleFalse: FalseClass) {
37293729 self.dateFormatter = dateFormatter
37303730 self.dateOnly = dateOnly
37313731 self.dateOnlyConverter = dateOnlyConverter
@@ -3769,11 +3769,11 @@ extension ClassClass {
37693769 self.formatException = formatException
37703770 self.friend = friend
37713771 self.from = from
3772+ self.fromDict = fromDict
37723773 self.fromJSON = fromJSON
37733774 self.function = function
37743775 self.global = global
37753776 self.go = go
3776- self.goto = goto
37773777 self.obj2Default = obj2Default
37783778 self.obj2Defer = obj2Defer
37793779 self.obj2Deinit = obj2Deinit
@@ -3799,7 +3799,7 @@ extension ClassClass {
37993799 extension Obj2 {
38003800 convenience init(data: Data) throws {
38013801 let me = try newJSONDecoder().decode(Obj2.self, from: data)
3802- self.init(dateFormatter: me.dateFormatter, dateOnly: me.dateOnly, dateOnlyConverter: me.dateOnlyConverter, dateParseHandling: me.dateParseHandling, dateTime: me.dateTime, dateTimeStyles: me.dateTimeStyles, debugger: me.debugger, decimal: me.decimal, declare: me.declare, decltype: me.decltype, decodeString: me.decodeString, decoder: me.decoder, decodingError: me.decodingError, def: me.def, del: me.del, delegate: me.delegate, delete: me.delete, dict: me.dict, dictionary: me.dictionary, double: me.double, dummy: me.dummy, dynamicCast: me.dynamicCast, elif: me.elif, encodeQuickType: me.encodeQuickType, encoder: me.encoder, enumValues: me.enumValues, equalityContract: me.equalityContract, equatable: me.equatable, event: me.event, except: me.except, exception: me.exception, explicit: me.explicit, export: me.export, exposing: me.exposing, extends: me.extends, extern: me.extern, finally: me.finally, fixed: me.fixed, float: me.float, foreach: me.foreach, formatException: me.formatException, friend: me.friend, from: me.from, fromJSON: me.fromJSON, function: me.function, global: me.global, go: me.go, goto: me.goto, obj2Default: me.obj2Default, obj2Defer: me.obj2Defer, obj2Deinit: me.obj2Deinit, obj2DidSet: me.obj2DidSet, obj2Do: me.obj2Do, obj2Dynamic: me.obj2Dynamic, obj2Else: me.obj2Else, obj2Enum: me.obj2Enum, obj2Extension: me.obj2Extension, obj2Fallthrough: me.obj2Fallthrough, obj2False: me.obj2False, obj2Fileprivate: me.obj2Fileprivate, obj2Final: me.obj2Final, obj2For: me.obj2For, obj2Func: me.obj2Func, obj2Get: me.obj2Get, purpleFalse: me.purpleFalse)
3802+ self.init(dateFormatter: me.dateFormatter, dateOnly: me.dateOnly, dateOnlyConverter: me.dateOnlyConverter, dateParseHandling: me.dateParseHandling, dateTime: me.dateTime, dateTimeStyles: me.dateTimeStyles, debugger: me.debugger, decimal: me.decimal, declare: me.declare, decltype: me.decltype, decodeString: me.decodeString, decoder: me.decoder, decodingError: me.decodingError, def: me.def, del: me.del, delegate: me.delegate, delete: me.delete, dict: me.dict, dictionary: me.dictionary, double: me.double, dummy: me.dummy, dynamicCast: me.dynamicCast, elif: me.elif, encodeQuickType: me.encodeQuickType, encoder: me.encoder, enumValues: me.enumValues, equalityContract: me.equalityContract, equatable: me.equatable, event: me.event, except: me.except, exception: me.exception, explicit: me.explicit, export: me.export, exposing: me.exposing, extends: me.extends, extern: me.extern, finally: me.finally, fixed: me.fixed, float: me.float, foreach: me.foreach, formatException: me.formatException, friend: me.friend, from: me.from, fromDict: me.fromDict, fromJSON: me.fromJSON, function: me.function, global: me.global, go: me.go, obj2Default: me.obj2Default, obj2Defer: me.obj2Defer, obj2Deinit: me.obj2Deinit, obj2DidSet: me.obj2DidSet, obj2Do: me.obj2Do, obj2Dynamic: me.obj2Dynamic, obj2Else: me.obj2Else, obj2Enum: me.obj2Enum, obj2Extension: me.obj2Extension, obj2Fallthrough: me.obj2Fallthrough, obj2False: me.obj2False, obj2Fileprivate: me.obj2Fileprivate, obj2Final: me.obj2Final, obj2For: me.obj2For, obj2Func: me.obj2Func, obj2Get: me.obj2Get, purpleFalse: me.purpleFalse)
38033803 }
38043804
38053805 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -3857,11 +3857,11 @@ extension Obj2 {
38573857 formatException: FormatException? = nil,
38583858 friend: Friend? = nil,
38593859 from: From? = nil,
3860+ fromDict: FromDict? = nil,
38603861 fromJSON: FromJSON? = nil,
38613862 function: Function? = nil,
38623863 global: Global? = nil,
38633864 go: Go? = nil,
3864- goto: Goto? = nil,
38653865 obj2Default: Default? = nil,
38663866 obj2Defer: Defer? = nil,
38673867 obj2Deinit: Deinit? = nil,
@@ -3924,11 +3924,11 @@ extension Obj2 {
39243924 formatException: formatException ?? self.formatException,
39253925 friend: friend ?? self.friend,
39263926 from: from ?? self.from,
3927+ fromDict: fromDict ?? self.fromDict,
39273928 fromJSON: fromJSON ?? self.fromJSON,
39283929 function: function ?? self.function,
39293930 global: global ?? self.global,
39303931 go: go ?? self.go,
3931- goto: goto ?? self.goto,
39323932 obj2Default: obj2Default ?? self.obj2Default,
39333933 obj2Defer: obj2Defer ?? self.obj2Defer,
39343934 obj2Deinit: obj2Deinit ?? self.obj2Deinit,
@@ -6021,6 +6021,55 @@ extension From {
60216021 }
60226022 }
60236023
6024+// MARK: - FromDict
6025+@objcMembers class FromDict: NSObject, Codable {
6026+ let fromDict: Int
6027+
6028+ enum CodingKeys: String, CodingKey {
6029+ case fromDict = "from_dict"
6030+ }
6031+
6032+ init(fromDict: Int) {
6033+ self.fromDict = fromDict
6034+ }
6035+}
6036+
6037+// MARK: FromDict convenience initializers and mutators
6038+
6039+extension FromDict {
6040+ convenience init(data: Data) throws {
6041+ let me = try newJSONDecoder().decode(FromDict.self, from: data)
6042+ self.init(fromDict: me.fromDict)
6043+ }
6044+
6045+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
6046+ guard let data = json.data(using: encoding) else {
6047+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
6048+ }
6049+ try self.init(data: data)
6050+ }
6051+
6052+ convenience init(fromURL url: URL) throws {
6053+ try self.init(data: try Data(contentsOf: url))
6054+ }
6055+
6056+ func with(
6057+ fromDict: Int? = nil
6058+ ) -> FromDict {
6059+ return FromDict(
6060+ fromDict: fromDict ?? self.fromDict
6061+ )
6062+ }
6063+
6064+ func jsonData() throws -> Data {
6065+ return try newJSONEncoder().encode(self)
6066+ }
6067+
6068+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
6069+ return String(data: try self.jsonData(), encoding: encoding)
6070+ }
6071+}
6072+
60246073 // MARK: - FromJSON
60256074 @objcMembers class FromJSON: NSObject, Codable {
60266075 let fromJSON: Int
@@ -6217,55 +6266,6 @@ extension Go {
62176266 }
62186267 }
62196268
6220-// MARK: - Goto
6221-@objcMembers class Goto: NSObject, Codable {
6222- let goto: Int
6223-
6224- enum CodingKeys: String, CodingKey {
6225- case goto = "goto"
6226- }
6227-
6228- init(goto: Int) {
6229- self.goto = goto
6230- }
6231-}
6232-
6233-// MARK: Goto convenience initializers and mutators
6234-
6235-extension Goto {
6236- convenience init(data: Data) throws {
6237- let me = try newJSONDecoder().decode(Goto.self, from: data)
6238- self.init(goto: me.goto)
6239- }
6240-
6241- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
6242- guard let data = json.data(using: encoding) else {
6243- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
6244- }
6245- try self.init(data: data)
6246- }
6247-
6248- convenience init(fromURL url: URL) throws {
6249- try self.init(data: try Data(contentsOf: url))
6250- }
6251-
6252- func with(
6253- goto: Int? = nil
6254- ) -> Goto {
6255- return Goto(
6256- goto: goto ?? self.goto
6257- )
6258- }
6259-
6260- func jsonData() throws -> Data {
6261- return try newJSONEncoder().encode(self)
6262- }
6263-
6264- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
6265- return String(data: try self.jsonData(), encoding: encoding)
6266- }
6267-}
6268-
62696269 // MARK: - Default
62706270 @objcMembers class Default: NSObject, Codable {
62716271 let defaultDefault: Int
@@ -7102,6 +7102,7 @@ extension FalseClass {
71027102 // MARK: - Obj3
71037103 @objcMembers class Obj3: NSObject, Codable {
71047104 let dummy: Int
7105+ let goto: Goto
71057106 let hasOwnProperty: HasOwnProperty
71067107 let hashCode: HashCode
71077108 let hashable: HashableClass
@@ -7141,6 +7142,7 @@ extension FalseClass {
71417142 let long: Long
71427143 let map: Map
71437144 let mapEntry: MapEntry
7145+ let marshalJSON: MarshalJSON
71447146 let metadataPropertyHandling: MetadataPropertyHandling
71457147 let module: Module
71467148 let mutable: Mutable
@@ -7149,7 +7151,6 @@ extension FalseClass {
71497151 let new: New
71507152 let newtonsoft: Newtonsoft
71517153 let no: No
7152- let noexcept: Noexcept
71537154 let obj3Guard: Guard
71547155 let obj3If: If
71557156 let obj3Import: Import
@@ -7169,6 +7170,7 @@ extension FalseClass {
71697170
71707171 enum CodingKeys: String, CodingKey {
71717172 case dummy = "dummy"
7173+ case goto = "goto"
71727174 case hasOwnProperty = "hasOwnProperty"
71737175 case hashCode = "hashCode"
71747176 case hashable = "Hashable"
@@ -7208,6 +7210,7 @@ extension FalseClass {
72087210 case long = "long"
72097211 case map = "map"
72107212 case mapEntry = "MapEntry"
7213+ case marshalJSON = "MarshalJSON"
72117214 case metadataPropertyHandling = "metadata_property_handling"
72127215 case module = "module"
72137216 case mutable = "mutable"
@@ -7216,7 +7219,6 @@ extension FalseClass {
72167219 case new = "new"
72177220 case newtonsoft = "newtonsoft"
72187221 case no = "NO"
7219- case noexcept = "noexcept"
72207222 case obj3Guard = "guard"
72217223 case obj3If = "if"
72227224 case obj3Import = "import"
@@ -7235,8 +7237,9 @@ extension FalseClass {
72357237 case obj3Nil = "nil"
72367238 }
72377239
7238- init(dummy: Int, hasOwnProperty: HasOwnProperty, hashCode: HashCode, hashable: HashableClass, hasher: HasherClass, id: ID, imp: Imp, implements: Implements, implicit: Implicit, inline: Inline, instanceof: Instanceof, int: IntClass, interface: Interface, isoDateTimeOffsetConverter: ISODateTimeOffsetConverter, iterable: Iterable, jdec: Jdec, jenc: Jenc, jpipe: Jpipe, jsonAny: JSONAnyClass, jsonCodingKey: JSONCodingKeyClass, jsonConverter: JSONConverter, jsonDecoder: JSONDecoderClass, jsonEncoder: JSONEncoderClass, jsonException: JSONException, jsonGenerator: JSONGenerator, jsonNode: JSONNode, jsonNull: JSONNullClass, jsonParser: JSONParser, jsonReader: JSONReader, jsonSerializer: JSONSerializer, jsonToken: JSONToken, jsonTokenType: JSONTokenType, jsonWriter: JSONWriter, lambda: Lambda, list: List, locale: LocaleClass, lock: Lock, long: Long, map: Map, mapEntry: MapEntry, metadataPropertyHandling: MetadataPropertyHandling, module: Module, mutable: Mutable, namespace: Namespace, native: Native, new: New, newtonsoft: Newtonsoft, no: No, noexcept: Noexcept, obj3Guard: Guard, obj3If: If, obj3Import: Import, obj3In: In, obj3Indirect: Indirect, obj3Infix: Infix, obj3Init: Init, obj3Inout: Inout, obj3Internal: Internal, obj3Is: Is, obj3JSON: JSON, obj3Lazy: Lazy, obj3Left: Left, obj3Let: Let, obj3Mutating: Mutating, obj3Nil: Nil) {
7240+ init(dummy: Int, goto: Goto, hasOwnProperty: HasOwnProperty, hashCode: HashCode, hashable: HashableClass, hasher: HasherClass, id: ID, imp: Imp, implements: Implements, implicit: Implicit, inline: Inline, instanceof: Instanceof, int: IntClass, interface: Interface, isoDateTimeOffsetConverter: ISODateTimeOffsetConverter, iterable: Iterable, jdec: Jdec, jenc: Jenc, jpipe: Jpipe, jsonAny: JSONAnyClass, jsonCodingKey: JSONCodingKeyClass, jsonConverter: JSONConverter, jsonDecoder: JSONDecoderClass, jsonEncoder: JSONEncoderClass, jsonException: JSONException, jsonGenerator: JSONGenerator, jsonNode: JSONNode, jsonNull: JSONNullClass, jsonParser: JSONParser, jsonReader: JSONReader, jsonSerializer: JSONSerializer, jsonToken: JSONToken, jsonTokenType: JSONTokenType, jsonWriter: JSONWriter, lambda: Lambda, list: List, locale: LocaleClass, lock: Lock, long: Long, map: Map, mapEntry: MapEntry, marshalJSON: MarshalJSON, metadataPropertyHandling: MetadataPropertyHandling, module: Module, mutable: Mutable, namespace: Namespace, native: Native, new: New, newtonsoft: Newtonsoft, no: No, obj3Guard: Guard, obj3If: If, obj3Import: Import, obj3In: In, obj3Indirect: Indirect, obj3Infix: Infix, obj3Init: Init, obj3Inout: Inout, obj3Internal: Internal, obj3Is: Is, obj3JSON: JSON, obj3Lazy: Lazy, obj3Left: Left, obj3Let: Let, obj3Mutating: Mutating, obj3Nil: Nil) {
72397241 self.dummy = dummy
7242+ self.goto = goto
72407243 self.hasOwnProperty = hasOwnProperty
72417244 self.hashCode = hashCode
72427245 self.hashable = hashable
@@ -7276,6 +7279,7 @@ extension FalseClass {
72767279 self.long = long
72777280 self.map = map
72787281 self.mapEntry = mapEntry
7282+ self.marshalJSON = marshalJSON
72797283 self.metadataPropertyHandling = metadataPropertyHandling
72807284 self.module = module
72817285 self.mutable = mutable
@@ -7284,7 +7288,6 @@ extension FalseClass {
72847288 self.new = new
72857289 self.newtonsoft = newtonsoft
72867290 self.no = no
7287- self.noexcept = noexcept
72887291 self.obj3Guard = obj3Guard
72897292 self.obj3If = obj3If
72907293 self.obj3Import = obj3Import
@@ -7309,7 +7312,7 @@ extension FalseClass {
73097312 extension Obj3 {
73107313 convenience init(data: Data) throws {
73117314 let me = try newJSONDecoder().decode(Obj3.self, from: data)
7312- self.init(dummy: me.dummy, hasOwnProperty: me.hasOwnProperty, hashCode: me.hashCode, hashable: me.hashable, hasher: me.hasher, id: me.id, imp: me.imp, implements: me.implements, implicit: me.implicit, inline: me.inline, instanceof: me.instanceof, int: me.int, interface: me.interface, isoDateTimeOffsetConverter: me.isoDateTimeOffsetConverter, iterable: me.iterable, jdec: me.jdec, jenc: me.jenc, jpipe: me.jpipe, jsonAny: me.jsonAny, jsonCodingKey: me.jsonCodingKey, jsonConverter: me.jsonConverter, jsonDecoder: me.jsonDecoder, jsonEncoder: me.jsonEncoder, jsonException: me.jsonException, jsonGenerator: me.jsonGenerator, jsonNode: me.jsonNode, jsonNull: me.jsonNull, jsonParser: me.jsonParser, jsonReader: me.jsonReader, jsonSerializer: me.jsonSerializer, jsonToken: me.jsonToken, jsonTokenType: me.jsonTokenType, jsonWriter: me.jsonWriter, lambda: me.lambda, list: me.list, locale: me.locale, lock: me.lock, long: me.long, map: me.map, mapEntry: me.mapEntry, metadataPropertyHandling: me.metadataPropertyHandling, module: me.module, mutable: me.mutable, namespace: me.namespace, native: me.native, new: me.new, newtonsoft: me.newtonsoft, no: me.no, noexcept: me.noexcept, obj3Guard: me.obj3Guard, obj3If: me.obj3If, obj3Import: me.obj3Import, obj3In: me.obj3In, obj3Indirect: me.obj3Indirect, obj3Infix: me.obj3Infix, obj3Init: me.obj3Init, obj3Inout: me.obj3Inout, obj3Internal: me.obj3Internal, obj3Is: me.obj3Is, obj3JSON: me.obj3JSON, obj3Lazy: me.obj3Lazy, obj3Left: me.obj3Left, obj3Let: me.obj3Let, obj3Mutating: me.obj3Mutating, obj3Nil: me.obj3Nil)
7315+ self.init(dummy: me.dummy, goto: me.goto, hasOwnProperty: me.hasOwnProperty, hashCode: me.hashCode, hashable: me.hashable, hasher: me.hasher, id: me.id, imp: me.imp, implements: me.implements, implicit: me.implicit, inline: me.inline, instanceof: me.instanceof, int: me.int, interface: me.interface, isoDateTimeOffsetConverter: me.isoDateTimeOffsetConverter, iterable: me.iterable, jdec: me.jdec, jenc: me.jenc, jpipe: me.jpipe, jsonAny: me.jsonAny, jsonCodingKey: me.jsonCodingKey, jsonConverter: me.jsonConverter, jsonDecoder: me.jsonDecoder, jsonEncoder: me.jsonEncoder, jsonException: me.jsonException, jsonGenerator: me.jsonGenerator, jsonNode: me.jsonNode, jsonNull: me.jsonNull, jsonParser: me.jsonParser, jsonReader: me.jsonReader, jsonSerializer: me.jsonSerializer, jsonToken: me.jsonToken, jsonTokenType: me.jsonTokenType, jsonWriter: me.jsonWriter, lambda: me.lambda, list: me.list, locale: me.locale, lock: me.lock, long: me.long, map: me.map, mapEntry: me.mapEntry, marshalJSON: me.marshalJSON, metadataPropertyHandling: me.metadataPropertyHandling, module: me.module, mutable: me.mutable, namespace: me.namespace, native: me.native, new: me.new, newtonsoft: me.newtonsoft, no: me.no, obj3Guard: me.obj3Guard, obj3If: me.obj3If, obj3Import: me.obj3Import, obj3In: me.obj3In, obj3Indirect: me.obj3Indirect, obj3Infix: me.obj3Infix, obj3Init: me.obj3Init, obj3Inout: me.obj3Inout, obj3Internal: me.obj3Internal, obj3Is: me.obj3Is, obj3JSON: me.obj3JSON, obj3Lazy: me.obj3Lazy, obj3Left: me.obj3Left, obj3Let: me.obj3Let, obj3Mutating: me.obj3Mutating, obj3Nil: me.obj3Nil)
73137316 }
73147317
73157318 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -7325,6 +7328,7 @@ extension Obj3 {
73257328
73267329 func with(
73277330 dummy: Int? = nil,
7331+ goto: Goto? = nil,
73287332 hasOwnProperty: HasOwnProperty? = nil,
73297333 hashCode: HashCode? = nil,
73307334 hashable: HashableClass? = nil,
@@ -7364,6 +7368,7 @@ extension Obj3 {
73647368 long: Long? = nil,
73657369 map: Map? = nil,
73667370 mapEntry: MapEntry? = nil,
7371+ marshalJSON: MarshalJSON? = nil,
73677372 metadataPropertyHandling: MetadataPropertyHandling? = nil,
73687373 module: Module? = nil,
73697374 mutable: Mutable? = nil,
@@ -7372,7 +7377,6 @@ extension Obj3 {
73727377 new: New? = nil,
73737378 newtonsoft: Newtonsoft? = nil,
73747379 no: No? = nil,
7375- noexcept: Noexcept? = nil,
73767380 obj3Guard: Guard? = nil,
73777381 obj3If: If? = nil,
73787382 obj3Import: Import? = nil,
@@ -7392,6 +7396,7 @@ extension Obj3 {
73927396 ) -> Obj3 {
73937397 return Obj3(
73947398 dummy: dummy ?? self.dummy,
7399+ goto: goto ?? self.goto,
73957400 hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty,
73967401 hashCode: hashCode ?? self.hashCode,
73977402 hashable: hashable ?? self.hashable,
@@ -7431,6 +7436,7 @@ extension Obj3 {
74317436 long: long ?? self.long,
74327437 map: map ?? self.map,
74337438 mapEntry: mapEntry ?? self.mapEntry,
7439+ marshalJSON: marshalJSON ?? self.marshalJSON,
74347440 metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling,
74357441 module: module ?? self.module,
74367442 mutable: mutable ?? self.mutable,
@@ -7439,7 +7445,6 @@ extension Obj3 {
74397445 new: new ?? self.new,
74407446 newtonsoft: newtonsoft ?? self.newtonsoft,
74417447 no: no ?? self.no,
7442- noexcept: noexcept ?? self.noexcept,
74437448 obj3Guard: obj3Guard ?? self.obj3Guard,
74447449 obj3If: obj3If ?? self.obj3If,
74457450 obj3Import: obj3Import ?? self.obj3Import,
@@ -7468,6 +7473,55 @@ extension Obj3 {
74687473 }
74697474 }
74707475
7476+// MARK: - Goto
7477+@objcMembers class Goto: NSObject, Codable {
7478+ let goto: Int
7479+
7480+ enum CodingKeys: String, CodingKey {
7481+ case goto = "goto"
7482+ }
7483+
7484+ init(goto: Int) {
7485+ self.goto = goto
7486+ }
7487+}
7488+
7489+// MARK: Goto convenience initializers and mutators
7490+
7491+extension Goto {
7492+ convenience init(data: Data) throws {
7493+ let me = try newJSONDecoder().decode(Goto.self, from: data)
7494+ self.init(goto: me.goto)
7495+ }
7496+
7497+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
7498+ guard let data = json.data(using: encoding) else {
7499+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
7500+ }
7501+ try self.init(data: data)
7502+ }
7503+
7504+ convenience init(fromURL url: URL) throws {
7505+ try self.init(data: try Data(contentsOf: url))
7506+ }
7507+
7508+ func with(
7509+ goto: Int? = nil
7510+ ) -> Goto {
7511+ return Goto(
7512+ goto: goto ?? self.goto
7513+ )
7514+ }
7515+
7516+ func jsonData() throws -> Data {
7517+ return try newJSONEncoder().encode(self)
7518+ }
7519+
7520+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
7521+ return String(data: try self.jsonData(), encoding: encoding)
7522+ }
7523+}
7524+
74717525 // MARK: - HasOwnProperty
74727526 @objcMembers class HasOwnProperty: NSObject, Codable {
74737527 let hasOwnProperty: Int
@@ -9379,6 +9433,55 @@ extension MapEntry {
93799433 }
93809434 }
93819435
9436+// MARK: - MarshalJSON
9437+@objcMembers class MarshalJSON: NSObject, Codable {
9438+ let marshalJSON: Int
9439+
9440+ enum CodingKeys: String, CodingKey {
9441+ case marshalJSON = "MarshalJSON"
9442+ }
9443+
9444+ init(marshalJSON: Int) {
9445+ self.marshalJSON = marshalJSON
9446+ }
9447+}
9448+
9449+// MARK: MarshalJSON convenience initializers and mutators
9450+
9451+extension MarshalJSON {
9452+ convenience init(data: Data) throws {
9453+ let me = try newJSONDecoder().decode(MarshalJSON.self, from: data)
9454+ self.init(marshalJSON: me.marshalJSON)
9455+ }
9456+
9457+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9458+ guard let data = json.data(using: encoding) else {
9459+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9460+ }
9461+ try self.init(data: data)
9462+ }
9463+
9464+ convenience init(fromURL url: URL) throws {
9465+ try self.init(data: try Data(contentsOf: url))
9466+ }
9467+
9468+ func with(
9469+ marshalJSON: Int? = nil
9470+ ) -> MarshalJSON {
9471+ return MarshalJSON(
9472+ marshalJSON: marshalJSON ?? self.marshalJSON
9473+ )
9474+ }
9475+
9476+ func jsonData() throws -> Data {
9477+ return try newJSONEncoder().encode(self)
9478+ }
9479+
9480+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9481+ return String(data: try self.jsonData(), encoding: encoding)
9482+ }
9483+}
9484+
93829485 // MARK: - MetadataPropertyHandling
93839486 @objcMembers class MetadataPropertyHandling: NSObject, Codable {
93849487 let metadataPropertyHandling: Int
@@ -9771,55 +9874,6 @@ extension No {
97719874 }
97729875 }
97739876
9774-// MARK: - Noexcept
9775-@objcMembers class Noexcept: NSObject, Codable {
9776- let noexcept: Int
9777-
9778- enum CodingKeys: String, CodingKey {
9779- case noexcept = "noexcept"
9780- }
9781-
9782- init(noexcept: Int) {
9783- self.noexcept = noexcept
9784- }
9785-}
9786-
9787-// MARK: Noexcept convenience initializers and mutators
9788-
9789-extension Noexcept {
9790- convenience init(data: Data) throws {
9791- let me = try newJSONDecoder().decode(Noexcept.self, from: data)
9792- self.init(noexcept: me.noexcept)
9793- }
9794-
9795- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9796- guard let data = json.data(using: encoding) else {
9797- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9798- }
9799- try self.init(data: data)
9800- }
9801-
9802- convenience init(fromURL url: URL) throws {
9803- try self.init(data: try Data(contentsOf: url))
9804- }
9805-
9806- func with(
9807- noexcept: Int? = nil
9808- ) -> Noexcept {
9809- return Noexcept(
9810- noexcept: noexcept ?? self.noexcept
9811- )
9812- }
9813-
9814- func jsonData() throws -> Data {
9815- return try newJSONEncoder().encode(self)
9816- }
9817-
9818- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9819- return String(data: try self.jsonData(), encoding: encoding)
9820- }
9821-}
9822-
98239877 // MARK: - Guard
98249878 @objcMembers class Guard: NSObject, Codable {
98259879 let guardGuard: Int
@@ -10608,6 +10662,7 @@ extension Nil {
1060810662 @objcMembers class Obj4: NSObject, Codable {
1060910663 let dummy: Int
1061010664 let noSuchMethod: NoSuchMethod
10665+ let noexcept: Noexcept
1061110666 let nonatomic: Nonatomic
1061210667 let none: None
1061310668 let nonlocal: Nonlocal
@@ -10670,11 +10725,11 @@ extension Nil {
1067010725 let sbyte: Sbyte
1067110726 let sealed: Sealed
1067210727 let sel: Sel
10673- let select: Select
1067410728
1067510729 enum CodingKeys: String, CodingKey {
1067610730 case dummy = "dummy"
1067710731 case noSuchMethod = "noSuchMethod"
10732+ case noexcept = "noexcept"
1067810733 case nonatomic = "nonatomic"
1067910734 case none = "None"
1068010735 case nonlocal = "nonlocal"
@@ -10737,12 +10792,12 @@ extension Nil {
1073710792 case sbyte = "sbyte"
1073810793 case sealed = "sealed"
1073910794 case sel = "SEL"
10740- case select = "select"
1074110795 }
1074210796
10743- init(dummy: Int, noSuchMethod: NoSuchMethod, nonatomic: Nonatomic, none: None, nonlocal: Nonlocal, not: Not, notEq: NotEq, nsError: NSErrorClass, nsObject: NSObjectClass, nsString: NSString, null: Null, nullptr: Nullptr, number: Number, obj4None: NoneClass, obj4Nonmutating: Nonmutating, obj4Null: NullClass, obj4Open: Open, obj4Operator: Operator, obj4Optional: Optional, obj4Override: Override, obj4Postfix: Postfix, obj4Precedence: Precedence, obj4Prefix: Prefix, obj4Private: Private, obj4Protocol: ProtocolClass, obj4Public: Public, obj4Repeat: Repeat, obj4Required: Required, obj4Retain: Retain, obj4Rethrows: Rethrows, obj4Return: Return, obj4Right: Right, object: Object, objectMapper: ObjectMapper, of: Of, oneway: Oneway, or: Or, orEq: OrEq, out: Out, package: Package, params: Params, pass: Pass, port: Port, print: Print, printMembers: PrintMembers, printf: Printf, protected: Protected, purpleProtocol: Obj4Protocol, quicktype: Quicktype, raise: Raise, range: Range, readonly: Readonly, ref: Ref, regExp: RegExp, register: Register, reinterpretCast: ReinterpretCast, require: Require, requires: Requires, restrict: Restrict, runtimeType: RuntimeType, s: S, sbyte: Sbyte, sealed: Sealed, sel: Sel, select: Select) {
10797+ init(dummy: Int, noSuchMethod: NoSuchMethod, noexcept: Noexcept, nonatomic: Nonatomic, none: None, nonlocal: Nonlocal, not: Not, notEq: NotEq, nsError: NSErrorClass, nsObject: NSObjectClass, nsString: NSString, null: Null, nullptr: Nullptr, number: Number, obj4None: NoneClass, obj4Nonmutating: Nonmutating, obj4Null: NullClass, obj4Open: Open, obj4Operator: Operator, obj4Optional: Optional, obj4Override: Override, obj4Postfix: Postfix, obj4Precedence: Precedence, obj4Prefix: Prefix, obj4Private: Private, obj4Protocol: ProtocolClass, obj4Public: Public, obj4Repeat: Repeat, obj4Required: Required, obj4Retain: Retain, obj4Rethrows: Rethrows, obj4Return: Return, obj4Right: Right, object: Object, objectMapper: ObjectMapper, of: Of, oneway: Oneway, or: Or, orEq: OrEq, out: Out, package: Package, params: Params, pass: Pass, port: Port, print: Print, printMembers: PrintMembers, printf: Printf, protected: Protected, purpleProtocol: Obj4Protocol, quicktype: Quicktype, raise: Raise, range: Range, readonly: Readonly, ref: Ref, regExp: RegExp, register: Register, reinterpretCast: ReinterpretCast, require: Require, requires: Requires, restrict: Restrict, runtimeType: RuntimeType, s: S, sbyte: Sbyte, sealed: Sealed, sel: Sel) {
1074410798 self.dummy = dummy
1074510799 self.noSuchMethod = noSuchMethod
10800+ self.noexcept = noexcept
1074610801 self.nonatomic = nonatomic
1074710802 self.none = none
1074810803 self.nonlocal = nonlocal
@@ -10805,7 +10860,6 @@ extension Nil {
1080510860 self.sbyte = sbyte
1080610861 self.sealed = sealed
1080710862 self.sel = sel
10808- self.select = select
1080910863 }
1081010864 }
1081110865
@@ -10814,7 +10868,7 @@ extension Nil {
1081410868 extension Obj4 {
1081510869 convenience init(data: Data) throws {
1081610870 let me = try newJSONDecoder().decode(Obj4.self, from: data)
10817- self.init(dummy: me.dummy, noSuchMethod: me.noSuchMethod, nonatomic: me.nonatomic, none: me.none, nonlocal: me.nonlocal, not: me.not, notEq: me.notEq, nsError: me.nsError, nsObject: me.nsObject, nsString: me.nsString, null: me.null, nullptr: me.nullptr, number: me.number, obj4None: me.obj4None, obj4Nonmutating: me.obj4Nonmutating, obj4Null: me.obj4Null, obj4Open: me.obj4Open, obj4Operator: me.obj4Operator, obj4Optional: me.obj4Optional, obj4Override: me.obj4Override, obj4Postfix: me.obj4Postfix, obj4Precedence: me.obj4Precedence, obj4Prefix: me.obj4Prefix, obj4Private: me.obj4Private, obj4Protocol: me.obj4Protocol, obj4Public: me.obj4Public, obj4Repeat: me.obj4Repeat, obj4Required: me.obj4Required, obj4Retain: me.obj4Retain, obj4Rethrows: me.obj4Rethrows, obj4Return: me.obj4Return, obj4Right: me.obj4Right, object: me.object, objectMapper: me.objectMapper, of: me.of, oneway: me.oneway, or: me.or, orEq: me.orEq, out: me.out, package: me.package, params: me.params, pass: me.pass, port: me.port, print: me.print, printMembers: me.printMembers, printf: me.printf, protected: me.protected, purpleProtocol: me.purpleProtocol, quicktype: me.quicktype, raise: me.raise, range: me.range, readonly: me.readonly, ref: me.ref, regExp: me.regExp, register: me.register, reinterpretCast: me.reinterpretCast, require: me.require, requires: me.requires, restrict: me.restrict, runtimeType: me.runtimeType, s: me.s, sbyte: me.sbyte, sealed: me.sealed, sel: me.sel, select: me.select)
10871+ self.init(dummy: me.dummy, noSuchMethod: me.noSuchMethod, noexcept: me.noexcept, nonatomic: me.nonatomic, none: me.none, nonlocal: me.nonlocal, not: me.not, notEq: me.notEq, nsError: me.nsError, nsObject: me.nsObject, nsString: me.nsString, null: me.null, nullptr: me.nullptr, number: me.number, obj4None: me.obj4None, obj4Nonmutating: me.obj4Nonmutating, obj4Null: me.obj4Null, obj4Open: me.obj4Open, obj4Operator: me.obj4Operator, obj4Optional: me.obj4Optional, obj4Override: me.obj4Override, obj4Postfix: me.obj4Postfix, obj4Precedence: me.obj4Precedence, obj4Prefix: me.obj4Prefix, obj4Private: me.obj4Private, obj4Protocol: me.obj4Protocol, obj4Public: me.obj4Public, obj4Repeat: me.obj4Repeat, obj4Required: me.obj4Required, obj4Retain: me.obj4Retain, obj4Rethrows: me.obj4Rethrows, obj4Return: me.obj4Return, obj4Right: me.obj4Right, object: me.object, objectMapper: me.objectMapper, of: me.of, oneway: me.oneway, or: me.or, orEq: me.orEq, out: me.out, package: me.package, params: me.params, pass: me.pass, port: me.port, print: me.print, printMembers: me.printMembers, printf: me.printf, protected: me.protected, purpleProtocol: me.purpleProtocol, quicktype: me.quicktype, raise: me.raise, range: me.range, readonly: me.readonly, ref: me.ref, regExp: me.regExp, register: me.register, reinterpretCast: me.reinterpretCast, require: me.require, requires: me.requires, restrict: me.restrict, runtimeType: me.runtimeType, s: me.s, sbyte: me.sbyte, sealed: me.sealed, sel: me.sel)
1081810872 }
1081910873
1082010874 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -10831,6 +10885,7 @@ extension Obj4 {
1083110885 func with(
1083210886 dummy: Int? = nil,
1083310887 noSuchMethod: NoSuchMethod? = nil,
10888+ noexcept: Noexcept? = nil,
1083410889 nonatomic: Nonatomic? = nil,
1083510890 none: None? = nil,
1083610891 nonlocal: Nonlocal? = nil,
@@ -10892,12 +10947,12 @@ extension Obj4 {
1089210947 s: S? = nil,
1089310948 sbyte: Sbyte? = nil,
1089410949 sealed: Sealed? = nil,
10895- sel: Sel? = nil,
10896- select: Select? = nil
10950+ sel: Sel? = nil
1089710951 ) -> Obj4 {
1089810952 return Obj4(
1089910953 dummy: dummy ?? self.dummy,
1090010954 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
10955+ noexcept: noexcept ?? self.noexcept,
1090110956 nonatomic: nonatomic ?? self.nonatomic,
1090210957 none: none ?? self.none,
1090310958 nonlocal: nonlocal ?? self.nonlocal,
@@ -10959,8 +11014,7 @@ extension Obj4 {
1095911014 s: s ?? self.s,
1096011015 sbyte: sbyte ?? self.sbyte,
1096111016 sealed: sealed ?? self.sealed,
10962- sel: sel ?? self.sel,
10963- select: select ?? self.select
11017+ sel: sel ?? self.sel
1096411018 )
1096511019 }
1096611020
@@ -11022,20 +11076,69 @@ extension NoSuchMethod {
1102211076 }
1102311077 }
1102411078
11025-// MARK: - Nonatomic
11026-@objcMembers class Nonatomic: NSObject, Codable {
11027- let nonatomic: Int
11079+// MARK: - Noexcept
11080+@objcMembers class Noexcept: NSObject, Codable {
11081+ let noexcept: Int
1102811082
1102911083 enum CodingKeys: String, CodingKey {
11030- case nonatomic = "nonatomic"
11084+ case noexcept = "noexcept"
1103111085 }
1103211086
11033- init(nonatomic: Int) {
11034- self.nonatomic = nonatomic
11087+ init(noexcept: Int) {
11088+ self.noexcept = noexcept
1103511089 }
1103611090 }
1103711091
11038-// MARK: Nonatomic convenience initializers and mutators
11092+// MARK: Noexcept convenience initializers and mutators
11093+
11094+extension Noexcept {
11095+ convenience init(data: Data) throws {
11096+ let me = try newJSONDecoder().decode(Noexcept.self, from: data)
11097+ self.init(noexcept: me.noexcept)
11098+ }
11099+
11100+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
11101+ guard let data = json.data(using: encoding) else {
11102+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11103+ }
11104+ try self.init(data: data)
11105+ }
11106+
11107+ convenience init(fromURL url: URL) throws {
11108+ try self.init(data: try Data(contentsOf: url))
11109+ }
11110+
11111+ func with(
11112+ noexcept: Int? = nil
11113+ ) -> Noexcept {
11114+ return Noexcept(
11115+ noexcept: noexcept ?? self.noexcept
11116+ )
11117+ }
11118+
11119+ func jsonData() throws -> Data {
11120+ return try newJSONEncoder().encode(self)
11121+ }
11122+
11123+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
11124+ return String(data: try self.jsonData(), encoding: encoding)
11125+ }
11126+}
11127+
11128+// MARK: - Nonatomic
11129+@objcMembers class Nonatomic: NSObject, Codable {
11130+ let nonatomic: Int
11131+
11132+ enum CodingKeys: String, CodingKey {
11133+ case nonatomic = "nonatomic"
11134+ }
11135+
11136+ init(nonatomic: Int) {
11137+ self.nonatomic = nonatomic
11138+ }
11139+}
11140+
11141+// MARK: Nonatomic convenience initializers and mutators
1103911142
1104011143 extension Nonatomic {
1104111144 convenience init(data: Data) throws {
@@ -14060,55 +14163,6 @@ extension Sel {
1406014163 }
1406114164 }
1406214165
14063-// MARK: - Select
14064-@objcMembers class Select: NSObject, Codable {
14065- let select: Int
14066-
14067- enum CodingKeys: String, CodingKey {
14068- case select = "select"
14069- }
14070-
14071- init(select: Int) {
14072- self.select = select
14073- }
14074-}
14075-
14076-// MARK: Select convenience initializers and mutators
14077-
14078-extension Select {
14079- convenience init(data: Data) throws {
14080- let me = try newJSONDecoder().decode(Select.self, from: data)
14081- self.init(select: me.select)
14082- }
14083-
14084- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14085- guard let data = json.data(using: encoding) else {
14086- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14087- }
14088- try self.init(data: data)
14089- }
14090-
14091- convenience init(fromURL url: URL) throws {
14092- try self.init(data: try Data(contentsOf: url))
14093- }
14094-
14095- func with(
14096- select: Int? = nil
14097- ) -> Select {
14098- return Select(
14099- select: select ?? self.select
14100- )
14101- }
14102-
14103- func jsonData() throws -> Data {
14104- return try newJSONEncoder().encode(self)
14105- }
14106-
14107- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
14108- return String(data: try self.jsonData(), encoding: encoding)
14109- }
14110-}
14111-
1411214166 // MARK: - Obj5
1411314167 @objcMembers class Obj5: NSObject, Codable {
1411414168 let dummy: Int
@@ -14130,6 +14184,7 @@ extension Select {
1413014184 let primitiveKind: PrimitiveKind
1413114185 let purpleSelf: Obj5Self
1413214186 let purpleTrue: TrueClass
14187+ let select: Select
1413314188 let sendable: Sendable
1413414189 let serialDescriptor: SerialDescriptor
1413514190 let serialName: SerialName
@@ -14158,6 +14213,7 @@ extension Select {
1415814213 let timeOnly: TimeOnly
1415914214 let timeOnlyConverter: TimeOnlyConverter
1416014215 let timeZone: TimeZoneClass
14216+ let toDict: ToDict
1416114217 let toJSON: ToJSON
1416214218 let toString: ToString
1416314219 let topLevel: TopLevelClass
@@ -14172,10 +14228,9 @@ extension Select {
1417214228 let unchecked: Unchecked
1417314229 let undefined: Undefined
1417414230 let union: Union
14231+ let unmarshalJSON: UnmarshalJSON
1417514232 let unsafe: Unsafe
14176- let unsigned: Unsigned
1417714233 let useSerializers: UseSerializers
14178- let ushort: Ushort
1417914234
1418014235 enum CodingKeys: String, CodingKey {
1418114236 case dummy = "dummy"
@@ -14197,6 +14252,7 @@ extension Select {
1419714252 case primitiveKind = "PrimitiveKind"
1419814253 case purpleSelf = "self"
1419914254 case purpleTrue = "true"
14255+ case select = "select"
1420014256 case sendable = "Sendable"
1420114257 case serialDescriptor = "SerialDescriptor"
1420214258 case serialName = "SerialName"
@@ -14225,6 +14281,7 @@ extension Select {
1422514281 case timeOnly = "TimeOnly"
1422614282 case timeOnlyConverter = "TimeOnlyConverter"
1422714283 case timeZone = "TimeZone"
14284+ case toDict = "to_dict"
1422814285 case toJSON = "to_json"
1422914286 case toString = "toString"
1423014287 case topLevel = "top_level"
@@ -14239,13 +14296,12 @@ extension Select {
1423914296 case unchecked = "unchecked"
1424014297 case undefined = "undefined"
1424114298 case union = "union"
14299+ case unmarshalJSON = "UnmarshalJSON"
1424214300 case unsafe = "unsafe"
14243- case unsigned = "unsigned"
1424414301 case useSerializers = "UseSerializers"
14245- case ushort = "ushort"
1424614302 }
1424714303
14248- init(dummy: Int, kSerializer: KSerializer, obj5Self: SelfClass, obj5Set: Set, obj5Static: Static, obj5Struct: Struct, obj5Subscript: Subscript, obj5Super: Super, obj5Switch: Switch, obj5Throw: Throw, obj5Throws: Throws, obj5True: True, obj5Try: Try, obj5Type: Obj5Type, obj5Typealias: Typealias, obj5Unowned: Unowned, primitiveKind: PrimitiveKind, purpleSelf: Obj5Self, purpleTrue: TrueClass, sendable: Sendable, serialDescriptor: SerialDescriptor, serialName: SerialName, serializable: Serializable, serialize: Serialize, serializerProvider: SerializerProvider, short: Short, signed: Signed, simpleModule: SimpleModule, sizeof: Sizeof, stackalloc: Stackalloc, standards: Standards, staticAssert: StaticAssert, staticCast: StaticCast, stdDeserializer: StdDeserializer, stdSerializer: StdSerializer, strictfp: Strictfp, string: StringClass, symbol: Symbol, synchronized: Synchronized, system: System, template: Template, then: Then, this: This, threadLocal: ThreadLocal, timeOnly: TimeOnly, timeOnlyConverter: TimeOnlyConverter, timeZone: TimeZoneClass, toJSON: ToJSON, toString: ToString, topLevel: TopLevelClass, transient: Transient, type: TypeClass, typedef: Typedef, typeid: Typeid, typename: Typename, typeof: Typeof, uint: Uint, ulong: Ulong, unchecked: Unchecked, undefined: Undefined, union: Union, unsafe: Unsafe, unsigned: Unsigned, useSerializers: UseSerializers, ushort: Ushort) {
14304+ init(dummy: Int, kSerializer: KSerializer, obj5Self: SelfClass, obj5Set: Set, obj5Static: Static, obj5Struct: Struct, obj5Subscript: Subscript, obj5Super: Super, obj5Switch: Switch, obj5Throw: Throw, obj5Throws: Throws, obj5True: True, obj5Try: Try, obj5Type: Obj5Type, obj5Typealias: Typealias, obj5Unowned: Unowned, primitiveKind: PrimitiveKind, purpleSelf: Obj5Self, purpleTrue: TrueClass, select: Select, sendable: Sendable, serialDescriptor: SerialDescriptor, serialName: SerialName, serializable: Serializable, serialize: Serialize, serializerProvider: SerializerProvider, short: Short, signed: Signed, simpleModule: SimpleModule, sizeof: Sizeof, stackalloc: Stackalloc, standards: Standards, staticAssert: StaticAssert, staticCast: StaticCast, stdDeserializer: StdDeserializer, stdSerializer: StdSerializer, strictfp: Strictfp, string: StringClass, symbol: Symbol, synchronized: Synchronized, system: System, template: Template, then: Then, this: This, threadLocal: ThreadLocal, timeOnly: TimeOnly, timeOnlyConverter: TimeOnlyConverter, timeZone: TimeZoneClass, toDict: ToDict, toJSON: ToJSON, toString: ToString, topLevel: TopLevelClass, transient: Transient, type: TypeClass, typedef: Typedef, typeid: Typeid, typename: Typename, typeof: Typeof, uint: Uint, ulong: Ulong, unchecked: Unchecked, undefined: Undefined, union: Union, unmarshalJSON: UnmarshalJSON, unsafe: Unsafe, useSerializers: UseSerializers) {
1424914305 self.dummy = dummy
1425014306 self.kSerializer = kSerializer
1425114307 self.obj5Self = obj5Self
@@ -14265,6 +14321,7 @@ extension Select {
1426514321 self.primitiveKind = primitiveKind
1426614322 self.purpleSelf = purpleSelf
1426714323 self.purpleTrue = purpleTrue
14324+ self.select = select
1426814325 self.sendable = sendable
1426914326 self.serialDescriptor = serialDescriptor
1427014327 self.serialName = serialName
@@ -14293,6 +14350,7 @@ extension Select {
1429314350 self.timeOnly = timeOnly
1429414351 self.timeOnlyConverter = timeOnlyConverter
1429514352 self.timeZone = timeZone
14353+ self.toDict = toDict
1429614354 self.toJSON = toJSON
1429714355 self.toString = toString
1429814356 self.topLevel = topLevel
@@ -14307,10 +14365,9 @@ extension Select {
1430714365 self.unchecked = unchecked
1430814366 self.undefined = undefined
1430914367 self.union = union
14368+ self.unmarshalJSON = unmarshalJSON
1431014369 self.unsafe = unsafe
14311- self.unsigned = unsigned
1431214370 self.useSerializers = useSerializers
14313- self.ushort = ushort
1431414371 }
1431514372 }
1431614373
@@ -14319,7 +14376,7 @@ extension Select {
1431914376 extension Obj5 {
1432014377 convenience init(data: Data) throws {
1432114378 let me = try newJSONDecoder().decode(Obj5.self, from: data)
14322- self.init(dummy: me.dummy, kSerializer: me.kSerializer, obj5Self: me.obj5Self, obj5Set: me.obj5Set, obj5Static: me.obj5Static, obj5Struct: me.obj5Struct, obj5Subscript: me.obj5Subscript, obj5Super: me.obj5Super, obj5Switch: me.obj5Switch, obj5Throw: me.obj5Throw, obj5Throws: me.obj5Throws, obj5True: me.obj5True, obj5Try: me.obj5Try, obj5Type: me.obj5Type, obj5Typealias: me.obj5Typealias, obj5Unowned: me.obj5Unowned, primitiveKind: me.primitiveKind, purpleSelf: me.purpleSelf, purpleTrue: me.purpleTrue, sendable: me.sendable, serialDescriptor: me.serialDescriptor, serialName: me.serialName, serializable: me.serializable, serialize: me.serialize, serializerProvider: me.serializerProvider, short: me.short, signed: me.signed, simpleModule: me.simpleModule, sizeof: me.sizeof, stackalloc: me.stackalloc, standards: me.standards, staticAssert: me.staticAssert, staticCast: me.staticCast, stdDeserializer: me.stdDeserializer, stdSerializer: me.stdSerializer, strictfp: me.strictfp, string: me.string, symbol: me.symbol, synchronized: me.synchronized, system: me.system, template: me.template, then: me.then, this: me.this, threadLocal: me.threadLocal, timeOnly: me.timeOnly, timeOnlyConverter: me.timeOnlyConverter, timeZone: me.timeZone, toJSON: me.toJSON, toString: me.toString, topLevel: me.topLevel, transient: me.transient, type: me.type, typedef: me.typedef, typeid: me.typeid, typename: me.typename, typeof: me.typeof, uint: me.uint, ulong: me.ulong, unchecked: me.unchecked, undefined: me.undefined, union: me.union, unsafe: me.unsafe, unsigned: me.unsigned, useSerializers: me.useSerializers, ushort: me.ushort)
14379+ self.init(dummy: me.dummy, kSerializer: me.kSerializer, obj5Self: me.obj5Self, obj5Set: me.obj5Set, obj5Static: me.obj5Static, obj5Struct: me.obj5Struct, obj5Subscript: me.obj5Subscript, obj5Super: me.obj5Super, obj5Switch: me.obj5Switch, obj5Throw: me.obj5Throw, obj5Throws: me.obj5Throws, obj5True: me.obj5True, obj5Try: me.obj5Try, obj5Type: me.obj5Type, obj5Typealias: me.obj5Typealias, obj5Unowned: me.obj5Unowned, primitiveKind: me.primitiveKind, purpleSelf: me.purpleSelf, purpleTrue: me.purpleTrue, select: me.select, sendable: me.sendable, serialDescriptor: me.serialDescriptor, serialName: me.serialName, serializable: me.serializable, serialize: me.serialize, serializerProvider: me.serializerProvider, short: me.short, signed: me.signed, simpleModule: me.simpleModule, sizeof: me.sizeof, stackalloc: me.stackalloc, standards: me.standards, staticAssert: me.staticAssert, staticCast: me.staticCast, stdDeserializer: me.stdDeserializer, stdSerializer: me.stdSerializer, strictfp: me.strictfp, string: me.string, symbol: me.symbol, synchronized: me.synchronized, system: me.system, template: me.template, then: me.then, this: me.this, threadLocal: me.threadLocal, timeOnly: me.timeOnly, timeOnlyConverter: me.timeOnlyConverter, timeZone: me.timeZone, toDict: me.toDict, toJSON: me.toJSON, toString: me.toString, topLevel: me.topLevel, transient: me.transient, type: me.type, typedef: me.typedef, typeid: me.typeid, typename: me.typename, typeof: me.typeof, uint: me.uint, ulong: me.ulong, unchecked: me.unchecked, undefined: me.undefined, union: me.union, unmarshalJSON: me.unmarshalJSON, unsafe: me.unsafe, useSerializers: me.useSerializers)
1432314380 }
1432414381
1432514382 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -14353,6 +14410,7 @@ extension Obj5 {
1435314410 primitiveKind: PrimitiveKind? = nil,
1435414411 purpleSelf: Obj5Self? = nil,
1435514412 purpleTrue: TrueClass? = nil,
14413+ select: Select? = nil,
1435614414 sendable: Sendable? = nil,
1435714415 serialDescriptor: SerialDescriptor? = nil,
1435814416 serialName: SerialName? = nil,
@@ -14381,6 +14439,7 @@ extension Obj5 {
1438114439 timeOnly: TimeOnly? = nil,
1438214440 timeOnlyConverter: TimeOnlyConverter? = nil,
1438314441 timeZone: TimeZoneClass? = nil,
14442+ toDict: ToDict? = nil,
1438414443 toJSON: ToJSON? = nil,
1438514444 toString: ToString? = nil,
1438614445 topLevel: TopLevelClass? = nil,
@@ -14395,10 +14454,9 @@ extension Obj5 {
1439514454 unchecked: Unchecked? = nil,
1439614455 undefined: Undefined? = nil,
1439714456 union: Union? = nil,
14457+ unmarshalJSON: UnmarshalJSON? = nil,
1439814458 unsafe: Unsafe? = nil,
14399- unsigned: Unsigned? = nil,
14400- useSerializers: UseSerializers? = nil,
14401- ushort: Ushort? = nil
14459+ useSerializers: UseSerializers? = nil
1440214460 ) -> Obj5 {
1440314461 return Obj5(
1440414462 dummy: dummy ?? self.dummy,
@@ -14420,6 +14478,7 @@ extension Obj5 {
1442014478 primitiveKind: primitiveKind ?? self.primitiveKind,
1442114479 purpleSelf: purpleSelf ?? self.purpleSelf,
1442214480 purpleTrue: purpleTrue ?? self.purpleTrue,
14481+ select: select ?? self.select,
1442314482 sendable: sendable ?? self.sendable,
1442414483 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
1442514484 serialName: serialName ?? self.serialName,
@@ -14448,6 +14507,7 @@ extension Obj5 {
1444814507 timeOnly: timeOnly ?? self.timeOnly,
1444914508 timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter,
1445014509 timeZone: timeZone ?? self.timeZone,
14510+ toDict: toDict ?? self.toDict,
1445114511 toJSON: toJSON ?? self.toJSON,
1445214512 toString: toString ?? self.toString,
1445314513 topLevel: topLevel ?? self.topLevel,
@@ -14462,10 +14522,9 @@ extension Obj5 {
1446214522 unchecked: unchecked ?? self.unchecked,
1446314523 undefined: undefined ?? self.undefined,
1446414524 union: union ?? self.union,
14525+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
1446514526 unsafe: unsafe ?? self.unsafe,
14466- unsigned: unsigned ?? self.unsigned,
14467- useSerializers: useSerializers ?? self.useSerializers,
14468- ushort: ushort ?? self.ushort
14527+ useSerializers: useSerializers ?? self.useSerializers
1446914528 )
1447014529 }
1447114530
@@ -15360,6 +15419,55 @@ extension TrueClass {
1536015419 }
1536115420 }
1536215421
15422+// MARK: - Select
15423+@objcMembers class Select: NSObject, Codable {
15424+ let select: Int
15425+
15426+ enum CodingKeys: String, CodingKey {
15427+ case select = "select"
15428+ }
15429+
15430+ init(select: Int) {
15431+ self.select = select
15432+ }
15433+}
15434+
15435+// MARK: Select convenience initializers and mutators
15436+
15437+extension Select {
15438+ convenience init(data: Data) throws {
15439+ let me = try newJSONDecoder().decode(Select.self, from: data)
15440+ self.init(select: me.select)
15441+ }
15442+
15443+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15444+ guard let data = json.data(using: encoding) else {
15445+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15446+ }
15447+ try self.init(data: data)
15448+ }
15449+
15450+ convenience init(fromURL url: URL) throws {
15451+ try self.init(data: try Data(contentsOf: url))
15452+ }
15453+
15454+ func with(
15455+ select: Int? = nil
15456+ ) -> Select {
15457+ return Select(
15458+ select: select ?? self.select
15459+ )
15460+ }
15461+
15462+ func jsonData() throws -> Data {
15463+ return try newJSONEncoder().encode(self)
15464+ }
15465+
15466+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15467+ return String(data: try self.jsonData(), encoding: encoding)
15468+ }
15469+}
15470+
1536315471 // MARK: - Sendable
1536415472 @objcMembers class Sendable: NSObject, Codable {
1536515473 let sendable: Int
@@ -16732,6 +16840,55 @@ extension TimeZoneClass {
1673216840 }
1673316841 }
1673416842
16843+// MARK: - ToDict
16844+@objcMembers class ToDict: NSObject, Codable {
16845+ let toDict: Int
16846+
16847+ enum CodingKeys: String, CodingKey {
16848+ case toDict = "to_dict"
16849+ }
16850+
16851+ init(toDict: Int) {
16852+ self.toDict = toDict
16853+ }
16854+}
16855+
16856+// MARK: ToDict convenience initializers and mutators
16857+
16858+extension ToDict {
16859+ convenience init(data: Data) throws {
16860+ let me = try newJSONDecoder().decode(ToDict.self, from: data)
16861+ self.init(toDict: me.toDict)
16862+ }
16863+
16864+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16865+ guard let data = json.data(using: encoding) else {
16866+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16867+ }
16868+ try self.init(data: data)
16869+ }
16870+
16871+ convenience init(fromURL url: URL) throws {
16872+ try self.init(data: try Data(contentsOf: url))
16873+ }
16874+
16875+ func with(
16876+ toDict: Int? = nil
16877+ ) -> ToDict {
16878+ return ToDict(
16879+ toDict: toDict ?? self.toDict
16880+ )
16881+ }
16882+
16883+ func jsonData() throws -> Data {
16884+ return try newJSONEncoder().encode(self)
16885+ }
16886+
16887+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16888+ return String(data: try self.jsonData(), encoding: encoding)
16889+ }
16890+}
16891+
1673516892 // MARK: - ToJSON
1673616893 @objcMembers class ToJSON: NSObject, Codable {
1673716894 let toJSON: Int
@@ -17418,25 +17575,25 @@ extension Union {
1741817575 }
1741917576 }
1742017577
17421-// MARK: - Unsafe
17422-@objcMembers class Unsafe: NSObject, Codable {
17423- let unsafe: Int
17578+// MARK: - UnmarshalJSON
17579+@objcMembers class UnmarshalJSON: NSObject, Codable {
17580+ let unmarshalJSON: Int
1742417581
1742517582 enum CodingKeys: String, CodingKey {
17426- case unsafe = "unsafe"
17583+ case unmarshalJSON = "UnmarshalJSON"
1742717584 }
1742817585
17429- init(unsafe: Int) {
17430- self.unsafe = unsafe
17586+ init(unmarshalJSON: Int) {
17587+ self.unmarshalJSON = unmarshalJSON
1743117588 }
1743217589 }
1743317590
17434-// MARK: Unsafe convenience initializers and mutators
17591+// MARK: UnmarshalJSON convenience initializers and mutators
1743517592
17436-extension Unsafe {
17593+extension UnmarshalJSON {
1743717594 convenience init(data: Data) throws {
17438- let me = try newJSONDecoder().decode(Unsafe.self, from: data)
17439- self.init(unsafe: me.unsafe)
17595+ let me = try newJSONDecoder().decode(UnmarshalJSON.self, from: data)
17596+ self.init(unmarshalJSON: me.unmarshalJSON)
1744017597 }
1744117598
1744217599 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -17451,10 +17608,10 @@ extension Unsafe {
1745117608 }
1745217609
1745317610 func with(
17454- unsafe: Int? = nil
17455- ) -> Unsafe {
17456- return Unsafe(
17457- unsafe: unsafe ?? self.unsafe
17611+ unmarshalJSON: Int? = nil
17612+ ) -> UnmarshalJSON {
17613+ return UnmarshalJSON(
17614+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1745817615 )
1745917616 }
1746017617
@@ -17467,25 +17624,25 @@ extension Unsafe {
1746717624 }
1746817625 }
1746917626
17470-// MARK: - Unsigned
17471-@objcMembers class Unsigned: NSObject, Codable {
17472- let unsigned: Int
17627+// MARK: - Unsafe
17628+@objcMembers class Unsafe: NSObject, Codable {
17629+ let unsafe: Int
1747317630
1747417631 enum CodingKeys: String, CodingKey {
17475- case unsigned = "unsigned"
17632+ case unsafe = "unsafe"
1747617633 }
1747717634
17478- init(unsigned: Int) {
17479- self.unsigned = unsigned
17635+ init(unsafe: Int) {
17636+ self.unsafe = unsafe
1748017637 }
1748117638 }
1748217639
17483-// MARK: Unsigned convenience initializers and mutators
17640+// MARK: Unsafe convenience initializers and mutators
1748417641
17485-extension Unsigned {
17642+extension Unsafe {
1748617643 convenience init(data: Data) throws {
17487- let me = try newJSONDecoder().decode(Unsigned.self, from: data)
17488- self.init(unsigned: me.unsigned)
17644+ let me = try newJSONDecoder().decode(Unsafe.self, from: data)
17645+ self.init(unsafe: me.unsafe)
1748917646 }
1749017647
1749117648 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -17500,10 +17657,10 @@ extension Unsigned {
1750017657 }
1750117658
1750217659 func with(
17503- unsigned: Int? = nil
17504- ) -> Unsigned {
17505- return Unsigned(
17506- unsigned: unsigned ?? self.unsigned
17660+ unsafe: Int? = nil
17661+ ) -> Unsafe {
17662+ return Unsafe(
17663+ unsafe: unsafe ?? self.unsafe
1750717664 )
1750817665 }
1750917666
@@ -17565,55 +17722,6 @@ extension UseSerializers {
1756517722 }
1756617723 }
1756717724
17568-// MARK: - Ushort
17569-@objcMembers class Ushort: NSObject, Codable {
17570- let ushort: Int
17571-
17572- enum CodingKeys: String, CodingKey {
17573- case ushort = "ushort"
17574- }
17575-
17576- init(ushort: Int) {
17577- self.ushort = ushort
17578- }
17579-}
17580-
17581-// MARK: Ushort convenience initializers and mutators
17582-
17583-extension Ushort {
17584- convenience init(data: Data) throws {
17585- let me = try newJSONDecoder().decode(Ushort.self, from: data)
17586- self.init(ushort: me.ushort)
17587- }
17588-
17589- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17590- guard let data = json.data(using: encoding) else {
17591- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17592- }
17593- try self.init(data: data)
17594- }
17595-
17596- convenience init(fromURL url: URL) throws {
17597- try self.init(data: try Data(contentsOf: url))
17598- }
17599-
17600- func with(
17601- ushort: Int? = nil
17602- ) -> Ushort {
17603- return Ushort(
17604- ushort: ushort ?? self.ushort
17605- )
17606- }
17607-
17608- func jsonData() throws -> Data {
17609- return try newJSONEncoder().encode(self)
17610- }
17611-
17612- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17613- return String(data: try self.jsonData(), encoding: encoding)
17614- }
17615-}
17616-
1761717725 // MARK: - Obj6
1761817726 @objcMembers class Obj6: NSObject, Codable {
1761917727 let dummy: Int
@@ -17622,6 +17730,8 @@ extension Ushort {
1762217730 let obj6Where: Where
1762317731 let obj6While: While
1762417732 let obj6WillSet: WillSet
17733+ let unsigned: Unsigned
17734+ let ushort: Ushort
1762517735 let using: Using
1762617736 let utf8JSONReader: Utf8JSONReader
1762717737 let utf8JSONWriter: Utf8JSONWriter
@@ -17643,6 +17753,8 @@ extension Ushort {
1764317753 case obj6Where = "where"
1764417754 case obj6While = "while"
1764517755 case obj6WillSet = "willSet"
17756+ case unsigned = "unsigned"
17757+ case ushort = "ushort"
1764617758 case using = "using"
1764717759 case utf8JSONReader = "Utf8JsonReader"
1764817760 case utf8JSONWriter = "Utf8JsonWriter"
@@ -17658,13 +17770,15 @@ extension Ushort {
1765817770 case yield = "yield"
1765917771 }
1766017772
17661- init(dummy: Int, obj6Var: Var, obj6Weak: Weak, obj6Where: Where, obj6While: While, obj6WillSet: WillSet, using: Using, utf8JSONReader: Utf8JSONReader, utf8JSONWriter: Utf8JSONWriter, uuid: UUIDClass, virtual: Virtual, void: Void, volatile: Volatile, wcharT: WcharT, with: With, xor: Xor, xorEq: XorEq, yes: Yes, yield: Yield) {
17773+ init(dummy: Int, obj6Var: Var, obj6Weak: Weak, obj6Where: Where, obj6While: While, obj6WillSet: WillSet, unsigned: Unsigned, ushort: Ushort, using: Using, utf8JSONReader: Utf8JSONReader, utf8JSONWriter: Utf8JSONWriter, uuid: UUIDClass, virtual: Virtual, void: Void, volatile: Volatile, wcharT: WcharT, with: With, xor: Xor, xorEq: XorEq, yes: Yes, yield: Yield) {
1766217774 self.dummy = dummy
1766317775 self.obj6Var = obj6Var
1766417776 self.obj6Weak = obj6Weak
1766517777 self.obj6Where = obj6Where
1766617778 self.obj6While = obj6While
1766717779 self.obj6WillSet = obj6WillSet
17780+ self.unsigned = unsigned
17781+ self.ushort = ushort
1766817782 self.using = using
1766917783 self.utf8JSONReader = utf8JSONReader
1767017784 self.utf8JSONWriter = utf8JSONWriter
@@ -17686,7 +17800,7 @@ extension Ushort {
1768617800 extension Obj6 {
1768717801 convenience init(data: Data) throws {
1768817802 let me = try newJSONDecoder().decode(Obj6.self, from: data)
17689- self.init(dummy: me.dummy, obj6Var: me.obj6Var, obj6Weak: me.obj6Weak, obj6Where: me.obj6Where, obj6While: me.obj6While, obj6WillSet: me.obj6WillSet, using: me.using, utf8JSONReader: me.utf8JSONReader, utf8JSONWriter: me.utf8JSONWriter, uuid: me.uuid, virtual: me.virtual, void: me.void, volatile: me.volatile, wcharT: me.wcharT, with: me.with, xor: me.xor, xorEq: me.xorEq, yes: me.yes, yield: me.yield)
17803+ self.init(dummy: me.dummy, obj6Var: me.obj6Var, obj6Weak: me.obj6Weak, obj6Where: me.obj6Where, obj6While: me.obj6While, obj6WillSet: me.obj6WillSet, unsigned: me.unsigned, ushort: me.ushort, using: me.using, utf8JSONReader: me.utf8JSONReader, utf8JSONWriter: me.utf8JSONWriter, uuid: me.uuid, virtual: me.virtual, void: me.void, volatile: me.volatile, wcharT: me.wcharT, with: me.with, xor: me.xor, xorEq: me.xorEq, yes: me.yes, yield: me.yield)
1769017804 }
1769117805
1769217806 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -17707,6 +17821,8 @@ extension Obj6 {
1770717821 obj6Where: Where? = nil,
1770817822 obj6While: While? = nil,
1770917823 obj6WillSet: WillSet? = nil,
17824+ unsigned: Unsigned? = nil,
17825+ ushort: Ushort? = nil,
1771017826 using: Using? = nil,
1771117827 utf8JSONReader: Utf8JSONReader? = nil,
1771217828 utf8JSONWriter: Utf8JSONWriter? = nil,
@@ -17728,6 +17844,8 @@ extension Obj6 {
1772817844 obj6Where: obj6Where ?? self.obj6Where,
1772917845 obj6While: obj6While ?? self.obj6While,
1773017846 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
17847+ unsigned: unsigned ?? self.unsigned,
17848+ ushort: ushort ?? self.ushort,
1773117849 using: using ?? self.using,
1773217850 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
1773317851 utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter,
@@ -17998,6 +18116,104 @@ extension WillSet {
1799818116 }
1799918117 }
1800018118
18119+// MARK: - Unsigned
18120+@objcMembers class Unsigned: NSObject, Codable {
18121+ let unsigned: Int
18122+
18123+ enum CodingKeys: String, CodingKey {
18124+ case unsigned = "unsigned"
18125+ }
18126+
18127+ init(unsigned: Int) {
18128+ self.unsigned = unsigned
18129+ }
18130+}
18131+
18132+// MARK: Unsigned convenience initializers and mutators
18133+
18134+extension Unsigned {
18135+ convenience init(data: Data) throws {
18136+ let me = try newJSONDecoder().decode(Unsigned.self, from: data)
18137+ self.init(unsigned: me.unsigned)
18138+ }
18139+
18140+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18141+ guard let data = json.data(using: encoding) else {
18142+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18143+ }
18144+ try self.init(data: data)
18145+ }
18146+
18147+ convenience init(fromURL url: URL) throws {
18148+ try self.init(data: try Data(contentsOf: url))
18149+ }
18150+
18151+ func with(
18152+ unsigned: Int? = nil
18153+ ) -> Unsigned {
18154+ return Unsigned(
18155+ unsigned: unsigned ?? self.unsigned
18156+ )
18157+ }
18158+
18159+ func jsonData() throws -> Data {
18160+ return try newJSONEncoder().encode(self)
18161+ }
18162+
18163+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18164+ return String(data: try self.jsonData(), encoding: encoding)
18165+ }
18166+}
18167+
18168+// MARK: - Ushort
18169+@objcMembers class Ushort: NSObject, Codable {
18170+ let ushort: Int
18171+
18172+ enum CodingKeys: String, CodingKey {
18173+ case ushort = "ushort"
18174+ }
18175+
18176+ init(ushort: Int) {
18177+ self.ushort = ushort
18178+ }
18179+}
18180+
18181+// MARK: Ushort convenience initializers and mutators
18182+
18183+extension Ushort {
18184+ convenience init(data: Data) throws {
18185+ let me = try newJSONDecoder().decode(Ushort.self, from: data)
18186+ self.init(ushort: me.ushort)
18187+ }
18188+
18189+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18190+ guard let data = json.data(using: encoding) else {
18191+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18192+ }
18193+ try self.init(data: data)
18194+ }
18195+
18196+ convenience init(fromURL url: URL) throws {
18197+ try self.init(data: try Data(contentsOf: url))
18198+ }
18199+
18200+ func with(
18201+ ushort: Int? = nil
18202+ ) -> Ushort {
18203+ return Ushort(
18204+ ushort: ushort ?? self.ushort
18205+ )
18206+ }
18207+
18208+ func jsonData() throws -> Data {
18209+ return try newJSONEncoder().encode(self)
18210+ }
18211+
18212+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18213+ return String(data: try self.jsonData(), encoding: encoding)
18214+ }
18215+}
18216+
1800118217 // MARK: - Using
1800218218 @objcMembers class Using: NSObject, Codable {
1800318219 let using: Int
Mswiftprotocol-equatable--bd9068f466c1 / quicktype.swift+466 −250
@@ -3636,11 +3636,11 @@ struct Obj2: Codable, Equatable {
36363636 let formatException: FormatException
36373637 let friend: Friend
36383638 let from: From
3639+ let fromDict: FromDict
36393640 let fromJSON: FromJSON
36403641 let function: Function
36413642 let global: Global
36423643 let go: Go
3643- let goto: Goto
36443644 let obj2Default: Default
36453645 let obj2Defer: Defer
36463646 let obj2Deinit: Deinit
@@ -3703,11 +3703,11 @@ struct Obj2: Codable, Equatable {
37033703 case formatException = "FormatException"
37043704 case friend = "friend"
37053705 case from = "from"
3706+ case fromDict = "from_dict"
37063707 case fromJSON = "from_json"
37073708 case function = "function"
37083709 case global = "global"
37093710 case go = "go"
3710- case goto = "goto"
37113711 case obj2Default = "default"
37123712 case obj2Defer = "defer"
37133713 case obj2Deinit = "deinit"
@@ -3790,11 +3790,11 @@ extension Obj2 {
37903790 formatException: FormatException? = nil,
37913791 friend: Friend? = nil,
37923792 from: From? = nil,
3793+ fromDict: FromDict? = nil,
37933794 fromJSON: FromJSON? = nil,
37943795 function: Function? = nil,
37953796 global: Global? = nil,
37963797 go: Go? = nil,
3797- goto: Goto? = nil,
37983798 obj2Default: Default? = nil,
37993799 obj2Defer: Defer? = nil,
38003800 obj2Deinit: Deinit? = nil,
@@ -3857,11 +3857,11 @@ extension Obj2 {
38573857 formatException: formatException ?? self.formatException,
38583858 friend: friend ?? self.friend,
38593859 from: from ?? self.from,
3860+ fromDict: fromDict ?? self.fromDict,
38603861 fromJSON: fromJSON ?? self.fromJSON,
38613862 function: function ?? self.function,
38623863 global: global ?? self.global,
38633864 go: go ?? self.go,
3864- goto: goto ?? self.goto,
38653865 obj2Default: obj2Default ?? self.obj2Default,
38663866 obj2Defer: obj2Defer ?? self.obj2Defer,
38673867 obj2Deinit: obj2Deinit ?? self.obj2Deinit,
@@ -6002,6 +6002,56 @@ extension From {
60026002 // for types that require the use of JSONAny, nor will the implementation of Hashable be
60036003 // synthesized for types that have collections (such as arrays or dictionaries).
60046004
6005+// MARK: - FromDict
6006+struct FromDict: Codable, Equatable {
6007+ let fromDict: Int
6008+
6009+ enum CodingKeys: String, CodingKey {
6010+ case fromDict = "from_dict"
6011+ }
6012+}
6013+
6014+// MARK: FromDict convenience initializers and mutators
6015+
6016+extension FromDict {
6017+ init(data: Data) throws {
6018+ self = try newJSONDecoder().decode(FromDict.self, from: data)
6019+ }
6020+
6021+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
6022+ guard let data = json.data(using: encoding) else {
6023+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
6024+ }
6025+ try self.init(data: data)
6026+ }
6027+
6028+ init(fromURL url: URL) throws {
6029+ try self.init(data: try Data(contentsOf: url))
6030+ }
6031+
6032+ func with(
6033+ fromDict: Int? = nil
6034+ ) -> FromDict {
6035+ return FromDict(
6036+ fromDict: fromDict ?? self.fromDict
6037+ )
6038+ }
6039+
6040+ func jsonData() throws -> Data {
6041+ return try newJSONEncoder().encode(self)
6042+ }
6043+
6044+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
6045+ return String(data: try self.jsonData(), encoding: encoding)
6046+ }
6047+}
6048+
6049+//
6050+// Hashable or Equatable:
6051+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
6052+// for types that require the use of JSONAny, nor will the implementation of Hashable be
6053+// synthesized for types that have collections (such as arrays or dictionaries).
6054+
60056055 // MARK: - FromJSON
60066056 struct FromJSON: Codable, Equatable {
60076057 let fromJSON: Int
@@ -6202,56 +6252,6 @@ extension Go {
62026252 // for types that require the use of JSONAny, nor will the implementation of Hashable be
62036253 // synthesized for types that have collections (such as arrays or dictionaries).
62046254
6205-// MARK: - Goto
6206-struct Goto: Codable, Equatable {
6207- let goto: Int
6208-
6209- enum CodingKeys: String, CodingKey {
6210- case goto = "goto"
6211- }
6212-}
6213-
6214-// MARK: Goto convenience initializers and mutators
6215-
6216-extension Goto {
6217- init(data: Data) throws {
6218- self = try newJSONDecoder().decode(Goto.self, from: data)
6219- }
6220-
6221- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
6222- guard let data = json.data(using: encoding) else {
6223- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
6224- }
6225- try self.init(data: data)
6226- }
6227-
6228- init(fromURL url: URL) throws {
6229- try self.init(data: try Data(contentsOf: url))
6230- }
6231-
6232- func with(
6233- goto: Int? = nil
6234- ) -> Goto {
6235- return Goto(
6236- goto: goto ?? self.goto
6237- )
6238- }
6239-
6240- func jsonData() throws -> Data {
6241- return try newJSONEncoder().encode(self)
6242- }
6243-
6244- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
6245- return String(data: try self.jsonData(), encoding: encoding)
6246- }
6247-}
6248-
6249-//
6250-// Hashable or Equatable:
6251-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
6252-// for types that require the use of JSONAny, nor will the implementation of Hashable be
6253-// synthesized for types that have collections (such as arrays or dictionaries).
6254-
62556255 // MARK: - Default
62566256 struct Default: Codable, Equatable {
62576257 let defaultDefault: Int
@@ -7105,6 +7105,7 @@ extension FalseClass {
71057105 // MARK: - Obj3
71067106 struct Obj3: Codable, Equatable {
71077107 let dummy: Int
7108+ let goto: Goto
71087109 let hasOwnProperty: HasOwnProperty
71097110 let hashCode: HashCode
71107111 let hashable: HashableClass
@@ -7144,6 +7145,7 @@ struct Obj3: Codable, Equatable {
71447145 let long: Long
71457146 let map: Map
71467147 let mapEntry: MapEntry
7148+ let marshalJSON: MarshalJSON
71477149 let metadataPropertyHandling: MetadataPropertyHandling
71487150 let module: Module
71497151 let mutable: Mutable
@@ -7152,7 +7154,6 @@ struct Obj3: Codable, Equatable {
71527154 let new: New
71537155 let newtonsoft: Newtonsoft
71547156 let no: No
7155- let noexcept: Noexcept
71567157 let obj3Guard: Guard
71577158 let obj3If: If
71587159 let obj3Import: Import
@@ -7172,6 +7173,7 @@ struct Obj3: Codable, Equatable {
71727173
71737174 enum CodingKeys: String, CodingKey {
71747175 case dummy = "dummy"
7176+ case goto = "goto"
71757177 case hasOwnProperty = "hasOwnProperty"
71767178 case hashCode = "hashCode"
71777179 case hashable = "Hashable"
@@ -7211,6 +7213,7 @@ struct Obj3: Codable, Equatable {
72117213 case long = "long"
72127214 case map = "map"
72137215 case mapEntry = "MapEntry"
7216+ case marshalJSON = "MarshalJSON"
72147217 case metadataPropertyHandling = "metadata_property_handling"
72157218 case module = "module"
72167219 case mutable = "mutable"
@@ -7219,7 +7222,6 @@ struct Obj3: Codable, Equatable {
72197222 case new = "new"
72207223 case newtonsoft = "newtonsoft"
72217224 case no = "NO"
7222- case noexcept = "noexcept"
72237225 case obj3Guard = "guard"
72247226 case obj3If = "if"
72257227 case obj3Import = "import"
@@ -7259,6 +7261,7 @@ extension Obj3 {
72597261
72607262 func with(
72617263 dummy: Int? = nil,
7264+ goto: Goto? = nil,
72627265 hasOwnProperty: HasOwnProperty? = nil,
72637266 hashCode: HashCode? = nil,
72647267 hashable: HashableClass? = nil,
@@ -7298,6 +7301,7 @@ extension Obj3 {
72987301 long: Long? = nil,
72997302 map: Map? = nil,
73007303 mapEntry: MapEntry? = nil,
7304+ marshalJSON: MarshalJSON? = nil,
73017305 metadataPropertyHandling: MetadataPropertyHandling? = nil,
73027306 module: Module? = nil,
73037307 mutable: Mutable? = nil,
@@ -7306,7 +7310,6 @@ extension Obj3 {
73067310 new: New? = nil,
73077311 newtonsoft: Newtonsoft? = nil,
73087312 no: No? = nil,
7309- noexcept: Noexcept? = nil,
73107313 obj3Guard: Guard? = nil,
73117314 obj3If: If? = nil,
73127315 obj3Import: Import? = nil,
@@ -7326,6 +7329,7 @@ extension Obj3 {
73267329 ) -> Obj3 {
73277330 return Obj3(
73287331 dummy: dummy ?? self.dummy,
7332+ goto: goto ?? self.goto,
73297333 hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty,
73307334 hashCode: hashCode ?? self.hashCode,
73317335 hashable: hashable ?? self.hashable,
@@ -7365,6 +7369,7 @@ extension Obj3 {
73657369 long: long ?? self.long,
73667370 map: map ?? self.map,
73677371 mapEntry: mapEntry ?? self.mapEntry,
7372+ marshalJSON: marshalJSON ?? self.marshalJSON,
73687373 metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling,
73697374 module: module ?? self.module,
73707375 mutable: mutable ?? self.mutable,
@@ -7373,7 +7378,6 @@ extension Obj3 {
73737378 new: new ?? self.new,
73747379 newtonsoft: newtonsoft ?? self.newtonsoft,
73757380 no: no ?? self.no,
7376- noexcept: noexcept ?? self.noexcept,
73777381 obj3Guard: obj3Guard ?? self.obj3Guard,
73787382 obj3If: obj3If ?? self.obj3If,
73797383 obj3Import: obj3Import ?? self.obj3Import,
@@ -7408,6 +7412,56 @@ extension Obj3 {
74087412 // for types that require the use of JSONAny, nor will the implementation of Hashable be
74097413 // synthesized for types that have collections (such as arrays or dictionaries).
74107414
7415+// MARK: - Goto
7416+struct Goto: Codable, Equatable {
7417+ let goto: Int
7418+
7419+ enum CodingKeys: String, CodingKey {
7420+ case goto = "goto"
7421+ }
7422+}
7423+
7424+// MARK: Goto convenience initializers and mutators
7425+
7426+extension Goto {
7427+ init(data: Data) throws {
7428+ self = try newJSONDecoder().decode(Goto.self, from: data)
7429+ }
7430+
7431+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
7432+ guard let data = json.data(using: encoding) else {
7433+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
7434+ }
7435+ try self.init(data: data)
7436+ }
7437+
7438+ init(fromURL url: URL) throws {
7439+ try self.init(data: try Data(contentsOf: url))
7440+ }
7441+
7442+ func with(
7443+ goto: Int? = nil
7444+ ) -> Goto {
7445+ return Goto(
7446+ goto: goto ?? self.goto
7447+ )
7448+ }
7449+
7450+ func jsonData() throws -> Data {
7451+ return try newJSONEncoder().encode(self)
7452+ }
7453+
7454+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
7455+ return String(data: try self.jsonData(), encoding: encoding)
7456+ }
7457+}
7458+
7459+//
7460+// Hashable or Equatable:
7461+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
7462+// for types that require the use of JSONAny, nor will the implementation of Hashable be
7463+// synthesized for types that have collections (such as arrays or dictionaries).
7464+
74117465 // MARK: - HasOwnProperty
74127466 struct HasOwnProperty: Codable, Equatable {
74137467 let hasOwnProperty: Int
@@ -9358,6 +9412,56 @@ extension MapEntry {
93589412 // for types that require the use of JSONAny, nor will the implementation of Hashable be
93599413 // synthesized for types that have collections (such as arrays or dictionaries).
93609414
9415+// MARK: - MarshalJSON
9416+struct MarshalJSON: Codable, Equatable {
9417+ let marshalJSON: Int
9418+
9419+ enum CodingKeys: String, CodingKey {
9420+ case marshalJSON = "MarshalJSON"
9421+ }
9422+}
9423+
9424+// MARK: MarshalJSON convenience initializers and mutators
9425+
9426+extension MarshalJSON {
9427+ init(data: Data) throws {
9428+ self = try newJSONDecoder().decode(MarshalJSON.self, from: data)
9429+ }
9430+
9431+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9432+ guard let data = json.data(using: encoding) else {
9433+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9434+ }
9435+ try self.init(data: data)
9436+ }
9437+
9438+ init(fromURL url: URL) throws {
9439+ try self.init(data: try Data(contentsOf: url))
9440+ }
9441+
9442+ func with(
9443+ marshalJSON: Int? = nil
9444+ ) -> MarshalJSON {
9445+ return MarshalJSON(
9446+ marshalJSON: marshalJSON ?? self.marshalJSON
9447+ )
9448+ }
9449+
9450+ func jsonData() throws -> Data {
9451+ return try newJSONEncoder().encode(self)
9452+ }
9453+
9454+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9455+ return String(data: try self.jsonData(), encoding: encoding)
9456+ }
9457+}
9458+
9459+//
9460+// Hashable or Equatable:
9461+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
9462+// for types that require the use of JSONAny, nor will the implementation of Hashable be
9463+// synthesized for types that have collections (such as arrays or dictionaries).
9464+
93619465 // MARK: - MetadataPropertyHandling
93629466 struct MetadataPropertyHandling: Codable, Equatable {
93639467 let metadataPropertyHandling: Int
@@ -9758,56 +9862,6 @@ extension No {
97589862 // for types that require the use of JSONAny, nor will the implementation of Hashable be
97599863 // synthesized for types that have collections (such as arrays or dictionaries).
97609864
9761-// MARK: - Noexcept
9762-struct Noexcept: Codable, Equatable {
9763- let noexcept: Int
9764-
9765- enum CodingKeys: String, CodingKey {
9766- case noexcept = "noexcept"
9767- }
9768-}
9769-
9770-// MARK: Noexcept convenience initializers and mutators
9771-
9772-extension Noexcept {
9773- init(data: Data) throws {
9774- self = try newJSONDecoder().decode(Noexcept.self, from: data)
9775- }
9776-
9777- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9778- guard let data = json.data(using: encoding) else {
9779- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9780- }
9781- try self.init(data: data)
9782- }
9783-
9784- init(fromURL url: URL) throws {
9785- try self.init(data: try Data(contentsOf: url))
9786- }
9787-
9788- func with(
9789- noexcept: Int? = nil
9790- ) -> Noexcept {
9791- return Noexcept(
9792- noexcept: noexcept ?? self.noexcept
9793- )
9794- }
9795-
9796- func jsonData() throws -> Data {
9797- return try newJSONEncoder().encode(self)
9798- }
9799-
9800- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9801- return String(data: try self.jsonData(), encoding: encoding)
9802- }
9803-}
9804-
9805-//
9806-// Hashable or Equatable:
9807-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
9808-// for types that require the use of JSONAny, nor will the implementation of Hashable be
9809-// synthesized for types that have collections (such as arrays or dictionaries).
9810-
98119865 // MARK: - Guard
98129866 struct Guard: Codable, Equatable {
98139867 let guardGuard: Int
@@ -10612,6 +10666,7 @@ extension Nil {
1061210666 struct Obj4: Codable, Equatable {
1061310667 let dummy: Int
1061410668 let noSuchMethod: NoSuchMethod
10669+ let noexcept: Noexcept
1061510670 let nonatomic: Nonatomic
1061610671 let none: None
1061710672 let nonlocal: Nonlocal
@@ -10674,11 +10729,11 @@ struct Obj4: Codable, Equatable {
1067410729 let sbyte: Sbyte
1067510730 let sealed: Sealed
1067610731 let sel: Sel
10677- let select: Select
1067810732
1067910733 enum CodingKeys: String, CodingKey {
1068010734 case dummy = "dummy"
1068110735 case noSuchMethod = "noSuchMethod"
10736+ case noexcept = "noexcept"
1068210737 case nonatomic = "nonatomic"
1068310738 case none = "None"
1068410739 case nonlocal = "nonlocal"
@@ -10741,7 +10796,6 @@ struct Obj4: Codable, Equatable {
1074110796 case sbyte = "sbyte"
1074210797 case sealed = "sealed"
1074310798 case sel = "SEL"
10744- case select = "select"
1074510799 }
1074610800 }
1074710801
@@ -10766,6 +10820,7 @@ extension Obj4 {
1076610820 func with(
1076710821 dummy: Int? = nil,
1076810822 noSuchMethod: NoSuchMethod? = nil,
10823+ noexcept: Noexcept? = nil,
1076910824 nonatomic: Nonatomic? = nil,
1077010825 none: None? = nil,
1077110826 nonlocal: Nonlocal? = nil,
@@ -10827,12 +10882,12 @@ extension Obj4 {
1082710882 s: S? = nil,
1082810883 sbyte: Sbyte? = nil,
1082910884 sealed: Sealed? = nil,
10830- sel: Sel? = nil,
10831- select: Select? = nil
10885+ sel: Sel? = nil
1083210886 ) -> Obj4 {
1083310887 return Obj4(
1083410888 dummy: dummy ?? self.dummy,
1083510889 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
10890+ noexcept: noexcept ?? self.noexcept,
1083610891 nonatomic: nonatomic ?? self.nonatomic,
1083710892 none: none ?? self.none,
1083810893 nonlocal: nonlocal ?? self.nonlocal,
@@ -10894,8 +10949,7 @@ extension Obj4 {
1089410949 s: s ?? self.s,
1089510950 sbyte: sbyte ?? self.sbyte,
1089610951 sealed: sealed ?? self.sealed,
10897- sel: sel ?? self.sel,
10898- select: select ?? self.select
10952+ sel: sel ?? self.sel
1089910953 )
1090010954 }
1090110955
@@ -10964,12 +11018,62 @@ extension NoSuchMethod {
1096411018 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1096511019 // synthesized for types that have collections (such as arrays or dictionaries).
1096611020
10967-// MARK: - Nonatomic
10968-struct Nonatomic: Codable, Equatable {
10969- let nonatomic: Int
11021+// MARK: - Noexcept
11022+struct Noexcept: Codable, Equatable {
11023+ let noexcept: Int
1097011024
1097111025 enum CodingKeys: String, CodingKey {
10972- case nonatomic = "nonatomic"
11026+ case noexcept = "noexcept"
11027+ }
11028+}
11029+
11030+// MARK: Noexcept convenience initializers and mutators
11031+
11032+extension Noexcept {
11033+ init(data: Data) throws {
11034+ self = try newJSONDecoder().decode(Noexcept.self, from: data)
11035+ }
11036+
11037+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
11038+ guard let data = json.data(using: encoding) else {
11039+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11040+ }
11041+ try self.init(data: data)
11042+ }
11043+
11044+ init(fromURL url: URL) throws {
11045+ try self.init(data: try Data(contentsOf: url))
11046+ }
11047+
11048+ func with(
11049+ noexcept: Int? = nil
11050+ ) -> Noexcept {
11051+ return Noexcept(
11052+ noexcept: noexcept ?? self.noexcept
11053+ )
11054+ }
11055+
11056+ func jsonData() throws -> Data {
11057+ return try newJSONEncoder().encode(self)
11058+ }
11059+
11060+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
11061+ return String(data: try self.jsonData(), encoding: encoding)
11062+ }
11063+}
11064+
11065+//
11066+// Hashable or Equatable:
11067+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
11068+// for types that require the use of JSONAny, nor will the implementation of Hashable be
11069+// synthesized for types that have collections (such as arrays or dictionaries).
11070+
11071+// MARK: - Nonatomic
11072+struct Nonatomic: Codable, Equatable {
11073+ let nonatomic: Int
11074+
11075+ enum CodingKeys: String, CodingKey {
11076+ case nonatomic = "nonatomic"
1097311077 }
1097411078 }
1097511079
@@ -14064,56 +14168,6 @@ extension Sel {
1406414168 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1406514169 // synthesized for types that have collections (such as arrays or dictionaries).
1406614170
14067-// MARK: - Select
14068-struct Select: Codable, Equatable {
14069- let select: Int
14070-
14071- enum CodingKeys: String, CodingKey {
14072- case select = "select"
14073- }
14074-}
14075-
14076-// MARK: Select convenience initializers and mutators
14077-
14078-extension Select {
14079- init(data: Data) throws {
14080- self = try newJSONDecoder().decode(Select.self, from: data)
14081- }
14082-
14083- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14084- guard let data = json.data(using: encoding) else {
14085- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14086- }
14087- try self.init(data: data)
14088- }
14089-
14090- init(fromURL url: URL) throws {
14091- try self.init(data: try Data(contentsOf: url))
14092- }
14093-
14094- func with(
14095- select: Int? = nil
14096- ) -> Select {
14097- return Select(
14098- select: select ?? self.select
14099- )
14100- }
14101-
14102- func jsonData() throws -> Data {
14103- return try newJSONEncoder().encode(self)
14104- }
14105-
14106- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
14107- return String(data: try self.jsonData(), encoding: encoding)
14108- }
14109-}
14110-
14111-//
14112-// Hashable or Equatable:
14113-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
14114-// for types that require the use of JSONAny, nor will the implementation of Hashable be
14115-// synthesized for types that have collections (such as arrays or dictionaries).
14116-
1411714171 // MARK: - Obj5
1411814172 struct Obj5: Codable, Equatable {
1411914173 let dummy: Int
@@ -14135,6 +14189,7 @@ struct Obj5: Codable, Equatable {
1413514189 let primitiveKind: PrimitiveKind
1413614190 let purpleSelf: Obj5Self
1413714191 let purpleTrue: TrueClass
14192+ let select: Select
1413814193 let sendable: Sendable
1413914194 let serialDescriptor: SerialDescriptor
1414014195 let serialName: SerialName
@@ -14163,6 +14218,7 @@ struct Obj5: Codable, Equatable {
1416314218 let timeOnly: TimeOnly
1416414219 let timeOnlyConverter: TimeOnlyConverter
1416514220 let timeZone: TimeZoneClass
14221+ let toDict: ToDict
1416614222 let toJSON: ToJSON
1416714223 let toString: ToString
1416814224 let topLevel: TopLevelClass
@@ -14177,10 +14233,9 @@ struct Obj5: Codable, Equatable {
1417714233 let unchecked: Unchecked
1417814234 let undefined: Undefined
1417914235 let union: Union
14236+ let unmarshalJSON: UnmarshalJSON
1418014237 let unsafe: Unsafe
14181- let unsigned: Unsigned
1418214238 let useSerializers: UseSerializers
14183- let ushort: Ushort
1418414239
1418514240 enum CodingKeys: String, CodingKey {
1418614241 case dummy = "dummy"
@@ -14202,6 +14257,7 @@ struct Obj5: Codable, Equatable {
1420214257 case primitiveKind = "PrimitiveKind"
1420314258 case purpleSelf = "self"
1420414259 case purpleTrue = "true"
14260+ case select = "select"
1420514261 case sendable = "Sendable"
1420614262 case serialDescriptor = "SerialDescriptor"
1420714263 case serialName = "SerialName"
@@ -14230,6 +14286,7 @@ struct Obj5: Codable, Equatable {
1423014286 case timeOnly = "TimeOnly"
1423114287 case timeOnlyConverter = "TimeOnlyConverter"
1423214288 case timeZone = "TimeZone"
14289+ case toDict = "to_dict"
1423314290 case toJSON = "to_json"
1423414291 case toString = "toString"
1423514292 case topLevel = "top_level"
@@ -14244,10 +14301,9 @@ struct Obj5: Codable, Equatable {
1424414301 case unchecked = "unchecked"
1424514302 case undefined = "undefined"
1424614303 case union = "union"
14304+ case unmarshalJSON = "UnmarshalJSON"
1424714305 case unsafe = "unsafe"
14248- case unsigned = "unsigned"
1424914306 case useSerializers = "UseSerializers"
14250- case ushort = "ushort"
1425114307 }
1425214308 }
1425314309
@@ -14289,6 +14345,7 @@ extension Obj5 {
1428914345 primitiveKind: PrimitiveKind? = nil,
1429014346 purpleSelf: Obj5Self? = nil,
1429114347 purpleTrue: TrueClass? = nil,
14348+ select: Select? = nil,
1429214349 sendable: Sendable? = nil,
1429314350 serialDescriptor: SerialDescriptor? = nil,
1429414351 serialName: SerialName? = nil,
@@ -14317,6 +14374,7 @@ extension Obj5 {
1431714374 timeOnly: TimeOnly? = nil,
1431814375 timeOnlyConverter: TimeOnlyConverter? = nil,
1431914376 timeZone: TimeZoneClass? = nil,
14377+ toDict: ToDict? = nil,
1432014378 toJSON: ToJSON? = nil,
1432114379 toString: ToString? = nil,
1432214380 topLevel: TopLevelClass? = nil,
@@ -14331,10 +14389,9 @@ extension Obj5 {
1433114389 unchecked: Unchecked? = nil,
1433214390 undefined: Undefined? = nil,
1433314391 union: Union? = nil,
14392+ unmarshalJSON: UnmarshalJSON? = nil,
1433414393 unsafe: Unsafe? = nil,
14335- unsigned: Unsigned? = nil,
14336- useSerializers: UseSerializers? = nil,
14337- ushort: Ushort? = nil
14394+ useSerializers: UseSerializers? = nil
1433814395 ) -> Obj5 {
1433914396 return Obj5(
1434014397 dummy: dummy ?? self.dummy,
@@ -14356,6 +14413,7 @@ extension Obj5 {
1435614413 primitiveKind: primitiveKind ?? self.primitiveKind,
1435714414 purpleSelf: purpleSelf ?? self.purpleSelf,
1435814415 purpleTrue: purpleTrue ?? self.purpleTrue,
14416+ select: select ?? self.select,
1435914417 sendable: sendable ?? self.sendable,
1436014418 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
1436114419 serialName: serialName ?? self.serialName,
@@ -14384,6 +14442,7 @@ extension Obj5 {
1438414442 timeOnly: timeOnly ?? self.timeOnly,
1438514443 timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter,
1438614444 timeZone: timeZone ?? self.timeZone,
14445+ toDict: toDict ?? self.toDict,
1438714446 toJSON: toJSON ?? self.toJSON,
1438814447 toString: toString ?? self.toString,
1438914448 topLevel: topLevel ?? self.topLevel,
@@ -14398,10 +14457,9 @@ extension Obj5 {
1439814457 unchecked: unchecked ?? self.unchecked,
1439914458 undefined: undefined ?? self.undefined,
1440014459 union: union ?? self.union,
14460+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
1440114461 unsafe: unsafe ?? self.unsafe,
14402- unsigned: unsigned ?? self.unsigned,
14403- useSerializers: useSerializers ?? self.useSerializers,
14404- ushort: ushort ?? self.ushort
14462+ useSerializers: useSerializers ?? self.useSerializers
1440514463 )
1440614464 }
1440714465
@@ -15320,6 +15378,56 @@ extension TrueClass {
1532015378 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1532115379 // synthesized for types that have collections (such as arrays or dictionaries).
1532215380
15381+// MARK: - Select
15382+struct Select: Codable, Equatable {
15383+ let select: Int
15384+
15385+ enum CodingKeys: String, CodingKey {
15386+ case select = "select"
15387+ }
15388+}
15389+
15390+// MARK: Select convenience initializers and mutators
15391+
15392+extension Select {
15393+ init(data: Data) throws {
15394+ self = try newJSONDecoder().decode(Select.self, from: data)
15395+ }
15396+
15397+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15398+ guard let data = json.data(using: encoding) else {
15399+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15400+ }
15401+ try self.init(data: data)
15402+ }
15403+
15404+ init(fromURL url: URL) throws {
15405+ try self.init(data: try Data(contentsOf: url))
15406+ }
15407+
15408+ func with(
15409+ select: Int? = nil
15410+ ) -> Select {
15411+ return Select(
15412+ select: select ?? self.select
15413+ )
15414+ }
15415+
15416+ func jsonData() throws -> Data {
15417+ return try newJSONEncoder().encode(self)
15418+ }
15419+
15420+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15421+ return String(data: try self.jsonData(), encoding: encoding)
15422+ }
15423+}
15424+
15425+//
15426+// Hashable or Equatable:
15427+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
15428+// for types that require the use of JSONAny, nor will the implementation of Hashable be
15429+// synthesized for types that have collections (such as arrays or dictionaries).
15430+
1532315431 // MARK: - Sendable
1532415432 struct Sendable: Codable, Equatable {
1532515433 let sendable: Int
@@ -16720,6 +16828,56 @@ extension TimeZoneClass {
1672016828 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1672116829 // synthesized for types that have collections (such as arrays or dictionaries).
1672216830
16831+// MARK: - ToDict
16832+struct ToDict: Codable, Equatable {
16833+ let toDict: Int
16834+
16835+ enum CodingKeys: String, CodingKey {
16836+ case toDict = "to_dict"
16837+ }
16838+}
16839+
16840+// MARK: ToDict convenience initializers and mutators
16841+
16842+extension ToDict {
16843+ init(data: Data) throws {
16844+ self = try newJSONDecoder().decode(ToDict.self, from: data)
16845+ }
16846+
16847+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16848+ guard let data = json.data(using: encoding) else {
16849+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16850+ }
16851+ try self.init(data: data)
16852+ }
16853+
16854+ init(fromURL url: URL) throws {
16855+ try self.init(data: try Data(contentsOf: url))
16856+ }
16857+
16858+ func with(
16859+ toDict: Int? = nil
16860+ ) -> ToDict {
16861+ return ToDict(
16862+ toDict: toDict ?? self.toDict
16863+ )
16864+ }
16865+
16866+ func jsonData() throws -> Data {
16867+ return try newJSONEncoder().encode(self)
16868+ }
16869+
16870+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16871+ return String(data: try self.jsonData(), encoding: encoding)
16872+ }
16873+}
16874+
16875+//
16876+// Hashable or Equatable:
16877+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
16878+// for types that require the use of JSONAny, nor will the implementation of Hashable be
16879+// synthesized for types that have collections (such as arrays or dictionaries).
16880+
1672316881 // MARK: - ToJSON
1672416882 struct ToJSON: Codable, Equatable {
1672516883 let toJSON: Int
@@ -17420,20 +17578,20 @@ extension Union {
1742017578 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1742117579 // synthesized for types that have collections (such as arrays or dictionaries).
1742217580
17423-// MARK: - Unsafe
17424-struct Unsafe: Codable, Equatable {
17425- let unsafe: Int
17581+// MARK: - UnmarshalJSON
17582+struct UnmarshalJSON: Codable, Equatable {
17583+ let unmarshalJSON: Int
1742617584
1742717585 enum CodingKeys: String, CodingKey {
17428- case unsafe = "unsafe"
17586+ case unmarshalJSON = "UnmarshalJSON"
1742917587 }
1743017588 }
1743117589
17432-// MARK: Unsafe convenience initializers and mutators
17590+// MARK: UnmarshalJSON convenience initializers and mutators
1743317591
17434-extension Unsafe {
17592+extension UnmarshalJSON {
1743517593 init(data: Data) throws {
17436- self = try newJSONDecoder().decode(Unsafe.self, from: data)
17594+ self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data)
1743717595 }
1743817596
1743917597 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -17448,10 +17606,10 @@ extension Unsafe {
1744817606 }
1744917607
1745017608 func with(
17451- unsafe: Int? = nil
17452- ) -> Unsafe {
17453- return Unsafe(
17454- unsafe: unsafe ?? self.unsafe
17609+ unmarshalJSON: Int? = nil
17610+ ) -> UnmarshalJSON {
17611+ return UnmarshalJSON(
17612+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1745517613 )
1745617614 }
1745717615
@@ -17470,20 +17628,20 @@ extension Unsafe {
1747017628 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1747117629 // synthesized for types that have collections (such as arrays or dictionaries).
1747217630
17473-// MARK: - Unsigned
17474-struct Unsigned: Codable, Equatable {
17475- let unsigned: Int
17631+// MARK: - Unsafe
17632+struct Unsafe: Codable, Equatable {
17633+ let unsafe: Int
1747617634
1747717635 enum CodingKeys: String, CodingKey {
17478- case unsigned = "unsigned"
17636+ case unsafe = "unsafe"
1747917637 }
1748017638 }
1748117639
17482-// MARK: Unsigned convenience initializers and mutators
17640+// MARK: Unsafe convenience initializers and mutators
1748317641
17484-extension Unsigned {
17642+extension Unsafe {
1748517643 init(data: Data) throws {
17486- self = try newJSONDecoder().decode(Unsigned.self, from: data)
17644+ self = try newJSONDecoder().decode(Unsafe.self, from: data)
1748717645 }
1748817646
1748917647 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -17498,10 +17656,10 @@ extension Unsigned {
1749817656 }
1749917657
1750017658 func with(
17501- unsigned: Int? = nil
17502- ) -> Unsigned {
17503- return Unsigned(
17504- unsigned: unsigned ?? self.unsigned
17659+ unsafe: Int? = nil
17660+ ) -> Unsafe {
17661+ return Unsafe(
17662+ unsafe: unsafe ?? self.unsafe
1750517663 )
1750617664 }
1750717665
@@ -17570,56 +17728,6 @@ extension UseSerializers {
1757017728 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1757117729 // synthesized for types that have collections (such as arrays or dictionaries).
1757217730
17573-// MARK: - Ushort
17574-struct Ushort: Codable, Equatable {
17575- let ushort: Int
17576-
17577- enum CodingKeys: String, CodingKey {
17578- case ushort = "ushort"
17579- }
17580-}
17581-
17582-// MARK: Ushort convenience initializers and mutators
17583-
17584-extension Ushort {
17585- init(data: Data) throws {
17586- self = try newJSONDecoder().decode(Ushort.self, from: data)
17587- }
17588-
17589- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17590- guard let data = json.data(using: encoding) else {
17591- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17592- }
17593- try self.init(data: data)
17594- }
17595-
17596- init(fromURL url: URL) throws {
17597- try self.init(data: try Data(contentsOf: url))
17598- }
17599-
17600- func with(
17601- ushort: Int? = nil
17602- ) -> Ushort {
17603- return Ushort(
17604- ushort: ushort ?? self.ushort
17605- )
17606- }
17607-
17608- func jsonData() throws -> Data {
17609- return try newJSONEncoder().encode(self)
17610- }
17611-
17612- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17613- return String(data: try self.jsonData(), encoding: encoding)
17614- }
17615-}
17616-
17617-//
17618-// Hashable or Equatable:
17619-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
17620-// for types that require the use of JSONAny, nor will the implementation of Hashable be
17621-// synthesized for types that have collections (such as arrays or dictionaries).
17622-
1762317731 // MARK: - Obj6
1762417732 struct Obj6: Codable, Equatable {
1762517733 let dummy: Int
@@ -17628,6 +17736,8 @@ struct Obj6: Codable, Equatable {
1762817736 let obj6Where: Where
1762917737 let obj6While: While
1763017738 let obj6WillSet: WillSet
17739+ let unsigned: Unsigned
17740+ let ushort: Ushort
1763117741 let using: Using
1763217742 let utf8JSONReader: Utf8JSONReader
1763317743 let utf8JSONWriter: Utf8JSONWriter
@@ -17649,6 +17759,8 @@ struct Obj6: Codable, Equatable {
1764917759 case obj6Where = "where"
1765017760 case obj6While = "while"
1765117761 case obj6WillSet = "willSet"
17762+ case unsigned = "unsigned"
17763+ case ushort = "ushort"
1765217764 case using = "using"
1765317765 case utf8JSONReader = "Utf8JsonReader"
1765417766 case utf8JSONWriter = "Utf8JsonWriter"
@@ -17690,6 +17802,8 @@ extension Obj6 {
1769017802 obj6Where: Where? = nil,
1769117803 obj6While: While? = nil,
1769217804 obj6WillSet: WillSet? = nil,
17805+ unsigned: Unsigned? = nil,
17806+ ushort: Ushort? = nil,
1769317807 using: Using? = nil,
1769417808 utf8JSONReader: Utf8JSONReader? = nil,
1769517809 utf8JSONWriter: Utf8JSONWriter? = nil,
@@ -17711,6 +17825,8 @@ extension Obj6 {
1771117825 obj6Where: obj6Where ?? self.obj6Where,
1771217826 obj6While: obj6While ?? self.obj6While,
1771317827 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
17828+ unsigned: unsigned ?? self.unsigned,
17829+ ushort: ushort ?? self.ushort,
1771417830 using: using ?? self.using,
1771517831 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
1771617832 utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter,
@@ -17992,6 +18108,106 @@ extension WillSet {
1799218108 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1799318109 // synthesized for types that have collections (such as arrays or dictionaries).
1799418110
18111+// MARK: - Unsigned
18112+struct Unsigned: Codable, Equatable {
18113+ let unsigned: Int
18114+
18115+ enum CodingKeys: String, CodingKey {
18116+ case unsigned = "unsigned"
18117+ }
18118+}
18119+
18120+// MARK: Unsigned convenience initializers and mutators
18121+
18122+extension Unsigned {
18123+ init(data: Data) throws {
18124+ self = try newJSONDecoder().decode(Unsigned.self, from: data)
18125+ }
18126+
18127+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18128+ guard let data = json.data(using: encoding) else {
18129+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18130+ }
18131+ try self.init(data: data)
18132+ }
18133+
18134+ init(fromURL url: URL) throws {
18135+ try self.init(data: try Data(contentsOf: url))
18136+ }
18137+
18138+ func with(
18139+ unsigned: Int? = nil
18140+ ) -> Unsigned {
18141+ return Unsigned(
18142+ unsigned: unsigned ?? self.unsigned
18143+ )
18144+ }
18145+
18146+ func jsonData() throws -> Data {
18147+ return try newJSONEncoder().encode(self)
18148+ }
18149+
18150+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18151+ return String(data: try self.jsonData(), encoding: encoding)
18152+ }
18153+}
18154+
18155+//
18156+// Hashable or Equatable:
18157+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
18158+// for types that require the use of JSONAny, nor will the implementation of Hashable be
18159+// synthesized for types that have collections (such as arrays or dictionaries).
18160+
18161+// MARK: - Ushort
18162+struct Ushort: Codable, Equatable {
18163+ let ushort: Int
18164+
18165+ enum CodingKeys: String, CodingKey {
18166+ case ushort = "ushort"
18167+ }
18168+}
18169+
18170+// MARK: Ushort convenience initializers and mutators
18171+
18172+extension Ushort {
18173+ init(data: Data) throws {
18174+ self = try newJSONDecoder().decode(Ushort.self, from: data)
18175+ }
18176+
18177+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18178+ guard let data = json.data(using: encoding) else {
18179+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18180+ }
18181+ try self.init(data: data)
18182+ }
18183+
18184+ init(fromURL url: URL) throws {
18185+ try self.init(data: try Data(contentsOf: url))
18186+ }
18187+
18188+ func with(
18189+ ushort: Int? = nil
18190+ ) -> Ushort {
18191+ return Ushort(
18192+ ushort: ushort ?? self.ushort
18193+ )
18194+ }
18195+
18196+ func jsonData() throws -> Data {
18197+ return try newJSONEncoder().encode(self)
18198+ }
18199+
18200+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18201+ return String(data: try self.jsonData(), encoding: encoding)
18202+ }
18203+}
18204+
18205+//
18206+// Hashable or Equatable:
18207+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
18208+// for types that require the use of JSONAny, nor will the implementation of Hashable be
18209+// synthesized for types that have collections (such as arrays or dictionaries).
18210+
1799518211 // MARK: - Using
1799618212 struct Using: Codable, Equatable {
1799718213 let using: Int
Mswiftsendable-true--1c3982c78639 / quicktype.swift+434 −242
@@ -3234,11 +3234,11 @@ struct Obj2: Codable, Sendable {
32343234 let formatException: FormatException
32353235 let friend: Friend
32363236 let from: From
3237+ let fromDict: FromDict
32373238 let fromJSON: FromJSON
32383239 let function: Function
32393240 let global: Global
32403241 let go: Go
3241- let goto: Goto
32423242 let obj2Default: Default
32433243 let obj2Defer: Defer
32443244 let obj2Deinit: Deinit
@@ -3301,11 +3301,11 @@ struct Obj2: Codable, Sendable {
33013301 case formatException = "FormatException"
33023302 case friend = "friend"
33033303 case from = "from"
3304+ case fromDict = "from_dict"
33043305 case fromJSON = "from_json"
33053306 case function = "function"
33063307 case global = "global"
33073308 case go = "go"
3308- case goto = "goto"
33093309 case obj2Default = "default"
33103310 case obj2Defer = "defer"
33113311 case obj2Deinit = "deinit"
@@ -3388,11 +3388,11 @@ extension Obj2 {
33883388 formatException: FormatException? = nil,
33893389 friend: Friend? = nil,
33903390 from: From? = nil,
3391+ fromDict: FromDict? = nil,
33913392 fromJSON: FromJSON? = nil,
33923393 function: Function? = nil,
33933394 global: Global? = nil,
33943395 go: Go? = nil,
3395- goto: Goto? = nil,
33963396 obj2Default: Default? = nil,
33973397 obj2Defer: Defer? = nil,
33983398 obj2Deinit: Deinit? = nil,
@@ -3455,11 +3455,11 @@ extension Obj2 {
34553455 formatException: formatException ?? self.formatException,
34563456 friend: friend ?? self.friend,
34573457 from: from ?? self.from,
3458+ fromDict: fromDict ?? self.fromDict,
34583459 fromJSON: fromJSON ?? self.fromJSON,
34593460 function: function ?? self.function,
34603461 global: global ?? self.global,
34613462 go: go ?? self.go,
3462- goto: goto ?? self.goto,
34633463 obj2Default: obj2Default ?? self.obj2Default,
34643464 obj2Defer: obj2Defer ?? self.obj2Defer,
34653465 obj2Deinit: obj2Deinit ?? self.obj2Deinit,
@@ -5342,6 +5342,50 @@ extension From {
53425342 }
53435343 }
53445344
5345+// MARK: - FromDict
5346+struct FromDict: Codable, Sendable {
5347+ let fromDict: Int
5348+
5349+ enum CodingKeys: String, CodingKey {
5350+ case fromDict = "from_dict"
5351+ }
5352+}
5353+
5354+// MARK: FromDict convenience initializers and mutators
5355+
5356+extension FromDict {
5357+ init(data: Data) throws {
5358+ self = try newJSONDecoder().decode(FromDict.self, from: data)
5359+ }
5360+
5361+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
5362+ guard let data = json.data(using: encoding) else {
5363+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
5364+ }
5365+ try self.init(data: data)
5366+ }
5367+
5368+ init(fromURL url: URL) throws {
5369+ try self.init(data: try Data(contentsOf: url))
5370+ }
5371+
5372+ func with(
5373+ fromDict: Int? = nil
5374+ ) -> FromDict {
5375+ return FromDict(
5376+ fromDict: fromDict ?? self.fromDict
5377+ )
5378+ }
5379+
5380+ func jsonData() throws -> Data {
5381+ return try newJSONEncoder().encode(self)
5382+ }
5383+
5384+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
5385+ return String(data: try self.jsonData(), encoding: encoding)
5386+ }
5387+}
5388+
53455389 // MARK: - FromJSON
53465390 struct FromJSON: Codable, Sendable {
53475391 let fromJSON: Int
@@ -5518,50 +5562,6 @@ extension Go {
55185562 }
55195563 }
55205564
5521-// MARK: - Goto
5522-struct Goto: Codable, Sendable {
5523- let goto: Int
5524-
5525- enum CodingKeys: String, CodingKey {
5526- case goto = "goto"
5527- }
5528-}
5529-
5530-// MARK: Goto convenience initializers and mutators
5531-
5532-extension Goto {
5533- init(data: Data) throws {
5534- self = try newJSONDecoder().decode(Goto.self, from: data)
5535- }
5536-
5537- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
5538- guard let data = json.data(using: encoding) else {
5539- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
5540- }
5541- try self.init(data: data)
5542- }
5543-
5544- init(fromURL url: URL) throws {
5545- try self.init(data: try Data(contentsOf: url))
5546- }
5547-
5548- func with(
5549- goto: Int? = nil
5550- ) -> Goto {
5551- return Goto(
5552- goto: goto ?? self.goto
5553- )
5554- }
5555-
5556- func jsonData() throws -> Data {
5557- return try newJSONEncoder().encode(self)
5558- }
5559-
5560- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
5561- return String(data: try self.jsonData(), encoding: encoding)
5562- }
5563-}
5564-
55655565 // MARK: - Default
55665566 struct Default: Codable, Sendable {
55675567 let defaultDefault: Int
@@ -6313,6 +6313,7 @@ extension FalseClass {
63136313 // MARK: - Obj3
63146314 struct Obj3: Codable, Sendable {
63156315 let dummy: Int
6316+ let goto: Goto
63166317 let hasOwnProperty: HasOwnProperty
63176318 let hashCode: HashCode
63186319 let hashable: HashableClass
@@ -6352,6 +6353,7 @@ struct Obj3: Codable, Sendable {
63526353 let long: Long
63536354 let map: Map
63546355 let mapEntry: MapEntry
6356+ let marshalJSON: MarshalJSON
63556357 let metadataPropertyHandling: MetadataPropertyHandling
63566358 let module: Module
63576359 let mutable: Mutable
@@ -6360,7 +6362,6 @@ struct Obj3: Codable, Sendable {
63606362 let new: New
63616363 let newtonsoft: Newtonsoft
63626364 let no: No
6363- let noexcept: Noexcept
63646365 let obj3Guard: Guard
63656366 let obj3If: If
63666367 let obj3Import: Import
@@ -6380,6 +6381,7 @@ struct Obj3: Codable, Sendable {
63806381
63816382 enum CodingKeys: String, CodingKey {
63826383 case dummy = "dummy"
6384+ case goto = "goto"
63836385 case hasOwnProperty = "hasOwnProperty"
63846386 case hashCode = "hashCode"
63856387 case hashable = "Hashable"
@@ -6419,6 +6421,7 @@ struct Obj3: Codable, Sendable {
64196421 case long = "long"
64206422 case map = "map"
64216423 case mapEntry = "MapEntry"
6424+ case marshalJSON = "MarshalJSON"
64226425 case metadataPropertyHandling = "metadata_property_handling"
64236426 case module = "module"
64246427 case mutable = "mutable"
@@ -6427,7 +6430,6 @@ struct Obj3: Codable, Sendable {
64276430 case new = "new"
64286431 case newtonsoft = "newtonsoft"
64296432 case no = "NO"
6430- case noexcept = "noexcept"
64316433 case obj3Guard = "guard"
64326434 case obj3If = "if"
64336435 case obj3Import = "import"
@@ -6467,6 +6469,7 @@ extension Obj3 {
64676469
64686470 func with(
64696471 dummy: Int? = nil,
6472+ goto: Goto? = nil,
64706473 hasOwnProperty: HasOwnProperty? = nil,
64716474 hashCode: HashCode? = nil,
64726475 hashable: HashableClass? = nil,
@@ -6506,6 +6509,7 @@ extension Obj3 {
65066509 long: Long? = nil,
65076510 map: Map? = nil,
65086511 mapEntry: MapEntry? = nil,
6512+ marshalJSON: MarshalJSON? = nil,
65096513 metadataPropertyHandling: MetadataPropertyHandling? = nil,
65106514 module: Module? = nil,
65116515 mutable: Mutable? = nil,
@@ -6514,7 +6518,6 @@ extension Obj3 {
65146518 new: New? = nil,
65156519 newtonsoft: Newtonsoft? = nil,
65166520 no: No? = nil,
6517- noexcept: Noexcept? = nil,
65186521 obj3Guard: Guard? = nil,
65196522 obj3If: If? = nil,
65206523 obj3Import: Import? = nil,
@@ -6534,6 +6537,7 @@ extension Obj3 {
65346537 ) -> Obj3 {
65356538 return Obj3(
65366539 dummy: dummy ?? self.dummy,
6540+ goto: goto ?? self.goto,
65376541 hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty,
65386542 hashCode: hashCode ?? self.hashCode,
65396543 hashable: hashable ?? self.hashable,
@@ -6573,6 +6577,7 @@ extension Obj3 {
65736577 long: long ?? self.long,
65746578 map: map ?? self.map,
65756579 mapEntry: mapEntry ?? self.mapEntry,
6580+ marshalJSON: marshalJSON ?? self.marshalJSON,
65766581 metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling,
65776582 module: module ?? self.module,
65786583 mutable: mutable ?? self.mutable,
@@ -6581,7 +6586,6 @@ extension Obj3 {
65816586 new: new ?? self.new,
65826587 newtonsoft: newtonsoft ?? self.newtonsoft,
65836588 no: no ?? self.no,
6584- noexcept: noexcept ?? self.noexcept,
65856589 obj3Guard: obj3Guard ?? self.obj3Guard,
65866590 obj3If: obj3If ?? self.obj3If,
65876591 obj3Import: obj3Import ?? self.obj3Import,
@@ -6610,6 +6614,50 @@ extension Obj3 {
66106614 }
66116615 }
66126616
6617+// MARK: - Goto
6618+struct Goto: Codable, Sendable {
6619+ let goto: Int
6620+
6621+ enum CodingKeys: String, CodingKey {
6622+ case goto = "goto"
6623+ }
6624+}
6625+
6626+// MARK: Goto convenience initializers and mutators
6627+
6628+extension Goto {
6629+ init(data: Data) throws {
6630+ self = try newJSONDecoder().decode(Goto.self, from: data)
6631+ }
6632+
6633+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
6634+ guard let data = json.data(using: encoding) else {
6635+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
6636+ }
6637+ try self.init(data: data)
6638+ }
6639+
6640+ init(fromURL url: URL) throws {
6641+ try self.init(data: try Data(contentsOf: url))
6642+ }
6643+
6644+ func with(
6645+ goto: Int? = nil
6646+ ) -> Goto {
6647+ return Goto(
6648+ goto: goto ?? self.goto
6649+ )
6650+ }
6651+
6652+ func jsonData() throws -> Data {
6653+ return try newJSONEncoder().encode(self)
6654+ }
6655+
6656+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
6657+ return String(data: try self.jsonData(), encoding: encoding)
6658+ }
6659+}
6660+
66136661 // MARK: - HasOwnProperty
66146662 struct HasOwnProperty: Codable, Sendable {
66156663 let hasOwnProperty: Int
@@ -8326,6 +8374,50 @@ extension MapEntry {
83268374 }
83278375 }
83288376
8377+// MARK: - MarshalJSON
8378+struct MarshalJSON: Codable, Sendable {
8379+ let marshalJSON: Int
8380+
8381+ enum CodingKeys: String, CodingKey {
8382+ case marshalJSON = "MarshalJSON"
8383+ }
8384+}
8385+
8386+// MARK: MarshalJSON convenience initializers and mutators
8387+
8388+extension MarshalJSON {
8389+ init(data: Data) throws {
8390+ self = try newJSONDecoder().decode(MarshalJSON.self, from: data)
8391+ }
8392+
8393+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8394+ guard let data = json.data(using: encoding) else {
8395+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8396+ }
8397+ try self.init(data: data)
8398+ }
8399+
8400+ init(fromURL url: URL) throws {
8401+ try self.init(data: try Data(contentsOf: url))
8402+ }
8403+
8404+ func with(
8405+ marshalJSON: Int? = nil
8406+ ) -> MarshalJSON {
8407+ return MarshalJSON(
8408+ marshalJSON: marshalJSON ?? self.marshalJSON
8409+ )
8410+ }
8411+
8412+ func jsonData() throws -> Data {
8413+ return try newJSONEncoder().encode(self)
8414+ }
8415+
8416+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8417+ return String(data: try self.jsonData(), encoding: encoding)
8418+ }
8419+}
8420+
83298421 // MARK: - MetadataPropertyHandling
83308422 struct MetadataPropertyHandling: Codable, Sendable {
83318423 let metadataPropertyHandling: Int
@@ -8678,50 +8770,6 @@ extension No {
86788770 }
86798771 }
86808772
8681-// MARK: - Noexcept
8682-struct Noexcept: Codable, Sendable {
8683- let noexcept: Int
8684-
8685- enum CodingKeys: String, CodingKey {
8686- case noexcept = "noexcept"
8687- }
8688-}
8689-
8690-// MARK: Noexcept convenience initializers and mutators
8691-
8692-extension Noexcept {
8693- init(data: Data) throws {
8694- self = try newJSONDecoder().decode(Noexcept.self, from: data)
8695- }
8696-
8697- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8698- guard let data = json.data(using: encoding) else {
8699- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8700- }
8701- try self.init(data: data)
8702- }
8703-
8704- init(fromURL url: URL) throws {
8705- try self.init(data: try Data(contentsOf: url))
8706- }
8707-
8708- func with(
8709- noexcept: Int? = nil
8710- ) -> Noexcept {
8711- return Noexcept(
8712- noexcept: noexcept ?? self.noexcept
8713- )
8714- }
8715-
8716- func jsonData() throws -> Data {
8717- return try newJSONEncoder().encode(self)
8718- }
8719-
8720- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8721- return String(data: try self.jsonData(), encoding: encoding)
8722- }
8723-}
8724-
87258773 // MARK: - Guard
87268774 struct Guard: Codable, Sendable {
87278775 let guardGuard: Int
@@ -9430,6 +9478,7 @@ extension Nil {
94309478 struct Obj4: Codable, Sendable {
94319479 let dummy: Int
94329480 let noSuchMethod: NoSuchMethod
9481+ let noexcept: Noexcept
94339482 let nonatomic: Nonatomic
94349483 let none: None
94359484 let nonlocal: Nonlocal
@@ -9492,11 +9541,11 @@ struct Obj4: Codable, Sendable {
94929541 let sbyte: Sbyte
94939542 let sealed: Sealed
94949543 let sel: Sel
9495- let select: Select
94969544
94979545 enum CodingKeys: String, CodingKey {
94989546 case dummy = "dummy"
94999547 case noSuchMethod = "noSuchMethod"
9548+ case noexcept = "noexcept"
95009549 case nonatomic = "nonatomic"
95019550 case none = "None"
95029551 case nonlocal = "nonlocal"
@@ -9559,7 +9608,6 @@ struct Obj4: Codable, Sendable {
95599608 case sbyte = "sbyte"
95609609 case sealed = "sealed"
95619610 case sel = "SEL"
9562- case select = "select"
95639611 }
95649612 }
95659613
@@ -9584,6 +9632,7 @@ extension Obj4 {
95849632 func with(
95859633 dummy: Int? = nil,
95869634 noSuchMethod: NoSuchMethod? = nil,
9635+ noexcept: Noexcept? = nil,
95879636 nonatomic: Nonatomic? = nil,
95889637 none: None? = nil,
95899638 nonlocal: Nonlocal? = nil,
@@ -9645,12 +9694,12 @@ extension Obj4 {
96459694 s: S? = nil,
96469695 sbyte: Sbyte? = nil,
96479696 sealed: Sealed? = nil,
9648- sel: Sel? = nil,
9649- select: Select? = nil
9697+ sel: Sel? = nil
96509698 ) -> Obj4 {
96519699 return Obj4(
96529700 dummy: dummy ?? self.dummy,
96539701 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
9702+ noexcept: noexcept ?? self.noexcept,
96549703 nonatomic: nonatomic ?? self.nonatomic,
96559704 none: none ?? self.none,
96569705 nonlocal: nonlocal ?? self.nonlocal,
@@ -9712,8 +9761,7 @@ extension Obj4 {
97129761 s: s ?? self.s,
97139762 sbyte: sbyte ?? self.sbyte,
97149763 sealed: sealed ?? self.sealed,
9715- sel: sel ?? self.sel,
9716- select: select ?? self.select
9764+ sel: sel ?? self.sel
97179765 )
97189766 }
97199767
@@ -9770,20 +9818,20 @@ extension NoSuchMethod {
97709818 }
97719819 }
97729820
9773-// MARK: - Nonatomic
9774-struct Nonatomic: Codable, Sendable {
9775- let nonatomic: Int
9821+// MARK: - Noexcept
9822+struct Noexcept: Codable, Sendable {
9823+ let noexcept: Int
97769824
97779825 enum CodingKeys: String, CodingKey {
9778- case nonatomic = "nonatomic"
9826+ case noexcept = "noexcept"
97799827 }
97809828 }
97819829
9782-// MARK: Nonatomic convenience initializers and mutators
9830+// MARK: Noexcept convenience initializers and mutators
97839831
9784-extension Nonatomic {
9832+extension Noexcept {
97859833 init(data: Data) throws {
9786- self = try newJSONDecoder().decode(Nonatomic.self, from: data)
9834+ self = try newJSONDecoder().decode(Noexcept.self, from: data)
97879835 }
97889836
97899837 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -9798,10 +9846,10 @@ extension Nonatomic {
97989846 }
97999847
98009848 func with(
9801- nonatomic: Int? = nil
9802- ) -> Nonatomic {
9803- return Nonatomic(
9804- nonatomic: nonatomic ?? self.nonatomic
9849+ noexcept: Int? = nil
9850+ ) -> Noexcept {
9851+ return Noexcept(
9852+ noexcept: noexcept ?? self.noexcept
98059853 )
98069854 }
98079855
@@ -9814,20 +9862,20 @@ extension Nonatomic {
98149862 }
98159863 }
98169864
9817-// MARK: - None
9818-struct None: Codable, Sendable {
9819- let none: Int
9865+// MARK: - Nonatomic
9866+struct Nonatomic: Codable, Sendable {
9867+ let nonatomic: Int
98209868
98219869 enum CodingKeys: String, CodingKey {
9822- case none = "None"
9870+ case nonatomic = "nonatomic"
98239871 }
98249872 }
98259873
9826-// MARK: None convenience initializers and mutators
9874+// MARK: Nonatomic convenience initializers and mutators
98279875
9828-extension None {
9876+extension Nonatomic {
98299877 init(data: Data) throws {
9830- self = try newJSONDecoder().decode(None.self, from: data)
9878+ self = try newJSONDecoder().decode(Nonatomic.self, from: data)
98319879 }
98329880
98339881 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -9842,8 +9890,52 @@ extension None {
98429890 }
98439891
98449892 func with(
9845- none: Int? = nil
9846- ) -> None {
9893+ nonatomic: Int? = nil
9894+ ) -> Nonatomic {
9895+ return Nonatomic(
9896+ nonatomic: nonatomic ?? self.nonatomic
9897+ )
9898+ }
9899+
9900+ func jsonData() throws -> Data {
9901+ return try newJSONEncoder().encode(self)
9902+ }
9903+
9904+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9905+ return String(data: try self.jsonData(), encoding: encoding)
9906+ }
9907+}
9908+
9909+// MARK: - None
9910+struct None: Codable, Sendable {
9911+ let none: Int
9912+
9913+ enum CodingKeys: String, CodingKey {
9914+ case none = "None"
9915+ }
9916+}
9917+
9918+// MARK: None convenience initializers and mutators
9919+
9920+extension None {
9921+ init(data: Data) throws {
9922+ self = try newJSONDecoder().decode(None.self, from: data)
9923+ }
9924+
9925+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9926+ guard let data = json.data(using: encoding) else {
9927+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9928+ }
9929+ try self.init(data: data)
9930+ }
9931+
9932+ init(fromURL url: URL) throws {
9933+ try self.init(data: try Data(contentsOf: url))
9934+ }
9935+
9936+ func with(
9937+ none: Int? = nil
9938+ ) -> None {
98479939 return None(
98489940 none: none ?? self.none
98499941 )
@@ -12498,50 +12590,6 @@ extension Sel {
1249812590 }
1249912591 }
1250012592
12501-// MARK: - Select
12502-struct Select: Codable, Sendable {
12503- let select: Int
12504-
12505- enum CodingKeys: String, CodingKey {
12506- case select = "select"
12507- }
12508-}
12509-
12510-// MARK: Select convenience initializers and mutators
12511-
12512-extension Select {
12513- init(data: Data) throws {
12514- self = try newJSONDecoder().decode(Select.self, from: data)
12515- }
12516-
12517- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
12518- guard let data = json.data(using: encoding) else {
12519- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
12520- }
12521- try self.init(data: data)
12522- }
12523-
12524- init(fromURL url: URL) throws {
12525- try self.init(data: try Data(contentsOf: url))
12526- }
12527-
12528- func with(
12529- select: Int? = nil
12530- ) -> Select {
12531- return Select(
12532- select: select ?? self.select
12533- )
12534- }
12535-
12536- func jsonData() throws -> Data {
12537- return try newJSONEncoder().encode(self)
12538- }
12539-
12540- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
12541- return String(data: try self.jsonData(), encoding: encoding)
12542- }
12543-}
12544-
1254512593 // MARK: - Obj5
1254612594 struct Obj5: Codable, Sendable {
1254712595 let dummy: Int
@@ -12563,6 +12611,7 @@ struct Obj5: Codable, Sendable {
1256312611 let primitiveKind: PrimitiveKind
1256412612 let purpleSelf: Obj5Self
1256512613 let purpleTrue: TrueClass
12614+ let select: Select
1256612615 let sendable: SendableClass
1256712616 let serialDescriptor: SerialDescriptor
1256812617 let serialName: SerialName
@@ -12591,6 +12640,7 @@ struct Obj5: Codable, Sendable {
1259112640 let timeOnly: TimeOnly
1259212641 let timeOnlyConverter: TimeOnlyConverter
1259312642 let timeZone: TimeZoneClass
12643+ let toDict: ToDict
1259412644 let toJSON: ToJSON
1259512645 let toString: ToString
1259612646 let topLevel: TopLevelClass
@@ -12605,10 +12655,9 @@ struct Obj5: Codable, Sendable {
1260512655 let unchecked: Unchecked
1260612656 let undefined: Undefined
1260712657 let union: Union
12658+ let unmarshalJSON: UnmarshalJSON
1260812659 let unsafe: Unsafe
12609- let unsigned: Unsigned
1261012660 let useSerializers: UseSerializers
12611- let ushort: Ushort
1261212661
1261312662 enum CodingKeys: String, CodingKey {
1261412663 case dummy = "dummy"
@@ -12630,6 +12679,7 @@ struct Obj5: Codable, Sendable {
1263012679 case primitiveKind = "PrimitiveKind"
1263112680 case purpleSelf = "self"
1263212681 case purpleTrue = "true"
12682+ case select = "select"
1263312683 case sendable = "Sendable"
1263412684 case serialDescriptor = "SerialDescriptor"
1263512685 case serialName = "SerialName"
@@ -12658,6 +12708,7 @@ struct Obj5: Codable, Sendable {
1265812708 case timeOnly = "TimeOnly"
1265912709 case timeOnlyConverter = "TimeOnlyConverter"
1266012710 case timeZone = "TimeZone"
12711+ case toDict = "to_dict"
1266112712 case toJSON = "to_json"
1266212713 case toString = "toString"
1266312714 case topLevel = "top_level"
@@ -12672,10 +12723,9 @@ struct Obj5: Codable, Sendable {
1267212723 case unchecked = "unchecked"
1267312724 case undefined = "undefined"
1267412725 case union = "union"
12726+ case unmarshalJSON = "UnmarshalJSON"
1267512727 case unsafe = "unsafe"
12676- case unsigned = "unsigned"
1267712728 case useSerializers = "UseSerializers"
12678- case ushort = "ushort"
1267912729 }
1268012730 }
1268112731
@@ -12717,6 +12767,7 @@ extension Obj5 {
1271712767 primitiveKind: PrimitiveKind? = nil,
1271812768 purpleSelf: Obj5Self? = nil,
1271912769 purpleTrue: TrueClass? = nil,
12770+ select: Select? = nil,
1272012771 sendable: SendableClass? = nil,
1272112772 serialDescriptor: SerialDescriptor? = nil,
1272212773 serialName: SerialName? = nil,
@@ -12745,6 +12796,7 @@ extension Obj5 {
1274512796 timeOnly: TimeOnly? = nil,
1274612797 timeOnlyConverter: TimeOnlyConverter? = nil,
1274712798 timeZone: TimeZoneClass? = nil,
12799+ toDict: ToDict? = nil,
1274812800 toJSON: ToJSON? = nil,
1274912801 toString: ToString? = nil,
1275012802 topLevel: TopLevelClass? = nil,
@@ -12759,10 +12811,9 @@ extension Obj5 {
1275912811 unchecked: Unchecked? = nil,
1276012812 undefined: Undefined? = nil,
1276112813 union: Union? = nil,
12814+ unmarshalJSON: UnmarshalJSON? = nil,
1276212815 unsafe: Unsafe? = nil,
12763- unsigned: Unsigned? = nil,
12764- useSerializers: UseSerializers? = nil,
12765- ushort: Ushort? = nil
12816+ useSerializers: UseSerializers? = nil
1276612817 ) -> Obj5 {
1276712818 return Obj5(
1276812819 dummy: dummy ?? self.dummy,
@@ -12784,6 +12835,7 @@ extension Obj5 {
1278412835 primitiveKind: primitiveKind ?? self.primitiveKind,
1278512836 purpleSelf: purpleSelf ?? self.purpleSelf,
1278612837 purpleTrue: purpleTrue ?? self.purpleTrue,
12838+ select: select ?? self.select,
1278712839 sendable: sendable ?? self.sendable,
1278812840 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
1278912841 serialName: serialName ?? self.serialName,
@@ -12812,6 +12864,7 @@ extension Obj5 {
1281212864 timeOnly: timeOnly ?? self.timeOnly,
1281312865 timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter,
1281412866 timeZone: timeZone ?? self.timeZone,
12867+ toDict: toDict ?? self.toDict,
1281512868 toJSON: toJSON ?? self.toJSON,
1281612869 toString: toString ?? self.toString,
1281712870 topLevel: topLevel ?? self.topLevel,
@@ -12826,10 +12879,9 @@ extension Obj5 {
1282612879 unchecked: unchecked ?? self.unchecked,
1282712880 undefined: undefined ?? self.undefined,
1282812881 union: union ?? self.union,
12882+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
1282912883 unsafe: unsafe ?? self.unsafe,
12830- unsigned: unsigned ?? self.unsigned,
12831- useSerializers: useSerializers ?? self.useSerializers,
12832- ushort: ushort ?? self.ushort
12884+ useSerializers: useSerializers ?? self.useSerializers
1283312885 )
1283412886 }
1283512887
@@ -13634,6 +13686,50 @@ extension TrueClass {
1363413686 }
1363513687 }
1363613688
13689+// MARK: - Select
13690+struct Select: Codable, Sendable {
13691+ let select: Int
13692+
13693+ enum CodingKeys: String, CodingKey {
13694+ case select = "select"
13695+ }
13696+}
13697+
13698+// MARK: Select convenience initializers and mutators
13699+
13700+extension Select {
13701+ init(data: Data) throws {
13702+ self = try newJSONDecoder().decode(Select.self, from: data)
13703+ }
13704+
13705+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13706+ guard let data = json.data(using: encoding) else {
13707+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13708+ }
13709+ try self.init(data: data)
13710+ }
13711+
13712+ init(fromURL url: URL) throws {
13713+ try self.init(data: try Data(contentsOf: url))
13714+ }
13715+
13716+ func with(
13717+ select: Int? = nil
13718+ ) -> Select {
13719+ return Select(
13720+ select: select ?? self.select
13721+ )
13722+ }
13723+
13724+ func jsonData() throws -> Data {
13725+ return try newJSONEncoder().encode(self)
13726+ }
13727+
13728+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13729+ return String(data: try self.jsonData(), encoding: encoding)
13730+ }
13731+}
13732+
1363713733 // MARK: - SendableClass
1363813734 struct SendableClass: Codable, Sendable {
1363913735 let sendable: Int
@@ -14866,6 +14962,50 @@ extension TimeZoneClass {
1486614962 }
1486714963 }
1486814964
14965+// MARK: - ToDict
14966+struct ToDict: Codable, Sendable {
14967+ let toDict: Int
14968+
14969+ enum CodingKeys: String, CodingKey {
14970+ case toDict = "to_dict"
14971+ }
14972+}
14973+
14974+// MARK: ToDict convenience initializers and mutators
14975+
14976+extension ToDict {
14977+ init(data: Data) throws {
14978+ self = try newJSONDecoder().decode(ToDict.self, from: data)
14979+ }
14980+
14981+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14982+ guard let data = json.data(using: encoding) else {
14983+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14984+ }
14985+ try self.init(data: data)
14986+ }
14987+
14988+ init(fromURL url: URL) throws {
14989+ try self.init(data: try Data(contentsOf: url))
14990+ }
14991+
14992+ func with(
14993+ toDict: Int? = nil
14994+ ) -> ToDict {
14995+ return ToDict(
14996+ toDict: toDict ?? self.toDict
14997+ )
14998+ }
14999+
15000+ func jsonData() throws -> Data {
15001+ return try newJSONEncoder().encode(self)
15002+ }
15003+
15004+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15005+ return String(data: try self.jsonData(), encoding: encoding)
15006+ }
15007+}
15008+
1486915009 // MARK: - ToJSON
1487015010 struct ToJSON: Codable, Sendable {
1487115011 let toJSON: Int
@@ -15482,20 +15622,20 @@ extension Union {
1548215622 }
1548315623 }
1548415624
15485-// MARK: - Unsafe
15486-struct Unsafe: Codable, Sendable {
15487- let unsafe: Int
15625+// MARK: - UnmarshalJSON
15626+struct UnmarshalJSON: Codable, Sendable {
15627+ let unmarshalJSON: Int
1548815628
1548915629 enum CodingKeys: String, CodingKey {
15490- case unsafe = "unsafe"
15630+ case unmarshalJSON = "UnmarshalJSON"
1549115631 }
1549215632 }
1549315633
15494-// MARK: Unsafe convenience initializers and mutators
15634+// MARK: UnmarshalJSON convenience initializers and mutators
1549515635
15496-extension Unsafe {
15636+extension UnmarshalJSON {
1549715637 init(data: Data) throws {
15498- self = try newJSONDecoder().decode(Unsafe.self, from: data)
15638+ self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data)
1549915639 }
1550015640
1550115641 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15510,10 +15650,10 @@ extension Unsafe {
1551015650 }
1551115651
1551215652 func with(
15513- unsafe: Int? = nil
15514- ) -> Unsafe {
15515- return Unsafe(
15516- unsafe: unsafe ?? self.unsafe
15653+ unmarshalJSON: Int? = nil
15654+ ) -> UnmarshalJSON {
15655+ return UnmarshalJSON(
15656+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1551715657 )
1551815658 }
1551915659
@@ -15526,20 +15666,20 @@ extension Unsafe {
1552615666 }
1552715667 }
1552815668
15529-// MARK: - Unsigned
15530-struct Unsigned: Codable, Sendable {
15531- let unsigned: Int
15669+// MARK: - Unsafe
15670+struct Unsafe: Codable, Sendable {
15671+ let unsafe: Int
1553215672
1553315673 enum CodingKeys: String, CodingKey {
15534- case unsigned = "unsigned"
15674+ case unsafe = "unsafe"
1553515675 }
1553615676 }
1553715677
15538-// MARK: Unsigned convenience initializers and mutators
15678+// MARK: Unsafe convenience initializers and mutators
1553915679
15540-extension Unsigned {
15680+extension Unsafe {
1554115681 init(data: Data) throws {
15542- self = try newJSONDecoder().decode(Unsigned.self, from: data)
15682+ self = try newJSONDecoder().decode(Unsafe.self, from: data)
1554315683 }
1554415684
1554515685 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15554,10 +15694,10 @@ extension Unsigned {
1555415694 }
1555515695
1555615696 func with(
15557- unsigned: Int? = nil
15558- ) -> Unsigned {
15559- return Unsigned(
15560- unsigned: unsigned ?? self.unsigned
15697+ unsafe: Int? = nil
15698+ ) -> Unsafe {
15699+ return Unsafe(
15700+ unsafe: unsafe ?? self.unsafe
1556115701 )
1556215702 }
1556315703
@@ -15614,50 +15754,6 @@ extension UseSerializers {
1561415754 }
1561515755 }
1561615756
15617-// MARK: - Ushort
15618-struct Ushort: Codable, Sendable {
15619- let ushort: Int
15620-
15621- enum CodingKeys: String, CodingKey {
15622- case ushort = "ushort"
15623- }
15624-}
15625-
15626-// MARK: Ushort convenience initializers and mutators
15627-
15628-extension Ushort {
15629- init(data: Data) throws {
15630- self = try newJSONDecoder().decode(Ushort.self, from: data)
15631- }
15632-
15633- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15634- guard let data = json.data(using: encoding) else {
15635- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15636- }
15637- try self.init(data: data)
15638- }
15639-
15640- init(fromURL url: URL) throws {
15641- try self.init(data: try Data(contentsOf: url))
15642- }
15643-
15644- func with(
15645- ushort: Int? = nil
15646- ) -> Ushort {
15647- return Ushort(
15648- ushort: ushort ?? self.ushort
15649- )
15650- }
15651-
15652- func jsonData() throws -> Data {
15653- return try newJSONEncoder().encode(self)
15654- }
15655-
15656- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15657- return String(data: try self.jsonData(), encoding: encoding)
15658- }
15659-}
15660-
1566115757 // MARK: - Obj6
1566215758 struct Obj6: Codable, Sendable {
1566315759 let dummy: Int
@@ -15666,6 +15762,8 @@ struct Obj6: Codable, Sendable {
1566615762 let obj6Where: Where
1566715763 let obj6While: While
1566815764 let obj6WillSet: WillSet
15765+ let unsigned: Unsigned
15766+ let ushort: Ushort
1566915767 let using: Using
1567015768 let utf8JSONReader: Utf8JSONReader
1567115769 let utf8JSONWriter: Utf8JSONWriter
@@ -15687,6 +15785,8 @@ struct Obj6: Codable, Sendable {
1568715785 case obj6Where = "where"
1568815786 case obj6While = "while"
1568915787 case obj6WillSet = "willSet"
15788+ case unsigned = "unsigned"
15789+ case ushort = "ushort"
1569015790 case using = "using"
1569115791 case utf8JSONReader = "Utf8JsonReader"
1569215792 case utf8JSONWriter = "Utf8JsonWriter"
@@ -15728,6 +15828,8 @@ extension Obj6 {
1572815828 obj6Where: Where? = nil,
1572915829 obj6While: While? = nil,
1573015830 obj6WillSet: WillSet? = nil,
15831+ unsigned: Unsigned? = nil,
15832+ ushort: Ushort? = nil,
1573115833 using: Using? = nil,
1573215834 utf8JSONReader: Utf8JSONReader? = nil,
1573315835 utf8JSONWriter: Utf8JSONWriter? = nil,
@@ -15749,6 +15851,8 @@ extension Obj6 {
1574915851 obj6Where: obj6Where ?? self.obj6Where,
1575015852 obj6While: obj6While ?? self.obj6While,
1575115853 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
15854+ unsigned: unsigned ?? self.unsigned,
15855+ ushort: ushort ?? self.ushort,
1575215856 using: using ?? self.using,
1575315857 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
1575415858 utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter,
@@ -15994,6 +16098,94 @@ extension WillSet {
1599416098 }
1599516099 }
1599616100
16101+// MARK: - Unsigned
16102+struct Unsigned: Codable, Sendable {
16103+ let unsigned: Int
16104+
16105+ enum CodingKeys: String, CodingKey {
16106+ case unsigned = "unsigned"
16107+ }
16108+}
16109+
16110+// MARK: Unsigned convenience initializers and mutators
16111+
16112+extension Unsigned {
16113+ init(data: Data) throws {
16114+ self = try newJSONDecoder().decode(Unsigned.self, from: data)
16115+ }
16116+
16117+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16118+ guard let data = json.data(using: encoding) else {
16119+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16120+ }
16121+ try self.init(data: data)
16122+ }
16123+
16124+ init(fromURL url: URL) throws {
16125+ try self.init(data: try Data(contentsOf: url))
16126+ }
16127+
16128+ func with(
16129+ unsigned: Int? = nil
16130+ ) -> Unsigned {
16131+ return Unsigned(
16132+ unsigned: unsigned ?? self.unsigned
16133+ )
16134+ }
16135+
16136+ func jsonData() throws -> Data {
16137+ return try newJSONEncoder().encode(self)
16138+ }
16139+
16140+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16141+ return String(data: try self.jsonData(), encoding: encoding)
16142+ }
16143+}
16144+
16145+// MARK: - Ushort
16146+struct Ushort: Codable, Sendable {
16147+ let ushort: Int
16148+
16149+ enum CodingKeys: String, CodingKey {
16150+ case ushort = "ushort"
16151+ }
16152+}
16153+
16154+// MARK: Ushort convenience initializers and mutators
16155+
16156+extension Ushort {
16157+ init(data: Data) throws {
16158+ self = try newJSONDecoder().decode(Ushort.self, from: data)
16159+ }
16160+
16161+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16162+ guard let data = json.data(using: encoding) else {
16163+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16164+ }
16165+ try self.init(data: data)
16166+ }
16167+
16168+ init(fromURL url: URL) throws {
16169+ try self.init(data: try Data(contentsOf: url))
16170+ }
16171+
16172+ func with(
16173+ ushort: Int? = nil
16174+ ) -> Ushort {
16175+ return Ushort(
16176+ ushort: ushort ?? self.ushort
16177+ )
16178+ }
16179+
16180+ func jsonData() throws -> Data {
16181+ return try newJSONEncoder().encode(self)
16182+ }
16183+
16184+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16185+ return String(data: try self.jsonData(), encoding: encoding)
16186+ }
16187+}
16188+
1599716189 // MARK: - Using
1599816190 struct Using: Codable, Sendable {
1599916191 let using: Int
Mtypescript-effect-schemadefault / TopLevel.ts+45 −25
@@ -79,8 +79,18 @@ export class Using extends S.Class<Using>("Using")({
7979 "using": S.Int,
8080 }) {}
8181
82+export class Ushort extends S.Class<Ushort>("Ushort")({
83+ "ushort": S.Int,
84+}) {}
85+
86+export class Unsigned extends S.Class<Unsigned>("Unsigned")({
87+ "unsigned": S.Int,
88+}) {}
89+
8290 export class Obj6 extends S.Class<Obj6>("Obj6")({
8391 "dummy": S.Int,
92+ "unsigned": Unsigned,
93+ "ushort": Ushort,
8494 "using": Using,
8595 "Utf8JsonReader": Utf8JsonReader,
8696 "Utf8JsonWriter": Utf8JsonWriter,
@@ -101,18 +111,10 @@ export class Obj6 extends S.Class<Obj6>("Obj6")({
101111 "yield": Yield,
102112 }) {}
103113
104-export class Ushort extends S.Class<Ushort>("Ushort")({
105- "ushort": S.Int,
106-}) {}
107-
108114 export class UseSerializers extends S.Class<UseSerializers>("UseSerializers")({
109115 "UseSerializers": S.Int,
110116 }) {}
111117
112-export class Unsigned extends S.Class<Unsigned>("Unsigned")({
113- "unsigned": S.Int,
114-}) {}
115-
116118 export class Unsafe extends S.Class<Unsafe>("Unsafe")({
117119 "unsafe": S.Int,
118120 }) {}
@@ -121,6 +123,10 @@ export class Unowned extends S.Class<Unowned>("Unowned")({
121123 "unowned": S.Int,
122124 }) {}
123125
126+export class UnmarshalJson extends S.Class<UnmarshalJson>("UnmarshalJson")({
127+ "UnmarshalJSON": S.Int,
128+}) {}
129+
124130 export class Union extends S.Class<Union>("Union")({
125131 "union": S.Int,
126132 }) {}
@@ -190,6 +196,10 @@ export class ToJson extends S.Class<ToJson>("ToJson")({
190196 "to_json": S.Int,
191197 }) {}
192198
199+export class ToDict extends S.Class<ToDict>("ToDict")({
200+ "to_dict": S.Int,
201+}) {}
202+
193203 export class TimeZone extends S.Class<TimeZone>("TimeZone")({
194204 "TimeZone": S.Int,
195205 }) {}
@@ -338,6 +348,10 @@ export class Self extends S.Class<Self>("Self")({
338348 "Self": S.Int,
339349 }) {}
340350
351+export class Select extends S.Class<Select>("Select")({
352+ "select": S.Int,
353+}) {}
354+
341355 export class PrimitiveKind extends S.Class<PrimitiveKind>("PrimitiveKind")({
342356 "PrimitiveKind": S.Int,
343357 }) {}
@@ -365,6 +379,7 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({
365379 "true": TrueClass,
366380 "type": TypeClass,
367381 "PrimitiveKind": PrimitiveKind,
382+ "select": Select,
368383 "Self": Self,
369384 "Sendable": Sendable,
370385 "SerialDescriptor": SerialDescriptor,
@@ -402,6 +417,7 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({
402417 "TimeOnly": TimeOnly,
403418 "TimeOnlyConverter": TimeOnlyConverter,
404419 "TimeZone": TimeZone,
420+ "to_dict": ToDict,
405421 "to_json": ToJson,
406422 "toString": ToString,
407423 "top_level": TopLevelClass,
@@ -419,18 +435,13 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({
419435 "unchecked": Unchecked,
420436 "undefined": Undefined,
421437 "union": Union,
438+ "UnmarshalJSON": UnmarshalJson,
422439 "unowned": Unowned,
423440 "unsafe": Unsafe,
424- "unsigned": Unsigned,
425441 "UseSerializers": UseSerializers,
426- "ushort": Ushort,
427442 }) {}
428443 Object.defineProperty(Obj5.prototype, "toString", { writable: true });
429444
430-export class Select extends S.Class<Select>("Select")({
431- "select": S.Int,
432-}) {}
433-
434445 export class Sel extends S.Class<Sel>("Sel")({
435446 "SEL": S.Int,
436447 }) {}
@@ -679,6 +690,10 @@ export class Nonatomic extends S.Class<Nonatomic>("Nonatomic")({
679690 "nonatomic": S.Int,
680691 }) {}
681692
693+export class Noexcept extends S.Class<Noexcept>("Noexcept")({
694+ "noexcept": S.Int,
695+}) {}
696+
682697 export class NoSuchMethod extends S.Class<NoSuchMethod>("NoSuchMethod")({
683698 "noSuchMethod": S.Int,
684699 }) {}
@@ -686,6 +701,7 @@ export class NoSuchMethod extends S.Class<NoSuchMethod>("NoSuchMethod")({
686701 export class Obj4 extends S.Class<Obj4>("Obj4")({
687702 "dummy": S.Int,
688703 "noSuchMethod": NoSuchMethod,
704+ "noexcept": Noexcept,
689705 "nonatomic": Nonatomic,
690706 "None": None,
691707 "nonlocal": Nonlocal,
@@ -748,11 +764,6 @@ export class Obj4 extends S.Class<Obj4>("Obj4")({
748764 "sbyte": Sbyte,
749765 "sealed": Sealed,
750766 "SEL": Sel,
751- "select": Select,
752-}) {}
753-
754-export class Noexcept extends S.Class<Noexcept>("Noexcept")({
755- "noexcept": S.Int,
756767 }) {}
757768
758769 export class No extends S.Class<No>("No")({
@@ -795,6 +806,10 @@ export class MetadataPropertyHandling extends S.Class<MetadataPropertyHandling>(
795806 "metadata_property_handling": S.Int,
796807 }) {}
797808
809+export class MarshalJson extends S.Class<MarshalJson>("MarshalJson")({
810+ "MarshalJSON": S.Int,
811+}) {}
812+
798813 export class MapEntry extends S.Class<MapEntry>("MapEntry")({
799814 "MapEntry": S.Int,
800815 }) {}
@@ -1007,8 +1022,13 @@ export class Guard extends S.Class<Guard>("Guard")({
10071022 "guard": S.Int,
10081023 }) {}
10091024
1025+export class Goto extends S.Class<Goto>("Goto")({
1026+ "goto": S.Int,
1027+}) {}
1028+
10101029 export class Obj3 extends S.Class<Obj3>("Obj3")({
10111030 "dummy": S.Int,
1031+ "goto": Goto,
10121032 "guard": Guard,
10131033 "hasOwnProperty": HasOwnProperty,
10141034 "hashCode": HashCode,
@@ -1062,6 +1082,7 @@ export class Obj3 extends S.Class<Obj3>("Obj3")({
10621082 "long": Long,
10631083 "map": Map,
10641084 "MapEntry": MapEntry,
1085+ "MarshalJSON": MarshalJson,
10651086 "metadata_property_handling": MetadataPropertyHandling,
10661087 "module": Module,
10671088 "mutable": Mutable,
@@ -1072,17 +1093,12 @@ export class Obj3 extends S.Class<Obj3>("Obj3")({
10721093 "newtonsoft": Newtonsoft,
10731094 "nil": Nil,
10741095 "NO": No,
1075- "noexcept": Noexcept,
10761096 }) {}
10771097
10781098 export class FalseClass extends S.Class<FalseClass>("FalseClass")({
10791099 "false": S.Int,
10801100 }) {}
10811101
1082-export class Goto extends S.Class<Goto>("Goto")({
1083- "goto": S.Int,
1084-}) {}
1085-
10861102 export class Go extends S.Class<Go>("Go")({
10871103 "go": S.Int,
10881104 }) {}
@@ -1107,6 +1123,10 @@ export class FromJson extends S.Class<FromJson>("FromJson")({
11071123 "from_json": S.Int,
11081124 }) {}
11091125
1126+export class FromDict extends S.Class<FromDict>("FromDict")({
1127+ "from_dict": S.Int,
1128+}) {}
1129+
11101130 export class From extends S.Class<From>("From")({
11111131 "from": S.Int,
11121132 }) {}
@@ -1389,13 +1409,13 @@ export class Obj2 extends S.Class<Obj2>("Obj2")({
13891409 "FormatException": FormatException,
13901410 "friend": Friend,
13911411 "from": From,
1412+ "from_dict": FromDict,
13921413 "from_json": FromJson,
13931414 "func": Func,
13941415 "function": Function,
13951416 "get": Get,
13961417 "global": Global,
13971418 "go": Go,
1398- "goto": Goto,
13991419 "false": FalseClass,
14001420 }) {}
Mtypescript-zoddefault / TopLevel.ts+49 −25
@@ -607,6 +607,11 @@ export const FromSchema = z.object({
607607 });
608608 export type From = z.infer<typeof FromSchema>;
609609
610+export const FromDictSchema = z.object({
611+ "from_dict": z.number().int(),
612+});
613+export type FromDict = z.infer<typeof FromDictSchema>;
614+
610615 export const FromJsonSchema = z.object({
611616 "from_json": z.number().int(),
612617 });
@@ -637,16 +642,16 @@ export const GoSchema = z.object({
637642 });
638643 export type Go = z.infer<typeof GoSchema>;
639644
640-export const GotoSchema = z.object({
641- "goto": z.number().int(),
642-});
643-export type Goto = z.infer<typeof GotoSchema>;
644-
645645 export const FalseClassSchema = z.object({
646646 "false": z.number().int(),
647647 });
648648 export type FalseClass = z.infer<typeof FalseClassSchema>;
649649
650+export const GotoSchema = z.object({
651+ "goto": z.number().int(),
652+});
653+export type Goto = z.infer<typeof GotoSchema>;
654+
650655 export const GuardSchema = z.object({
651656 "guard": z.number().int(),
652657 });
@@ -912,6 +917,11 @@ export const MapEntrySchema = z.object({
912917 });
913918 export type MapEntry = z.infer<typeof MapEntrySchema>;
914919
920+export const MarshalJsonSchema = z.object({
921+ "MarshalJSON": z.number().int(),
922+});
923+export type MarshalJson = z.infer<typeof MarshalJsonSchema>;
924+
915925 export const MetadataPropertyHandlingSchema = z.object({
916926 "metadata_property_handling": z.number().int(),
917927 });
@@ -962,16 +972,16 @@ export const NoSchema = z.object({
962972 });
963973 export type No = z.infer<typeof NoSchema>;
964974
965-export const NoexceptSchema = z.object({
966- "noexcept": z.number().int(),
967-});
968-export type Noexcept = z.infer<typeof NoexceptSchema>;
969-
970975 export const NoSuchMethodSchema = z.object({
971976 "noSuchMethod": z.number().int(),
972977 });
973978 export type NoSuchMethod = z.infer<typeof NoSuchMethodSchema>;
974979
980+export const NoexceptSchema = z.object({
981+ "noexcept": z.number().int(),
982+});
983+export type Noexcept = z.infer<typeof NoexceptSchema>;
984+
975985 export const NonatomicSchema = z.object({
976986 "nonatomic": z.number().int(),
977987 });
@@ -1282,11 +1292,6 @@ export const SelSchema = z.object({
12821292 });
12831293 export type Sel = z.infer<typeof SelSchema>;
12841294
1285-export const SelectSchema = z.object({
1286- "select": z.number().int(),
1287-});
1288-export type Select = z.infer<typeof SelectSchema>;
1289-
12901295 export const KSerializerSchema = z.object({
12911296 "KSerializer": z.number().int(),
12921297 });
@@ -1312,6 +1317,11 @@ export const PrimitiveKindSchema = z.object({
13121317 });
13131318 export type PrimitiveKind = z.infer<typeof PrimitiveKindSchema>;
13141319
1320+export const SelectSchema = z.object({
1321+ "select": z.number().int(),
1322+});
1323+export type Select = z.infer<typeof SelectSchema>;
1324+
13151325 export const SelfSchema = z.object({
13161326 "Self": z.number().int(),
13171327 });
@@ -1497,6 +1507,11 @@ export const TimeZoneSchema = z.object({
14971507 });
14981508 export type TimeZone = z.infer<typeof TimeZoneSchema>;
14991509
1510+export const ToDictSchema = z.object({
1511+ "to_dict": z.number().int(),
1512+});
1513+export type ToDict = z.infer<typeof ToDictSchema>;
1514+
15001515 export const ToJsonSchema = z.object({
15011516 "to_json": z.number().int(),
15021517 });
@@ -1582,6 +1597,11 @@ export const UnionSchema = z.object({
15821597 });
15831598 export type Union = z.infer<typeof UnionSchema>;
15841599
1600+export const UnmarshalJsonSchema = z.object({
1601+ "UnmarshalJSON": z.number().int(),
1602+});
1603+export type UnmarshalJson = z.infer<typeof UnmarshalJsonSchema>;
1604+
15851605 export const UnownedSchema = z.object({
15861606 "unowned": z.number().int(),
15871607 });
@@ -1592,16 +1612,16 @@ export const UnsafeSchema = z.object({
15921612 });
15931613 export type Unsafe = z.infer<typeof UnsafeSchema>;
15941614
1595-export const UnsignedSchema = z.object({
1596- "unsigned": z.number().int(),
1597-});
1598-export type Unsigned = z.infer<typeof UnsignedSchema>;
1599-
16001615 export const UseSerializersSchema = z.object({
16011616 "UseSerializers": z.number().int(),
16021617 });
16031618 export type UseSerializers = z.infer<typeof UseSerializersSchema>;
16041619
1620+export const UnsignedSchema = z.object({
1621+ "unsigned": z.number().int(),
1622+});
1623+export type Unsigned = z.infer<typeof UnsignedSchema>;
1624+
16051625 export const UshortSchema = z.object({
16061626 "ushort": z.number().int(),
16071627 });
@@ -1824,19 +1844,20 @@ export const Obj2Schema = z.object({
18241844 "FormatException": FormatExceptionSchema,
18251845 "friend": FriendSchema,
18261846 "from": FromSchema,
1847+ "from_dict": FromDictSchema,
18271848 "from_json": FromJsonSchema,
18281849 "func": FuncSchema,
18291850 "function": FunctionSchema,
18301851 "get": GetSchema,
18311852 "global": GlobalSchema,
18321853 "go": GoSchema,
1833- "goto": GotoSchema,
18341854 "false": FalseClassSchema,
18351855 });
18361856 export type Obj2 = z.infer<typeof Obj2Schema>;
18371857
18381858 export const Obj3Schema = z.object({
18391859 "dummy": z.number().int(),
1860+ "goto": GotoSchema,
18401861 "guard": GuardSchema,
18411862 "hasOwnProperty": HasOwnPropertySchema,
18421863 "hashCode": HashCodeSchema,
@@ -1890,6 +1911,7 @@ export const Obj3Schema = z.object({
18901911 "long": LongSchema,
18911912 "map": MapSchema,
18921913 "MapEntry": MapEntrySchema,
1914+ "MarshalJSON": MarshalJsonSchema,
18931915 "metadata_property_handling": MetadataPropertyHandlingSchema,
18941916 "module": ModuleSchema,
18951917 "mutable": MutableSchema,
@@ -1900,13 +1922,13 @@ export const Obj3Schema = z.object({
19001922 "newtonsoft": NewtonsoftSchema,
19011923 "nil": NilSchema,
19021924 "NO": NoSchema,
1903- "noexcept": NoexceptSchema,
19041925 });
19051926 export type Obj3 = z.infer<typeof Obj3Schema>;
19061927
19071928 export const Obj4Schema = z.object({
19081929 "dummy": z.number().int(),
19091930 "noSuchMethod": NoSuchMethodSchema,
1931+ "noexcept": NoexceptSchema,
19101932 "nonatomic": NonatomicSchema,
19111933 "None": NoneSchema,
19121934 "nonlocal": NonlocalSchema,
@@ -1969,7 +1991,6 @@ export const Obj4Schema = z.object({
19691991 "sbyte": SbyteSchema,
19701992 "sealed": SealedSchema,
19711993 "SEL": SelSchema,
1972- "select": SelectSchema,
19731994 });
19741995 export type Obj4 = z.infer<typeof Obj4Schema>;
19751996
@@ -1980,6 +2001,7 @@ export const Obj5Schema = z.object({
19802001 "true": TrueClassSchema,
19812002 "type": TypeClassSchema,
19822003 "PrimitiveKind": PrimitiveKindSchema,
2004+ "select": SelectSchema,
19832005 "Self": SelfSchema,
19842006 "Sendable": SendableSchema,
19852007 "SerialDescriptor": SerialDescriptorSchema,
@@ -2017,6 +2039,7 @@ export const Obj5Schema = z.object({
20172039 "TimeOnly": TimeOnlySchema,
20182040 "TimeOnlyConverter": TimeOnlyConverterSchema,
20192041 "TimeZone": TimeZoneSchema,
2042+ "to_dict": ToDictSchema,
20202043 "to_json": ToJsonSchema,
20212044 "toString": ToStringSchema,
20222045 "top_level": TopLevelClassSchema,
@@ -2034,16 +2057,17 @@ export const Obj5Schema = z.object({
20342057 "unchecked": UncheckedSchema,
20352058 "undefined": UndefinedSchema,
20362059 "union": UnionSchema,
2060+ "UnmarshalJSON": UnmarshalJsonSchema,
20372061 "unowned": UnownedSchema,
20382062 "unsafe": UnsafeSchema,
2039- "unsigned": UnsignedSchema,
20402063 "UseSerializers": UseSerializersSchema,
2041- "ushort": UshortSchema,
20422064 });
20432065 export type Obj5 = z.infer<typeof Obj5Schema>;
20442066
20452067 export const Obj6Schema = z.object({
20462068 "dummy": z.number().int(),
2069+ "unsigned": UnsignedSchema,
2070+ "ushort": UshortSchema,
20472071 "using": UsingSchema,
20482072 "Utf8JsonReader": Utf8JsonReaderSchema,
20492073 "Utf8JsonWriter": Utf8JsonWriterSchema,
Mtypescriptdefault / TopLevel.ts+83 −47
@@ -400,13 +400,13 @@ export interface Obj2 {
400400 foreach: Foreach;
401401 friend: Friend;
402402 from: From;
403+ from_dict: FromDict;
403404 from_json: FromJSON;
404405 func: Func;
405406 function: Function;
406407 get: Get;
407408 global: Global;
408409 go: Go;
409- goto: Goto;
410410 }
411411
412412 export interface DateFormatter {
@@ -639,6 +639,10 @@ export interface From {
639639 from: number;
640640 }
641641
642+export interface FromDict {
643+ from_dict: number;
644+}
645+
642646 export interface FromJSON {
643647 from_json: number;
644648 }
@@ -663,10 +667,6 @@ export interface Go {
663667 go: number;
664668 }
665669
666-export interface Goto {
667- goto: number;
668-}
669-
670670 export interface Obj3 {
671671 Hashable: Hashable;
672672 Hasher: Hasher;
@@ -685,8 +685,10 @@ export interface Obj3 {
685685 JsonTokenType: JSONTokenType;
686686 Locale: Locale;
687687 MapEntry: MapEntry;
688+ MarshalJSON: MarshalJSON;
688689 NO: No;
689690 dummy: number;
691+ goto: Goto;
690692 guard: Guard;
691693 hasOwnProperty: HasOwnProperty;
692694 hashCode: HashCode;
@@ -732,7 +734,6 @@ export interface Obj3 {
732734 new: New;
733735 newtonsoft: Newtonsoft;
734736 nil: Nil;
735- noexcept: Noexcept;
736737 }
737738
738739 export interface Hashable {
@@ -803,10 +804,18 @@ export interface MapEntry {
803804 MapEntry: number;
804805 }
805806
807+export interface MarshalJSON {
808+ MarshalJSON: number;
809+}
810+
806811 export interface No {
807812 NO: number;
808813 }
809814
815+export interface Goto {
816+ goto: number;
817+}
818+
810819 export interface Guard {
811820 guard: number;
812821 }
@@ -987,10 +996,6 @@ export interface Nil {
987996 nil: number;
988997 }
989998
990-export interface Noexcept {
991- noexcept: number;
992-}
993-
994999 export interface Obj4 {
9951000 NSError: NSError;
9961001 NSObject: NSObject;
@@ -1003,6 +1008,7 @@ export interface Obj4 {
10031008 SEL: Sel;
10041009 dummy: number;
10051010 noSuchMethod: NoSuchMethod;
1011+ noexcept: Noexcept;
10061012 nonatomic: Nonatomic;
10071013 none: NoneClass;
10081014 nonlocal: Nonlocal;
@@ -1056,7 +1062,6 @@ export interface Obj4 {
10561062 s: S;
10571063 sbyte: Sbyte;
10581064 sealed: Sealed;
1059- select: Select;
10601065 }
10611066
10621067 export interface NSError {
@@ -1099,6 +1104,10 @@ export interface NoSuchMethod {
10991104 noSuchMethod: number;
11001105 }
11011106
1107+export interface Noexcept {
1108+ noexcept: number;
1109+}
1110+
11021111 export interface Nonatomic {
11031112 nonatomic: number;
11041113 }
@@ -1311,10 +1320,6 @@ export interface Sealed {
13111320 sealed: number;
13121321 }
13131322
1314-export interface Select {
1315- select: number;
1316-}
1317-
13181323 export interface Obj5 {
13191324 KSerializer: KSerializer;
13201325 PrimitiveKind: PrimitiveKind;
@@ -1333,8 +1338,10 @@ export interface Obj5 {
13331338 TimeZone: TimeZone;
13341339 True: True;
13351340 Type: Type;
1341+ UnmarshalJSON: UnmarshalJSON;
13361342 UseSerializers: UseSerializers;
13371343 dummy: number;
1344+ select: Select;
13381345 self: SelfClass;
13391346 serialize: Serialize;
13401347 set: Set;
@@ -1361,6 +1368,7 @@ export interface Obj5 {
13611368 throw: Throw;
13621369 throws: Throws;
13631370 toString: ToString;
1371+ to_dict: ToDict;
13641372 to_json: ToJSON;
13651373 top_level: TopLevelClass;
13661374 transient: Transient;
@@ -1379,8 +1387,6 @@ export interface Obj5 {
13791387 union: Union;
13801388 unowned: Unowned;
13811389 unsafe: Unsafe;
1382- unsigned: Unsigned;
1383- ushort: Ushort;
13841390 }
13851391
13861392 export interface KSerializer {
@@ -1451,10 +1457,18 @@ export interface Type {
14511457 Type: number;
14521458 }
14531459
1460+export interface UnmarshalJSON {
1461+ UnmarshalJSON: number;
1462+}
1463+
14541464 export interface UseSerializers {
14551465 UseSerializers: number;
14561466 }
14571467
1468+export interface Select {
1469+ select: number;
1470+}
1471+
14581472 export interface SelfClass {
14591473 self: number;
14601474 }
@@ -1559,6 +1573,10 @@ export interface ToString {
15591573 toString: number;
15601574 }
15611575
1576+export interface ToDict {
1577+ to_dict: number;
1578+}
1579+
15621580 export interface ToJSON {
15631581 to_json: number;
15641582 }
@@ -1631,20 +1649,14 @@ export interface Unsafe {
16311649 unsafe: number;
16321650 }
16331651
1634-export interface Unsigned {
1635- unsigned: number;
1636-}
1637-
1638-export interface Ushort {
1639- ushort: number;
1640-}
1641-
16421652 export interface Obj6 {
16431653 UUID: UUID;
16441654 Utf8JsonReader: Utf8JSONReader;
16451655 Utf8JsonWriter: Utf8JSONWriter;
16461656 YES: Yes;
16471657 dummy: number;
1658+ unsigned: Unsigned;
1659+ ushort: Ushort;
16481660 using: Using;
16491661 var: Var;
16501662 virtual: Virtual;
@@ -1677,6 +1689,14 @@ export interface Yes {
16771689 YES: number;
16781690 }
16791691
1692+export interface Unsigned {
1693+ unsigned: number;
1694+}
1695+
1696+export interface Ushort {
1697+ ushort: number;
1698+}
1699+
16801700 export interface Using {
16811701 using: number;
16821702 }
@@ -1829,7 +1849,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18291849 if (val === null || typeof val !== "object" || Array.isArray(val)) {
18301850 return invalidValue(l(ref || "object"), val, key, parent);
18311851 }
1832- const result: any = {};
1852+ const result: any = Object.create(null);
18331853 Object.getOwnPropertyNames(props).forEach(key => {
18341854 const prop = props[key];
18351855 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1840,7 +1860,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18401860 result[key] = transform(val[key], additional, getProps, key, ref);
18411861 }
18421862 });
1843- return result;
1863+ return Object.setPrototypeOf(result, Object.prototype);
18441864 }
18451865
18461866 if (typ === "any") return val;
@@ -2248,13 +2268,13 @@ const typeMap: any = {
22482268 { json: "foreach", js: "foreach", typ: r("Foreach") },
22492269 { json: "friend", js: "friend", typ: r("Friend") },
22502270 { json: "from", js: "from", typ: r("From") },
2271+ { json: "from_dict", js: "from_dict", typ: r("FromDict") },
22512272 { json: "from_json", js: "from_json", typ: r("FromJSON") },
22522273 { json: "func", js: "func", typ: r("Func") },
22532274 { json: "function", js: "function", typ: r("Function") },
22542275 { json: "get", js: "get", typ: r("Get") },
22552276 { json: "global", js: "global", typ: r("Global") },
22562277 { json: "go", js: "go", typ: r("Go") },
2257- { json: "goto", js: "goto", typ: r("Goto") },
22582278 ], false),
22592279 "DateFormatter": o([
22602280 { json: "DateFormatter", js: "DateFormatter", typ: i(0) },
@@ -2427,6 +2447,9 @@ const typeMap: any = {
24272447 "From": o([
24282448 { json: "from", js: "from", typ: i(0) },
24292449 ], false),
2450+ "FromDict": o([
2451+ { json: "from_dict", js: "from_dict", typ: i(0) },
2452+ ], false),
24302453 "FromJSON": o([
24312454 { json: "from_json", js: "from_json", typ: i(0) },
24322455 ], false),
@@ -2445,9 +2468,6 @@ const typeMap: any = {
24452468 "Go": o([
24462469 { json: "go", js: "go", typ: i(0) },
24472470 ], false),
2448- "Goto": o([
2449- { json: "goto", js: "goto", typ: i(0) },
2450- ], false),
24512471 "Obj3": o([
24522472 { json: "Hashable", js: "Hashable", typ: r("Hashable") },
24532473 { json: "Hasher", js: "Hasher", typ: r("Hasher") },
@@ -2466,8 +2486,10 @@ const typeMap: any = {
24662486 { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") },
24672487 { json: "Locale", js: "Locale", typ: r("Locale") },
24682488 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
2489+ { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
24692490 { json: "NO", js: "NO", typ: r("No") },
24702491 { json: "dummy", js: "dummy", typ: i(0) },
2492+ { json: "goto", js: "goto", typ: r("Goto") },
24712493 { json: "guard", js: "guard", typ: r("Guard") },
24722494 { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") },
24732495 { json: "hashCode", js: "hashCode", typ: r("HashCode") },
@@ -2513,7 +2535,6 @@ const typeMap: any = {
25132535 { json: "new", js: "new", typ: r("New") },
25142536 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
25152537 { json: "nil", js: "nil", typ: r("Nil") },
2516- { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
25172538 ], false),
25182539 "Hashable": o([
25192540 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -2566,9 +2587,15 @@ const typeMap: any = {
25662587 "MapEntry": o([
25672588 { json: "MapEntry", js: "MapEntry", typ: i(0) },
25682589 ], false),
2590+ "MarshalJSON": o([
2591+ { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
2592+ ], false),
25692593 "No": o([
25702594 { json: "NO", js: "NO", typ: i(0) },
25712595 ], false),
2596+ "Goto": o([
2597+ { json: "goto", js: "goto", typ: i(0) },
2598+ ], false),
25722599 "Guard": o([
25732600 { json: "guard", js: "guard", typ: i(0) },
25742601 ], false),
@@ -2704,9 +2731,6 @@ const typeMap: any = {
27042731 "Nil": o([
27052732 { json: "nil", js: "nil", typ: i(0) },
27062733 ], false),
2707- "Noexcept": o([
2708- { json: "noexcept", js: "noexcept", typ: i(0) },
2709- ], false),
27102734 "Obj4": o([
27112735 { json: "NSError", js: "NSError", typ: r("NSError") },
27122736 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
@@ -2719,6 +2743,7 @@ const typeMap: any = {
27192743 { json: "SEL", js: "SEL", typ: r("Sel") },
27202744 { json: "dummy", js: "dummy", typ: i(0) },
27212745 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
2746+ { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
27222747 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
27232748 { json: "none", js: "none", typ: r("NoneClass") },
27242749 { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") },
@@ -2772,7 +2797,6 @@ const typeMap: any = {
27722797 { json: "s", js: "s", typ: r("S") },
27732798 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
27742799 { json: "sealed", js: "sealed", typ: r("Sealed") },
2775- { json: "select", js: "select", typ: r("Select") },
27762800 ], false),
27772801 "NSError": o([
27782802 { json: "NSError", js: "NSError", typ: i(0) },
@@ -2804,6 +2828,9 @@ const typeMap: any = {
28042828 "NoSuchMethod": o([
28052829 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
28062830 ], false),
2831+ "Noexcept": o([
2832+ { json: "noexcept", js: "noexcept", typ: i(0) },
2833+ ], false),
28072834 "Nonatomic": o([
28082835 { json: "nonatomic", js: "nonatomic", typ: i(0) },
28092836 ], false),
@@ -2963,9 +2990,6 @@ const typeMap: any = {
29632990 "Sealed": o([
29642991 { json: "sealed", js: "sealed", typ: i(0) },
29652992 ], false),
2966- "Select": o([
2967- { json: "select", js: "select", typ: i(0) },
2968- ], false),
29692993 "Obj5": o([
29702994 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
29712995 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
@@ -2984,8 +3008,10 @@ const typeMap: any = {
29843008 { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") },
29853009 { json: "True", js: "True", typ: r("True") },
29863010 { json: "Type", js: "Type", typ: r("Type") },
3011+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
29873012 { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
29883013 { json: "dummy", js: "dummy", typ: i(0) },
3014+ { json: "select", js: "select", typ: r("Select") },
29893015 { json: "self", js: "self", typ: r("SelfClass") },
29903016 { json: "serialize", js: "serialize", typ: r("Serialize") },
29913017 { json: "set", js: "set", typ: r("Set") },
@@ -3012,6 +3038,7 @@ const typeMap: any = {
30123038 { json: "throw", js: "throw", typ: r("Throw") },
30133039 { json: "throws", js: "throws", typ: r("Throws") },
30143040 { json: "toString", js: "toString", typ: r("ToString") },
3041+ { json: "to_dict", js: "to_dict", typ: r("ToDict") },
30153042 { json: "to_json", js: "to_json", typ: r("ToJSON") },
30163043 { json: "top_level", js: "top_level", typ: r("TopLevelClass") },
30173044 { json: "transient", js: "transient", typ: r("Transient") },
@@ -3030,8 +3057,6 @@ const typeMap: any = {
30303057 { json: "union", js: "union", typ: r("Union") },
30313058 { json: "unowned", js: "unowned", typ: r("Unowned") },
30323059 { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
3033- { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
3034- { json: "ushort", js: "ushort", typ: r("Ushort") },
30353060 ], false),
30363061 "KSerializer": o([
30373062 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -3084,9 +3109,15 @@ const typeMap: any = {
30843109 "Type": o([
30853110 { json: "Type", js: "Type", typ: i(0) },
30863111 ], false),
3112+ "UnmarshalJSON": o([
3113+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
3114+ ], false),
30873115 "UseSerializers": o([
30883116 { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
30893117 ], false),
3118+ "Select": o([
3119+ { json: "select", js: "select", typ: i(0) },
3120+ ], false),
30903121 "SelfClass": o([
30913122 { json: "self", js: "self", typ: i(0) },
30923123 ], false),
@@ -3165,6 +3196,9 @@ const typeMap: any = {
31653196 "ToString": o([
31663197 { json: "toString", js: "toString", typ: i(0) },
31673198 ], false),
3199+ "ToDict": o([
3200+ { json: "to_dict", js: "to_dict", typ: i(0) },
3201+ ], false),
31683202 "ToJSON": o([
31693203 { json: "to_json", js: "to_json", typ: i(0) },
31703204 ], false),
@@ -3219,18 +3253,14 @@ const typeMap: any = {
32193253 "Unsafe": o([
32203254 { json: "unsafe", js: "unsafe", typ: i(0) },
32213255 ], false),
3222- "Unsigned": o([
3223- { json: "unsigned", js: "unsigned", typ: i(0) },
3224- ], false),
3225- "Ushort": o([
3226- { json: "ushort", js: "ushort", typ: i(0) },
3227- ], false),
32283256 "Obj6": o([
32293257 { json: "UUID", js: "UUID", typ: r("UUID") },
32303258 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
32313259 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
32323260 { json: "YES", js: "YES", typ: r("Yes") },
32333261 { json: "dummy", js: "dummy", typ: i(0) },
3262+ { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
3263+ { json: "ushort", js: "ushort", typ: r("Ushort") },
32343264 { json: "using", js: "using", typ: r("Using") },
32353265 { json: "var", js: "var", typ: r("Var") },
32363266 { json: "virtual", js: "virtual", typ: r("Virtual") },
@@ -3258,6 +3288,12 @@ const typeMap: any = {
32583288 "Yes": o([
32593289 { json: "YES", js: "YES", typ: i(0) },
32603290 ], false),
3291+ "Unsigned": o([
3292+ { json: "unsigned", js: "unsigned", typ: i(0) },
3293+ ], false),
3294+ "Ushort": o([
3295+ { json: "ushort", js: "ushort", typ: i(0) },
3296+ ], false),
32613297 "Using": o([
32623298 { json: "using", js: "using", typ: i(0) },
32633299 ], false),
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+83 −47
@@ -400,13 +400,13 @@ export type Obj2 = {
400400 foreach: Foreach;
401401 friend: Friend;
402402 from: From;
403+ from_dict: FromDict;
403404 from_json: FromJSON;
404405 func: Func;
405406 function: Function;
406407 get: Get;
407408 global: Global;
408409 go: Go;
409- goto: Goto;
410410 }
411411
412412 export type DateFormatter = {
@@ -639,6 +639,10 @@ export type From = {
639639 from: number;
640640 }
641641
642+export type FromDict = {
643+ from_dict: number;
644+}
645+
642646 export type FromJSON = {
643647 from_json: number;
644648 }
@@ -663,10 +667,6 @@ export type Go = {
663667 go: number;
664668 }
665669
666-export type Goto = {
667- goto: number;
668-}
669-
670670 export type Obj3 = {
671671 Hashable: Hashable;
672672 Hasher: Hasher;
@@ -685,8 +685,10 @@ export type Obj3 = {
685685 JsonTokenType: JSONTokenType;
686686 Locale: Locale;
687687 MapEntry: MapEntry;
688+ MarshalJSON: MarshalJSON;
688689 NO: No;
689690 dummy: number;
691+ goto: Goto;
690692 guard: Guard;
691693 hasOwnProperty: HasOwnProperty;
692694 hashCode: HashCode;
@@ -732,7 +734,6 @@ export type Obj3 = {
732734 new: New;
733735 newtonsoft: Newtonsoft;
734736 nil: Nil;
735- noexcept: Noexcept;
736737 }
737738
738739 export type Hashable = {
@@ -803,10 +804,18 @@ export type MapEntry = {
803804 MapEntry: number;
804805 }
805806
807+export type MarshalJSON = {
808+ MarshalJSON: number;
809+}
810+
806811 export type No = {
807812 NO: number;
808813 }
809814
815+export type Goto = {
816+ goto: number;
817+}
818+
810819 export type Guard = {
811820 guard: number;
812821 }
@@ -987,10 +996,6 @@ export type Nil = {
987996 nil: number;
988997 }
989998
990-export type Noexcept = {
991- noexcept: number;
992-}
993-
994999 export type Obj4 = {
9951000 NSError: NSError;
9961001 NSObject: NSObject;
@@ -1003,6 +1008,7 @@ export type Obj4 = {
10031008 SEL: Sel;
10041009 dummy: number;
10051010 noSuchMethod: NoSuchMethod;
1011+ noexcept: Noexcept;
10061012 nonatomic: Nonatomic;
10071013 none: NoneClass;
10081014 nonlocal: Nonlocal;
@@ -1056,7 +1062,6 @@ export type Obj4 = {
10561062 s: S;
10571063 sbyte: Sbyte;
10581064 sealed: Sealed;
1059- select: Select;
10601065 }
10611066
10621067 export type NSError = {
@@ -1099,6 +1104,10 @@ export type NoSuchMethod = {
10991104 noSuchMethod: number;
11001105 }
11011106
1107+export type Noexcept = {
1108+ noexcept: number;
1109+}
1110+
11021111 export type Nonatomic = {
11031112 nonatomic: number;
11041113 }
@@ -1311,10 +1320,6 @@ export type Sealed = {
13111320 sealed: number;
13121321 }
13131322
1314-export type Select = {
1315- select: number;
1316-}
1317-
13181323 export type Obj5 = {
13191324 KSerializer: KSerializer;
13201325 PrimitiveKind: PrimitiveKind;
@@ -1333,8 +1338,10 @@ export type Obj5 = {
13331338 TimeZone: TimeZone;
13341339 True: True;
13351340 Type: Type;
1341+ UnmarshalJSON: UnmarshalJSON;
13361342 UseSerializers: UseSerializers;
13371343 dummy: number;
1344+ select: Select;
13381345 self: SelfClass;
13391346 serialize: Serialize;
13401347 set: Set;
@@ -1361,6 +1368,7 @@ export type Obj5 = {
13611368 throw: Throw;
13621369 throws: Throws;
13631370 toString: ToString;
1371+ to_dict: ToDict;
13641372 to_json: ToJSON;
13651373 top_level: TopLevelClass;
13661374 transient: Transient;
@@ -1379,8 +1387,6 @@ export type Obj5 = {
13791387 union: Union;
13801388 unowned: Unowned;
13811389 unsafe: Unsafe;
1382- unsigned: Unsigned;
1383- ushort: Ushort;
13841390 }
13851391
13861392 export type KSerializer = {
@@ -1451,10 +1457,18 @@ export type Type = {
14511457 Type: number;
14521458 }
14531459
1460+export type UnmarshalJSON = {
1461+ UnmarshalJSON: number;
1462+}
1463+
14541464 export type UseSerializers = {
14551465 UseSerializers: number;
14561466 }
14571467
1468+export type Select = {
1469+ select: number;
1470+}
1471+
14581472 export type SelfClass = {
14591473 self: number;
14601474 }
@@ -1559,6 +1573,10 @@ export type ToString = {
15591573 toString: number;
15601574 }
15611575
1576+export type ToDict = {
1577+ to_dict: number;
1578+}
1579+
15621580 export type ToJSON = {
15631581 to_json: number;
15641582 }
@@ -1631,20 +1649,14 @@ export type Unsafe = {
16311649 unsafe: number;
16321650 }
16331651
1634-export type Unsigned = {
1635- unsigned: number;
1636-}
1637-
1638-export type Ushort = {
1639- ushort: number;
1640-}
1641-
16421652 export type Obj6 = {
16431653 UUID: UUID;
16441654 Utf8JsonReader: Utf8JSONReader;
16451655 Utf8JsonWriter: Utf8JSONWriter;
16461656 YES: Yes;
16471657 dummy: number;
1658+ unsigned: Unsigned;
1659+ ushort: Ushort;
16481660 using: Using;
16491661 var: Var;
16501662 virtual: Virtual;
@@ -1677,6 +1689,14 @@ export type Yes = {
16771689 YES: number;
16781690 }
16791691
1692+export type Unsigned = {
1693+ unsigned: number;
1694+}
1695+
1696+export type Ushort = {
1697+ ushort: number;
1698+}
1699+
16801700 export type Using = {
16811701 using: number;
16821702 }
@@ -1829,7 +1849,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18291849 if (val === null || typeof val !== "object" || Array.isArray(val)) {
18301850 return invalidValue(l(ref || "object"), val, key, parent);
18311851 }
1832- const result: any = {};
1852+ const result: any = Object.create(null);
18331853 Object.getOwnPropertyNames(props).forEach(key => {
18341854 const prop = props[key];
18351855 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1840,7 +1860,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18401860 result[key] = transform(val[key], additional, getProps, key, ref);
18411861 }
18421862 });
1843- return result;
1863+ return Object.setPrototypeOf(result, Object.prototype);
18441864 }
18451865
18461866 if (typ === "any") return val;
@@ -2248,13 +2268,13 @@ const typeMap: any = {
22482268 { json: "foreach", js: "foreach", typ: r("Foreach") },
22492269 { json: "friend", js: "friend", typ: r("Friend") },
22502270 { json: "from", js: "from", typ: r("From") },
2271+ { json: "from_dict", js: "from_dict", typ: r("FromDict") },
22512272 { json: "from_json", js: "from_json", typ: r("FromJSON") },
22522273 { json: "func", js: "func", typ: r("Func") },
22532274 { json: "function", js: "function", typ: r("Function") },
22542275 { json: "get", js: "get", typ: r("Get") },
22552276 { json: "global", js: "global", typ: r("Global") },
22562277 { json: "go", js: "go", typ: r("Go") },
2257- { json: "goto", js: "goto", typ: r("Goto") },
22582278 ], false),
22592279 "DateFormatter": o([
22602280 { json: "DateFormatter", js: "DateFormatter", typ: i(0) },
@@ -2427,6 +2447,9 @@ const typeMap: any = {
24272447 "From": o([
24282448 { json: "from", js: "from", typ: i(0) },
24292449 ], false),
2450+ "FromDict": o([
2451+ { json: "from_dict", js: "from_dict", typ: i(0) },
2452+ ], false),
24302453 "FromJSON": o([
24312454 { json: "from_json", js: "from_json", typ: i(0) },
24322455 ], false),
@@ -2445,9 +2468,6 @@ const typeMap: any = {
24452468 "Go": o([
24462469 { json: "go", js: "go", typ: i(0) },
24472470 ], false),
2448- "Goto": o([
2449- { json: "goto", js: "goto", typ: i(0) },
2450- ], false),
24512471 "Obj3": o([
24522472 { json: "Hashable", js: "Hashable", typ: r("Hashable") },
24532473 { json: "Hasher", js: "Hasher", typ: r("Hasher") },
@@ -2466,8 +2486,10 @@ const typeMap: any = {
24662486 { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") },
24672487 { json: "Locale", js: "Locale", typ: r("Locale") },
24682488 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
2489+ { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
24692490 { json: "NO", js: "NO", typ: r("No") },
24702491 { json: "dummy", js: "dummy", typ: i(0) },
2492+ { json: "goto", js: "goto", typ: r("Goto") },
24712493 { json: "guard", js: "guard", typ: r("Guard") },
24722494 { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") },
24732495 { json: "hashCode", js: "hashCode", typ: r("HashCode") },
@@ -2513,7 +2535,6 @@ const typeMap: any = {
25132535 { json: "new", js: "new", typ: r("New") },
25142536 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
25152537 { json: "nil", js: "nil", typ: r("Nil") },
2516- { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
25172538 ], false),
25182539 "Hashable": o([
25192540 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -2566,9 +2587,15 @@ const typeMap: any = {
25662587 "MapEntry": o([
25672588 { json: "MapEntry", js: "MapEntry", typ: i(0) },
25682589 ], false),
2590+ "MarshalJSON": o([
2591+ { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
2592+ ], false),
25692593 "No": o([
25702594 { json: "NO", js: "NO", typ: i(0) },
25712595 ], false),
2596+ "Goto": o([
2597+ { json: "goto", js: "goto", typ: i(0) },
2598+ ], false),
25722599 "Guard": o([
25732600 { json: "guard", js: "guard", typ: i(0) },
25742601 ], false),
@@ -2704,9 +2731,6 @@ const typeMap: any = {
27042731 "Nil": o([
27052732 { json: "nil", js: "nil", typ: i(0) },
27062733 ], false),
2707- "Noexcept": o([
2708- { json: "noexcept", js: "noexcept", typ: i(0) },
2709- ], false),
27102734 "Obj4": o([
27112735 { json: "NSError", js: "NSError", typ: r("NSError") },
27122736 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
@@ -2719,6 +2743,7 @@ const typeMap: any = {
27192743 { json: "SEL", js: "SEL", typ: r("Sel") },
27202744 { json: "dummy", js: "dummy", typ: i(0) },
27212745 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
2746+ { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
27222747 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
27232748 { json: "none", js: "none", typ: r("NoneClass") },
27242749 { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") },
@@ -2772,7 +2797,6 @@ const typeMap: any = {
27722797 { json: "s", js: "s", typ: r("S") },
27732798 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
27742799 { json: "sealed", js: "sealed", typ: r("Sealed") },
2775- { json: "select", js: "select", typ: r("Select") },
27762800 ], false),
27772801 "NSError": o([
27782802 { json: "NSError", js: "NSError", typ: i(0) },
@@ -2804,6 +2828,9 @@ const typeMap: any = {
28042828 "NoSuchMethod": o([
28052829 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
28062830 ], false),
2831+ "Noexcept": o([
2832+ { json: "noexcept", js: "noexcept", typ: i(0) },
2833+ ], false),
28072834 "Nonatomic": o([
28082835 { json: "nonatomic", js: "nonatomic", typ: i(0) },
28092836 ], false),
@@ -2963,9 +2990,6 @@ const typeMap: any = {
29632990 "Sealed": o([
29642991 { json: "sealed", js: "sealed", typ: i(0) },
29652992 ], false),
2966- "Select": o([
2967- { json: "select", js: "select", typ: i(0) },
2968- ], false),
29692993 "Obj5": o([
29702994 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
29712995 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
@@ -2984,8 +3008,10 @@ const typeMap: any = {
29843008 { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") },
29853009 { json: "True", js: "True", typ: r("True") },
29863010 { json: "Type", js: "Type", typ: r("Type") },
3011+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
29873012 { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
29883013 { json: "dummy", js: "dummy", typ: i(0) },
3014+ { json: "select", js: "select", typ: r("Select") },
29893015 { json: "self", js: "self", typ: r("SelfClass") },
29903016 { json: "serialize", js: "serialize", typ: r("Serialize") },
29913017 { json: "set", js: "set", typ: r("Set") },
@@ -3012,6 +3038,7 @@ const typeMap: any = {
30123038 { json: "throw", js: "throw", typ: r("Throw") },
30133039 { json: "throws", js: "throws", typ: r("Throws") },
30143040 { json: "toString", js: "toString", typ: r("ToString") },
3041+ { json: "to_dict", js: "to_dict", typ: r("ToDict") },
30153042 { json: "to_json", js: "to_json", typ: r("ToJSON") },
30163043 { json: "top_level", js: "top_level", typ: r("TopLevelClass") },
30173044 { json: "transient", js: "transient", typ: r("Transient") },
@@ -3030,8 +3057,6 @@ const typeMap: any = {
30303057 { json: "union", js: "union", typ: r("Union") },
30313058 { json: "unowned", js: "unowned", typ: r("Unowned") },
30323059 { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
3033- { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
3034- { json: "ushort", js: "ushort", typ: r("Ushort") },
30353060 ], false),
30363061 "KSerializer": o([
30373062 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -3084,9 +3109,15 @@ const typeMap: any = {
30843109 "Type": o([
30853110 { json: "Type", js: "Type", typ: i(0) },
30863111 ], false),
3112+ "UnmarshalJSON": o([
3113+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
3114+ ], false),
30873115 "UseSerializers": o([
30883116 { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
30893117 ], false),
3118+ "Select": o([
3119+ { json: "select", js: "select", typ: i(0) },
3120+ ], false),
30903121 "SelfClass": o([
30913122 { json: "self", js: "self", typ: i(0) },
30923123 ], false),
@@ -3165,6 +3196,9 @@ const typeMap: any = {
31653196 "ToString": o([
31663197 { json: "toString", js: "toString", typ: i(0) },
31673198 ], false),
3199+ "ToDict": o([
3200+ { json: "to_dict", js: "to_dict", typ: i(0) },
3201+ ], false),
31683202 "ToJSON": o([
31693203 { json: "to_json", js: "to_json", typ: i(0) },
31703204 ], false),
@@ -3219,18 +3253,14 @@ const typeMap: any = {
32193253 "Unsafe": o([
32203254 { json: "unsafe", js: "unsafe", typ: i(0) },
32213255 ], false),
3222- "Unsigned": o([
3223- { json: "unsigned", js: "unsigned", typ: i(0) },
3224- ], false),
3225- "Ushort": o([
3226- { json: "ushort", js: "ushort", typ: i(0) },
3227- ], false),
32283256 "Obj6": o([
32293257 { json: "UUID", js: "UUID", typ: r("UUID") },
32303258 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
32313259 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
32323260 { json: "YES", js: "YES", typ: r("Yes") },
32333261 { json: "dummy", js: "dummy", typ: i(0) },
3262+ { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
3263+ { json: "ushort", js: "ushort", typ: r("Ushort") },
32343264 { json: "using", js: "using", typ: r("Using") },
32353265 { json: "var", js: "var", typ: r("Var") },
32363266 { json: "virtual", js: "virtual", typ: r("Virtual") },
@@ -3258,6 +3288,12 @@ const typeMap: any = {
32583288 "Yes": o([
32593289 { json: "YES", js: "YES", typ: i(0) },
32603290 ], false),
3291+ "Unsigned": o([
3292+ { json: "unsigned", js: "unsigned", typ: i(0) },
3293+ ], false),
3294+ "Ushort": o([
3295+ { json: "ushort", js: "ushort", typ: i(0) },
3296+ ], false),
32613297 "Using": o([
32623298 { json: "using", js: "using", typ: i(0) },
32633299 ], false),
Test case

test/inputs/json/priority/kotlin-enum-class-case-collision.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/list.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/priority/name-style.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/nbl-stats.json

4 generated files · +26 −18
Melmdefault / QuickType.elm+20 −12
@@ -436,9 +436,9 @@ encodeQuickType x =
436436 , ("periodLengthREGULAR", Jenc.int x.periodLengthREGULAR)
437437 , ("periodType", encodePerType x.periodType)
438438 , ("periodsMax", Jenc.int x.periodsMax)
439- , ("scorers", Jenc.dict identity (Jenc.list encodeScorer) x.scorers)
439+ , ("scorers", makeDictEncoder identity (Jenc.list encodeScorer) x.scorers)
440440 , ("timeline", Jenc.list identity x.timeline)
441- , ("tm", Jenc.dict identity encodeTm x.tm)
441+ , ("tm", makeDictEncoder identity encodeTm x.tm)
442442 , ("totalTimeAdded", Jenc.int x.totalTimeAdded)
443443 , ("totallds", encodeTotallds x.totallds)
444444 ]
@@ -878,7 +878,7 @@ encodeTm x =
878878 , ("p2_score", Jenc.int x.p2Score)
879879 , ("p3_score", Jenc.int x.p3Score)
880880 , ("p4_score", Jenc.int x.p4Score)
881- , ("pl", Jenc.dict identity encodePl x.pl)
881+ , ("pl", makeDictEncoder identity encodePl x.pl)
882882 , ("score", Jenc.int x.score)
883883 , ("scoring", Jenc.list encodeScorer x.scoring)
884884 , ("shortName", Jenc.string x.shortName)
@@ -945,11 +945,11 @@ lds =
945945 encodeLds : Lds -> Jenc.Value
946946 encodeLds x =
947947 Jenc.object
948- [ ("sAssists", Jenc.dict identity encodeScorer x.sAssists)
948+ [ ("sAssists", makeDictEncoder identity encodeScorer x.sAssists)
949949 , ("sBlocks", encodeSBlocks x.sBlocks)
950- , ("sPoints", Jenc.dict identity encodeScorer x.sPoints)
951- , ("sReboundsTotal", Jenc.dict identity encodeScorer x.sReboundsTotal)
952- , ("sSteals", Jenc.dict identity encodeScorer x.sSteals)
950+ , ("sPoints", makeDictEncoder identity encodeScorer x.sPoints)
951+ , ("sReboundsTotal", makeDictEncoder identity encodeScorer x.sReboundsTotal)
952+ , ("sSteals", makeDictEncoder identity encodeScorer x.sSteals)
953953 ]
954954
955955 sBlocks : Jdec.Decoder SBlocks
@@ -1163,15 +1163,23 @@ totallds =
11631163 encodeTotallds : Totallds -> Jenc.Value
11641164 encodeTotallds x =
11651165 Jenc.object
1166- [ ("sAssists", Jenc.dict identity encodeScorer x.sAssists)
1167- , ("sBlocks", Jenc.dict identity encodeScorer x.sBlocks)
1168- , ("sPoints", Jenc.dict identity encodeScorer x.sPoints)
1169- , ("sReboundsTotal", Jenc.dict identity encodeScorer x.sReboundsTotal)
1170- , ("sSteals", Jenc.dict identity encodeScorer x.sSteals)
1166+ [ ("sAssists", makeDictEncoder identity encodeScorer x.sAssists)
1167+ , ("sBlocks", makeDictEncoder identity encodeScorer x.sBlocks)
1168+ , ("sPoints", makeDictEncoder identity encodeScorer x.sPoints)
1169+ , ("sReboundsTotal", makeDictEncoder identity encodeScorer x.sReboundsTotal)
1170+ , ("sSteals", makeDictEncoder identity encodeScorer x.sSteals)
11711171 ]
11721172
11731173 --- encoder helpers
11741174
1175+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
1176+makeDictEncoder f m r =
1177+ r
1178+ |> Dict.toList
1179+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
1180+ |> String.join ","
1181+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
1182+
11751183 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
11761184 makeNullableEncoder f m =
11771185 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -439,7 +439,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
439439 if (val === null || typeof val !== "object" || Array.isArray(val)) {
440440 return invalidValue(l(ref || "object"), val, key, parent);
441441 }
442- const result: any = {};
442+ const result: any = Object.create(null);
443443 Object.getOwnPropertyNames(props).forEach(key => {
444444 const prop = props[key];
445445 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -450,7 +450,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
450450 result[key] = transform(val[key], additional, getProps, key, ref);
451451 }
452452 });
453- return result;
453+ return Object.setPrototypeOf(result, Object.prototype);
454454 }
455455
456456 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -384,7 +384,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
384384 if (val === null || typeof val !== "object" || Array.isArray(val)) {
385385 return invalidValue(l(ref || "object"), val, key, parent);
386386 }
387- const result: any = {};
387+ const result: any = Object.create(null);
388388 Object.getOwnPropertyNames(props).forEach(key => {
389389 const prop = props[key];
390390 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -395,7 +395,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
395395 result[key] = transform(val[key], additional, getProps, key, ref);
396396 }
397397 });
398- return result;
398+ return Object.setPrototypeOf(result, Object.prototype);
399399 }
400400
401401 if (typ === "any") return val;
Test case

test/inputs/json/priority/nested-objects.json

5 generated files · +18 −10
Melmdefault / QuickType.elm+10 −2
@@ -47,12 +47,20 @@ quickType =
4747 encodeQuickType : QuickType -> Jenc.Value
4848 encodeQuickType x =
4949 Jenc.object
50- [ ("a", Jenc.dict identity Jenc.int x.a)
51- , ("b", Jenc.dict identity Jenc.int x.b)
50+ [ ("a", makeDictEncoder identity Jenc.int x.a)
51+ , ("b", makeDictEncoder identity Jenc.int x.b)
5252 ]
5353
5454 --- encoder helpers
5555
56+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
57+makeDictEncoder f m r =
58+ r
59+ |> Dict.toList
60+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
61+ |> String.join ","
62+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
63+
5664 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5765 makeNullableEncoder f m =
5866 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptconverters-all-objects--3a443babd1cb / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/priority/no-classes.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/json/priority/nst-test-suite.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -247,7 +247,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
247247 if (val === null || typeof val !== "object" || Array.isArray(val)) {
248248 return invalidValue(l(ref || "object"), val, key, parent);
249249 }
250- const result: any = {};
250+ const result: any = Object.create(null);
251251 Object.getOwnPropertyNames(props).forEach(key => {
252252 const prop = props[key];
253253 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -258,7 +258,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
258258 result[key] = transform(val[key], additional, getProps, key, ref);
259259 }
260260 });
261- return result;
261+ return Object.setPrototypeOf(result, Object.prototype);
262262 }
263263
264264 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
244244 if (val === null || typeof val !== "object" || Array.isArray(val)) {
245245 return invalidValue(l(ref || "object"), val, key, parent);
246246 }
247- const result: any = {};
247+ const result: any = Object.create(null);
248248 Object.getOwnPropertyNames(props).forEach(key => {
249249 const prop = props[key];
250250 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
255255 result[key] = transform(val[key], additional, getProps, key, ref);
256256 }
257257 });
258- return result;
258+ return Object.setPrototypeOf(result, Object.prototype);
259259 }
260260
261261 if (typ === "any") return val;
Test case

test/inputs/json/priority/number-map.json

6 generated files · +428 −7
Melmdefault / QuickType.elm+9 −1
@@ -45,11 +45,19 @@ quickType =
4545 encodeQuickType : QuickType -> Jenc.Value
4646 encodeQuickType x =
4747 Jenc.object
48- [ ("foo", Jenc.dict identity Jenc.float x.foo)
48+ [ ("foo", makeDictEncoder identity Jenc.float x.foo)
4949 ]
5050
5151 --- encoder helpers
5252
53+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
54+makeDictEncoder f m r =
55+ r
56+ |> Dict.toList
57+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
58+ |> String.join ","
59+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
60+
5361 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5462 makeNullableEncoder f m =
5563 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Aflowreadonly-true--24da4fc107df / TopLevel.js+209 −0
@@ -0,0 +1,209 @@
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+ +foo: { +[key: string]: number };
14+};
15+
16+// Converts JSON strings to/from your types
17+// and asserts the results of JSON.parse at runtime
18+function toTopLevel(json: string): TopLevel {
19+ return cast(JSON.parse(json), r("TopLevel"));
20+}
21+
22+function topLevelToJson(value: TopLevel): string {
23+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
24+}
25+
26+function invalidValue(typ: any, val: any, key: any, parent: any = '') {
27+ const prettyTyp = prettyTypeName(typ);
28+ const parentText = parent ? ` on ${parent}` : '';
29+ const keyText = key ? ` for key "${key}"` : '';
30+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
31+}
32+
33+function prettyTypeName(typ: any): string {
34+ if (Array.isArray(typ)) {
35+ if (typ.length === 2 && typ[0] === undefined) {
36+ return `an optional ${prettyTypeName(typ[1])}`;
37+ } else {
38+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
39+ }
40+ } else if (typeof typ === "object" && typ.literal !== undefined) {
41+ return typ.literal;
42+ } else {
43+ return typeof typ;
44+ }
45+}
46+
47+function jsonToJSProps(typ: any): any {
48+ if (typ.jsonToJS === undefined) {
49+ const map: any = {};
50+ typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
51+ typ.jsonToJS = map;
52+ }
53+ return typ.jsonToJS;
54+}
55+
56+function jsToJSONProps(typ: any): any {
57+ if (typ.jsToJSON === undefined) {
58+ const map: any = {};
59+ typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
60+ typ.jsToJSON = map;
61+ }
62+ return typ.jsToJSON;
63+}
64+
65+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
66+ function transformPrimitive(typ: string, val: any): any {
67+ if (typeof typ === typeof val) return val;
68+ return invalidValue(typ, val, key, parent);
69+ }
70+
71+ function transformUnion(typs: any[], val: any): any {
72+ // val must validate against one typ in typs
73+ const l = typs.length;
74+ for (let i = 0; i < l; i++) {
75+ const typ = typs[i];
76+ try {
77+ return transform(val, typ, getProps);
78+ } catch (_) {}
79+ }
80+ return invalidValue(typs, val, key, parent);
81+ }
82+
83+ function transformEnum(cases: string[], val: any): any {
84+ if (cases.indexOf(val) !== -1) return val;
85+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
86+ }
87+
88+ function transformArray(typ: any, val: any): any {
89+ // val must be an array with no invalid elements
90+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
91+
92+ return val.map(el => transform(el, typ, getProps));
93+ }
94+
95+ function transformDate(val: any): any {
96+ if (val === null) {
97+ return null;
98+ }
99+ const d = new Date(val);
100+ if (isNaN(d.valueOf())) {
101+ return invalidValue(l("Date"), val, key, parent);
102+ }
103+ return d;
104+ }
105+
106+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
107+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
108+ return invalidValue(l(ref || "object"), val, key, parent);
109+ }
110+ const result: any = Object.create(null);
111+ Object.getOwnPropertyNames(props).forEach(key => {
112+ const prop = props[key];
113+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
114+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
115+ });
116+ Object.getOwnPropertyNames(val).forEach(key => {
117+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
118+ result[key] = transform(val[key], additional, getProps, key, ref);
119+ }
120+ });
121+ return Object.setPrototypeOf(result, Object.prototype);
122+ }
123+
124+ if (typ === "any") return val;
125+ if (typ === null) {
126+ if (val === null) return val;
127+ return invalidValue(typ, val, key, parent);
128+ }
129+ if (typ === false) return invalidValue(typ, val, key, parent);
130+ let ref: any = undefined;
131+ while (typeof typ === "object" && typ.ref !== undefined) {
132+ ref = typ.ref;
133+ typ = typeMap[typ.ref];
134+ }
135+ if (Array.isArray(typ)) return transformEnum(typ, val);
136+ if (typeof typ === "object") {
137+ return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent)
138+ : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent)
139+ : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent)
140+ : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent)
141+ : 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 === "string" || val instanceof Date)) 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 i(typ: any) {
168+ return { integer: typ };
169+}
170+
171+function p(pattern: any) {
172+ return { pattern };
173+}
174+
175+function s(typ: any, min: any, max: any) {
176+ return { string: typ, min, max };
177+}
178+
179+function n(typ: any, min: any, max: any) {
180+ return { number: typ, min, max };
181+}
182+
183+function u(...typs: any[]) {
184+ return { unionMembers: typs };
185+}
186+
187+function o(props: any[], additional: any) {
188+ return { props, additional };
189+}
190+
191+function m(additional: any) {
192+ const props: any[] = [];
193+ return { props, additional };
194+}
195+
196+function r(name: string) {
197+ return { ref: name };
198+}
199+
200+const typeMap: any = {
201+ "TopLevel": o([
202+ { json: "foo", js: "foo", typ: m(3.14) },
203+ ], false),
204+};
205+
206+module.exports = {
207+ "topLevelToJson": topLevelToJson,
208+ "toTopLevel": toTopLevel,
209+};
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Atypescriptreadonly-true--24da4fc107df / TopLevel.ts+204 −0
@@ -0,0 +1,204 @@
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+ readonly foo: { readonly [key: string]: number };
12+}
13+
14+// Converts JSON strings to/from your types
15+// and asserts the results of JSON.parse at runtime
16+export class Convert {
17+ public static toTopLevel(json: string): TopLevel {
18+ return cast(JSON.parse(json), r("TopLevel"));
19+ }
20+
21+ public static topLevelToJson(value: TopLevel): string {
22+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
23+ }
24+}
25+
26+function invalidValue(typ: any, val: any, key: any, parent: any = ''): never {
27+ const prettyTyp = prettyTypeName(typ);
28+ const parentText = parent ? ` on ${parent}` : '';
29+ const keyText = key ? ` for key "${key}"` : '';
30+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
31+}
32+
33+function prettyTypeName(typ: any): string {
34+ if (Array.isArray(typ)) {
35+ if (typ.length === 2 && typ[0] === undefined) {
36+ return `an optional ${prettyTypeName(typ[1])}`;
37+ } else {
38+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
39+ }
40+ } else if (typeof typ === "object" && typ.literal !== undefined) {
41+ return typ.literal;
42+ } else {
43+ return typeof typ;
44+ }
45+}
46+
47+function jsonToJSProps(typ: any): any {
48+ if (typ.jsonToJS === undefined) {
49+ const map: any = {};
50+ typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
51+ typ.jsonToJS = map;
52+ }
53+ return typ.jsonToJS;
54+}
55+
56+function jsToJSONProps(typ: any): any {
57+ if (typ.jsToJSON === undefined) {
58+ const map: any = {};
59+ typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
60+ typ.jsToJSON = map;
61+ }
62+ return typ.jsToJSON;
63+}
64+
65+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
66+ function transformPrimitive(typ: string, val: any): any {
67+ if (typeof typ === typeof val) return val;
68+ return invalidValue(typ, val, key, parent);
69+ }
70+
71+ function transformUnion(typs: any[], val: any): any {
72+ // val must validate against one typ in typs
73+ const l = typs.length;
74+ for (let i = 0; i < l; i++) {
75+ const typ = typs[i];
76+ try {
77+ return transform(val, typ, getProps);
78+ } catch (_) {}
79+ }
80+ return invalidValue(typs, val, key, parent);
81+ }
82+
83+ function transformEnum(cases: string[], val: any): any {
84+ if (cases.indexOf(val) !== -1) return val;
85+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
86+ }
87+
88+ function transformArray(typ: any, val: any): any {
89+ // val must be an array with no invalid elements
90+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
91+
92+ return val.map(el => transform(el, typ, getProps));
93+ }
94+
95+ function transformDate(val: any): any {
96+ if (val === null) {
97+ return null;
98+ }
99+ const d = new Date(val);
100+ if (isNaN(d.valueOf())) {
101+ return invalidValue(l("Date"), val, key, parent);
102+ }
103+ return d;
104+ }
105+
106+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
107+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
108+ return invalidValue(l(ref || "object"), val, key, parent);
109+ }
110+ const result: any = Object.create(null);
111+ Object.getOwnPropertyNames(props).forEach(key => {
112+ const prop = props[key];
113+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
114+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
115+ });
116+ Object.getOwnPropertyNames(val).forEach(key => {
117+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
118+ result[key] = transform(val[key], additional, getProps, key, ref);
119+ }
120+ });
121+ return Object.setPrototypeOf(result, Object.prototype);
122+ }
123+
124+ if (typ === "any") return val;
125+ if (typ === null) {
126+ if (val === null) return val;
127+ return invalidValue(typ, val, key, parent);
128+ }
129+ if (typ === false) return invalidValue(typ, val, key, parent);
130+ let ref: any = undefined;
131+ while (typeof typ === "object" && typ.ref !== undefined) {
132+ ref = typ.ref;
133+ typ = typeMap[typ.ref];
134+ }
135+ if (Array.isArray(typ)) return transformEnum(typ, val);
136+ if (typeof typ === "object") {
137+ return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent)
138+ : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent)
139+ : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent)
140+ : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent)
141+ : 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 === "string" || val instanceof Date)) 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 i(typ: any) {
168+ return { integer: typ };
169+}
170+
171+function p(pattern: any) {
172+ return { pattern };
173+}
174+
175+function s(typ: any, min: any, max: any) {
176+ return { string: typ, min, max };
177+}
178+
179+function n(typ: any, min: any, max: any) {
180+ return { number: typ, min, max };
181+}
182+
183+function u(...typs: any[]) {
184+ return { unionMembers: typs };
185+}
186+
187+function o(props: any[], additional: any) {
188+ return { props, additional };
189+}
190+
191+function m(additional: any) {
192+ const props: any[] = [];
193+ return { props, additional };
194+}
195+
196+function r(name: string) {
197+ return { ref: name };
198+}
199+
200+const typeMap: any = {
201+ "TopLevel": o([
202+ { json: "foo", js: "foo", typ: m(3.14) },
203+ ], false),
204+};
Test case

test/inputs/json/priority/omit-empty.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/priority/optional-union.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/php-mixed-union.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/php-validation.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/recursive.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 if (val === null || typeof val !== "object" || Array.isArray(val)) {
227227 return invalidValue(l(ref || "object"), val, key, parent);
228228 }
229- const result: any = {};
229+ const result: any = Object.create(null);
230230 Object.getOwnPropertyNames(props).forEach(key => {
231231 const prop = props[key];
232232 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -237,7 +237,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
237237 result[key] = transform(val[key], additional, getProps, key, ref);
238238 }
239239 });
240- return result;
240+ return Object.setPrototypeOf(result, Object.prototype);
241241 }
242242
243243 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 if (val === null || typeof val !== "object" || Array.isArray(val)) {
227227 return invalidValue(l(ref || "object"), val, key, parent);
228228 }
229- const result: any = {};
229+ const result: any = Object.create(null);
230230 Object.getOwnPropertyNames(props).forEach(key => {
231231 const prop = props[key];
232232 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -237,7 +237,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
237237 result[key] = transform(val[key], additional, getProps, key, ref);
238238 }
239239 });
240- return result;
240+ return Object.setPrototypeOf(result, Object.prototype);
241241 }
242242
243243 if (typ === "any") return val;
Test case

test/inputs/json/priority/simple-identifiers.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/json/priority/union-constructor-clash.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/priority/unions.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/priority/url.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/priority/uuids.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/samples/bitcoin-block.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/samples/copy-with-property.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/samples/getting-started.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/samples/github-events.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -395,7 +395,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
395395 if (val === null || typeof val !== "object" || Array.isArray(val)) {
396396 return invalidValue(l(ref || "object"), val, key, parent);
397397 }
398- const result: any = {};
398+ const result: any = Object.create(null);
399399 Object.getOwnPropertyNames(props).forEach(key => {
400400 const prop = props[key];
401401 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -406,7 +406,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
406406 result[key] = transform(val[key], additional, getProps, key, ref);
407407 }
408408 });
409- return result;
409+ return Object.setPrototypeOf(result, Object.prototype);
410410 }
411411
412412 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -393,7 +393,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
393393 if (val === null || typeof val !== "object" || Array.isArray(val)) {
394394 return invalidValue(l(ref || "object"), val, key, parent);
395395 }
396- const result: any = {};
396+ const result: any = Object.create(null);
397397 Object.getOwnPropertyNames(props).forEach(key => {
398398 const prop = props[key];
399399 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -404,7 +404,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
404404 result[key] = transform(val[key], additional, getProps, key, ref);
405405 }
406406 });
407- return result;
407+ return Object.setPrototypeOf(result, Object.prototype);
408408 }
409409
410410 if (typ === "any") return val;
Test case

test/inputs/json/samples/kitchen-sink.json

4 generated files · +16 −8
Melmdefault / QuickType.elm+10 −2
@@ -105,10 +105,10 @@ encodeQuickType x =
105105 , ("differentThings", Jenc.list encodeDifferentThingElement x.differentThings)
106106 , ("doubleValue", Jenc.float x.doubleValue)
107107 , ("intValue", Jenc.int x.intValue)
108- , ("mapValue", Jenc.dict identity (makeNullableEncoder Jenc.int) x.mapValue)
108+ , ("mapValue", makeDictEncoder identity (makeNullableEncoder Jenc.int) x.mapValue)
109109 , ("name with spaces", always Jenc.null x.nameWithSpaces)
110110 , ("nullValue", always Jenc.null x.nullValue)
111- , ("nullableMapValue", Jenc.dict identity (makeNullableEncoder Jenc.int) x.nullableMapValue)
111+ , ("nullableMapValue", makeDictEncoder identity (makeNullableEncoder Jenc.int) x.nullableMapValue)
112112 , ("people", Jenc.list encodePersonElement x.people)
113113 , ("person", encodePurplePerson x.person)
114114 , ("stringValue", Jenc.string x.stringValue)
@@ -183,6 +183,14 @@ encodePurplePerson x =
183183
184184 --- encoder helpers
185185
186+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
187+makeDictEncoder f m r =
188+ r
189+ |> Dict.toList
190+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
191+ |> String.join ","
192+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
193+
186194 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
187195 makeNullableEncoder f m =
188196 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Test case

test/inputs/json/samples/null-safe.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/samples/objc-control-characters.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/samples/pokedex.json

4 generated files · +8 −8
Mflowdefault / TopLevel.js+2 −2
@@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
159159 if (val === null || typeof val !== "object" || Array.isArray(val)) {
160160 return invalidValue(l(ref || "object"), val, key, parent);
161161 }
162- const result: any = {};
162+ const result: any = Object.create(null);
163163 Object.getOwnPropertyNames(props).forEach(key => {
164164 const prop = props[key];
165165 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
170170 result[key] = transform(val[key], additional, getProps, key, ref);
171171 }
172172 });
173- return result;
173+ return Object.setPrototypeOf(result, Object.prototype);
174174 }
175175
176176 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/samples/reddit.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -248,7 +248,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
248248 if (val === null || typeof val !== "object" || Array.isArray(val)) {
249249 return invalidValue(l(ref || "object"), val, key, parent);
250250 }
251- const result: any = {};
251+ const result: any = Object.create(null);
252252 Object.getOwnPropertyNames(props).forEach(key => {
253253 const prop = props[key];
254254 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -259,7 +259,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
259259 result[key] = transform(val[key], additional, getProps, key, ref);
260260 }
261261 });
262- return result;
262+ return Object.setPrototypeOf(result, Object.prototype);
263263 }
264264
265265 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Test case

test/inputs/json/samples/simple-object.json

4 generated files · +219 −6
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Aflowreadonly-true--24da4fc107df / TopLevel.js+213 −0
@@ -0,0 +1,213 @@
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+ +date: number;
14+ +title: string;
15+ +validity: boolean;
16+};
17+
18+// Converts JSON strings to/from your types
19+// and asserts the results of JSON.parse at runtime
20+function toTopLevel(json: string): TopLevel {
21+ return cast(JSON.parse(json), r("TopLevel"));
22+}
23+
24+function topLevelToJson(value: TopLevel): string {
25+ return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
26+}
27+
28+function invalidValue(typ: any, val: any, key: any, parent: any = '') {
29+ const prettyTyp = prettyTypeName(typ);
30+ const parentText = parent ? ` on ${parent}` : '';
31+ const keyText = key ? ` for key "${key}"` : '';
32+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
33+}
34+
35+function prettyTypeName(typ: any): string {
36+ if (Array.isArray(typ)) {
37+ if (typ.length === 2 && typ[0] === undefined) {
38+ return `an optional ${prettyTypeName(typ[1])}`;
39+ } else {
40+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
41+ }
42+ } else if (typeof typ === "object" && typ.literal !== undefined) {
43+ return typ.literal;
44+ } else {
45+ return typeof typ;
46+ }
47+}
48+
49+function jsonToJSProps(typ: any): any {
50+ if (typ.jsonToJS === undefined) {
51+ const map: any = {};
52+ typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
53+ typ.jsonToJS = map;
54+ }
55+ return typ.jsonToJS;
56+}
57+
58+function jsToJSONProps(typ: any): any {
59+ if (typ.jsToJSON === undefined) {
60+ const map: any = {};
61+ typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
62+ typ.jsToJSON = map;
63+ }
64+ return typ.jsToJSON;
65+}
66+
67+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
68+ function transformPrimitive(typ: string, val: any): any {
69+ if (typeof typ === typeof val) return val;
70+ return invalidValue(typ, val, key, parent);
71+ }
72+
73+ function transformUnion(typs: any[], val: any): any {
74+ // val must validate against one typ in typs
75+ const l = typs.length;
76+ for (let i = 0; i < l; i++) {
77+ const typ = typs[i];
78+ try {
79+ return transform(val, typ, getProps);
80+ } catch (_) {}
81+ }
82+ return invalidValue(typs, val, key, parent);
83+ }
84+
85+ function transformEnum(cases: string[], val: any): any {
86+ if (cases.indexOf(val) !== -1) return val;
87+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
88+ }
89+
90+ function transformArray(typ: any, val: any): any {
91+ // val must be an array with no invalid elements
92+ if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
93+
94+ return val.map(el => transform(el, typ, getProps));
95+ }
96+
97+ function transformDate(val: any): any {
98+ if (val === null) {
99+ return null;
100+ }
101+ const d = new Date(val);
102+ if (isNaN(d.valueOf())) {
103+ return invalidValue(l("Date"), val, key, parent);
104+ }
105+ return d;
106+ }
107+
108+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
109+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
110+ return invalidValue(l(ref || "object"), val, key, parent);
111+ }
112+ const result: any = Object.create(null);
113+ Object.getOwnPropertyNames(props).forEach(key => {
114+ const prop = props[key];
115+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
116+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
117+ });
118+ Object.getOwnPropertyNames(val).forEach(key => {
119+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
120+ result[key] = transform(val[key], additional, getProps, key, ref);
121+ }
122+ });
123+ return Object.setPrototypeOf(result, Object.prototype);
124+ }
125+
126+ if (typ === "any") return val;
127+ if (typ === null) {
128+ if (val === null) return val;
129+ return invalidValue(typ, val, key, parent);
130+ }
131+ if (typ === false) return invalidValue(typ, val, key, parent);
132+ let ref: any = undefined;
133+ while (typeof typ === "object" && typ.ref !== undefined) {
134+ ref = typ.ref;
135+ typ = typeMap[typ.ref];
136+ }
137+ if (Array.isArray(typ)) return transformEnum(typ, val);
138+ if (typeof typ === "object") {
139+ return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent)
140+ : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent)
141+ : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent)
142+ : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent)
143+ : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
144+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
145+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
146+ : invalidValue(typ, val, key, parent);
147+ }
148+ // Numbers can be parsed by Date but shouldn't be.
149+ if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val);
150+ return transformPrimitive(typ, val);
151+}
152+
153+function cast<T>(val: any, typ: any): T {
154+ return transform(val, typ, jsonToJSProps);
155+}
156+
157+function uncast<T>(val: T, typ: any): any {
158+ return transform(val, typ, jsToJSONProps);
159+}
160+
161+function l(typ: any) {
162+ return { literal: typ };
163+}
164+
165+function a(typ: any) {
166+ return { arrayItems: typ };
167+}
168+
169+function i(typ: any) {
170+ return { integer: typ };
171+}
172+
173+function p(pattern: any) {
174+ return { pattern };
175+}
176+
177+function s(typ: any, min: any, max: any) {
178+ return { string: typ, min, max };
179+}
180+
181+function n(typ: any, min: any, max: any) {
182+ return { number: typ, min, max };
183+}
184+
185+function u(...typs: any[]) {
186+ return { unionMembers: typs };
187+}
188+
189+function o(props: any[], additional: any) {
190+ return { props, additional };
191+}
192+
193+function m(additional: any) {
194+ const props: any[] = [];
195+ return { props, additional };
196+}
197+
198+function r(name: string) {
199+ return { ref: name };
200+}
201+
202+const typeMap: any = {
203+ "TopLevel": o([
204+ { json: "date", js: "date", typ: i(0) },
205+ { json: "title", js: "title", typ: "" },
206+ { json: "validity", js: "validity", typ: true },
207+ ], false),
208+};
209+
210+module.exports = {
211+ "topLevelToJson": topLevelToJson,
212+ "toTopLevel": toTopLevel,
213+};
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/samples/spotify-album.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
177177 if (val === null || typeof val !== "object" || Array.isArray(val)) {
178178 return invalidValue(l(ref || "object"), val, key, parent);
179179 }
180- const result: any = {};
180+ const result: any = Object.create(null);
181181 Object.getOwnPropertyNames(props).forEach(key => {
182182 const prop = props[key];
183183 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -188,7 +188,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
188188 result[key] = transform(val[key], additional, getProps, key, ref);
189189 }
190190 });
191- return result;
191+ return Object.setPrototypeOf(result, Object.prototype);
192192 }
193193
194194 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
177177 if (val === null || typeof val !== "object" || Array.isArray(val)) {
178178 return invalidValue(l(ref || "object"), val, key, parent);
179179 }
180- const result: any = {};
180+ const result: any = Object.create(null);
181181 Object.getOwnPropertyNames(props).forEach(key => {
182182 const prop = props[key];
183183 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -188,7 +188,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
188188 result[key] = transform(val[key], additional, getProps, key, ref);
189189 }
190190 });
191- return result;
191+ return Object.setPrototypeOf(result, Object.prototype);
192192 }
193193
194194 if (typ === "any") return val;
Test case

test/inputs/json/samples/us-avg-temperatures.json

4 generated files · +15 −7
Melmdefault / QuickType.elm+9 −1
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("data", Jenc.dict identity encodeDatum x.data)
64+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6565 , ("description", encodeDescription x.description)
6666 ]
6767
@@ -97,6 +97,14 @@ encodeDescription x =
9797
9898 --- encoder helpers
9999
100+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
101+makeDictEncoder f m r =
102+ r
103+ |> Dict.toList
104+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
105+ |> String.join ","
106+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
107+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/samples/us-senators.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -212,7 +212,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
212212 if (val === null || typeof val !== "object" || Array.isArray(val)) {
213213 return invalidValue(l(ref || "object"), val, key, parent);
214214 }
215- const result: any = {};
215+ const result: any = Object.create(null);
216216 Object.getOwnPropertyNames(props).forEach(key => {
217217 const prop = props[key];
218218 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
223223 result[key] = transform(val[key], additional, getProps, key, ref);
224224 }
225225 });
226- return result;
226+ return Object.setPrototypeOf(result, Object.prototype);
227227 }
228228
229229 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
189189 if (val === null || typeof val !== "object" || Array.isArray(val)) {
190190 return invalidValue(l(ref || "object"), val, key, parent);
191191 }
192- const result: any = {};
192+ const result: any = Object.create(null);
193193 Object.getOwnPropertyNames(props).forEach(key => {
194194 const prop = props[key];
195195 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -200,7 +200,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
200200 result[key] = transform(val[key], additional, getProps, key, ref);
201201 }
202202 });
203- return result;
203+ return Object.setPrototypeOf(result, Object.prototype);
204204 }
205205
206206 if (typ === "any") return val;
Test case

test/inputs/schema/accessors.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/all-of-additional-properties-false.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/any.schema

4 generated files · +15 −7
Mschema-elmdefault / QuickType.elm+9 −1
@@ -48,11 +48,19 @@ encodeQuickType : QuickType -> Jenc.Value
4848 encodeQuickType x =
4949 Jenc.object
5050 [ ("foo", identity x.foo)
51- , ("values", Jenc.dict identity identity x.values)
51+ , ("values", makeDictEncoder identity identity x.values)
5252 ]
5353
5454 --- encoder helpers
5555
56+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
57+makeDictEncoder f m r =
58+ r
59+ |> Dict.toList
60+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
61+ |> String.join ","
62+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
63+
5664 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5765 makeNullableEncoder f m =
5866 case m of
Mschema-flowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/bool-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/schema/boolean-subschema.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/camelCase.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/class-map-union.schema

4 generated files · +15 −7
Mschema-elmdefault / QuickType.elm+9 −1
@@ -57,7 +57,7 @@ quickType =
5757 encodeQuickType : QuickType -> Jenc.Value
5858 encodeQuickType x =
5959 Jenc.object
60- [ ("union", makeNullableEncoder (Jenc.dict identity encodeUnionValue) x.union)
60+ [ ("union", makeNullableEncoder (makeDictEncoder identity encodeUnionValue) x.union)
6161 ]
6262
6363 unionValue : Jdec.Decoder UnionValue
@@ -89,6 +89,14 @@ encodeUnionClass x =
8989
9090 --- encoder helpers
9191
92+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
93+makeDictEncoder f m r =
94+ r
95+ |> Dict.toList
96+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
97+ |> String.join ","
98+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
99+
92100 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
93101 makeNullableEncoder f m =
94102 case m of
Mschema-flowdefault / TopLevel.js+2 −2
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Test case

test/inputs/schema/class-with-additional.schema

6 generated files · +444 −7
Mschema-elmdefault / QuickType.elm+9 −1
@@ -50,7 +50,7 @@ quickType =
5050 encodeQuickType : QuickType -> Jenc.Value
5151 encodeQuickType x =
5252 Jenc.object
53- [ ("map", makeNullableEncoder (Jenc.dict identity encodeMap) x.map)
53+ [ ("map", makeNullableEncoder (makeDictEncoder identity encodeMap) x.map)
5454 ]
5555
5656 map : Jdec.Decoder Map
@@ -67,6 +67,14 @@ encodeMap x = case x of
6767
6868 --- encoder helpers
6969
70+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
71+makeDictEncoder f m r =
72+ r
73+ |> Dict.toList
74+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
75+ |> String.join ","
76+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
77+
7078 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
7179 makeNullableEncoder f m =
7280 case m of
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Aschema-flowreadonly-true--24da4fc107df / TopLevel.js+217 −0
@@ -0,0 +1,217 @@
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+ +map?: Map;
14+};
15+
16+export type Map = {
17+ +foo?: number;
18+ +[property: string]: boolean | number | void;
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+
97+ return val.map(el => transform(el, typ, getProps));
98+ }
99+
100+ function transformDate(val: any): any {
101+ if (val === null) {
102+ return null;
103+ }
104+ const d = new Date(val);
105+ if (isNaN(d.valueOf())) {
106+ return invalidValue(l("Date"), val, key, parent);
107+ }
108+ return d;
109+ }
110+
111+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
112+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
113+ return invalidValue(l(ref || "object"), val, key, parent);
114+ }
115+ const result: any = Object.create(null);
116+ Object.getOwnPropertyNames(props).forEach(key => {
117+ const prop = props[key];
118+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
119+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
120+ });
121+ Object.getOwnPropertyNames(val).forEach(key => {
122+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
123+ result[key] = transform(val[key], additional, getProps, key, ref);
124+ }
125+ });
126+ return Object.setPrototypeOf(result, Object.prototype);
127+ }
128+
129+ if (typ === "any") return val;
130+ if (typ === null) {
131+ if (val === null) return val;
132+ return invalidValue(typ, val, key, parent);
133+ }
134+ if (typ === false) return invalidValue(typ, val, key, parent);
135+ let ref: any = undefined;
136+ while (typeof typ === "object" && typ.ref !== undefined) {
137+ ref = typ.ref;
138+ typ = typeMap[typ.ref];
139+ }
140+ if (Array.isArray(typ)) return transformEnum(typ, val);
141+ if (typeof typ === "object") {
142+ return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent)
143+ : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent)
144+ : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent)
145+ : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent)
146+ : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
147+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
148+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
149+ : invalidValue(typ, val, key, parent);
150+ }
151+ // Numbers can be parsed by Date but shouldn't be.
152+ if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val);
153+ return transformPrimitive(typ, val);
154+}
155+
156+function cast<T>(val: any, typ: any): T {
157+ return transform(val, typ, jsonToJSProps);
158+}
159+
160+function uncast<T>(val: T, typ: any): any {
161+ return transform(val, typ, jsToJSONProps);
162+}
163+
164+function l(typ: any) {
165+ return { literal: typ };
166+}
167+
168+function a(typ: any) {
169+ return { arrayItems: typ };
170+}
171+
172+function i(typ: any) {
173+ return { integer: typ };
174+}
175+
176+function p(pattern: any) {
177+ return { pattern };
178+}
179+
180+function s(typ: any, min: any, max: any) {
181+ return { string: typ, min, max };
182+}
183+
184+function n(typ: any, min: any, max: any) {
185+ return { number: typ, min, max };
186+}
187+
188+function u(...typs: any[]) {
189+ return { unionMembers: typs };
190+}
191+
192+function o(props: any[], additional: any) {
193+ return { props, additional };
194+}
195+
196+function m(additional: any) {
197+ const props: any[] = [];
198+ return { props, additional };
199+}
200+
201+function r(name: string) {
202+ return { ref: name };
203+}
204+
205+const typeMap: any = {
206+ "TopLevel": o([
207+ { json: "map", js: "map", typ: u(undefined, r("Map")) },
208+ ], false),
209+ "Map": o([
210+ { json: "foo", js: "foo", typ: u(undefined, 3.14) },
211+ ], true),
212+};
213+
214+module.exports = {
215+ "topLevelToJson": topLevelToJson,
216+ "toTopLevel": toTopLevel,
217+};
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Aschema-typescriptreadonly-true--24da4fc107df / TopLevel.ts+212 −0
@@ -0,0 +1,212 @@
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+ readonly map?: Map;
12+}
13+
14+export interface Map {
15+ readonly foo?: number;
16+ readonly [property: string]: boolean | number | undefined;
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+
97+ return val.map(el => transform(el, typ, getProps));
98+ }
99+
100+ function transformDate(val: any): any {
101+ if (val === null) {
102+ return null;
103+ }
104+ const d = new Date(val);
105+ if (isNaN(d.valueOf())) {
106+ return invalidValue(l("Date"), val, key, parent);
107+ }
108+ return d;
109+ }
110+
111+ function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
112+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
113+ return invalidValue(l(ref || "object"), val, key, parent);
114+ }
115+ const result: any = Object.create(null);
116+ Object.getOwnPropertyNames(props).forEach(key => {
117+ const prop = props[key];
118+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
119+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
120+ });
121+ Object.getOwnPropertyNames(val).forEach(key => {
122+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
123+ result[key] = transform(val[key], additional, getProps, key, ref);
124+ }
125+ });
126+ return Object.setPrototypeOf(result, Object.prototype);
127+ }
128+
129+ if (typ === "any") return val;
130+ if (typ === null) {
131+ if (val === null) return val;
132+ return invalidValue(typ, val, key, parent);
133+ }
134+ if (typ === false) return invalidValue(typ, val, key, parent);
135+ let ref: any = undefined;
136+ while (typeof typ === "object" && typ.ref !== undefined) {
137+ ref = typ.ref;
138+ typ = typeMap[typ.ref];
139+ }
140+ if (Array.isArray(typ)) return transformEnum(typ, val);
141+ if (typeof typ === "object") {
142+ return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent)
143+ : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent)
144+ : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent)
145+ : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent)
146+ : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
147+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
148+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
149+ : invalidValue(typ, val, key, parent);
150+ }
151+ // Numbers can be parsed by Date but shouldn't be.
152+ if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val);
153+ return transformPrimitive(typ, val);
154+}
155+
156+function cast<T>(val: any, typ: any): T {
157+ return transform(val, typ, jsonToJSProps);
158+}
159+
160+function uncast<T>(val: T, typ: any): any {
161+ return transform(val, typ, jsToJSONProps);
162+}
163+
164+function l(typ: any) {
165+ return { literal: typ };
166+}
167+
168+function a(typ: any) {
169+ return { arrayItems: typ };
170+}
171+
172+function i(typ: any) {
173+ return { integer: typ };
174+}
175+
176+function p(pattern: any) {
177+ return { pattern };
178+}
179+
180+function s(typ: any, min: any, max: any) {
181+ return { string: typ, min, max };
182+}
183+
184+function n(typ: any, min: any, max: any) {
185+ return { number: typ, min, max };
186+}
187+
188+function u(...typs: any[]) {
189+ return { unionMembers: typs };
190+}
191+
192+function o(props: any[], additional: any) {
193+ return { props, additional };
194+}
195+
196+function m(additional: any) {
197+ const props: any[] = [];
198+ return { props, additional };
199+}
200+
201+function r(name: string) {
202+ return { ref: name };
203+}
204+
205+const typeMap: any = {
206+ "TopLevel": o([
207+ { json: "map", js: "map", typ: u(undefined, r("Map")) },
208+ ], false),
209+ "Map": o([
210+ { json: "foo", js: "foo", typ: u(undefined, 3.14) },
211+ ], true),
212+};
Test case

test/inputs/schema/comment-injection-enum-nested-comment.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mschema-flowdefault / TopLevel.js+2 −2
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/schema/comment-injection-enum.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 if (val === null || typeof val !== "object" || Array.isArray(val)) {
128128 return invalidValue(l(ref || "object"), val, key, parent);
129129 }
130- const result: any = {};
130+ const result: any = Object.create(null);
131131 Object.getOwnPropertyNames(props).forEach(key => {
132132 const prop = props[key];
133133 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 result[key] = transform(val[key], additional, getProps, key, ref);
139139 }
140140 });
141- return result;
141+ return Object.setPrototypeOf(result, Object.prototype);
142142 }
143143
144144 if (typ === "any") return val;
Mschema-flowdefault / TopLevel.js+2 −2
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 if (val === null || typeof val !== "object" || Array.isArray(val)) {
129129 return invalidValue(l(ref || "object"), val, key, parent);
130130 }
131- const result: any = {};
131+ const result: any = Object.create(null);
132132 Object.getOwnPropertyNames(props).forEach(key => {
133133 const prop = props[key];
134134 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 result[key] = transform(val[key], additional, getProps, key, ref);
140140 }
141141 });
142- return result;
142+ return Object.setPrototypeOf(result, Object.prototype);
143143 }
144144
145145 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 if (val === null || typeof val !== "object" || Array.isArray(val)) {
128128 return invalidValue(l(ref || "object"), val, key, parent);
129129 }
130- const result: any = {};
130+ const result: any = Object.create(null);
131131 Object.getOwnPropertyNames(props).forEach(key => {
132132 const prop = props[key];
133133 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 result[key] = transform(val[key], additional, getProps, key, ref);
139139 }
140140 });
141- return result;
141+ return Object.setPrototypeOf(result, Object.prototype);
142142 }
143143
144144 if (typ === "any") return val;
Test case

test/inputs/schema/comment-injection-nested-comment.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mschema-flowdefault / TopLevel.js+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Test case

test/inputs/schema/comment-injection.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Mschema-flowdefault / TopLevel.js+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/schema/const-non-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/constructor.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/cut-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/date-time-or-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/date-time.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/default-value.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/description-with-double-quotes.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/description.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 if (val === null || typeof val !== "object" || Array.isArray(val)) {
147147 return invalidValue(l(ref || "object"), val, key, parent);
148148 }
149- const result: any = {};
149+ const result: any = Object.create(null);
150150 Object.getOwnPropertyNames(props).forEach(key => {
151151 const prop = props[key];
152152 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -157,7 +157,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
157157 result[key] = transform(val[key], additional, getProps, key, ref);
158158 }
159159 });
160- return result;
160+ return Object.setPrototypeOf(result, Object.prototype);
161161 }
162162
163163 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
144144 if (val === null || typeof val !== "object" || Array.isArray(val)) {
145145 return invalidValue(l(ref || "object"), val, key, parent);
146146 }
147- const result: any = {};
147+ const result: any = Object.create(null);
148148 Object.getOwnPropertyNames(props).forEach(key => {
149149 const prop = props[key];
150150 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -155,7 +155,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
155155 result[key] = transform(val[key], additional, getProps, key, ref);
156156 }
157157 });
158- return result;
158+ return Object.setPrototypeOf(result, Object.prototype);
159159 }
160160
161161 if (typ === "any") return val;
Test case

test/inputs/schema/direct-union.schema

4 generated files · +16 −8
Mschema-elmdefault / QuickType.elm+10 −2
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("stuff", Jenc.dict identity encodeThing x.stuff)
64+ [ ("stuff", makeDictEncoder identity encodeThing x.stuff)
6565 ]
6666
6767 thing : Jdec.Decoder Thing
@@ -97,10 +97,18 @@ encodeAnything x = case x of
9797 NullInAnything -> Jenc.null
9898 StringInAnything y -> Jenc.string y
9999 DoubleInAnything y -> Jenc.float y
100- AnythingMapInAnything y -> Jenc.dict identity identity y
100+ AnythingMapInAnything y -> makeDictEncoder identity identity y
101101
102102 --- encoder helpers
103103
104+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
105+makeDictEncoder f m r =
106+ r
107+ |> Dict.toList
108+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
109+ |> String.join ","
110+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
111+
104112 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
105113 makeNullableEncoder f m =
106114 case m of
Mschema-flowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/empty-object.schema

4 generated files · +15 −7
Mschema-elmdefault / QuickType.elm+9 −1
@@ -36,10 +36,18 @@ quickType : Jdec.Decoder QuickType
3636 quickType = Jdec.dict Jdec.value
3737
3838 quickTypeToString : QuickType -> String
39-quickTypeToString r = Jenc.encode 0 (Jenc.dict identity identity r)
39+quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity identity r)
4040
4141 --- encoder helpers
4242
43+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
44+makeDictEncoder f m r =
45+ r
46+ |> Dict.toList
47+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
48+ |> String.join ","
49+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
50+
4351 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
4452 makeNullableEncoder f m =
4553 case m of
Mschema-flowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/enum-large.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/enum-with-null.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/enum-with-values.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 if (val === null || typeof val !== "object" || Array.isArray(val)) {
130130 return invalidValue(l(ref || "object"), val, key, parent);
131131 }
132- const result: any = {};
132+ const result: any = Object.create(null);
133133 Object.getOwnPropertyNames(props).forEach(key => {
134134 const prop = props[key];
135135 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 result[key] = transform(val[key], additional, getProps, key, ref);
141141 }
142142 });
143- return result;
143+ return Object.setPrototypeOf(result, Object.prototype);
144144 }
145145
146146 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/schema/fractional-bounds.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/go-schema-pattern-properties.schema

4 generated files · +15 −7
Mschema-elmdefault / QuickType.elm+9 −1
@@ -45,11 +45,19 @@ quickType =
4545 encodeQuickType : QuickType -> Jenc.Value
4646 encodeQuickType x =
4747 Jenc.object
48- [ ("map", Jenc.dict identity Jenc.int x.map)
48+ [ ("map", makeDictEncoder identity Jenc.int x.map)
4949 ]
5050
5151 --- encoder helpers
5252
53+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
54+makeDictEncoder f m r =
55+ r
56+ |> Dict.toList
57+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
58+ |> String.join ","
59+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
60+
5361 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5462 makeNullableEncoder f m =
5563 case m of
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/haskell-enum-forbidden.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/id-no-address.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/id-root.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/ie-suffix-singularization.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/implicit-all-of.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/implicit-class-array-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/implicit-one-of.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/integer-before-number.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/integer-float-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/integer-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/schema/integer-type.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/schema/intersection-nested.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/schema/intersection.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/issue2680-top-level-array.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/keyword-enum.schema

34 generated files · +290 −18
Mschema-cjsondefault / TopLevel.c+8 −0
@@ -129,6 +129,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) {
129129 else if (!strcmp(cJSON_GetStringValue(j), "FormatException")) x = ENUM_FORMAT_EXCEPTION;
130130 else if (!strcmp(cJSON_GetStringValue(j), "friend")) x = ENUM_FRIEND;
131131 else if (!strcmp(cJSON_GetStringValue(j), "from")) x = ENUM_FROM;
132+ else if (!strcmp(cJSON_GetStringValue(j), "from_dict")) x = ENUM_FROM_DICT;
132133 else if (!strcmp(cJSON_GetStringValue(j), "from_json")) x = ENUM_FROM_JSON;
133134 else if (!strcmp(cJSON_GetStringValue(j), "func")) x = ENUM_FUNC;
134135 else if (!strcmp(cJSON_GetStringValue(j), "function")) x = ENUM_FUNCTION;
@@ -188,6 +189,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) {
188189 else if (!strcmp(cJSON_GetStringValue(j), "lock")) x = ENUM_LOCK;
189190 else if (!strcmp(cJSON_GetStringValue(j), "long")) x = ENUM_LONG;
190191 else if (!strcmp(cJSON_GetStringValue(j), "map")) x = ENUM_MAP;
192+ else if (!strcmp(cJSON_GetStringValue(j), "MarshalJSON")) x = ENUM_MARSHAL_JSON;
191193 else if (!strcmp(cJSON_GetStringValue(j), "MapEntry")) x = ENUM_MAP_ENTRY;
192194 else if (!strcmp(cJSON_GetStringValue(j), "metadata_property_handling")) x = ENUM_METADATA_PROPERTY_HANDLING;
193195 else if (!strcmp(cJSON_GetStringValue(j), "module")) x = ENUM_MODULE;
@@ -307,6 +309,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) {
307309 else if (!strcmp(cJSON_GetStringValue(j), "to_json")) x = ENUM_TO_JSON;
308310 else if (!strcmp(cJSON_GetStringValue(j), "top_level")) x = ENUM_TOP_LEVEL;
309311 else if (!strcmp(cJSON_GetStringValue(j), "toString")) x = ENUM_TO_STRING;
312+ else if (!strcmp(cJSON_GetStringValue(j), "to_dict")) x = ENUM_TO_DICT;
310313 else if (!strcmp(cJSON_GetStringValue(j), "transient")) x = ENUM_TRANSIENT;
311314 else if (!strcmp(cJSON_GetStringValue(j), "True")) x = ENUM_TRUE;
312315 else if (!strcmp(cJSON_GetStringValue(j), "true")) x = ENUM_ENUM_TRUE;
@@ -323,6 +326,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) {
323326 else if (!strcmp(cJSON_GetStringValue(j), "unchecked")) x = ENUM_UNCHECKED;
324327 else if (!strcmp(cJSON_GetStringValue(j), "undefined")) x = ENUM_UNDEFINED;
325328 else if (!strcmp(cJSON_GetStringValue(j), "union")) x = ENUM_UNION;
329+ else if (!strcmp(cJSON_GetStringValue(j), "UnmarshalJSON")) x = ENUM_UNMARSHAL_JSON;
326330 else if (!strcmp(cJSON_GetStringValue(j), "UseSerializers")) x = ENUM_USE_SERIALIZERS;
327331 else if (!strcmp(cJSON_GetStringValue(j), "unowned")) x = ENUM_UNOWNED;
328332 else if (!strcmp(cJSON_GetStringValue(j), "unsafe")) x = ENUM_UNSAFE;
@@ -475,6 +479,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) {
475479 case ENUM_FORMAT_EXCEPTION: j = cJSON_CreateString("FormatException"); break;
476480 case ENUM_FRIEND: j = cJSON_CreateString("friend"); break;
477481 case ENUM_FROM: j = cJSON_CreateString("from"); break;
482+ case ENUM_FROM_DICT: j = cJSON_CreateString("from_dict"); break;
478483 case ENUM_FROM_JSON: j = cJSON_CreateString("from_json"); break;
479484 case ENUM_FUNC: j = cJSON_CreateString("func"); break;
480485 case ENUM_FUNCTION: j = cJSON_CreateString("function"); break;
@@ -534,6 +539,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) {
534539 case ENUM_LOCK: j = cJSON_CreateString("lock"); break;
535540 case ENUM_LONG: j = cJSON_CreateString("long"); break;
536541 case ENUM_MAP: j = cJSON_CreateString("map"); break;
542+ case ENUM_MARSHAL_JSON: j = cJSON_CreateString("MarshalJSON"); break;
537543 case ENUM_MAP_ENTRY: j = cJSON_CreateString("MapEntry"); break;
538544 case ENUM_METADATA_PROPERTY_HANDLING: j = cJSON_CreateString("metadata_property_handling"); break;
539545 case ENUM_MODULE: j = cJSON_CreateString("module"); break;
@@ -653,6 +659,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) {
653659 case ENUM_TO_JSON: j = cJSON_CreateString("to_json"); break;
654660 case ENUM_TOP_LEVEL: j = cJSON_CreateString("top_level"); break;
655661 case ENUM_TO_STRING: j = cJSON_CreateString("toString"); break;
662+ case ENUM_TO_DICT: j = cJSON_CreateString("to_dict"); break;
656663 case ENUM_TRANSIENT: j = cJSON_CreateString("transient"); break;
657664 case ENUM_TRUE: j = cJSON_CreateString("True"); break;
658665 case ENUM_ENUM_TRUE: j = cJSON_CreateString("true"); break;
@@ -669,6 +676,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) {
669676 case ENUM_UNCHECKED: j = cJSON_CreateString("unchecked"); break;
670677 case ENUM_UNDEFINED: j = cJSON_CreateString("undefined"); break;
671678 case ENUM_UNION: j = cJSON_CreateString("union"); break;
679+ case ENUM_UNMARSHAL_JSON: j = cJSON_CreateString("UnmarshalJSON"); break;
672680 case ENUM_USE_SERIALIZERS: j = cJSON_CreateString("UseSerializers"); break;
673681 case ENUM_UNOWNED: j = cJSON_CreateString("unowned"); break;
674682 case ENUM_UNSAFE: j = cJSON_CreateString("unsafe"); break;
Mschema-cjsondefault / TopLevel.h+4 −0
@@ -170,6 +170,7 @@ enum Enum {
170170 ENUM_FORMAT_EXCEPTION,
171171 ENUM_FRIEND,
172172 ENUM_FROM,
173+ ENUM_FROM_DICT,
173174 ENUM_FROM_JSON,
174175 ENUM_FUNC,
175176 ENUM_FUNCTION,
@@ -229,6 +230,7 @@ enum Enum {
229230 ENUM_LOCK,
230231 ENUM_LONG,
231232 ENUM_MAP,
233+ ENUM_MARSHAL_JSON,
232234 ENUM_MAP_ENTRY,
233235 ENUM_METADATA_PROPERTY_HANDLING,
234236 ENUM_MODULE,
@@ -348,6 +350,7 @@ enum Enum {
348350 ENUM_TO_JSON,
349351 ENUM_TOP_LEVEL,
350352 ENUM_TO_STRING,
353+ ENUM_TO_DICT,
351354 ENUM_TRANSIENT,
352355 ENUM_TRUE,
353356 ENUM_ENUM_TRUE,
@@ -364,6 +367,7 @@ enum Enum {
364367 ENUM_UNCHECKED,
365368 ENUM_UNDEFINED,
366369 ENUM_UNION,
370+ ENUM_UNMARSHAL_JSON,
367371 ENUM_USE_SERIALIZERS,
368372 ENUM_UNOWNED,
369373 ENUM_UNSAFE,
Mschema-cplusplusdefault / quicktype.hpp+9 −1
@@ -89,7 +89,7 @@ namespace quicktype {
8989 }
9090 #endif
9191
92- enum class Enum : int { EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, ENUM_NULL, PURPLE_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY };
92+ enum class Enum : int { EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, ENUM_NULL, PURPLE_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY };
9393
9494 class TopLevel {
9595 public:
@@ -247,6 +247,7 @@ namespace quicktype {
247247 {"FormatException", Enum::FORMAT_EXCEPTION},
248248 {"friend", Enum::FRIEND},
249249 {"from", Enum::FROM},
250+ {"from_dict", Enum::FROM_DICT},
250251 {"from_json", Enum::FROM_JSON},
251252 {"func", Enum::FUNC},
252253 {"function", Enum::FUNCTION},
@@ -306,6 +307,7 @@ namespace quicktype {
306307 {"lock", Enum::LOCK},
307308 {"long", Enum::LONG},
308309 {"map", Enum::MAP},
310+ {"MarshalJSON", Enum::MARSHAL_JSON},
309311 {"MapEntry", Enum::MAP_ENTRY},
310312 {"metadata_property_handling", Enum::METADATA_PROPERTY_HANDLING},
311313 {"module", Enum::MODULE},
@@ -425,6 +427,7 @@ namespace quicktype {
425427 {"to_json", Enum::TO_JSON},
426428 {"top_level", Enum::TOP_LEVEL},
427429 {"toString", Enum::TO_STRING},
430+ {"to_dict", Enum::TO_DICT},
428431 {"transient", Enum::TRANSIENT},
429432 {"True", Enum::TRUE},
430433 {"true", Enum::ENUM_TRUE},
@@ -441,6 +444,7 @@ namespace quicktype {
441444 {"unchecked", Enum::UNCHECKED},
442445 {"undefined", Enum::UNDEFINED},
443446 {"union", Enum::UNION},
447+ {"UnmarshalJSON", Enum::UNMARSHAL_JSON},
444448 {"UseSerializers", Enum::USE_SERIALIZERS},
445449 {"unowned", Enum::UNOWNED},
446450 {"unsafe", Enum::UNSAFE},
@@ -596,6 +600,7 @@ namespace quicktype {
596600 case Enum::FORMAT_EXCEPTION: j = "FormatException"; break;
597601 case Enum::FRIEND: j = "friend"; break;
598602 case Enum::FROM: j = "from"; break;
603+ case Enum::FROM_DICT: j = "from_dict"; break;
599604 case Enum::FROM_JSON: j = "from_json"; break;
600605 case Enum::FUNC: j = "func"; break;
601606 case Enum::FUNCTION: j = "function"; break;
@@ -655,6 +660,7 @@ namespace quicktype {
655660 case Enum::LOCK: j = "lock"; break;
656661 case Enum::LONG: j = "long"; break;
657662 case Enum::MAP: j = "map"; break;
663+ case Enum::MARSHAL_JSON: j = "MarshalJSON"; break;
658664 case Enum::MAP_ENTRY: j = "MapEntry"; break;
659665 case Enum::METADATA_PROPERTY_HANDLING: j = "metadata_property_handling"; break;
660666 case Enum::MODULE: j = "module"; break;
@@ -774,6 +780,7 @@ namespace quicktype {
774780 case Enum::TO_JSON: j = "to_json"; break;
775781 case Enum::TOP_LEVEL: j = "top_level"; break;
776782 case Enum::TO_STRING: j = "toString"; break;
783+ case Enum::TO_DICT: j = "to_dict"; break;
777784 case Enum::TRANSIENT: j = "transient"; break;
778785 case Enum::TRUE: j = "True"; break;
779786 case Enum::ENUM_TRUE: j = "true"; break;
@@ -790,6 +797,7 @@ namespace quicktype {
790797 case Enum::UNCHECKED: j = "unchecked"; break;
791798 case Enum::UNDEFINED: j = "undefined"; break;
792799 case Enum::UNION: j = "union"; break;
800+ case Enum::UNMARSHAL_JSON: j = "UnmarshalJSON"; break;
793801 case Enum::USE_SERIALIZERS: j = "UseSerializers"; break;
794802 case Enum::UNOWNED: j = "unowned"; break;
795803 case Enum::UNSAFE: j = "unsafe"; break;
Mschema-csharp-recordsdefault / QuickType.cs+21 −1
@@ -29,7 +29,7 @@ namespace QuickType
2929 public Enum? Enum { get; set; }
3030 }
3131
32- public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy };
32+ public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJson, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJson, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy };
3333
3434 public partial record TopLevel
3535 {
@@ -307,6 +307,8 @@ namespace QuickType
307307 return Enum.Friend;
308308 case "from":
309309 return Enum.From;
310+ case "from_dict":
311+ return Enum.FromDict;
310312 case "from_json":
311313 return Enum.FromJson;
312314 case "func":
@@ -425,6 +427,8 @@ namespace QuickType
425427 return Enum.Long;
426428 case "map":
427429 return Enum.Map;
430+ case "MarshalJSON":
431+ return Enum.MarshalJson;
428432 case "MapEntry":
429433 return Enum.MapEntry;
430434 case "metadata_property_handling":
@@ -663,6 +667,8 @@ namespace QuickType
663667 return Enum.TopLevel;
664668 case "toString":
665669 return Enum.ToString;
670+ case "to_dict":
671+ return Enum.ToDict;
666672 case "transient":
667673 return Enum.Transient;
668674 case "True":
@@ -695,6 +701,8 @@ namespace QuickType
695701 return Enum.Undefined;
696702 case "union":
697703 return Enum.Union;
704+ case "UnmarshalJSON":
705+ return Enum.UnmarshalJson;
698706 case "UseSerializers":
699707 return Enum.UseSerializers;
700708 case "unowned":
@@ -1120,6 +1128,9 @@ namespace QuickType
11201128 case Enum.From:
11211129 serializer.Serialize(writer, "from");
11221130 return;
1131+ case Enum.FromDict:
1132+ serializer.Serialize(writer, "from_dict");
1133+ return;
11231134 case Enum.FromJson:
11241135 serializer.Serialize(writer, "from_json");
11251136 return;
@@ -1297,6 +1308,9 @@ namespace QuickType
12971308 case Enum.Map:
12981309 serializer.Serialize(writer, "map");
12991310 return;
1311+ case Enum.MarshalJson:
1312+ serializer.Serialize(writer, "MarshalJSON");
1313+ return;
13001314 case Enum.MapEntry:
13011315 serializer.Serialize(writer, "MapEntry");
13021316 return;
@@ -1654,6 +1668,9 @@ namespace QuickType
16541668 case Enum.ToString:
16551669 serializer.Serialize(writer, "toString");
16561670 return;
1671+ case Enum.ToDict:
1672+ serializer.Serialize(writer, "to_dict");
1673+ return;
16571674 case Enum.Transient:
16581675 serializer.Serialize(writer, "transient");
16591676 return;
@@ -1702,6 +1719,9 @@ namespace QuickType
17021719 case Enum.Union:
17031720 serializer.Serialize(writer, "union");
17041721 return;
1722+ case Enum.UnmarshalJson:
1723+ serializer.Serialize(writer, "UnmarshalJSON");
1724+ return;
17051725 case Enum.UseSerializers:
17061726 serializer.Serialize(writer, "UseSerializers");
17071727 return;
Mschema-csharp-SystemTextJsondefault / QuickType.cs+21 −1
@@ -27,7 +27,7 @@ namespace QuickType
2727 public Enum? Enum { get; set; }
2828 }
2929
30- public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy };
30+ public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJson, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJson, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy };
3131
3232 public partial class TopLevel
3333 {
@@ -304,6 +304,8 @@ namespace QuickType
304304 return Enum.Friend;
305305 case "from":
306306 return Enum.From;
307+ case "from_dict":
308+ return Enum.FromDict;
307309 case "from_json":
308310 return Enum.FromJson;
309311 case "func":
@@ -422,6 +424,8 @@ namespace QuickType
422424 return Enum.Long;
423425 case "map":
424426 return Enum.Map;
427+ case "MarshalJSON":
428+ return Enum.MarshalJson;
425429 case "MapEntry":
426430 return Enum.MapEntry;
427431 case "metadata_property_handling":
@@ -660,6 +664,8 @@ namespace QuickType
660664 return Enum.TopLevel;
661665 case "toString":
662666 return Enum.ToString;
667+ case "to_dict":
668+ return Enum.ToDict;
663669 case "transient":
664670 return Enum.Transient;
665671 case "True":
@@ -692,6 +698,8 @@ namespace QuickType
692698 return Enum.Undefined;
693699 case "union":
694700 return Enum.Union;
701+ case "UnmarshalJSON":
702+ return Enum.UnmarshalJson;
695703 case "UseSerializers":
696704 return Enum.UseSerializers;
697705 case "unowned":
@@ -1111,6 +1119,9 @@ namespace QuickType
11111119 case Enum.From:
11121120 JsonSerializer.Serialize(writer, "from", options);
11131121 return;
1122+ case Enum.FromDict:
1123+ JsonSerializer.Serialize(writer, "from_dict", options);
1124+ return;
11141125 case Enum.FromJson:
11151126 JsonSerializer.Serialize(writer, "from_json", options);
11161127 return;
@@ -1288,6 +1299,9 @@ namespace QuickType
12881299 case Enum.Map:
12891300 JsonSerializer.Serialize(writer, "map", options);
12901301 return;
1302+ case Enum.MarshalJson:
1303+ JsonSerializer.Serialize(writer, "MarshalJSON", options);
1304+ return;
12911305 case Enum.MapEntry:
12921306 JsonSerializer.Serialize(writer, "MapEntry", options);
12931307 return;
@@ -1645,6 +1659,9 @@ namespace QuickType
16451659 case Enum.ToString:
16461660 JsonSerializer.Serialize(writer, "toString", options);
16471661 return;
1662+ case Enum.ToDict:
1663+ JsonSerializer.Serialize(writer, "to_dict", options);
1664+ return;
16481665 case Enum.Transient:
16491666 JsonSerializer.Serialize(writer, "transient", options);
16501667 return;
@@ -1693,6 +1710,9 @@ namespace QuickType
16931710 case Enum.Union:
16941711 JsonSerializer.Serialize(writer, "union", options);
16951712 return;
1713+ case Enum.UnmarshalJson:
1714+ JsonSerializer.Serialize(writer, "UnmarshalJSON", options);
1715+ return;
16961716 case Enum.UseSerializers:
16971717 JsonSerializer.Serialize(writer, "UseSerializers", options);
16981718 return;
Mschema-csharpdefault / QuickType.cs+21 −1
@@ -29,7 +29,7 @@ namespace QuickType
2929 public Enum? Enum { get; set; }
3030 }
3131
32- public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy };
32+ public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJson, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJson, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy };
3333
3434 public partial class TopLevel
3535 {
@@ -307,6 +307,8 @@ namespace QuickType
307307 return Enum.Friend;
308308 case "from":
309309 return Enum.From;
310+ case "from_dict":
311+ return Enum.FromDict;
310312 case "from_json":
311313 return Enum.FromJson;
312314 case "func":
@@ -425,6 +427,8 @@ namespace QuickType
425427 return Enum.Long;
426428 case "map":
427429 return Enum.Map;
430+ case "MarshalJSON":
431+ return Enum.MarshalJson;
428432 case "MapEntry":
429433 return Enum.MapEntry;
430434 case "metadata_property_handling":
@@ -663,6 +667,8 @@ namespace QuickType
663667 return Enum.TopLevel;
664668 case "toString":
665669 return Enum.ToString;
670+ case "to_dict":
671+ return Enum.ToDict;
666672 case "transient":
667673 return Enum.Transient;
668674 case "True":
@@ -695,6 +701,8 @@ namespace QuickType
695701 return Enum.Undefined;
696702 case "union":
697703 return Enum.Union;
704+ case "UnmarshalJSON":
705+ return Enum.UnmarshalJson;
698706 case "UseSerializers":
699707 return Enum.UseSerializers;
700708 case "unowned":
@@ -1120,6 +1128,9 @@ namespace QuickType
11201128 case Enum.From:
11211129 serializer.Serialize(writer, "from");
11221130 return;
1131+ case Enum.FromDict:
1132+ serializer.Serialize(writer, "from_dict");
1133+ return;
11231134 case Enum.FromJson:
11241135 serializer.Serialize(writer, "from_json");
11251136 return;
@@ -1297,6 +1308,9 @@ namespace QuickType
12971308 case Enum.Map:
12981309 serializer.Serialize(writer, "map");
12991310 return;
1311+ case Enum.MarshalJson:
1312+ serializer.Serialize(writer, "MarshalJSON");
1313+ return;
13001314 case Enum.MapEntry:
13011315 serializer.Serialize(writer, "MapEntry");
13021316 return;
@@ -1654,6 +1668,9 @@ namespace QuickType
16541668 case Enum.ToString:
16551669 serializer.Serialize(writer, "toString");
16561670 return;
1671+ case Enum.ToDict:
1672+ serializer.Serialize(writer, "to_dict");
1673+ return;
16571674 case Enum.Transient:
16581675 serializer.Serialize(writer, "transient");
16591676 return;
@@ -1702,6 +1719,9 @@ namespace QuickType
17021719 case Enum.Union:
17031720 serializer.Serialize(writer, "union");
17041721 return;
1722+ case Enum.UnmarshalJson:
1723+ serializer.Serialize(writer, "UnmarshalJSON");
1724+ return;
17051725 case Enum.UseSerializers:
17061726 serializer.Serialize(writer, "UseSerializers");
17071727 return;
Mschema-dartdefault / TopLevel.dart+8 −0
@@ -146,6 +146,7 @@ enum Enum {
146146 FORMAT_EXCEPTION,
147147 FRIEND,
148148 FROM,
149+ FROM_DICT,
149150 FROM_JSON,
150151 FUNC,
151152 FUNCTION,
@@ -205,6 +206,7 @@ enum Enum {
205206 LOCK,
206207 LONG,
207208 MAP,
209+ MARSHAL_JSON,
208210 MAP_ENTRY,
209211 METADATA_PROPERTY_HANDLING,
210212 MODULE,
@@ -324,6 +326,7 @@ enum Enum {
324326 TO_JSON,
325327 TOP_LEVEL,
326328 TO_STRING,
329+ TO_DICT,
327330 TRANSIENT,
328331 TRUE,
329332 ENUM_TRUE,
@@ -340,6 +343,7 @@ enum Enum {
340343 UNCHECKED,
341344 UNDEFINED,
342345 UNION,
346+ UNMARSHAL_JSON,
343347 USE_SERIALIZERS,
344348 UNOWNED,
345349 UNSAFE,
@@ -488,6 +492,7 @@ final enumValues = EnumValues({
488492 "FormatException": Enum.FORMAT_EXCEPTION,
489493 "friend": Enum.FRIEND,
490494 "from": Enum.FROM,
495+ "from_dict": Enum.FROM_DICT,
491496 "from_json": Enum.FROM_JSON,
492497 "func": Enum.FUNC,
493498 "function": Enum.FUNCTION,
@@ -547,6 +552,7 @@ final enumValues = EnumValues({
547552 "lock": Enum.LOCK,
548553 "long": Enum.LONG,
549554 "map": Enum.MAP,
555+ "MarshalJSON": Enum.MARSHAL_JSON,
550556 "MapEntry": Enum.MAP_ENTRY,
551557 "metadata_property_handling": Enum.METADATA_PROPERTY_HANDLING,
552558 "module": Enum.MODULE,
@@ -666,6 +672,7 @@ final enumValues = EnumValues({
666672 "to_json": Enum.TO_JSON,
667673 "top_level": Enum.TOP_LEVEL,
668674 "toString": Enum.TO_STRING,
675+ "to_dict": Enum.TO_DICT,
669676 "transient": Enum.TRANSIENT,
670677 "True": Enum.TRUE,
671678 "true": Enum.ENUM_TRUE,
@@ -682,6 +689,7 @@ final enumValues = EnumValues({
682689 "unchecked": Enum.UNCHECKED,
683690 "undefined": Enum.UNDEFINED,
684691 "union": Enum.UNION,
692+ "UnmarshalJSON": Enum.UNMARSHAL_JSON,
685693 "UseSerializers": Enum.USE_SERIALIZERS,
686694 "unowned": Enum.UNOWNED,
687695 "unsafe": Enum.UNSAFE,
Mschema-elixirdefault / QuickType.ex+4 −0
@@ -128,6 +128,7 @@ defmodule EnumEnum do
128128 :FormatException,
129129 :friend,
130130 :from,
131+ :from_dict,
131132 :from_json,
132133 :func,
133134 :function,
@@ -187,6 +188,7 @@ defmodule EnumEnum do
187188 :lock,
188189 :long,
189190 :map,
191+ :MarshalJSON,
190192 :MapEntry,
191193 :metadata_property_handling,
192194 :module,
@@ -306,6 +308,7 @@ defmodule EnumEnum do
306308 :to_json,
307309 :top_level,
308310 :toString,
311+ :to_dict,
309312 :transient,
310313 :True,
311314 :true,
@@ -322,6 +325,7 @@ defmodule EnumEnum do
322325 :unchecked,
323326 :undefined,
324327 :union,
328+ :UnmarshalJSON,
325329 :UseSerializers,
326330 :unowned,
327331 :unsafe,
Mschema-elmdefault / QuickType.elm+12 −0
@@ -149,6 +149,7 @@ type EnumEnum
149149 | FormatException
150150 | Friend
151151 | From
152+ | FromDict
152153 | FromJSON
153154 | Func
154155 | Function
@@ -208,6 +209,7 @@ type EnumEnum
208209 | Lock
209210 | Long
210211 | Map
212+ | MarshalJSON
211213 | MapEntry
212214 | MetadataPropertyHandling
213215 | Module
@@ -327,6 +329,7 @@ type EnumEnum
327329 | ToJSON
328330 | TopLevel
329331 | ToString
332+ | ToDict
330333 | Transient
331334 | EnumTrue
332335 | PurpleTrue
@@ -343,6 +346,7 @@ type EnumEnum
343346 | Unchecked
344347 | Undefined
345348 | Union
349+ | UnmarshalJSON
346350 | UseSerializers
347351 | Unowned
348352 | Unsafe
@@ -516,6 +520,7 @@ enumEnum =
516520 "FormatException" -> Jdec.succeed FormatException
517521 "friend" -> Jdec.succeed Friend
518522 "from" -> Jdec.succeed From
523+ "from_dict" -> Jdec.succeed FromDict
519524 "from_json" -> Jdec.succeed FromJSON
520525 "func" -> Jdec.succeed Func
521526 "function" -> Jdec.succeed Function
@@ -575,6 +580,7 @@ enumEnum =
575580 "lock" -> Jdec.succeed Lock
576581 "long" -> Jdec.succeed Long
577582 "map" -> Jdec.succeed Map
583+ "MarshalJSON" -> Jdec.succeed MarshalJSON
578584 "MapEntry" -> Jdec.succeed MapEntry
579585 "metadata_property_handling" -> Jdec.succeed MetadataPropertyHandling
580586 "module" -> Jdec.succeed Module
@@ -694,6 +700,7 @@ enumEnum =
694700 "to_json" -> Jdec.succeed ToJSON
695701 "top_level" -> Jdec.succeed TopLevel
696702 "toString" -> Jdec.succeed ToString
703+ "to_dict" -> Jdec.succeed ToDict
697704 "transient" -> Jdec.succeed Transient
698705 "True" -> Jdec.succeed EnumTrue
699706 "true" -> Jdec.succeed PurpleTrue
@@ -710,6 +717,7 @@ enumEnum =
710717 "unchecked" -> Jdec.succeed Unchecked
711718 "undefined" -> Jdec.succeed Undefined
712719 "union" -> Jdec.succeed Union
720+ "UnmarshalJSON" -> Jdec.succeed UnmarshalJSON
713721 "UseSerializers" -> Jdec.succeed UseSerializers
714722 "unowned" -> Jdec.succeed Unowned
715723 "unsafe" -> Jdec.succeed Unsafe
@@ -860,6 +868,7 @@ encodeEnumEnum x = case x of
860868 FormatException -> Jenc.string "FormatException"
861869 Friend -> Jenc.string "friend"
862870 From -> Jenc.string "from"
871+ FromDict -> Jenc.string "from_dict"
863872 FromJSON -> Jenc.string "from_json"
864873 Func -> Jenc.string "func"
865874 Function -> Jenc.string "function"
@@ -919,6 +928,7 @@ encodeEnumEnum x = case x of
919928 Lock -> Jenc.string "lock"
920929 Long -> Jenc.string "long"
921930 Map -> Jenc.string "map"
931+ MarshalJSON -> Jenc.string "MarshalJSON"
922932 MapEntry -> Jenc.string "MapEntry"
923933 MetadataPropertyHandling -> Jenc.string "metadata_property_handling"
924934 Module -> Jenc.string "module"
@@ -1038,6 +1048,7 @@ encodeEnumEnum x = case x of
10381048 ToJSON -> Jenc.string "to_json"
10391049 TopLevel -> Jenc.string "top_level"
10401050 ToString -> Jenc.string "toString"
1051+ ToDict -> Jenc.string "to_dict"
10411052 Transient -> Jenc.string "transient"
10421053 EnumTrue -> Jenc.string "True"
10431054 PurpleTrue -> Jenc.string "true"
@@ -1054,6 +1065,7 @@ encodeEnumEnum x = case x of
10541065 Unchecked -> Jenc.string "unchecked"
10551066 Undefined -> Jenc.string "undefined"
10561067 Union -> Jenc.string "union"
1068+ UnmarshalJSON -> Jenc.string "UnmarshalJSON"
10571069 UseSerializers -> Jenc.string "UseSerializers"
10581070 Unowned -> Jenc.string "unowned"
10591071 Unsafe -> Jenc.string "unsafe"
Mschema-flowdefault / TopLevel.js+10 −2
@@ -136,6 +136,7 @@ export type Enum =
136136 | "FormatException"
137137 | "friend"
138138 | "from"
139+ | "from_dict"
139140 | "from_json"
140141 | "func"
141142 | "function"
@@ -195,6 +196,7 @@ export type Enum =
195196 | "lock"
196197 | "long"
197198 | "map"
199+ | "MarshalJSON"
198200 | "MapEntry"
199201 | "metadata_property_handling"
200202 | "module"
@@ -314,6 +316,7 @@ export type Enum =
314316 | "to_json"
315317 | "top_level"
316318 | "toString"
319+ | "to_dict"
317320 | "transient"
318321 | "True"
319322 | "true"
@@ -330,6 +333,7 @@ export type Enum =
330333 | "unchecked"
331334 | "undefined"
332335 | "union"
336+ | "UnmarshalJSON"
333337 | "UseSerializers"
334338 | "unowned"
335339 | "unsafe"
@@ -449,7 +453,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
449453 if (val === null || typeof val !== "object" || Array.isArray(val)) {
450454 return invalidValue(l(ref || "object"), val, key, parent);
451455 }
452- const result: any = {};
456+ const result: any = Object.create(null);
453457 Object.getOwnPropertyNames(props).forEach(key => {
454458 const prop = props[key];
455459 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -460,7 +464,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
460464 result[key] = transform(val[key], additional, getProps, key, ref);
461465 }
462466 });
463- return result;
467+ return Object.setPrototypeOf(result, Object.prototype);
464468 }
465469
466470 if (typ === "any") return val;
@@ -665,6 +669,7 @@ const typeMap: any = {
665669 "FormatException",
666670 "friend",
667671 "from",
672+ "from_dict",
668673 "from_json",
669674 "func",
670675 "function",
@@ -724,6 +729,7 @@ const typeMap: any = {
724729 "lock",
725730 "long",
726731 "map",
732+ "MarshalJSON",
727733 "MapEntry",
728734 "metadata_property_handling",
729735 "module",
@@ -843,6 +849,7 @@ const typeMap: any = {
843849 "to_json",
844850 "top_level",
845851 "toString",
852+ "to_dict",
846853 "transient",
847854 "True",
848855 "true",
@@ -859,6 +866,7 @@ const typeMap: any = {
859866 "unchecked",
860867 "undefined",
861868 "union",
869+ "UnmarshalJSON",
862870 "UseSerializers",
863871 "unowned",
864872 "unsafe",
Mschema-golangdefault / quicktype.go+5 −1
@@ -146,6 +146,7 @@ const (
146146 FormatException EnumEnum = "FormatException"
147147 Friend EnumEnum = "friend"
148148 From EnumEnum = "from"
149+ FromDict EnumEnum = "from_dict"
149150 FromJSON EnumEnum = "from_json"
150151 Func EnumEnum = "func"
151152 Function EnumEnum = "function"
@@ -205,6 +206,7 @@ const (
205206 Lock EnumEnum = "lock"
206207 Long EnumEnum = "long"
207208 Map EnumEnum = "map"
209+ MarshalJSON EnumEnum = "MarshalJSON"
208210 MapEntry EnumEnum = "MapEntry"
209211 MetadataPropertyHandling EnumEnum = "metadata_property_handling"
210212 Module EnumEnum = "module"
@@ -324,6 +326,7 @@ const (
324326 ToJSON EnumEnum = "to_json"
325327 EnumTopLevel EnumEnum = "top_level"
326328 ToString EnumEnum = "toString"
329+ ToDict EnumEnum = "to_dict"
327330 Transient EnumEnum = "transient"
328331 True EnumEnum = "True"
329332 EnumTrue EnumEnum = "true"
@@ -340,6 +343,7 @@ const (
340343 Unchecked EnumEnum = "unchecked"
341344 Undefined EnumEnum = "undefined"
342345 Union EnumEnum = "union"
346+ UnmarshalJSON EnumEnum = "UnmarshalJSON"
343347 UseSerializers EnumEnum = "UseSerializers"
344348 Unowned EnumEnum = "unowned"
345349 Unsafe EnumEnum = "unsafe"
@@ -373,7 +377,7 @@ func (x *EnumEnum) UnmarshalJSON(data []byte) error {
373377 var value string
374378 if err := json.Unmarshal(data, &value); err != nil { return err }
375379 switch EnumEnum(value) {
376- case Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, ASM, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBOOL, EnumBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJSON, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, ID, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, ISODateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, JSON, JSONConverter, JSONSerializer, JSONToken, JSONWriter, JSONAny, JSONCodingKey, JSONDecoder, JSONEncoder, JSONException, JSONGenerator, JSONNode, JSONNull, JSONParser, JSONReader, JSONTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NSObject, NoSuchMethod, Not, NotEq, NSError, NSString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJSON, EnumTopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JSONReader, Utf8JSONWriter, UUID, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy: *x = EnumEnum(value); return nil
380+ case Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, ASM, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBOOL, EnumBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJSON, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, ID, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, ISODateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, JSON, JSONConverter, JSONSerializer, JSONToken, JSONWriter, JSONAny, JSONCodingKey, JSONDecoder, JSONEncoder, JSONException, JSONGenerator, JSONNode, JSONNull, JSONParser, JSONReader, JSONTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJSON, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NSObject, NoSuchMethod, Not, NotEq, NSError, NSString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJSON, EnumTopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJSON, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JSONReader, Utf8JSONWriter, UUID, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy: *x = EnumEnum(value); return nil
377381 }
378382 return invalidEnumEnum(value)
379383 }
Mschema-haskelldefault / QuickType.hs+12 −0
@@ -139,6 +139,7 @@ data EnumEnum
139139 | FormatExceptionEnumEnum
140140 | FriendEnumEnum
141141 | FromEnumEnum
142+ | FromDictEnumEnum
142143 | FromJSONEnumEnum
143144 | FuncEnumEnum
144145 | FunctionEnumEnum
@@ -198,6 +199,7 @@ data EnumEnum
198199 | LockEnumEnum
199200 | LongEnumEnum
200201 | MapEnumEnum
202+ | MarshalJSONEnumEnum
201203 | MapEntryEnumEnum
202204 | MetadataPropertyHandlingEnumEnum
203205 | ModuleEnumEnum
@@ -317,6 +319,7 @@ data EnumEnum
317319 | ToJSONEnumEnum
318320 | TopLevelEnumEnum
319321 | ToStringEnumEnum
322+ | ToDictEnumEnum
320323 | TransientEnumEnum
321324 | TrueEnumEnum
322325 | PurpleTrueEnumEnum
@@ -333,6 +336,7 @@ data EnumEnum
333336 | UncheckedEnumEnum
334337 | UndefinedEnumEnum
335338 | UnionEnumEnum
339+ | UnmarshalJSONEnumEnum
336340 | UseSerializersEnumEnum
337341 | UnownedEnumEnum
338342 | UnsafeEnumEnum
@@ -494,6 +498,7 @@ instance ToJSON EnumEnum where
494498 toJSON FormatExceptionEnumEnum = "FormatException"
495499 toJSON FriendEnumEnum = "friend"
496500 toJSON FromEnumEnum = "from"
501+ toJSON FromDictEnumEnum = "from_dict"
497502 toJSON FromJSONEnumEnum = "from_json"
498503 toJSON FuncEnumEnum = "func"
499504 toJSON FunctionEnumEnum = "function"
@@ -553,6 +558,7 @@ instance ToJSON EnumEnum where
553558 toJSON LockEnumEnum = "lock"
554559 toJSON LongEnumEnum = "long"
555560 toJSON MapEnumEnum = "map"
561+ toJSON MarshalJSONEnumEnum = "MarshalJSON"
556562 toJSON MapEntryEnumEnum = "MapEntry"
557563 toJSON MetadataPropertyHandlingEnumEnum = "metadata_property_handling"
558564 toJSON ModuleEnumEnum = "module"
@@ -672,6 +678,7 @@ instance ToJSON EnumEnum where
672678 toJSON ToJSONEnumEnum = "to_json"
673679 toJSON TopLevelEnumEnum = "top_level"
674680 toJSON ToStringEnumEnum = "toString"
681+ toJSON ToDictEnumEnum = "to_dict"
675682 toJSON TransientEnumEnum = "transient"
676683 toJSON TrueEnumEnum = "True"
677684 toJSON PurpleTrueEnumEnum = "true"
@@ -688,6 +695,7 @@ instance ToJSON EnumEnum where
688695 toJSON UncheckedEnumEnum = "unchecked"
689696 toJSON UndefinedEnumEnum = "undefined"
690697 toJSON UnionEnumEnum = "union"
698+ toJSON UnmarshalJSONEnumEnum = "UnmarshalJSON"
691699 toJSON UseSerializersEnumEnum = "UseSerializers"
692700 toJSON UnownedEnumEnum = "unowned"
693701 toJSON UnsafeEnumEnum = "unsafe"
@@ -837,6 +845,7 @@ instance FromJSON EnumEnum where
837845 parseText "FormatException" = return FormatExceptionEnumEnum
838846 parseText "friend" = return FriendEnumEnum
839847 parseText "from" = return FromEnumEnum
848+ parseText "from_dict" = return FromDictEnumEnum
840849 parseText "from_json" = return FromJSONEnumEnum
841850 parseText "func" = return FuncEnumEnum
842851 parseText "function" = return FunctionEnumEnum
@@ -896,6 +905,7 @@ instance FromJSON EnumEnum where
896905 parseText "lock" = return LockEnumEnum
897906 parseText "long" = return LongEnumEnum
898907 parseText "map" = return MapEnumEnum
908+ parseText "MarshalJSON" = return MarshalJSONEnumEnum
899909 parseText "MapEntry" = return MapEntryEnumEnum
900910 parseText "metadata_property_handling" = return MetadataPropertyHandlingEnumEnum
901911 parseText "module" = return ModuleEnumEnum
@@ -1015,6 +1025,7 @@ instance FromJSON EnumEnum where
10151025 parseText "to_json" = return ToJSONEnumEnum
10161026 parseText "top_level" = return TopLevelEnumEnum
10171027 parseText "toString" = return ToStringEnumEnum
1028+ parseText "to_dict" = return ToDictEnumEnum
10181029 parseText "transient" = return TransientEnumEnum
10191030 parseText "True" = return TrueEnumEnum
10201031 parseText "true" = return PurpleTrueEnumEnum
@@ -1031,6 +1042,7 @@ instance FromJSON EnumEnum where
10311042 parseText "unchecked" = return UncheckedEnumEnum
10321043 parseText "undefined" = return UndefinedEnumEnum
10331044 parseText "union" = return UnionEnumEnum
1045+ parseText "UnmarshalJSON" = return UnmarshalJSONEnumEnum
10341046 parseText "UseSerializers" = return UseSerializersEnumEnum
10351047 parseText "unowned" = return UnownedEnumEnum
10361048 parseText "unsafe" = return UnsafeEnumEnum
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Enum.java+9 −1
@@ -4,7 +4,7 @@ import java.io.IOException;
44 import com.fasterxml.jackson.annotation.*;
55
66 public enum Enum {
7- EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY;
7+ EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY;
88
99 @JsonValue
1010 public String toValue() {
@@ -130,6 +130,7 @@ public enum Enum {
130130 case FORMAT_EXCEPTION: return "FormatException";
131131 case FRIEND: return "friend";
132132 case FROM: return "from";
133+ case FROM_DICT: return "from_dict";
133134 case FROM_JSON: return "from_json";
134135 case FUNC: return "func";
135136 case FUNCTION: return "function";
@@ -189,6 +190,7 @@ public enum Enum {
189190 case LOCK: return "lock";
190191 case LONG: return "long";
191192 case MAP: return "map";
193+ case MARSHAL_JSON: return "MarshalJSON";
192194 case MAP_ENTRY: return "MapEntry";
193195 case METADATA_PROPERTY_HANDLING: return "metadata_property_handling";
194196 case MODULE: return "module";
@@ -308,6 +310,7 @@ public enum Enum {
308310 case TO_JSON: return "to_json";
309311 case TOP_LEVEL: return "top_level";
310312 case TO_STRING: return "toString";
313+ case TO_DICT: return "to_dict";
311314 case TRANSIENT: return "transient";
312315 case TRUE: return "True";
313316 case ENUM_TRUE: return "true";
@@ -324,6 +327,7 @@ public enum Enum {
324327 case UNCHECKED: return "unchecked";
325328 case UNDEFINED: return "undefined";
326329 case UNION: return "union";
330+ case UNMARSHAL_JSON: return "UnmarshalJSON";
327331 case USE_SERIALIZERS: return "UseSerializers";
328332 case UNOWNED: return "unowned";
329333 case UNSAFE: return "unsafe";
@@ -475,6 +479,7 @@ public enum Enum {
475479 if (value.equals("FormatException")) return FORMAT_EXCEPTION;
476480 if (value.equals("friend")) return FRIEND;
477481 if (value.equals("from")) return FROM;
482+ if (value.equals("from_dict")) return FROM_DICT;
478483 if (value.equals("from_json")) return FROM_JSON;
479484 if (value.equals("func")) return FUNC;
480485 if (value.equals("function")) return FUNCTION;
@@ -534,6 +539,7 @@ public enum Enum {
534539 if (value.equals("lock")) return LOCK;
535540 if (value.equals("long")) return LONG;
536541 if (value.equals("map")) return MAP;
542+ if (value.equals("MarshalJSON")) return MARSHAL_JSON;
537543 if (value.equals("MapEntry")) return MAP_ENTRY;
538544 if (value.equals("metadata_property_handling")) return METADATA_PROPERTY_HANDLING;
539545 if (value.equals("module")) return MODULE;
@@ -653,6 +659,7 @@ public enum Enum {
653659 if (value.equals("to_json")) return TO_JSON;
654660 if (value.equals("top_level")) return TOP_LEVEL;
655661 if (value.equals("toString")) return TO_STRING;
662+ if (value.equals("to_dict")) return TO_DICT;
656663 if (value.equals("transient")) return TRANSIENT;
657664 if (value.equals("True")) return TRUE;
658665 if (value.equals("true")) return ENUM_TRUE;
@@ -669,6 +676,7 @@ public enum Enum {
669676 if (value.equals("unchecked")) return UNCHECKED;
670677 if (value.equals("undefined")) return UNDEFINED;
671678 if (value.equals("union")) return UNION;
679+ if (value.equals("UnmarshalJSON")) return UNMARSHAL_JSON;
672680 if (value.equals("UseSerializers")) return USE_SERIALIZERS;
673681 if (value.equals("unowned")) return UNOWNED;
674682 if (value.equals("unsafe")) return UNSAFE;
Mschema-java-lombokdefault / src / main / java / io / quicktype / Enum.java+9 −1
@@ -4,7 +4,7 @@ import java.io.IOException;
44 import com.fasterxml.jackson.annotation.*;
55
66 public enum Enum {
7- EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY;
7+ EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY;
88
99 @JsonValue
1010 public String toValue() {
@@ -130,6 +130,7 @@ public enum Enum {
130130 case FORMAT_EXCEPTION: return "FormatException";
131131 case FRIEND: return "friend";
132132 case FROM: return "from";
133+ case FROM_DICT: return "from_dict";
133134 case FROM_JSON: return "from_json";
134135 case FUNC: return "func";
135136 case FUNCTION: return "function";
@@ -189,6 +190,7 @@ public enum Enum {
189190 case LOCK: return "lock";
190191 case LONG: return "long";
191192 case MAP: return "map";
193+ case MARSHAL_JSON: return "MarshalJSON";
192194 case MAP_ENTRY: return "MapEntry";
193195 case METADATA_PROPERTY_HANDLING: return "metadata_property_handling";
194196 case MODULE: return "module";
@@ -308,6 +310,7 @@ public enum Enum {
308310 case TO_JSON: return "to_json";
309311 case TOP_LEVEL: return "top_level";
310312 case TO_STRING: return "toString";
313+ case TO_DICT: return "to_dict";
311314 case TRANSIENT: return "transient";
312315 case TRUE: return "True";
313316 case ENUM_TRUE: return "true";
@@ -324,6 +327,7 @@ public enum Enum {
324327 case UNCHECKED: return "unchecked";
325328 case UNDEFINED: return "undefined";
326329 case UNION: return "union";
330+ case UNMARSHAL_JSON: return "UnmarshalJSON";
327331 case USE_SERIALIZERS: return "UseSerializers";
328332 case UNOWNED: return "unowned";
329333 case UNSAFE: return "unsafe";
@@ -475,6 +479,7 @@ public enum Enum {
475479 if (value.equals("FormatException")) return FORMAT_EXCEPTION;
476480 if (value.equals("friend")) return FRIEND;
477481 if (value.equals("from")) return FROM;
482+ if (value.equals("from_dict")) return FROM_DICT;
478483 if (value.equals("from_json")) return FROM_JSON;
479484 if (value.equals("func")) return FUNC;
480485 if (value.equals("function")) return FUNCTION;
@@ -534,6 +539,7 @@ public enum Enum {
534539 if (value.equals("lock")) return LOCK;
535540 if (value.equals("long")) return LONG;
536541 if (value.equals("map")) return MAP;
542+ if (value.equals("MarshalJSON")) return MARSHAL_JSON;
537543 if (value.equals("MapEntry")) return MAP_ENTRY;
538544 if (value.equals("metadata_property_handling")) return METADATA_PROPERTY_HANDLING;
539545 if (value.equals("module")) return MODULE;
@@ -653,6 +659,7 @@ public enum Enum {
653659 if (value.equals("to_json")) return TO_JSON;
654660 if (value.equals("top_level")) return TOP_LEVEL;
655661 if (value.equals("toString")) return TO_STRING;
662+ if (value.equals("to_dict")) return TO_DICT;
656663 if (value.equals("transient")) return TRANSIENT;
657664 if (value.equals("True")) return TRUE;
658665 if (value.equals("true")) return ENUM_TRUE;
@@ -669,6 +676,7 @@ public enum Enum {
669676 if (value.equals("unchecked")) return UNCHECKED;
670677 if (value.equals("undefined")) return UNDEFINED;
671678 if (value.equals("union")) return UNION;
679+ if (value.equals("UnmarshalJSON")) return UNMARSHAL_JSON;
672680 if (value.equals("UseSerializers")) return USE_SERIALIZERS;
673681 if (value.equals("unowned")) return UNOWNED;
674682 if (value.equals("unsafe")) return UNSAFE;
Mschema-javadefault / src / main / java / io / quicktype / Enum.java+9 −1
@@ -4,7 +4,7 @@ import java.io.IOException;
44 import com.fasterxml.jackson.annotation.*;
55
66 public enum Enum {
7- EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY;
7+ EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY;
88
99 @JsonValue
1010 public String toValue() {
@@ -130,6 +130,7 @@ public enum Enum {
130130 case FORMAT_EXCEPTION: return "FormatException";
131131 case FRIEND: return "friend";
132132 case FROM: return "from";
133+ case FROM_DICT: return "from_dict";
133134 case FROM_JSON: return "from_json";
134135 case FUNC: return "func";
135136 case FUNCTION: return "function";
@@ -189,6 +190,7 @@ public enum Enum {
189190 case LOCK: return "lock";
190191 case LONG: return "long";
191192 case MAP: return "map";
193+ case MARSHAL_JSON: return "MarshalJSON";
192194 case MAP_ENTRY: return "MapEntry";
193195 case METADATA_PROPERTY_HANDLING: return "metadata_property_handling";
194196 case MODULE: return "module";
@@ -308,6 +310,7 @@ public enum Enum {
308310 case TO_JSON: return "to_json";
309311 case TOP_LEVEL: return "top_level";
310312 case TO_STRING: return "toString";
313+ case TO_DICT: return "to_dict";
311314 case TRANSIENT: return "transient";
312315 case TRUE: return "True";
313316 case ENUM_TRUE: return "true";
@@ -324,6 +327,7 @@ public enum Enum {
324327 case UNCHECKED: return "unchecked";
325328 case UNDEFINED: return "undefined";
326329 case UNION: return "union";
330+ case UNMARSHAL_JSON: return "UnmarshalJSON";
327331 case USE_SERIALIZERS: return "UseSerializers";
328332 case UNOWNED: return "unowned";
329333 case UNSAFE: return "unsafe";
@@ -475,6 +479,7 @@ public enum Enum {
475479 if (value.equals("FormatException")) return FORMAT_EXCEPTION;
476480 if (value.equals("friend")) return FRIEND;
477481 if (value.equals("from")) return FROM;
482+ if (value.equals("from_dict")) return FROM_DICT;
478483 if (value.equals("from_json")) return FROM_JSON;
479484 if (value.equals("func")) return FUNC;
480485 if (value.equals("function")) return FUNCTION;
@@ -534,6 +539,7 @@ public enum Enum {
534539 if (value.equals("lock")) return LOCK;
535540 if (value.equals("long")) return LONG;
536541 if (value.equals("map")) return MAP;
542+ if (value.equals("MarshalJSON")) return MARSHAL_JSON;
537543 if (value.equals("MapEntry")) return MAP_ENTRY;
538544 if (value.equals("metadata_property_handling")) return METADATA_PROPERTY_HANDLING;
539545 if (value.equals("module")) return MODULE;
@@ -653,6 +659,7 @@ public enum Enum {
653659 if (value.equals("to_json")) return TO_JSON;
654660 if (value.equals("top_level")) return TOP_LEVEL;
655661 if (value.equals("toString")) return TO_STRING;
662+ if (value.equals("to_dict")) return TO_DICT;
656663 if (value.equals("transient")) return TRANSIENT;
657664 if (value.equals("True")) return TRUE;
658665 if (value.equals("true")) return ENUM_TRUE;
@@ -669,6 +676,7 @@ public enum Enum {
669676 if (value.equals("unchecked")) return UNCHECKED;
670677 if (value.equals("undefined")) return UNDEFINED;
671678 if (value.equals("union")) return UNION;
679+ if (value.equals("UnmarshalJSON")) return UNMARSHAL_JSON;
672680 if (value.equals("UseSerializers")) return USE_SERIALIZERS;
673681 if (value.equals("unowned")) return UNOWNED;
674682 if (value.equals("unsafe")) return UNSAFE;
Mschema-javascript-prop-typesdefault / toplevel.js+1 −1
@@ -13,7 +13,7 @@
1313 import PropTypes from "prop-types";
1414
1515 let _TopLevel;
16-const _Enum = PropTypes.oneOf(['_', '_Bool', '_Complex', '_Imaginery', 'abstract', 'alignas', 'alignof', 'and', 'and_eq', 'any', 'Any', 'array', 'as', 'asm', 'assert', 'associatedtype', 'associativity', 'async', 'atomic', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'await', 'base', 'bitand', 'bitor', 'BOOL', 'bool', 'boolean', 'break', 'bycopy', 'byref', 'byte', 'Calendar', 'case', 'catch', 'chan', 'char', 'char16_t', 'char32_t', 'checked', 'class', 'Class', 'clone', 'co_await', 'co_return', 'co_yield', 'Codable', 'CodingKey', 'CodingKeys', 'compl', 'concept', 'console', 'const', 'const_cast', 'constexpr', 'constructor', 'continue', 'convenience', 'convert', 'converter', 'CultureInfo', 'date', 'date_parse_handling', 'DateFormatter', 'DateOnly', 'DateOnlyConverter', 'DateTime', 'DateTimeStyles', 'debugger', 'decimal', 'declare', 'decltype', 'decode_string', 'Decoder', 'DecodingError', 'def', 'default', 'defer', 'deinit', 'del', 'delegate', 'delete', 'dict', 'dictionary', 'didSet', 'do', 'double', 'dynamic', 'dynamic_cast', 'elif', 'else', 'encode_quick_type', 'Encoder', 'enum', 'EnumValues', 'Equatable', 'equalityContract', 'event', 'except', 'exception', 'explicit', 'export', 'exposing', 'extends', 'extension', 'extern', 'fallthrough', 'false', 'False', 'fileprivate', 'final', 'finally', 'fixed', 'float', 'for', 'foreach', 'FormatException', 'friend', 'from', 'from_json', 'func', 'function', 'get', 'global', 'go', 'goto', 'guard', 'Hashable', 'hashCode', 'Hasher', 'hasOwnProperty', 'id', 'if', 'IMP', 'implements', 'implicit', 'import', 'in', 'indirect', 'infix', 'init', 'inline', 'inout', 'instanceof', 'int', 'interface', 'internal', 'IsoDateTimeOffsetConverter', 'iterable', 'is', 'jdec', 'jenc', 'jpipe', 'json', 'json_converter', 'json_serializer', 'json_token', 'json_writer', 'JSONAny', 'JSONCodingKey', 'JSONDecoder', 'JSONEncoder', 'JsonException', 'JsonGenerator', 'JsonNode', 'JSONNull', 'JsonParser', 'JsonReader', 'JsonTokenType', 'lambda', 'lazy', 'left', 'let', 'list', 'Locale', 'lock', 'long', 'map', 'MapEntry', 'metadata_property_handling', 'module', 'mutable', 'mutating', 'namespace', 'native', 'new', 'newtonsoft', 'nil', 'NO', 'noexcept', 'nonatomic', 'none', 'None', 'nonlocal', 'nonmutating', 'NSObject', 'noSuchMethod', 'not', 'not_eq', 'NSError', 'NSString', 'NULL', 'null', 'nullptr', 'number', 'object', 'ObjectMapper', 'of', 'oneway', 'open', 'operator', 'optional', 'or', 'or_eq', 'out', 'override', 'package', 'params', 'pass', 'port', 'postfix', 'precedence', 'prefix', 'print', 'printf', 'printMembers', 'private', 'protected', 'Protocol', 'protocol', 'public', 'quicktype', 'raise', 'range', 'readonly', 'ref', 'RegExp', 'register', 'reinterpret_cast', 'repeat', 'require', 'required', 'requires', 'restrict', 'retain', 'rethrows', 'return', 'right', 'runtimeType', 's', 'sbyte', 'sealed', 'SEL', 'select', 'Self', 'Serializable', 'self', 'Sendable', 'serialize', 'SerialName', 'KSerializer', 'PrimitiveKind', 'SerialDescriptor', 'SerializerProvider', 'set', 'short', 'signed', 'SimpleModule', 'sizeof', 'stackalloc', 'Standards', 'static', 'static_assert', 'static_cast', 'StdDeserializer', 'StdSerializer', 'strictfp', 'string', 'struct', 'subscript', 'super', 'switch', 'symbol', 'synchronized', 'system', 'template', 'then', 'this', 'thread_local', 'throw', 'throws', 'TimeOnly', 'TimeOnlyConverter', 'TimeZone', 'to_json', 'top_level', 'toString', 'transient', 'True', 'true', 'try', 'Type', 'type', 'typealias', 'typedef', 'typeid', 'typename', 'typeof', 'uint', 'ulong', 'unchecked', 'undefined', 'union', 'UseSerializers', 'unowned', 'unsafe', 'unsigned', 'ushort', 'using', 'Utf8JsonReader', 'Utf8JsonWriter', 'UUID', 'var', 'virtual', 'void', 'volatile', 'wchar_t', 'weak', 'where', 'while', 'willSet', 'with', 'xor', 'xor_eq', 'YES', 'yield', 'dummy']);
16+const _Enum = PropTypes.oneOf(['_', '_Bool', '_Complex', '_Imaginery', 'abstract', 'alignas', 'alignof', 'and', 'and_eq', 'any', 'Any', 'array', 'as', 'asm', 'assert', 'associatedtype', 'associativity', 'async', 'atomic', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'await', 'base', 'bitand', 'bitor', 'BOOL', 'bool', 'boolean', 'break', 'bycopy', 'byref', 'byte', 'Calendar', 'case', 'catch', 'chan', 'char', 'char16_t', 'char32_t', 'checked', 'class', 'Class', 'clone', 'co_await', 'co_return', 'co_yield', 'Codable', 'CodingKey', 'CodingKeys', 'compl', 'concept', 'console', 'const', 'const_cast', 'constexpr', 'constructor', 'continue', 'convenience', 'convert', 'converter', 'CultureInfo', 'date', 'date_parse_handling', 'DateFormatter', 'DateOnly', 'DateOnlyConverter', 'DateTime', 'DateTimeStyles', 'debugger', 'decimal', 'declare', 'decltype', 'decode_string', 'Decoder', 'DecodingError', 'def', 'default', 'defer', 'deinit', 'del', 'delegate', 'delete', 'dict', 'dictionary', 'didSet', 'do', 'double', 'dynamic', 'dynamic_cast', 'elif', 'else', 'encode_quick_type', 'Encoder', 'enum', 'EnumValues', 'Equatable', 'equalityContract', 'event', 'except', 'exception', 'explicit', 'export', 'exposing', 'extends', 'extension', 'extern', 'fallthrough', 'false', 'False', 'fileprivate', 'final', 'finally', 'fixed', 'float', 'for', 'foreach', 'FormatException', 'friend', 'from', 'from_dict', 'from_json', 'func', 'function', 'get', 'global', 'go', 'goto', 'guard', 'Hashable', 'hashCode', 'Hasher', 'hasOwnProperty', 'id', 'if', 'IMP', 'implements', 'implicit', 'import', 'in', 'indirect', 'infix', 'init', 'inline', 'inout', 'instanceof', 'int', 'interface', 'internal', 'IsoDateTimeOffsetConverter', 'iterable', 'is', 'jdec', 'jenc', 'jpipe', 'json', 'json_converter', 'json_serializer', 'json_token', 'json_writer', 'JSONAny', 'JSONCodingKey', 'JSONDecoder', 'JSONEncoder', 'JsonException', 'JsonGenerator', 'JsonNode', 'JSONNull', 'JsonParser', 'JsonReader', 'JsonTokenType', 'lambda', 'lazy', 'left', 'let', 'list', 'Locale', 'lock', 'long', 'map', 'MarshalJSON', 'MapEntry', 'metadata_property_handling', 'module', 'mutable', 'mutating', 'namespace', 'native', 'new', 'newtonsoft', 'nil', 'NO', 'noexcept', 'nonatomic', 'none', 'None', 'nonlocal', 'nonmutating', 'NSObject', 'noSuchMethod', 'not', 'not_eq', 'NSError', 'NSString', 'NULL', 'null', 'nullptr', 'number', 'object', 'ObjectMapper', 'of', 'oneway', 'open', 'operator', 'optional', 'or', 'or_eq', 'out', 'override', 'package', 'params', 'pass', 'port', 'postfix', 'precedence', 'prefix', 'print', 'printf', 'printMembers', 'private', 'protected', 'Protocol', 'protocol', 'public', 'quicktype', 'raise', 'range', 'readonly', 'ref', 'RegExp', 'register', 'reinterpret_cast', 'repeat', 'require', 'required', 'requires', 'restrict', 'retain', 'rethrows', 'return', 'right', 'runtimeType', 's', 'sbyte', 'sealed', 'SEL', 'select', 'Self', 'Serializable', 'self', 'Sendable', 'serialize', 'SerialName', 'KSerializer', 'PrimitiveKind', 'SerialDescriptor', 'SerializerProvider', 'set', 'short', 'signed', 'SimpleModule', 'sizeof', 'stackalloc', 'Standards', 'static', 'static_assert', 'static_cast', 'StdDeserializer', 'StdSerializer', 'strictfp', 'string', 'struct', 'subscript', 'super', 'switch', 'symbol', 'synchronized', 'system', 'template', 'then', 'this', 'thread_local', 'throw', 'throws', 'TimeOnly', 'TimeOnlyConverter', 'TimeZone', 'to_json', 'top_level', 'toString', 'to_dict', 'transient', 'True', 'true', 'try', 'Type', 'type', 'typealias', 'typedef', 'typeid', 'typename', 'typeof', 'uint', 'ulong', 'unchecked', 'undefined', 'union', 'UnmarshalJSON', 'UseSerializers', 'unowned', 'unsafe', 'unsigned', 'ushort', 'using', 'Utf8JsonReader', 'Utf8JsonWriter', 'UUID', 'var', 'virtual', 'void', 'volatile', 'wchar_t', 'weak', 'where', 'while', 'willSet', 'with', 'xor', 'xor_eq', 'YES', 'yield', 'dummy']);
1717 _TopLevel = PropTypes.shape({
1818 "enum": PropTypes.oneOfType([_Enum, PropTypes.oneOf([null])]),
1919 });
Mschema-javascriptdefault / TopLevel.js+6 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
@@ -317,6 +317,7 @@ const typeMap = {
317317 "FormatException",
318318 "friend",
319319 "from",
320+ "from_dict",
320321 "from_json",
321322 "func",
322323 "function",
@@ -376,6 +377,7 @@ const typeMap = {
376377 "lock",
377378 "long",
378379 "map",
380+ "MarshalJSON",
379381 "MapEntry",
380382 "metadata_property_handling",
381383 "module",
@@ -495,6 +497,7 @@ const typeMap = {
495497 "to_json",
496498 "top_level",
497499 "toString",
500+ "to_dict",
498501 "transient",
499502 "True",
500503 "true",
@@ -511,6 +514,7 @@ const typeMap = {
511514 "unchecked",
512515 "undefined",
513516 "union",
517+ "UnmarshalJSON",
514518 "UseSerializers",
515519 "unowned",
516520 "unsafe",
Mschema-kotlin-jacksondefault / TopLevel.kt+8 −0
@@ -162,6 +162,7 @@ enum class EnumEnum(val value: String) {
162162 FormatException("FormatException"),
163163 Friend("friend"),
164164 From("from"),
165+ FromDict("from_dict"),
165166 FromJSON("from_json"),
166167 Func("func"),
167168 Function("function"),
@@ -221,6 +222,7 @@ enum class EnumEnum(val value: String) {
221222 Lock("lock"),
222223 EnumLong("long"),
223224 EnumMap("map"),
225+ MarshalJSON("MarshalJSON"),
224226 MapEntry("MapEntry"),
225227 MetadataPropertyHandling("metadata_property_handling"),
226228 Module("module"),
@@ -340,6 +342,7 @@ enum class EnumEnum(val value: String) {
340342 ToJSON("to_json"),
341343 TopLevel("top_level"),
342344 ToString("toString"),
345+ ToDict("to_dict"),
343346 Transient("transient"),
344347 True("True"),
345348 EnumTrue("true"),
@@ -356,6 +359,7 @@ enum class EnumEnum(val value: String) {
356359 Unchecked("unchecked"),
357360 Undefined("undefined"),
358361 Union("union"),
362+ UnmarshalJSON("UnmarshalJSON"),
359363 UseSerializers("UseSerializers"),
360364 Unowned("unowned"),
361365 Unsafe("unsafe"),
@@ -504,6 +508,7 @@ enum class EnumEnum(val value: String) {
504508 "FormatException" -> FormatException
505509 "friend" -> Friend
506510 "from" -> From
511+ "from_dict" -> FromDict
507512 "from_json" -> FromJSON
508513 "func" -> Func
509514 "function" -> Function
@@ -563,6 +568,7 @@ enum class EnumEnum(val value: String) {
563568 "lock" -> Lock
564569 "long" -> EnumLong
565570 "map" -> EnumMap
571+ "MarshalJSON" -> MarshalJSON
566572 "MapEntry" -> MapEntry
567573 "metadata_property_handling" -> MetadataPropertyHandling
568574 "module" -> Module
@@ -682,6 +688,7 @@ enum class EnumEnum(val value: String) {
682688 "to_json" -> ToJSON
683689 "top_level" -> TopLevel
684690 "toString" -> ToString
691+ "to_dict" -> ToDict
685692 "transient" -> Transient
686693 "True" -> True
687694 "true" -> EnumTrue
@@ -698,6 +705,7 @@ enum class EnumEnum(val value: String) {
698705 "unchecked" -> Unchecked
699706 "undefined" -> Undefined
700707 "union" -> Union
708+ "UnmarshalJSON" -> UnmarshalJSON
701709 "UseSerializers" -> UseSerializers
702710 "unowned" -> Unowned
703711 "unsafe" -> Unsafe
Mschema-kotlindefault / TopLevel.kt+8 −0
@@ -149,6 +149,7 @@ enum class EnumEnum(val value: String) {
149149 FormatException("FormatException"),
150150 Friend("friend"),
151151 From("from"),
152+ FromDict("from_dict"),
152153 FromJSON("from_json"),
153154 Func("func"),
154155 Function("function"),
@@ -208,6 +209,7 @@ enum class EnumEnum(val value: String) {
208209 Lock("lock"),
209210 EnumLong("long"),
210211 EnumMap("map"),
212+ MarshalJSON("MarshalJSON"),
211213 MapEntry("MapEntry"),
212214 MetadataPropertyHandling("metadata_property_handling"),
213215 Module("module"),
@@ -327,6 +329,7 @@ enum class EnumEnum(val value: String) {
327329 ToJSON("to_json"),
328330 TopLevel("top_level"),
329331 ToString("toString"),
332+ ToDict("to_dict"),
330333 Transient("transient"),
331334 True("True"),
332335 EnumTrue("true"),
@@ -343,6 +346,7 @@ enum class EnumEnum(val value: String) {
343346 Unchecked("unchecked"),
344347 Undefined("undefined"),
345348 Union("union"),
349+ UnmarshalJSON("UnmarshalJSON"),
346350 UseSerializers("UseSerializers"),
347351 Unowned("unowned"),
348352 Unsafe("unsafe"),
@@ -491,6 +495,7 @@ enum class EnumEnum(val value: String) {
491495 "FormatException" -> FormatException
492496 "friend" -> Friend
493497 "from" -> From
498+ "from_dict" -> FromDict
494499 "from_json" -> FromJSON
495500 "func" -> Func
496501 "function" -> Function
@@ -550,6 +555,7 @@ enum class EnumEnum(val value: String) {
550555 "lock" -> Lock
551556 "long" -> EnumLong
552557 "map" -> EnumMap
558+ "MarshalJSON" -> MarshalJSON
553559 "MapEntry" -> MapEntry
554560 "metadata_property_handling" -> MetadataPropertyHandling
555561 "module" -> Module
@@ -669,6 +675,7 @@ enum class EnumEnum(val value: String) {
669675 "to_json" -> ToJSON
670676 "top_level" -> TopLevel
671677 "toString" -> ToString
678+ "to_dict" -> ToDict
672679 "transient" -> Transient
673680 "True" -> True
674681 "true" -> EnumTrue
@@ -685,6 +692,7 @@ enum class EnumEnum(val value: String) {
685692 "unchecked" -> Unchecked
686693 "undefined" -> Undefined
687694 "union" -> Union
695+ "UnmarshalJSON" -> UnmarshalJSON
688696 "UseSerializers" -> UseSerializers
689697 "unowned" -> Unowned
690698 "unsafe" -> Unsafe
Mschema-kotlinxdefault / TopLevel.kt+4 −0
@@ -138,6 +138,7 @@ enum class EnumEnum(val value: String) {
138138 @SerialName("FormatException") FormatException("FormatException"),
139139 @SerialName("friend") Friend("friend"),
140140 @SerialName("from") From("from"),
141+ @SerialName("from_dict") FromDict("from_dict"),
141142 @SerialName("from_json") FromJSON("from_json"),
142143 @SerialName("func") Func("func"),
143144 @SerialName("function") Function("function"),
@@ -197,6 +198,7 @@ enum class EnumEnum(val value: String) {
197198 @SerialName("lock") Lock("lock"),
198199 @SerialName("long") EnumLong("long"),
199200 @SerialName("map") EnumMap("map"),
201+ @SerialName("MarshalJSON") MarshalJSON("MarshalJSON"),
200202 @SerialName("MapEntry") MapEntry("MapEntry"),
201203 @SerialName("metadata_property_handling") MetadataPropertyHandling("metadata_property_handling"),
202204 @SerialName("module") Module("module"),
@@ -316,6 +318,7 @@ enum class EnumEnum(val value: String) {
316318 @SerialName("to_json") ToJSON("to_json"),
317319 @SerialName("top_level") TopLevel("top_level"),
318320 @SerialName("toString") ToString("toString"),
321+ @SerialName("to_dict") ToDict("to_dict"),
319322 @SerialName("transient") Transient("transient"),
320323 @SerialName("True") True("True"),
321324 @SerialName("true") EnumTrue("true"),
@@ -332,6 +335,7 @@ enum class EnumEnum(val value: String) {
332335 @SerialName("unchecked") Unchecked("unchecked"),
333336 @SerialName("undefined") Undefined("undefined"),
334337 @SerialName("union") Union("union"),
338+ @SerialName("UnmarshalJSON") UnmarshalJSON("UnmarshalJSON"),
335339 @SerialName("UseSerializers") EnumUseSerializers("UseSerializers"),
336340 @SerialName("unowned") Unowned("unowned"),
337341 @SerialName("unsafe") Unsafe("unsafe"),
Mschema-objective-cdefault / QTTopLevel.h+4 −0
@@ -136,6 +136,7 @@ NS_ASSUME_NONNULL_BEGIN
136136 + (QTEnum *)formatException;
137137 + (QTEnum *)friend;
138138 + (QTEnum *)from;
139++ (QTEnum *)fromDict;
139140 + (QTEnum *)fromJSON;
140141 + (QTEnum *)func;
141142 + (QTEnum *)function;
@@ -195,6 +196,7 @@ NS_ASSUME_NONNULL_BEGIN
195196 + (QTEnum *)lock;
196197 + (QTEnum *)enumLong;
197198 + (QTEnum *)map;
199++ (QTEnum *)marshalJSON;
198200 + (QTEnum *)mapEntry;
199201 + (QTEnum *)metadataPropertyHandling;
200202 + (QTEnum *)module;
@@ -314,6 +316,7 @@ NS_ASSUME_NONNULL_BEGIN
314316 + (QTEnum *)toJSON;
315317 + (QTEnum *)topLevel;
316318 + (QTEnum *)toString;
319++ (QTEnum *)toDict;
317320 + (QTEnum *)transient;
318321 + (QTEnum *)enumTrue;
319322 + (QTEnum *)true1;
@@ -330,6 +333,7 @@ NS_ASSUME_NONNULL_BEGIN
330333 + (QTEnum *)unchecked;
331334 + (QTEnum *)undefined;
332335 + (QTEnum *)enumUnion;
336++ (QTEnum *)unmarshalJSON;
333337 + (QTEnum *)useSerializers;
334338 + (QTEnum *)unowned;
335339 + (QTEnum *)unsafe;
Mschema-objective-cdefault / QTTopLevel.m+8 −0
@@ -139,6 +139,7 @@ NS_ASSUME_NONNULL_BEGIN
139139 @"FormatException": [[QTEnum alloc] initWithValue:@"FormatException"],
140140 @"friend": [[QTEnum alloc] initWithValue:@"friend"],
141141 @"from": [[QTEnum alloc] initWithValue:@"from"],
142+ @"from_dict": [[QTEnum alloc] initWithValue:@"from_dict"],
142143 @"from_json": [[QTEnum alloc] initWithValue:@"from_json"],
143144 @"func": [[QTEnum alloc] initWithValue:@"func"],
144145 @"function": [[QTEnum alloc] initWithValue:@"function"],
@@ -198,6 +199,7 @@ NS_ASSUME_NONNULL_BEGIN
198199 @"lock": [[QTEnum alloc] initWithValue:@"lock"],
199200 @"long": [[QTEnum alloc] initWithValue:@"long"],
200201 @"map": [[QTEnum alloc] initWithValue:@"map"],
202+ @"MarshalJSON": [[QTEnum alloc] initWithValue:@"MarshalJSON"],
201203 @"MapEntry": [[QTEnum alloc] initWithValue:@"MapEntry"],
202204 @"metadata_property_handling": [[QTEnum alloc] initWithValue:@"metadata_property_handling"],
203205 @"module": [[QTEnum alloc] initWithValue:@"module"],
@@ -317,6 +319,7 @@ NS_ASSUME_NONNULL_BEGIN
317319 @"to_json": [[QTEnum alloc] initWithValue:@"to_json"],
318320 @"top_level": [[QTEnum alloc] initWithValue:@"top_level"],
319321 @"toString": [[QTEnum alloc] initWithValue:@"toString"],
322+ @"to_dict": [[QTEnum alloc] initWithValue:@"to_dict"],
320323 @"transient": [[QTEnum alloc] initWithValue:@"transient"],
321324 @"True": [[QTEnum alloc] initWithValue:@"True"],
322325 @"true": [[QTEnum alloc] initWithValue:@"true"],
@@ -333,6 +336,7 @@ NS_ASSUME_NONNULL_BEGIN
333336 @"unchecked": [[QTEnum alloc] initWithValue:@"unchecked"],
334337 @"undefined": [[QTEnum alloc] initWithValue:@"undefined"],
335338 @"union": [[QTEnum alloc] initWithValue:@"union"],
339+ @"UnmarshalJSON": [[QTEnum alloc] initWithValue:@"UnmarshalJSON"],
336340 @"UseSerializers": [[QTEnum alloc] initWithValue:@"UseSerializers"],
337341 @"unowned": [[QTEnum alloc] initWithValue:@"unowned"],
338342 @"unsafe": [[QTEnum alloc] initWithValue:@"unsafe"],
@@ -481,6 +485,7 @@ NS_ASSUME_NONNULL_BEGIN
481485 + (QTEnum *)formatException { return QTEnum.values[@"FormatException"]; }
482486 + (QTEnum *)friend { return QTEnum.values[@"friend"]; }
483487 + (QTEnum *)from { return QTEnum.values[@"from"]; }
488++ (QTEnum *)fromDict { return QTEnum.values[@"from_dict"]; }
484489 + (QTEnum *)fromJSON { return QTEnum.values[@"from_json"]; }
485490 + (QTEnum *)func { return QTEnum.values[@"func"]; }
486491 + (QTEnum *)function { return QTEnum.values[@"function"]; }
@@ -540,6 +545,7 @@ NS_ASSUME_NONNULL_BEGIN
540545 + (QTEnum *)lock { return QTEnum.values[@"lock"]; }
541546 + (QTEnum *)enumLong { return QTEnum.values[@"long"]; }
542547 + (QTEnum *)map { return QTEnum.values[@"map"]; }
548++ (QTEnum *)marshalJSON { return QTEnum.values[@"MarshalJSON"]; }
543549 + (QTEnum *)mapEntry { return QTEnum.values[@"MapEntry"]; }
544550 + (QTEnum *)metadataPropertyHandling { return QTEnum.values[@"metadata_property_handling"]; }
545551 + (QTEnum *)module { return QTEnum.values[@"module"]; }
@@ -659,6 +665,7 @@ NS_ASSUME_NONNULL_BEGIN
659665 + (QTEnum *)toJSON { return QTEnum.values[@"to_json"]; }
660666 + (QTEnum *)topLevel { return QTEnum.values[@"top_level"]; }
661667 + (QTEnum *)toString { return QTEnum.values[@"toString"]; }
668++ (QTEnum *)toDict { return QTEnum.values[@"to_dict"]; }
662669 + (QTEnum *)transient { return QTEnum.values[@"transient"]; }
663670 + (QTEnum *)enumTrue { return QTEnum.values[@"True"]; }
664671 + (QTEnum *)true1 { return QTEnum.values[@"true"]; }
@@ -675,6 +682,7 @@ NS_ASSUME_NONNULL_BEGIN
675682 + (QTEnum *)unchecked { return QTEnum.values[@"unchecked"]; }
676683 + (QTEnum *)undefined { return QTEnum.values[@"undefined"]; }
677684 + (QTEnum *)enumUnion { return QTEnum.values[@"union"]; }
685++ (QTEnum *)unmarshalJSON { return QTEnum.values[@"UnmarshalJSON"]; }
678686 + (QTEnum *)useSerializers { return QTEnum.values[@"UseSerializers"]; }
679687 + (QTEnum *)unowned { return QTEnum.values[@"unowned"]; }
680688 + (QTEnum *)unsafe { return QTEnum.values[@"unsafe"]; }
Mschema-phpdefault / TopLevel.php+16 −0
@@ -234,6 +234,7 @@ class EnumEnum {
234234 public static EnumEnum $FORMAT_EXCEPTION;
235235 public static EnumEnum $FRIEND;
236236 public static EnumEnum $FROM;
237+ public static EnumEnum $FROM_DICT;
237238 public static EnumEnum $FROM_JSON;
238239 public static EnumEnum $FUNC;
239240 public static EnumEnum $FUNCTION;
@@ -293,6 +294,7 @@ class EnumEnum {
293294 public static EnumEnum $LOCK;
294295 public static EnumEnum $LONG;
295296 public static EnumEnum $MAP;
297+ public static EnumEnum $MARSHAL_JSON;
296298 public static EnumEnum $MAP_ENTRY;
297299 public static EnumEnum $METADATA_PROPERTY_HANDLING;
298300 public static EnumEnum $MODULE;
@@ -412,6 +414,7 @@ class EnumEnum {
412414 public static EnumEnum $TO_JSON;
413415 public static EnumEnum $TOP_LEVEL;
414416 public static EnumEnum $TO_STRING;
417+ public static EnumEnum $TO_DICT;
415418 public static EnumEnum $TRANSIENT;
416419 public static EnumEnum $TRUE;
417420 public static EnumEnum $ENUM_TRUE;
@@ -428,6 +431,7 @@ class EnumEnum {
428431 public static EnumEnum $UNCHECKED;
429432 public static EnumEnum $UNDEFINED;
430433 public static EnumEnum $UNION;
434+ public static EnumEnum $UNMARSHAL_JSON;
431435 public static EnumEnum $USE_SERIALIZERS;
432436 public static EnumEnum $UNOWNED;
433437 public static EnumEnum $UNSAFE;
@@ -574,6 +578,7 @@ class EnumEnum {
574578 EnumEnum::$FORMAT_EXCEPTION = new EnumEnum('FormatException');
575579 EnumEnum::$FRIEND = new EnumEnum('friend');
576580 EnumEnum::$FROM = new EnumEnum('from');
581+ EnumEnum::$FROM_DICT = new EnumEnum('from_dict');
577582 EnumEnum::$FROM_JSON = new EnumEnum('from_json');
578583 EnumEnum::$FUNC = new EnumEnum('func');
579584 EnumEnum::$FUNCTION = new EnumEnum('function');
@@ -633,6 +638,7 @@ class EnumEnum {
633638 EnumEnum::$LOCK = new EnumEnum('lock');
634639 EnumEnum::$LONG = new EnumEnum('long');
635640 EnumEnum::$MAP = new EnumEnum('map');
641+ EnumEnum::$MARSHAL_JSON = new EnumEnum('MarshalJSON');
636642 EnumEnum::$MAP_ENTRY = new EnumEnum('MapEntry');
637643 EnumEnum::$METADATA_PROPERTY_HANDLING = new EnumEnum('metadata_property_handling');
638644 EnumEnum::$MODULE = new EnumEnum('module');
@@ -752,6 +758,7 @@ class EnumEnum {
752758 EnumEnum::$TO_JSON = new EnumEnum('to_json');
753759 EnumEnum::$TOP_LEVEL = new EnumEnum('top_level');
754760 EnumEnum::$TO_STRING = new EnumEnum('toString');
761+ EnumEnum::$TO_DICT = new EnumEnum('to_dict');
755762 EnumEnum::$TRANSIENT = new EnumEnum('transient');
756763 EnumEnum::$TRUE = new EnumEnum('True');
757764 EnumEnum::$ENUM_TRUE = new EnumEnum('true');
@@ -768,6 +775,7 @@ class EnumEnum {
768775 EnumEnum::$UNCHECKED = new EnumEnum('unchecked');
769776 EnumEnum::$UNDEFINED = new EnumEnum('undefined');
770777 EnumEnum::$UNION = new EnumEnum('union');
778+ EnumEnum::$UNMARSHAL_JSON = new EnumEnum('UnmarshalJSON');
771779 EnumEnum::$USE_SERIALIZERS = new EnumEnum('UseSerializers');
772780 EnumEnum::$UNOWNED = new EnumEnum('unowned');
773781 EnumEnum::$UNSAFE = new EnumEnum('unsafe');
@@ -926,6 +934,7 @@ class EnumEnum {
926934 case EnumEnum::$FORMAT_EXCEPTION->enum: return 'FormatException';
927935 case EnumEnum::$FRIEND->enum: return 'friend';
928936 case EnumEnum::$FROM->enum: return 'from';
937+ case EnumEnum::$FROM_DICT->enum: return 'from_dict';
929938 case EnumEnum::$FROM_JSON->enum: return 'from_json';
930939 case EnumEnum::$FUNC->enum: return 'func';
931940 case EnumEnum::$FUNCTION->enum: return 'function';
@@ -985,6 +994,7 @@ class EnumEnum {
985994 case EnumEnum::$LOCK->enum: return 'lock';
986995 case EnumEnum::$LONG->enum: return 'long';
987996 case EnumEnum::$MAP->enum: return 'map';
997+ case EnumEnum::$MARSHAL_JSON->enum: return 'MarshalJSON';
988998 case EnumEnum::$MAP_ENTRY->enum: return 'MapEntry';
989999 case EnumEnum::$METADATA_PROPERTY_HANDLING->enum: return 'metadata_property_handling';
9901000 case EnumEnum::$MODULE->enum: return 'module';
@@ -1104,6 +1114,7 @@ class EnumEnum {
11041114 case EnumEnum::$TO_JSON->enum: return 'to_json';
11051115 case EnumEnum::$TOP_LEVEL->enum: return 'top_level';
11061116 case EnumEnum::$TO_STRING->enum: return 'toString';
1117+ case EnumEnum::$TO_DICT->enum: return 'to_dict';
11071118 case EnumEnum::$TRANSIENT->enum: return 'transient';
11081119 case EnumEnum::$TRUE->enum: return 'True';
11091120 case EnumEnum::$ENUM_TRUE->enum: return 'true';
@@ -1120,6 +1131,7 @@ class EnumEnum {
11201131 case EnumEnum::$UNCHECKED->enum: return 'unchecked';
11211132 case EnumEnum::$UNDEFINED->enum: return 'undefined';
11221133 case EnumEnum::$UNION->enum: return 'union';
1134+ case EnumEnum::$UNMARSHAL_JSON->enum: return 'UnmarshalJSON';
11231135 case EnumEnum::$USE_SERIALIZERS->enum: return 'UseSerializers';
11241136 case EnumEnum::$UNOWNED->enum: return 'unowned';
11251137 case EnumEnum::$UNSAFE->enum: return 'unsafe';
@@ -1276,6 +1288,7 @@ class EnumEnum {
12761288 case 'FormatException': return EnumEnum::$FORMAT_EXCEPTION;
12771289 case 'friend': return EnumEnum::$FRIEND;
12781290 case 'from': return EnumEnum::$FROM;
1291+ case 'from_dict': return EnumEnum::$FROM_DICT;
12791292 case 'from_json': return EnumEnum::$FROM_JSON;
12801293 case 'func': return EnumEnum::$FUNC;
12811294 case 'function': return EnumEnum::$FUNCTION;
@@ -1335,6 +1348,7 @@ class EnumEnum {
13351348 case 'lock': return EnumEnum::$LOCK;
13361349 case 'long': return EnumEnum::$LONG;
13371350 case 'map': return EnumEnum::$MAP;
1351+ case 'MarshalJSON': return EnumEnum::$MARSHAL_JSON;
13381352 case 'MapEntry': return EnumEnum::$MAP_ENTRY;
13391353 case 'metadata_property_handling': return EnumEnum::$METADATA_PROPERTY_HANDLING;
13401354 case 'module': return EnumEnum::$MODULE;
@@ -1454,6 +1468,7 @@ class EnumEnum {
14541468 case 'to_json': return EnumEnum::$TO_JSON;
14551469 case 'top_level': return EnumEnum::$TOP_LEVEL;
14561470 case 'toString': return EnumEnum::$TO_STRING;
1471+ case 'to_dict': return EnumEnum::$TO_DICT;
14571472 case 'transient': return EnumEnum::$TRANSIENT;
14581473 case 'True': return EnumEnum::$TRUE;
14591474 case 'true': return EnumEnum::$ENUM_TRUE;
@@ -1470,6 +1485,7 @@ class EnumEnum {
14701485 case 'unchecked': return EnumEnum::$UNCHECKED;
14711486 case 'undefined': return EnumEnum::$UNDEFINED;
14721487 case 'union': return EnumEnum::$UNION;
1488+ case 'UnmarshalJSON': return EnumEnum::$UNMARSHAL_JSON;
14731489 case 'UseSerializers': return EnumEnum::$USE_SERIALIZERS;
14741490 case 'unowned': return EnumEnum::$UNOWNED;
14751491 case 'unsafe': return EnumEnum::$UNSAFE;
Mschema-pikedefault / TopLevel.pmod+5 −1
@@ -154,6 +154,7 @@ enum Enum {
154154 FORMAT_EXCEPTION = "FormatException", // json: "FormatException"
155155 FRIEND = "friend", // json: "friend"
156156 FROM = "from", // json: "from"
157+ FROM_DICT = "from_dict", // json: "from_dict"
157158 FROM_JSON = "from_json", // json: "from_json"
158159 FUNC = "func", // json: "func"
159160 FUNCTION = "function", // json: "function"
@@ -213,6 +214,7 @@ enum Enum {
213214 LOCK = "lock", // json: "lock"
214215 LONG = "long", // json: "long"
215216 MAP = "map", // json: "map"
217+ MARSHAL_JSON = "MarshalJSON", // json: "MarshalJSON"
216218 MAP_ENTRY = "MapEntry", // json: "MapEntry"
217219 METADATA_PROPERTY_HANDLING = "metadata_property_handling", // json: "metadata_property_handling"
218220 MODULE = "module", // json: "module"
@@ -332,6 +334,7 @@ enum Enum {
332334 TO_JSON = "to_json", // json: "to_json"
333335 TOP_LEVEL = "top_level", // json: "top_level"
334336 TO_STRING = "toString", // json: "toString"
337+ TO_DICT = "to_dict", // json: "to_dict"
335338 TRANSIENT = "transient", // json: "transient"
336339 TRUE = "True", // json: "True"
337340 ENUM_TRUE = "true", // json: "true"
@@ -348,6 +351,7 @@ enum Enum {
348351 UNCHECKED = "unchecked", // json: "unchecked"
349352 UNDEFINED = "undefined", // json: "undefined"
350353 UNION = "union", // json: "union"
354+ UNMARSHAL_JSON = "UnmarshalJSON", // json: "UnmarshalJSON"
351355 USE_SERIALIZERS = "UseSerializers", // json: "UseSerializers"
352356 UNOWNED = "unowned", // json: "unowned"
353357 UNSAFE = "unsafe", // json: "unsafe"
@@ -375,5 +379,5 @@ enum Enum {
375379 }
376380
377381 Enum Enum_from_JSON(mixed json) {
378- if(!zero_type(json)&&json != "_"&&json != "_Bool"&&json != "_Complex"&&json != "_Imaginery"&&json != "abstract"&&json != "alignas"&&json != "alignof"&&json != "and"&&json != "and_eq"&&json != "any"&&json != "Any"&&json != "array"&&json != "as"&&json != "asm"&&json != "assert"&&json != "associatedtype"&&json != "associativity"&&json != "async"&&json != "atomic"&&json != "atomic_cancel"&&json != "atomic_commit"&&json != "atomic_noexcept"&&json != "auto"&&json != "await"&&json != "base"&&json != "bitand"&&json != "bitor"&&json != "BOOL"&&json != "bool"&&json != "boolean"&&json != "break"&&json != "bycopy"&&json != "byref"&&json != "byte"&&json != "Calendar"&&json != "case"&&json != "catch"&&json != "chan"&&json != "char"&&json != "char16_t"&&json != "char32_t"&&json != "checked"&&json != "class"&&json != "Class"&&json != "clone"&&json != "co_await"&&json != "co_return"&&json != "co_yield"&&json != "Codable"&&json != "CodingKey"&&json != "CodingKeys"&&json != "compl"&&json != "concept"&&json != "console"&&json != "const"&&json != "const_cast"&&json != "constexpr"&&json != "constructor"&&json != "continue"&&json != "convenience"&&json != "convert"&&json != "converter"&&json != "CultureInfo"&&json != "date"&&json != "date_parse_handling"&&json != "DateFormatter"&&json != "DateOnly"&&json != "DateOnlyConverter"&&json != "DateTime"&&json != "DateTimeStyles"&&json != "debugger"&&json != "decimal"&&json != "declare"&&json != "decltype"&&json != "decode_string"&&json != "Decoder"&&json != "DecodingError"&&json != "def"&&json != "default"&&json != "defer"&&json != "deinit"&&json != "del"&&json != "delegate"&&json != "delete"&&json != "dict"&&json != "dictionary"&&json != "didSet"&&json != "do"&&json != "double"&&json != "dynamic"&&json != "dynamic_cast"&&json != "elif"&&json != "else"&&json != "encode_quick_type"&&json != "Encoder"&&json != "enum"&&json != "EnumValues"&&json != "Equatable"&&json != "equalityContract"&&json != "event"&&json != "except"&&json != "exception"&&json != "explicit"&&json != "export"&&json != "exposing"&&json != "extends"&&json != "extension"&&json != "extern"&&json != "fallthrough"&&json != "false"&&json != "False"&&json != "fileprivate"&&json != "final"&&json != "finally"&&json != "fixed"&&json != "float"&&json != "for"&&json != "foreach"&&json != "FormatException"&&json != "friend"&&json != "from"&&json != "from_json"&&json != "func"&&json != "function"&&json != "get"&&json != "global"&&json != "go"&&json != "goto"&&json != "guard"&&json != "Hashable"&&json != "hashCode"&&json != "Hasher"&&json != "hasOwnProperty"&&json != "id"&&json != "if"&&json != "IMP"&&json != "implements"&&json != "implicit"&&json != "import"&&json != "in"&&json != "indirect"&&json != "infix"&&json != "init"&&json != "inline"&&json != "inout"&&json != "instanceof"&&json != "int"&&json != "interface"&&json != "internal"&&json != "IsoDateTimeOffsetConverter"&&json != "iterable"&&json != "is"&&json != "jdec"&&json != "jenc"&&json != "jpipe"&&json != "json"&&json != "json_converter"&&json != "json_serializer"&&json != "json_token"&&json != "json_writer"&&json != "JSONAny"&&json != "JSONCodingKey"&&json != "JSONDecoder"&&json != "JSONEncoder"&&json != "JsonException"&&json != "JsonGenerator"&&json != "JsonNode"&&json != "JSONNull"&&json != "JsonParser"&&json != "JsonReader"&&json != "JsonTokenType"&&json != "lambda"&&json != "lazy"&&json != "left"&&json != "let"&&json != "list"&&json != "Locale"&&json != "lock"&&json != "long"&&json != "map"&&json != "MapEntry"&&json != "metadata_property_handling"&&json != "module"&&json != "mutable"&&json != "mutating"&&json != "namespace"&&json != "native"&&json != "new"&&json != "newtonsoft"&&json != "nil"&&json != "NO"&&json != "noexcept"&&json != "nonatomic"&&json != "none"&&json != "None"&&json != "nonlocal"&&json != "nonmutating"&&json != "NSObject"&&json != "noSuchMethod"&&json != "not"&&json != "not_eq"&&json != "NSError"&&json != "NSString"&&json != "NULL"&&json != "null"&&json != "nullptr"&&json != "number"&&json != "object"&&json != "ObjectMapper"&&json != "of"&&json != "oneway"&&json != "open"&&json != "operator"&&json != "optional"&&json != "or"&&json != "or_eq"&&json != "out"&&json != "override"&&json != "package"&&json != "params"&&json != "pass"&&json != "port"&&json != "postfix"&&json != "precedence"&&json != "prefix"&&json != "print"&&json != "printf"&&json != "printMembers"&&json != "private"&&json != "protected"&&json != "Protocol"&&json != "protocol"&&json != "public"&&json != "quicktype"&&json != "raise"&&json != "range"&&json != "readonly"&&json != "ref"&&json != "RegExp"&&json != "register"&&json != "reinterpret_cast"&&json != "repeat"&&json != "require"&&json != "required"&&json != "requires"&&json != "restrict"&&json != "retain"&&json != "rethrows"&&json != "return"&&json != "right"&&json != "runtimeType"&&json != "s"&&json != "sbyte"&&json != "sealed"&&json != "SEL"&&json != "select"&&json != "Self"&&json != "Serializable"&&json != "self"&&json != "Sendable"&&json != "serialize"&&json != "SerialName"&&json != "KSerializer"&&json != "PrimitiveKind"&&json != "SerialDescriptor"&&json != "SerializerProvider"&&json != "set"&&json != "short"&&json != "signed"&&json != "SimpleModule"&&json != "sizeof"&&json != "stackalloc"&&json != "Standards"&&json != "static"&&json != "static_assert"&&json != "static_cast"&&json != "StdDeserializer"&&json != "StdSerializer"&&json != "strictfp"&&json != "string"&&json != "struct"&&json != "subscript"&&json != "super"&&json != "switch"&&json != "symbol"&&json != "synchronized"&&json != "system"&&json != "template"&&json != "then"&&json != "this"&&json != "thread_local"&&json != "throw"&&json != "throws"&&json != "TimeOnly"&&json != "TimeOnlyConverter"&&json != "TimeZone"&&json != "to_json"&&json != "top_level"&&json != "toString"&&json != "transient"&&json != "True"&&json != "true"&&json != "try"&&json != "Type"&&json != "type"&&json != "typealias"&&json != "typedef"&&json != "typeid"&&json != "typename"&&json != "typeof"&&json != "uint"&&json != "ulong"&&json != "unchecked"&&json != "undefined"&&json != "union"&&json != "UseSerializers"&&json != "unowned"&&json != "unsafe"&&json != "unsigned"&&json != "ushort"&&json != "using"&&json != "Utf8JsonReader"&&json != "Utf8JsonWriter"&&json != "UUID"&&json != "var"&&json != "virtual"&&json != "void"&&json != "volatile"&&json != "wchar_t"&&json != "weak"&&json != "where"&&json != "while"&&json != "willSet"&&json != "with"&&json != "xor"&&json != "xor_eq"&&json != "YES"&&json != "yield"&&json != "dummy")error("enum");return json;
382+ if(!zero_type(json)&&json != "_"&&json != "_Bool"&&json != "_Complex"&&json != "_Imaginery"&&json != "abstract"&&json != "alignas"&&json != "alignof"&&json != "and"&&json != "and_eq"&&json != "any"&&json != "Any"&&json != "array"&&json != "as"&&json != "asm"&&json != "assert"&&json != "associatedtype"&&json != "associativity"&&json != "async"&&json != "atomic"&&json != "atomic_cancel"&&json != "atomic_commit"&&json != "atomic_noexcept"&&json != "auto"&&json != "await"&&json != "base"&&json != "bitand"&&json != "bitor"&&json != "BOOL"&&json != "bool"&&json != "boolean"&&json != "break"&&json != "bycopy"&&json != "byref"&&json != "byte"&&json != "Calendar"&&json != "case"&&json != "catch"&&json != "chan"&&json != "char"&&json != "char16_t"&&json != "char32_t"&&json != "checked"&&json != "class"&&json != "Class"&&json != "clone"&&json != "co_await"&&json != "co_return"&&json != "co_yield"&&json != "Codable"&&json != "CodingKey"&&json != "CodingKeys"&&json != "compl"&&json != "concept"&&json != "console"&&json != "const"&&json != "const_cast"&&json != "constexpr"&&json != "constructor"&&json != "continue"&&json != "convenience"&&json != "convert"&&json != "converter"&&json != "CultureInfo"&&json != "date"&&json != "date_parse_handling"&&json != "DateFormatter"&&json != "DateOnly"&&json != "DateOnlyConverter"&&json != "DateTime"&&json != "DateTimeStyles"&&json != "debugger"&&json != "decimal"&&json != "declare"&&json != "decltype"&&json != "decode_string"&&json != "Decoder"&&json != "DecodingError"&&json != "def"&&json != "default"&&json != "defer"&&json != "deinit"&&json != "del"&&json != "delegate"&&json != "delete"&&json != "dict"&&json != "dictionary"&&json != "didSet"&&json != "do"&&json != "double"&&json != "dynamic"&&json != "dynamic_cast"&&json != "elif"&&json != "else"&&json != "encode_quick_type"&&json != "Encoder"&&json != "enum"&&json != "EnumValues"&&json != "Equatable"&&json != "equalityContract"&&json != "event"&&json != "except"&&json != "exception"&&json != "explicit"&&json != "export"&&json != "exposing"&&json != "extends"&&json != "extension"&&json != "extern"&&json != "fallthrough"&&json != "false"&&json != "False"&&json != "fileprivate"&&json != "final"&&json != "finally"&&json != "fixed"&&json != "float"&&json != "for"&&json != "foreach"&&json != "FormatException"&&json != "friend"&&json != "from"&&json != "from_dict"&&json != "from_json"&&json != "func"&&json != "function"&&json != "get"&&json != "global"&&json != "go"&&json != "goto"&&json != "guard"&&json != "Hashable"&&json != "hashCode"&&json != "Hasher"&&json != "hasOwnProperty"&&json != "id"&&json != "if"&&json != "IMP"&&json != "implements"&&json != "implicit"&&json != "import"&&json != "in"&&json != "indirect"&&json != "infix"&&json != "init"&&json != "inline"&&json != "inout"&&json != "instanceof"&&json != "int"&&json != "interface"&&json != "internal"&&json != "IsoDateTimeOffsetConverter"&&json != "iterable"&&json != "is"&&json != "jdec"&&json != "jenc"&&json != "jpipe"&&json != "json"&&json != "json_converter"&&json != "json_serializer"&&json != "json_token"&&json != "json_writer"&&json != "JSONAny"&&json != "JSONCodingKey"&&json != "JSONDecoder"&&json != "JSONEncoder"&&json != "JsonException"&&json != "JsonGenerator"&&json != "JsonNode"&&json != "JSONNull"&&json != "JsonParser"&&json != "JsonReader"&&json != "JsonTokenType"&&json != "lambda"&&json != "lazy"&&json != "left"&&json != "let"&&json != "list"&&json != "Locale"&&json != "lock"&&json != "long"&&json != "map"&&json != "MarshalJSON"&&json != "MapEntry"&&json != "metadata_property_handling"&&json != "module"&&json != "mutable"&&json != "mutating"&&json != "namespace"&&json != "native"&&json != "new"&&json != "newtonsoft"&&json != "nil"&&json != "NO"&&json != "noexcept"&&json != "nonatomic"&&json != "none"&&json != "None"&&json != "nonlocal"&&json != "nonmutating"&&json != "NSObject"&&json != "noSuchMethod"&&json != "not"&&json != "not_eq"&&json != "NSError"&&json != "NSString"&&json != "NULL"&&json != "null"&&json != "nullptr"&&json != "number"&&json != "object"&&json != "ObjectMapper"&&json != "of"&&json != "oneway"&&json != "open"&&json != "operator"&&json != "optional"&&json != "or"&&json != "or_eq"&&json != "out"&&json != "override"&&json != "package"&&json != "params"&&json != "pass"&&json != "port"&&json != "postfix"&&json != "precedence"&&json != "prefix"&&json != "print"&&json != "printf"&&json != "printMembers"&&json != "private"&&json != "protected"&&json != "Protocol"&&json != "protocol"&&json != "public"&&json != "quicktype"&&json != "raise"&&json != "range"&&json != "readonly"&&json != "ref"&&json != "RegExp"&&json != "register"&&json != "reinterpret_cast"&&json != "repeat"&&json != "require"&&json != "required"&&json != "requires"&&json != "restrict"&&json != "retain"&&json != "rethrows"&&json != "return"&&json != "right"&&json != "runtimeType"&&json != "s"&&json != "sbyte"&&json != "sealed"&&json != "SEL"&&json != "select"&&json != "Self"&&json != "Serializable"&&json != "self"&&json != "Sendable"&&json != "serialize"&&json != "SerialName"&&json != "KSerializer"&&json != "PrimitiveKind"&&json != "SerialDescriptor"&&json != "SerializerProvider"&&json != "set"&&json != "short"&&json != "signed"&&json != "SimpleModule"&&json != "sizeof"&&json != "stackalloc"&&json != "Standards"&&json != "static"&&json != "static_assert"&&json != "static_cast"&&json != "StdDeserializer"&&json != "StdSerializer"&&json != "strictfp"&&json != "string"&&json != "struct"&&json != "subscript"&&json != "super"&&json != "switch"&&json != "symbol"&&json != "synchronized"&&json != "system"&&json != "template"&&json != "then"&&json != "this"&&json != "thread_local"&&json != "throw"&&json != "throws"&&json != "TimeOnly"&&json != "TimeOnlyConverter"&&json != "TimeZone"&&json != "to_json"&&json != "top_level"&&json != "toString"&&json != "to_dict"&&json != "transient"&&json != "True"&&json != "true"&&json != "try"&&json != "Type"&&json != "type"&&json != "typealias"&&json != "typedef"&&json != "typeid"&&json != "typename"&&json != "typeof"&&json != "uint"&&json != "ulong"&&json != "unchecked"&&json != "undefined"&&json != "union"&&json != "UnmarshalJSON"&&json != "UseSerializers"&&json != "unowned"&&json != "unsafe"&&json != "unsigned"&&json != "ushort"&&json != "using"&&json != "Utf8JsonReader"&&json != "Utf8JsonWriter"&&json != "UUID"&&json != "var"&&json != "virtual"&&json != "void"&&json != "volatile"&&json != "wchar_t"&&json != "weak"&&json != "where"&&json != "while"&&json != "willSet"&&json != "with"&&json != "xor"&&json != "xor_eq"&&json != "YES"&&json != "yield"&&json != "dummy")error("enum");return json;
379383 }
Mschema-pythondefault / quicktype.py+4 −0
@@ -153,6 +153,7 @@ class EnumEnum(Enum):
153153 FORMAT_EXCEPTION = "FormatException"
154154 FRIEND = "friend"
155155 FROM = "from"
156+ FROM_DICT = "from_dict"
156157 FROM_JSON = "from_json"
157158 FUNC = "func"
158159 FUNCTION = "function"
@@ -212,6 +213,7 @@ class EnumEnum(Enum):
212213 LOCK = "lock"
213214 LONG = "long"
214215 MAP = "map"
216+ MARSHAL_JSON = "MarshalJSON"
215217 MAP_ENTRY = "MapEntry"
216218 METADATA_PROPERTY_HANDLING = "metadata_property_handling"
217219 MODULE = "module"
@@ -331,6 +333,7 @@ class EnumEnum(Enum):
331333 TO_JSON = "to_json"
332334 TOP_LEVEL = "top_level"
333335 TO_STRING = "toString"
336+ TO_DICT = "to_dict"
334337 TRANSIENT = "transient"
335338 TRUE = "True"
336339 ENUM_TRUE = "true"
@@ -347,6 +350,7 @@ class EnumEnum(Enum):
347350 UNCHECKED = "unchecked"
348351 UNDEFINED = "undefined"
349352 UNION = "union"
353+ UNMARSHAL_JSON = "UnmarshalJSON"
350354 USE_SERIALIZERS = "UseSerializers"
351355 UNOWNED = "unowned"
352356 UNSAFE = "unsafe"
Mschema-rubydefault / TopLevel.rb+5 −1
@@ -17,7 +17,7 @@ module Types
1717
1818 Hash = Strict::Hash
1919 String = Strict::String
20- Enum = Strict::String.enum("_", "_Bool", "_Complex", "_Imaginery", "abstract", "alignas", "alignof", "and", "and_eq", "any", "Any", "array", "as", "asm", "assert", "associatedtype", "associativity", "async", "atomic", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "await", "base", "bitand", "bitor", "BOOL", "bool", "boolean", "break", "bycopy", "byref", "byte", "Calendar", "case", "catch", "chan", "char", "char16_t", "char32_t", "checked", "class", "Class", "clone", "co_await", "co_return", "co_yield", "Codable", "CodingKey", "CodingKeys", "compl", "concept", "console", "const", "const_cast", "constexpr", "constructor", "continue", "convenience", "convert", "converter", "CultureInfo", "date", "date_parse_handling", "DateFormatter", "DateOnly", "DateOnlyConverter", "DateTime", "DateTimeStyles", "debugger", "decimal", "declare", "decltype", "decode_string", "Decoder", "DecodingError", "def", "default", "defer", "deinit", "del", "delegate", "delete", "dict", "dictionary", "didSet", "do", "double", "dynamic", "dynamic_cast", "elif", "else", "encode_quick_type", "Encoder", "enum", "EnumValues", "Equatable", "equalityContract", "event", "except", "exception", "explicit", "export", "exposing", "extends", "extension", "extern", "fallthrough", "false", "False", "fileprivate", "final", "finally", "fixed", "float", "for", "foreach", "FormatException", "friend", "from", "from_json", "func", "function", "get", "global", "go", "goto", "guard", "Hashable", "hashCode", "Hasher", "hasOwnProperty", "id", "if", "IMP", "implements", "implicit", "import", "in", "indirect", "infix", "init", "inline", "inout", "instanceof", "int", "interface", "internal", "IsoDateTimeOffsetConverter", "iterable", "is", "jdec", "jenc", "jpipe", "json", "json_converter", "json_serializer", "json_token", "json_writer", "JSONAny", "JSONCodingKey", "JSONDecoder", "JSONEncoder", "JsonException", "JsonGenerator", "JsonNode", "JSONNull", "JsonParser", "JsonReader", "JsonTokenType", "lambda", "lazy", "left", "let", "list", "Locale", "lock", "long", "map", "MapEntry", "metadata_property_handling", "module", "mutable", "mutating", "namespace", "native", "new", "newtonsoft", "nil", "NO", "noexcept", "nonatomic", "none", "None", "nonlocal", "nonmutating", "NSObject", "noSuchMethod", "not", "not_eq", "NSError", "NSString", "NULL", "null", "nullptr", "number", "object", "ObjectMapper", "of", "oneway", "open", "operator", "optional", "or", "or_eq", "out", "override", "package", "params", "pass", "port", "postfix", "precedence", "prefix", "print", "printf", "printMembers", "private", "protected", "Protocol", "protocol", "public", "quicktype", "raise", "range", "readonly", "ref", "RegExp", "register", "reinterpret_cast", "repeat", "require", "required", "requires", "restrict", "retain", "rethrows", "return", "right", "runtimeType", "s", "sbyte", "sealed", "SEL", "select", "Self", "Serializable", "self", "Sendable", "serialize", "SerialName", "KSerializer", "PrimitiveKind", "SerialDescriptor", "SerializerProvider", "set", "short", "signed", "SimpleModule", "sizeof", "stackalloc", "Standards", "static", "static_assert", "static_cast", "StdDeserializer", "StdSerializer", "strictfp", "string", "struct", "subscript", "super", "switch", "symbol", "synchronized", "system", "template", "then", "this", "thread_local", "throw", "throws", "TimeOnly", "TimeOnlyConverter", "TimeZone", "to_json", "top_level", "toString", "transient", "True", "true", "try", "Type", "type", "typealias", "typedef", "typeid", "typename", "typeof", "uint", "ulong", "unchecked", "undefined", "union", "UseSerializers", "unowned", "unsafe", "unsigned", "ushort", "using", "Utf8JsonReader", "Utf8JsonWriter", "UUID", "var", "virtual", "void", "volatile", "wchar_t", "weak", "where", "while", "willSet", "with", "xor", "xor_eq", "YES", "yield", "dummy")
20+ Enum = Strict::String.enum("_", "_Bool", "_Complex", "_Imaginery", "abstract", "alignas", "alignof", "and", "and_eq", "any", "Any", "array", "as", "asm", "assert", "associatedtype", "associativity", "async", "atomic", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "await", "base", "bitand", "bitor", "BOOL", "bool", "boolean", "break", "bycopy", "byref", "byte", "Calendar", "case", "catch", "chan", "char", "char16_t", "char32_t", "checked", "class", "Class", "clone", "co_await", "co_return", "co_yield", "Codable", "CodingKey", "CodingKeys", "compl", "concept", "console", "const", "const_cast", "constexpr", "constructor", "continue", "convenience", "convert", "converter", "CultureInfo", "date", "date_parse_handling", "DateFormatter", "DateOnly", "DateOnlyConverter", "DateTime", "DateTimeStyles", "debugger", "decimal", "declare", "decltype", "decode_string", "Decoder", "DecodingError", "def", "default", "defer", "deinit", "del", "delegate", "delete", "dict", "dictionary", "didSet", "do", "double", "dynamic", "dynamic_cast", "elif", "else", "encode_quick_type", "Encoder", "enum", "EnumValues", "Equatable", "equalityContract", "event", "except", "exception", "explicit", "export", "exposing", "extends", "extension", "extern", "fallthrough", "false", "False", "fileprivate", "final", "finally", "fixed", "float", "for", "foreach", "FormatException", "friend", "from", "from_dict", "from_json", "func", "function", "get", "global", "go", "goto", "guard", "Hashable", "hashCode", "Hasher", "hasOwnProperty", "id", "if", "IMP", "implements", "implicit", "import", "in", "indirect", "infix", "init", "inline", "inout", "instanceof", "int", "interface", "internal", "IsoDateTimeOffsetConverter", "iterable", "is", "jdec", "jenc", "jpipe", "json", "json_converter", "json_serializer", "json_token", "json_writer", "JSONAny", "JSONCodingKey", "JSONDecoder", "JSONEncoder", "JsonException", "JsonGenerator", "JsonNode", "JSONNull", "JsonParser", "JsonReader", "JsonTokenType", "lambda", "lazy", "left", "let", "list", "Locale", "lock", "long", "map", "MarshalJSON", "MapEntry", "metadata_property_handling", "module", "mutable", "mutating", "namespace", "native", "new", "newtonsoft", "nil", "NO", "noexcept", "nonatomic", "none", "None", "nonlocal", "nonmutating", "NSObject", "noSuchMethod", "not", "not_eq", "NSError", "NSString", "NULL", "null", "nullptr", "number", "object", "ObjectMapper", "of", "oneway", "open", "operator", "optional", "or", "or_eq", "out", "override", "package", "params", "pass", "port", "postfix", "precedence", "prefix", "print", "printf", "printMembers", "private", "protected", "Protocol", "protocol", "public", "quicktype", "raise", "range", "readonly", "ref", "RegExp", "register", "reinterpret_cast", "repeat", "require", "required", "requires", "restrict", "retain", "rethrows", "return", "right", "runtimeType", "s", "sbyte", "sealed", "SEL", "select", "Self", "Serializable", "self", "Sendable", "serialize", "SerialName", "KSerializer", "PrimitiveKind", "SerialDescriptor", "SerializerProvider", "set", "short", "signed", "SimpleModule", "sizeof", "stackalloc", "Standards", "static", "static_assert", "static_cast", "StdDeserializer", "StdSerializer", "strictfp", "string", "struct", "subscript", "super", "switch", "symbol", "synchronized", "system", "template", "then", "this", "thread_local", "throw", "throws", "TimeOnly", "TimeOnlyConverter", "TimeZone", "to_json", "top_level", "toString", "to_dict", "transient", "True", "true", "try", "Type", "type", "typealias", "typedef", "typeid", "typename", "typeof", "uint", "ulong", "unchecked", "undefined", "union", "UnmarshalJSON", "UseSerializers", "unowned", "unsafe", "unsigned", "ushort", "using", "Utf8JsonReader", "Utf8JsonWriter", "UUID", "var", "virtual", "void", "volatile", "wchar_t", "weak", "where", "while", "willSet", "with", "xor", "xor_eq", "YES", "yield", "dummy")
2121 end
2222
2323 module Enum
@@ -142,6 +142,7 @@ module Enum
142142 FormatException = "FormatException"
143143 Friend = "friend"
144144 From = "from"
145+ FromDict = "from_dict"
145146 FromJSON = "from_json"
146147 Func = "func"
147148 Function = "function"
@@ -201,6 +202,7 @@ module Enum
201202 Lock = "lock"
202203 Long = "long"
203204 Map = "map"
205+ MarshalJSON = "MarshalJSON"
204206 MapEntry = "MapEntry"
205207 MetadataPropertyHandling = "metadata_property_handling"
206208 Module = "module"
@@ -320,6 +322,7 @@ module Enum
320322 ToJSON = "to_json"
321323 TopLevel = "top_level"
322324 ToString = "toString"
325+ ToDict = "to_dict"
323326 Transient = "transient"
324327 True = "True"
325328 EnumTrue = "true"
@@ -336,6 +339,7 @@ module Enum
336339 Unchecked = "unchecked"
337340 Undefined = "undefined"
338341 Union = "union"
342+ UnmarshalJSON = "UnmarshalJSON"
339343 UseSerializers = "UseSerializers"
340344 Unowned = "unowned"
341345 Unsafe = "unsafe"
Mschema-rustdefault / module_under_test.rs+12 −0
@@ -305,6 +305,9 @@ pub enum Enum {
305305
306306 From,
307307
308+ #[serde(rename = "from_dict")]
309+ FromDict,
310+
308311 #[serde(rename = "from_json")]
309312 FromJson,
310313
@@ -446,6 +449,9 @@ pub enum Enum {
446449
447450 Map,
448451
452+ #[serde(rename = "MarshalJSON")]
453+ MarshalJson,
454+
449455 #[serde(rename = "MapEntry")]
450456 MapEntry,
451457
@@ -729,6 +735,9 @@ pub enum Enum {
729735 #[serde(rename = "toString")]
730736 ToString,
731737
738+ #[serde(rename = "to_dict")]
739+ ToDict,
740+
732741 Transient,
733742
734743 #[serde(rename = "True")]
@@ -765,6 +774,9 @@ pub enum Enum {
765774
766775 Union,
767776
777+ #[serde(rename = "UnmarshalJSON")]
778+ UnmarshalJson,
779+
768780 #[serde(rename = "UseSerializers")]
769781 UseSerializers,
Mschema-scala3-upickledefault / TopLevel.scala+12 −0
@@ -204,6 +204,7 @@ enum EnumEnum :
204204 case FormatException
205205 case Friend
206206 case From
207+ case FromDict
207208 case FromJSON
208209 case Func
209210 case Function
@@ -263,6 +264,7 @@ enum EnumEnum :
263264 case Lock
264265 case EnumLong
265266 case EnumMap
267+ case MarshalJSON
266268 case MapEntry
267269 case MetadataPropertyHandling
268270 case Module
@@ -382,6 +384,7 @@ enum EnumEnum :
382384 case ToJSON
383385 case TopLevel
384386 case ToString
387+ case ToDict
385388 case Transient
386389 case True
387390 case EnumTrue
@@ -398,6 +401,7 @@ enum EnumEnum :
398401 case Unchecked
399402 case Undefined
400403 case Union
404+ case UnmarshalJSON
401405 case UseSerializers
402406 case Unowned
403407 case Unsafe
@@ -546,6 +550,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
546550 case EnumEnum.FormatException => "FormatException"
547551 case EnumEnum.Friend => "friend"
548552 case EnumEnum.From => "from"
553+ case EnumEnum.FromDict => "from_dict"
549554 case EnumEnum.FromJSON => "from_json"
550555 case EnumEnum.Func => "func"
551556 case EnumEnum.Function => "function"
@@ -605,6 +610,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
605610 case EnumEnum.Lock => "lock"
606611 case EnumEnum.EnumLong => "long"
607612 case EnumEnum.EnumMap => "map"
613+ case EnumEnum.MarshalJSON => "MarshalJSON"
608614 case EnumEnum.MapEntry => "MapEntry"
609615 case EnumEnum.MetadataPropertyHandling => "metadata_property_handling"
610616 case EnumEnum.Module => "module"
@@ -724,6 +730,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
724730 case EnumEnum.ToJSON => "to_json"
725731 case EnumEnum.TopLevel => "top_level"
726732 case EnumEnum.ToString => "toString"
733+ case EnumEnum.ToDict => "to_dict"
727734 case EnumEnum.Transient => "transient"
728735 case EnumEnum.True => "True"
729736 case EnumEnum.EnumTrue => "true"
@@ -740,6 +747,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
740747 case EnumEnum.Unchecked => "unchecked"
741748 case EnumEnum.Undefined => "undefined"
742749 case EnumEnum.Union => "union"
750+ case EnumEnum.UnmarshalJSON => "UnmarshalJSON"
743751 case EnumEnum.UseSerializers => "UseSerializers"
744752 case EnumEnum.Unowned => "unowned"
745753 case EnumEnum.Unsafe => "unsafe"
@@ -887,6 +895,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
887895 case "FormatException" => EnumEnum.FormatException
888896 case "friend" => EnumEnum.Friend
889897 case "from" => EnumEnum.From
898+ case "from_dict" => EnumEnum.FromDict
890899 case "from_json" => EnumEnum.FromJSON
891900 case "func" => EnumEnum.Func
892901 case "function" => EnumEnum.Function
@@ -946,6 +955,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
946955 case "lock" => EnumEnum.Lock
947956 case "long" => EnumEnum.EnumLong
948957 case "map" => EnumEnum.EnumMap
958+ case "MarshalJSON" => EnumEnum.MarshalJSON
949959 case "MapEntry" => EnumEnum.MapEntry
950960 case "metadata_property_handling" => EnumEnum.MetadataPropertyHandling
951961 case "module" => EnumEnum.Module
@@ -1065,6 +1075,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
10651075 case "to_json" => EnumEnum.ToJSON
10661076 case "top_level" => EnumEnum.TopLevel
10671077 case "toString" => EnumEnum.ToString
1078+ case "to_dict" => EnumEnum.ToDict
10681079 case "transient" => EnumEnum.Transient
10691080 case "True" => EnumEnum.True
10701081 case "true" => EnumEnum.EnumTrue
@@ -1081,6 +1092,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
10811092 case "unchecked" => EnumEnum.Unchecked
10821093 case "undefined" => EnumEnum.Undefined
10831094 case "union" => EnumEnum.Union
1095+ case "UnmarshalJSON" => EnumEnum.UnmarshalJSON
10841096 case "UseSerializers" => EnumEnum.UseSerializers
10851097 case "unowned" => EnumEnum.Unowned
10861098 case "unsafe" => EnumEnum.Unsafe
Mschema-scala3default / TopLevel.scala+12 −0
@@ -133,6 +133,7 @@ enum EnumEnum :
133133 case FormatException
134134 case Friend
135135 case From
136+ case FromDict
136137 case FromJSON
137138 case Func
138139 case Function
@@ -192,6 +193,7 @@ enum EnumEnum :
192193 case Lock
193194 case EnumLong
194195 case EnumMap
196+ case MarshalJSON
195197 case MapEntry
196198 case MetadataPropertyHandling
197199 case Module
@@ -311,6 +313,7 @@ enum EnumEnum :
311313 case ToJSON
312314 case TopLevel
313315 case ToString
316+ case ToDict
314317 case Transient
315318 case True
316319 case EnumTrue
@@ -327,6 +330,7 @@ enum EnumEnum :
327330 case Unchecked
328331 case Undefined
329332 case Union
333+ case UnmarshalJSON
330334 case UseSerializers
331335 case Unowned
332336 case Unsafe
@@ -474,6 +478,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap {
474478 case "FormatException" => scala.Right(EnumEnum.FormatException)
475479 case "friend" => scala.Right(EnumEnum.Friend)
476480 case "from" => scala.Right(EnumEnum.From)
481+ case "from_dict" => scala.Right(EnumEnum.FromDict)
477482 case "from_json" => scala.Right(EnumEnum.FromJSON)
478483 case "func" => scala.Right(EnumEnum.Func)
479484 case "function" => scala.Right(EnumEnum.Function)
@@ -533,6 +538,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap {
533538 case "lock" => scala.Right(EnumEnum.Lock)
534539 case "long" => scala.Right(EnumEnum.EnumLong)
535540 case "map" => scala.Right(EnumEnum.EnumMap)
541+ case "MarshalJSON" => scala.Right(EnumEnum.MarshalJSON)
536542 case "MapEntry" => scala.Right(EnumEnum.MapEntry)
537543 case "metadata_property_handling" => scala.Right(EnumEnum.MetadataPropertyHandling)
538544 case "module" => scala.Right(EnumEnum.Module)
@@ -652,6 +658,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap {
652658 case "to_json" => scala.Right(EnumEnum.ToJSON)
653659 case "top_level" => scala.Right(EnumEnum.TopLevel)
654660 case "toString" => scala.Right(EnumEnum.ToString)
661+ case "to_dict" => scala.Right(EnumEnum.ToDict)
655662 case "transient" => scala.Right(EnumEnum.Transient)
656663 case "True" => scala.Right(EnumEnum.True)
657664 case "true" => scala.Right(EnumEnum.EnumTrue)
@@ -668,6 +675,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap {
668675 case "unchecked" => scala.Right(EnumEnum.Unchecked)
669676 case "undefined" => scala.Right(EnumEnum.Undefined)
670677 case "union" => scala.Right(EnumEnum.Union)
678+ case "UnmarshalJSON" => scala.Right(EnumEnum.UnmarshalJSON)
671679 case "UseSerializers" => scala.Right(EnumEnum.UseSerializers)
672680 case "unowned" => scala.Right(EnumEnum.Unowned)
673681 case "unsafe" => scala.Right(EnumEnum.Unsafe)
@@ -816,6 +824,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap {
816824 case EnumEnum.FormatException => "FormatException"
817825 case EnumEnum.Friend => "friend"
818826 case EnumEnum.From => "from"
827+ case EnumEnum.FromDict => "from_dict"
819828 case EnumEnum.FromJSON => "from_json"
820829 case EnumEnum.Func => "func"
821830 case EnumEnum.Function => "function"
@@ -875,6 +884,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap {
875884 case EnumEnum.Lock => "lock"
876885 case EnumEnum.EnumLong => "long"
877886 case EnumEnum.EnumMap => "map"
887+ case EnumEnum.MarshalJSON => "MarshalJSON"
878888 case EnumEnum.MapEntry => "MapEntry"
879889 case EnumEnum.MetadataPropertyHandling => "metadata_property_handling"
880890 case EnumEnum.Module => "module"
@@ -994,6 +1004,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap {
9941004 case EnumEnum.ToJSON => "to_json"
9951005 case EnumEnum.TopLevel => "top_level"
9961006 case EnumEnum.ToString => "toString"
1007+ case EnumEnum.ToDict => "to_dict"
9971008 case EnumEnum.Transient => "transient"
9981009 case EnumEnum.True => "True"
9991010 case EnumEnum.EnumTrue => "true"
@@ -1010,6 +1021,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap {
10101021 case EnumEnum.Unchecked => "unchecked"
10111022 case EnumEnum.Undefined => "undefined"
10121023 case EnumEnum.Union => "union"
1024+ case EnumEnum.UnmarshalJSON => "UnmarshalJSON"
10131025 case EnumEnum.UseSerializers => "UseSerializers"
10141026 case EnumEnum.Unowned => "unowned"
10151027 case EnumEnum.Unsafe => "unsafe"
Mschema-schemadefault / TopLevel.schema+4 −0
@@ -137,6 +137,7 @@
137137 "FormatException",
138138 "friend",
139139 "from",
140+ "from_dict",
140141 "from_json",
141142 "func",
142143 "function",
@@ -196,6 +197,7 @@
196197 "lock",
197198 "long",
198199 "map",
200+ "MarshalJSON",
199201 "MapEntry",
200202 "metadata_property_handling",
201203 "module",
@@ -315,6 +317,7 @@
315317 "to_json",
316318 "top_level",
317319 "toString",
320+ "to_dict",
318321 "transient",
319322 "True",
320323 "true",
@@ -331,6 +334,7 @@
331334 "unchecked",
332335 "undefined",
333336 "union",
337+ "UnmarshalJSON",
334338 "UseSerializers",
335339 "unowned",
336340 "unsafe",
Mschema-swiftdefault / quicktype.swift+4 −0
@@ -171,6 +171,7 @@ enum Enum: String, Codable {
171171 case formatException = "FormatException"
172172 case friend = "friend"
173173 case from = "from"
174+ case fromDict = "from_dict"
174175 case fromJSON = "from_json"
175176 case enumFunc = "func"
176177 case function = "function"
@@ -230,6 +231,7 @@ enum Enum: String, Codable {
230231 case lock = "lock"
231232 case long = "long"
232233 case map = "map"
234+ case marshalJSON = "MarshalJSON"
233235 case mapEntry = "MapEntry"
234236 case metadataPropertyHandling = "metadata_property_handling"
235237 case module = "module"
@@ -349,6 +351,7 @@ enum Enum: String, Codable {
349351 case toJSON = "to_json"
350352 case topLevel = "top_level"
351353 case toString = "toString"
354+ case toDict = "to_dict"
352355 case transient = "transient"
353356 case enumTrue = "True"
354357 case purpleTrue = "true"
@@ -365,6 +368,7 @@ enum Enum: String, Codable {
365368 case unchecked = "unchecked"
366369 case undefined = "undefined"
367370 case union = "union"
371+ case unmarshalJSON = "UnmarshalJSON"
368372 case useSerializers = "UseSerializers"
369373 case enumUnowned = "unowned"
370374 case unsafe = "unsafe"
Mschema-typescript-effect-schemadefault / TopLevel.ts+4 −0
@@ -123,6 +123,7 @@ export const Enum = S.Literal(
123123 "FormatException",
124124 "friend",
125125 "from",
126+ "from_dict",
126127 "from_json",
127128 "func",
128129 "function",
@@ -182,6 +183,7 @@ export const Enum = S.Literal(
182183 "lock",
183184 "long",
184185 "map",
186+ "MarshalJSON",
185187 "MapEntry",
186188 "metadata_property_handling",
187189 "module",
@@ -301,6 +303,7 @@ export const Enum = S.Literal(
301303 "to_json",
302304 "top_level",
303305 "toString",
306+ "to_dict",
304307 "transient",
305308 "True",
306309 "true",
@@ -317,6 +320,7 @@ export const Enum = S.Literal(
317320 "unchecked",
318321 "undefined",
319322 "union",
323+ "UnmarshalJSON",
320324 "UseSerializers",
321325 "unowned",
322326 "unsafe",
Mschema-typescript-zoddefault / TopLevel.ts+4 −0
@@ -123,6 +123,7 @@ export const EnumSchema = z.enum([
123123 "FormatException",
124124 "friend",
125125 "from",
126+ "from_dict",
126127 "from_json",
127128 "func",
128129 "function",
@@ -182,6 +183,7 @@ export const EnumSchema = z.enum([
182183 "lock",
183184 "long",
184185 "map",
186+ "MarshalJSON",
185187 "MapEntry",
186188 "metadata_property_handling",
187189 "module",
@@ -301,6 +303,7 @@ export const EnumSchema = z.enum([
301303 "to_json",
302304 "top_level",
303305 "toString",
306+ "to_dict",
304307 "transient",
305308 "True",
306309 "true",
@@ -317,6 +320,7 @@ export const EnumSchema = z.enum([
317320 "unchecked",
318321 "undefined",
319322 "union",
323+ "UnmarshalJSON",
320324 "UseSerializers",
321325 "unowned",
322326 "unsafe",
Mschema-typescriptdefault / TopLevel.ts+7 −3
@@ -12,7 +12,7 @@ export interface TopLevel {
1212 [property: string]: unknown;
1313 }
1414
15-export type Enum = "_" | "_Bool" | "_Complex" | "_Imaginery" | "abstract" | "alignas" | "alignof" | "and" | "and_eq" | "any" | "Any" | "array" | "as" | "asm" | "assert" | "associatedtype" | "associativity" | "async" | "atomic" | "atomic_cancel" | "atomic_commit" | "atomic_noexcept" | "auto" | "await" | "base" | "bitand" | "bitor" | "BOOL" | "bool" | "boolean" | "break" | "bycopy" | "byref" | "byte" | "Calendar" | "case" | "catch" | "chan" | "char" | "char16_t" | "char32_t" | "checked" | "class" | "Class" | "clone" | "co_await" | "co_return" | "co_yield" | "Codable" | "CodingKey" | "CodingKeys" | "compl" | "concept" | "console" | "const" | "const_cast" | "constexpr" | "constructor" | "continue" | "convenience" | "convert" | "converter" | "CultureInfo" | "date" | "date_parse_handling" | "DateFormatter" | "DateOnly" | "DateOnlyConverter" | "DateTime" | "DateTimeStyles" | "debugger" | "decimal" | "declare" | "decltype" | "decode_string" | "Decoder" | "DecodingError" | "def" | "default" | "defer" | "deinit" | "del" | "delegate" | "delete" | "dict" | "dictionary" | "didSet" | "do" | "double" | "dynamic" | "dynamic_cast" | "elif" | "else" | "encode_quick_type" | "Encoder" | "enum" | "EnumValues" | "Equatable" | "equalityContract" | "event" | "except" | "exception" | "explicit" | "export" | "exposing" | "extends" | "extension" | "extern" | "fallthrough" | "false" | "False" | "fileprivate" | "final" | "finally" | "fixed" | "float" | "for" | "foreach" | "FormatException" | "friend" | "from" | "from_json" | "func" | "function" | "get" | "global" | "go" | "goto" | "guard" | "Hashable" | "hashCode" | "Hasher" | "hasOwnProperty" | "id" | "if" | "IMP" | "implements" | "implicit" | "import" | "in" | "indirect" | "infix" | "init" | "inline" | "inout" | "instanceof" | "int" | "interface" | "internal" | "IsoDateTimeOffsetConverter" | "iterable" | "is" | "jdec" | "jenc" | "jpipe" | "json" | "json_converter" | "json_serializer" | "json_token" | "json_writer" | "JSONAny" | "JSONCodingKey" | "JSONDecoder" | "JSONEncoder" | "JsonException" | "JsonGenerator" | "JsonNode" | "JSONNull" | "JsonParser" | "JsonReader" | "JsonTokenType" | "lambda" | "lazy" | "left" | "let" | "list" | "Locale" | "lock" | "long" | "map" | "MapEntry" | "metadata_property_handling" | "module" | "mutable" | "mutating" | "namespace" | "native" | "new" | "newtonsoft" | "nil" | "NO" | "noexcept" | "nonatomic" | "none" | "None" | "nonlocal" | "nonmutating" | "NSObject" | "noSuchMethod" | "not" | "not_eq" | "NSError" | "NSString" | "NULL" | "null" | "nullptr" | "number" | "object" | "ObjectMapper" | "of" | "oneway" | "open" | "operator" | "optional" | "or" | "or_eq" | "out" | "override" | "package" | "params" | "pass" | "port" | "postfix" | "precedence" | "prefix" | "print" | "printf" | "printMembers" | "private" | "protected" | "Protocol" | "protocol" | "public" | "quicktype" | "raise" | "range" | "readonly" | "ref" | "RegExp" | "register" | "reinterpret_cast" | "repeat" | "require" | "required" | "requires" | "restrict" | "retain" | "rethrows" | "return" | "right" | "runtimeType" | "s" | "sbyte" | "sealed" | "SEL" | "select" | "Self" | "Serializable" | "self" | "Sendable" | "serialize" | "SerialName" | "KSerializer" | "PrimitiveKind" | "SerialDescriptor" | "SerializerProvider" | "set" | "short" | "signed" | "SimpleModule" | "sizeof" | "stackalloc" | "Standards" | "static" | "static_assert" | "static_cast" | "StdDeserializer" | "StdSerializer" | "strictfp" | "string" | "struct" | "subscript" | "super" | "switch" | "symbol" | "synchronized" | "system" | "template" | "then" | "this" | "thread_local" | "throw" | "throws" | "TimeOnly" | "TimeOnlyConverter" | "TimeZone" | "to_json" | "top_level" | "toString" | "transient" | "True" | "true" | "try" | "Type" | "type" | "typealias" | "typedef" | "typeid" | "typename" | "typeof" | "uint" | "ulong" | "unchecked" | "undefined" | "union" | "UseSerializers" | "unowned" | "unsafe" | "unsigned" | "ushort" | "using" | "Utf8JsonReader" | "Utf8JsonWriter" | "UUID" | "var" | "virtual" | "void" | "volatile" | "wchar_t" | "weak" | "where" | "while" | "willSet" | "with" | "xor" | "xor_eq" | "YES" | "yield" | "dummy";
15+export type Enum = "_" | "_Bool" | "_Complex" | "_Imaginery" | "abstract" | "alignas" | "alignof" | "and" | "and_eq" | "any" | "Any" | "array" | "as" | "asm" | "assert" | "associatedtype" | "associativity" | "async" | "atomic" | "atomic_cancel" | "atomic_commit" | "atomic_noexcept" | "auto" | "await" | "base" | "bitand" | "bitor" | "BOOL" | "bool" | "boolean" | "break" | "bycopy" | "byref" | "byte" | "Calendar" | "case" | "catch" | "chan" | "char" | "char16_t" | "char32_t" | "checked" | "class" | "Class" | "clone" | "co_await" | "co_return" | "co_yield" | "Codable" | "CodingKey" | "CodingKeys" | "compl" | "concept" | "console" | "const" | "const_cast" | "constexpr" | "constructor" | "continue" | "convenience" | "convert" | "converter" | "CultureInfo" | "date" | "date_parse_handling" | "DateFormatter" | "DateOnly" | "DateOnlyConverter" | "DateTime" | "DateTimeStyles" | "debugger" | "decimal" | "declare" | "decltype" | "decode_string" | "Decoder" | "DecodingError" | "def" | "default" | "defer" | "deinit" | "del" | "delegate" | "delete" | "dict" | "dictionary" | "didSet" | "do" | "double" | "dynamic" | "dynamic_cast" | "elif" | "else" | "encode_quick_type" | "Encoder" | "enum" | "EnumValues" | "Equatable" | "equalityContract" | "event" | "except" | "exception" | "explicit" | "export" | "exposing" | "extends" | "extension" | "extern" | "fallthrough" | "false" | "False" | "fileprivate" | "final" | "finally" | "fixed" | "float" | "for" | "foreach" | "FormatException" | "friend" | "from" | "from_dict" | "from_json" | "func" | "function" | "get" | "global" | "go" | "goto" | "guard" | "Hashable" | "hashCode" | "Hasher" | "hasOwnProperty" | "id" | "if" | "IMP" | "implements" | "implicit" | "import" | "in" | "indirect" | "infix" | "init" | "inline" | "inout" | "instanceof" | "int" | "interface" | "internal" | "IsoDateTimeOffsetConverter" | "iterable" | "is" | "jdec" | "jenc" | "jpipe" | "json" | "json_converter" | "json_serializer" | "json_token" | "json_writer" | "JSONAny" | "JSONCodingKey" | "JSONDecoder" | "JSONEncoder" | "JsonException" | "JsonGenerator" | "JsonNode" | "JSONNull" | "JsonParser" | "JsonReader" | "JsonTokenType" | "lambda" | "lazy" | "left" | "let" | "list" | "Locale" | "lock" | "long" | "map" | "MarshalJSON" | "MapEntry" | "metadata_property_handling" | "module" | "mutable" | "mutating" | "namespace" | "native" | "new" | "newtonsoft" | "nil" | "NO" | "noexcept" | "nonatomic" | "none" | "None" | "nonlocal" | "nonmutating" | "NSObject" | "noSuchMethod" | "not" | "not_eq" | "NSError" | "NSString" | "NULL" | "null" | "nullptr" | "number" | "object" | "ObjectMapper" | "of" | "oneway" | "open" | "operator" | "optional" | "or" | "or_eq" | "out" | "override" | "package" | "params" | "pass" | "port" | "postfix" | "precedence" | "prefix" | "print" | "printf" | "printMembers" | "private" | "protected" | "Protocol" | "protocol" | "public" | "quicktype" | "raise" | "range" | "readonly" | "ref" | "RegExp" | "register" | "reinterpret_cast" | "repeat" | "require" | "required" | "requires" | "restrict" | "retain" | "rethrows" | "return" | "right" | "runtimeType" | "s" | "sbyte" | "sealed" | "SEL" | "select" | "Self" | "Serializable" | "self" | "Sendable" | "serialize" | "SerialName" | "KSerializer" | "PrimitiveKind" | "SerialDescriptor" | "SerializerProvider" | "set" | "short" | "signed" | "SimpleModule" | "sizeof" | "stackalloc" | "Standards" | "static" | "static_assert" | "static_cast" | "StdDeserializer" | "StdSerializer" | "strictfp" | "string" | "struct" | "subscript" | "super" | "switch" | "symbol" | "synchronized" | "system" | "template" | "then" | "this" | "thread_local" | "throw" | "throws" | "TimeOnly" | "TimeOnlyConverter" | "TimeZone" | "to_json" | "top_level" | "toString" | "to_dict" | "transient" | "True" | "true" | "try" | "Type" | "type" | "typealias" | "typedef" | "typeid" | "typename" | "typeof" | "uint" | "ulong" | "unchecked" | "undefined" | "union" | "UnmarshalJSON" | "UseSerializers" | "unowned" | "unsafe" | "unsigned" | "ushort" | "using" | "Utf8JsonReader" | "Utf8JsonWriter" | "UUID" | "var" | "virtual" | "void" | "volatile" | "wchar_t" | "weak" | "where" | "while" | "willSet" | "with" | "xor" | "xor_eq" | "YES" | "yield" | "dummy";
1616
1717 // Converts JSON strings to/from your types
1818 // and asserts the results of JSON.parse at runtime
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
@@ -326,6 +326,7 @@ const typeMap: any = {
326326 "FormatException",
327327 "friend",
328328 "from",
329+ "from_dict",
329330 "from_json",
330331 "func",
331332 "function",
@@ -385,6 +386,7 @@ const typeMap: any = {
385386 "lock",
386387 "long",
387388 "map",
389+ "MarshalJSON",
388390 "MapEntry",
389391 "metadata_property_handling",
390392 "module",
@@ -504,6 +506,7 @@ const typeMap: any = {
504506 "to_json",
505507 "top_level",
506508 "toString",
509+ "to_dict",
507510 "transient",
508511 "True",
509512 "true",
@@ -520,6 +523,7 @@ const typeMap: any = {
520523 "unchecked",
521524 "undefined",
522525 "union",
526+ "UnmarshalJSON",
523527 "UseSerializers",
524528 "unowned",
525529 "unsafe",
Test case

test/inputs/schema/keyword-unions.schema

55 generated files · +4,943 −231
Mschema-cjsondefault / TopLevel.c+416 −0
@@ -3173,6 +3173,50 @@ void cJSON_DeleteUnionFrom(struct UnionFrom * x) {
31733173 }
31743174 }
31753175
3176+struct UnionFromDict * cJSON_GetUnionFromDictValue(const cJSON * j) {
3177+ struct UnionFromDict * x = cJSON_malloc(sizeof(struct UnionFromDict));
3178+ if (NULL != x) {
3179+ memset(x, 0, sizeof(struct UnionFromDict));
3180+ if (cJSON_IsNumber(j)) {
3181+ x->type = cJSON_Number;
3182+ x->value.number = cJSON_GetNumberValue(j);
3183+ }
3184+ else if (cJSON_IsObject(j)) {
3185+ x->type = cJSON_Object;
3186+ x->value.from_dict = cJSON_GetFromDictValue(j);
3187+ if (NULL == x->value.from_dict) x->type = 0;
3188+ }
3189+ if (0 == x->type) { cJSON_free(x); return NULL; }
3190+ }
3191+ return x;
3192+}
3193+struct UnionFromDict * cJSON_ParseUnionFromDict(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionFromDict * x = j ? cJSON_GetUnionFromDictValue(j) : NULL; cJSON_Delete(j); return x; }
3194+char * cJSON_PrintUnionFromDict(const struct UnionFromDict * x) { cJSON * j = cJSON_CreateUnionFromDict(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; }
3195+
3196+cJSON * cJSON_CreateUnionFromDict(const struct UnionFromDict * x) {
3197+ cJSON * j = NULL;
3198+ if (NULL != x) {
3199+ if (cJSON_Number == x->type) {
3200+ j = cJSON_CreateNumber(x->value.number);
3201+ }
3202+ else if (cJSON_Object == x->type) {
3203+ j = cJSON_CreateFromDict(x->value.from_dict);
3204+ }
3205+ }
3206+ return j;
3207+}
3208+
3209+void cJSON_DeleteUnionFromDict(struct UnionFromDict * x) {
3210+ if (NULL != x) {
3211+ if (cJSON_Number == x->type) {
3212+ }
3213+ else if (cJSON_Object == x->type) {
3214+ cJSON_DeleteFromDict(x->value.from_dict);
3215+ }
3216+ cJSON_free(x);
3217+ }
3218+}
3219+
31763220 struct UnionFromJson * cJSON_GetUnionFromJsonValue(const cJSON * j) {
31773221 struct UnionFromJson * x = cJSON_malloc(sizeof(struct UnionFromJson));
31783222 if (NULL != x) {
@@ -5637,6 +5681,50 @@ void cJSON_DeleteUnionMapEntry(struct UnionMapEntry * x) {
56375681 }
56385682 }
56395683
5684+struct UnionMarshalJson * cJSON_GetUnionMarshalJsonValue(const cJSON * j) {
5685+ struct UnionMarshalJson * x = cJSON_malloc(sizeof(struct UnionMarshalJson));
5686+ if (NULL != x) {
5687+ memset(x, 0, sizeof(struct UnionMarshalJson));
5688+ if (cJSON_IsNumber(j)) {
5689+ x->type = cJSON_Number;
5690+ x->value.number = cJSON_GetNumberValue(j);
5691+ }
5692+ else if (cJSON_IsObject(j)) {
5693+ x->type = cJSON_Object;
5694+ x->value.marshal_json = cJSON_GetMarshalJsonValue(j);
5695+ if (NULL == x->value.marshal_json) x->type = 0;
5696+ }
5697+ if (0 == x->type) { cJSON_free(x); return NULL; }
5698+ }
5699+ return x;
5700+}
5701+struct UnionMarshalJson * cJSON_ParseUnionMarshalJson(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionMarshalJson * x = j ? cJSON_GetUnionMarshalJsonValue(j) : NULL; cJSON_Delete(j); return x; }
5702+char * cJSON_PrintUnionMarshalJson(const struct UnionMarshalJson * x) { cJSON * j = cJSON_CreateUnionMarshalJson(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; }
5703+
5704+cJSON * cJSON_CreateUnionMarshalJson(const struct UnionMarshalJson * x) {
5705+ cJSON * j = NULL;
5706+ if (NULL != x) {
5707+ if (cJSON_Number == x->type) {
5708+ j = cJSON_CreateNumber(x->value.number);
5709+ }
5710+ else if (cJSON_Object == x->type) {
5711+ j = cJSON_CreateMarshalJson(x->value.marshal_json);
5712+ }
5713+ }
5714+ return j;
5715+}
5716+
5717+void cJSON_DeleteUnionMarshalJson(struct UnionMarshalJson * x) {
5718+ if (NULL != x) {
5719+ if (cJSON_Number == x->type) {
5720+ }
5721+ else if (cJSON_Object == x->type) {
5722+ cJSON_DeleteMarshalJson(x->value.marshal_json);
5723+ }
5724+ cJSON_free(x);
5725+ }
5726+}
5727+
56405728 struct UnionMetadataPropertyHandling * cJSON_GetUnionMetadataPropertyHandlingValue(const cJSON * j) {
56415729 struct UnionMetadataPropertyHandling * x = cJSON_malloc(sizeof(struct UnionMetadataPropertyHandling));
56425730 if (NULL != x) {
@@ -9201,6 +9289,50 @@ void cJSON_DeleteUnionTimeZone(struct UnionTimeZone * x) {
92019289 }
92029290 }
92039291
9292+struct UnionToDict * cJSON_GetUnionToDictValue(const cJSON * j) {
9293+ struct UnionToDict * x = cJSON_malloc(sizeof(struct UnionToDict));
9294+ if (NULL != x) {
9295+ memset(x, 0, sizeof(struct UnionToDict));
9296+ if (cJSON_IsNumber(j)) {
9297+ x->type = cJSON_Number;
9298+ x->value.number = cJSON_GetNumberValue(j);
9299+ }
9300+ else if (cJSON_IsObject(j)) {
9301+ x->type = cJSON_Object;
9302+ x->value.to_dict = cJSON_GetToDictValue(j);
9303+ if (NULL == x->value.to_dict) x->type = 0;
9304+ }
9305+ if (0 == x->type) { cJSON_free(x); return NULL; }
9306+ }
9307+ return x;
9308+}
9309+struct UnionToDict * cJSON_ParseUnionToDict(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionToDict * x = j ? cJSON_GetUnionToDictValue(j) : NULL; cJSON_Delete(j); return x; }
9310+char * cJSON_PrintUnionToDict(const struct UnionToDict * x) { cJSON * j = cJSON_CreateUnionToDict(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; }
9311+
9312+cJSON * cJSON_CreateUnionToDict(const struct UnionToDict * x) {
9313+ cJSON * j = NULL;
9314+ if (NULL != x) {
9315+ if (cJSON_Number == x->type) {
9316+ j = cJSON_CreateNumber(x->value.number);
9317+ }
9318+ else if (cJSON_Object == x->type) {
9319+ j = cJSON_CreateToDict(x->value.to_dict);
9320+ }
9321+ }
9322+ return j;
9323+}
9324+
9325+void cJSON_DeleteUnionToDict(struct UnionToDict * x) {
9326+ if (NULL != x) {
9327+ if (cJSON_Number == x->type) {
9328+ }
9329+ else if (cJSON_Object == x->type) {
9330+ cJSON_DeleteToDict(x->value.to_dict);
9331+ }
9332+ cJSON_free(x);
9333+ }
9334+}
9335+
92049336 struct UnionToJson * cJSON_GetUnionToJsonValue(const cJSON * j) {
92059337 struct UnionToJson * x = cJSON_malloc(sizeof(struct UnionToJson));
92069338 if (NULL != x) {
@@ -14261,6 +14393,50 @@ void cJSON_DeleteUnionUndefined(struct UnionUndefined * x) {
1426114393 }
1426214394 }
1426314395
14396+struct UnionUnmarshalJson * cJSON_GetUnionUnmarshalJsonValue(const cJSON * j) {
14397+ struct UnionUnmarshalJson * x = cJSON_malloc(sizeof(struct UnionUnmarshalJson));
14398+ if (NULL != x) {
14399+ memset(x, 0, sizeof(struct UnionUnmarshalJson));
14400+ if (cJSON_IsNumber(j)) {
14401+ x->type = cJSON_Number;
14402+ x->value.number = cJSON_GetNumberValue(j);
14403+ }
14404+ else if (cJSON_IsObject(j)) {
14405+ x->type = cJSON_Object;
14406+ x->value.unmarshal_json = cJSON_GetUnmarshalJsonValue(j);
14407+ if (NULL == x->value.unmarshal_json) x->type = 0;
14408+ }
14409+ if (0 == x->type) { cJSON_free(x); return NULL; }
14410+ }
14411+ return x;
14412+}
14413+struct UnionUnmarshalJson * cJSON_ParseUnionUnmarshalJson(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionUnmarshalJson * x = j ? cJSON_GetUnionUnmarshalJsonValue(j) : NULL; cJSON_Delete(j); return x; }
14414+char * cJSON_PrintUnionUnmarshalJson(const struct UnionUnmarshalJson * x) { cJSON * j = cJSON_CreateUnionUnmarshalJson(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; }
14415+
14416+cJSON * cJSON_CreateUnionUnmarshalJson(const struct UnionUnmarshalJson * x) {
14417+ cJSON * j = NULL;
14418+ if (NULL != x) {
14419+ if (cJSON_Number == x->type) {
14420+ j = cJSON_CreateNumber(x->value.number);
14421+ }
14422+ else if (cJSON_Object == x->type) {
14423+ j = cJSON_CreateUnmarshalJson(x->value.unmarshal_json);
14424+ }
14425+ }
14426+ return j;
14427+}
14428+
14429+void cJSON_DeleteUnionUnmarshalJson(struct UnionUnmarshalJson * x) {
14430+ if (NULL != x) {
14431+ if (cJSON_Number == x->type) {
14432+ }
14433+ else if (cJSON_Object == x->type) {
14434+ cJSON_DeleteUnmarshalJson(x->value.unmarshal_json);
14435+ }
14436+ cJSON_free(x);
14437+ }
14438+}
14439+
1426414440 struct UnionUnowned * cJSON_GetUnionUnownedValue(const cJSON * j) {
1426514441 struct UnionUnowned * x = cJSON_malloc(sizeof(struct UnionUnowned));
1426614442 if (NULL != x) {
@@ -18405,6 +18581,55 @@ void cJSON_DeleteFrom(struct From * x) {
1840518581 }
1840618582 }
1840718583
18584+struct FromDict * cJSON_ParseFromDict(const char * s) {
18585+ struct FromDict * x = NULL;
18586+ if (NULL != s) {
18587+ cJSON * j = cJSON_Parse(s);
18588+ if (NULL != j) {
18589+ x = cJSON_GetFromDictValue(j);
18590+ cJSON_Delete(j);
18591+ }
18592+ }
18593+ return x;
18594+}
18595+
18596+struct FromDict * cJSON_GetFromDictValue(const cJSON * j) {
18597+ struct FromDict * x = NULL;
18598+ if (NULL != j) {
18599+ if (NULL != (x = cJSON_malloc(sizeof(struct FromDict)))) {
18600+ memset(x, 0, sizeof(struct FromDict));
18601+ }
18602+ }
18603+ return x;
18604+}
18605+
18606+cJSON * cJSON_CreateFromDict(const struct FromDict * x) {
18607+ cJSON * j = NULL;
18608+ if (NULL != x) {
18609+ if (NULL != (j = cJSON_CreateObject())) {
18610+ }
18611+ }
18612+ return j;
18613+}
18614+
18615+char * cJSON_PrintFromDict(const struct FromDict * x) {
18616+ char * s = NULL;
18617+ if (NULL != x) {
18618+ cJSON * j = cJSON_CreateFromDict(x);
18619+ if (NULL != j) {
18620+ s = cJSON_Print(j);
18621+ cJSON_Delete(j);
18622+ }
18623+ }
18624+ return s;
18625+}
18626+
18627+void cJSON_DeleteFromDict(struct FromDict * x) {
18628+ if (NULL != x) {
18629+ cJSON_free(x);
18630+ }
18631+}
18632+
1840818633 struct FromJson * cJSON_ParseFromJson(const char * s) {
1840918634 struct FromJson * x = NULL;
1841018635 if (NULL != s) {
@@ -21149,6 +21374,55 @@ void cJSON_DeleteMapEntry(struct MapEntry * x) {
2114921374 }
2115021375 }
2115121376
21377+struct MarshalJson * cJSON_ParseMarshalJson(const char * s) {
21378+ struct MarshalJson * x = NULL;
21379+ if (NULL != s) {
21380+ cJSON * j = cJSON_Parse(s);
21381+ if (NULL != j) {
21382+ x = cJSON_GetMarshalJsonValue(j);
21383+ cJSON_Delete(j);
21384+ }
21385+ }
21386+ return x;
21387+}
21388+
21389+struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j) {
21390+ struct MarshalJson * x = NULL;
21391+ if (NULL != j) {
21392+ if (NULL != (x = cJSON_malloc(sizeof(struct MarshalJson)))) {
21393+ memset(x, 0, sizeof(struct MarshalJson));
21394+ }
21395+ }
21396+ return x;
21397+}
21398+
21399+cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x) {
21400+ cJSON * j = NULL;
21401+ if (NULL != x) {
21402+ if (NULL != (j = cJSON_CreateObject())) {
21403+ }
21404+ }
21405+ return j;
21406+}
21407+
21408+char * cJSON_PrintMarshalJson(const struct MarshalJson * x) {
21409+ char * s = NULL;
21410+ if (NULL != x) {
21411+ cJSON * j = cJSON_CreateMarshalJson(x);
21412+ if (NULL != j) {
21413+ s = cJSON_Print(j);
21414+ cJSON_Delete(j);
21415+ }
21416+ }
21417+ return s;
21418+}
21419+
21420+void cJSON_DeleteMarshalJson(struct MarshalJson * x) {
21421+ if (NULL != x) {
21422+ cJSON_free(x);
21423+ }
21424+}
21425+
2115221426 struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s) {
2115321427 struct MetadataPropertyHandling * x = NULL;
2115421428 if (NULL != s) {
@@ -25118,6 +25392,55 @@ void cJSON_DeleteTimeZone(struct TimeZone * x) {
2511825392 }
2511925393 }
2512025394
25395+struct ToDict * cJSON_ParseToDict(const char * s) {
25396+ struct ToDict * x = NULL;
25397+ if (NULL != s) {
25398+ cJSON * j = cJSON_Parse(s);
25399+ if (NULL != j) {
25400+ x = cJSON_GetToDictValue(j);
25401+ cJSON_Delete(j);
25402+ }
25403+ }
25404+ return x;
25405+}
25406+
25407+struct ToDict * cJSON_GetToDictValue(const cJSON * j) {
25408+ struct ToDict * x = NULL;
25409+ if (NULL != j) {
25410+ if (NULL != (x = cJSON_malloc(sizeof(struct ToDict)))) {
25411+ memset(x, 0, sizeof(struct ToDict));
25412+ }
25413+ }
25414+ return x;
25415+}
25416+
25417+cJSON * cJSON_CreateToDict(const struct ToDict * x) {
25418+ cJSON * j = NULL;
25419+ if (NULL != x) {
25420+ if (NULL != (j = cJSON_CreateObject())) {
25421+ }
25422+ }
25423+ return j;
25424+}
25425+
25426+char * cJSON_PrintToDict(const struct ToDict * x) {
25427+ char * s = NULL;
25428+ if (NULL != x) {
25429+ cJSON * j = cJSON_CreateToDict(x);
25430+ if (NULL != j) {
25431+ s = cJSON_Print(j);
25432+ cJSON_Delete(j);
25433+ }
25434+ }
25435+ return s;
25436+}
25437+
25438+void cJSON_DeleteToDict(struct ToDict * x) {
25439+ if (NULL != x) {
25440+ cJSON_free(x);
25441+ }
25442+}
25443+
2512125444 struct ToJson * cJSON_ParseToJson(const char * s) {
2512225445 struct ToJson * x = NULL;
2512325446 if (NULL != s) {
@@ -30753,6 +31076,55 @@ void cJSON_DeleteUndefined(struct Undefined * x) {
3075331076 }
3075431077 }
3075531078
31079+struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s) {
31080+ struct UnmarshalJson * x = NULL;
31081+ if (NULL != s) {
31082+ cJSON * j = cJSON_Parse(s);
31083+ if (NULL != j) {
31084+ x = cJSON_GetUnmarshalJsonValue(j);
31085+ cJSON_Delete(j);
31086+ }
31087+ }
31088+ return x;
31089+}
31090+
31091+struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j) {
31092+ struct UnmarshalJson * x = NULL;
31093+ if (NULL != j) {
31094+ if (NULL != (x = cJSON_malloc(sizeof(struct UnmarshalJson)))) {
31095+ memset(x, 0, sizeof(struct UnmarshalJson));
31096+ }
31097+ }
31098+ return x;
31099+}
31100+
31101+cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x) {
31102+ cJSON * j = NULL;
31103+ if (NULL != x) {
31104+ if (NULL != (j = cJSON_CreateObject())) {
31105+ }
31106+ }
31107+ return j;
31108+}
31109+
31110+char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x) {
31111+ char * s = NULL;
31112+ if (NULL != x) {
31113+ cJSON * j = cJSON_CreateUnmarshalJson(x);
31114+ if (NULL != j) {
31115+ s = cJSON_Print(j);
31116+ cJSON_Delete(j);
31117+ }
31118+ }
31119+ return s;
31120+}
31121+
31122+void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x) {
31123+ if (NULL != x) {
31124+ cJSON_free(x);
31125+ }
31126+}
31127+
3075631128 struct Unowned * cJSON_ParseUnowned(const char * s) {
3075731129 struct Unowned * x = NULL;
3075831130 if (NULL != s) {
@@ -32067,6 +32439,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
3206732439 x->from = cJSON_GetUnionFromValue(cJSON_GetObjectItemCaseSensitive(j, "from"));
3206832440 if (NULL == x->from) { cJSON_DeleteTopLevel(x); return NULL; }
3206932441 }
32442+ if (cJSON_HasObjectItem(j, "from_dict")) {
32443+ if (!cJSON_IsUnionFromDict(cJSON_GetObjectItemCaseSensitive(j, "from_dict"))) { cJSON_DeleteTopLevel(x); return NULL; }
32444+ x->from_dict = cJSON_GetUnionFromDictValue(cJSON_GetObjectItemCaseSensitive(j, "from_dict"));
32445+ if (NULL == x->from_dict) { cJSON_DeleteTopLevel(x); return NULL; }
32446+ }
3207032447 if (cJSON_HasObjectItem(j, "from_json")) {
3207132448 if (!cJSON_IsUnionFromJson(cJSON_GetObjectItemCaseSensitive(j, "from_json"))) { cJSON_DeleteTopLevel(x); return NULL; }
3207232449 x->from_json = cJSON_GetUnionFromJsonValue(cJSON_GetObjectItemCaseSensitive(j, "from_json"));
@@ -32372,6 +32749,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
3237232749 x->map_entry = cJSON_GetUnionMapEntryValue(cJSON_GetObjectItemCaseSensitive(j, "MapEntry"));
3237332750 if (NULL == x->map_entry) { cJSON_DeleteTopLevel(x); return NULL; }
3237432751 }
32752+ if (cJSON_HasObjectItem(j, "MarshalJSON")) {
32753+ if (!cJSON_IsUnionMarshalJson(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"))) { cJSON_DeleteTopLevel(x); return NULL; }
32754+ x->marshal_json = cJSON_GetUnionMarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"));
32755+ if (NULL == x->marshal_json) { cJSON_DeleteTopLevel(x); return NULL; }
32756+ }
3237532757 if (cJSON_HasObjectItem(j, "metadata_property_handling")) {
3237632758 if (!cJSON_IsUnionMetadataPropertyHandling(cJSON_GetObjectItemCaseSensitive(j, "metadata_property_handling"))) { cJSON_DeleteTopLevel(x); return NULL; }
3237732759 x->metadata_property_handling = cJSON_GetUnionMetadataPropertyHandlingValue(cJSON_GetObjectItemCaseSensitive(j, "metadata_property_handling"));
@@ -32942,6 +33324,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
3294233324 x->time_zone = cJSON_GetUnionTimeZoneValue(cJSON_GetObjectItemCaseSensitive(j, "TimeZone"));
3294333325 if (NULL == x->time_zone) { cJSON_DeleteTopLevel(x); return NULL; }
3294433326 }
33327+ if (cJSON_HasObjectItem(j, "to_dict")) {
33328+ if (!cJSON_IsUnionToDict(cJSON_GetObjectItemCaseSensitive(j, "to_dict"))) { cJSON_DeleteTopLevel(x); return NULL; }
33329+ x->to_dict = cJSON_GetUnionToDictValue(cJSON_GetObjectItemCaseSensitive(j, "to_dict"));
33330+ if (NULL == x->to_dict) { cJSON_DeleteTopLevel(x); return NULL; }
33331+ }
3294533332 if (cJSON_HasObjectItem(j, "to_json")) {
3294633333 if (!cJSON_IsUnionToJson(cJSON_GetObjectItemCaseSensitive(j, "to_json"))) { cJSON_DeleteTopLevel(x); return NULL; }
3294733334 x->to_json = cJSON_GetUnionToJsonValue(cJSON_GetObjectItemCaseSensitive(j, "to_json"));
@@ -33037,6 +33424,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
3303733424 x->top_level_union = cJSON_GetUnionUnionUnionValue(cJSON_GetObjectItemCaseSensitive(j, "union"));
3303833425 if (NULL == x->top_level_union) { cJSON_DeleteTopLevel(x); return NULL; }
3303933426 }
33427+ if (cJSON_HasObjectItem(j, "UnmarshalJSON")) {
33428+ if (!cJSON_IsUnionUnmarshalJson(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"))) { cJSON_DeleteTopLevel(x); return NULL; }
33429+ x->unmarshal_json = cJSON_GetUnionUnmarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"));
33430+ if (NULL == x->unmarshal_json) { cJSON_DeleteTopLevel(x); return NULL; }
33431+ }
3304033432 if (cJSON_HasObjectItem(j, "unowned")) {
3304133433 if (!cJSON_IsUnionUnowned(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteTopLevel(x); return NULL; }
3304233434 x->unowned = cJSON_GetUnionUnownedValue(cJSON_GetObjectItemCaseSensitive(j, "unowned"));
@@ -33527,6 +33919,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
3352733919 if (NULL != x->from) {
3352833920 cJSON_AddItemToObject(j, "from", cJSON_CreateUnionFrom(x->from));
3352933921 }
33922+ if (NULL != x->from_dict) {
33923+ cJSON_AddItemToObject(j, "from_dict", cJSON_CreateUnionFromDict(x->from_dict));
33924+ }
3353033925 if (NULL != x->from_json) {
3353133926 cJSON_AddItemToObject(j, "from_json", cJSON_CreateUnionFromJson(x->from_json));
3353233927 }
@@ -33710,6 +34105,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
3371034105 if (NULL != x->map_entry) {
3371134106 cJSON_AddItemToObject(j, "MapEntry", cJSON_CreateUnionMapEntry(x->map_entry));
3371234107 }
34108+ if (NULL != x->marshal_json) {
34109+ cJSON_AddItemToObject(j, "MarshalJSON", cJSON_CreateUnionMarshalJson(x->marshal_json));
34110+ }
3371334111 if (NULL != x->metadata_property_handling) {
3371434112 cJSON_AddItemToObject(j, "metadata_property_handling", cJSON_CreateUnionMetadataPropertyHandling(x->metadata_property_handling));
3371534113 }
@@ -34052,6 +34450,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
3405234450 if (NULL != x->time_zone) {
3405334451 cJSON_AddItemToObject(j, "TimeZone", cJSON_CreateUnionTimeZone(x->time_zone));
3405434452 }
34453+ if (NULL != x->to_dict) {
34454+ cJSON_AddItemToObject(j, "to_dict", cJSON_CreateUnionToDict(x->to_dict));
34455+ }
3405534456 if (NULL != x->to_json) {
3405634457 cJSON_AddItemToObject(j, "to_json", cJSON_CreateUnionToJson(x->to_json));
3405734458 }
@@ -34109,6 +34510,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
3410934510 if (NULL != x->top_level_union) {
3411034511 cJSON_AddItemToObject(j, "union", cJSON_CreateUnionUnionUnion(x->top_level_union));
3411134512 }
34513+ if (NULL != x->unmarshal_json) {
34514+ cJSON_AddItemToObject(j, "UnmarshalJSON", cJSON_CreateUnionUnmarshalJson(x->unmarshal_json));
34515+ }
3411234516 if (NULL != x->unowned) {
3411334517 cJSON_AddItemToObject(j, "unowned", cJSON_CreateUnionUnowned(x->unowned));
3411434518 }
@@ -34563,6 +34967,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) {
3456334967 if (NULL != x->from) {
3456434968 cJSON_DeleteUnionFrom(x->from);
3456534969 }
34970+ if (NULL != x->from_dict) {
34971+ cJSON_DeleteUnionFromDict(x->from_dict);
34972+ }
3456634973 if (NULL != x->from_json) {
3456734974 cJSON_DeleteUnionFromJson(x->from_json);
3456834975 }
@@ -34746,6 +35153,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) {
3474635153 if (NULL != x->map_entry) {
3474735154 cJSON_DeleteUnionMapEntry(x->map_entry);
3474835155 }
35156+ if (NULL != x->marshal_json) {
35157+ cJSON_DeleteUnionMarshalJson(x->marshal_json);
35158+ }
3474935159 if (NULL != x->metadata_property_handling) {
3475035160 cJSON_DeleteUnionMetadataPropertyHandling(x->metadata_property_handling);
3475135161 }
@@ -35088,6 +35498,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) {
3508835498 if (NULL != x->time_zone) {
3508935499 cJSON_DeleteUnionTimeZone(x->time_zone);
3509035500 }
35501+ if (NULL != x->to_dict) {
35502+ cJSON_DeleteUnionToDict(x->to_dict);
35503+ }
3509135504 if (NULL != x->to_json) {
3509235505 cJSON_DeleteUnionToJson(x->to_json);
3509335506 }
@@ -35145,6 +35558,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) {
3514535558 if (NULL != x->top_level_union) {
3514635559 cJSON_DeleteUnionUnionUnion(x->top_level_union);
3514735560 }
35561+ if (NULL != x->unmarshal_json) {
35562+ cJSON_DeleteUnionUnmarshalJson(x->unmarshal_json);
35563+ }
3514835564 if (NULL != x->unowned) {
3514935565 cJSON_DeleteUnionUnowned(x->unowned);
3515035566 }
Mschema-cjsondefault / TopLevel.h+100 −0
@@ -840,6 +840,17 @@ struct UnionFrom {
840840 } value;
841841 };
842842
843+struct FromDict {
844+};
845+
846+struct UnionFromDict {
847+ int type;
848+ union {
849+ double number;
850+ struct FromDict * from_dict;
851+ } value;
852+};
853+
843854 struct FromJson {
844855 };
845856
@@ -1456,6 +1467,17 @@ struct UnionMapEntry {
14561467 } value;
14571468 };
14581469
1470+struct MarshalJson {
1471+};
1472+
1473+struct UnionMarshalJson {
1474+ int type;
1475+ union {
1476+ double number;
1477+ struct MarshalJson * marshal_json;
1478+ } value;
1479+};
1480+
14591481 struct MetadataPropertyHandling {
14601482 };
14611483
@@ -2347,6 +2369,17 @@ struct UnionTimeZone {
23472369 } value;
23482370 };
23492371
2372+struct ToDict {
2373+};
2374+
2375+struct UnionToDict {
2376+ int type;
2377+ union {
2378+ double number;
2379+ struct ToDict * to_dict;
2380+ } value;
2381+};
2382+
23502383 struct ToJson {
23512384 };
23522385
@@ -3612,6 +3645,17 @@ struct UnionUndefined {
36123645 } value;
36133646 };
36143647
3648+struct UnmarshalJson {
3649+};
3650+
3651+struct UnionUnmarshalJson {
3652+ int type;
3653+ union {
3654+ double number;
3655+ struct UnmarshalJson * unmarshal_json;
3656+ } value;
3657+};
3658+
36153659 struct Unowned {
36163660 };
36173661
@@ -3889,6 +3933,7 @@ struct TopLevel {
38893933 struct UnionFormatException * format_exception;
38903934 struct UnionFriend * top_level_friend;
38913935 struct UnionFrom * from;
3936+ struct UnionFromDict * from_dict;
38923937 struct UnionFromJson * from_json;
38933938 struct UnionFunc * func;
38943939 struct UnionFunction * function;
@@ -3950,6 +3995,7 @@ struct TopLevel {
39503995 struct UnionLong * top_level_long;
39513996 struct UnionMap * map;
39523997 struct UnionMapEntry * map_entry;
3998+ struct UnionMarshalJson * marshal_json;
39533999 struct UnionMetadataPropertyHandling * metadata_property_handling;
39544000 struct UnionModule * top_level_module;
39554001 struct UnionMutable * top_level_mutable;
@@ -4064,6 +4110,7 @@ struct TopLevel {
40644110 struct UnionTimeOnly * time_only;
40654111 struct UnionTimeOnlyConverter * time_only_converter;
40664112 struct UnionTimeZone * time_zone;
4113+ struct UnionToDict * to_dict;
40674114 struct UnionToJson * to_json;
40684115 struct UnionTopLevel * top_level;
40694116 struct UnionToString * to_string;
@@ -4083,6 +4130,7 @@ struct TopLevel {
40834130 struct UnionUnchecked * unchecked;
40844131 struct UnionUndefined * undefined;
40854132 struct UnionUnionUnion * top_level_union;
4133+ struct UnionUnmarshalJson * unmarshal_json;
40864134 struct UnionUnowned * unowned;
40874135 struct UnionUnsafe * unsafe;
40884136 struct UnionUnsigned * top_level_unsigned;
@@ -4612,6 +4660,13 @@ void cJSON_DeleteUnionFrom(struct UnionFrom * x);
46124660 struct UnionFrom * cJSON_ParseUnionFrom(const char * s);
46134661 char * cJSON_PrintUnionFrom(const struct UnionFrom * x);
46144662
4663+#define cJSON_IsUnionFromDict(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
4664+struct UnionFromDict * cJSON_GetUnionFromDictValue(const cJSON * j);
4665+cJSON * cJSON_CreateUnionFromDict(const struct UnionFromDict * x);
4666+void cJSON_DeleteUnionFromDict(struct UnionFromDict * x);
4667+struct UnionFromDict * cJSON_ParseUnionFromDict(const char * s);
4668+char * cJSON_PrintUnionFromDict(const struct UnionFromDict * x);
4669+
46154670 #define cJSON_IsUnionFromJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
46164671 struct UnionFromJson * cJSON_GetUnionFromJsonValue(const cJSON * j);
46174672 cJSON * cJSON_CreateUnionFromJson(const struct UnionFromJson * x);
@@ -5004,6 +5059,13 @@ void cJSON_DeleteUnionMapEntry(struct UnionMapEntry * x);
50045059 struct UnionMapEntry * cJSON_ParseUnionMapEntry(const char * s);
50055060 char * cJSON_PrintUnionMapEntry(const struct UnionMapEntry * x);
50065061
5062+#define cJSON_IsUnionMarshalJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
5063+struct UnionMarshalJson * cJSON_GetUnionMarshalJsonValue(const cJSON * j);
5064+cJSON * cJSON_CreateUnionMarshalJson(const struct UnionMarshalJson * x);
5065+void cJSON_DeleteUnionMarshalJson(struct UnionMarshalJson * x);
5066+struct UnionMarshalJson * cJSON_ParseUnionMarshalJson(const char * s);
5067+char * cJSON_PrintUnionMarshalJson(const struct UnionMarshalJson * x);
5068+
50075069 #define cJSON_IsUnionMetadataPropertyHandling(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
50085070 struct UnionMetadataPropertyHandling * cJSON_GetUnionMetadataPropertyHandlingValue(const cJSON * j);
50095071 cJSON * cJSON_CreateUnionMetadataPropertyHandling(const struct UnionMetadataPropertyHandling * x);
@@ -5571,6 +5633,13 @@ void cJSON_DeleteUnionTimeZone(struct UnionTimeZone * x);
55715633 struct UnionTimeZone * cJSON_ParseUnionTimeZone(const char * s);
55725634 char * cJSON_PrintUnionTimeZone(const struct UnionTimeZone * x);
55735635
5636+#define cJSON_IsUnionToDict(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
5637+struct UnionToDict * cJSON_GetUnionToDictValue(const cJSON * j);
5638+cJSON * cJSON_CreateUnionToDict(const struct UnionToDict * x);
5639+void cJSON_DeleteUnionToDict(struct UnionToDict * x);
5640+struct UnionToDict * cJSON_ParseUnionToDict(const char * s);
5641+char * cJSON_PrintUnionToDict(const struct UnionToDict * x);
5642+
55745643 #define cJSON_IsUnionToJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
55755644 struct UnionToJson * cJSON_GetUnionToJsonValue(const cJSON * j);
55765645 cJSON * cJSON_CreateUnionToJson(const struct UnionToJson * x);
@@ -6376,6 +6445,13 @@ void cJSON_DeleteUnionUndefined(struct UnionUndefined * x);
63766445 struct UnionUndefined * cJSON_ParseUnionUndefined(const char * s);
63776446 char * cJSON_PrintUnionUndefined(const struct UnionUndefined * x);
63786447
6448+#define cJSON_IsUnionUnmarshalJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
6449+struct UnionUnmarshalJson * cJSON_GetUnionUnmarshalJsonValue(const cJSON * j);
6450+cJSON * cJSON_CreateUnionUnmarshalJson(const struct UnionUnmarshalJson * x);
6451+void cJSON_DeleteUnionUnmarshalJson(struct UnionUnmarshalJson * x);
6452+struct UnionUnmarshalJson * cJSON_ParseUnionUnmarshalJson(const char * s);
6453+char * cJSON_PrintUnionUnmarshalJson(const struct UnionUnmarshalJson * x);
6454+
63796455 #define cJSON_IsUnionUnowned(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
63806456 struct UnionUnowned * cJSON_GetUnionUnownedValue(const cJSON * j);
63816457 cJSON * cJSON_CreateUnionUnowned(const struct UnionUnowned * x);
@@ -6906,6 +6982,12 @@ cJSON * cJSON_CreateFrom(const struct From * x);
69066982 char * cJSON_PrintFrom(const struct From * x);
69076983 void cJSON_DeleteFrom(struct From * x);
69086984
6985+struct FromDict * cJSON_ParseFromDict(const char * s);
6986+struct FromDict * cJSON_GetFromDictValue(const cJSON * j);
6987+cJSON * cJSON_CreateFromDict(const struct FromDict * x);
6988+char * cJSON_PrintFromDict(const struct FromDict * x);
6989+void cJSON_DeleteFromDict(struct FromDict * x);
6990+
69096991 struct FromJson * cJSON_ParseFromJson(const char * s);
69106992 struct FromJson * cJSON_GetFromJsonValue(const cJSON * j);
69116993 cJSON * cJSON_CreateFromJson(const struct FromJson * x);
@@ -7242,6 +7324,12 @@ cJSON * cJSON_CreateMapEntry(const struct MapEntry * x);
72427324 char * cJSON_PrintMapEntry(const struct MapEntry * x);
72437325 void cJSON_DeleteMapEntry(struct MapEntry * x);
72447326
7327+struct MarshalJson * cJSON_ParseMarshalJson(const char * s);
7328+struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j);
7329+cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x);
7330+char * cJSON_PrintMarshalJson(const struct MarshalJson * x);
7331+void cJSON_DeleteMarshalJson(struct MarshalJson * x);
7332+
72457333 struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s);
72467334 struct MetadataPropertyHandling * cJSON_GetMetadataPropertyHandlingValue(const cJSON * j);
72477335 cJSON * cJSON_CreateMetadataPropertyHandling(const struct MetadataPropertyHandling * x);
@@ -7728,6 +7816,12 @@ cJSON * cJSON_CreateTimeZone(const struct TimeZone * x);
77287816 char * cJSON_PrintTimeZone(const struct TimeZone * x);
77297817 void cJSON_DeleteTimeZone(struct TimeZone * x);
77307818
7819+struct ToDict * cJSON_ParseToDict(const char * s);
7820+struct ToDict * cJSON_GetToDictValue(const cJSON * j);
7821+cJSON * cJSON_CreateToDict(const struct ToDict * x);
7822+char * cJSON_PrintToDict(const struct ToDict * x);
7823+void cJSON_DeleteToDict(struct ToDict * x);
7824+
77317825 struct ToJson * cJSON_ParseToJson(const char * s);
77327826 struct ToJson * cJSON_GetToJsonValue(const cJSON * j);
77337827 cJSON * cJSON_CreateToJson(const struct ToJson * x);
@@ -8418,6 +8512,12 @@ cJSON * cJSON_CreateUndefined(const struct Undefined * x);
84188512 char * cJSON_PrintUndefined(const struct Undefined * x);
84198513 void cJSON_DeleteUndefined(struct Undefined * x);
84208514
8515+struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s);
8516+struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j);
8517+cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x);
8518+char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x);
8519+void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x);
8520+
84218521 struct Unowned * cJSON_ParseUnowned(const char * s);
84228522 struct Unowned * cJSON_GetUnownedValue(const cJSON * j);
84238523 cJSON * cJSON_CreateUnowned(const struct Unowned * x);
Mschema-cplusplusdefault / quicktype.hpp+240 −0
@@ -953,6 +953,18 @@ namespace quicktype {
953953
954954 using UnionFrom = std::variant<From, double>;
955955
956+ class FromDict {
957+ public:
958+ FromDict() = default;
959+ virtual ~FromDict() = default;
960+
961+ private:
962+
963+ public:
964+ };
965+
966+ using UnionFromDict = std::variant<FromDict, double>;
967+
956968 class FromJson {
957969 public:
958970 FromJson() = default;
@@ -1625,6 +1637,18 @@ namespace quicktype {
16251637
16261638 using UnionMapEntry = std::variant<MapEntry, double>;
16271639
1640+ class MarshalJson {
1641+ public:
1642+ MarshalJson() = default;
1643+ virtual ~MarshalJson() = default;
1644+
1645+ private:
1646+
1647+ public:
1648+ };
1649+
1650+ using UnionMarshalJson = std::variant<MarshalJson, double>;
1651+
16281652 class MetadataPropertyHandling {
16291653 public:
16301654 MetadataPropertyHandling() = default;
@@ -2609,6 +2633,18 @@ namespace quicktype {
26092633
26102634 using UnionTimeZone = std::variant<TimeZone, double>;
26112635
2636+ class ToDict {
2637+ public:
2638+ ToDict() = default;
2639+ virtual ~ToDict() = default;
2640+
2641+ private:
2642+
2643+ public:
2644+ };
2645+
2646+ using UnionToDict = std::variant<ToDict, double>;
2647+
26122648 class ToJson {
26132649 public:
26142650 ToJson() = default;
@@ -3977,6 +4013,18 @@ namespace quicktype {
39774013
39784014 using UnionUndefined = std::variant<Undefined, double>;
39794015
4016+ class UnmarshalJson {
4017+ public:
4018+ UnmarshalJson() = default;
4019+ virtual ~UnmarshalJson() = default;
4020+
4021+ private:
4022+
4023+ public:
4024+ };
4025+
4026+ using UnionUnmarshalJson = std::variant<UnmarshalJson, double>;
4027+
39804028 class Unowned {
39814029 public:
39824030 Unowned() = default;
@@ -4273,6 +4321,7 @@ namespace quicktype {
42734321 std::optional<UnionFormatException> format_exception;
42744322 std::optional<UnionFriend> top_level_friend;
42754323 std::optional<UnionFrom> from;
4324+ std::optional<UnionFromDict> from_dict;
42764325 std::optional<UnionFromJson> from_json;
42774326 std::optional<UnionFunc> func;
42784327 std::optional<UnionFunction> function;
@@ -4334,6 +4383,7 @@ namespace quicktype {
43344383 std::optional<UnionLong> top_level_long;
43354384 std::optional<UnionMap> map;
43364385 std::optional<UnionMapEntry> map_entry;
4386+ std::optional<UnionMarshalJson> marshal_json;
43374387 std::optional<UnionMetadataPropertyHandling> metadata_property_handling;
43384388 std::optional<UnionModule> top_level_module;
43394389 std::optional<UnionMutable> top_level_mutable;
@@ -4448,6 +4498,7 @@ namespace quicktype {
44484498 std::optional<UnionTimeOnly> time_only;
44494499 std::optional<UnionTimeOnlyConverter> time_only_converter;
44504500 std::optional<UnionTimeZone> time_zone;
4501+ std::optional<UnionToDict> to_dict;
44514502 std::optional<UnionToJson> to_json;
44524503 std::optional<UnionTopLevel> top_level;
44534504 std::optional<UnionToString> to_string;
@@ -4467,6 +4518,7 @@ namespace quicktype {
44674518 std::optional<UnionUnchecked> unchecked;
44684519 std::optional<UnionUndefined> undefined;
44694520 std::optional<UnionUnionUnion> top_level_union;
4521+ std::optional<UnionUnmarshalJson> unmarshal_json;
44704522 std::optional<UnionUnowned> unowned;
44714523 std::optional<UnionUnsafe> unsafe;
44724524 std::optional<UnionUnsigned> top_level_unsigned;
@@ -4980,6 +5032,10 @@ namespace quicktype {
49805032 std::optional<UnionFrom> & get_mutable_from() { return from; }
49815033 void set_from(const std::optional<UnionFrom> & value) { this->from = value; }
49825034
5035+ const std::optional<UnionFromDict> & get_from_dict() const { return from_dict; }
5036+ std::optional<UnionFromDict> & get_mutable_from_dict() { return from_dict; }
5037+ void set_from_dict(const std::optional<UnionFromDict> & value) { this->from_dict = value; }
5038+
49835039 const std::optional<UnionFromJson> & get_from_json() const { return from_json; }
49845040 std::optional<UnionFromJson> & get_mutable_from_json() { return from_json; }
49855041 void set_from_json(const std::optional<UnionFromJson> & value) { this->from_json = value; }
@@ -5224,6 +5280,10 @@ namespace quicktype {
52245280 std::optional<UnionMapEntry> & get_mutable_map_entry() { return map_entry; }
52255281 void set_map_entry(const std::optional<UnionMapEntry> & value) { this->map_entry = value; }
52265282
5283+ const std::optional<UnionMarshalJson> & get_marshal_json() const { return marshal_json; }
5284+ std::optional<UnionMarshalJson> & get_mutable_marshal_json() { return marshal_json; }
5285+ void set_marshal_json(const std::optional<UnionMarshalJson> & value) { this->marshal_json = value; }
5286+
52275287 const std::optional<UnionMetadataPropertyHandling> & get_metadata_property_handling() const { return metadata_property_handling; }
52285288 std::optional<UnionMetadataPropertyHandling> & get_mutable_metadata_property_handling() { return metadata_property_handling; }
52295289 void set_metadata_property_handling(const std::optional<UnionMetadataPropertyHandling> & value) { this->metadata_property_handling = value; }
@@ -5680,6 +5740,10 @@ namespace quicktype {
56805740 std::optional<UnionTimeZone> & get_mutable_time_zone() { return time_zone; }
56815741 void set_time_zone(const std::optional<UnionTimeZone> & value) { this->time_zone = value; }
56825742
5743+ const std::optional<UnionToDict> & get_to_dict() const { return to_dict; }
5744+ std::optional<UnionToDict> & get_mutable_to_dict() { return to_dict; }
5745+ void set_to_dict(const std::optional<UnionToDict> & value) { this->to_dict = value; }
5746+
56835747 const std::optional<UnionToJson> & get_to_json() const { return to_json; }
56845748 std::optional<UnionToJson> & get_mutable_to_json() { return to_json; }
56855749 void set_to_json(const std::optional<UnionToJson> & value) { this->to_json = value; }
@@ -5756,6 +5820,10 @@ namespace quicktype {
57565820 std::optional<UnionUnionUnion> & get_mutable_top_level_union() { return top_level_union; }
57575821 void set_top_level_union(const std::optional<UnionUnionUnion> & value) { this->top_level_union = value; }
57585822
5823+ const std::optional<UnionUnmarshalJson> & get_unmarshal_json() const { return unmarshal_json; }
5824+ std::optional<UnionUnmarshalJson> & get_mutable_unmarshal_json() { return unmarshal_json; }
5825+ void set_unmarshal_json(const std::optional<UnionUnmarshalJson> & value) { this->unmarshal_json = value; }
5826+
57595827 const std::optional<UnionUnowned> & get_unowned() const { return unowned; }
57605828 std::optional<UnionUnowned> & get_mutable_unowned() { return unowned; }
57615829 void set_unowned(const std::optional<UnionUnowned> & value) { this->unowned = value; }
@@ -6067,6 +6135,9 @@ void to_json(json & j, const FormatException & x);
60676135 void from_json(const json & j, From & x);
60686136 void to_json(json & j, const From & x);
60696137
6138+void from_json(const json & j, FromDict & x);
6139+void to_json(json & j, const FromDict & x);
6140+
60706141 void from_json(const json & j, FromJson & x);
60716142 void to_json(json & j, const FromJson & x);
60726143
@@ -6235,6 +6306,9 @@ void to_json(json & j, const Map & x);
62356306 void from_json(const json & j, MapEntry & x);
62366307 void to_json(json & j, const MapEntry & x);
62376308
6309+void from_json(const json & j, MarshalJson & x);
6310+void to_json(json & j, const MarshalJson & x);
6311+
62386312 void from_json(const json & j, MetadataPropertyHandling & x);
62396313 void to_json(json & j, const MetadataPropertyHandling & x);
62406314
@@ -6481,6 +6555,9 @@ void to_json(json & j, const TimeOnlyConverter & x);
64816555 void from_json(const json & j, TimeZone & x);
64826556 void to_json(json & j, const TimeZone & x);
64836557
6558+void from_json(const json & j, ToDict & x);
6559+void to_json(json & j, const ToDict & x);
6560+
64846561 void from_json(const json & j, ToJson & x);
64856562 void to_json(json & j, const ToJson & x);
64866563
@@ -6823,6 +6900,9 @@ void to_json(json & j, const Unchecked & x);
68236900 void from_json(const json & j, Undefined & x);
68246901 void to_json(json & j, const Undefined & x);
68256902
6903+void from_json(const json & j, UnmarshalJson & x);
6904+void to_json(json & j, const UnmarshalJson & x);
6905+
68266906 void from_json(const json & j, Unowned & x);
68276907 void to_json(json & j, const Unowned & x);
68286908
@@ -7301,6 +7381,12 @@ struct adl_serializer<std::variant<quicktype::From, double>> {
73017381 static void to_json(json & j, const std::variant<quicktype::From, double> & x);
73027382 };
73037383
7384+template <>
7385+struct adl_serializer<std::variant<quicktype::FromDict, double>> {
7386+ static void from_json(const json & j, std::variant<quicktype::FromDict, double> & x);
7387+ static void to_json(json & j, const std::variant<quicktype::FromDict, double> & x);
7388+};
7389+
73047390 template <>
73057391 struct adl_serializer<std::variant<quicktype::FromJson, double>> {
73067392 static void from_json(const json & j, std::variant<quicktype::FromJson, double> & x);
@@ -7637,6 +7723,12 @@ struct adl_serializer<std::variant<quicktype::MapEntry, double>> {
76377723 static void to_json(json & j, const std::variant<quicktype::MapEntry, double> & x);
76387724 };
76397725
7726+template <>
7727+struct adl_serializer<std::variant<quicktype::MarshalJson, double>> {
7728+ static void from_json(const json & j, std::variant<quicktype::MarshalJson, double> & x);
7729+ static void to_json(json & j, const std::variant<quicktype::MarshalJson, double> & x);
7730+};
7731+
76407732 template <>
76417733 struct adl_serializer<std::variant<quicktype::MetadataPropertyHandling, double>> {
76427734 static void from_json(const json & j, std::variant<quicktype::MetadataPropertyHandling, double> & x);
@@ -8129,6 +8221,12 @@ struct adl_serializer<std::variant<quicktype::TimeZone, double>> {
81298221 static void to_json(json & j, const std::variant<quicktype::TimeZone, double> & x);
81308222 };
81318223
8224+template <>
8225+struct adl_serializer<std::variant<quicktype::ToDict, double>> {
8226+ static void from_json(const json & j, std::variant<quicktype::ToDict, double> & x);
8227+ static void to_json(json & j, const std::variant<quicktype::ToDict, double> & x);
8228+};
8229+
81328230 template <>
81338231 struct adl_serializer<std::variant<quicktype::ToJson, double>> {
81348232 static void from_json(const json & j, std::variant<quicktype::ToJson, double> & x);
@@ -8813,6 +8911,12 @@ struct adl_serializer<std::variant<quicktype::Undefined, double>> {
88138911 static void to_json(json & j, const std::variant<quicktype::Undefined, double> & x);
88148912 };
88158913
8914+template <>
8915+struct adl_serializer<std::variant<quicktype::UnmarshalJson, double>> {
8916+ static void from_json(const json & j, std::variant<quicktype::UnmarshalJson, double> & x);
8917+ static void to_json(json & j, const std::variant<quicktype::UnmarshalJson, double> & x);
8918+};
8919+
88168920 template <>
88178921 struct adl_serializer<std::variant<quicktype::Unowned, double>> {
88188922 static void from_json(const json & j, std::variant<quicktype::Unowned, double> & x);
@@ -9690,6 +9794,17 @@ namespace quicktype {
96909794 (void)x;
96919795 }
96929796
9797+ inline void from_json(const json & j, FromDict& x) {
9798+ if (!j.is_object()) throw std::runtime_error("Expected object");
9799+ (void)j;
9800+ (void)x;
9801+ }
9802+
9803+ inline void to_json(json & j, const FromDict & x) {
9804+ j = json::object();
9805+ (void)x;
9806+ }
9807+
96939808 inline void from_json(const json & j, FromJson& x) {
96949809 if (!j.is_object()) throw std::runtime_error("Expected object");
96959810 (void)j;
@@ -10306,6 +10421,17 @@ namespace quicktype {
1030610421 (void)x;
1030710422 }
1030810423
10424+ inline void from_json(const json & j, MarshalJson& x) {
10425+ if (!j.is_object()) throw std::runtime_error("Expected object");
10426+ (void)j;
10427+ (void)x;
10428+ }
10429+
10430+ inline void to_json(json & j, const MarshalJson & x) {
10431+ j = json::object();
10432+ (void)x;
10433+ }
10434+
1030910435 inline void from_json(const json & j, MetadataPropertyHandling& x) {
1031010436 if (!j.is_object()) throw std::runtime_error("Expected object");
1031110437 (void)j;
@@ -11208,6 +11334,17 @@ namespace quicktype {
1120811334 (void)x;
1120911335 }
1121011336
11337+ inline void from_json(const json & j, ToDict& x) {
11338+ if (!j.is_object()) throw std::runtime_error("Expected object");
11339+ (void)j;
11340+ (void)x;
11341+ }
11342+
11343+ inline void to_json(json & j, const ToDict & x) {
11344+ j = json::object();
11345+ (void)x;
11346+ }
11347+
1121111348 inline void from_json(const json & j, ToJson& x) {
1121211349 if (!j.is_object()) throw std::runtime_error("Expected object");
1121311350 (void)j;
@@ -12462,6 +12599,17 @@ namespace quicktype {
1246212599 (void)x;
1246312600 }
1246412601
12602+ inline void from_json(const json & j, UnmarshalJson& x) {
12603+ if (!j.is_object()) throw std::runtime_error("Expected object");
12604+ (void)j;
12605+ (void)x;
12606+ }
12607+
12608+ inline void to_json(json & j, const UnmarshalJson & x) {
12609+ j = json::object();
12610+ (void)x;
12611+ }
12612+
1246512613 inline void from_json(const json & j, Unowned& x) {
1246612614 if (!j.is_object()) throw std::runtime_error("Expected object");
1246712615 (void)j;
@@ -12862,6 +13010,8 @@ namespace quicktype {
1286213010 x.set_top_level_friend(get_stack_optional<std::variant<Friend, double>>(j, "friend"));
1286313011 if (j.find("from") != j.end() && j.at("from").is_null()) throw std::runtime_error("Unexpected null");
1286413012 x.set_from(get_stack_optional<std::variant<From, double>>(j, "from"));
13013+ if (j.find("from_dict") != j.end() && j.at("from_dict").is_null()) throw std::runtime_error("Unexpected null");
13014+ x.set_from_dict(get_stack_optional<std::variant<FromDict, double>>(j, "from_dict"));
1286513015 if (j.find("from_json") != j.end() && j.at("from_json").is_null()) throw std::runtime_error("Unexpected null");
1286613016 x.set_from_json(get_stack_optional<std::variant<FromJson, double>>(j, "from_json"));
1286713017 if (j.find("func") != j.end() && j.at("func").is_null()) throw std::runtime_error("Unexpected null");
@@ -12984,6 +13134,8 @@ namespace quicktype {
1298413134 x.set_map(get_stack_optional<std::variant<Map, double>>(j, "map"));
1298513135 if (j.find("MapEntry") != j.end() && j.at("MapEntry").is_null()) throw std::runtime_error("Unexpected null");
1298613136 x.set_map_entry(get_stack_optional<std::variant<MapEntry, double>>(j, "MapEntry"));
13137+ if (j.find("MarshalJSON") != j.end() && j.at("MarshalJSON").is_null()) throw std::runtime_error("Unexpected null");
13138+ x.set_marshal_json(get_stack_optional<std::variant<MarshalJson, double>>(j, "MarshalJSON"));
1298713139 if (j.find("metadata_property_handling") != j.end() && j.at("metadata_property_handling").is_null()) throw std::runtime_error("Unexpected null");
1298813140 x.set_metadata_property_handling(get_stack_optional<std::variant<MetadataPropertyHandling, double>>(j, "metadata_property_handling"));
1298913141 if (j.find("module") != j.end() && j.at("module").is_null()) throw std::runtime_error("Unexpected null");
@@ -13212,6 +13364,8 @@ namespace quicktype {
1321213364 x.set_time_only_converter(get_stack_optional<std::variant<TimeOnlyConverter, double>>(j, "TimeOnlyConverter"));
1321313365 if (j.find("TimeZone") != j.end() && j.at("TimeZone").is_null()) throw std::runtime_error("Unexpected null");
1321413366 x.set_time_zone(get_stack_optional<std::variant<TimeZone, double>>(j, "TimeZone"));
13367+ if (j.find("to_dict") != j.end() && j.at("to_dict").is_null()) throw std::runtime_error("Unexpected null");
13368+ x.set_to_dict(get_stack_optional<std::variant<ToDict, double>>(j, "to_dict"));
1321513369 if (j.find("to_json") != j.end() && j.at("to_json").is_null()) throw std::runtime_error("Unexpected null");
1321613370 x.set_to_json(get_stack_optional<std::variant<ToJson, double>>(j, "to_json"));
1321713371 if (j.find("top_level") != j.end() && j.at("top_level").is_null()) throw std::runtime_error("Unexpected null");
@@ -13250,6 +13404,8 @@ namespace quicktype {
1325013404 x.set_undefined(get_stack_optional<std::variant<Undefined, double>>(j, "undefined"));
1325113405 if (j.find("union") != j.end() && j.at("union").is_null()) throw std::runtime_error("Unexpected null");
1325213406 x.set_top_level_union(get_stack_optional<std::variant<Union, double>>(j, "union"));
13407+ if (j.find("UnmarshalJSON") != j.end() && j.at("UnmarshalJSON").is_null()) throw std::runtime_error("Unexpected null");
13408+ x.set_unmarshal_json(get_stack_optional<std::variant<UnmarshalJson, double>>(j, "UnmarshalJSON"));
1325313409 if (j.find("unowned") != j.end() && j.at("unowned").is_null()) throw std::runtime_error("Unexpected null");
1325413410 x.set_unowned(get_stack_optional<std::variant<Unowned, double>>(j, "unowned"));
1325513411 if (j.find("unsafe") != j.end() && j.at("unsafe").is_null()) throw std::runtime_error("Unexpected null");
@@ -13422,6 +13578,7 @@ namespace quicktype {
1342213578 j["FormatException"] = x.get_format_exception();
1342313579 j["friend"] = x.get_top_level_friend();
1342413580 j["from"] = x.get_from();
13581+ j["from_dict"] = x.get_from_dict();
1342513582 j["from_json"] = x.get_from_json();
1342613583 j["func"] = x.get_func();
1342713584 j["function"] = x.get_function();
@@ -13483,6 +13640,7 @@ namespace quicktype {
1348313640 j["long"] = x.get_top_level_long();
1348413641 j["map"] = x.get_map();
1348513642 j["MapEntry"] = x.get_map_entry();
13643+ j["MarshalJSON"] = x.get_marshal_json();
1348613644 j["metadata_property_handling"] = x.get_metadata_property_handling();
1348713645 j["module"] = x.get_top_level_module();
1348813646 j["mutable"] = x.get_top_level_mutable();
@@ -13597,6 +13755,7 @@ namespace quicktype {
1359713755 j["TimeOnly"] = x.get_time_only();
1359813756 j["TimeOnlyConverter"] = x.get_time_only_converter();
1359913757 j["TimeZone"] = x.get_time_zone();
13758+ j["to_dict"] = x.get_to_dict();
1360013759 j["to_json"] = x.get_to_json();
1360113760 j["top_level"] = x.get_top_level();
1360213761 j["toString"] = x.get_to_string();
@@ -13616,6 +13775,7 @@ namespace quicktype {
1361613775 j["unchecked"] = x.get_unchecked();
1361713776 j["undefined"] = x.get_undefined();
1361813777 j["union"] = x.get_top_level_union();
13778+ j["UnmarshalJSON"] = x.get_unmarshal_json();
1361913779 j["unowned"] = x.get_unowned();
1362013780 j["unsafe"] = x.get_unsafe();
1362113781 j["unsigned"] = x.get_top_level_unsigned();
@@ -15082,6 +15242,26 @@ namespace nlohmann {
1508215242 }
1508315243 }
1508415244
15245+ inline void adl_serializer<std::variant<quicktype::FromDict, double>>::from_json(const json & j, std::variant<quicktype::FromDict, double> & x) {
15246+ if (j.is_number())
15247+ x = j.get<double>();
15248+ else if (j.is_object())
15249+ x = j.get<quicktype::FromDict>();
15250+ else throw std::runtime_error("Could not deserialise!");
15251+ }
15252+
15253+ inline void adl_serializer<std::variant<quicktype::FromDict, double>>::to_json(json & j, const std::variant<quicktype::FromDict, double> & x) {
15254+ switch (x.index()) {
15255+ case 0:
15256+ j = std::get<quicktype::FromDict>(x);
15257+ break;
15258+ case 1:
15259+ j = std::get<double>(x);
15260+ break;
15261+ default: throw std::runtime_error("Input JSON does not conform to schema!");
15262+ }
15263+ }
15264+
1508515265 inline void adl_serializer<std::variant<quicktype::FromJson, double>>::from_json(const json & j, std::variant<quicktype::FromJson, double> & x) {
1508615266 if (j.is_number())
1508715267 x = j.get<double>();
@@ -16202,6 +16382,26 @@ namespace nlohmann {
1620216382 }
1620316383 }
1620416384
16385+ inline void adl_serializer<std::variant<quicktype::MarshalJson, double>>::from_json(const json & j, std::variant<quicktype::MarshalJson, double> & x) {
16386+ if (j.is_number())
16387+ x = j.get<double>();
16388+ else if (j.is_object())
16389+ x = j.get<quicktype::MarshalJson>();
16390+ else throw std::runtime_error("Could not deserialise!");
16391+ }
16392+
16393+ inline void adl_serializer<std::variant<quicktype::MarshalJson, double>>::to_json(json & j, const std::variant<quicktype::MarshalJson, double> & x) {
16394+ switch (x.index()) {
16395+ case 0:
16396+ j = std::get<quicktype::MarshalJson>(x);
16397+ break;
16398+ case 1:
16399+ j = std::get<double>(x);
16400+ break;
16401+ default: throw std::runtime_error("Input JSON does not conform to schema!");
16402+ }
16403+ }
16404+
1620516405 inline void adl_serializer<std::variant<quicktype::MetadataPropertyHandling, double>>::from_json(const json & j, std::variant<quicktype::MetadataPropertyHandling, double> & x) {
1620616406 if (j.is_number())
1620716407 x = j.get<double>();
@@ -17842,6 +18042,26 @@ namespace nlohmann {
1784218042 }
1784318043 }
1784418044
18045+ inline void adl_serializer<std::variant<quicktype::ToDict, double>>::from_json(const json & j, std::variant<quicktype::ToDict, double> & x) {
18046+ if (j.is_number())
18047+ x = j.get<double>();
18048+ else if (j.is_object())
18049+ x = j.get<quicktype::ToDict>();
18050+ else throw std::runtime_error("Could not deserialise!");
18051+ }
18052+
18053+ inline void adl_serializer<std::variant<quicktype::ToDict, double>>::to_json(json & j, const std::variant<quicktype::ToDict, double> & x) {
18054+ switch (x.index()) {
18055+ case 0:
18056+ j = std::get<quicktype::ToDict>(x);
18057+ break;
18058+ case 1:
18059+ j = std::get<double>(x);
18060+ break;
18061+ default: throw std::runtime_error("Input JSON does not conform to schema!");
18062+ }
18063+ }
18064+
1784518065 inline void adl_serializer<std::variant<quicktype::ToJson, double>>::from_json(const json & j, std::variant<quicktype::ToJson, double> & x) {
1784618066 if (j.is_number())
1784718067 x = j.get<double>();
@@ -20122,6 +20342,26 @@ namespace nlohmann {
2012220342 }
2012320343 }
2012420344
20345+ inline void adl_serializer<std::variant<quicktype::UnmarshalJson, double>>::from_json(const json & j, std::variant<quicktype::UnmarshalJson, double> & x) {
20346+ if (j.is_number())
20347+ x = j.get<double>();
20348+ else if (j.is_object())
20349+ x = j.get<quicktype::UnmarshalJson>();
20350+ else throw std::runtime_error("Could not deserialise!");
20351+ }
20352+
20353+ inline void adl_serializer<std::variant<quicktype::UnmarshalJson, double>>::to_json(json & j, const std::variant<quicktype::UnmarshalJson, double> & x) {
20354+ switch (x.index()) {
20355+ case 0:
20356+ j = std::get<quicktype::UnmarshalJson>(x);
20357+ break;
20358+ case 1:
20359+ j = std::get<double>(x);
20360+ break;
20361+ default: throw std::runtime_error("Input JSON does not conform to schema!");
20362+ }
20363+ }
20364+
2012520365 inline void adl_serializer<std::variant<quicktype::Unowned, double>>::from_json(const json & j, std::variant<quicktype::Unowned, double> & x) {
2012620366 if (j.is_number())
2012720367 x = j.get<double>();
Mschema-crystaldefault / TopLevel.cr+38 −0
@@ -287,6 +287,8 @@ class TopLevel
287287
288288 property from : UnionFrom?
289289
290+ property from_dict : UnionFromDict?
291+
290292 property from_json : UnionFromJson?
291293
292294 property func : UnionFunc?
@@ -431,6 +433,9 @@ class TopLevel
431433 @[JSON::Field(key: "MapEntry")]
432434 property map_entry : UnionMapEntry?
433435
436+ @[JSON::Field(key: "MarshalJSON")]
437+ property marshal_json : UnionMarshalJson?
438+
434439 property metadata_property_handling : UnionMetadataPropertyHandling?
435440
436441 @[JSON::Field(key: "module")]
@@ -703,6 +708,8 @@ class TopLevel
703708 @[JSON::Field(key: "TimeZone")]
704709 property time_zone : UnionTimeZone?
705710
711+ property to_dict : UnionToDict?
712+
706713 @[JSON::Field(key: "to_json")]
707714 property top_level_to_json : UnionToJson?
708715
@@ -749,6 +756,9 @@ class TopLevel
749756 @[JSON::Field(key: "union")]
750757 property top_level_union : UnionUnionUnion?
751758
759+ @[JSON::Field(key: "UnmarshalJSON")]
760+ property unmarshal_json : UnionUnmarshalJson?
761+
752762 property unowned : UnionUnowned?
753763
754764 property unsafe : UnionUnsafe?
@@ -1320,6 +1330,11 @@ class From
13201330
13211331 end
13221332
1333+class FromDict
1334+ include JSON::Serializable
1335+
1336+end
1337+
13231338 class FromJson
13241339 include JSON::Serializable
13251340
@@ -1620,6 +1635,11 @@ class MapEntry
16201635
16211636 end
16221637
1638+class MarshalJson
1639+ include JSON::Serializable
1640+
1641+end
1642+
16231643 class MetadataPropertyHandling
16241644 include JSON::Serializable
16251645
@@ -2130,6 +2150,11 @@ class TimeZone
21302150
21312151 end
21322152
2153+class ToDict
2154+ include JSON::Serializable
2155+
2156+end
2157+
21332158 class ToString
21342159 include JSON::Serializable
21352160
@@ -2395,6 +2420,11 @@ class Undefined
23952420
23962421 end
23972422
2423+class UnmarshalJson
2424+ include JSON::Serializable
2425+
2426+end
2427+
23982428 class Unowned
23992429 include JSON::Serializable
24002430
@@ -2701,6 +2731,8 @@ alias UnionFriend = Float64 | Friend
27012731
27022732 alias UnionFrom = Float64 | From
27032733
2734+alias UnionFromDict = Float64 | FromDict
2735+
27042736 alias UnionFromJson = Float64 | FromJson
27052737
27062738 alias UnionFunc = Float64 | Func
@@ -2821,6 +2853,8 @@ alias UnionMap = Float64 | Map
28212853
28222854 alias UnionMapEntry = Float64 | MapEntry
28232855
2856+alias UnionMarshalJson = Float64 | MarshalJson
2857+
28242858 alias UnionMetadataPropertyHandling = Float64 | MetadataPropertyHandling
28252859
28262860 alias UnionMutable = Float64 | Mutable
@@ -3025,6 +3059,8 @@ alias UnionTimeOnlyConverter = Float64 | TimeOnlyConverter
30253059
30263060 alias UnionTimeZone = Float64 | TimeZone
30273061
3062+alias UnionToDict = Float64 | ToDict
3063+
30283064 alias UnionToString = Float64 | ToString
30293065
30303066 alias UnionTopLevel = Float64 | TopLevelClass
@@ -3131,6 +3167,8 @@ alias UnionUnchecked = Float64 | Unchecked
31313167
31323168 alias UnionUndefined = Float64 | Undefined
31333169
3170+alias UnionUnmarshalJson = Float64 | UnmarshalJson
3171+
31343172 alias UnionUnowned = Float64 | Unowned
31353173
31363174 alias UnionUnsafe = Float64 | Unsafe
Mschema-csharp-recordsdefault / QuickType.cs+220 −0
@@ -391,6 +391,9 @@ namespace QuickType
391391 [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
392392 public UnionFrom? From { get; set; }
393393
394+ [JsonProperty("from_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
395+ public UnionFromDict? FromDict { get; set; }
396+
394397 [JsonProperty("from_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
395398 public UnionFromJson? TopLevelFromJson { get; set; }
396399
@@ -574,6 +577,9 @@ namespace QuickType
574577 [JsonProperty("MapEntry", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
575578 public UnionMapEntry? MapEntry { get; set; }
576579
580+ [JsonProperty("MarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
581+ public UnionMarshalJson? MarshalJson { get; set; }
582+
577583 [JsonProperty("metadata_property_handling", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
578584 public UnionMetadataPropertyHandling? MetadataPropertyHandling { get; set; }
579585
@@ -916,6 +922,9 @@ namespace QuickType
916922 [JsonProperty("TimeZone", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
917923 public UnionTimeZone? TimeZone { get; set; }
918924
925+ [JsonProperty("to_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
926+ public UnionToDict? ToDict { get; set; }
927+
919928 [JsonProperty("to_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
920929 public UnionToJson? TopLevelToJson { get; set; }
921930
@@ -973,6 +982,9 @@ namespace QuickType
973982 [JsonProperty("union", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
974983 public UnionUnionUnion? Union { get; set; }
975984
985+ [JsonProperty("UnmarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
986+ public UnionUnmarshalJson? UnmarshalJson { get; set; }
987+
976988 [JsonProperty("unowned", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
977989 public UnionUnowned? Unowned { get; set; }
978990
@@ -1495,6 +1507,10 @@ namespace QuickType
14951507 {
14961508 }
14971509
1510+ public partial record FromDict
1511+ {
1512+ }
1513+
14981514 public partial record Func
14991515 {
15001516 }
@@ -1739,6 +1755,10 @@ namespace QuickType
17391755 {
17401756 }
17411757
1758+ public partial record MarshalJson
1759+ {
1760+ }
1761+
17421762 public partial record MetadataPropertyHandlingClass
17431763 {
17441764 }
@@ -2175,6 +2195,10 @@ namespace QuickType
21752195 {
21762196 }
21772197
2198+ public partial record ToDict
2199+ {
2200+ }
2201+
21782202 public partial record AnyClass
21792203 {
21802204 }
@@ -2303,6 +2327,10 @@ namespace QuickType
23032327 {
23042328 }
23052329
2330+ public partial record UnmarshalJson
2331+ {
2332+ }
2333+
23062334 public partial record Unowned
23072335 {
23082336 }
@@ -3412,6 +3440,15 @@ namespace QuickType
34123440 public static implicit operator UnionFrom(From From) => new UnionFrom { From = From };
34133441 }
34143442
3443+ public partial struct UnionFromDict
3444+ {
3445+ public double? Double;
3446+ public FromDict? FromDict;
3447+
3448+ public static implicit operator UnionFromDict(double Double) => new UnionFromDict { Double = Double };
3449+ public static implicit operator UnionFromDict(FromDict FromDict) => new UnionFromDict { FromDict = FromDict };
3450+ }
3451+
34153452 public partial struct UnionFunc
34163453 {
34173454 public double? Double;
@@ -3961,6 +3998,15 @@ namespace QuickType
39613998 public static implicit operator UnionMapEntry(MapEntry MapEntry) => new UnionMapEntry { MapEntry = MapEntry };
39623999 }
39634000
4001+ public partial struct UnionMarshalJson
4002+ {
4003+ public double? Double;
4004+ public MarshalJson? MarshalJson;
4005+
4006+ public static implicit operator UnionMarshalJson(double Double) => new UnionMarshalJson { Double = Double };
4007+ public static implicit operator UnionMarshalJson(MarshalJson MarshalJson) => new UnionMarshalJson { MarshalJson = MarshalJson };
4008+ }
4009+
39644010 public partial struct UnionMetadataPropertyHandling
39654011 {
39664012 public double? Double;
@@ -4942,6 +4988,15 @@ namespace QuickType
49424988 public static implicit operator UnionTimeZone(TimeZone TimeZone) => new UnionTimeZone { TimeZone = TimeZone };
49434989 }
49444990
4991+ public partial struct UnionToDict
4992+ {
4993+ public double? Double;
4994+ public ToDict? ToDict;
4995+
4996+ public static implicit operator UnionToDict(double Double) => new UnionToDict { Double = Double };
4997+ public static implicit operator UnionToDict(ToDict ToDict) => new UnionToDict { ToDict = ToDict };
4998+ }
4999+
49455000 public partial struct UnionAnyUnion
49465001 {
49475002 public AnyClass? AnyClass;
@@ -5230,6 +5285,15 @@ namespace QuickType
52305285 public static implicit operator UnionUnionUnion(Union Union) => new UnionUnionUnion { Union = Union };
52315286 }
52325287
5288+ public partial struct UnionUnmarshalJson
5289+ {
5290+ public double? Double;
5291+ public UnmarshalJson? UnmarshalJson;
5292+
5293+ public static implicit operator UnionUnmarshalJson(double Double) => new UnionUnmarshalJson { Double = Double };
5294+ public static implicit operator UnionUnmarshalJson(UnmarshalJson UnmarshalJson) => new UnionUnmarshalJson { UnmarshalJson = UnmarshalJson };
5295+ }
5296+
52335297 public partial struct UnionUnowned
52345298 {
52355299 public double? Double;
@@ -5493,6 +5557,7 @@ namespace QuickType
54935557 UnionKSerializerConverter.Singleton,
54945558 UnionLocaleConverter.Singleton,
54955559 UnionMapEntryConverter.Singleton,
5560+ UnionMarshalJsonConverter.Singleton,
54965561 UnionNoConverter.Singleton,
54975562 UnionNsErrorConverter.Singleton,
54985563 UnionNsObjectConverter.Singleton,
@@ -5520,6 +5585,7 @@ namespace QuickType
55205585 UnionTrueConverter.Singleton,
55215586 UnionTypeConverter.Singleton,
55225587 UnionUuidConverter.Singleton,
5588+ UnionUnmarshalJsonConverter.Singleton,
55235589 UnionUseSerializersConverter.Singleton,
55245590 UnionUtf8JsonReaderConverter.Singleton,
55255591 UnionUtf8JsonWriterConverter.Singleton,
@@ -5625,6 +5691,7 @@ namespace QuickType
56255691 UnionForeachConverter.Singleton,
56265692 UnionFriendConverter.Singleton,
56275693 UnionFromConverter.Singleton,
5694+ UnionFromDictConverter.Singleton,
56285695 UnionFromJsonConverter.Singleton,
56295696 UnionFuncConverter.Singleton,
56305697 UnionFunctionConverter.Singleton,
@@ -5759,6 +5826,7 @@ namespace QuickType
57595826 UnionThrowConverter.Singleton,
57605827 UnionThrowsConverter.Singleton,
57615828 UnionToStringConverter.Singleton,
5829+ UnionToDictConverter.Singleton,
57625830 UnionToJsonConverter.Singleton,
57635831 UnionTopLevelConverter.Singleton,
57645832 UnionTransientConverter.Singleton,
@@ -7242,6 +7310,44 @@ namespace QuickType
72427310 public static readonly UnionMapEntryConverter Singleton = new UnionMapEntryConverter();
72437311 }
72447312
7313+ internal class UnionMarshalJsonConverter : JsonConverter
7314+ {
7315+ public override bool CanConvert(Type t) => t == typeof(UnionMarshalJson) || t == typeof(UnionMarshalJson?);
7316+
7317+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
7318+ {
7319+ switch (reader.TokenType)
7320+ {
7321+ case JsonToken.Integer:
7322+ case JsonToken.Float:
7323+ var doubleValue = serializer.Deserialize<double>(reader);
7324+ return new UnionMarshalJson { Double = doubleValue };
7325+ case JsonToken.StartObject:
7326+ var objectValue = serializer.Deserialize<MarshalJson>(reader);
7327+ return new UnionMarshalJson { MarshalJson = objectValue };
7328+ }
7329+ throw new Exception("Cannot unmarshal type UnionMarshalJson");
7330+ }
7331+
7332+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
7333+ {
7334+ var value = (UnionMarshalJson)untypedValue;
7335+ if (value.Double != null)
7336+ {
7337+ serializer.Serialize(writer, value.Double.Value);
7338+ return;
7339+ }
7340+ if (value.MarshalJson != null)
7341+ {
7342+ serializer.Serialize(writer, value.MarshalJson);
7343+ return;
7344+ }
7345+ throw new Exception("Cannot marshal type UnionMarshalJson");
7346+ }
7347+
7348+ public static readonly UnionMarshalJsonConverter Singleton = new UnionMarshalJsonConverter();
7349+ }
7350+
72457351 internal class UnionNoConverter : JsonConverter
72467352 {
72477353 public override bool CanConvert(Type t) => t == typeof(UnionNo) || t == typeof(UnionNo?);
@@ -8268,6 +8374,44 @@ namespace QuickType
82688374 public static readonly UnionUuidConverter Singleton = new UnionUuidConverter();
82698375 }
82708376
8377+ internal class UnionUnmarshalJsonConverter : JsonConverter
8378+ {
8379+ public override bool CanConvert(Type t) => t == typeof(UnionUnmarshalJson) || t == typeof(UnionUnmarshalJson?);
8380+
8381+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
8382+ {
8383+ switch (reader.TokenType)
8384+ {
8385+ case JsonToken.Integer:
8386+ case JsonToken.Float:
8387+ var doubleValue = serializer.Deserialize<double>(reader);
8388+ return new UnionUnmarshalJson { Double = doubleValue };
8389+ case JsonToken.StartObject:
8390+ var objectValue = serializer.Deserialize<UnmarshalJson>(reader);
8391+ return new UnionUnmarshalJson { UnmarshalJson = objectValue };
8392+ }
8393+ throw new Exception("Cannot unmarshal type UnionUnmarshalJson");
8394+ }
8395+
8396+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
8397+ {
8398+ var value = (UnionUnmarshalJson)untypedValue;
8399+ if (value.Double != null)
8400+ {
8401+ serializer.Serialize(writer, value.Double.Value);
8402+ return;
8403+ }
8404+ if (value.UnmarshalJson != null)
8405+ {
8406+ serializer.Serialize(writer, value.UnmarshalJson);
8407+ return;
8408+ }
8409+ throw new Exception("Cannot marshal type UnionUnmarshalJson");
8410+ }
8411+
8412+ public static readonly UnionUnmarshalJsonConverter Singleton = new UnionUnmarshalJsonConverter();
8413+ }
8414+
82718415 internal class UnionUseSerializersConverter : JsonConverter
82728416 {
82738417 public override bool CanConvert(Type t) => t == typeof(UnionUseSerializers) || t == typeof(UnionUseSerializers?);
@@ -12258,6 +12402,44 @@ namespace QuickType
1225812402 public static readonly UnionFromConverter Singleton = new UnionFromConverter();
1225912403 }
1226012404
12405+ internal class UnionFromDictConverter : JsonConverter
12406+ {
12407+ public override bool CanConvert(Type t) => t == typeof(UnionFromDict) || t == typeof(UnionFromDict?);
12408+
12409+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
12410+ {
12411+ switch (reader.TokenType)
12412+ {
12413+ case JsonToken.Integer:
12414+ case JsonToken.Float:
12415+ var doubleValue = serializer.Deserialize<double>(reader);
12416+ return new UnionFromDict { Double = doubleValue };
12417+ case JsonToken.StartObject:
12418+ var objectValue = serializer.Deserialize<FromDict>(reader);
12419+ return new UnionFromDict { FromDict = objectValue };
12420+ }
12421+ throw new Exception("Cannot unmarshal type UnionFromDict");
12422+ }
12423+
12424+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
12425+ {
12426+ var value = (UnionFromDict)untypedValue;
12427+ if (value.Double != null)
12428+ {
12429+ serializer.Serialize(writer, value.Double.Value);
12430+ return;
12431+ }
12432+ if (value.FromDict != null)
12433+ {
12434+ serializer.Serialize(writer, value.FromDict);
12435+ return;
12436+ }
12437+ throw new Exception("Cannot marshal type UnionFromDict");
12438+ }
12439+
12440+ public static readonly UnionFromDictConverter Singleton = new UnionFromDictConverter();
12441+ }
12442+
1226112443 internal class UnionFromJsonConverter : JsonConverter
1226212444 {
1226312445 public override bool CanConvert(Type t) => t == typeof(UnionFromJson) || t == typeof(UnionFromJson?);
@@ -17350,6 +17532,44 @@ namespace QuickType
1735017532 public static readonly UnionToStringConverter Singleton = new UnionToStringConverter();
1735117533 }
1735217534
17535+ internal class UnionToDictConverter : JsonConverter
17536+ {
17537+ public override bool CanConvert(Type t) => t == typeof(UnionToDict) || t == typeof(UnionToDict?);
17538+
17539+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
17540+ {
17541+ switch (reader.TokenType)
17542+ {
17543+ case JsonToken.Integer:
17544+ case JsonToken.Float:
17545+ var doubleValue = serializer.Deserialize<double>(reader);
17546+ return new UnionToDict { Double = doubleValue };
17547+ case JsonToken.StartObject:
17548+ var objectValue = serializer.Deserialize<ToDict>(reader);
17549+ return new UnionToDict { ToDict = objectValue };
17550+ }
17551+ throw new Exception("Cannot unmarshal type UnionToDict");
17552+ }
17553+
17554+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
17555+ {
17556+ var value = (UnionToDict)untypedValue;
17557+ if (value.Double != null)
17558+ {
17559+ serializer.Serialize(writer, value.Double.Value);
17560+ return;
17561+ }
17562+ if (value.ToDict != null)
17563+ {
17564+ serializer.Serialize(writer, value.ToDict);
17565+ return;
17566+ }
17567+ throw new Exception("Cannot marshal type UnionToDict");
17568+ }
17569+
17570+ public static readonly UnionToDictConverter Singleton = new UnionToDictConverter();
17571+ }
17572+
1735317573 internal class UnionToJsonConverter : JsonConverter
1735417574 {
1735517575 public override bool CanConvert(Type t) => t == typeof(UnionToJson) || t == typeof(UnionToJson?);
Mschema-csharp-SystemTextJsondefault / QuickType.cs+216 −0
@@ -510,6 +510,10 @@ namespace QuickType
510510 [JsonPropertyName("from")]
511511 public UnionFrom? From { get; set; }
512512
513+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
514+ [JsonPropertyName("from_dict")]
515+ public UnionFromDict? FromDict { get; set; }
516+
513517 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
514518 [JsonPropertyName("from_json")]
515519 public UnionFromJson? TopLevelFromJson { get; set; }
@@ -754,6 +758,10 @@ namespace QuickType
754758 [JsonPropertyName("MapEntry")]
755759 public UnionMapEntry? MapEntry { get; set; }
756760
761+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
762+ [JsonPropertyName("MarshalJSON")]
763+ public UnionMarshalJson? MarshalJson { get; set; }
764+
757765 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
758766 [JsonPropertyName("metadata_property_handling")]
759767 public UnionMetadataPropertyHandling? MetadataPropertyHandling { get; set; }
@@ -1210,6 +1218,10 @@ namespace QuickType
12101218 [JsonPropertyName("TimeZone")]
12111219 public UnionTimeZone? TimeZone { get; set; }
12121220
1221+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
1222+ [JsonPropertyName("to_dict")]
1223+ public UnionToDict? ToDict { get; set; }
1224+
12131225 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
12141226 [JsonPropertyName("to_json")]
12151227 public UnionToJson? TopLevelToJson { get; set; }
@@ -1286,6 +1298,10 @@ namespace QuickType
12861298 [JsonPropertyName("union")]
12871299 public UnionUnionUnion? Union { get; set; }
12881300
1301+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
1302+ [JsonPropertyName("UnmarshalJSON")]
1303+ public UnionUnmarshalJson? UnmarshalJson { get; set; }
1304+
12891305 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
12901306 [JsonPropertyName("unowned")]
12911307 public UnionUnowned? Unowned { get; set; }
@@ -1839,6 +1855,10 @@ namespace QuickType
18391855 {
18401856 }
18411857
1858+ public partial class FromDict
1859+ {
1860+ }
1861+
18421862 public partial class Func
18431863 {
18441864 }
@@ -2083,6 +2103,10 @@ namespace QuickType
20832103 {
20842104 }
20852105
2106+ public partial class MarshalJson
2107+ {
2108+ }
2109+
20862110 public partial class MetadataPropertyHandling
20872111 {
20882112 }
@@ -2523,6 +2547,10 @@ namespace QuickType
25232547 {
25242548 }
25252549
2550+ public partial class ToDict
2551+ {
2552+ }
2553+
25262554 public partial class AnyClass
25272555 {
25282556 }
@@ -2639,6 +2667,10 @@ namespace QuickType
26392667 {
26402668 }
26412669
2670+ public partial class UnmarshalJson
2671+ {
2672+ }
2673+
26422674 public partial class Unowned
26432675 {
26442676 }
@@ -3766,6 +3798,15 @@ namespace QuickType
37663798 public static implicit operator UnionFrom(From From) => new UnionFrom { From = From };
37673799 }
37683800
3801+ public partial struct UnionFromDict
3802+ {
3803+ public double? Double;
3804+ public FromDict? FromDict;
3805+
3806+ public static implicit operator UnionFromDict(double Double) => new UnionFromDict { Double = Double };
3807+ public static implicit operator UnionFromDict(FromDict FromDict) => new UnionFromDict { FromDict = FromDict };
3808+ }
3809+
37693810 public partial struct UnionFunc
37703811 {
37713812 public double? Double;
@@ -4315,6 +4356,15 @@ namespace QuickType
43154356 public static implicit operator UnionMapEntry(MapEntry MapEntry) => new UnionMapEntry { MapEntry = MapEntry };
43164357 }
43174358
4359+ public partial struct UnionMarshalJson
4360+ {
4361+ public double? Double;
4362+ public MarshalJson? MarshalJson;
4363+
4364+ public static implicit operator UnionMarshalJson(double Double) => new UnionMarshalJson { Double = Double };
4365+ public static implicit operator UnionMarshalJson(MarshalJson MarshalJson) => new UnionMarshalJson { MarshalJson = MarshalJson };
4366+ }
4367+
43184368 public partial struct UnionMetadataPropertyHandling
43194369 {
43204370 public double? Double;
@@ -5305,6 +5355,15 @@ namespace QuickType
53055355 public static implicit operator UnionTimeZone(TimeZone TimeZone) => new UnionTimeZone { TimeZone = TimeZone };
53065356 }
53075357
5358+ public partial struct UnionToDict
5359+ {
5360+ public double? Double;
5361+ public ToDict? ToDict;
5362+
5363+ public static implicit operator UnionToDict(double Double) => new UnionToDict { Double = Double };
5364+ public static implicit operator UnionToDict(ToDict ToDict) => new UnionToDict { ToDict = ToDict };
5365+ }
5366+
53085367 public partial struct UnionAnyUnion
53095368 {
53105369 public AnyClass? AnyClass;
@@ -5566,6 +5625,15 @@ namespace QuickType
55665625 public static implicit operator UnionUnionUnion(Union Union) => new UnionUnionUnion { Union = Union };
55675626 }
55685627
5628+ public partial struct UnionUnmarshalJson
5629+ {
5630+ public double? Double;
5631+ public UnmarshalJson? UnmarshalJson;
5632+
5633+ public static implicit operator UnionUnmarshalJson(double Double) => new UnionUnmarshalJson { Double = Double };
5634+ public static implicit operator UnionUnmarshalJson(UnmarshalJson UnmarshalJson) => new UnionUnmarshalJson { UnmarshalJson = UnmarshalJson };
5635+ }
5636+
55695637 public partial struct UnionUnowned
55705638 {
55715639 public double? Double;
@@ -5827,6 +5895,7 @@ namespace QuickType
58275895 UnionKSerializerConverter.Singleton,
58285896 UnionLocaleConverter.Singleton,
58295897 UnionMapEntryConverter.Singleton,
5898+ UnionMarshalJsonConverter.Singleton,
58305899 UnionNoConverter.Singleton,
58315900 UnionNsErrorConverter.Singleton,
58325901 UnionNsObjectConverter.Singleton,
@@ -5854,6 +5923,7 @@ namespace QuickType
58545923 UnionTrueConverter.Singleton,
58555924 UnionTypeConverter.Singleton,
58565925 UnionUuidConverter.Singleton,
5926+ UnionUnmarshalJsonConverter.Singleton,
58575927 UnionUseSerializersConverter.Singleton,
58585928 UnionUtf8JsonReaderConverter.Singleton,
58595929 UnionUtf8JsonWriterConverter.Singleton,
@@ -5959,6 +6029,7 @@ namespace QuickType
59596029 UnionForeachConverter.Singleton,
59606030 UnionFriendConverter.Singleton,
59616031 UnionFromConverter.Singleton,
6032+ UnionFromDictConverter.Singleton,
59626033 UnionFromJsonConverter.Singleton,
59636034 UnionFuncConverter.Singleton,
59646035 UnionFunctionConverter.Singleton,
@@ -6093,6 +6164,7 @@ namespace QuickType
60936164 UnionThrowConverter.Singleton,
60946165 UnionThrowsConverter.Singleton,
60956166 UnionToStringConverter.Singleton,
6167+ UnionToDictConverter.Singleton,
60966168 UnionToJsonConverter.Singleton,
60976169 UnionTopLevelConverter.Singleton,
60986170 UnionTransientConverter.Singleton,
@@ -7502,6 +7574,42 @@ namespace QuickType
75027574 public static readonly UnionMapEntryConverter Singleton = new UnionMapEntryConverter();
75037575 }
75047576
7577+ internal class UnionMarshalJsonConverter : JsonConverter<UnionMarshalJson>
7578+ {
7579+ public override bool CanConvert(Type t) => t == typeof(UnionMarshalJson);
7580+
7581+ public override UnionMarshalJson Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
7582+ {
7583+ switch (reader.TokenType)
7584+ {
7585+ case JsonTokenType.Number:
7586+ var doubleValue1 = reader.GetDouble();
7587+ return new UnionMarshalJson { Double = doubleValue1 };
7588+ case JsonTokenType.StartObject:
7589+ var objectValue = JsonSerializer.Deserialize<MarshalJson>(ref reader, options);
7590+ return new UnionMarshalJson { MarshalJson = objectValue };
7591+ }
7592+ throw new JsonException("Cannot unmarshal type UnionMarshalJson");
7593+ }
7594+
7595+ public override void Write(Utf8JsonWriter writer, UnionMarshalJson value, JsonSerializerOptions options)
7596+ {
7597+ if (value.Double != null)
7598+ {
7599+ JsonSerializer.Serialize(writer, value.Double.Value, options);
7600+ return;
7601+ }
7602+ if (value.MarshalJson != null)
7603+ {
7604+ JsonSerializer.Serialize(writer, value.MarshalJson, options);
7605+ return;
7606+ }
7607+ throw new NotSupportedException("Cannot marshal type UnionMarshalJson");
7608+ }
7609+
7610+ public static readonly UnionMarshalJsonConverter Singleton = new UnionMarshalJsonConverter();
7611+ }
7612+
75057613 internal class UnionNoConverter : JsonConverter<UnionNo>
75067614 {
75077615 public override bool CanConvert(Type t) => t == typeof(UnionNo);
@@ -8474,6 +8582,42 @@ namespace QuickType
84748582 public static readonly UnionUuidConverter Singleton = new UnionUuidConverter();
84758583 }
84768584
8585+ internal class UnionUnmarshalJsonConverter : JsonConverter<UnionUnmarshalJson>
8586+ {
8587+ public override bool CanConvert(Type t) => t == typeof(UnionUnmarshalJson);
8588+
8589+ public override UnionUnmarshalJson Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
8590+ {
8591+ switch (reader.TokenType)
8592+ {
8593+ case JsonTokenType.Number:
8594+ var doubleValue1 = reader.GetDouble();
8595+ return new UnionUnmarshalJson { Double = doubleValue1 };
8596+ case JsonTokenType.StartObject:
8597+ var objectValue = JsonSerializer.Deserialize<UnmarshalJson>(ref reader, options);
8598+ return new UnionUnmarshalJson { UnmarshalJson = objectValue };
8599+ }
8600+ throw new JsonException("Cannot unmarshal type UnionUnmarshalJson");
8601+ }
8602+
8603+ public override void Write(Utf8JsonWriter writer, UnionUnmarshalJson value, JsonSerializerOptions options)
8604+ {
8605+ if (value.Double != null)
8606+ {
8607+ JsonSerializer.Serialize(writer, value.Double.Value, options);
8608+ return;
8609+ }
8610+ if (value.UnmarshalJson != null)
8611+ {
8612+ JsonSerializer.Serialize(writer, value.UnmarshalJson, options);
8613+ return;
8614+ }
8615+ throw new NotSupportedException("Cannot marshal type UnionUnmarshalJson");
8616+ }
8617+
8618+ public static readonly UnionUnmarshalJsonConverter Singleton = new UnionUnmarshalJsonConverter();
8619+ }
8620+
84778621 internal class UnionUseSerializersConverter : JsonConverter<UnionUseSerializers>
84788622 {
84798623 public override bool CanConvert(Type t) => t == typeof(UnionUseSerializers);
@@ -12254,6 +12398,42 @@ namespace QuickType
1225412398 public static readonly UnionFromConverter Singleton = new UnionFromConverter();
1225512399 }
1225612400
12401+ internal class UnionFromDictConverter : JsonConverter<UnionFromDict>
12402+ {
12403+ public override bool CanConvert(Type t) => t == typeof(UnionFromDict);
12404+
12405+ public override UnionFromDict Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
12406+ {
12407+ switch (reader.TokenType)
12408+ {
12409+ case JsonTokenType.Number:
12410+ var doubleValue1 = reader.GetDouble();
12411+ return new UnionFromDict { Double = doubleValue1 };
12412+ case JsonTokenType.StartObject:
12413+ var objectValue = JsonSerializer.Deserialize<FromDict>(ref reader, options);
12414+ return new UnionFromDict { FromDict = objectValue };
12415+ }
12416+ throw new JsonException("Cannot unmarshal type UnionFromDict");
12417+ }
12418+
12419+ public override void Write(Utf8JsonWriter writer, UnionFromDict value, JsonSerializerOptions options)
12420+ {
12421+ if (value.Double != null)
12422+ {
12423+ JsonSerializer.Serialize(writer, value.Double.Value, options);
12424+ return;
12425+ }
12426+ if (value.FromDict != null)
12427+ {
12428+ JsonSerializer.Serialize(writer, value.FromDict, options);
12429+ return;
12430+ }
12431+ throw new NotSupportedException("Cannot marshal type UnionFromDict");
12432+ }
12433+
12434+ public static readonly UnionFromDictConverter Singleton = new UnionFromDictConverter();
12435+ }
12436+
1225712437 internal class UnionFromJsonConverter : JsonConverter<UnionFromJson>
1225812438 {
1225912439 public override bool CanConvert(Type t) => t == typeof(UnionFromJson);
@@ -17078,6 +17258,42 @@ namespace QuickType
1707817258 public static readonly UnionToStringConverter Singleton = new UnionToStringConverter();
1707917259 }
1708017260
17261+ internal class UnionToDictConverter : JsonConverter<UnionToDict>
17262+ {
17263+ public override bool CanConvert(Type t) => t == typeof(UnionToDict);
17264+
17265+ public override UnionToDict Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
17266+ {
17267+ switch (reader.TokenType)
17268+ {
17269+ case JsonTokenType.Number:
17270+ var doubleValue1 = reader.GetDouble();
17271+ return new UnionToDict { Double = doubleValue1 };
17272+ case JsonTokenType.StartObject:
17273+ var objectValue = JsonSerializer.Deserialize<ToDict>(ref reader, options);
17274+ return new UnionToDict { ToDict = objectValue };
17275+ }
17276+ throw new JsonException("Cannot unmarshal type UnionToDict");
17277+ }
17278+
17279+ public override void Write(Utf8JsonWriter writer, UnionToDict value, JsonSerializerOptions options)
17280+ {
17281+ if (value.Double != null)
17282+ {
17283+ JsonSerializer.Serialize(writer, value.Double.Value, options);
17284+ return;
17285+ }
17286+ if (value.ToDict != null)
17287+ {
17288+ JsonSerializer.Serialize(writer, value.ToDict, options);
17289+ return;
17290+ }
17291+ throw new NotSupportedException("Cannot marshal type UnionToDict");
17292+ }
17293+
17294+ public static readonly UnionToDictConverter Singleton = new UnionToDictConverter();
17295+ }
17296+
1708117297 internal class UnionToJsonConverter : JsonConverter<UnionToJson>
1708217298 {
1708317299 public override bool CanConvert(Type t) => t == typeof(UnionToJson);
Mschema-csharpdefault / QuickType.cs+220 −0
@@ -391,6 +391,9 @@ namespace QuickType
391391 [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
392392 public UnionFrom? From { get; set; }
393393
394+ [JsonProperty("from_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
395+ public UnionFromDict? FromDict { get; set; }
396+
394397 [JsonProperty("from_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
395398 public UnionFromJson? TopLevelFromJson { get; set; }
396399
@@ -574,6 +577,9 @@ namespace QuickType
574577 [JsonProperty("MapEntry", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
575578 public UnionMapEntry? MapEntry { get; set; }
576579
580+ [JsonProperty("MarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
581+ public UnionMarshalJson? MarshalJson { get; set; }
582+
577583 [JsonProperty("metadata_property_handling", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
578584 public UnionMetadataPropertyHandling? MetadataPropertyHandling { get; set; }
579585
@@ -916,6 +922,9 @@ namespace QuickType
916922 [JsonProperty("TimeZone", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
917923 public UnionTimeZone? TimeZone { get; set; }
918924
925+ [JsonProperty("to_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
926+ public UnionToDict? ToDict { get; set; }
927+
919928 [JsonProperty("to_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
920929 public UnionToJson? TopLevelToJson { get; set; }
921930
@@ -973,6 +982,9 @@ namespace QuickType
973982 [JsonProperty("union", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
974983 public UnionUnionUnion? Union { get; set; }
975984
985+ [JsonProperty("UnmarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
986+ public UnionUnmarshalJson? UnmarshalJson { get; set; }
987+
976988 [JsonProperty("unowned", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
977989 public UnionUnowned? Unowned { get; set; }
978990
@@ -1503,6 +1515,10 @@ namespace QuickType
15031515 {
15041516 }
15051517
1518+ public partial class FromDict
1519+ {
1520+ }
1521+
15061522 public partial class Func
15071523 {
15081524 }
@@ -1747,6 +1763,10 @@ namespace QuickType
17471763 {
17481764 }
17491765
1766+ public partial class MarshalJson
1767+ {
1768+ }
1769+
17501770 public partial class MetadataPropertyHandlingClass
17511771 {
17521772 }
@@ -2187,6 +2207,10 @@ namespace QuickType
21872207 {
21882208 }
21892209
2210+ public partial class ToDict
2211+ {
2212+ }
2213+
21902214 public partial class AnyClass
21912215 {
21922216 }
@@ -2303,6 +2327,10 @@ namespace QuickType
23032327 {
23042328 }
23052329
2330+ public partial class UnmarshalJson
2331+ {
2332+ }
2333+
23062334 public partial class Unowned
23072335 {
23082336 }
@@ -3430,6 +3458,15 @@ namespace QuickType
34303458 public static implicit operator UnionFrom(From From) => new UnionFrom { From = From };
34313459 }
34323460
3461+ public partial struct UnionFromDict
3462+ {
3463+ public double? Double;
3464+ public FromDict? FromDict;
3465+
3466+ public static implicit operator UnionFromDict(double Double) => new UnionFromDict { Double = Double };
3467+ public static implicit operator UnionFromDict(FromDict FromDict) => new UnionFromDict { FromDict = FromDict };
3468+ }
3469+
34333470 public partial struct UnionFunc
34343471 {
34353472 public double? Double;
@@ -3979,6 +4016,15 @@ namespace QuickType
39794016 public static implicit operator UnionMapEntry(MapEntry MapEntry) => new UnionMapEntry { MapEntry = MapEntry };
39804017 }
39814018
4019+ public partial struct UnionMarshalJson
4020+ {
4021+ public double? Double;
4022+ public MarshalJson? MarshalJson;
4023+
4024+ public static implicit operator UnionMarshalJson(double Double) => new UnionMarshalJson { Double = Double };
4025+ public static implicit operator UnionMarshalJson(MarshalJson MarshalJson) => new UnionMarshalJson { MarshalJson = MarshalJson };
4026+ }
4027+
39824028 public partial struct UnionMetadataPropertyHandling
39834029 {
39844030 public double? Double;
@@ -4969,6 +5015,15 @@ namespace QuickType
49695015 public static implicit operator UnionTimeZone(TimeZone TimeZone) => new UnionTimeZone { TimeZone = TimeZone };
49705016 }
49715017
5018+ public partial struct UnionToDict
5019+ {
5020+ public double? Double;
5021+ public ToDict? ToDict;
5022+
5023+ public static implicit operator UnionToDict(double Double) => new UnionToDict { Double = Double };
5024+ public static implicit operator UnionToDict(ToDict ToDict) => new UnionToDict { ToDict = ToDict };
5025+ }
5026+
49725027 public partial struct UnionAnyUnion
49735028 {
49745029 public AnyClass? AnyClass;
@@ -5230,6 +5285,15 @@ namespace QuickType
52305285 public static implicit operator UnionUnionUnion(Union Union) => new UnionUnionUnion { Union = Union };
52315286 }
52325287
5288+ public partial struct UnionUnmarshalJson
5289+ {
5290+ public double? Double;
5291+ public UnmarshalJson? UnmarshalJson;
5292+
5293+ public static implicit operator UnionUnmarshalJson(double Double) => new UnionUnmarshalJson { Double = Double };
5294+ public static implicit operator UnionUnmarshalJson(UnmarshalJson UnmarshalJson) => new UnionUnmarshalJson { UnmarshalJson = UnmarshalJson };
5295+ }
5296+
52335297 public partial struct UnionUnowned
52345298 {
52355299 public double? Double;
@@ -5493,6 +5557,7 @@ namespace QuickType
54935557 UnionKSerializerConverter.Singleton,
54945558 UnionLocaleConverter.Singleton,
54955559 UnionMapEntryConverter.Singleton,
5560+ UnionMarshalJsonConverter.Singleton,
54965561 UnionNoConverter.Singleton,
54975562 UnionNsErrorConverter.Singleton,
54985563 UnionNsObjectConverter.Singleton,
@@ -5520,6 +5585,7 @@ namespace QuickType
55205585 UnionTrueConverter.Singleton,
55215586 UnionTypeConverter.Singleton,
55225587 UnionUuidConverter.Singleton,
5588+ UnionUnmarshalJsonConverter.Singleton,
55235589 UnionUseSerializersConverter.Singleton,
55245590 UnionUtf8JsonReaderConverter.Singleton,
55255591 UnionUtf8JsonWriterConverter.Singleton,
@@ -5625,6 +5691,7 @@ namespace QuickType
56255691 UnionForeachConverter.Singleton,
56265692 UnionFriendConverter.Singleton,
56275693 UnionFromConverter.Singleton,
5694+ UnionFromDictConverter.Singleton,
56285695 UnionFromJsonConverter.Singleton,
56295696 UnionFuncConverter.Singleton,
56305697 UnionFunctionConverter.Singleton,
@@ -5759,6 +5826,7 @@ namespace QuickType
57595826 UnionThrowConverter.Singleton,
57605827 UnionThrowsConverter.Singleton,
57615828 UnionToStringConverter.Singleton,
5829+ UnionToDictConverter.Singleton,
57625830 UnionToJsonConverter.Singleton,
57635831 UnionTopLevelConverter.Singleton,
57645832 UnionTransientConverter.Singleton,
@@ -7242,6 +7310,44 @@ namespace QuickType
72427310 public static readonly UnionMapEntryConverter Singleton = new UnionMapEntryConverter();
72437311 }
72447312
7313+ internal class UnionMarshalJsonConverter : JsonConverter
7314+ {
7315+ public override bool CanConvert(Type t) => t == typeof(UnionMarshalJson) || t == typeof(UnionMarshalJson?);
7316+
7317+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
7318+ {
7319+ switch (reader.TokenType)
7320+ {
7321+ case JsonToken.Integer:
7322+ case JsonToken.Float:
7323+ var doubleValue = serializer.Deserialize<double>(reader);
7324+ return new UnionMarshalJson { Double = doubleValue };
7325+ case JsonToken.StartObject:
7326+ var objectValue = serializer.Deserialize<MarshalJson>(reader);
7327+ return new UnionMarshalJson { MarshalJson = objectValue };
7328+ }
7329+ throw new Exception("Cannot unmarshal type UnionMarshalJson");
7330+ }
7331+
7332+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
7333+ {
7334+ var value = (UnionMarshalJson)untypedValue;
7335+ if (value.Double != null)
7336+ {
7337+ serializer.Serialize(writer, value.Double.Value);
7338+ return;
7339+ }
7340+ if (value.MarshalJson != null)
7341+ {
7342+ serializer.Serialize(writer, value.MarshalJson);
7343+ return;
7344+ }
7345+ throw new Exception("Cannot marshal type UnionMarshalJson");
7346+ }
7347+
7348+ public static readonly UnionMarshalJsonConverter Singleton = new UnionMarshalJsonConverter();
7349+ }
7350+
72457351 internal class UnionNoConverter : JsonConverter
72467352 {
72477353 public override bool CanConvert(Type t) => t == typeof(UnionNo) || t == typeof(UnionNo?);
@@ -8268,6 +8374,44 @@ namespace QuickType
82688374 public static readonly UnionUuidConverter Singleton = new UnionUuidConverter();
82698375 }
82708376
8377+ internal class UnionUnmarshalJsonConverter : JsonConverter
8378+ {
8379+ public override bool CanConvert(Type t) => t == typeof(UnionUnmarshalJson) || t == typeof(UnionUnmarshalJson?);
8380+
8381+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
8382+ {
8383+ switch (reader.TokenType)
8384+ {
8385+ case JsonToken.Integer:
8386+ case JsonToken.Float:
8387+ var doubleValue = serializer.Deserialize<double>(reader);
8388+ return new UnionUnmarshalJson { Double = doubleValue };
8389+ case JsonToken.StartObject:
8390+ var objectValue = serializer.Deserialize<UnmarshalJson>(reader);
8391+ return new UnionUnmarshalJson { UnmarshalJson = objectValue };
8392+ }
8393+ throw new Exception("Cannot unmarshal type UnionUnmarshalJson");
8394+ }
8395+
8396+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
8397+ {
8398+ var value = (UnionUnmarshalJson)untypedValue;
8399+ if (value.Double != null)
8400+ {
8401+ serializer.Serialize(writer, value.Double.Value);
8402+ return;
8403+ }
8404+ if (value.UnmarshalJson != null)
8405+ {
8406+ serializer.Serialize(writer, value.UnmarshalJson);
8407+ return;
8408+ }
8409+ throw new Exception("Cannot marshal type UnionUnmarshalJson");
8410+ }
8411+
8412+ public static readonly UnionUnmarshalJsonConverter Singleton = new UnionUnmarshalJsonConverter();
8413+ }
8414+
82718415 internal class UnionUseSerializersConverter : JsonConverter
82728416 {
82738417 public override bool CanConvert(Type t) => t == typeof(UnionUseSerializers) || t == typeof(UnionUseSerializers?);
@@ -12258,6 +12402,44 @@ namespace QuickType
1225812402 public static readonly UnionFromConverter Singleton = new UnionFromConverter();
1225912403 }
1226012404
12405+ internal class UnionFromDictConverter : JsonConverter
12406+ {
12407+ public override bool CanConvert(Type t) => t == typeof(UnionFromDict) || t == typeof(UnionFromDict?);
12408+
12409+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
12410+ {
12411+ switch (reader.TokenType)
12412+ {
12413+ case JsonToken.Integer:
12414+ case JsonToken.Float:
12415+ var doubleValue = serializer.Deserialize<double>(reader);
12416+ return new UnionFromDict { Double = doubleValue };
12417+ case JsonToken.StartObject:
12418+ var objectValue = serializer.Deserialize<FromDict>(reader);
12419+ return new UnionFromDict { FromDict = objectValue };
12420+ }
12421+ throw new Exception("Cannot unmarshal type UnionFromDict");
12422+ }
12423+
12424+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
12425+ {
12426+ var value = (UnionFromDict)untypedValue;
12427+ if (value.Double != null)
12428+ {
12429+ serializer.Serialize(writer, value.Double.Value);
12430+ return;
12431+ }
12432+ if (value.FromDict != null)
12433+ {
12434+ serializer.Serialize(writer, value.FromDict);
12435+ return;
12436+ }
12437+ throw new Exception("Cannot marshal type UnionFromDict");
12438+ }
12439+
12440+ public static readonly UnionFromDictConverter Singleton = new UnionFromDictConverter();
12441+ }
12442+
1226112443 internal class UnionFromJsonConverter : JsonConverter
1226212444 {
1226312445 public override bool CanConvert(Type t) => t == typeof(UnionFromJson) || t == typeof(UnionFromJson?);
@@ -17350,6 +17532,44 @@ namespace QuickType
1735017532 public static readonly UnionToStringConverter Singleton = new UnionToStringConverter();
1735117533 }
1735217534
17535+ internal class UnionToDictConverter : JsonConverter
17536+ {
17537+ public override bool CanConvert(Type t) => t == typeof(UnionToDict) || t == typeof(UnionToDict?);
17538+
17539+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
17540+ {
17541+ switch (reader.TokenType)
17542+ {
17543+ case JsonToken.Integer:
17544+ case JsonToken.Float:
17545+ var doubleValue = serializer.Deserialize<double>(reader);
17546+ return new UnionToDict { Double = doubleValue };
17547+ case JsonToken.StartObject:
17548+ var objectValue = serializer.Deserialize<ToDict>(reader);
17549+ return new UnionToDict { ToDict = objectValue };
17550+ }
17551+ throw new Exception("Cannot unmarshal type UnionToDict");
17552+ }
17553+
17554+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
17555+ {
17556+ var value = (UnionToDict)untypedValue;
17557+ if (value.Double != null)
17558+ {
17559+ serializer.Serialize(writer, value.Double.Value);
17560+ return;
17561+ }
17562+ if (value.ToDict != null)
17563+ {
17564+ serializer.Serialize(writer, value.ToDict);
17565+ return;
17566+ }
17567+ throw new Exception("Cannot marshal type UnionToDict");
17568+ }
17569+
17570+ public static readonly UnionToDictConverter Singleton = new UnionToDictConverter();
17571+ }
17572+
1735317573 internal class UnionToJsonConverter : JsonConverter
1735417574 {
1735517575 public override bool CanConvert(Type t) => t == typeof(UnionToJson) || t == typeof(UnionToJson?);
Mschema-dartdefault / TopLevel.dart+56 −0
@@ -131,6 +131,7 @@ class TopLevel {
131131 final dynamic formatException;
132132 final dynamic friend;
133133 final dynamic from;
134+ final dynamic fromDict;
134135 final dynamic topLevelFromJson;
135136 final dynamic func;
136137 final dynamic function;
@@ -192,6 +193,7 @@ class TopLevel {
192193 final dynamic long;
193194 final dynamic map;
194195 final dynamic mapEntry;
196+ final dynamic marshalJson;
195197 final dynamic metadataPropertyHandling;
196198 final dynamic module;
197199 final dynamic mutable;
@@ -306,6 +308,7 @@ class TopLevel {
306308 final dynamic timeOnly;
307309 final dynamic timeOnlyConverter;
308310 final dynamic timeZone;
311+ final dynamic toDict;
309312 final dynamic topLevelToJson;
310313 final dynamic topLevel;
311314 final dynamic topLevelToString;
@@ -325,6 +328,7 @@ class TopLevel {
325328 final dynamic unchecked;
326329 final dynamic undefined;
327330 final dynamic union;
331+ final dynamic unmarshalJson;
328332 final dynamic unowned;
329333 final dynamic unsafe;
330334 final dynamic unsigned;
@@ -472,6 +476,7 @@ class TopLevel {
472476 this.formatException,
473477 this.friend,
474478 this.from,
479+ this.fromDict,
475480 this.topLevelFromJson,
476481 this.func,
477482 this.function,
@@ -533,6 +538,7 @@ class TopLevel {
533538 this.long,
534539 this.map,
535540 this.mapEntry,
541+ this.marshalJson,
536542 this.metadataPropertyHandling,
537543 this.module,
538544 this.mutable,
@@ -647,6 +653,7 @@ class TopLevel {
647653 this.timeOnly,
648654 this.timeOnlyConverter,
649655 this.timeZone,
656+ this.toDict,
650657 this.topLevelToJson,
651658 this.topLevel,
652659 this.topLevelToString,
@@ -666,6 +673,7 @@ class TopLevel {
666673 this.unchecked,
667674 this.undefined,
668675 this.union,
676+ this.unmarshalJson,
669677 this.unowned,
670678 this.unsafe,
671679 this.unsigned,
@@ -814,6 +822,7 @@ class TopLevel {
814822 formatException: json["FormatException"],
815823 friend: json["friend"],
816824 from: json["from"],
825+ fromDict: json["from_dict"],
817826 topLevelFromJson: json["from_json"],
818827 func: json["func"],
819828 function: json["function"],
@@ -875,6 +884,7 @@ class TopLevel {
875884 long: json["long"],
876885 map: json["map"],
877886 mapEntry: json["MapEntry"],
887+ marshalJson: json["MarshalJSON"],
878888 metadataPropertyHandling: json["metadata_property_handling"],
879889 module: json["module"],
880890 mutable: json["mutable"],
@@ -989,6 +999,7 @@ class TopLevel {
989999 timeOnly: json["TimeOnly"],
9901000 timeOnlyConverter: json["TimeOnlyConverter"],
9911001 timeZone: json["TimeZone"],
1002+ toDict: json["to_dict"],
9921003 topLevelToJson: json["to_json"],
9931004 topLevel: json["top_level"],
9941005 topLevelToString: json["toString"],
@@ -1008,6 +1019,7 @@ class TopLevel {
10081019 unchecked: json["unchecked"],
10091020 undefined: json["undefined"],
10101021 union: json["union"],
1022+ unmarshalJson: json["UnmarshalJSON"],
10111023 unowned: json["unowned"],
10121024 unsafe: json["unsafe"],
10131025 unsigned: json["unsigned"],
@@ -1156,6 +1168,7 @@ class TopLevel {
11561168 "FormatException": formatException,
11571169 "friend": friend,
11581170 "from": from,
1171+ "from_dict": fromDict,
11591172 "from_json": topLevelFromJson,
11601173 "func": func,
11611174 "function": function,
@@ -1217,6 +1230,7 @@ class TopLevel {
12171230 "long": long,
12181231 "map": map,
12191232 "MapEntry": mapEntry,
1233+ "MarshalJSON": marshalJson,
12201234 "metadata_property_handling": metadataPropertyHandling,
12211235 "module": module,
12221236 "mutable": mutable,
@@ -1331,6 +1345,7 @@ class TopLevel {
13311345 "TimeOnly": timeOnly,
13321346 "TimeOnlyConverter": timeOnlyConverter,
13331347 "TimeZone": timeZone,
1348+ "to_dict": toDict,
13341349 "to_json": topLevelToJson,
13351350 "top_level": topLevel,
13361351 "toString": topLevelToString,
@@ -1350,6 +1365,7 @@ class TopLevel {
13501365 "unchecked": unchecked,
13511366 "undefined": undefined,
13521367 "union": union,
1368+ "UnmarshalJSON": unmarshalJson,
13531369 "unowned": unowned,
13541370 "unsafe": unsafe,
13551371 "unsigned": unsigned,
@@ -2296,6 +2312,16 @@ class From {
22962312 };
22972313 }
22982314
2315+class FromDict {
2316+ FromDict();
2317+
2318+ factory FromDict.fromJson(Map<String, dynamic> json) => FromDict(
2319+ );
2320+
2321+ Map<String, dynamic> toJson() => {
2322+ };
2323+}
2324+
22992325 class Func {
23002326 Func();
23012327
@@ -2816,6 +2842,16 @@ class MapEntryClass {
28162842 };
28172843 }
28182844
2845+class MarshalJson {
2846+ MarshalJson();
2847+
2848+ factory MarshalJson.fromJson(Map<String, dynamic> json) => MarshalJson(
2849+ );
2850+
2851+ Map<String, dynamic> toJson() => {
2852+ };
2853+}
2854+
28192855 class MetadataPropertyHandling {
28202856 MetadataPropertyHandling();
28212857
@@ -3846,6 +3882,16 @@ class TimeZone {
38463882 };
38473883 }
38483884
3885+class ToDict {
3886+ ToDict();
3887+
3888+ factory ToDict.fromJson(Map<String, dynamic> json) => ToDict(
3889+ );
3890+
3891+ Map<String, dynamic> toJson() => {
3892+ };
3893+}
3894+
38493895 class TopLevelClass {
38503896 TopLevelClass();
38513897
@@ -4576,6 +4622,16 @@ class Union {
45764622 };
45774623 }
45784624
4625+class UnmarshalJson {
4626+ UnmarshalJson();
4627+
4628+ factory UnmarshalJson.fromJson(Map<String, dynamic> json) => UnmarshalJson(
4629+ );
4630+
4631+ Map<String, dynamic> toJson() => {
4632+ };
4633+}
4634+
45794635 class Unowned {
45804636 Unowned();
Mschema-elixirdefault / QuickType.ex+177 −1
@@ -3224,6 +3224,35 @@ defmodule From do
32243224 end
32253225 end
32263226
3227+defmodule FromDict do
3228+ defstruct []
3229+
3230+ @type t :: %__MODULE__{
3231+ }
3232+
3233+ def from_map(m) when is_map(m) do
3234+ %FromDict{
3235+ }
3236+ end
3237+
3238+ def from_json(json) do
3239+ json
3240+ |> Jason.decode!()
3241+ |> from_map()
3242+ end
3243+
3244+ def to_map(_struct) do
3245+ %{
3246+ }
3247+ end
3248+
3249+ def to_json(struct) do
3250+ struct
3251+ |> to_map()
3252+ |> Jason.encode!()
3253+ end
3254+end
3255+
32273256 defmodule FromJSON do
32283257 defstruct []
32293258
@@ -4964,6 +4993,35 @@ defmodule MapEntry do
49644993 end
49654994 end
49664995
4996+defmodule MarshalJSON do
4997+ defstruct []
4998+
4999+ @type t :: %__MODULE__{
5000+ }
5001+
5002+ def from_map(m) when is_map(m) do
5003+ %MarshalJSON{
5004+ }
5005+ end
5006+
5007+ def from_json(json) do
5008+ json
5009+ |> Jason.decode!()
5010+ |> from_map()
5011+ end
5012+
5013+ def to_map(_struct) do
5014+ %{
5015+ }
5016+ end
5017+
5018+ def to_json(struct) do
5019+ struct
5020+ |> to_map()
5021+ |> Jason.encode!()
5022+ end
5023+end
5024+
49675025 defmodule MetadataPropertyHandling do
49685026 defstruct []
49695027
@@ -8067,6 +8125,35 @@ defmodule TimeZone do
80678125 end
80688126 end
80698127
8128+defmodule ToDict do
8129+ defstruct []
8130+
8131+ @type t :: %__MODULE__{
8132+ }
8133+
8134+ def from_map(m) when is_map(m) do
8135+ %ToDict{
8136+ }
8137+ end
8138+
8139+ def from_json(json) do
8140+ json
8141+ |> Jason.decode!()
8142+ |> from_map()
8143+ end
8144+
8145+ def to_map(_struct) do
8146+ %{
8147+ }
8148+ end
8149+
8150+ def to_json(struct) do
8151+ struct
8152+ |> to_map()
8153+ |> Jason.encode!()
8154+ end
8155+end
8156+
80708157 defmodule ToJSON do
80718158 defstruct []
80728159
@@ -9140,6 +9227,35 @@ defmodule Union do
91409227 end
91419228 end
91429229
9230+defmodule UnmarshalJSON do
9231+ defstruct []
9232+
9233+ @type t :: %__MODULE__{
9234+ }
9235+
9236+ def from_map(m) when is_map(m) do
9237+ %UnmarshalJSON{
9238+ }
9239+ end
9240+
9241+ def from_json(json) do
9242+ json
9243+ |> Jason.decode!()
9244+ |> from_map()
9245+ end
9246+
9247+ def to_map(_struct) do
9248+ %{
9249+ }
9250+ end
9251+
9252+ def to_json(struct) do
9253+ struct
9254+ |> to_map()
9255+ |> Jason.encode!()
9256+ end
9257+end
9258+
91439259 defmodule Unowned do
91449260 defstruct []
91459261
@@ -9808,7 +9924,7 @@ defmodule Yield do
98089924 end
98099925
98109926 defmodule TopLevel do
9811- defstruct [:empty, :top_level_bool, :complex, :imaginery, :abstract, :alignas, :alignof, :top_level_and, :and_eq, :top_level_any, :any, :array, :as, :asm, :assert, :associatedtype, :associativity, :async, :atomic, :atomic_cancel, :atomic_commit, :atomic_noexcept, :auto, :await, :base, :bitand, :bitor, :bool, :bool_1, :boolean, :break, :bycopy, :byref, :byte, :calendar, :case, :top_level_catch, :chan, :char, :char16_t, :char32_t, :checked, :top_level_class, :class, :clone, :co_await, :co_return, :co_yield, :codable, :coding_key, :coding_keys, :compl, :concept, :console, :const, :const_cast, :constexpr, :constructor, :continue, :convenience, :convert, :converter, :culture_info, :date, :date_parse_handling, :date_formatter, :date_only, :date_only_converter, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :top_level_def, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :top_level_do, :double, :dummy, :dynamic, :dynamic_cast, :elif, :top_level_else, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :top_level_false, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_json, :func, :function, :get, :global, :go, :goto, :guard, :hashable, :hash_code, :hasher, :has_own_property, :id, :if, :imp, :implements, :implicit, :top_level_import, :top_level_in, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_converter, :json_serializer, :json_token, :json_writer, :json_any, :json_coding_key, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_token_type, :k_serializer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :top_level_nil, :no, :noexcept, :nonatomic, :top_level_none, :none, :nonlocal, :nonmutating, :no_such_method, :top_level_not, :not_eq, :ns_error, :ns_object, :ns_string, :null, :top_level_null, :nullptr, :number, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :top_level_or, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :primitive_kind, :print, :printf, :print_members, :private, :protected, :protocol, :top_level_protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select, :self, :top_level_self, :sendable, :serial_descriptor, :serializable, :serialize, :serializer_provider, :serial_name, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_json, :top_level, :to_string, :transient, :top_level_true, :true_1, :try, :type, :top_level_type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unowned, :unsafe, :unsigned, :use_serializers, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield]
9927+ defstruct [:empty, :top_level_bool, :complex, :imaginery, :abstract, :alignas, :alignof, :top_level_and, :and_eq, :top_level_any, :any, :array, :as, :asm, :assert, :associatedtype, :associativity, :async, :atomic, :atomic_cancel, :atomic_commit, :atomic_noexcept, :auto, :await, :base, :bitand, :bitor, :bool, :bool_1, :boolean, :break, :bycopy, :byref, :byte, :calendar, :case, :top_level_catch, :chan, :char, :char16_t, :char32_t, :checked, :top_level_class, :class, :clone, :co_await, :co_return, :co_yield, :codable, :coding_key, :coding_keys, :compl, :concept, :console, :const, :const_cast, :constexpr, :constructor, :continue, :convenience, :convert, :converter, :culture_info, :date, :date_parse_handling, :date_formatter, :date_only, :date_only_converter, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :top_level_def, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :top_level_do, :double, :dummy, :dynamic, :dynamic_cast, :elif, :top_level_else, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :top_level_false, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_dict, :from_json, :func, :function, :get, :global, :go, :goto, :guard, :hashable, :hash_code, :hasher, :has_own_property, :id, :if, :imp, :implements, :implicit, :top_level_import, :top_level_in, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_converter, :json_serializer, :json_token, :json_writer, :json_any, :json_coding_key, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_token_type, :k_serializer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :top_level_nil, :no, :noexcept, :nonatomic, :top_level_none, :none, :nonlocal, :nonmutating, :no_such_method, :top_level_not, :not_eq, :ns_error, :ns_object, :ns_string, :null, :top_level_null, :nullptr, :number, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :top_level_or, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :primitive_kind, :print, :printf, :print_members, :private, :protected, :protocol, :top_level_protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select, :self, :top_level_self, :sendable, :serial_descriptor, :serializable, :serialize, :serializer_provider, :serial_name, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_dict, :to_json, :top_level, :to_string, :transient, :top_level_true, :true_1, :try, :type, :top_level_type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unmarshal_json, :unowned, :unsafe, :unsigned, :use_serializers, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield]
98129928
98139929 @type t :: %__MODULE__{
98149930 empty: Empty.t() | float() | nil,
@@ -9933,6 +10049,7 @@ defmodule TopLevel do
993310049 format_exception: FormatException.t() | float() | nil,
993410050 friend: Friend.t() | float() | nil,
993510051 from: From.t() | float() | nil,
10052+ from_dict: FromDict.t() | float() | nil,
993610053 from_json: FromJSON.t() | float() | nil,
993710054 func: Func.t() | float() | nil,
993810055 function: FunctionClass.t() | float() | nil,
@@ -9994,6 +10111,7 @@ defmodule TopLevel do
999410111 long: Long.t() | float() | nil,
999510112 map: MapClass.t() | float() | nil,
999610113 map_entry: MapEntry.t() | float() | nil,
10114+ marshal_json: MarshalJSON.t() | float() | nil,
999710115 metadata_property_handling: MetadataPropertyHandling.t() | float() | nil,
999810116 module: ModuleClass.t() | float() | nil,
999910117 mutable: Mutable.t() | float() | nil,
@@ -10108,6 +10226,7 @@ defmodule TopLevel do
1010810226 time_only: TimeOnly.t() | float() | nil,
1010910227 time_only_converter: TimeOnlyConverter.t() | float() | nil,
1011010228 time_zone: TimeZone.t() | float() | nil,
10229+ to_dict: ToDict.t() | float() | nil,
1011110230 to_json: ToJSON.t() | float() | nil,
1011210231 top_level: TopLevelClass.t() | float() | nil,
1011310232 to_string: ToString.t() | float() | nil,
@@ -10127,6 +10246,7 @@ defmodule TopLevel do
1012710246 unchecked: Unchecked.t() | float() | nil,
1012810247 undefined: Undefined.t() | float() | nil,
1012910248 union: Union.t() | float() | nil,
10249+ unmarshal_json: UnmarshalJSON.t() | float() | nil,
1013010250 unowned: Unowned.t() | float() | nil,
1013110251 unsafe: Unsafe.t() | float() | nil,
1013210252 unsigned: Unsigned.t() | float() | nil,
@@ -11612,6 +11732,18 @@ defmodule TopLevel do
1161211732 def encode_from(value) when is_nil(value), do: value
1161311733 def encode_from(_), do: {:error, "Unexpected type when encoding TopLevel.from"}
1161411734
11735+ def decode_from_dict(%{} = value), do: FromDict.from_map(value)
11736+ def decode_from_dict(value) when is_float(value), do: value
11737+ def decode_from_dict(value) when is_integer(value), do: value
11738+ def decode_from_dict(value) when is_nil(value), do: value
11739+ def decode_from_dict(_), do: {:error, "Unexpected type when decoding TopLevel.from_dict"}
11740+
11741+ def encode_from_dict(%FromDict{} = value), do: FromDict.to_map(value)
11742+ def encode_from_dict(value) when is_float(value), do: value
11743+ def encode_from_dict(value) when is_integer(value), do: value
11744+ def encode_from_dict(value) when is_nil(value), do: value
11745+ def encode_from_dict(_), do: {:error, "Unexpected type when encoding TopLevel.from_dict"}
11746+
1161511747 def decode_from_json(%{} = value), do: FromJSON.from_map(value)
1161611748 def decode_from_json(value) when is_float(value), do: value
1161711749 def decode_from_json(value) when is_integer(value), do: value
@@ -12344,6 +12476,18 @@ defmodule TopLevel do
1234412476 def encode_map_entry(value) when is_nil(value), do: value
1234512477 def encode_map_entry(_), do: {:error, "Unexpected type when encoding TopLevel.map_entry"}
1234612478
12479+ def decode_marshal_json(%{} = value), do: MarshalJSON.from_map(value)
12480+ def decode_marshal_json(value) when is_float(value), do: value
12481+ def decode_marshal_json(value) when is_integer(value), do: value
12482+ def decode_marshal_json(value) when is_nil(value), do: value
12483+ def decode_marshal_json(_), do: {:error, "Unexpected type when decoding TopLevel.marshal_json"}
12484+
12485+ def encode_marshal_json(%MarshalJSON{} = value), do: MarshalJSON.to_map(value)
12486+ def encode_marshal_json(value) when is_float(value), do: value
12487+ def encode_marshal_json(value) when is_integer(value), do: value
12488+ def encode_marshal_json(value) when is_nil(value), do: value
12489+ def encode_marshal_json(_), do: {:error, "Unexpected type when encoding TopLevel.marshal_json"}
12490+
1234712491 def decode_metadata_property_handling(%{} = value), do: MetadataPropertyHandling.from_map(value)
1234812492 def decode_metadata_property_handling(value) when is_float(value), do: value
1234912493 def decode_metadata_property_handling(value) when is_integer(value), do: value
@@ -13712,6 +13856,18 @@ defmodule TopLevel do
1371213856 def encode_time_zone(value) when is_nil(value), do: value
1371313857 def encode_time_zone(_), do: {:error, "Unexpected type when encoding TopLevel.time_zone"}
1371413858
13859+ def decode_to_dict(%{} = value), do: ToDict.from_map(value)
13860+ def decode_to_dict(value) when is_float(value), do: value
13861+ def decode_to_dict(value) when is_integer(value), do: value
13862+ def decode_to_dict(value) when is_nil(value), do: value
13863+ def decode_to_dict(_), do: {:error, "Unexpected type when decoding TopLevel.to_dict"}
13864+
13865+ def encode_to_dict(%ToDict{} = value), do: ToDict.to_map(value)
13866+ def encode_to_dict(value) when is_float(value), do: value
13867+ def encode_to_dict(value) when is_integer(value), do: value
13868+ def encode_to_dict(value) when is_nil(value), do: value
13869+ def encode_to_dict(_), do: {:error, "Unexpected type when encoding TopLevel.to_dict"}
13870+
1371513871 def decode_to_json(%{} = value), do: ToJSON.from_map(value)
1371613872 def decode_to_json(value) when is_float(value), do: value
1371713873 def decode_to_json(value) when is_integer(value), do: value
@@ -13940,6 +14096,18 @@ defmodule TopLevel do
1394014096 def encode_union(value) when is_nil(value), do: value
1394114097 def encode_union(_), do: {:error, "Unexpected type when encoding TopLevel.union"}
1394214098
14099+ def decode_unmarshal_json(%{} = value), do: UnmarshalJSON.from_map(value)
14100+ def decode_unmarshal_json(value) when is_float(value), do: value
14101+ def decode_unmarshal_json(value) when is_integer(value), do: value
14102+ def decode_unmarshal_json(value) when is_nil(value), do: value
14103+ def decode_unmarshal_json(_), do: {:error, "Unexpected type when decoding TopLevel.unmarshal_json"}
14104+
14105+ def encode_unmarshal_json(%UnmarshalJSON{} = value), do: UnmarshalJSON.to_map(value)
14106+ def encode_unmarshal_json(value) when is_float(value), do: value
14107+ def encode_unmarshal_json(value) when is_integer(value), do: value
14108+ def encode_unmarshal_json(value) when is_nil(value), do: value
14109+ def encode_unmarshal_json(_), do: {:error, "Unexpected type when encoding TopLevel.unmarshal_json"}
14110+
1394314111 def decode_unowned(%{} = value), do: Unowned.from_map(value)
1394414112 def decode_unowned(value) when is_float(value), do: value
1394514113 def decode_unowned(value) when is_integer(value), do: value
@@ -14340,6 +14508,7 @@ defmodule TopLevel do
1434014508 format_exception: decode_format_exception(m["FormatException"]),
1434114509 friend: decode_friend(m["friend"]),
1434214510 from: decode_from(m["from"]),
14511+ from_dict: decode_from_dict(m["from_dict"]),
1434314512 from_json: decode_from_json(m["from_json"]),
1434414513 func: decode_func(m["func"]),
1434514514 function: decode_function(m["function"]),
@@ -14401,6 +14570,7 @@ defmodule TopLevel do
1440114570 long: decode_long(m["long"]),
1440214571 map: decode_map(m["map"]),
1440314572 map_entry: decode_map_entry(m["MapEntry"]),
14573+ marshal_json: decode_marshal_json(m["MarshalJSON"]),
1440414574 metadata_property_handling: decode_metadata_property_handling(m["metadata_property_handling"]),
1440514575 module: decode_module(m["module"]),
1440614576 mutable: decode_mutable(m["mutable"]),
@@ -14515,6 +14685,7 @@ defmodule TopLevel do
1451514685 time_only: decode_time_only(m["TimeOnly"]),
1451614686 time_only_converter: decode_time_only_converter(m["TimeOnlyConverter"]),
1451714687 time_zone: decode_time_zone(m["TimeZone"]),
14688+ to_dict: decode_to_dict(m["to_dict"]),
1451814689 to_json: decode_to_json(m["to_json"]),
1451914690 top_level: decode_top_level(m["top_level"]),
1452014691 to_string: decode_to_string(m["toString"]),
@@ -14534,6 +14705,7 @@ defmodule TopLevel do
1453414705 unchecked: decode_unchecked(m["unchecked"]),
1453514706 undefined: decode_undefined(m["undefined"]),
1453614707 union: decode_union(m["union"]),
14708+ unmarshal_json: decode_unmarshal_json(m["UnmarshalJSON"]),
1453714709 unowned: decode_unowned(m["unowned"]),
1453814710 unsafe: decode_unsafe(m["unsafe"]),
1453914711 unsigned: decode_unsigned(m["unsigned"]),
@@ -14690,6 +14862,7 @@ defmodule TopLevel do
1469014862 "FormatException" => encode_format_exception(struct.format_exception),
1469114863 "friend" => encode_friend(struct.friend),
1469214864 "from" => encode_from(struct.from),
14865+ "from_dict" => encode_from_dict(struct.from_dict),
1469314866 "from_json" => encode_from_json(struct.from_json),
1469414867 "func" => encode_func(struct.func),
1469514868 "function" => encode_function(struct.function),
@@ -14751,6 +14924,7 @@ defmodule TopLevel do
1475114924 "long" => encode_long(struct.long),
1475214925 "map" => encode_map(struct.map),
1475314926 "MapEntry" => encode_map_entry(struct.map_entry),
14927+ "MarshalJSON" => encode_marshal_json(struct.marshal_json),
1475414928 "metadata_property_handling" => encode_metadata_property_handling(struct.metadata_property_handling),
1475514929 "module" => encode_module(struct.module),
1475614930 "mutable" => encode_mutable(struct.mutable),
@@ -14865,6 +15039,7 @@ defmodule TopLevel do
1486515039 "TimeOnly" => encode_time_only(struct.time_only),
1486615040 "TimeOnlyConverter" => encode_time_only_converter(struct.time_only_converter),
1486715041 "TimeZone" => encode_time_zone(struct.time_zone),
15042+ "to_dict" => encode_to_dict(struct.to_dict),
1486815043 "to_json" => encode_to_json(struct.to_json),
1486915044 "top_level" => encode_top_level(struct.top_level),
1487015045 "toString" => encode_to_string(struct.to_string),
@@ -14884,6 +15059,7 @@ defmodule TopLevel do
1488415059 "unchecked" => encode_unchecked(struct.unchecked),
1488515060 "undefined" => encode_undefined(struct.undefined),
1488615061 "union" => encode_union(struct.union),
15062+ "UnmarshalJSON" => encode_unmarshal_json(struct.unmarshal_json),
1488715063 "unowned" => encode_unowned(struct.unowned),
1488815064 "unsafe" => encode_unsafe(struct.unsafe),
1488915065 "unsigned" => encode_unsigned(struct.unsigned),
Mschema-elmdefault / QuickType.elm+140 −0
@@ -123,6 +123,7 @@ module QuickType exposing
123123 , FormatException
124124 , Friend
125125 , From
126+ , FromDict
126127 , FromJSON
127128 , Func
128129 , Function
@@ -179,6 +180,7 @@ module QuickType exposing
179180 , Long
180181 , Map
181182 , MapEntry
183+ , MarshalJSON
182184 , MetadataPropertyHandling
183185 , Mutable
184186 , Mutating
@@ -315,6 +317,7 @@ module QuickType exposing
315317 , TimeOnly
316318 , TimeOnlyConverter
317319 , TimeZone
320+ , ToDict
318321 , ToJSON
319322 , ToString
320323 , TopLevel
@@ -331,6 +334,7 @@ module QuickType exposing
331334 , Unchecked
332335 , Undefined
333336 , Union
337+ , UnmarshalJSON
334338 , Unowned
335339 , Unsafe
336340 , Unsigned
@@ -461,6 +465,7 @@ module QuickType exposing
461465 , UnionFormatException(..)
462466 , UnionFriend(..)
463467 , UnionFrom(..)
468+ , UnionFromDict(..)
464469 , UnionFromJSON(..)
465470 , UnionFunc(..)
466471 , UnionFunction(..)
@@ -517,6 +522,7 @@ module QuickType exposing
517522 , UnionLong(..)
518523 , UnionMap(..)
519524 , UnionMapEntry(..)
525+ , UnionMarshalJSON(..)
520526 , UnionMetadataPropertyHandling(..)
521527 , UnionMutable(..)
522528 , UnionMutating(..)
@@ -653,6 +659,7 @@ module QuickType exposing
653659 , UnionTimeOnly(..)
654660 , UnionTimeOnlyConverter(..)
655661 , UnionTimeZone(..)
662+ , UnionToDict(..)
656663 , UnionToJSON(..)
657664 , UnionToString(..)
658665 , UnionTopLevel(..)
@@ -669,6 +676,7 @@ module QuickType exposing
669676 , UnionUnchecked(..)
670677 , UnionUndefined(..)
671678 , UnionUnionUnion(..)
679+ , UnionUnmarshalJSON(..)
672680 , UnionUnowned(..)
673681 , UnionUnsafe(..)
674682 , UnionUnsigned(..)
@@ -821,6 +829,7 @@ type alias QuickType =
821829 , formatException : Maybe UnionFormatException
822830 , friend : Maybe UnionFriend
823831 , from : Maybe UnionFrom
832+ , fromDict : Maybe UnionFromDict
824833 , fromJSON : Maybe UnionFromJSON
825834 , func : Maybe UnionFunc
826835 , function : Maybe UnionFunction
@@ -882,6 +891,7 @@ type alias QuickType =
882891 , long : Maybe UnionLong
883892 , map : Maybe UnionMap
884893 , mapEntry : Maybe UnionMapEntry
894+ , marshalJSON : Maybe UnionMarshalJSON
885895 , metadataPropertyHandling : Maybe UnionMetadataPropertyHandling
886896 , quickTypeModule : Maybe UnionModule
887897 , mutable : Maybe UnionMutable
@@ -996,6 +1006,7 @@ type alias QuickType =
9961006 , timeOnly : Maybe UnionTimeOnly
9971007 , timeOnlyConverter : Maybe UnionTimeOnlyConverter
9981008 , timeZone : Maybe UnionTimeZone
1009+ , toDict : Maybe UnionToDict
9991010 , toJSON : Maybe UnionToJSON
10001011 , topLevel : Maybe UnionTopLevel
10011012 , toString : Maybe UnionToString
@@ -1015,6 +1026,7 @@ type alias QuickType =
10151026 , unchecked : Maybe UnionUnchecked
10161027 , undefined : Maybe UnionUndefined
10171028 , union : Maybe UnionUnionUnion
1029+ , unmarshalJSON : Maybe UnionUnmarshalJSON
10181030 , unowned : Maybe UnionUnowned
10191031 , unsafe : Maybe UnionUnsafe
10201032 , unsigned : Maybe UnionUnsigned
@@ -1904,6 +1916,14 @@ type alias From =
19041916 {
19051917 }
19061918
1919+type UnionFromDict
1920+ = DoubleInUnionFromDict Float
1921+ | FromDictInUnionFromDict FromDict
1922+
1923+type alias FromDict =
1924+ {
1925+ }
1926+
19071927 type UnionFromJSON
19081928 = DoubleInUnionFromJSON Float
19091929 | FromJSONInUnionFromJSON FromJSON
@@ -2352,6 +2372,14 @@ type alias MapEntry =
23522372 {
23532373 }
23542374
2375+type UnionMarshalJSON
2376+ = DoubleInUnionMarshalJSON Float
2377+ | MarshalJSONInUnionMarshalJSON MarshalJSON
2378+
2379+type alias MarshalJSON =
2380+ {
2381+ }
2382+
23552383 type UnionMetadataPropertyHandling
23562384 = DoubleInUnionMetadataPropertyHandling Float
23572385 | MetadataPropertyHandlingInUnionMetadataPropertyHandling MetadataPropertyHandling
@@ -3440,6 +3468,14 @@ type alias TimeZone =
34403468 {
34413469 }
34423470
3471+type UnionToDict
3472+ = DoubleInUnionToDict Float
3473+ | ToDictInUnionToDict ToDict
3474+
3475+type alias ToDict =
3476+ {
3477+ }
3478+
34433479 type UnionToJSON
34443480 = DoubleInUnionToJSON Float
34453481 | ToJSONInUnionToJSON ToJSON
@@ -3568,6 +3604,14 @@ type alias Union =
35683604 {
35693605 }
35703606
3607+type UnionUnmarshalJSON
3608+ = DoubleInUnionUnmarshalJSON Float
3609+ | UnmarshalJSONInUnionUnmarshalJSON UnmarshalJSON
3610+
3611+type alias UnmarshalJSON =
3612+ {
3613+ }
3614+
35713615 type UnionUnowned
35723616 = DoubleInUnionUnowned Float
35733617 | UnownedInUnionUnowned Unowned
@@ -3880,6 +3924,7 @@ quickType =
38803924 |> Jpipe.custom (optionalField "FormatException" (Jdec.map Just unionFormatException) Nothing)
38813925 |> Jpipe.custom (optionalField "friend" (Jdec.map Just unionFriend) Nothing)
38823926 |> Jpipe.custom (optionalField "from" (Jdec.map Just unionFrom) Nothing)
3927+ |> Jpipe.custom (optionalField "from_dict" (Jdec.map Just unionFromDict) Nothing)
38833928 |> Jpipe.custom (optionalField "from_json" (Jdec.map Just unionFromJSON) Nothing)
38843929 |> Jpipe.custom (optionalField "func" (Jdec.map Just unionFunc) Nothing)
38853930 |> Jpipe.custom (optionalField "function" (Jdec.map Just unionFunction) Nothing)
@@ -3941,6 +3986,7 @@ quickType =
39413986 |> Jpipe.custom (optionalField "long" (Jdec.map Just unionLong) Nothing)
39423987 |> Jpipe.custom (optionalField "map" (Jdec.map Just unionMap) Nothing)
39433988 |> Jpipe.custom (optionalField "MapEntry" (Jdec.map Just unionMapEntry) Nothing)
3989+ |> Jpipe.custom (optionalField "MarshalJSON" (Jdec.map Just unionMarshalJSON) Nothing)
39443990 |> Jpipe.custom (optionalField "metadata_property_handling" (Jdec.map Just unionMetadataPropertyHandling) Nothing)
39453991 |> Jpipe.custom (optionalField "module" (Jdec.map Just unionModule) Nothing)
39463992 |> Jpipe.custom (optionalField "mutable" (Jdec.map Just unionMutable) Nothing)
@@ -4055,6 +4101,7 @@ quickType =
40554101 |> Jpipe.custom (optionalField "TimeOnly" (Jdec.map Just unionTimeOnly) Nothing)
40564102 |> Jpipe.custom (optionalField "TimeOnlyConverter" (Jdec.map Just unionTimeOnlyConverter) Nothing)
40574103 |> Jpipe.custom (optionalField "TimeZone" (Jdec.map Just unionTimeZone) Nothing)
4104+ |> Jpipe.custom (optionalField "to_dict" (Jdec.map Just unionToDict) Nothing)
40584105 |> Jpipe.custom (optionalField "to_json" (Jdec.map Just unionToJSON) Nothing)
40594106 |> Jpipe.custom (optionalField "top_level" (Jdec.map Just unionTopLevel) Nothing)
40604107 |> Jpipe.custom (optionalField "toString" (Jdec.map Just unionToString) Nothing)
@@ -4074,6 +4121,7 @@ quickType =
40744121 |> Jpipe.custom (optionalField "unchecked" (Jdec.map Just unionUnchecked) Nothing)
40754122 |> Jpipe.custom (optionalField "undefined" (Jdec.map Just unionUndefined) Nothing)
40764123 |> Jpipe.custom (optionalField "union" (Jdec.map Just unionUnionUnion) Nothing)
4124+ |> Jpipe.custom (optionalField "UnmarshalJSON" (Jdec.map Just unionUnmarshalJSON) Nothing)
40774125 |> Jpipe.custom (optionalField "unowned" (Jdec.map Just unionUnowned) Nothing)
40784126 |> Jpipe.custom (optionalField "unsafe" (Jdec.map Just unionUnsafe) Nothing)
40794127 |> Jpipe.custom (optionalField "unsigned" (Jdec.map Just unionUnsigned) Nothing)
@@ -4223,6 +4271,7 @@ encodeQuickType x =
42234271 , ("FormatException", makeNullableEncoder encodeUnionFormatException x.formatException)
42244272 , ("friend", makeNullableEncoder encodeUnionFriend x.friend)
42254273 , ("from", makeNullableEncoder encodeUnionFrom x.from)
4274+ , ("from_dict", makeNullableEncoder encodeUnionFromDict x.fromDict)
42264275 , ("from_json", makeNullableEncoder encodeUnionFromJSON x.fromJSON)
42274276 , ("func", makeNullableEncoder encodeUnionFunc x.func)
42284277 , ("function", makeNullableEncoder encodeUnionFunction x.function)
@@ -4284,6 +4333,7 @@ encodeQuickType x =
42844333 , ("long", makeNullableEncoder encodeUnionLong x.long)
42854334 , ("map", makeNullableEncoder encodeUnionMap x.map)
42864335 , ("MapEntry", makeNullableEncoder encodeUnionMapEntry x.mapEntry)
4336+ , ("MarshalJSON", makeNullableEncoder encodeUnionMarshalJSON x.marshalJSON)
42874337 , ("metadata_property_handling", makeNullableEncoder encodeUnionMetadataPropertyHandling x.metadataPropertyHandling)
42884338 , ("module", makeNullableEncoder encodeUnionModule x.quickTypeModule)
42894339 , ("mutable", makeNullableEncoder encodeUnionMutable x.mutable)
@@ -4398,6 +4448,7 @@ encodeQuickType x =
43984448 , ("TimeOnly", makeNullableEncoder encodeUnionTimeOnly x.timeOnly)
43994449 , ("TimeOnlyConverter", makeNullableEncoder encodeUnionTimeOnlyConverter x.timeOnlyConverter)
44004450 , ("TimeZone", makeNullableEncoder encodeUnionTimeZone x.timeZone)
4451+ , ("to_dict", makeNullableEncoder encodeUnionToDict x.toDict)
44014452 , ("to_json", makeNullableEncoder encodeUnionToJSON x.toJSON)
44024453 , ("top_level", makeNullableEncoder encodeUnionTopLevel x.topLevel)
44034454 , ("toString", makeNullableEncoder encodeUnionToString x.toString)
@@ -4417,6 +4468,7 @@ encodeQuickType x =
44174468 , ("unchecked", makeNullableEncoder encodeUnionUnchecked x.unchecked)
44184469 , ("undefined", makeNullableEncoder encodeUnionUndefined x.undefined)
44194470 , ("union", makeNullableEncoder encodeUnionUnionUnion x.union)
4471+ , ("UnmarshalJSON", makeNullableEncoder encodeUnionUnmarshalJSON x.unmarshalJSON)
44204472 , ("unowned", makeNullableEncoder encodeUnionUnowned x.unowned)
44214473 , ("unsafe", makeNullableEncoder encodeUnionUnsafe x.unsafe)
44224474 , ("unsigned", makeNullableEncoder encodeUnionUnsigned x.unsigned)
@@ -6818,6 +6870,28 @@ encodeFrom x =
68186870 [
68196871 ]
68206872
6873+unionFromDict : Jdec.Decoder UnionFromDict
6874+unionFromDict =
6875+ Jdec.oneOf
6876+ [ Jdec.map DoubleInUnionFromDict Jdec.float
6877+ , Jdec.map FromDictInUnionFromDict fromDict
6878+ ]
6879+
6880+encodeUnionFromDict : UnionFromDict -> Jenc.Value
6881+encodeUnionFromDict x = case x of
6882+ DoubleInUnionFromDict y -> Jenc.float y
6883+ FromDictInUnionFromDict y -> encodeFromDict y
6884+
6885+fromDict : Jdec.Decoder FromDict
6886+fromDict =
6887+ Jdec.dict Jdec.value |> Jdec.map (\_ -> FromDict)
6888+
6889+encodeFromDict : FromDict -> Jenc.Value
6890+encodeFromDict x =
6891+ Jenc.object
6892+ [
6893+ ]
6894+
68216895 unionFromJSON : Jdec.Decoder UnionFromJSON
68226896 unionFromJSON =
68236897 Jdec.oneOf
@@ -8050,6 +8124,28 @@ encodeMapEntry x =
80508124 [
80518125 ]
80528126
8127+unionMarshalJSON : Jdec.Decoder UnionMarshalJSON
8128+unionMarshalJSON =
8129+ Jdec.oneOf
8130+ [ Jdec.map DoubleInUnionMarshalJSON Jdec.float
8131+ , Jdec.map MarshalJSONInUnionMarshalJSON marshalJSON
8132+ ]
8133+
8134+encodeUnionMarshalJSON : UnionMarshalJSON -> Jenc.Value
8135+encodeUnionMarshalJSON x = case x of
8136+ DoubleInUnionMarshalJSON y -> Jenc.float y
8137+ MarshalJSONInUnionMarshalJSON y -> encodeMarshalJSON y
8138+
8139+marshalJSON : Jdec.Decoder MarshalJSON
8140+marshalJSON =
8141+ Jdec.dict Jdec.value |> Jdec.map (\_ -> MarshalJSON)
8142+
8143+encodeMarshalJSON : MarshalJSON -> Jenc.Value
8144+encodeMarshalJSON x =
8145+ Jenc.object
8146+ [
8147+ ]
8148+
80538149 unionMetadataPropertyHandling : Jdec.Decoder UnionMetadataPropertyHandling
80548150 unionMetadataPropertyHandling =
80558151 Jdec.oneOf
@@ -11042,6 +11138,28 @@ encodeTimeZone x =
1104211138 [
1104311139 ]
1104411140
11141+unionToDict : Jdec.Decoder UnionToDict
11142+unionToDict =
11143+ Jdec.oneOf
11144+ [ Jdec.map DoubleInUnionToDict Jdec.float
11145+ , Jdec.map ToDictInUnionToDict toDict
11146+ ]
11147+
11148+encodeUnionToDict : UnionToDict -> Jenc.Value
11149+encodeUnionToDict x = case x of
11150+ DoubleInUnionToDict y -> Jenc.float y
11151+ ToDictInUnionToDict y -> encodeToDict y
11152+
11153+toDict : Jdec.Decoder ToDict
11154+toDict =
11155+ Jdec.dict Jdec.value |> Jdec.map (\_ -> ToDict)
11156+
11157+encodeToDict : ToDict -> Jenc.Value
11158+encodeToDict x =
11159+ Jenc.object
11160+ [
11161+ ]
11162+
1104511163 unionToJSON : Jdec.Decoder UnionToJSON
1104611164 unionToJSON =
1104711165 Jdec.oneOf
@@ -11394,6 +11512,28 @@ encodeUnion x =
1139411512 [
1139511513 ]
1139611514
11515+unionUnmarshalJSON : Jdec.Decoder UnionUnmarshalJSON
11516+unionUnmarshalJSON =
11517+ Jdec.oneOf
11518+ [ Jdec.map DoubleInUnionUnmarshalJSON Jdec.float
11519+ , Jdec.map UnmarshalJSONInUnionUnmarshalJSON unmarshalJSON
11520+ ]
11521+
11522+encodeUnionUnmarshalJSON : UnionUnmarshalJSON -> Jenc.Value
11523+encodeUnionUnmarshalJSON x = case x of
11524+ DoubleInUnionUnmarshalJSON y -> Jenc.float y
11525+ UnmarshalJSONInUnionUnmarshalJSON y -> encodeUnmarshalJSON y
11526+
11527+unmarshalJSON : Jdec.Decoder UnmarshalJSON
11528+unmarshalJSON =
11529+ Jdec.dict Jdec.value |> Jdec.map (\_ -> UnmarshalJSON)
11530+
11531+encodeUnmarshalJSON : UnmarshalJSON -> Jenc.Value
11532+encodeUnmarshalJSON x =
11533+ Jenc.object
11534+ [
11535+ ]
11536+
1139711537 unionUnowned : Jdec.Decoder UnionUnowned
1139811538 unionUnowned =
1139911539 Jdec.oneOf
Mschema-flowdefault / TopLevel.js+38 −2
@@ -132,6 +132,7 @@ export type TopLevel = {
132132 FormatException?: UnionFormatException;
133133 friend?: UnionFriend;
134134 from?: UnionFrom;
135+ from_dict?: UnionFromDict;
135136 from_json?: UnionFromJSON;
136137 func?: UnionFunc;
137138 function?: UnionFunction;
@@ -193,6 +194,7 @@ export type TopLevel = {
193194 long?: UnionLong;
194195 map?: UnionMap;
195196 MapEntry?: UnionMapEntry;
197+ MarshalJSON?: UnionMarshalJSON;
196198 metadata_property_handling?: UnionMetadataPropertyHandling;
197199 module?: UnionModule;
198200 mutable?: UnionMutable;
@@ -307,6 +309,7 @@ export type TopLevel = {
307309 TimeOnly?: UnionTimeOnly;
308310 TimeOnlyConverter?: UnionTimeOnlyConverter;
309311 TimeZone?: UnionTimeZone;
312+ to_dict?: UnionToDict;
310313 to_json?: UnionToJSON;
311314 top_level?: UnionTopLevel;
312315 toString?: UnionToString;
@@ -326,6 +329,7 @@ export type TopLevel = {
326329 unchecked?: UnionUnchecked;
327330 undefined?: UnionUndefined;
328331 union?: UnionUnionUnion;
332+ UnmarshalJSON?: UnionUnmarshalJSON;
329333 unowned?: UnionUnowned;
330334 unsafe?: UnionUnsafe;
331335 unsigned?: UnionUnsigned;
@@ -542,6 +546,11 @@ export type UnionMapEntry = MapEntry | number;
542546 export type MapEntry = {
543547 };
544548
549+export type UnionMarshalJSON = MarshalJSON | number;
550+
551+export type MarshalJSON = {
552+};
553+
545554 export type UnionNO = No | number;
546555
547556 export type No = {
@@ -677,6 +686,11 @@ export type UnionUUID = UUID | number;
677686 export type UUID = {
678687 };
679688
689+export type UnionUnmarshalJSON = UnmarshalJSON | number;
690+
691+export type UnmarshalJSON = {
692+};
693+
680694 export type UnionUseSerializers = UseSerializers | number;
681695
682696 export type UseSerializers = {
@@ -1202,6 +1216,11 @@ export type UnionFrom = From | number;
12021216 export type From = {
12031217 };
12041218
1219+export type UnionFromDict = FromDict | number;
1220+
1221+export type FromDict = {
1222+};
1223+
12051224 export type UnionFromJSON = FromJSON | number;
12061225
12071226 export type FromJSON = {
@@ -1872,6 +1891,11 @@ export type UnionToString = ToString | number;
18721891 export type ToString = {
18731892 };
18741893
1894+export type UnionToDict = ToDict | number;
1895+
1896+export type ToDict = {
1897+};
1898+
18751899 export type UnionToJSON = ToJSON | number;
18761900
18771901 export type ToJSON = {
@@ -2136,7 +2160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
21362160 if (val === null || typeof val !== "object" || Array.isArray(val)) {
21372161 return invalidValue(l(ref || "object"), val, key, parent);
21382162 }
2139- const result: any = {};
2163+ const result: any = Object.create(null);
21402164 Object.getOwnPropertyNames(props).forEach(key => {
21412165 const prop = props[key];
21422166 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -2147,7 +2171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
21472171 result[key] = transform(val[key], additional, getProps, key, ref);
21482172 }
21492173 });
2150- return result;
2174+ return Object.setPrototypeOf(result, Object.prototype);
21512175 }
21522176
21532177 if (typ === "any") return val;
@@ -2350,6 +2374,7 @@ const typeMap: any = {
23502374 { json: "FormatException", js: "FormatException", typ: u(undefined, u(r("FormatException"), 3.14)) },
23512375 { json: "friend", js: "friend", typ: u(undefined, u(r("Friend"), 3.14)) },
23522376 { json: "from", js: "from", typ: u(undefined, u(r("From"), 3.14)) },
2377+ { json: "from_dict", js: "from_dict", typ: u(undefined, u(r("FromDict"), 3.14)) },
23532378 { json: "from_json", js: "from_json", typ: u(undefined, u(r("FromJSON"), 3.14)) },
23542379 { json: "func", js: "func", typ: u(undefined, u(r("Func"), 3.14)) },
23552380 { json: "function", js: "function", typ: u(undefined, u(r("Function"), 3.14)) },
@@ -2411,6 +2436,7 @@ const typeMap: any = {
24112436 { json: "long", js: "long", typ: u(undefined, u(r("Long"), 3.14)) },
24122437 { json: "map", js: "map", typ: u(undefined, u(r("Map"), 3.14)) },
24132438 { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(r("MapEntry"), 3.14)) },
2439+ { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(r("MarshalJSON"), 3.14)) },
24142440 { json: "metadata_property_handling", js: "metadata_property_handling", typ: u(undefined, u(r("MetadataPropertyHandling"), 3.14)) },
24152441 { json: "module", js: "module", typ: u(undefined, u(r("Module"), 3.14)) },
24162442 { json: "mutable", js: "mutable", typ: u(undefined, u(r("Mutable"), 3.14)) },
@@ -2525,6 +2551,7 @@ const typeMap: any = {
25252551 { json: "TimeOnly", js: "TimeOnly", typ: u(undefined, u(r("TimeOnly"), 3.14)) },
25262552 { json: "TimeOnlyConverter", js: "TimeOnlyConverter", typ: u(undefined, u(r("TimeOnlyConverter"), 3.14)) },
25272553 { json: "TimeZone", js: "TimeZone", typ: u(undefined, u(r("TimeZone"), 3.14)) },
2554+ { json: "to_dict", js: "to_dict", typ: u(undefined, u(r("ToDict"), 3.14)) },
25282555 { json: "to_json", js: "to_json", typ: u(undefined, u(r("ToJSON"), 3.14)) },
25292556 { json: "top_level", js: "top_level", typ: u(undefined, u(r("TopLevelClass"), 3.14)) },
25302557 { json: "toString", js: "toString", typ: u(undefined, u(r("ToString"), 3.14)) },
@@ -2544,6 +2571,7 @@ const typeMap: any = {
25442571 { json: "unchecked", js: "unchecked", typ: u(undefined, u(r("Unchecked"), 3.14)) },
25452572 { json: "undefined", js: "undefined", typ: u(undefined, u(r("Undefined"), 3.14)) },
25462573 { json: "union", js: "union", typ: u(undefined, u(r("Union"), 3.14)) },
2574+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: u(undefined, u(r("UnmarshalJSON"), 3.14)) },
25472575 { json: "unowned", js: "unowned", typ: u(undefined, u(r("Unowned"), 3.14)) },
25482576 { json: "unsafe", js: "unsafe", typ: u(undefined, u(r("Unsafe"), 3.14)) },
25492577 { json: "unsigned", js: "unsigned", typ: u(undefined, u(r("Unsigned"), 3.14)) },
@@ -2644,6 +2672,8 @@ const typeMap: any = {
26442672 ], false),
26452673 "MapEntry": o([
26462674 ], false),
2675+ "MarshalJSON": o([
2676+ ], false),
26472677 "No": o([
26482678 ], false),
26492679 "NSError": o([
@@ -2698,6 +2728,8 @@ const typeMap: any = {
26982728 ], false),
26992729 "UUID": o([
27002730 ], false),
2731+ "UnmarshalJSON": o([
2732+ ], false),
27012733 "UseSerializers": o([
27022734 ], false),
27032735 "Utf8JSONReader": o([
@@ -2908,6 +2940,8 @@ const typeMap: any = {
29082940 ], false),
29092941 "From": o([
29102942 ], false),
2943+ "FromDict": o([
2944+ ], false),
29112945 "FromJSON": o([
29122946 ], false),
29132947 "Func": o([
@@ -3176,6 +3210,8 @@ const typeMap: any = {
31763210 ], false),
31773211 "ToString": o([
31783212 ], false),
3213+ "ToDict": o([
3214+ ], false),
31793215 "ToJSON": o([
31803216 ], false),
31813217 "TopLevelClass": o([
Mschema-golangdefault / quicktype.go+104 −0
@@ -144,6 +144,7 @@ type TopLevel struct {
144144 FormatException *UnionFormatException `json:"FormatException"`
145145 Friend *UnionFriend `json:"friend"`
146146 From *UnionFrom `json:"from"`
147+ FromDict *UnionFromDict `json:"from_dict"`
147148 FromJSON *UnionFromJSON `json:"from_json"`
148149 Func *UnionFunc `json:"func"`
149150 Function *UnionFunction `json:"function"`
@@ -205,6 +206,7 @@ type TopLevel struct {
205206 Long *UnionLong `json:"long"`
206207 Map *UnionMap `json:"map"`
207208 MapEntry *UnionMapEntry `json:"MapEntry"`
209+ MarshalJSON *UnionMarshalJSON `json:"MarshalJSON"`
208210 MetadataPropertyHandling *UnionMetadataPropertyHandling `json:"metadata_property_handling"`
209211 Module *UnionModule `json:"module"`
210212 Mutable *UnionMutable `json:"mutable"`
@@ -319,6 +321,7 @@ type TopLevel struct {
319321 TimeOnly *UnionTimeOnly `json:"TimeOnly"`
320322 TimeOnlyConverter *UnionTimeOnlyConverter `json:"TimeOnlyConverter"`
321323 TimeZone *UnionTimeZone `json:"TimeZone"`
324+ ToDict *UnionToDict `json:"to_dict"`
322325 ToJSON *UnionToJSON `json:"to_json"`
323326 TopLevel *UnionTopLevel `json:"top_level"`
324327 ToString *UnionToString `json:"toString"`
@@ -338,6 +341,7 @@ type TopLevel struct {
338341 Unchecked *UnionUnchecked `json:"unchecked"`
339342 Undefined *UnionUndefined `json:"undefined"`
340343 Union *UnionUnionUnion `json:"union"`
344+ UnmarshalJSON *UnionUnmarshalJSON `json:"UnmarshalJSON"`
341345 Unowned *UnionUnowned `json:"unowned"`
342346 Unsafe *UnionUnsafe `json:"unsafe"`
343347 Unsigned *UnionUnsigned `json:"unsigned"`
@@ -708,6 +712,9 @@ type Friend struct {
708712 type From struct {
709713 }
710714
715+type FromDict struct {
716+}
717+
711718 type FromJSON struct {
712719 }
713720
@@ -894,6 +901,9 @@ type Map struct {
894901 type MapEntry struct {
895902 }
896903
904+type MarshalJSON struct {
905+}
906+
897907 type MetadataPropertyHandling struct {
898908 }
899909
@@ -1227,6 +1237,9 @@ type TimeOnlyConverter struct {
12271237 type TimeZone struct {
12281238 }
12291239
1240+type ToDict struct {
1241+}
1242+
12301243 type ToJSON struct {
12311244 }
12321245
@@ -1311,6 +1324,9 @@ type Undefined struct {
13111324 type Union struct {
13121325 }
13131326
1327+type UnmarshalJSON struct {
1328+}
1329+
13141330 type Unowned struct {
13151331 }
13161332
@@ -3907,6 +3923,28 @@ func (x *UnionFrom) MarshalJSON() ([]byte, error) {
39073923 return marshalUnion(nil, x.Double, nil, nil, false, nil, x.From != nil, x.From, false, nil, false, nil, false)
39083924 }
39093925
3926+type UnionFromDict struct {
3927+ Double *float64
3928+ FromDict *FromDict
3929+}
3930+
3931+func (x *UnionFromDict) UnmarshalJSON(data []byte) error {
3932+ x.FromDict = nil
3933+ var c FromDict
3934+ object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false)
3935+ if err != nil {
3936+ return err
3937+ }
3938+ if object {
3939+ x.FromDict = &c
3940+ }
3941+ return nil
3942+}
3943+
3944+func (x *UnionFromDict) MarshalJSON() ([]byte, error) {
3945+ return marshalUnion(nil, x.Double, nil, nil, false, nil, x.FromDict != nil, x.FromDict, false, nil, false, nil, false)
3946+}
3947+
39103948 type UnionFromJSON struct {
39113949 Double *float64
39123950 FromJSON *FromJSON
@@ -5271,6 +5309,28 @@ func (x *UnionMapEntry) MarshalJSON() ([]byte, error) {
52715309 return marshalUnion(nil, x.Double, nil, nil, false, nil, x.MapEntry != nil, x.MapEntry, false, nil, false, nil, false)
52725310 }
52735311
5312+type UnionMarshalJSON struct {
5313+ Double *float64
5314+ PurpleMarshalJSON *MarshalJSON
5315+}
5316+
5317+func (x *UnionMarshalJSON) UnmarshalJSON(data []byte) error {
5318+ x.PurpleMarshalJSON = nil
5319+ var c MarshalJSON
5320+ object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false)
5321+ if err != nil {
5322+ return err
5323+ }
5324+ if object {
5325+ x.PurpleMarshalJSON = &c
5326+ }
5327+ return nil
5328+}
5329+
5330+func (x *UnionMarshalJSON) MarshalJSON() ([]byte, error) {
5331+ return marshalUnion(nil, x.Double, nil, nil, false, nil, x.PurpleMarshalJSON != nil, x.PurpleMarshalJSON, false, nil, false, nil, false)
5332+}
5333+
52745334 type UnionMetadataPropertyHandling struct {
52755335 Double *float64
52765336 MetadataPropertyHandling *MetadataPropertyHandling
@@ -7713,6 +7773,28 @@ func (x *UnionTimeZone) MarshalJSON() ([]byte, error) {
77137773 return marshalUnion(nil, x.Double, nil, nil, false, nil, x.TimeZone != nil, x.TimeZone, false, nil, false, nil, false)
77147774 }
77157775
7776+type UnionToDict struct {
7777+ Double *float64
7778+ ToDict *ToDict
7779+}
7780+
7781+func (x *UnionToDict) UnmarshalJSON(data []byte) error {
7782+ x.ToDict = nil
7783+ var c ToDict
7784+ object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false)
7785+ if err != nil {
7786+ return err
7787+ }
7788+ if object {
7789+ x.ToDict = &c
7790+ }
7791+ return nil
7792+}
7793+
7794+func (x *UnionToDict) MarshalJSON() ([]byte, error) {
7795+ return marshalUnion(nil, x.Double, nil, nil, false, nil, x.ToDict != nil, x.ToDict, false, nil, false, nil, false)
7796+}
7797+
77167798 type UnionToJSON struct {
77177799 Double *float64
77187800 ToJSON *ToJSON
@@ -8329,6 +8411,28 @@ func (x *UnionUnionUnion) MarshalJSON() ([]byte, error) {
83298411 return marshalUnion(nil, x.Double, nil, nil, false, nil, x.Union != nil, x.Union, false, nil, false, nil, false)
83308412 }
83318413
8414+type UnionUnmarshalJSON struct {
8415+ Double *float64
8416+ PurpleUnmarshalJSON *UnmarshalJSON
8417+}
8418+
8419+func (x *UnionUnmarshalJSON) UnmarshalJSON(data []byte) error {
8420+ x.PurpleUnmarshalJSON = nil
8421+ var c UnmarshalJSON
8422+ object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false)
8423+ if err != nil {
8424+ return err
8425+ }
8426+ if object {
8427+ x.PurpleUnmarshalJSON = &c
8428+ }
8429+ return nil
8430+}
8431+
8432+func (x *UnionUnmarshalJSON) MarshalJSON() ([]byte, error) {
8433+ return marshalUnion(nil, x.Double, nil, nil, false, nil, x.PurpleUnmarshalJSON != nil, x.PurpleUnmarshalJSON, false, nil, false, nil, false)
8434+}
8435+
83328436 type UnionUnowned struct {
83338437 Double *float64
83348438 Unowned *Unowned
Mschema-haskelldefault / QuickType.hs+113 −1
@@ -112,6 +112,7 @@ module QuickType
112112 , FormatException (..)
113113 , Friend (..)
114114 , From (..)
115+ , FromDict (..)
115116 , FromJSONClass (..)
116117 , Func (..)
117118 , Function (..)
@@ -168,6 +169,7 @@ module QuickType
168169 , Long (..)
169170 , MapClass (..)
170171 , MapEntry (..)
172+ , MarshalJSON (..)
171173 , MetadataPropertyHandling (..)
172174 , Mutable (..)
173175 , Mutating (..)
@@ -303,6 +305,7 @@ module QuickType
303305 , TimeOnly (..)
304306 , TimeOnlyConverter (..)
305307 , TimeZone (..)
308+ , ToDict (..)
306309 , ToJSONClass (..)
307310 , ToString (..)
308311 , TopLevel (..)
@@ -319,6 +322,7 @@ module QuickType
319322 , Unchecked (..)
320323 , Undefined (..)
321324 , Union (..)
325+ , UnmarshalJSON (..)
322326 , Unowned (..)
323327 , Unsafe (..)
324328 , Unsigned (..)
@@ -450,6 +454,7 @@ module QuickType
450454 , UnionFormatException (..)
451455 , UnionFriend (..)
452456 , UnionFrom (..)
457+ , UnionFromDict (..)
453458 , UnionFromJSON (..)
454459 , UnionFunc (..)
455460 , UnionFunction (..)
@@ -506,6 +511,7 @@ module QuickType
506511 , UnionLong (..)
507512 , UnionMap (..)
508513 , UnionMapEntry (..)
514+ , UnionMarshalJSON (..)
509515 , UnionMetadataPropertyHandling (..)
510516 , UnionMutable (..)
511517 , UnionMutating (..)
@@ -641,6 +647,7 @@ module QuickType
641647 , UnionTimeOnly (..)
642648 , UnionTimeOnlyConverter (..)
643649 , UnionTimeZone (..)
650+ , UnionToDict (..)
644651 , UnionToJSON (..)
645652 , UnionToString (..)
646653 , UnionTopLevel (..)
@@ -657,6 +664,7 @@ module QuickType
657664 , UnionUnchecked (..)
658665 , UnionUndefined (..)
659666 , UnionUnionUnion (..)
667+ , UnionUnmarshalJSON (..)
660668 , UnionUnowned (..)
661669 , UnionUnsafe (..)
662670 , UnionUnsigned (..)
@@ -811,6 +819,7 @@ data QuickType = QuickType
811819 , formatExceptionQuickType :: Maybe UnionFormatException
812820 , friendQuickType :: Maybe UnionFriend
813821 , fromQuickType :: Maybe UnionFrom
822+ , fromDictQuickType :: Maybe UnionFromDict
814823 , fromJSONQuickType :: Maybe UnionFromJSON
815824 , funcQuickType :: Maybe UnionFunc
816825 , functionQuickType :: Maybe UnionFunction
@@ -872,6 +881,7 @@ data QuickType = QuickType
872881 , longQuickType :: Maybe UnionLong
873882 , mapQuickType :: Maybe UnionMap
874883 , mapEntryQuickType :: Maybe UnionMapEntry
884+ , marshalJSONQuickType :: Maybe UnionMarshalJSON
875885 , metadataPropertyHandlingQuickType :: Maybe UnionMetadataPropertyHandling
876886 , quickTypeModuleQuickType :: Maybe UnionModule
877887 , mutableQuickType :: Maybe UnionMutable
@@ -986,6 +996,7 @@ data QuickType = QuickType
986996 , timeOnlyQuickType :: Maybe UnionTimeOnly
987997 , timeOnlyConverterQuickType :: Maybe UnionTimeOnlyConverter
988998 , timeZoneQuickType :: Maybe UnionTimeZone
999+ , toDictQuickType :: Maybe UnionToDict
9891000 , toJSONQuickType :: Maybe UnionToJSON
9901001 , topLevelQuickType :: Maybe UnionTopLevel
9911002 , toStringQuickType :: Maybe UnionToString
@@ -1005,6 +1016,7 @@ data QuickType = QuickType
10051016 , uncheckedQuickType :: Maybe UnionUnchecked
10061017 , undefinedQuickType :: Maybe UnionUndefined
10071018 , unionQuickType :: Maybe UnionUnionUnion
1019+ , unmarshalJSONQuickType :: Maybe UnionUnmarshalJSON
10081020 , unownedQuickType :: Maybe UnionUnowned
10091021 , unsafeQuickType :: Maybe UnionUnsafe
10101022 , unsignedQuickType :: Maybe UnionUnsigned
@@ -2011,6 +2023,15 @@ data From = From
20112023 {
20122024 } deriving (Show)
20132025
2026+data UnionFromDict
2027+ = DoubleInUnionFromDict Double
2028+ | FromDictInUnionFromDict FromDict
2029+ deriving (Show)
2030+
2031+data FromDict = FromDict
2032+ {
2033+ } deriving (Show)
2034+
20142035 data UnionFromJSON
20152036 = DoubleInUnionFromJSON Double
20162037 | FromJSONClassInUnionFromJSON FromJSONClass
@@ -2515,6 +2536,15 @@ data MapEntry = MapEntry
25152536 {
25162537 } deriving (Show)
25172538
2539+data UnionMarshalJSON
2540+ = DoubleInUnionMarshalJSON Double
2541+ | MarshalJSONInUnionMarshalJSON MarshalJSON
2542+ deriving (Show)
2543+
2544+data MarshalJSON = MarshalJSON
2545+ {
2546+ } deriving (Show)
2547+
25182548 data UnionMetadataPropertyHandling
25192549 = DoubleInUnionMetadataPropertyHandling Double
25202550 | MetadataPropertyHandlingInUnionMetadataPropertyHandling MetadataPropertyHandling
@@ -3730,6 +3760,15 @@ data TimeZone = TimeZone
37303760 {
37313761 } deriving (Show)
37323762
3763+data UnionToDict
3764+ = DoubleInUnionToDict Double
3765+ | ToDictInUnionToDict ToDict
3766+ deriving (Show)
3767+
3768+data ToDict = ToDict
3769+ {
3770+ } deriving (Show)
3771+
37333772 data UnionToJSON
37343773 = DoubleInUnionToJSON Double
37353774 | ToJSONClassInUnionToJSON ToJSONClass
@@ -3874,6 +3913,15 @@ data Union = Union
38743913 {
38753914 } deriving (Show)
38763915
3916+data UnionUnmarshalJSON
3917+ = DoubleInUnionUnmarshalJSON Double
3918+ | UnmarshalJSONInUnionUnmarshalJSON UnmarshalJSON
3919+ deriving (Show)
3920+
3921+data UnmarshalJSON = UnmarshalJSON
3922+ {
3923+ } deriving (Show)
3924+
38773925 data UnionUnowned
38783926 = DoubleInUnionUnowned Double
38793927 | UnownedInUnionUnowned Unowned
@@ -4076,7 +4124,7 @@ decodeTopLevel :: ByteString -> Maybe QuickType
40764124 decodeTopLevel = decode
40774125
40784126 instance ToJSON QuickType where
4079- toJSON (QuickType emptyQuickType quickTypeBoolQuickType complexQuickType imagineryQuickType abstractQuickType alignasQuickType alignofQuickType andQuickType andEqQuickType quickTypeAnyQuickType anyQuickType arrayQuickType quickTypeAsQuickType asmQuickType assertQuickType associatedtypeQuickType associativityQuickType asyncQuickType atomicQuickType atomicCancelQuickType atomicCommitQuickType atomicNoexceptQuickType autoQuickType awaitQuickType baseQuickType bitandQuickType bitorQuickType boolQuickType purpleBoolQuickType booleanQuickType breakQuickType bycopyQuickType byrefQuickType byteQuickType calendarQuickType quickTypeCaseQuickType catchQuickType chanQuickType charQuickType char16TQuickType char32TQuickType checkedQuickType purpleClassQuickType quickTypeClassQuickType cloneQuickType coAwaitQuickType coReturnQuickType coYieldQuickType codableQuickType codingKeyQuickType codingKeysQuickType complQuickType conceptQuickType consoleQuickType constQuickType constCastQuickType constexprQuickType constructorQuickType continueQuickType convenienceQuickType convertQuickType converterQuickType cultureInfoQuickType dateQuickType dateParseHandlingQuickType dateFormatterQuickType dateOnlyQuickType dateOnlyConverterQuickType dateTimeQuickType dateTimeStylesQuickType debuggerQuickType decimalQuickType declareQuickType decltypeQuickType decodeStringQuickType decoderQuickType decodingErrorQuickType defQuickType quickTypeDefaultQuickType deferQuickType deinitQuickType delQuickType delegateQuickType deleteQuickType dictQuickType dictionaryQuickType didSetQuickType quickTypeDoQuickType doubleQuickType dummyQuickType dynamicQuickType dynamicCastQuickType elifQuickType quickTypeElseQuickType encodeQuickTypeQuickType encoderQuickType enumQuickType enumValuesQuickType equalityContractQuickType equatableQuickType eventQuickType exceptQuickType exceptionQuickType explicitQuickType exportQuickType exposingQuickType extendsQuickType extensionQuickType externQuickType fallthroughQuickType quickTypeFalseQuickType falseQuickType fileprivateQuickType finalQuickType finallyQuickType fixedQuickType floatQuickType forQuickType foreachQuickType formatExceptionQuickType friendQuickType fromQuickType fromJSONQuickType funcQuickType functionQuickType getQuickType globalQuickType goQuickType gotoQuickType guardQuickType hashableQuickType hashCodeQuickType hasherQuickType hasOwnPropertyQuickType quickTypeIDQuickType quickTypeIfQuickType impQuickType implementsQuickType implicitQuickType quickTypeImportQuickType quickTypeInQuickType indirectQuickType quickTypeInfixQuickType initQuickType inlineQuickType inoutQuickType instanceofQuickType intQuickType interfaceQuickType internalQuickType isQuickType isoDateTimeOffsetConverterQuickType iterableQuickType jdecQuickType jencQuickType jpipeQuickType jsonQuickType jsonConverterQuickType jsonSerializerQuickType jsonTokenQuickType jsonWriterQuickType jsonAnyQuickType jsonCodingKeyQuickType jsonDecoderQuickType jsonEncoderQuickType jsonExceptionQuickType jsonGeneratorQuickType jsonNodeQuickType jsonNullQuickType jsonParserQuickType jsonReaderQuickType jsonTokenTypeQuickType kSerializerQuickType lambdaQuickType lazyQuickType leftQuickType quickTypeLetQuickType listQuickType localeQuickType lockQuickType longQuickType mapQuickType mapEntryQuickType metadataPropertyHandlingQuickType quickTypeModuleQuickType mutableQuickType mutatingQuickType namespaceQuickType nativeQuickType newQuickType newtonsoftQuickType nilQuickType noQuickType noexceptQuickType nonatomicQuickType quickTypeNoneQuickType noneQuickType nonlocalQuickType nonmutatingQuickType noSuchMethodQuickType notQuickType notEqQuickType nsErrorQuickType nsObjectQuickType nsStringQuickType nullQuickType quickTypeNullQuickType nullptrQuickType numberQuickType objectQuickType objectMapperQuickType quickTypeOfQuickType onewayQuickType openQuickType operatorQuickType optionalQuickType orQuickType orEqQuickType outQuickType overrideQuickType packageQuickType paramsQuickType passQuickType portQuickType postfixQuickType precedenceQuickType prefixQuickType primitiveKindQuickType printQuickType printfQuickType printMembersQuickType privateQuickType protectedQuickType protocolQuickType quickTypeProtocolQuickType publicQuickType quicktypeQuickType raiseQuickType rangeQuickType readonlyQuickType refQuickType regExpQuickType registerQuickType reinterpretCastQuickType repeatQuickType requireQuickType requiredQuickType requiresQuickType restrictQuickType retainQuickType rethrowsQuickType returnQuickType rightQuickType runtimeTypeQuickType sQuickType sbyteQuickType sealedQuickType selQuickType selectQuickType selfQuickType quickTypeSelfQuickType sendableQuickType serialDescriptorQuickType serializableQuickType serializeQuickType serializerProviderQuickType serialNameQuickType setQuickType shortQuickType signedQuickType simpleModuleQuickType sizeofQuickType stackallocQuickType standardsQuickType staticQuickType staticAssertQuickType staticCastQuickType stdDeserializerQuickType stdSerializerQuickType strictfpQuickType stringQuickType structQuickType subscriptQuickType superQuickType switchQuickType symbolQuickType synchronizedQuickType systemQuickType templateQuickType quickTypeThenQuickType thisQuickType threadLocalQuickType throwQuickType throwsQuickType timeOnlyQuickType timeOnlyConverterQuickType timeZoneQuickType toJSONQuickType topLevelQuickType toStringQuickType transientQuickType trueQuickType quickTypeTrueQuickType tryQuickType quickTypeTypeQuickType purpleTypeQuickType typealiasQuickType typedefQuickType typeidQuickType typenameQuickType typeofQuickType uintQuickType ulongQuickType uncheckedQuickType undefinedQuickType unionQuickType unownedQuickType unsafeQuickType unsignedQuickType useSerializersQuickType ushortQuickType usingQuickType utf8JSONReaderQuickType utf8JSONWriterQuickType uuidQuickType varQuickType virtualQuickType voidQuickType volatileQuickType wcharTQuickType weakQuickType quickTypeWhereQuickType whileQuickType willSetQuickType withQuickType xorQuickType xorEqQuickType yesQuickType yieldQuickType) =
4127+ toJSON (QuickType emptyQuickType quickTypeBoolQuickType complexQuickType imagineryQuickType abstractQuickType alignasQuickType alignofQuickType andQuickType andEqQuickType quickTypeAnyQuickType anyQuickType arrayQuickType quickTypeAsQuickType asmQuickType assertQuickType associatedtypeQuickType associativityQuickType asyncQuickType atomicQuickType atomicCancelQuickType atomicCommitQuickType atomicNoexceptQuickType autoQuickType awaitQuickType baseQuickType bitandQuickType bitorQuickType boolQuickType purpleBoolQuickType booleanQuickType breakQuickType bycopyQuickType byrefQuickType byteQuickType calendarQuickType quickTypeCaseQuickType catchQuickType chanQuickType charQuickType char16TQuickType char32TQuickType checkedQuickType purpleClassQuickType quickTypeClassQuickType cloneQuickType coAwaitQuickType coReturnQuickType coYieldQuickType codableQuickType codingKeyQuickType codingKeysQuickType complQuickType conceptQuickType consoleQuickType constQuickType constCastQuickType constexprQuickType constructorQuickType continueQuickType convenienceQuickType convertQuickType converterQuickType cultureInfoQuickType dateQuickType dateParseHandlingQuickType dateFormatterQuickType dateOnlyQuickType dateOnlyConverterQuickType dateTimeQuickType dateTimeStylesQuickType debuggerQuickType decimalQuickType declareQuickType decltypeQuickType decodeStringQuickType decoderQuickType decodingErrorQuickType defQuickType quickTypeDefaultQuickType deferQuickType deinitQuickType delQuickType delegateQuickType deleteQuickType dictQuickType dictionaryQuickType didSetQuickType quickTypeDoQuickType doubleQuickType dummyQuickType dynamicQuickType dynamicCastQuickType elifQuickType quickTypeElseQuickType encodeQuickTypeQuickType encoderQuickType enumQuickType enumValuesQuickType equalityContractQuickType equatableQuickType eventQuickType exceptQuickType exceptionQuickType explicitQuickType exportQuickType exposingQuickType extendsQuickType extensionQuickType externQuickType fallthroughQuickType quickTypeFalseQuickType falseQuickType fileprivateQuickType finalQuickType finallyQuickType fixedQuickType floatQuickType forQuickType foreachQuickType formatExceptionQuickType friendQuickType fromQuickType fromDictQuickType fromJSONQuickType funcQuickType functionQuickType getQuickType globalQuickType goQuickType gotoQuickType guardQuickType hashableQuickType hashCodeQuickType hasherQuickType hasOwnPropertyQuickType quickTypeIDQuickType quickTypeIfQuickType impQuickType implementsQuickType implicitQuickType quickTypeImportQuickType quickTypeInQuickType indirectQuickType quickTypeInfixQuickType initQuickType inlineQuickType inoutQuickType instanceofQuickType intQuickType interfaceQuickType internalQuickType isQuickType isoDateTimeOffsetConverterQuickType iterableQuickType jdecQuickType jencQuickType jpipeQuickType jsonQuickType jsonConverterQuickType jsonSerializerQuickType jsonTokenQuickType jsonWriterQuickType jsonAnyQuickType jsonCodingKeyQuickType jsonDecoderQuickType jsonEncoderQuickType jsonExceptionQuickType jsonGeneratorQuickType jsonNodeQuickType jsonNullQuickType jsonParserQuickType jsonReaderQuickType jsonTokenTypeQuickType kSerializerQuickType lambdaQuickType lazyQuickType leftQuickType quickTypeLetQuickType listQuickType localeQuickType lockQuickType longQuickType mapQuickType mapEntryQuickType marshalJSONQuickType metadataPropertyHandlingQuickType quickTypeModuleQuickType mutableQuickType mutatingQuickType namespaceQuickType nativeQuickType newQuickType newtonsoftQuickType nilQuickType noQuickType noexceptQuickType nonatomicQuickType quickTypeNoneQuickType noneQuickType nonlocalQuickType nonmutatingQuickType noSuchMethodQuickType notQuickType notEqQuickType nsErrorQuickType nsObjectQuickType nsStringQuickType nullQuickType quickTypeNullQuickType nullptrQuickType numberQuickType objectQuickType objectMapperQuickType quickTypeOfQuickType onewayQuickType openQuickType operatorQuickType optionalQuickType orQuickType orEqQuickType outQuickType overrideQuickType packageQuickType paramsQuickType passQuickType portQuickType postfixQuickType precedenceQuickType prefixQuickType primitiveKindQuickType printQuickType printfQuickType printMembersQuickType privateQuickType protectedQuickType protocolQuickType quickTypeProtocolQuickType publicQuickType quicktypeQuickType raiseQuickType rangeQuickType readonlyQuickType refQuickType regExpQuickType registerQuickType reinterpretCastQuickType repeatQuickType requireQuickType requiredQuickType requiresQuickType restrictQuickType retainQuickType rethrowsQuickType returnQuickType rightQuickType runtimeTypeQuickType sQuickType sbyteQuickType sealedQuickType selQuickType selectQuickType selfQuickType quickTypeSelfQuickType sendableQuickType serialDescriptorQuickType serializableQuickType serializeQuickType serializerProviderQuickType serialNameQuickType setQuickType shortQuickType signedQuickType simpleModuleQuickType sizeofQuickType stackallocQuickType standardsQuickType staticQuickType staticAssertQuickType staticCastQuickType stdDeserializerQuickType stdSerializerQuickType strictfpQuickType stringQuickType structQuickType subscriptQuickType superQuickType switchQuickType symbolQuickType synchronizedQuickType systemQuickType templateQuickType quickTypeThenQuickType thisQuickType threadLocalQuickType throwQuickType throwsQuickType timeOnlyQuickType timeOnlyConverterQuickType timeZoneQuickType toDictQuickType toJSONQuickType topLevelQuickType toStringQuickType transientQuickType trueQuickType quickTypeTrueQuickType tryQuickType quickTypeTypeQuickType purpleTypeQuickType typealiasQuickType typedefQuickType typeidQuickType typenameQuickType typeofQuickType uintQuickType ulongQuickType uncheckedQuickType undefinedQuickType unionQuickType unmarshalJSONQuickType unownedQuickType unsafeQuickType unsignedQuickType useSerializersQuickType ushortQuickType usingQuickType utf8JSONReaderQuickType utf8JSONWriterQuickType uuidQuickType varQuickType virtualQuickType voidQuickType volatileQuickType wcharTQuickType weakQuickType quickTypeWhereQuickType whileQuickType willSetQuickType withQuickType xorQuickType xorEqQuickType yesQuickType yieldQuickType) =
40804128 object $ foldMap (maybe [] pure)
40814129 [ ("_" .=) <$> emptyQuickType
40824130 , ("_Bool" .=) <$> quickTypeBoolQuickType
@@ -4200,6 +4248,7 @@ instance ToJSON QuickType where
42004248 , ("FormatException" .=) <$> formatExceptionQuickType
42014249 , ("friend" .=) <$> friendQuickType
42024250 , ("from" .=) <$> fromQuickType
4251+ , ("from_dict" .=) <$> fromDictQuickType
42034252 , ("from_json" .=) <$> fromJSONQuickType
42044253 , ("func" .=) <$> funcQuickType
42054254 , ("function" .=) <$> functionQuickType
@@ -4261,6 +4310,7 @@ instance ToJSON QuickType where
42614310 , ("long" .=) <$> longQuickType
42624311 , ("map" .=) <$> mapQuickType
42634312 , ("MapEntry" .=) <$> mapEntryQuickType
4313+ , ("MarshalJSON" .=) <$> marshalJSONQuickType
42644314 , ("metadata_property_handling" .=) <$> metadataPropertyHandlingQuickType
42654315 , ("module" .=) <$> quickTypeModuleQuickType
42664316 , ("mutable" .=) <$> mutableQuickType
@@ -4375,6 +4425,7 @@ instance ToJSON QuickType where
43754425 , ("TimeOnly" .=) <$> timeOnlyQuickType
43764426 , ("TimeOnlyConverter" .=) <$> timeOnlyConverterQuickType
43774427 , ("TimeZone" .=) <$> timeZoneQuickType
4428+ , ("to_dict" .=) <$> toDictQuickType
43784429 , ("to_json" .=) <$> toJSONQuickType
43794430 , ("top_level" .=) <$> topLevelQuickType
43804431 , ("toString" .=) <$> toStringQuickType
@@ -4394,6 +4445,7 @@ instance ToJSON QuickType where
43944445 , ("unchecked" .=) <$> uncheckedQuickType
43954446 , ("undefined" .=) <$> undefinedQuickType
43964447 , ("union" .=) <$> unionQuickType
4448+ , ("UnmarshalJSON" .=) <$> unmarshalJSONQuickType
43974449 , ("unowned" .=) <$> unownedQuickType
43984450 , ("unsafe" .=) <$> unsafeQuickType
43994451 , ("unsigned" .=) <$> unsignedQuickType
@@ -4543,6 +4595,7 @@ instance FromJSON QuickType where
45434595 <*> v .:! "FormatException"
45444596 <*> v .:! "friend"
45454597 <*> v .:! "from"
4598+ <*> v .:! "from_dict"
45464599 <*> v .:! "from_json"
45474600 <*> v .:! "func"
45484601 <*> v .:! "function"
@@ -4604,6 +4657,7 @@ instance FromJSON QuickType where
46044657 <*> v .:! "long"
46054658 <*> v .:! "map"
46064659 <*> v .:! "MapEntry"
4660+ <*> v .:! "MarshalJSON"
46074661 <*> v .:! "metadata_property_handling"
46084662 <*> v .:! "module"
46094663 <*> v .:! "mutable"
@@ -4718,6 +4772,7 @@ instance FromJSON QuickType where
47184772 <*> v .:! "TimeOnly"
47194773 <*> v .:! "TimeOnlyConverter"
47204774 <*> v .:! "TimeZone"
4775+ <*> v .:! "to_dict"
47214776 <*> v .:! "to_json"
47224777 <*> v .:! "top_level"
47234778 <*> v .:! "toString"
@@ -4737,6 +4792,7 @@ instance FromJSON QuickType where
47374792 <*> v .:! "unchecked"
47384793 <*> v .:! "undefined"
47394794 <*> v .:! "union"
4795+ <*> v .:! "UnmarshalJSON"
47404796 <*> v .:! "unowned"
47414797 <*> v .:! "unsafe"
47424798 <*> v .:! "unsigned"
@@ -6287,6 +6343,20 @@ instance ToJSON From where
62876343 instance FromJSON From where
62886344 parseJSON (Object _) = return From
62896345
6346+instance ToJSON UnionFromDict where
6347+ toJSON (DoubleInUnionFromDict x) = toJSON x
6348+ toJSON (FromDictInUnionFromDict x) = toJSON x
6349+
6350+instance FromJSON UnionFromDict where
6351+ parseJSON xs@(Number _) = (fmap DoubleInUnionFromDict . parseJSON) xs
6352+ parseJSON xs@(Object _) = (fmap FromDictInUnionFromDict . parseJSON) xs
6353+
6354+instance ToJSON FromDict where
6355+ toJSON = \_ -> emptyObject
6356+
6357+instance FromJSON FromDict where
6358+ parseJSON (Object _) = return FromDict
6359+
62906360 instance ToJSON UnionFromJSON where
62916361 toJSON (DoubleInUnionFromJSON x) = toJSON x
62926362 toJSON (FromJSONClassInUnionFromJSON x) = toJSON x
@@ -7071,6 +7141,20 @@ instance ToJSON MapEntry where
70717141 instance FromJSON MapEntry where
70727142 parseJSON (Object _) = return MapEntry
70737143
7144+instance ToJSON UnionMarshalJSON where
7145+ toJSON (DoubleInUnionMarshalJSON x) = toJSON x
7146+ toJSON (MarshalJSONInUnionMarshalJSON x) = toJSON x
7147+
7148+instance FromJSON UnionMarshalJSON where
7149+ parseJSON xs@(Number _) = (fmap DoubleInUnionMarshalJSON . parseJSON) xs
7150+ parseJSON xs@(Object _) = (fmap MarshalJSONInUnionMarshalJSON . parseJSON) xs
7151+
7152+instance ToJSON MarshalJSON where
7153+ toJSON = \_ -> emptyObject
7154+
7155+instance FromJSON MarshalJSON where
7156+ parseJSON (Object _) = return MarshalJSON
7157+
70747158 instance ToJSON UnionMetadataPropertyHandling where
70757159 toJSON (DoubleInUnionMetadataPropertyHandling x) = toJSON x
70767160 toJSON (MetadataPropertyHandlingInUnionMetadataPropertyHandling x) = toJSON x
@@ -8961,6 +9045,20 @@ instance ToJSON TimeZone where
89619045 instance FromJSON TimeZone where
89629046 parseJSON (Object _) = return TimeZone
89639047
9048+instance ToJSON UnionToDict where
9049+ toJSON (DoubleInUnionToDict x) = toJSON x
9050+ toJSON (ToDictInUnionToDict x) = toJSON x
9051+
9052+instance FromJSON UnionToDict where
9053+ parseJSON xs@(Number _) = (fmap DoubleInUnionToDict . parseJSON) xs
9054+ parseJSON xs@(Object _) = (fmap ToDictInUnionToDict . parseJSON) xs
9055+
9056+instance ToJSON ToDict where
9057+ toJSON = \_ -> emptyObject
9058+
9059+instance FromJSON ToDict where
9060+ parseJSON (Object _) = return ToDict
9061+
89649062 instance ToJSON UnionToJSON where
89659063 toJSON (DoubleInUnionToJSON x) = toJSON x
89669064 toJSON (ToJSONClassInUnionToJSON x) = toJSON x
@@ -9185,6 +9283,20 @@ instance ToJSON Union where
91859283 instance FromJSON Union where
91869284 parseJSON (Object _) = return Union
91879285
9286+instance ToJSON UnionUnmarshalJSON where
9287+ toJSON (DoubleInUnionUnmarshalJSON x) = toJSON x
9288+ toJSON (UnmarshalJSONInUnionUnmarshalJSON x) = toJSON x
9289+
9290+instance FromJSON UnionUnmarshalJSON where
9291+ parseJSON xs@(Number _) = (fmap DoubleInUnionUnmarshalJSON . parseJSON) xs
9292+ parseJSON xs@(Object _) = (fmap UnmarshalJSONInUnionUnmarshalJSON . parseJSON) xs
9293+
9294+instance ToJSON UnmarshalJSON where
9295+ toJSON = \_ -> emptyObject
9296+
9297+instance FromJSON UnmarshalJSON where
9298+ parseJSON (Object _) = return UnmarshalJSON
9299+
91889300 instance ToJSON UnionUnowned where
91899301 toJSON (DoubleInUnionUnowned x) = toJSON x
91909302 toJSON (UnownedInUnionUnowned x) = toJSON x
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / FromDict.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class FromDict {
7+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / MarshalJSON.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class MarshalJSON {
7+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / ToDict.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class ToDict {
7+}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / TopLevel.java+24 −0
@@ -125,6 +125,7 @@ public class TopLevel {
125125 private UnionFormatException formatException;
126126 private UnionFriend friend;
127127 private UnionFrom from;
128+ private UnionFromDict fromDict;
128129 private UnionFromJSON fromJSON;
129130 private UnionFunc func;
130131 private UnionFunction function;
@@ -186,6 +187,7 @@ public class TopLevel {
186187 private UnionLong topLevelLong;
187188 private UnionMap map;
188189 private UnionMapEntry mapEntry;
190+ private UnionMarshalJSON marshalJSON;
189191 private UnionMetadataPropertyHandling metadataPropertyHandling;
190192 private UnionModule module;
191193 private UnionMutable mutable;
@@ -300,6 +302,7 @@ public class TopLevel {
300302 private UnionTimeOnly timeOnly;
301303 private UnionTimeOnlyConverter timeOnlyConverter;
302304 private UnionTimeZone timeZone;
305+ private UnionToDict toDict;
303306 private UnionToJSON toJSON;
304307 private UnionTopLevel topLevel;
305308 private UnionToString toString;
@@ -319,6 +322,7 @@ public class TopLevel {
319322 private UnionUnchecked unchecked;
320323 private UnionUndefined undefined;
321324 private UnionUnionUnion union;
325+ private UnionUnmarshalJSON unmarshalJSON;
322326 private UnionUnowned unowned;
323327 private UnionUnsafe unsafe;
324328 private UnionUnsigned unsigned;
@@ -953,6 +957,11 @@ public class TopLevel {
953957 @JsonProperty("from")
954958 public void setFrom(UnionFrom value) { this.from = value; }
955959
960+ @JsonProperty("from_dict")
961+ public UnionFromDict getFromDict() { return fromDict; }
962+ @JsonProperty("from_dict")
963+ public void setFromDict(UnionFromDict value) { this.fromDict = value; }
964+
956965 @JsonProperty("from_json")
957966 public UnionFromJSON getFromJSON() { return fromJSON; }
958967 @JsonProperty("from_json")
@@ -1258,6 +1267,11 @@ public class TopLevel {
12581267 @JsonProperty("MapEntry")
12591268 public void setMapEntry(UnionMapEntry value) { this.mapEntry = value; }
12601269
1270+ @JsonProperty("MarshalJSON")
1271+ public UnionMarshalJSON getMarshalJSON() { return marshalJSON; }
1272+ @JsonProperty("MarshalJSON")
1273+ public void setMarshalJSON(UnionMarshalJSON value) { this.marshalJSON = value; }
1274+
12611275 @JsonProperty("metadata_property_handling")
12621276 public UnionMetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; }
12631277 @JsonProperty("metadata_property_handling")
@@ -1828,6 +1842,11 @@ public class TopLevel {
18281842 @JsonProperty("TimeZone")
18291843 public void setTimeZone(UnionTimeZone value) { this.timeZone = value; }
18301844
1845+ @JsonProperty("to_dict")
1846+ public UnionToDict getToDict() { return toDict; }
1847+ @JsonProperty("to_dict")
1848+ public void setToDict(UnionToDict value) { this.toDict = value; }
1849+
18311850 @JsonProperty("to_json")
18321851 public UnionToJSON getToJSON() { return toJSON; }
18331852 @JsonProperty("to_json")
@@ -1923,6 +1942,11 @@ public class TopLevel {
19231942 @JsonProperty("union")
19241943 public void setUnion(UnionUnionUnion value) { this.union = value; }
19251944
1945+ @JsonProperty("UnmarshalJSON")
1946+ public UnionUnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
1947+ @JsonProperty("UnmarshalJSON")
1948+ public void setUnmarshalJSON(UnionUnmarshalJSON value) { this.unmarshalJSON = value; }
1949+
19261950 @JsonProperty("unowned")
19271951 public UnionUnowned getUnowned() { return unowned; }
19281952 @JsonProperty("unowned")
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionFromDict.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 = UnionFromDict.Deserializer.class)
11+@JsonSerialize(using = UnionFromDict.Serializer.class)
12+public class UnionFromDict {
13+ public Double doubleValue;
14+ public FromDict fromDictValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionFromDict> {
17+ @Override
18+ public UnionFromDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionFromDict value = new UnionFromDict();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.fromDictValue = jsonParser.readValueAs(FromDict.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionFromDict");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionFromDict> {
37+ @Override
38+ public void serialize(UnionFromDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.fromDictValue != null) {
44+ jsonGenerator.writeObject(obj.fromDictValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionMarshalJSON.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 = UnionMarshalJSON.Deserializer.class)
11+@JsonSerialize(using = UnionMarshalJSON.Serializer.class)
12+public class UnionMarshalJSON {
13+ public Double doubleValue;
14+ public MarshalJSON marshalJSONValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionMarshalJSON> {
17+ @Override
18+ public UnionMarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionMarshalJSON value = new UnionMarshalJSON();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.marshalJSONValue = jsonParser.readValueAs(MarshalJSON.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionMarshalJSON");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionMarshalJSON> {
37+ @Override
38+ public void serialize(UnionMarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.marshalJSONValue != null) {
44+ jsonGenerator.writeObject(obj.marshalJSONValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionToDict.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 = UnionToDict.Deserializer.class)
11+@JsonSerialize(using = UnionToDict.Serializer.class)
12+public class UnionToDict {
13+ public Double doubleValue;
14+ public ToDict toDictValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionToDict> {
17+ @Override
18+ public UnionToDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionToDict value = new UnionToDict();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.toDictValue = jsonParser.readValueAs(ToDict.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionToDict");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionToDict> {
37+ @Override
38+ public void serialize(UnionToDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.toDictValue != null) {
44+ jsonGenerator.writeObject(obj.toDictValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionUnmarshalJSON.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 = UnionUnmarshalJSON.Deserializer.class)
11+@JsonSerialize(using = UnionUnmarshalJSON.Serializer.class)
12+public class UnionUnmarshalJSON {
13+ public Double doubleValue;
14+ public UnmarshalJSON unmarshalJSONValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionUnmarshalJSON> {
17+ @Override
18+ public UnionUnmarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionUnmarshalJSON value = new UnionUnmarshalJSON();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.unmarshalJSONValue = jsonParser.readValueAs(UnmarshalJSON.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionUnmarshalJSON");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionUnmarshalJSON> {
37+ @Override
38+ public void serialize(UnionUnmarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.unmarshalJSONValue != null) {
44+ jsonGenerator.writeObject(obj.unmarshalJSONValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnmarshalJSON.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class UnmarshalJSON {
7+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / FromDict.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class FromDict {
7+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / MarshalJSON.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class MarshalJSON {
7+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / ToDict.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class ToDict {
7+}
Mschema-java-lombokdefault / src / main / java / io / quicktype / TopLevel.java+24 −0
@@ -125,6 +125,7 @@ public class TopLevel {
125125 private UnionFormatException formatException;
126126 private UnionFriend friend;
127127 private UnionFrom from;
128+ private UnionFromDict fromDict;
128129 private UnionFromJSON fromJSON;
129130 private UnionFunc func;
130131 private UnionFunction function;
@@ -186,6 +187,7 @@ public class TopLevel {
186187 private UnionLong topLevelLong;
187188 private UnionMap map;
188189 private UnionMapEntry mapEntry;
190+ private UnionMarshalJSON marshalJSON;
189191 private UnionMetadataPropertyHandling metadataPropertyHandling;
190192 private UnionModule module;
191193 private UnionMutable mutable;
@@ -300,6 +302,7 @@ public class TopLevel {
300302 private UnionTimeOnly timeOnly;
301303 private UnionTimeOnlyConverter timeOnlyConverter;
302304 private UnionTimeZone timeZone;
305+ private UnionToDict toDict;
303306 private UnionToJSON toJSON;
304307 private UnionTopLevel topLevel;
305308 private UnionToString toString;
@@ -319,6 +322,7 @@ public class TopLevel {
319322 private UnionUnchecked unchecked;
320323 private UnionUndefined undefined;
321324 private UnionUnionUnion union;
325+ private UnionUnmarshalJSON unmarshalJSON;
322326 private UnionUnowned unowned;
323327 private UnionUnsafe unsafe;
324328 private UnionUnsigned unsigned;
@@ -953,6 +957,11 @@ public class TopLevel {
953957 @JsonProperty("from")
954958 public void setFrom(UnionFrom value) { this.from = value; }
955959
960+ @JsonProperty("from_dict")
961+ public UnionFromDict getFromDict() { return fromDict; }
962+ @JsonProperty("from_dict")
963+ public void setFromDict(UnionFromDict value) { this.fromDict = value; }
964+
956965 @JsonProperty("from_json")
957966 public UnionFromJSON getFromJSON() { return fromJSON; }
958967 @JsonProperty("from_json")
@@ -1258,6 +1267,11 @@ public class TopLevel {
12581267 @JsonProperty("MapEntry")
12591268 public void setMapEntry(UnionMapEntry value) { this.mapEntry = value; }
12601269
1270+ @JsonProperty("MarshalJSON")
1271+ public UnionMarshalJSON getMarshalJSON() { return marshalJSON; }
1272+ @JsonProperty("MarshalJSON")
1273+ public void setMarshalJSON(UnionMarshalJSON value) { this.marshalJSON = value; }
1274+
12611275 @JsonProperty("metadata_property_handling")
12621276 public UnionMetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; }
12631277 @JsonProperty("metadata_property_handling")
@@ -1828,6 +1842,11 @@ public class TopLevel {
18281842 @JsonProperty("TimeZone")
18291843 public void setTimeZone(UnionTimeZone value) { this.timeZone = value; }
18301844
1845+ @JsonProperty("to_dict")
1846+ public UnionToDict getToDict() { return toDict; }
1847+ @JsonProperty("to_dict")
1848+ public void setToDict(UnionToDict value) { this.toDict = value; }
1849+
18311850 @JsonProperty("to_json")
18321851 public UnionToJSON getToJSON() { return toJSON; }
18331852 @JsonProperty("to_json")
@@ -1923,6 +1942,11 @@ public class TopLevel {
19231942 @JsonProperty("union")
19241943 public void setUnion(UnionUnionUnion value) { this.union = value; }
19251944
1945+ @JsonProperty("UnmarshalJSON")
1946+ public UnionUnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
1947+ @JsonProperty("UnmarshalJSON")
1948+ public void setUnmarshalJSON(UnionUnmarshalJSON value) { this.unmarshalJSON = value; }
1949+
19261950 @JsonProperty("unowned")
19271951 public UnionUnowned getUnowned() { return unowned; }
19281952 @JsonProperty("unowned")
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionFromDict.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 = UnionFromDict.Deserializer.class)
11+@JsonSerialize(using = UnionFromDict.Serializer.class)
12+public class UnionFromDict {
13+ public Double doubleValue;
14+ public FromDict fromDictValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionFromDict> {
17+ @Override
18+ public UnionFromDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionFromDict value = new UnionFromDict();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.fromDictValue = jsonParser.readValueAs(FromDict.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionFromDict");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionFromDict> {
37+ @Override
38+ public void serialize(UnionFromDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.fromDictValue != null) {
44+ jsonGenerator.writeObject(obj.fromDictValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionMarshalJSON.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 = UnionMarshalJSON.Deserializer.class)
11+@JsonSerialize(using = UnionMarshalJSON.Serializer.class)
12+public class UnionMarshalJSON {
13+ public Double doubleValue;
14+ public MarshalJSON marshalJSONValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionMarshalJSON> {
17+ @Override
18+ public UnionMarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionMarshalJSON value = new UnionMarshalJSON();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.marshalJSONValue = jsonParser.readValueAs(MarshalJSON.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionMarshalJSON");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionMarshalJSON> {
37+ @Override
38+ public void serialize(UnionMarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.marshalJSONValue != null) {
44+ jsonGenerator.writeObject(obj.marshalJSONValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionToDict.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 = UnionToDict.Deserializer.class)
11+@JsonSerialize(using = UnionToDict.Serializer.class)
12+public class UnionToDict {
13+ public Double doubleValue;
14+ public ToDict toDictValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionToDict> {
17+ @Override
18+ public UnionToDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionToDict value = new UnionToDict();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.toDictValue = jsonParser.readValueAs(ToDict.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionToDict");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionToDict> {
37+ @Override
38+ public void serialize(UnionToDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.toDictValue != null) {
44+ jsonGenerator.writeObject(obj.toDictValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionUnmarshalJSON.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 = UnionUnmarshalJSON.Deserializer.class)
11+@JsonSerialize(using = UnionUnmarshalJSON.Serializer.class)
12+public class UnionUnmarshalJSON {
13+ public Double doubleValue;
14+ public UnmarshalJSON unmarshalJSONValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionUnmarshalJSON> {
17+ @Override
18+ public UnionUnmarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionUnmarshalJSON value = new UnionUnmarshalJSON();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.unmarshalJSONValue = jsonParser.readValueAs(UnmarshalJSON.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionUnmarshalJSON");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionUnmarshalJSON> {
37+ @Override
38+ public void serialize(UnionUnmarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.unmarshalJSONValue != null) {
44+ jsonGenerator.writeObject(obj.unmarshalJSONValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnmarshalJSON.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class UnmarshalJSON {
7+}
Aschema-javadefault / src / main / java / io / quicktype / FromDict.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class FromDict {
7+}
Aschema-javadefault / src / main / java / io / quicktype / MarshalJSON.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class MarshalJSON {
7+}
Aschema-javadefault / src / main / java / io / quicktype / ToDict.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class ToDict {
7+}
Mschema-javadefault / src / main / java / io / quicktype / TopLevel.java+24 −0
@@ -125,6 +125,7 @@ public class TopLevel {
125125 private UnionFormatException formatException;
126126 private UnionFriend friend;
127127 private UnionFrom from;
128+ private UnionFromDict fromDict;
128129 private UnionFromJSON fromJSON;
129130 private UnionFunc func;
130131 private UnionFunction function;
@@ -186,6 +187,7 @@ public class TopLevel {
186187 private UnionLong topLevelLong;
187188 private UnionMap map;
188189 private UnionMapEntry mapEntry;
190+ private UnionMarshalJSON marshalJSON;
189191 private UnionMetadataPropertyHandling metadataPropertyHandling;
190192 private UnionModule module;
191193 private UnionMutable mutable;
@@ -300,6 +302,7 @@ public class TopLevel {
300302 private UnionTimeOnly timeOnly;
301303 private UnionTimeOnlyConverter timeOnlyConverter;
302304 private UnionTimeZone timeZone;
305+ private UnionToDict toDict;
303306 private UnionToJSON toJSON;
304307 private UnionTopLevel topLevel;
305308 private UnionToString toString;
@@ -319,6 +322,7 @@ public class TopLevel {
319322 private UnionUnchecked unchecked;
320323 private UnionUndefined undefined;
321324 private UnionUnionUnion union;
325+ private UnionUnmarshalJSON unmarshalJSON;
322326 private UnionUnowned unowned;
323327 private UnionUnsafe unsafe;
324328 private UnionUnsigned unsigned;
@@ -953,6 +957,11 @@ public class TopLevel {
953957 @JsonProperty("from")
954958 public void setFrom(UnionFrom value) { this.from = value; }
955959
960+ @JsonProperty("from_dict")
961+ public UnionFromDict getFromDict() { return fromDict; }
962+ @JsonProperty("from_dict")
963+ public void setFromDict(UnionFromDict value) { this.fromDict = value; }
964+
956965 @JsonProperty("from_json")
957966 public UnionFromJSON getFromJSON() { return fromJSON; }
958967 @JsonProperty("from_json")
@@ -1258,6 +1267,11 @@ public class TopLevel {
12581267 @JsonProperty("MapEntry")
12591268 public void setMapEntry(UnionMapEntry value) { this.mapEntry = value; }
12601269
1270+ @JsonProperty("MarshalJSON")
1271+ public UnionMarshalJSON getMarshalJSON() { return marshalJSON; }
1272+ @JsonProperty("MarshalJSON")
1273+ public void setMarshalJSON(UnionMarshalJSON value) { this.marshalJSON = value; }
1274+
12611275 @JsonProperty("metadata_property_handling")
12621276 public UnionMetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; }
12631277 @JsonProperty("metadata_property_handling")
@@ -1828,6 +1842,11 @@ public class TopLevel {
18281842 @JsonProperty("TimeZone")
18291843 public void setTimeZone(UnionTimeZone value) { this.timeZone = value; }
18301844
1845+ @JsonProperty("to_dict")
1846+ public UnionToDict getToDict() { return toDict; }
1847+ @JsonProperty("to_dict")
1848+ public void setToDict(UnionToDict value) { this.toDict = value; }
1849+
18311850 @JsonProperty("to_json")
18321851 public UnionToJSON getToJSON() { return toJSON; }
18331852 @JsonProperty("to_json")
@@ -1923,6 +1942,11 @@ public class TopLevel {
19231942 @JsonProperty("union")
19241943 public void setUnion(UnionUnionUnion value) { this.union = value; }
19251944
1945+ @JsonProperty("UnmarshalJSON")
1946+ public UnionUnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
1947+ @JsonProperty("UnmarshalJSON")
1948+ public void setUnmarshalJSON(UnionUnmarshalJSON value) { this.unmarshalJSON = value; }
1949+
19261950 @JsonProperty("unowned")
19271951 public UnionUnowned getUnowned() { return unowned; }
19281952 @JsonProperty("unowned")
Aschema-javadefault / src / main / java / io / quicktype / UnionFromDict.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 = UnionFromDict.Deserializer.class)
11+@JsonSerialize(using = UnionFromDict.Serializer.class)
12+public class UnionFromDict {
13+ public Double doubleValue;
14+ public FromDict fromDictValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionFromDict> {
17+ @Override
18+ public UnionFromDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionFromDict value = new UnionFromDict();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.fromDictValue = jsonParser.readValueAs(FromDict.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionFromDict");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionFromDict> {
37+ @Override
38+ public void serialize(UnionFromDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.fromDictValue != null) {
44+ jsonGenerator.writeObject(obj.fromDictValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-javadefault / src / main / java / io / quicktype / UnionMarshalJSON.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 = UnionMarshalJSON.Deserializer.class)
11+@JsonSerialize(using = UnionMarshalJSON.Serializer.class)
12+public class UnionMarshalJSON {
13+ public Double doubleValue;
14+ public MarshalJSON marshalJSONValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionMarshalJSON> {
17+ @Override
18+ public UnionMarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionMarshalJSON value = new UnionMarshalJSON();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.marshalJSONValue = jsonParser.readValueAs(MarshalJSON.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionMarshalJSON");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionMarshalJSON> {
37+ @Override
38+ public void serialize(UnionMarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.marshalJSONValue != null) {
44+ jsonGenerator.writeObject(obj.marshalJSONValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-javadefault / src / main / java / io / quicktype / UnionToDict.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 = UnionToDict.Deserializer.class)
11+@JsonSerialize(using = UnionToDict.Serializer.class)
12+public class UnionToDict {
13+ public Double doubleValue;
14+ public ToDict toDictValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionToDict> {
17+ @Override
18+ public UnionToDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionToDict value = new UnionToDict();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.toDictValue = jsonParser.readValueAs(ToDict.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionToDict");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionToDict> {
37+ @Override
38+ public void serialize(UnionToDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.toDictValue != null) {
44+ jsonGenerator.writeObject(obj.toDictValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-javadefault / src / main / java / io / quicktype / UnionUnmarshalJSON.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 = UnionUnmarshalJSON.Deserializer.class)
11+@JsonSerialize(using = UnionUnmarshalJSON.Serializer.class)
12+public class UnionUnmarshalJSON {
13+ public Double doubleValue;
14+ public UnmarshalJSON unmarshalJSONValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionUnmarshalJSON> {
17+ @Override
18+ public UnionUnmarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionUnmarshalJSON value = new UnionUnmarshalJSON();
20+ switch (jsonParser.currentToken()) {
21+ case VALUE_NULL:
22+ break;
23+ case VALUE_NUMBER_INT:
24+ case VALUE_NUMBER_FLOAT:
25+ value.doubleValue = jsonParser.readValueAs(Double.class);
26+ break;
27+ case START_OBJECT:
28+ value.unmarshalJSONValue = jsonParser.readValueAs(UnmarshalJSON.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionUnmarshalJSON");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionUnmarshalJSON> {
37+ @Override
38+ public void serialize(UnionUnmarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.unmarshalJSONValue != null) {
44+ jsonGenerator.writeObject(obj.unmarshalJSONValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-javadefault / src / main / java / io / quicktype / UnmarshalJSON.java+7 −0
@@ -0,0 +1,7 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE)
6+public class UnmarshalJSON {
7+}
Mschema-javascript-prop-typesdefault / toplevel.js+16 −0
@@ -51,6 +51,7 @@ let _JSONTokenType;
5151 let _KSerializer;
5252 let _Locale;
5353 let _MapEntry;
54+let _MarshalJSON;
5455 let _No;
5556 let _NSError;
5657 let _NSObject;
@@ -78,6 +79,7 @@ let _TimeZone;
7879 let _True;
7980 let _Type;
8081 let _UUID;
82+let _UnmarshalJSON;
8183 let _UseSerializers;
8284 let _Utf8JSONReader;
8385 let _Utf8JSONWriter;
@@ -183,6 +185,7 @@ let _For;
183185 let _Foreach;
184186 let _Friend;
185187 let _From;
188+let _FromDict;
186189 let _FromJSON;
187190 let _Func;
188191 let _Function;
@@ -317,6 +320,7 @@ let _ThreadLocal;
317320 let _Throw;
318321 let _Throws;
319322 let _ToString;
323+let _ToDict;
320324 let _ToJSON;
321325 let _TopLevelClass;
322326 let _Transient;
@@ -427,6 +431,8 @@ _Locale = PropTypes.shape({
427431 });
428432 _MapEntry = PropTypes.shape({
429433 });
434+_MarshalJSON = PropTypes.shape({
435+});
430436 _No = PropTypes.shape({
431437 });
432438 _NSError = PropTypes.shape({
@@ -481,6 +487,8 @@ _Type = PropTypes.shape({
481487 });
482488 _UUID = PropTypes.shape({
483489 });
490+_UnmarshalJSON = PropTypes.shape({
491+});
484492 _UseSerializers = PropTypes.shape({
485493 });
486494 _Utf8JSONReader = PropTypes.shape({
@@ -691,6 +699,8 @@ _Friend = PropTypes.shape({
691699 });
692700 _From = PropTypes.shape({
693701 });
702+_FromDict = PropTypes.shape({
703+});
694704 _FromJSON = PropTypes.shape({
695705 });
696706 _Func = PropTypes.shape({
@@ -959,6 +969,8 @@ _Throws = PropTypes.shape({
959969 });
960970 _ToString = PropTypes.shape({
961971 });
972+_ToDict = PropTypes.shape({
973+});
962974 _ToJSON = PropTypes.shape({
963975 });
964976 _TopLevelClass = PropTypes.shape({
@@ -1150,6 +1162,7 @@ _TopLevel = PropTypes.shape({
11501162 "FormatException": PropTypes.oneOfType([_FormatException, PropTypes.number, PropTypes.oneOf([null])]),
11511163 "friend": PropTypes.oneOfType([_Friend, PropTypes.number, PropTypes.oneOf([null])]),
11521164 "from": PropTypes.oneOfType([_From, PropTypes.number, PropTypes.oneOf([null])]),
1165+ "from_dict": PropTypes.oneOfType([_FromDict, PropTypes.number, PropTypes.oneOf([null])]),
11531166 "from_json": PropTypes.oneOfType([_FromJSON, PropTypes.number, PropTypes.oneOf([null])]),
11541167 "func": PropTypes.oneOfType([_Func, PropTypes.number, PropTypes.oneOf([null])]),
11551168 "function": PropTypes.oneOfType([_Function, PropTypes.number, PropTypes.oneOf([null])]),
@@ -1211,6 +1224,7 @@ _TopLevel = PropTypes.shape({
12111224 "long": PropTypes.oneOfType([_Long, PropTypes.number, PropTypes.oneOf([null])]),
12121225 "map": PropTypes.oneOfType([_Map, PropTypes.number, PropTypes.oneOf([null])]),
12131226 "MapEntry": PropTypes.oneOfType([_MapEntry, PropTypes.number, PropTypes.oneOf([null])]),
1227+ "MarshalJSON": PropTypes.oneOfType([_MarshalJSON, PropTypes.number, PropTypes.oneOf([null])]),
12141228 "metadata_property_handling": PropTypes.oneOfType([_MetadataPropertyHandling, PropTypes.number, PropTypes.oneOf([null])]),
12151229 "module": PropTypes.oneOfType([_Module, PropTypes.number, PropTypes.oneOf([null])]),
12161230 "mutable": PropTypes.oneOfType([_Mutable, PropTypes.number, PropTypes.oneOf([null])]),
@@ -1325,6 +1339,7 @@ _TopLevel = PropTypes.shape({
13251339 "TimeOnly": PropTypes.oneOfType([_TimeOnly, PropTypes.number, PropTypes.oneOf([null])]),
13261340 "TimeOnlyConverter": PropTypes.oneOfType([_TimeOnlyConverter, PropTypes.number, PropTypes.oneOf([null])]),
13271341 "TimeZone": PropTypes.oneOfType([_TimeZone, PropTypes.number, PropTypes.oneOf([null])]),
1342+ "to_dict": PropTypes.oneOfType([_ToDict, PropTypes.number, PropTypes.oneOf([null])]),
13281343 "to_json": PropTypes.oneOfType([_ToJSON, PropTypes.number, PropTypes.oneOf([null])]),
13291344 "top_level": PropTypes.oneOfType([_TopLevelClass, PropTypes.number, PropTypes.oneOf([null])]),
13301345 "toString": (props, name, ...args) => Object.prototype.hasOwnProperty.call(props, name) ? PropTypes.oneOfType([_ToString, PropTypes.number, PropTypes.oneOf([null])])(props, name, ...args) : null,
@@ -1344,6 +1359,7 @@ _TopLevel = PropTypes.shape({
13441359 "unchecked": PropTypes.oneOfType([_Unchecked, PropTypes.number, PropTypes.oneOf([null])]),
13451360 "undefined": PropTypes.oneOfType([_Undefined, PropTypes.number, PropTypes.oneOf([null])]),
13461361 "union": PropTypes.oneOfType([_Union, PropTypes.number, PropTypes.oneOf([null])]),
1362+ "UnmarshalJSON": PropTypes.oneOfType([_UnmarshalJSON, PropTypes.number, PropTypes.oneOf([null])]),
13471363 "unowned": PropTypes.oneOfType([_Unowned, PropTypes.number, PropTypes.oneOf([null])]),
13481364 "unsafe": PropTypes.oneOfType([_Unsafe, PropTypes.number, PropTypes.oneOf([null])]),
13491365 "unsigned": PropTypes.oneOfType([_Unsigned, PropTypes.number, PropTypes.oneOf([null])]),
Mschema-javascriptdefault / TopLevel.js+14 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
@@ -315,6 +315,7 @@ const typeMap = {
315315 { json: "FormatException", js: "FormatException", typ: u(undefined, u(r("FormatException"), 3.14)) },
316316 { json: "friend", js: "friend", typ: u(undefined, u(r("Friend"), 3.14)) },
317317 { json: "from", js: "from", typ: u(undefined, u(r("From"), 3.14)) },
318+ { json: "from_dict", js: "from_dict", typ: u(undefined, u(r("FromDict"), 3.14)) },
318319 { json: "from_json", js: "from_json", typ: u(undefined, u(r("FromJSON"), 3.14)) },
319320 { json: "func", js: "func", typ: u(undefined, u(r("Func"), 3.14)) },
320321 { json: "function", js: "function", typ: u(undefined, u(r("Function"), 3.14)) },
@@ -376,6 +377,7 @@ const typeMap = {
376377 { json: "long", js: "long", typ: u(undefined, u(r("Long"), 3.14)) },
377378 { json: "map", js: "map", typ: u(undefined, u(r("Map"), 3.14)) },
378379 { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(r("MapEntry"), 3.14)) },
380+ { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(r("MarshalJSON"), 3.14)) },
379381 { json: "metadata_property_handling", js: "metadata_property_handling", typ: u(undefined, u(r("MetadataPropertyHandling"), 3.14)) },
380382 { json: "module", js: "module", typ: u(undefined, u(r("Module"), 3.14)) },
381383 { json: "mutable", js: "mutable", typ: u(undefined, u(r("Mutable"), 3.14)) },
@@ -490,6 +492,7 @@ const typeMap = {
490492 { json: "TimeOnly", js: "TimeOnly", typ: u(undefined, u(r("TimeOnly"), 3.14)) },
491493 { json: "TimeOnlyConverter", js: "TimeOnlyConverter", typ: u(undefined, u(r("TimeOnlyConverter"), 3.14)) },
492494 { json: "TimeZone", js: "TimeZone", typ: u(undefined, u(r("TimeZone"), 3.14)) },
495+ { json: "to_dict", js: "to_dict", typ: u(undefined, u(r("ToDict"), 3.14)) },
493496 { json: "to_json", js: "to_json", typ: u(undefined, u(r("ToJSON"), 3.14)) },
494497 { json: "top_level", js: "top_level", typ: u(undefined, u(r("TopLevelClass"), 3.14)) },
495498 { json: "toString", js: "toString", typ: u(undefined, u(r("ToString"), 3.14)) },
@@ -509,6 +512,7 @@ const typeMap = {
509512 { json: "unchecked", js: "unchecked", typ: u(undefined, u(r("Unchecked"), 3.14)) },
510513 { json: "undefined", js: "undefined", typ: u(undefined, u(r("Undefined"), 3.14)) },
511514 { json: "union", js: "union", typ: u(undefined, u(r("Union"), 3.14)) },
515+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: u(undefined, u(r("UnmarshalJSON"), 3.14)) },
512516 { json: "unowned", js: "unowned", typ: u(undefined, u(r("Unowned"), 3.14)) },
513517 { json: "unsafe", js: "unsafe", typ: u(undefined, u(r("Unsafe"), 3.14)) },
514518 { json: "unsigned", js: "unsigned", typ: u(undefined, u(r("Unsigned"), 3.14)) },
@@ -609,6 +613,8 @@ const typeMap = {
609613 ], false),
610614 "MapEntry": o([
611615 ], false),
616+ "MarshalJSON": o([
617+ ], false),
612618 "No": o([
613619 ], false),
614620 "NSError": o([
@@ -663,6 +669,8 @@ const typeMap = {
663669 ], false),
664670 "UUID": o([
665671 ], false),
672+ "UnmarshalJSON": o([
673+ ], false),
666674 "UseSerializers": o([
667675 ], false),
668676 "Utf8JSONReader": o([
@@ -873,6 +881,8 @@ const typeMap = {
873881 ], false),
874882 "From": o([
875883 ], false),
884+ "FromDict": o([
885+ ], false),
876886 "FromJSON": o([
877887 ], false),
878888 "Func": o([
@@ -1141,6 +1151,8 @@ const typeMap = {
11411151 ], false),
11421152 "ToString": o([
11431153 ], false),
1154+ "ToDict": o([
1155+ ], false),
11441156 "ToJSON": o([
11451157 ], false),
11461158 "TopLevelClass": o([
Mschema-objective-cdefault / QTTopLevel.h+20 −0
@@ -103,6 +103,7 @@
103103 @class QTFormatException;
104104 @class QTFriend;
105105 @class QTFrom;
106+@class QTFromDict;
106107 @class QTFromJSON;
107108 @class QTFunc;
108109 @class QTFunction;
@@ -158,6 +159,7 @@
158159 @class QTLock;
159160 @class QTMap;
160161 @class QTMapEntry;
162+@class QTMarshalJSON;
161163 @class QTMetadataPropertyHandling;
162164 @class QTModule;
163165 @class QTMutable;
@@ -312,6 +314,7 @@
312314 @class QTTimeOnly;
313315 @class QTTimeOnlyConverter;
314316 @class QTTimeZone;
317+@class QTToDict;
315318 @class QTToJSON;
316319 @class QTToString;
317320 @class QTTopLevelClass;
@@ -325,6 +328,7 @@
325328 @class QTUlong;
326329 @class QTUnchecked;
327330 @class QTUndefined;
331+@class QTUnmarshalJSON;
328332 @class QTUnowned;
329333 @class QTUnsafe;
330334 @class QTUseSerializers;
@@ -479,6 +483,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
479483 @property (nonatomic, nullable, copy) id formatException;
480484 @property (nonatomic, nullable, copy) id friend;
481485 @property (nonatomic, nullable, copy) id from;
486+@property (nonatomic, nullable, copy) id fromDict;
482487 @property (nonatomic, nullable, copy) id fromJSON;
483488 @property (nonatomic, nullable, copy) id func;
484489 @property (nonatomic, nullable, copy) id function;
@@ -540,6 +545,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
540545 @property (nonatomic, nullable, copy) id qtTopLevelLong;
541546 @property (nonatomic, nullable, copy) id map;
542547 @property (nonatomic, nullable, copy) id mapEntry;
548+@property (nonatomic, nullable, copy) id marshalJSON;
543549 @property (nonatomic, nullable, copy) id metadataPropertyHandling;
544550 @property (nonatomic, nullable, copy) id module;
545551 @property (nonatomic, nullable, copy) id mutable;
@@ -654,6 +660,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
654660 @property (nonatomic, nullable, copy) id timeOnly;
655661 @property (nonatomic, nullable, copy) id timeOnlyConverter;
656662 @property (nonatomic, nullable, copy) id timeZone;
663+@property (nonatomic, nullable, copy) id toDict;
657664 @property (nonatomic, nullable, copy) id toJSON;
658665 @property (nonatomic, nullable, copy) id topLevel;
659666 @property (nonatomic, nullable, copy) id toString;
@@ -673,6 +680,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
673680 @property (nonatomic, nullable, copy) id unchecked;
674681 @property (nonatomic, nullable, copy) id undefined;
675682 @property (nonatomic, nullable, copy) id qtTopLevelUnion;
683+@property (nonatomic, nullable, copy) id unmarshalJSON;
676684 @property (nonatomic, nullable, copy) id unowned;
677685 @property (nonatomic, nullable, copy) id unsafe;
678686 @property (nonatomic, nullable, copy) id qtTopLevelUnsigned;
@@ -994,6 +1002,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
9941002 @interface QTFrom : NSObject
9951003 @end
9961004
1005+@interface QTFromDict : NSObject
1006+@end
1007+
9971008 @interface QTFromJSON : NSObject
9981009 @end
9991010
@@ -1159,6 +1170,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
11591170 @interface QTMapEntry : NSObject
11601171 @end
11611172
1173+@interface QTMarshalJSON : NSObject
1174+@end
1175+
11621176 @interface QTMetadataPropertyHandling : NSObject
11631177 @end
11641178
@@ -1621,6 +1635,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
16211635 @interface QTTimeZone : NSObject
16221636 @end
16231637
1638+@interface QTToDict : NSObject
1639+@end
1640+
16241641 @interface QTToJSON : NSObject
16251642 @end
16261643
@@ -1660,6 +1677,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
16601677 @interface QTUndefined : NSObject
16611678 @end
16621679
1680+@interface QTUnmarshalJSON : NSObject
1681+@end
1682+
16631683 @interface QTUnowned : NSObject
16641684 @end
Mschema-objective-cdefault / QTTopLevel.m+180 −0
@@ -498,6 +498,11 @@ NS_ASSUME_NONNULL_BEGIN
498498 - (NSDictionary *)JSONDictionary;
499499 @end
500500
501+@interface QTFromDict (JSONConversion)
502++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
503+- (NSDictionary *)JSONDictionary;
504+@end
505+
501506 @interface QTFromJSON (JSONConversion)
502507 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
503508 - (NSDictionary *)JSONDictionary;
@@ -773,6 +778,11 @@ NS_ASSUME_NONNULL_BEGIN
773778 - (NSDictionary *)JSONDictionary;
774779 @end
775780
781+@interface QTMarshalJSON (JSONConversion)
782++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
783+- (NSDictionary *)JSONDictionary;
784+@end
785+
776786 @interface QTMetadataPropertyHandling (JSONConversion)
777787 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
778788 - (NSDictionary *)JSONDictionary;
@@ -1543,6 +1553,11 @@ NS_ASSUME_NONNULL_BEGIN
15431553 - (NSDictionary *)JSONDictionary;
15441554 @end
15451555
1556+@interface QTToDict (JSONConversion)
1557++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1558+- (NSDictionary *)JSONDictionary;
1559+@end
1560+
15461561 @interface QTToJSON (JSONConversion)
15471562 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
15481563 - (NSDictionary *)JSONDictionary;
@@ -1608,6 +1623,11 @@ NS_ASSUME_NONNULL_BEGIN
16081623 - (NSDictionary *)JSONDictionary;
16091624 @end
16101625
1626+@interface QTUnmarshalJSON (JSONConversion)
1627++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1628+- (NSDictionary *)JSONDictionary;
1629+@end
1630+
16111631 @interface QTUnowned (JSONConversion)
16121632 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16131633 - (NSDictionary *)JSONDictionary;
@@ -1866,6 +1886,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
18661886 @"FormatException": @"formatException",
18671887 @"friend": @"friend",
18681888 @"from": @"from",
1889+ @"from_dict": @"fromDict",
18691890 @"from_json": @"fromJSON",
18701891 @"func": @"func",
18711892 @"function": @"function",
@@ -1927,6 +1948,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
19271948 @"long": @"qtTopLevelLong",
19281949 @"map": @"map",
19291950 @"MapEntry": @"mapEntry",
1951+ @"MarshalJSON": @"marshalJSON",
19301952 @"metadata_property_handling": @"metadataPropertyHandling",
19311953 @"module": @"module",
19321954 @"mutable": @"mutable",
@@ -2041,6 +2063,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
20412063 @"TimeOnly": @"timeOnly",
20422064 @"TimeOnlyConverter": @"timeOnlyConverter",
20432065 @"TimeZone": @"timeZone",
2066+ @"to_dict": @"toDict",
20442067 @"to_json": @"toJSON",
20452068 @"top_level": @"topLevel",
20462069 @"toString": @"toString",
@@ -2060,6 +2083,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
20602083 @"unchecked": @"unchecked",
20612084 @"undefined": @"undefined",
20622085 @"union": @"qtTopLevelUnion",
2086+ @"UnmarshalJSON": @"unmarshalJSON",
20632087 @"unowned": @"unowned",
20642088 @"unsafe": @"unsafe",
20652089 @"unsigned": @"qtTopLevelUnsigned",
@@ -5930,6 +5954,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
59305954 }
59315955 @end
59325956
5957+@implementation QTFromDict
5958++ (NSDictionary<NSString *, NSString *> *)properties
5959+{
5960+ static NSDictionary<NSString *, NSString *> *properties;
5961+ return properties = properties ? properties : @{
5962+ };
5963+}
5964+
5965++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
5966+{
5967+ return [dict isKindOfClass:NSDictionary.class] ? [[QTFromDict alloc] initWithJSONDictionary:dict] : nil;
5968+}
5969+
5970+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
5971+{
5972+ if (self = [super init]) {
5973+ [self setValuesForKeysWithDictionary:dict];
5974+ }
5975+ return self;
5976+}
5977+
5978+- (void)setValue:(nullable id)value forKey:(NSString *)key
5979+{
5980+ id resolved = QTFromDict.properties[key];
5981+ if (resolved) [super setValue:value forKey:resolved];
5982+}
5983+
5984+- (void)setNilValueForKey:(NSString *)key
5985+{
5986+ id resolved = QTFromDict.properties[key];
5987+ if (resolved) [super setValue:@(0) forKey:resolved];
5988+}
5989+
5990+- (NSDictionary *)JSONDictionary
5991+{
5992+ return [self dictionaryWithValuesForKeys:QTFromDict.properties.allValues];
5993+}
5994+@end
5995+
59335996 @implementation QTFromJSON
59345997 + (NSDictionary<NSString *, NSString *> *)properties
59355998 {
@@ -8075,6 +8138,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
80758138 }
80768139 @end
80778140
8141+@implementation QTMarshalJSON
8142++ (NSDictionary<NSString *, NSString *> *)properties
8143+{
8144+ static NSDictionary<NSString *, NSString *> *properties;
8145+ return properties = properties ? properties : @{
8146+ };
8147+}
8148+
8149++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
8150+{
8151+ return [dict isKindOfClass:NSDictionary.class] ? [[QTMarshalJSON alloc] initWithJSONDictionary:dict] : nil;
8152+}
8153+
8154+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
8155+{
8156+ if (self = [super init]) {
8157+ [self setValuesForKeysWithDictionary:dict];
8158+ }
8159+ return self;
8160+}
8161+
8162+- (void)setValue:(nullable id)value forKey:(NSString *)key
8163+{
8164+ id resolved = QTMarshalJSON.properties[key];
8165+ if (resolved) [super setValue:value forKey:resolved];
8166+}
8167+
8168+- (void)setNilValueForKey:(NSString *)key
8169+{
8170+ id resolved = QTMarshalJSON.properties[key];
8171+ if (resolved) [super setValue:@(0) forKey:resolved];
8172+}
8173+
8174+- (NSDictionary *)JSONDictionary
8175+{
8176+ return [self dictionaryWithValuesForKeys:QTMarshalJSON.properties.allValues];
8177+}
8178+@end
8179+
80788180 @implementation QTMetadataPropertyHandling
80798181 + (NSDictionary<NSString *, NSString *> *)properties
80808182 {
@@ -14081,6 +14183,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1408114183 }
1408214184 @end
1408314185
14186+@implementation QTToDict
14187++ (NSDictionary<NSString *, NSString *> *)properties
14188+{
14189+ static NSDictionary<NSString *, NSString *> *properties;
14190+ return properties = properties ? properties : @{
14191+ };
14192+}
14193+
14194++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
14195+{
14196+ return [dict isKindOfClass:NSDictionary.class] ? [[QTToDict alloc] initWithJSONDictionary:dict] : nil;
14197+}
14198+
14199+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
14200+{
14201+ if (self = [super init]) {
14202+ [self setValuesForKeysWithDictionary:dict];
14203+ }
14204+ return self;
14205+}
14206+
14207+- (void)setValue:(nullable id)value forKey:(NSString *)key
14208+{
14209+ id resolved = QTToDict.properties[key];
14210+ if (resolved) [super setValue:value forKey:resolved];
14211+}
14212+
14213+- (void)setNilValueForKey:(NSString *)key
14214+{
14215+ id resolved = QTToDict.properties[key];
14216+ if (resolved) [super setValue:@(0) forKey:resolved];
14217+}
14218+
14219+- (NSDictionary *)JSONDictionary
14220+{
14221+ return [self dictionaryWithValuesForKeys:QTToDict.properties.allValues];
14222+}
14223+@end
14224+
1408414225 @implementation QTToJSON
1408514226 + (NSDictionary<NSString *, NSString *> *)properties
1408614227 {
@@ -14588,6 +14729,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1458814729 }
1458914730 @end
1459014731
14732+@implementation QTUnmarshalJSON
14733++ (NSDictionary<NSString *, NSString *> *)properties
14734+{
14735+ static NSDictionary<NSString *, NSString *> *properties;
14736+ return properties = properties ? properties : @{
14737+ };
14738+}
14739+
14740++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
14741+{
14742+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUnmarshalJSON alloc] initWithJSONDictionary:dict] : nil;
14743+}
14744+
14745+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
14746+{
14747+ if (self = [super init]) {
14748+ [self setValuesForKeysWithDictionary:dict];
14749+ }
14750+ return self;
14751+}
14752+
14753+- (void)setValue:(nullable id)value forKey:(NSString *)key
14754+{
14755+ id resolved = QTUnmarshalJSON.properties[key];
14756+ if (resolved) [super setValue:value forKey:resolved];
14757+}
14758+
14759+- (void)setNilValueForKey:(NSString *)key
14760+{
14761+ id resolved = QTUnmarshalJSON.properties[key];
14762+ if (resolved) [super setValue:@(0) forKey:resolved];
14763+}
14764+
14765+- (NSDictionary *)JSONDictionary
14766+{
14767+ return [self dictionaryWithValuesForKeys:QTUnmarshalJSON.properties.allValues];
14768+}
14769+@end
14770+
1459114771 @implementation QTUnowned
1459214772 + (NSDictionary<NSString *, NSString *> *)properties
1459314773 {
Mschema-phpdefault / TopLevel.php+734 −222
@@ -126,6 +126,7 @@ class TopLevel {
126126 private FormatException|float|null $formatException; // json:FormatException Optional
127127 private Friend|float|null $friend; // json:friend Optional
128128 private From|float|null $from; // json:from Optional
129+ private FromDict|float|null $fromDict; // json:from_dict Optional
129130 private FromJSON|float|null $fromJSON; // json:from_json Optional
130131 private Func|float|null $func; // json:func Optional
131132 private FunctionClass|float|null $function; // json:function Optional
@@ -187,6 +188,7 @@ class TopLevel {
187188 private Long|float|null $long; // json:long Optional
188189 private Map|float|null $map; // json:map Optional
189190 private MapEntry|float|null $mapEntry; // json:MapEntry Optional
191+ private MarshalJSON|float|null $marshalJSON; // json:MarshalJSON Optional
190192 private MetadataPropertyHandling|float|null $metadataPropertyHandling; // json:metadata_property_handling Optional
191193 private Module|float|null $module; // json:module Optional
192194 private Mutable|float|null $mutable; // json:mutable Optional
@@ -301,6 +303,7 @@ class TopLevel {
301303 private TimeOnly|float|null $timeOnly; // json:TimeOnly Optional
302304 private TimeOnlyConverter|float|null $timeOnlyConverter; // json:TimeOnlyConverter Optional
303305 private TimeZone|float|null $timeZone; // json:TimeZone Optional
306+ private ToDict|float|null $toDict; // json:to_dict Optional
304307 private ToJSON|float|null $toJSON; // json:to_json Optional
305308 private TopLevelClass|float|null $topLevel; // json:top_level Optional
306309 private ToString|float|null $toString; // json:toString Optional
@@ -320,6 +323,7 @@ class TopLevel {
320323 private Unchecked|float|null $unchecked; // json:unchecked Optional
321324 private Undefined|float|null $undefined; // json:undefined Optional
322325 private UnionClass|float|null $union; // json:union Optional
326+ private UnmarshalJSON|float|null $unmarshalJSON; // json:UnmarshalJSON Optional
323327 private Unowned|float|null $unowned; // json:unowned Optional
324328 private Unsafe|float|null $unsafe; // json:unsafe Optional
325329 private Unsigned|float|null $unsigned; // json:unsigned Optional
@@ -467,6 +471,7 @@ class TopLevel {
467471 * @param FormatException|float|null $formatException
468472 * @param Friend|float|null $friend
469473 * @param From|float|null $from
474+ * @param FromDict|float|null $fromDict
470475 * @param FromJSON|float|null $fromJSON
471476 * @param Func|float|null $func
472477 * @param FunctionClass|float|null $function
@@ -528,6 +533,7 @@ class TopLevel {
528533 * @param Long|float|null $long
529534 * @param Map|float|null $map
530535 * @param MapEntry|float|null $mapEntry
536+ * @param MarshalJSON|float|null $marshalJSON
531537 * @param MetadataPropertyHandling|float|null $metadataPropertyHandling
532538 * @param Module|float|null $module
533539 * @param Mutable|float|null $mutable
@@ -642,6 +648,7 @@ class TopLevel {
642648 * @param TimeOnly|float|null $timeOnly
643649 * @param TimeOnlyConverter|float|null $timeOnlyConverter
644650 * @param TimeZone|float|null $timeZone
651+ * @param ToDict|float|null $toDict
645652 * @param ToJSON|float|null $toJSON
646653 * @param TopLevelClass|float|null $topLevel
647654 * @param ToString|float|null $toString
@@ -661,6 +668,7 @@ class TopLevel {
661668 * @param Unchecked|float|null $unchecked
662669 * @param Undefined|float|null $undefined
663670 * @param UnionClass|float|null $union
671+ * @param UnmarshalJSON|float|null $unmarshalJSON
664672 * @param Unowned|float|null $unowned
665673 * @param Unsafe|float|null $unsafe
666674 * @param Unsigned|float|null $unsigned
@@ -685,7 +693,7 @@ class TopLevel {
685693 * @param Yes|float|null $yes
686694 * @param YieldClass|float|null $yield
687695 */
688- public function __construct(Union|float|null $empty, UnionBoolBool|float|null $topLevelBool, Complex|float|null $complex, Imaginery|float|null $imaginery, AbstractClass|float|null $abstract, Alignas|float|null $alignas, Alignof|float|null $alignof, AndClass|float|null $and, AndEq|float|null $andEq, AnyClass|float|null $topLevelAny, Any|float|null $any, ArrayClass|float|null $array, AsClass|float|null $as, ASM|float|null $asm, Assert|float|null $assert, Associatedtype|float|null $associatedtype, Associativity|float|null $associativity, Async|float|null $async, Atomic|float|null $atomic, AtomicCancel|float|null $atomicCancel, AtomicCommit|float|null $atomicCommit, AtomicNoexcept|float|null $atomicNoexcept, Auto|float|null $auto, Await|float|null $await, Base|float|null $base, Bitand|float|null $bitand, Bitor|float|null $bitor, BOOLClass|float|null $bool, UnionBoolBoolClass|float|null $purpleBool, Boolean|float|null $boolean, BreakClass|float|null $break, Bycopy|float|null $bycopy, Byref|float|null $byref, Byte|float|null $byte, Calendar|float|null $calendar, CaseClass|float|null $case, CatchClass|float|null $catch, Chan|float|null $chan, Char|float|null $char, Char16T|float|null $char16T, Char32T|float|null $char32T, Checked|float|null $checked, UnionClassClass|float|null $topLevelClass, ClassClass|float|null $class, CloneClass|float|null $clone, CoAwait|float|null $coAwait, CoReturn|float|null $coReturn, CoYield|float|null $coYield, Codable|float|null $codable, CodingKey|float|null $codingKey, CodingKeys|float|null $codingKeys, Compl|float|null $compl, Concept|float|null $concept, Console|float|null $console, ConstClass|float|null $const, ConstCast|float|null $constCast, Constexpr|float|null $constexpr, Constructor|float|null $constructor, ContinueClass|float|null $continue, Convenience|float|null $convenience, Convert|float|null $convert, ConverterClass|float|null $converter, CultureInfo|float|null $cultureInfo, Date|float|null $date, DateParseHandling|float|null $dateParseHandling, DateFormatter|float|null $dateFormatter, DateOnly|float|null $dateOnly, DateOnlyConverter|float|null $dateOnlyConverter, DateTimeClass|float|null $dateTime, DateTimeStyles|float|null $dateTimeStyles, Debugger|float|null $debugger, Decimal|float|null $decimal, DeclareClass|float|null $declare, Decltype|float|null $decltype, DecodeString|float|null $decodeString, Decoder|float|null $decoder, DecodingError|float|null $decodingError, Def|float|null $def, DefaultClass|float|null $default, Defer|float|null $defer, Deinit|float|null $deinit, Del|float|null $del, Delegate|float|null $delegate, Delete|float|null $delete, Dict|float|null $dict, Dictionary|float|null $dictionary, DidSet|float|null $didSet, DoClass|float|null $do, Double|float|null $double, ?float $dummy, Dynamic|float|null $dynamic, DynamicCast|float|null $dynamicCast, Elif|float|null $elif, ElseClass|float|null $else, EncodeQuickType|float|null $encodeQuickType, Encoder|float|null $encoder, EnumClass|float|null $enum, EnumValues|float|null $enumValues, EqualityContract|float|null $equalityContract, Equatable|float|null $equatable, Event|float|null $event, Except|float|null $except, ExceptionClass|float|null $exception, Explicit|float|null $explicit, Export|float|null $export, Exposing|float|null $exposing, ExtendsClass|float|null $extends, Extension|float|null $extension, Extern|float|null $extern, Fallthrough|float|null $fallthrough, UnionFalseFalse|float|null $topLevelFalse, FalseClass|float|null $false, Fileprivate|float|null $fileprivate, FinalClass|float|null $final, FinallyClass|float|null $finally, Fixed|float|null $fixed, FloatClass|float|null $float, ForClass|float|null $for, ForeachClass|float|null $foreach, FormatException|float|null $formatException, Friend|float|null $friend, From|float|null $from, FromJSON|float|null $fromJSON, Func|float|null $func, FunctionClass|float|null $function, Get|float|null $get, GlobalClass|float|null $global, Go|float|null $go, GotoClass|float|null $goto, Guard|float|null $guard, Hashable|float|null $hashable, HashCode|float|null $hashCode, Hasher|float|null $hasher, HasOwnProperty|float|null $hasOwnProperty, ID|float|null $id, IfClass|float|null $if, Imp|float|null $imp, ImplementsClass|float|null $implements, Implicit|float|null $implicit, Import|float|null $import, In|float|null $in, Indirect|float|null $indirect, Infix|float|null $infix, Init|float|null $init, Inline|float|null $inline, Inout|float|null $inout, InstanceofClass|float|null $instanceof, IntClass|float|null $int, InterfaceClass|float|null $interface, Internal|float|null $internal, Is|float|null $is, ISODateTimeOffsetConverter|float|null $isoDateTimeOffsetConverter, IterableClass|float|null $iterable, Jdec|float|null $jdec, Jenc|float|null $jenc, Jpipe|float|null $jpipe, JSON|float|null $json, JSONConverter|float|null $jsonConverter, JSONSerializer|float|null $jsonSerializer, JSONToken|float|null $jsonToken, JSONWriter|float|null $jsonWriter, JSONAny|float|null $jsonAny, JSONCodingKey|float|null $jsonCodingKey, JSONDecoder|float|null $jsonDecoder, JSONEncoder|float|null $jsonEncoder, JSONExceptionClass|float|null $jsonException, JSONGenerator|float|null $jsonGenerator, JSONNode|float|null $jsonNode, JSONNull|float|null $jsonNull, JSONParser|float|null $jsonParser, JSONReader|float|null $jsonReader, JSONTokenType|float|null $jsonTokenType, KSerializer|float|null $kSerializer, Lambda|float|null $lambda, Lazy|float|null $lazy, Left|float|null $left, Let|float|null $let, ListClass|float|null $list, LocaleClass|float|null $locale, Lock|float|null $lock, Long|float|null $long, Map|float|null $map, MapEntry|float|null $mapEntry, MetadataPropertyHandling|float|null $metadataPropertyHandling, Module|float|null $module, Mutable|float|null $mutable, Mutating|float|null $mutating, NamespaceClass|float|null $namespace, Native|float|null $native, NewClass|float|null $new, Newtonsoft|float|null $newtonsoft, Nil|float|null $nil, No|float|null $no, Noexcept|float|null $noexcept, Nonatomic|float|null $nonatomic, NoneClass|float|null $topLevelNone, None|float|null $none, Nonlocal|float|null $nonlocal, Nonmutating|float|null $nonmutating, NoSuchMethod|float|null $noSuchMethod, Not|float|null $not, NotEq|float|null $notEq, NSError|float|null $nsError, NSObject|float|null $nsObject, NSString|float|null $nsString, NULLClass|float|null $null, UnionNullNull|float|null $topLevelNull, Nullptr|float|null $nullptr, Number|float|null $number, ObjectClass|float|null $object, ObjectMapper|float|null $objectMapper, Of|float|null $of, Oneway|float|null $oneway, Open|float|null $open, Operator|float|null $operator, Optional|float|null $optional, OrClass|float|null $or, OrEq|float|null $orEq, Out|float|null $out, OverrideClass|float|null $override, Package|float|null $package, Params|float|null $params, Pass|float|null $pass, Port|float|null $port, Postfix|float|null $postfix, Precedence|float|null $precedence, Prefix|float|null $prefix, PrimitiveKind|float|null $primitiveKind, PrintClass|float|null $print, Printf|float|null $printf, PrintMembers|float|null $printMembers, PrivateClass|float|null $private, ProtectedClass|float|null $protected, Protocol|float|null $protocol, ProtocolClass|float|null $topLevelProtocol, PublicClass|float|null $public, Quicktype|float|null $quicktype, Raise|float|null $raise, Range|float|null $range, ReadonlyClass|float|null $readonly, Ref|float|null $ref, RegExp|float|null $regExp, Register|float|null $register, ReinterpretCast|float|null $reinterpretCast, Repeat|float|null $repeat, RequireClass|float|null $require, Required|float|null $required, Requires|float|null $requires, Restrict|float|null $restrict, Retain|float|null $retain, Rethrows|float|null $rethrows, ReturnClass|float|null $return, Right|float|null $right, RuntimeType|float|null $runtimeType, S|float|null $s, Sbyte|float|null $sbyte, Sealed|float|null $sealed, Sel|float|null $sel, Select|float|null $select, SelfClass|float|null $self, UnionSelfSelf|float|null $topLevelSelf, Sendable|float|null $sendable, SerialDescriptor|float|null $serialDescriptor, SerializableClass|float|null $serializable, Serialize|float|null $serialize, SerializerProvider|float|null $serializerProvider, SerialName|float|null $serialName, Set|float|null $set, Short|float|null $short, Signed|float|null $signed, SimpleModule|float|null $simpleModule, Sizeof|float|null $sizeof, Stackalloc|float|null $stackalloc, Standards|float|null $standards, StaticClass|float|null $static, StaticAssert|float|null $staticAssert, StaticCast|float|null $staticCast, StdDeserializer|float|null $stdDeserializer, StdSerializer|float|null $stdSerializer, Strictfp|float|null $strictfp, StringClass|float|null $string, Struct|float|null $struct, Subscript|float|null $subscript, Super|float|null $super, SwitchClass|float|null $switch, Symbol|float|null $symbol, Synchronized|float|null $synchronized, System|float|null $system, Template|float|null $template, Then|float|null $then, This|float|null $topLevelThis, ThreadLocal|float|null $threadLocal, ThrowClass|float|null $throw, Throws|float|null $throws, TimeOnly|float|null $timeOnly, TimeOnlyConverter|float|null $timeOnlyConverter, TimeZone|float|null $timeZone, ToJSON|float|null $toJSON, TopLevelClass|float|null $topLevel, ToString|float|null $toString, Transient|float|null $transient, TrueClass|float|null $true, UnionTrueTrue|float|null $topLevelTrue, TryClass|float|null $try, Type|float|null $type, TypeClass|float|null $topLevelType, Typealias|float|null $typealias, Typedef|float|null $typedef, Typeid|float|null $typeid, Typename|float|null $typename, Typeof|float|null $typeof, Uint|float|null $uint, Ulong|float|null $ulong, Unchecked|float|null $unchecked, Undefined|float|null $undefined, UnionClass|float|null $union, Unowned|float|null $unowned, Unsafe|float|null $unsafe, Unsigned|float|null $unsigned, UseSerializers|float|null $useSerializers, Ushort|float|null $ushort, Using|float|null $using, Utf8JSONReader|float|null $utf8JSONReader, Utf8JSONWriter|float|null $utf8JSONWriter, UUID|float|null $uuid, VarClass|float|null $var, Virtual|float|null $virtual, VoidClass|float|null $void, Volatile|float|null $volatile, WcharT|float|null $wcharT, Weak|float|null $weak, Where|float|null $where, WhileClass|float|null $while, WillSet|float|null $willSet, With|float|null $with, XorClass|float|null $xor, XorEq|float|null $xorEq, Yes|float|null $yes, YieldClass|float|null $yield) {
696+ public function __construct(Union|float|null $empty, UnionBoolBool|float|null $topLevelBool, Complex|float|null $complex, Imaginery|float|null $imaginery, AbstractClass|float|null $abstract, Alignas|float|null $alignas, Alignof|float|null $alignof, AndClass|float|null $and, AndEq|float|null $andEq, AnyClass|float|null $topLevelAny, Any|float|null $any, ArrayClass|float|null $array, AsClass|float|null $as, ASM|float|null $asm, Assert|float|null $assert, Associatedtype|float|null $associatedtype, Associativity|float|null $associativity, Async|float|null $async, Atomic|float|null $atomic, AtomicCancel|float|null $atomicCancel, AtomicCommit|float|null $atomicCommit, AtomicNoexcept|float|null $atomicNoexcept, Auto|float|null $auto, Await|float|null $await, Base|float|null $base, Bitand|float|null $bitand, Bitor|float|null $bitor, BOOLClass|float|null $bool, UnionBoolBoolClass|float|null $purpleBool, Boolean|float|null $boolean, BreakClass|float|null $break, Bycopy|float|null $bycopy, Byref|float|null $byref, Byte|float|null $byte, Calendar|float|null $calendar, CaseClass|float|null $case, CatchClass|float|null $catch, Chan|float|null $chan, Char|float|null $char, Char16T|float|null $char16T, Char32T|float|null $char32T, Checked|float|null $checked, UnionClassClass|float|null $topLevelClass, ClassClass|float|null $class, CloneClass|float|null $clone, CoAwait|float|null $coAwait, CoReturn|float|null $coReturn, CoYield|float|null $coYield, Codable|float|null $codable, CodingKey|float|null $codingKey, CodingKeys|float|null $codingKeys, Compl|float|null $compl, Concept|float|null $concept, Console|float|null $console, ConstClass|float|null $const, ConstCast|float|null $constCast, Constexpr|float|null $constexpr, Constructor|float|null $constructor, ContinueClass|float|null $continue, Convenience|float|null $convenience, Convert|float|null $convert, ConverterClass|float|null $converter, CultureInfo|float|null $cultureInfo, Date|float|null $date, DateParseHandling|float|null $dateParseHandling, DateFormatter|float|null $dateFormatter, DateOnly|float|null $dateOnly, DateOnlyConverter|float|null $dateOnlyConverter, DateTimeClass|float|null $dateTime, DateTimeStyles|float|null $dateTimeStyles, Debugger|float|null $debugger, Decimal|float|null $decimal, DeclareClass|float|null $declare, Decltype|float|null $decltype, DecodeString|float|null $decodeString, Decoder|float|null $decoder, DecodingError|float|null $decodingError, Def|float|null $def, DefaultClass|float|null $default, Defer|float|null $defer, Deinit|float|null $deinit, Del|float|null $del, Delegate|float|null $delegate, Delete|float|null $delete, Dict|float|null $dict, Dictionary|float|null $dictionary, DidSet|float|null $didSet, DoClass|float|null $do, Double|float|null $double, ?float $dummy, Dynamic|float|null $dynamic, DynamicCast|float|null $dynamicCast, Elif|float|null $elif, ElseClass|float|null $else, EncodeQuickType|float|null $encodeQuickType, Encoder|float|null $encoder, EnumClass|float|null $enum, EnumValues|float|null $enumValues, EqualityContract|float|null $equalityContract, Equatable|float|null $equatable, Event|float|null $event, Except|float|null $except, ExceptionClass|float|null $exception, Explicit|float|null $explicit, Export|float|null $export, Exposing|float|null $exposing, ExtendsClass|float|null $extends, Extension|float|null $extension, Extern|float|null $extern, Fallthrough|float|null $fallthrough, UnionFalseFalse|float|null $topLevelFalse, FalseClass|float|null $false, Fileprivate|float|null $fileprivate, FinalClass|float|null $final, FinallyClass|float|null $finally, Fixed|float|null $fixed, FloatClass|float|null $float, ForClass|float|null $for, ForeachClass|float|null $foreach, FormatException|float|null $formatException, Friend|float|null $friend, From|float|null $from, FromDict|float|null $fromDict, FromJSON|float|null $fromJSON, Func|float|null $func, FunctionClass|float|null $function, Get|float|null $get, GlobalClass|float|null $global, Go|float|null $go, GotoClass|float|null $goto, Guard|float|null $guard, Hashable|float|null $hashable, HashCode|float|null $hashCode, Hasher|float|null $hasher, HasOwnProperty|float|null $hasOwnProperty, ID|float|null $id, IfClass|float|null $if, Imp|float|null $imp, ImplementsClass|float|null $implements, Implicit|float|null $implicit, Import|float|null $import, In|float|null $in, Indirect|float|null $indirect, Infix|float|null $infix, Init|float|null $init, Inline|float|null $inline, Inout|float|null $inout, InstanceofClass|float|null $instanceof, IntClass|float|null $int, InterfaceClass|float|null $interface, Internal|float|null $internal, Is|float|null $is, ISODateTimeOffsetConverter|float|null $isoDateTimeOffsetConverter, IterableClass|float|null $iterable, Jdec|float|null $jdec, Jenc|float|null $jenc, Jpipe|float|null $jpipe, JSON|float|null $json, JSONConverter|float|null $jsonConverter, JSONSerializer|float|null $jsonSerializer, JSONToken|float|null $jsonToken, JSONWriter|float|null $jsonWriter, JSONAny|float|null $jsonAny, JSONCodingKey|float|null $jsonCodingKey, JSONDecoder|float|null $jsonDecoder, JSONEncoder|float|null $jsonEncoder, JSONExceptionClass|float|null $jsonException, JSONGenerator|float|null $jsonGenerator, JSONNode|float|null $jsonNode, JSONNull|float|null $jsonNull, JSONParser|float|null $jsonParser, JSONReader|float|null $jsonReader, JSONTokenType|float|null $jsonTokenType, KSerializer|float|null $kSerializer, Lambda|float|null $lambda, Lazy|float|null $lazy, Left|float|null $left, Let|float|null $let, ListClass|float|null $list, LocaleClass|float|null $locale, Lock|float|null $lock, Long|float|null $long, Map|float|null $map, MapEntry|float|null $mapEntry, MarshalJSON|float|null $marshalJSON, MetadataPropertyHandling|float|null $metadataPropertyHandling, Module|float|null $module, Mutable|float|null $mutable, Mutating|float|null $mutating, NamespaceClass|float|null $namespace, Native|float|null $native, NewClass|float|null $new, Newtonsoft|float|null $newtonsoft, Nil|float|null $nil, No|float|null $no, Noexcept|float|null $noexcept, Nonatomic|float|null $nonatomic, NoneClass|float|null $topLevelNone, None|float|null $none, Nonlocal|float|null $nonlocal, Nonmutating|float|null $nonmutating, NoSuchMethod|float|null $noSuchMethod, Not|float|null $not, NotEq|float|null $notEq, NSError|float|null $nsError, NSObject|float|null $nsObject, NSString|float|null $nsString, NULLClass|float|null $null, UnionNullNull|float|null $topLevelNull, Nullptr|float|null $nullptr, Number|float|null $number, ObjectClass|float|null $object, ObjectMapper|float|null $objectMapper, Of|float|null $of, Oneway|float|null $oneway, Open|float|null $open, Operator|float|null $operator, Optional|float|null $optional, OrClass|float|null $or, OrEq|float|null $orEq, Out|float|null $out, OverrideClass|float|null $override, Package|float|null $package, Params|float|null $params, Pass|float|null $pass, Port|float|null $port, Postfix|float|null $postfix, Precedence|float|null $precedence, Prefix|float|null $prefix, PrimitiveKind|float|null $primitiveKind, PrintClass|float|null $print, Printf|float|null $printf, PrintMembers|float|null $printMembers, PrivateClass|float|null $private, ProtectedClass|float|null $protected, Protocol|float|null $protocol, ProtocolClass|float|null $topLevelProtocol, PublicClass|float|null $public, Quicktype|float|null $quicktype, Raise|float|null $raise, Range|float|null $range, ReadonlyClass|float|null $readonly, Ref|float|null $ref, RegExp|float|null $regExp, Register|float|null $register, ReinterpretCast|float|null $reinterpretCast, Repeat|float|null $repeat, RequireClass|float|null $require, Required|float|null $required, Requires|float|null $requires, Restrict|float|null $restrict, Retain|float|null $retain, Rethrows|float|null $rethrows, ReturnClass|float|null $return, Right|float|null $right, RuntimeType|float|null $runtimeType, S|float|null $s, Sbyte|float|null $sbyte, Sealed|float|null $sealed, Sel|float|null $sel, Select|float|null $select, SelfClass|float|null $self, UnionSelfSelf|float|null $topLevelSelf, Sendable|float|null $sendable, SerialDescriptor|float|null $serialDescriptor, SerializableClass|float|null $serializable, Serialize|float|null $serialize, SerializerProvider|float|null $serializerProvider, SerialName|float|null $serialName, Set|float|null $set, Short|float|null $short, Signed|float|null $signed, SimpleModule|float|null $simpleModule, Sizeof|float|null $sizeof, Stackalloc|float|null $stackalloc, Standards|float|null $standards, StaticClass|float|null $static, StaticAssert|float|null $staticAssert, StaticCast|float|null $staticCast, StdDeserializer|float|null $stdDeserializer, StdSerializer|float|null $stdSerializer, Strictfp|float|null $strictfp, StringClass|float|null $string, Struct|float|null $struct, Subscript|float|null $subscript, Super|float|null $super, SwitchClass|float|null $switch, Symbol|float|null $symbol, Synchronized|float|null $synchronized, System|float|null $system, Template|float|null $template, Then|float|null $then, This|float|null $topLevelThis, ThreadLocal|float|null $threadLocal, ThrowClass|float|null $throw, Throws|float|null $throws, TimeOnly|float|null $timeOnly, TimeOnlyConverter|float|null $timeOnlyConverter, TimeZone|float|null $timeZone, ToDict|float|null $toDict, ToJSON|float|null $toJSON, TopLevelClass|float|null $topLevel, ToString|float|null $toString, Transient|float|null $transient, TrueClass|float|null $true, UnionTrueTrue|float|null $topLevelTrue, TryClass|float|null $try, Type|float|null $type, TypeClass|float|null $topLevelType, Typealias|float|null $typealias, Typedef|float|null $typedef, Typeid|float|null $typeid, Typename|float|null $typename, Typeof|float|null $typeof, Uint|float|null $uint, Ulong|float|null $ulong, Unchecked|float|null $unchecked, Undefined|float|null $undefined, UnionClass|float|null $union, UnmarshalJSON|float|null $unmarshalJSON, Unowned|float|null $unowned, Unsafe|float|null $unsafe, Unsigned|float|null $unsigned, UseSerializers|float|null $useSerializers, Ushort|float|null $ushort, Using|float|null $using, Utf8JSONReader|float|null $utf8JSONReader, Utf8JSONWriter|float|null $utf8JSONWriter, UUID|float|null $uuid, VarClass|float|null $var, Virtual|float|null $virtual, VoidClass|float|null $void, Volatile|float|null $volatile, WcharT|float|null $wcharT, Weak|float|null $weak, Where|float|null $where, WhileClass|float|null $while, WillSet|float|null $willSet, With|float|null $with, XorClass|float|null $xor, XorEq|float|null $xorEq, Yes|float|null $yes, YieldClass|float|null $yield) {
689697 $this->empty = $empty;
690698 $this->topLevelBool = $topLevelBool;
691699 $this->complex = $complex;
@@ -808,6 +816,7 @@ class TopLevel {
808816 $this->formatException = $formatException;
809817 $this->friend = $friend;
810818 $this->from = $from;
819+ $this->fromDict = $fromDict;
811820 $this->fromJSON = $fromJSON;
812821 $this->func = $func;
813822 $this->function = $function;
@@ -869,6 +878,7 @@ class TopLevel {
869878 $this->long = $long;
870879 $this->map = $map;
871880 $this->mapEntry = $mapEntry;
881+ $this->marshalJSON = $marshalJSON;
872882 $this->metadataPropertyHandling = $metadataPropertyHandling;
873883 $this->module = $module;
874884 $this->mutable = $mutable;
@@ -983,6 +993,7 @@ class TopLevel {
983993 $this->timeOnly = $timeOnly;
984994 $this->timeOnlyConverter = $timeOnlyConverter;
985995 $this->timeZone = $timeZone;
996+ $this->toDict = $toDict;
986997 $this->toJSON = $toJSON;
987998 $this->topLevel = $topLevel;
988999 $this->toString = $toString;
@@ -1002,6 +1013,7 @@ class TopLevel {
10021013 $this->unchecked = $unchecked;
10031014 $this->undefined = $undefined;
10041015 $this->union = $union;
1016+ $this->unmarshalJSON = $unmarshalJSON;
10051017 $this->unowned = $unowned;
10061018 $this->unsafe = $unsafe;
10071019 $this->unsigned = $unsigned;
@@ -7416,7 +7428,7 @@ class TopLevel {
74167428 * @throws Exception
74177429 * @return Dict|float|null
74187430 */
7419- public static function fromDict(stdClass|float|null $value): Dict|float|null {
7431+ public static function purpleFromDict(stdClass|float|null $value): Dict|float|null {
74207432 if (is_null($value)) {
74217433 return $value; /*null*/
74227434 } elseif (is_object($value)) {
@@ -7432,7 +7444,7 @@ class TopLevel {
74327444 * @throws Exception
74337445 * @return stdClass|float|null
74347446 */
7435- public function toDict(): stdClass|float|null {
7447+ public function purpleToDict(): stdClass|float|null {
74367448 if (TopLevel::validateDict($this->dict)) {
74377449 if (is_null($this->dict)) {
74387450 return $this->dict; /*null*/
@@ -10280,6 +10292,82 @@ class TopLevel {
1028010292 return From::sample(); /*152:from*/
1028110293 }
1028210294
10295+ /**
10296+ * @param stdClass|float|null $value
10297+ * @throws Exception
10298+ * @return FromDict|float|null
10299+ */
10300+ public static function fromFromDict(stdClass|float|null $value): FromDict|float|null {
10301+ if (is_null($value)) {
10302+ return $value; /*null*/
10303+ } elseif (is_object($value)) {
10304+ return FromDict::from($value); /*class*/
10305+ } elseif (is_float($value) || is_int($value)) {
10306+ return $value; /*float*/
10307+ } else {
10308+ throw new Exception('Cannot deserialize union value in TopLevel');
10309+ }
10310+ }
10311+
10312+ /**
10313+ * @throws Exception
10314+ * @return stdClass|float|null
10315+ */
10316+ public function toFromDict(): stdClass|float|null {
10317+ if (TopLevel::validateFromDict($this->fromDict)) {
10318+ if (is_null($this->fromDict)) {
10319+ return $this->fromDict; /*null*/
10320+ } elseif ($this->fromDict instanceof FromDict) {
10321+ return $this->fromDict->to(); /*class*/
10322+ } elseif (is_float($this->fromDict) || is_int($this->fromDict)) {
10323+ return $this->fromDict; /*float*/
10324+ } else {
10325+ throw new Exception('Union value has no matching member in TopLevel');
10326+ }
10327+ }
10328+ throw new Exception('never get to this TopLevel::fromDict');
10329+ }
10330+
10331+ /**
10332+ * @param FromDict|float|null
10333+ * @return bool
10334+ * @throws Exception
10335+ */
10336+ public static function validateFromDict(FromDict|float|null $value): bool {
10337+ if (is_null($value)) {
10338+ if (!is_null($value)) {
10339+ throw new Exception("Attribute Error:TopLevel::fromDict");
10340+ }
10341+ } elseif ($value instanceof FromDict) {
10342+ $value->validate();
10343+ } elseif (is_float($value) || is_int($value)) {
10344+ if (!is_float($value) && !is_int($value)) {
10345+ throw new Exception("Attribute Error:TopLevel::fromDict");
10346+ }
10347+ } else {
10348+ throw new Exception("Attribute Error:TopLevel::fromDict");
10349+ }
10350+ return true;
10351+ }
10352+
10353+ /**
10354+ * @throws Exception
10355+ * @return FromDict|float|null
10356+ */
10357+ public function getFromDict(): FromDict|float|null {
10358+ if (TopLevel::validateFromDict($this->fromDict)) {
10359+ return $this->fromDict;
10360+ }
10361+ throw new Exception('never get to getFromDict TopLevel::fromDict');
10362+ }
10363+
10364+ /**
10365+ * @return FromDict|float|null
10366+ */
10367+ public static function sampleFromDict(): FromDict|float|null {
10368+ return FromDict::sample(); /*153:fromDict*/
10369+ }
10370+
1028310371 /**
1028410372 * @param stdClass|float|null $value
1028510373 * @throws Exception
@@ -10353,7 +10441,7 @@ class TopLevel {
1035310441 * @return FromJSON|float|null
1035410442 */
1035510443 public static function sampleFromJSON(): FromJSON|float|null {
10356- return FromJSON::sample(); /*153:fromJSON*/
10444+ return FromJSON::sample(); /*154:fromJSON*/
1035710445 }
1035810446
1035910447 /**
@@ -10429,7 +10517,7 @@ class TopLevel {
1042910517 * @return Func|float|null
1043010518 */
1043110519 public static function sampleFunc(): Func|float|null {
10432- return Func::sample(); /*154:func*/
10520+ return Func::sample(); /*155:func*/
1043310521 }
1043410522
1043510523 /**
@@ -10505,7 +10593,7 @@ class TopLevel {
1050510593 * @return FunctionClass|float|null
1050610594 */
1050710595 public static function sampleFunction(): FunctionClass|float|null {
10508- return FunctionClass::sample(); /*155:function*/
10596+ return FunctionClass::sample(); /*156:function*/
1050910597 }
1051010598
1051110599 /**
@@ -10581,7 +10669,7 @@ class TopLevel {
1058110669 * @return Get|float|null
1058210670 */
1058310671 public static function sampleGet(): Get|float|null {
10584- return Get::sample(); /*156:get*/
10672+ return Get::sample(); /*157:get*/
1058510673 }
1058610674
1058710675 /**
@@ -10657,7 +10745,7 @@ class TopLevel {
1065710745 * @return GlobalClass|float|null
1065810746 */
1065910747 public static function sampleGlobal(): GlobalClass|float|null {
10660- return GlobalClass::sample(); /*157:global*/
10748+ return GlobalClass::sample(); /*158:global*/
1066110749 }
1066210750
1066310751 /**
@@ -10733,7 +10821,7 @@ class TopLevel {
1073310821 * @return Go|float|null
1073410822 */
1073510823 public static function sampleGo(): Go|float|null {
10736- return Go::sample(); /*158:go*/
10824+ return Go::sample(); /*159:go*/
1073710825 }
1073810826
1073910827 /**
@@ -10809,7 +10897,7 @@ class TopLevel {
1080910897 * @return GotoClass|float|null
1081010898 */
1081110899 public static function sampleGoto(): GotoClass|float|null {
10812- return GotoClass::sample(); /*159:goto*/
10900+ return GotoClass::sample(); /*160:goto*/
1081310901 }
1081410902
1081510903 /**
@@ -10885,7 +10973,7 @@ class TopLevel {
1088510973 * @return Guard|float|null
1088610974 */
1088710975 public static function sampleGuard(): Guard|float|null {
10888- return Guard::sample(); /*160:guard*/
10976+ return Guard::sample(); /*161:guard*/
1088910977 }
1089010978
1089110979 /**
@@ -10961,7 +11049,7 @@ class TopLevel {
1096111049 * @return Hashable|float|null
1096211050 */
1096311051 public static function sampleHashable(): Hashable|float|null {
10964- return Hashable::sample(); /*161:hashable*/
11052+ return Hashable::sample(); /*162:hashable*/
1096511053 }
1096611054
1096711055 /**
@@ -11037,7 +11125,7 @@ class TopLevel {
1103711125 * @return HashCode|float|null
1103811126 */
1103911127 public static function sampleHashCode(): HashCode|float|null {
11040- return HashCode::sample(); /*162:hashCode*/
11128+ return HashCode::sample(); /*163:hashCode*/
1104111129 }
1104211130
1104311131 /**
@@ -11113,7 +11201,7 @@ class TopLevel {
1111311201 * @return Hasher|float|null
1111411202 */
1111511203 public static function sampleHasher(): Hasher|float|null {
11116- return Hasher::sample(); /*163:hasher*/
11204+ return Hasher::sample(); /*164:hasher*/
1111711205 }
1111811206
1111911207 /**
@@ -11189,7 +11277,7 @@ class TopLevel {
1118911277 * @return HasOwnProperty|float|null
1119011278 */
1119111279 public static function sampleHasOwnProperty(): HasOwnProperty|float|null {
11192- return HasOwnProperty::sample(); /*164:hasOwnProperty*/
11280+ return HasOwnProperty::sample(); /*165:hasOwnProperty*/
1119311281 }
1119411282
1119511283 /**
@@ -11265,7 +11353,7 @@ class TopLevel {
1126511353 * @return ID|float|null
1126611354 */
1126711355 public static function sampleID(): ID|float|null {
11268- return ID::sample(); /*165:id*/
11356+ return ID::sample(); /*166:id*/
1126911357 }
1127011358
1127111359 /**
@@ -11341,7 +11429,7 @@ class TopLevel {
1134111429 * @return IfClass|float|null
1134211430 */
1134311431 public static function sampleIf(): IfClass|float|null {
11344- return IfClass::sample(); /*166:if*/
11432+ return IfClass::sample(); /*167:if*/
1134511433 }
1134611434
1134711435 /**
@@ -11417,7 +11505,7 @@ class TopLevel {
1141711505 * @return Imp|float|null
1141811506 */
1141911507 public static function sampleImp(): Imp|float|null {
11420- return Imp::sample(); /*167:imp*/
11508+ return Imp::sample(); /*168:imp*/
1142111509 }
1142211510
1142311511 /**
@@ -11493,7 +11581,7 @@ class TopLevel {
1149311581 * @return ImplementsClass|float|null
1149411582 */
1149511583 public static function sampleImplements(): ImplementsClass|float|null {
11496- return ImplementsClass::sample(); /*168:implements*/
11584+ return ImplementsClass::sample(); /*169:implements*/
1149711585 }
1149811586
1149911587 /**
@@ -11569,7 +11657,7 @@ class TopLevel {
1156911657 * @return Implicit|float|null
1157011658 */
1157111659 public static function sampleImplicit(): Implicit|float|null {
11572- return Implicit::sample(); /*169:implicit*/
11660+ return Implicit::sample(); /*170:implicit*/
1157311661 }
1157411662
1157511663 /**
@@ -11645,7 +11733,7 @@ class TopLevel {
1164511733 * @return Import|float|null
1164611734 */
1164711735 public static function sampleImport(): Import|float|null {
11648- return Import::sample(); /*170:import*/
11736+ return Import::sample(); /*171:import*/
1164911737 }
1165011738
1165111739 /**
@@ -11721,7 +11809,7 @@ class TopLevel {
1172111809 * @return In|float|null
1172211810 */
1172311811 public static function sampleIn(): In|float|null {
11724- return In::sample(); /*171:in*/
11812+ return In::sample(); /*172:in*/
1172511813 }
1172611814
1172711815 /**
@@ -11797,7 +11885,7 @@ class TopLevel {
1179711885 * @return Indirect|float|null
1179811886 */
1179911887 public static function sampleIndirect(): Indirect|float|null {
11800- return Indirect::sample(); /*172:indirect*/
11888+ return Indirect::sample(); /*173:indirect*/
1180111889 }
1180211890
1180311891 /**
@@ -11873,7 +11961,7 @@ class TopLevel {
1187311961 * @return Infix|float|null
1187411962 */
1187511963 public static function sampleInfix(): Infix|float|null {
11876- return Infix::sample(); /*173:infix*/
11964+ return Infix::sample(); /*174:infix*/
1187711965 }
1187811966
1187911967 /**
@@ -11949,7 +12037,7 @@ class TopLevel {
1194912037 * @return Init|float|null
1195012038 */
1195112039 public static function sampleInit(): Init|float|null {
11952- return Init::sample(); /*174:init*/
12040+ return Init::sample(); /*175:init*/
1195312041 }
1195412042
1195512043 /**
@@ -12025,7 +12113,7 @@ class TopLevel {
1202512113 * @return Inline|float|null
1202612114 */
1202712115 public static function sampleInline(): Inline|float|null {
12028- return Inline::sample(); /*175:inline*/
12116+ return Inline::sample(); /*176:inline*/
1202912117 }
1203012118
1203112119 /**
@@ -12101,7 +12189,7 @@ class TopLevel {
1210112189 * @return Inout|float|null
1210212190 */
1210312191 public static function sampleInout(): Inout|float|null {
12104- return Inout::sample(); /*176:inout*/
12192+ return Inout::sample(); /*177:inout*/
1210512193 }
1210612194
1210712195 /**
@@ -12177,7 +12265,7 @@ class TopLevel {
1217712265 * @return InstanceofClass|float|null
1217812266 */
1217912267 public static function sampleInstanceof(): InstanceofClass|float|null {
12180- return InstanceofClass::sample(); /*177:instanceof*/
12268+ return InstanceofClass::sample(); /*178:instanceof*/
1218112269 }
1218212270
1218312271 /**
@@ -12253,7 +12341,7 @@ class TopLevel {
1225312341 * @return IntClass|float|null
1225412342 */
1225512343 public static function sampleInt(): IntClass|float|null {
12256- return IntClass::sample(); /*178:int*/
12344+ return IntClass::sample(); /*179:int*/
1225712345 }
1225812346
1225912347 /**
@@ -12329,7 +12417,7 @@ class TopLevel {
1232912417 * @return InterfaceClass|float|null
1233012418 */
1233112419 public static function sampleInterface(): InterfaceClass|float|null {
12332- return InterfaceClass::sample(); /*179:interface*/
12420+ return InterfaceClass::sample(); /*180:interface*/
1233312421 }
1233412422
1233512423 /**
@@ -12405,7 +12493,7 @@ class TopLevel {
1240512493 * @return Internal|float|null
1240612494 */
1240712495 public static function sampleInternal(): Internal|float|null {
12408- return Internal::sample(); /*180:internal*/
12496+ return Internal::sample(); /*181:internal*/
1240912497 }
1241012498
1241112499 /**
@@ -12481,7 +12569,7 @@ class TopLevel {
1248112569 * @return Is|float|null
1248212570 */
1248312571 public static function sampleIs(): Is|float|null {
12484- return Is::sample(); /*181:is*/
12572+ return Is::sample(); /*182:is*/
1248512573 }
1248612574
1248712575 /**
@@ -12557,7 +12645,7 @@ class TopLevel {
1255712645 * @return ISODateTimeOffsetConverter|float|null
1255812646 */
1255912647 public static function sampleISODateTimeOffsetConverter(): ISODateTimeOffsetConverter|float|null {
12560- return ISODateTimeOffsetConverter::sample(); /*182:isoDateTimeOffsetConverter*/
12648+ return ISODateTimeOffsetConverter::sample(); /*183:isoDateTimeOffsetConverter*/
1256112649 }
1256212650
1256312651 /**
@@ -12633,7 +12721,7 @@ class TopLevel {
1263312721 * @return IterableClass|float|null
1263412722 */
1263512723 public static function sampleIterable(): IterableClass|float|null {
12636- return IterableClass::sample(); /*183:iterable*/
12724+ return IterableClass::sample(); /*184:iterable*/
1263712725 }
1263812726
1263912727 /**
@@ -12709,7 +12797,7 @@ class TopLevel {
1270912797 * @return Jdec|float|null
1271012798 */
1271112799 public static function sampleJdec(): Jdec|float|null {
12712- return Jdec::sample(); /*184:jdec*/
12800+ return Jdec::sample(); /*185:jdec*/
1271312801 }
1271412802
1271512803 /**
@@ -12785,7 +12873,7 @@ class TopLevel {
1278512873 * @return Jenc|float|null
1278612874 */
1278712875 public static function sampleJenc(): Jenc|float|null {
12788- return Jenc::sample(); /*185:jenc*/
12876+ return Jenc::sample(); /*186:jenc*/
1278912877 }
1279012878
1279112879 /**
@@ -12861,7 +12949,7 @@ class TopLevel {
1286112949 * @return Jpipe|float|null
1286212950 */
1286312951 public static function sampleJpipe(): Jpipe|float|null {
12864- return Jpipe::sample(); /*186:jpipe*/
12952+ return Jpipe::sample(); /*187:jpipe*/
1286512953 }
1286612954
1286712955 /**
@@ -12937,7 +13025,7 @@ class TopLevel {
1293713025 * @return JSON|float|null
1293813026 */
1293913027 public static function sampleJSON(): JSON|float|null {
12940- return JSON::sample(); /*187:json*/
13028+ return JSON::sample(); /*188:json*/
1294113029 }
1294213030
1294313031 /**
@@ -13013,7 +13101,7 @@ class TopLevel {
1301313101 * @return JSONConverter|float|null
1301413102 */
1301513103 public static function sampleJSONConverter(): JSONConverter|float|null {
13016- return JSONConverter::sample(); /*188:jsonConverter*/
13104+ return JSONConverter::sample(); /*189:jsonConverter*/
1301713105 }
1301813106
1301913107 /**
@@ -13089,7 +13177,7 @@ class TopLevel {
1308913177 * @return JSONSerializer|float|null
1309013178 */
1309113179 public static function sampleJSONSerializer(): JSONSerializer|float|null {
13092- return JSONSerializer::sample(); /*189:jsonSerializer*/
13180+ return JSONSerializer::sample(); /*190:jsonSerializer*/
1309313181 }
1309413182
1309513183 /**
@@ -13165,7 +13253,7 @@ class TopLevel {
1316513253 * @return JSONToken|float|null
1316613254 */
1316713255 public static function sampleJSONToken(): JSONToken|float|null {
13168- return JSONToken::sample(); /*190:jsonToken*/
13256+ return JSONToken::sample(); /*191:jsonToken*/
1316913257 }
1317013258
1317113259 /**
@@ -13241,7 +13329,7 @@ class TopLevel {
1324113329 * @return JSONWriter|float|null
1324213330 */
1324313331 public static function sampleJSONWriter(): JSONWriter|float|null {
13244- return JSONWriter::sample(); /*191:jsonWriter*/
13332+ return JSONWriter::sample(); /*192:jsonWriter*/
1324513333 }
1324613334
1324713335 /**
@@ -13317,7 +13405,7 @@ class TopLevel {
1331713405 * @return JSONAny|float|null
1331813406 */
1331913407 public static function sampleJSONAny(): JSONAny|float|null {
13320- return JSONAny::sample(); /*192:jsonAny*/
13408+ return JSONAny::sample(); /*193:jsonAny*/
1332113409 }
1332213410
1332313411 /**
@@ -13393,7 +13481,7 @@ class TopLevel {
1339313481 * @return JSONCodingKey|float|null
1339413482 */
1339513483 public static function sampleJSONCodingKey(): JSONCodingKey|float|null {
13396- return JSONCodingKey::sample(); /*193:jsonCodingKey*/
13484+ return JSONCodingKey::sample(); /*194:jsonCodingKey*/
1339713485 }
1339813486
1339913487 /**
@@ -13469,7 +13557,7 @@ class TopLevel {
1346913557 * @return JSONDecoder|float|null
1347013558 */
1347113559 public static function sampleJSONDecoder(): JSONDecoder|float|null {
13472- return JSONDecoder::sample(); /*194:jsonDecoder*/
13560+ return JSONDecoder::sample(); /*195:jsonDecoder*/
1347313561 }
1347413562
1347513563 /**
@@ -13545,7 +13633,7 @@ class TopLevel {
1354513633 * @return JSONEncoder|float|null
1354613634 */
1354713635 public static function sampleJSONEncoder(): JSONEncoder|float|null {
13548- return JSONEncoder::sample(); /*195:jsonEncoder*/
13636+ return JSONEncoder::sample(); /*196:jsonEncoder*/
1354913637 }
1355013638
1355113639 /**
@@ -13621,7 +13709,7 @@ class TopLevel {
1362113709 * @return JSONExceptionClass|float|null
1362213710 */
1362313711 public static function sampleJSONException(): JSONExceptionClass|float|null {
13624- return JSONExceptionClass::sample(); /*196:jsonException*/
13712+ return JSONExceptionClass::sample(); /*197:jsonException*/
1362513713 }
1362613714
1362713715 /**
@@ -13697,7 +13785,7 @@ class TopLevel {
1369713785 * @return JSONGenerator|float|null
1369813786 */
1369913787 public static function sampleJSONGenerator(): JSONGenerator|float|null {
13700- return JSONGenerator::sample(); /*197:jsonGenerator*/
13788+ return JSONGenerator::sample(); /*198:jsonGenerator*/
1370113789 }
1370213790
1370313791 /**
@@ -13773,7 +13861,7 @@ class TopLevel {
1377313861 * @return JSONNode|float|null
1377413862 */
1377513863 public static function sampleJSONNode(): JSONNode|float|null {
13776- return JSONNode::sample(); /*198:jsonNode*/
13864+ return JSONNode::sample(); /*199:jsonNode*/
1377713865 }
1377813866
1377913867 /**
@@ -13849,7 +13937,7 @@ class TopLevel {
1384913937 * @return JSONNull|float|null
1385013938 */
1385113939 public static function sampleJSONNull(): JSONNull|float|null {
13852- return JSONNull::sample(); /*199:jsonNull*/
13940+ return JSONNull::sample(); /*200:jsonNull*/
1385313941 }
1385413942
1385513943 /**
@@ -13925,7 +14013,7 @@ class TopLevel {
1392514013 * @return JSONParser|float|null
1392614014 */
1392714015 public static function sampleJSONParser(): JSONParser|float|null {
13928- return JSONParser::sample(); /*200:jsonParser*/
14016+ return JSONParser::sample(); /*201:jsonParser*/
1392914017 }
1393014018
1393114019 /**
@@ -14001,7 +14089,7 @@ class TopLevel {
1400114089 * @return JSONReader|float|null
1400214090 */
1400314091 public static function sampleJSONReader(): JSONReader|float|null {
14004- return JSONReader::sample(); /*201:jsonReader*/
14092+ return JSONReader::sample(); /*202:jsonReader*/
1400514093 }
1400614094
1400714095 /**
@@ -14077,7 +14165,7 @@ class TopLevel {
1407714165 * @return JSONTokenType|float|null
1407814166 */
1407914167 public static function sampleJSONTokenType(): JSONTokenType|float|null {
14080- return JSONTokenType::sample(); /*202:jsonTokenType*/
14168+ return JSONTokenType::sample(); /*203:jsonTokenType*/
1408114169 }
1408214170
1408314171 /**
@@ -14153,7 +14241,7 @@ class TopLevel {
1415314241 * @return KSerializer|float|null
1415414242 */
1415514243 public static function sampleKSerializer(): KSerializer|float|null {
14156- return KSerializer::sample(); /*203:kSerializer*/
14244+ return KSerializer::sample(); /*204:kSerializer*/
1415714245 }
1415814246
1415914247 /**
@@ -14229,7 +14317,7 @@ class TopLevel {
1422914317 * @return Lambda|float|null
1423014318 */
1423114319 public static function sampleLambda(): Lambda|float|null {
14232- return Lambda::sample(); /*204:lambda*/
14320+ return Lambda::sample(); /*205:lambda*/
1423314321 }
1423414322
1423514323 /**
@@ -14305,7 +14393,7 @@ class TopLevel {
1430514393 * @return Lazy|float|null
1430614394 */
1430714395 public static function sampleLazy(): Lazy|float|null {
14308- return Lazy::sample(); /*205:lazy*/
14396+ return Lazy::sample(); /*206:lazy*/
1430914397 }
1431014398
1431114399 /**
@@ -14381,7 +14469,7 @@ class TopLevel {
1438114469 * @return Left|float|null
1438214470 */
1438314471 public static function sampleLeft(): Left|float|null {
14384- return Left::sample(); /*206:left*/
14472+ return Left::sample(); /*207:left*/
1438514473 }
1438614474
1438714475 /**
@@ -14457,7 +14545,7 @@ class TopLevel {
1445714545 * @return Let|float|null
1445814546 */
1445914547 public static function sampleLet(): Let|float|null {
14460- return Let::sample(); /*207:let*/
14548+ return Let::sample(); /*208:let*/
1446114549 }
1446214550
1446314551 /**
@@ -14533,7 +14621,7 @@ class TopLevel {
1453314621 * @return ListClass|float|null
1453414622 */
1453514623 public static function sampleList(): ListClass|float|null {
14536- return ListClass::sample(); /*208:list*/
14624+ return ListClass::sample(); /*209:list*/
1453714625 }
1453814626
1453914627 /**
@@ -14609,7 +14697,7 @@ class TopLevel {
1460914697 * @return LocaleClass|float|null
1461014698 */
1461114699 public static function sampleLocale(): LocaleClass|float|null {
14612- return LocaleClass::sample(); /*209:locale*/
14700+ return LocaleClass::sample(); /*210:locale*/
1461314701 }
1461414702
1461514703 /**
@@ -14685,7 +14773,7 @@ class TopLevel {
1468514773 * @return Lock|float|null
1468614774 */
1468714775 public static function sampleLock(): Lock|float|null {
14688- return Lock::sample(); /*210:lock*/
14776+ return Lock::sample(); /*211:lock*/
1468914777 }
1469014778
1469114779 /**
@@ -14761,7 +14849,7 @@ class TopLevel {
1476114849 * @return Long|float|null
1476214850 */
1476314851 public static function sampleLong(): Long|float|null {
14764- return Long::sample(); /*211:long*/
14852+ return Long::sample(); /*212:long*/
1476514853 }
1476614854
1476714855 /**
@@ -14837,7 +14925,7 @@ class TopLevel {
1483714925 * @return Map|float|null
1483814926 */
1483914927 public static function sampleMap(): Map|float|null {
14840- return Map::sample(); /*212:map*/
14928+ return Map::sample(); /*213:map*/
1484114929 }
1484214930
1484314931 /**
@@ -14913,7 +15001,83 @@ class TopLevel {
1491315001 * @return MapEntry|float|null
1491415002 */
1491515003 public static function sampleMapEntry(): MapEntry|float|null {
14916- return MapEntry::sample(); /*213:mapEntry*/
15004+ return MapEntry::sample(); /*214:mapEntry*/
15005+ }
15006+
15007+ /**
15008+ * @param stdClass|float|null $value
15009+ * @throws Exception
15010+ * @return MarshalJSON|float|null
15011+ */
15012+ public static function fromMarshalJSON(stdClass|float|null $value): MarshalJSON|float|null {
15013+ if (is_null($value)) {
15014+ return $value; /*null*/
15015+ } elseif (is_object($value)) {
15016+ return MarshalJSON::from($value); /*class*/
15017+ } elseif (is_float($value) || is_int($value)) {
15018+ return $value; /*float*/
15019+ } else {
15020+ throw new Exception('Cannot deserialize union value in TopLevel');
15021+ }
15022+ }
15023+
15024+ /**
15025+ * @throws Exception
15026+ * @return stdClass|float|null
15027+ */
15028+ public function toMarshalJSON(): stdClass|float|null {
15029+ if (TopLevel::validateMarshalJSON($this->marshalJSON)) {
15030+ if (is_null($this->marshalJSON)) {
15031+ return $this->marshalJSON; /*null*/
15032+ } elseif ($this->marshalJSON instanceof MarshalJSON) {
15033+ return $this->marshalJSON->to(); /*class*/
15034+ } elseif (is_float($this->marshalJSON) || is_int($this->marshalJSON)) {
15035+ return $this->marshalJSON; /*float*/
15036+ } else {
15037+ throw new Exception('Union value has no matching member in TopLevel');
15038+ }
15039+ }
15040+ throw new Exception('never get to this TopLevel::marshalJSON');
15041+ }
15042+
15043+ /**
15044+ * @param MarshalJSON|float|null
15045+ * @return bool
15046+ * @throws Exception
15047+ */
15048+ public static function validateMarshalJSON(MarshalJSON|float|null $value): bool {
15049+ if (is_null($value)) {
15050+ if (!is_null($value)) {
15051+ throw new Exception("Attribute Error:TopLevel::marshalJSON");
15052+ }
15053+ } elseif ($value instanceof MarshalJSON) {
15054+ $value->validate();
15055+ } elseif (is_float($value) || is_int($value)) {
15056+ if (!is_float($value) && !is_int($value)) {
15057+ throw new Exception("Attribute Error:TopLevel::marshalJSON");
15058+ }
15059+ } else {
15060+ throw new Exception("Attribute Error:TopLevel::marshalJSON");
15061+ }
15062+ return true;
15063+ }
15064+
15065+ /**
15066+ * @throws Exception
15067+ * @return MarshalJSON|float|null
15068+ */
15069+ public function getMarshalJSON(): MarshalJSON|float|null {
15070+ if (TopLevel::validateMarshalJSON($this->marshalJSON)) {
15071+ return $this->marshalJSON;
15072+ }
15073+ throw new Exception('never get to getMarshalJSON TopLevel::marshalJSON');
15074+ }
15075+
15076+ /**
15077+ * @return MarshalJSON|float|null
15078+ */
15079+ public static function sampleMarshalJSON(): MarshalJSON|float|null {
15080+ return MarshalJSON::sample(); /*215:marshalJSON*/
1491715081 }
1491815082
1491915083 /**
@@ -14989,7 +15153,7 @@ class TopLevel {
1498915153 * @return MetadataPropertyHandling|float|null
1499015154 */
1499115155 public static function sampleMetadataPropertyHandling(): MetadataPropertyHandling|float|null {
14992- return MetadataPropertyHandling::sample(); /*214:metadataPropertyHandling*/
15156+ return MetadataPropertyHandling::sample(); /*216:metadataPropertyHandling*/
1499315157 }
1499415158
1499515159 /**
@@ -15065,7 +15229,7 @@ class TopLevel {
1506515229 * @return Module|float|null
1506615230 */
1506715231 public static function sampleModule(): Module|float|null {
15068- return Module::sample(); /*215:module*/
15232+ return Module::sample(); /*217:module*/
1506915233 }
1507015234
1507115235 /**
@@ -15141,7 +15305,7 @@ class TopLevel {
1514115305 * @return Mutable|float|null
1514215306 */
1514315307 public static function sampleMutable(): Mutable|float|null {
15144- return Mutable::sample(); /*216:mutable*/
15308+ return Mutable::sample(); /*218:mutable*/
1514515309 }
1514615310
1514715311 /**
@@ -15217,7 +15381,7 @@ class TopLevel {
1521715381 * @return Mutating|float|null
1521815382 */
1521915383 public static function sampleMutating(): Mutating|float|null {
15220- return Mutating::sample(); /*217:mutating*/
15384+ return Mutating::sample(); /*219:mutating*/
1522115385 }
1522215386
1522315387 /**
@@ -15293,7 +15457,7 @@ class TopLevel {
1529315457 * @return NamespaceClass|float|null
1529415458 */
1529515459 public static function sampleNamespace(): NamespaceClass|float|null {
15296- return NamespaceClass::sample(); /*218:namespace*/
15460+ return NamespaceClass::sample(); /*220:namespace*/
1529715461 }
1529815462
1529915463 /**
@@ -15369,7 +15533,7 @@ class TopLevel {
1536915533 * @return Native|float|null
1537015534 */
1537115535 public static function sampleNative(): Native|float|null {
15372- return Native::sample(); /*219:native*/
15536+ return Native::sample(); /*221:native*/
1537315537 }
1537415538
1537515539 /**
@@ -15445,7 +15609,7 @@ class TopLevel {
1544515609 * @return NewClass|float|null
1544615610 */
1544715611 public static function sampleNew(): NewClass|float|null {
15448- return NewClass::sample(); /*220:new*/
15612+ return NewClass::sample(); /*222:new*/
1544915613 }
1545015614
1545115615 /**
@@ -15521,7 +15685,7 @@ class TopLevel {
1552115685 * @return Newtonsoft|float|null
1552215686 */
1552315687 public static function sampleNewtonsoft(): Newtonsoft|float|null {
15524- return Newtonsoft::sample(); /*221:newtonsoft*/
15688+ return Newtonsoft::sample(); /*223:newtonsoft*/
1552515689 }
1552615690
1552715691 /**
@@ -15597,7 +15761,7 @@ class TopLevel {
1559715761 * @return Nil|float|null
1559815762 */
1559915763 public static function sampleNil(): Nil|float|null {
15600- return Nil::sample(); /*222:nil*/
15764+ return Nil::sample(); /*224:nil*/
1560115765 }
1560215766
1560315767 /**
@@ -15673,7 +15837,7 @@ class TopLevel {
1567315837 * @return No|float|null
1567415838 */
1567515839 public static function sampleNo(): No|float|null {
15676- return No::sample(); /*223:no*/
15840+ return No::sample(); /*225:no*/
1567715841 }
1567815842
1567915843 /**
@@ -15749,7 +15913,7 @@ class TopLevel {
1574915913 * @return Noexcept|float|null
1575015914 */
1575115915 public static function sampleNoexcept(): Noexcept|float|null {
15752- return Noexcept::sample(); /*224:noexcept*/
15916+ return Noexcept::sample(); /*226:noexcept*/
1575315917 }
1575415918
1575515919 /**
@@ -15825,7 +15989,7 @@ class TopLevel {
1582515989 * @return Nonatomic|float|null
1582615990 */
1582715991 public static function sampleNonatomic(): Nonatomic|float|null {
15828- return Nonatomic::sample(); /*225:nonatomic*/
15992+ return Nonatomic::sample(); /*227:nonatomic*/
1582915993 }
1583015994
1583115995 /**
@@ -15901,7 +16065,7 @@ class TopLevel {
1590116065 * @return NoneClass|float|null
1590216066 */
1590316067 public static function sampleTopLevelNone(): NoneClass|float|null {
15904- return NoneClass::sample(); /*226:topLevelNone*/
16068+ return NoneClass::sample(); /*228:topLevelNone*/
1590516069 }
1590616070
1590716071 /**
@@ -15977,7 +16141,7 @@ class TopLevel {
1597716141 * @return None|float|null
1597816142 */
1597916143 public static function sampleNone(): None|float|null {
15980- return None::sample(); /*227:none*/
16144+ return None::sample(); /*229:none*/
1598116145 }
1598216146
1598316147 /**
@@ -16053,7 +16217,7 @@ class TopLevel {
1605316217 * @return Nonlocal|float|null
1605416218 */
1605516219 public static function sampleNonlocal(): Nonlocal|float|null {
16056- return Nonlocal::sample(); /*228:nonlocal*/
16220+ return Nonlocal::sample(); /*230:nonlocal*/
1605716221 }
1605816222
1605916223 /**
@@ -16129,7 +16293,7 @@ class TopLevel {
1612916293 * @return Nonmutating|float|null
1613016294 */
1613116295 public static function sampleNonmutating(): Nonmutating|float|null {
16132- return Nonmutating::sample(); /*229:nonmutating*/
16296+ return Nonmutating::sample(); /*231:nonmutating*/
1613316297 }
1613416298
1613516299 /**
@@ -16205,7 +16369,7 @@ class TopLevel {
1620516369 * @return NoSuchMethod|float|null
1620616370 */
1620716371 public static function sampleNoSuchMethod(): NoSuchMethod|float|null {
16208- return NoSuchMethod::sample(); /*230:noSuchMethod*/
16372+ return NoSuchMethod::sample(); /*232:noSuchMethod*/
1620916373 }
1621016374
1621116375 /**
@@ -16281,7 +16445,7 @@ class TopLevel {
1628116445 * @return Not|float|null
1628216446 */
1628316447 public static function sampleNot(): Not|float|null {
16284- return Not::sample(); /*231:not*/
16448+ return Not::sample(); /*233:not*/
1628516449 }
1628616450
1628716451 /**
@@ -16357,7 +16521,7 @@ class TopLevel {
1635716521 * @return NotEq|float|null
1635816522 */
1635916523 public static function sampleNotEq(): NotEq|float|null {
16360- return NotEq::sample(); /*232:notEq*/
16524+ return NotEq::sample(); /*234:notEq*/
1636116525 }
1636216526
1636316527 /**
@@ -16433,7 +16597,7 @@ class TopLevel {
1643316597 * @return NSError|float|null
1643416598 */
1643516599 public static function sampleNSError(): NSError|float|null {
16436- return NSError::sample(); /*233:nsError*/
16600+ return NSError::sample(); /*235:nsError*/
1643716601 }
1643816602
1643916603 /**
@@ -16509,7 +16673,7 @@ class TopLevel {
1650916673 * @return NSObject|float|null
1651016674 */
1651116675 public static function sampleNSObject(): NSObject|float|null {
16512- return NSObject::sample(); /*234:nsObject*/
16676+ return NSObject::sample(); /*236:nsObject*/
1651316677 }
1651416678
1651516679 /**
@@ -16585,7 +16749,7 @@ class TopLevel {
1658516749 * @return NSString|float|null
1658616750 */
1658716751 public static function sampleNSString(): NSString|float|null {
16588- return NSString::sample(); /*235:nsString*/
16752+ return NSString::sample(); /*237:nsString*/
1658916753 }
1659016754
1659116755 /**
@@ -16661,7 +16825,7 @@ class TopLevel {
1666116825 * @return NULLClass|float|null
1666216826 */
1666316827 public static function sampleNull(): NULLClass|float|null {
16664- return NULLClass::sample(); /*236:null*/
16828+ return NULLClass::sample(); /*238:null*/
1666516829 }
1666616830
1666716831 /**
@@ -16737,7 +16901,7 @@ class TopLevel {
1673716901 * @return UnionNullNull|float|null
1673816902 */
1673916903 public static function sampleTopLevelNull(): UnionNullNull|float|null {
16740- return UnionNullNull::sample(); /*237:topLevelNull*/
16904+ return UnionNullNull::sample(); /*239:topLevelNull*/
1674116905 }
1674216906
1674316907 /**
@@ -16813,7 +16977,7 @@ class TopLevel {
1681316977 * @return Nullptr|float|null
1681416978 */
1681516979 public static function sampleNullptr(): Nullptr|float|null {
16816- return Nullptr::sample(); /*238:nullptr*/
16980+ return Nullptr::sample(); /*240:nullptr*/
1681716981 }
1681816982
1681916983 /**
@@ -16889,7 +17053,7 @@ class TopLevel {
1688917053 * @return Number|float|null
1689017054 */
1689117055 public static function sampleNumber(): Number|float|null {
16892- return Number::sample(); /*239:number*/
17056+ return Number::sample(); /*241:number*/
1689317057 }
1689417058
1689517059 /**
@@ -16965,7 +17129,7 @@ class TopLevel {
1696517129 * @return ObjectClass|float|null
1696617130 */
1696717131 public static function sampleObject(): ObjectClass|float|null {
16968- return ObjectClass::sample(); /*240:object*/
17132+ return ObjectClass::sample(); /*242:object*/
1696917133 }
1697017134
1697117135 /**
@@ -17041,7 +17205,7 @@ class TopLevel {
1704117205 * @return ObjectMapper|float|null
1704217206 */
1704317207 public static function sampleObjectMapper(): ObjectMapper|float|null {
17044- return ObjectMapper::sample(); /*241:objectMapper*/
17208+ return ObjectMapper::sample(); /*243:objectMapper*/
1704517209 }
1704617210
1704717211 /**
@@ -17117,7 +17281,7 @@ class TopLevel {
1711717281 * @return Of|float|null
1711817282 */
1711917283 public static function sampleOf(): Of|float|null {
17120- return Of::sample(); /*242:of*/
17284+ return Of::sample(); /*244:of*/
1712117285 }
1712217286
1712317287 /**
@@ -17193,7 +17357,7 @@ class TopLevel {
1719317357 * @return Oneway|float|null
1719417358 */
1719517359 public static function sampleOneway(): Oneway|float|null {
17196- return Oneway::sample(); /*243:oneway*/
17360+ return Oneway::sample(); /*245:oneway*/
1719717361 }
1719817362
1719917363 /**
@@ -17269,7 +17433,7 @@ class TopLevel {
1726917433 * @return Open|float|null
1727017434 */
1727117435 public static function sampleOpen(): Open|float|null {
17272- return Open::sample(); /*244:open*/
17436+ return Open::sample(); /*246:open*/
1727317437 }
1727417438
1727517439 /**
@@ -17345,7 +17509,7 @@ class TopLevel {
1734517509 * @return Operator|float|null
1734617510 */
1734717511 public static function sampleOperator(): Operator|float|null {
17348- return Operator::sample(); /*245:operator*/
17512+ return Operator::sample(); /*247:operator*/
1734917513 }
1735017514
1735117515 /**
@@ -17421,7 +17585,7 @@ class TopLevel {
1742117585 * @return Optional|float|null
1742217586 */
1742317587 public static function sampleOptional(): Optional|float|null {
17424- return Optional::sample(); /*246:optional*/
17588+ return Optional::sample(); /*248:optional*/
1742517589 }
1742617590
1742717591 /**
@@ -17497,7 +17661,7 @@ class TopLevel {
1749717661 * @return OrClass|float|null
1749817662 */
1749917663 public static function sampleOr(): OrClass|float|null {
17500- return OrClass::sample(); /*247:or*/
17664+ return OrClass::sample(); /*249:or*/
1750117665 }
1750217666
1750317667 /**
@@ -17573,7 +17737,7 @@ class TopLevel {
1757317737 * @return OrEq|float|null
1757417738 */
1757517739 public static function sampleOrEq(): OrEq|float|null {
17576- return OrEq::sample(); /*248:orEq*/
17740+ return OrEq::sample(); /*250:orEq*/
1757717741 }
1757817742
1757917743 /**
@@ -17649,7 +17813,7 @@ class TopLevel {
1764917813 * @return Out|float|null
1765017814 */
1765117815 public static function sampleOut(): Out|float|null {
17652- return Out::sample(); /*249:out*/
17816+ return Out::sample(); /*251:out*/
1765317817 }
1765417818
1765517819 /**
@@ -17725,7 +17889,7 @@ class TopLevel {
1772517889 * @return OverrideClass|float|null
1772617890 */
1772717891 public static function sampleOverride(): OverrideClass|float|null {
17728- return OverrideClass::sample(); /*250:override*/
17892+ return OverrideClass::sample(); /*252:override*/
1772917893 }
1773017894
1773117895 /**
@@ -17801,7 +17965,7 @@ class TopLevel {
1780117965 * @return Package|float|null
1780217966 */
1780317967 public static function samplePackage(): Package|float|null {
17804- return Package::sample(); /*251:package*/
17968+ return Package::sample(); /*253:package*/
1780517969 }
1780617970
1780717971 /**
@@ -17877,7 +18041,7 @@ class TopLevel {
1787718041 * @return Params|float|null
1787818042 */
1787918043 public static function sampleParams(): Params|float|null {
17880- return Params::sample(); /*252:params*/
18044+ return Params::sample(); /*254:params*/
1788118045 }
1788218046
1788318047 /**
@@ -17953,7 +18117,7 @@ class TopLevel {
1795318117 * @return Pass|float|null
1795418118 */
1795518119 public static function samplePass(): Pass|float|null {
17956- return Pass::sample(); /*253:pass*/
18120+ return Pass::sample(); /*255:pass*/
1795718121 }
1795818122
1795918123 /**
@@ -18029,7 +18193,7 @@ class TopLevel {
1802918193 * @return Port|float|null
1803018194 */
1803118195 public static function samplePort(): Port|float|null {
18032- return Port::sample(); /*254:port*/
18196+ return Port::sample(); /*256:port*/
1803318197 }
1803418198
1803518199 /**
@@ -18105,7 +18269,7 @@ class TopLevel {
1810518269 * @return Postfix|float|null
1810618270 */
1810718271 public static function samplePostfix(): Postfix|float|null {
18108- return Postfix::sample(); /*255:postfix*/
18272+ return Postfix::sample(); /*257:postfix*/
1810918273 }
1811018274
1811118275 /**
@@ -18181,7 +18345,7 @@ class TopLevel {
1818118345 * @return Precedence|float|null
1818218346 */
1818318347 public static function samplePrecedence(): Precedence|float|null {
18184- return Precedence::sample(); /*256:precedence*/
18348+ return Precedence::sample(); /*258:precedence*/
1818518349 }
1818618350
1818718351 /**
@@ -18257,7 +18421,7 @@ class TopLevel {
1825718421 * @return Prefix|float|null
1825818422 */
1825918423 public static function samplePrefix(): Prefix|float|null {
18260- return Prefix::sample(); /*257:prefix*/
18424+ return Prefix::sample(); /*259:prefix*/
1826118425 }
1826218426
1826318427 /**
@@ -18333,7 +18497,7 @@ class TopLevel {
1833318497 * @return PrimitiveKind|float|null
1833418498 */
1833518499 public static function samplePrimitiveKind(): PrimitiveKind|float|null {
18336- return PrimitiveKind::sample(); /*258:primitiveKind*/
18500+ return PrimitiveKind::sample(); /*260:primitiveKind*/
1833718501 }
1833818502
1833918503 /**
@@ -18409,7 +18573,7 @@ class TopLevel {
1840918573 * @return PrintClass|float|null
1841018574 */
1841118575 public static function samplePrint(): PrintClass|float|null {
18412- return PrintClass::sample(); /*259:print*/
18576+ return PrintClass::sample(); /*261:print*/
1841318577 }
1841418578
1841518579 /**
@@ -18485,7 +18649,7 @@ class TopLevel {
1848518649 * @return Printf|float|null
1848618650 */
1848718651 public static function samplePrintf(): Printf|float|null {
18488- return Printf::sample(); /*260:printf*/
18652+ return Printf::sample(); /*262:printf*/
1848918653 }
1849018654
1849118655 /**
@@ -18561,7 +18725,7 @@ class TopLevel {
1856118725 * @return PrintMembers|float|null
1856218726 */
1856318727 public static function samplePrintMembers(): PrintMembers|float|null {
18564- return PrintMembers::sample(); /*261:printMembers*/
18728+ return PrintMembers::sample(); /*263:printMembers*/
1856518729 }
1856618730
1856718731 /**
@@ -18637,7 +18801,7 @@ class TopLevel {
1863718801 * @return PrivateClass|float|null
1863818802 */
1863918803 public static function samplePrivate(): PrivateClass|float|null {
18640- return PrivateClass::sample(); /*262:private*/
18804+ return PrivateClass::sample(); /*264:private*/
1864118805 }
1864218806
1864318807 /**
@@ -18713,7 +18877,7 @@ class TopLevel {
1871318877 * @return ProtectedClass|float|null
1871418878 */
1871518879 public static function sampleProtected(): ProtectedClass|float|null {
18716- return ProtectedClass::sample(); /*263:protected*/
18880+ return ProtectedClass::sample(); /*265:protected*/
1871718881 }
1871818882
1871918883 /**
@@ -18789,7 +18953,7 @@ class TopLevel {
1878918953 * @return Protocol|float|null
1879018954 */
1879118955 public static function sampleProtocol(): Protocol|float|null {
18792- return Protocol::sample(); /*264:protocol*/
18956+ return Protocol::sample(); /*266:protocol*/
1879318957 }
1879418958
1879518959 /**
@@ -18865,7 +19029,7 @@ class TopLevel {
1886519029 * @return ProtocolClass|float|null
1886619030 */
1886719031 public static function sampleTopLevelProtocol(): ProtocolClass|float|null {
18868- return ProtocolClass::sample(); /*265:topLevelProtocol*/
19032+ return ProtocolClass::sample(); /*267:topLevelProtocol*/
1886919033 }
1887019034
1887119035 /**
@@ -18941,7 +19105,7 @@ class TopLevel {
1894119105 * @return PublicClass|float|null
1894219106 */
1894319107 public static function samplePublic(): PublicClass|float|null {
18944- return PublicClass::sample(); /*266:public*/
19108+ return PublicClass::sample(); /*268:public*/
1894519109 }
1894619110
1894719111 /**
@@ -19017,7 +19181,7 @@ class TopLevel {
1901719181 * @return Quicktype|float|null
1901819182 */
1901919183 public static function sampleQuicktype(): Quicktype|float|null {
19020- return Quicktype::sample(); /*267:quicktype*/
19184+ return Quicktype::sample(); /*269:quicktype*/
1902119185 }
1902219186
1902319187 /**
@@ -19093,7 +19257,7 @@ class TopLevel {
1909319257 * @return Raise|float|null
1909419258 */
1909519259 public static function sampleRaise(): Raise|float|null {
19096- return Raise::sample(); /*268:raise*/
19260+ return Raise::sample(); /*270:raise*/
1909719261 }
1909819262
1909919263 /**
@@ -19169,7 +19333,7 @@ class TopLevel {
1916919333 * @return Range|float|null
1917019334 */
1917119335 public static function sampleRange(): Range|float|null {
19172- return Range::sample(); /*269:range*/
19336+ return Range::sample(); /*271:range*/
1917319337 }
1917419338
1917519339 /**
@@ -19245,7 +19409,7 @@ class TopLevel {
1924519409 * @return ReadonlyClass|float|null
1924619410 */
1924719411 public static function sampleReadonly(): ReadonlyClass|float|null {
19248- return ReadonlyClass::sample(); /*270:readonly*/
19412+ return ReadonlyClass::sample(); /*272:readonly*/
1924919413 }
1925019414
1925119415 /**
@@ -19321,7 +19485,7 @@ class TopLevel {
1932119485 * @return Ref|float|null
1932219486 */
1932319487 public static function sampleRef(): Ref|float|null {
19324- return Ref::sample(); /*271:ref*/
19488+ return Ref::sample(); /*273:ref*/
1932519489 }
1932619490
1932719491 /**
@@ -19397,7 +19561,7 @@ class TopLevel {
1939719561 * @return RegExp|float|null
1939819562 */
1939919563 public static function sampleRegExp(): RegExp|float|null {
19400- return RegExp::sample(); /*272:regExp*/
19564+ return RegExp::sample(); /*274:regExp*/
1940119565 }
1940219566
1940319567 /**
@@ -19473,7 +19637,7 @@ class TopLevel {
1947319637 * @return Register|float|null
1947419638 */
1947519639 public static function sampleRegister(): Register|float|null {
19476- return Register::sample(); /*273:register*/
19640+ return Register::sample(); /*275:register*/
1947719641 }
1947819642
1947919643 /**
@@ -19549,7 +19713,7 @@ class TopLevel {
1954919713 * @return ReinterpretCast|float|null
1955019714 */
1955119715 public static function sampleReinterpretCast(): ReinterpretCast|float|null {
19552- return ReinterpretCast::sample(); /*274:reinterpretCast*/
19716+ return ReinterpretCast::sample(); /*276:reinterpretCast*/
1955319717 }
1955419718
1955519719 /**
@@ -19625,7 +19789,7 @@ class TopLevel {
1962519789 * @return Repeat|float|null
1962619790 */
1962719791 public static function sampleRepeat(): Repeat|float|null {
19628- return Repeat::sample(); /*275:repeat*/
19792+ return Repeat::sample(); /*277:repeat*/
1962919793 }
1963019794
1963119795 /**
@@ -19701,7 +19865,7 @@ class TopLevel {
1970119865 * @return RequireClass|float|null
1970219866 */
1970319867 public static function sampleRequire(): RequireClass|float|null {
19704- return RequireClass::sample(); /*276:require*/
19868+ return RequireClass::sample(); /*278:require*/
1970519869 }
1970619870
1970719871 /**
@@ -19777,7 +19941,7 @@ class TopLevel {
1977719941 * @return Required|float|null
1977819942 */
1977919943 public static function sampleRequired(): Required|float|null {
19780- return Required::sample(); /*277:required*/
19944+ return Required::sample(); /*279:required*/
1978119945 }
1978219946
1978319947 /**
@@ -19853,7 +20017,7 @@ class TopLevel {
1985320017 * @return Requires|float|null
1985420018 */
1985520019 public static function sampleRequires(): Requires|float|null {
19856- return Requires::sample(); /*278:requires*/
20020+ return Requires::sample(); /*280:requires*/
1985720021 }
1985820022
1985920023 /**
@@ -19929,7 +20093,7 @@ class TopLevel {
1992920093 * @return Restrict|float|null
1993020094 */
1993120095 public static function sampleRestrict(): Restrict|float|null {
19932- return Restrict::sample(); /*279:restrict*/
20096+ return Restrict::sample(); /*281:restrict*/
1993320097 }
1993420098
1993520099 /**
@@ -20005,7 +20169,7 @@ class TopLevel {
2000520169 * @return Retain|float|null
2000620170 */
2000720171 public static function sampleRetain(): Retain|float|null {
20008- return Retain::sample(); /*280:retain*/
20172+ return Retain::sample(); /*282:retain*/
2000920173 }
2001020174
2001120175 /**
@@ -20081,7 +20245,7 @@ class TopLevel {
2008120245 * @return Rethrows|float|null
2008220246 */
2008320247 public static function sampleRethrows(): Rethrows|float|null {
20084- return Rethrows::sample(); /*281:rethrows*/
20248+ return Rethrows::sample(); /*283:rethrows*/
2008520249 }
2008620250
2008720251 /**
@@ -20157,7 +20321,7 @@ class TopLevel {
2015720321 * @return ReturnClass|float|null
2015820322 */
2015920323 public static function sampleReturn(): ReturnClass|float|null {
20160- return ReturnClass::sample(); /*282:return*/
20324+ return ReturnClass::sample(); /*284:return*/
2016120325 }
2016220326
2016320327 /**
@@ -20233,7 +20397,7 @@ class TopLevel {
2023320397 * @return Right|float|null
2023420398 */
2023520399 public static function sampleRight(): Right|float|null {
20236- return Right::sample(); /*283:right*/
20400+ return Right::sample(); /*285:right*/
2023720401 }
2023820402
2023920403 /**
@@ -20309,7 +20473,7 @@ class TopLevel {
2030920473 * @return RuntimeType|float|null
2031020474 */
2031120475 public static function sampleRuntimeType(): RuntimeType|float|null {
20312- return RuntimeType::sample(); /*284:runtimeType*/
20476+ return RuntimeType::sample(); /*286:runtimeType*/
2031320477 }
2031420478
2031520479 /**
@@ -20385,7 +20549,7 @@ class TopLevel {
2038520549 * @return S|float|null
2038620550 */
2038720551 public static function sampleS(): S|float|null {
20388- return S::sample(); /*285:s*/
20552+ return S::sample(); /*287:s*/
2038920553 }
2039020554
2039120555 /**
@@ -20461,7 +20625,7 @@ class TopLevel {
2046120625 * @return Sbyte|float|null
2046220626 */
2046320627 public static function sampleSbyte(): Sbyte|float|null {
20464- return Sbyte::sample(); /*286:sbyte*/
20628+ return Sbyte::sample(); /*288:sbyte*/
2046520629 }
2046620630
2046720631 /**
@@ -20537,7 +20701,7 @@ class TopLevel {
2053720701 * @return Sealed|float|null
2053820702 */
2053920703 public static function sampleSealed(): Sealed|float|null {
20540- return Sealed::sample(); /*287:sealed*/
20704+ return Sealed::sample(); /*289:sealed*/
2054120705 }
2054220706
2054320707 /**
@@ -20613,7 +20777,7 @@ class TopLevel {
2061320777 * @return Sel|float|null
2061420778 */
2061520779 public static function sampleSel(): Sel|float|null {
20616- return Sel::sample(); /*288:sel*/
20780+ return Sel::sample(); /*290:sel*/
2061720781 }
2061820782
2061920783 /**
@@ -20689,7 +20853,7 @@ class TopLevel {
2068920853 * @return Select|float|null
2069020854 */
2069120855 public static function sampleSelect(): Select|float|null {
20692- return Select::sample(); /*289:select*/
20856+ return Select::sample(); /*291:select*/
2069320857 }
2069420858
2069520859 /**
@@ -20765,7 +20929,7 @@ class TopLevel {
2076520929 * @return SelfClass|float|null
2076620930 */
2076720931 public static function sampleSelf(): SelfClass|float|null {
20768- return SelfClass::sample(); /*290:self*/
20932+ return SelfClass::sample(); /*292:self*/
2076920933 }
2077020934
2077120935 /**
@@ -20841,7 +21005,7 @@ class TopLevel {
2084121005 * @return UnionSelfSelf|float|null
2084221006 */
2084321007 public static function sampleTopLevelSelf(): UnionSelfSelf|float|null {
20844- return UnionSelfSelf::sample(); /*291:topLevelSelf*/
21008+ return UnionSelfSelf::sample(); /*293:topLevelSelf*/
2084521009 }
2084621010
2084721011 /**
@@ -20917,7 +21081,7 @@ class TopLevel {
2091721081 * @return Sendable|float|null
2091821082 */
2091921083 public static function sampleSendable(): Sendable|float|null {
20920- return Sendable::sample(); /*292:sendable*/
21084+ return Sendable::sample(); /*294:sendable*/
2092121085 }
2092221086
2092321087 /**
@@ -20993,7 +21157,7 @@ class TopLevel {
2099321157 * @return SerialDescriptor|float|null
2099421158 */
2099521159 public static function sampleSerialDescriptor(): SerialDescriptor|float|null {
20996- return SerialDescriptor::sample(); /*293:serialDescriptor*/
21160+ return SerialDescriptor::sample(); /*295:serialDescriptor*/
2099721161 }
2099821162
2099921163 /**
@@ -21069,7 +21233,7 @@ class TopLevel {
2106921233 * @return SerializableClass|float|null
2107021234 */
2107121235 public static function sampleSerializable(): SerializableClass|float|null {
21072- return SerializableClass::sample(); /*294:serializable*/
21236+ return SerializableClass::sample(); /*296:serializable*/
2107321237 }
2107421238
2107521239 /**
@@ -21145,7 +21309,7 @@ class TopLevel {
2114521309 * @return Serialize|float|null
2114621310 */
2114721311 public static function sampleSerialize(): Serialize|float|null {
21148- return Serialize::sample(); /*295:serialize*/
21312+ return Serialize::sample(); /*297:serialize*/
2114921313 }
2115021314
2115121315 /**
@@ -21221,7 +21385,7 @@ class TopLevel {
2122121385 * @return SerializerProvider|float|null
2122221386 */
2122321387 public static function sampleSerializerProvider(): SerializerProvider|float|null {
21224- return SerializerProvider::sample(); /*296:serializerProvider*/
21388+ return SerializerProvider::sample(); /*298:serializerProvider*/
2122521389 }
2122621390
2122721391 /**
@@ -21297,7 +21461,7 @@ class TopLevel {
2129721461 * @return SerialName|float|null
2129821462 */
2129921463 public static function sampleSerialName(): SerialName|float|null {
21300- return SerialName::sample(); /*297:serialName*/
21464+ return SerialName::sample(); /*299:serialName*/
2130121465 }
2130221466
2130321467 /**
@@ -21373,7 +21537,7 @@ class TopLevel {
2137321537 * @return Set|float|null
2137421538 */
2137521539 public static function sampleSet(): Set|float|null {
21376- return Set::sample(); /*298:set*/
21540+ return Set::sample(); /*300:set*/
2137721541 }
2137821542
2137921543 /**
@@ -21449,7 +21613,7 @@ class TopLevel {
2144921613 * @return Short|float|null
2145021614 */
2145121615 public static function sampleShort(): Short|float|null {
21452- return Short::sample(); /*299:short*/
21616+ return Short::sample(); /*301:short*/
2145321617 }
2145421618
2145521619 /**
@@ -21525,7 +21689,7 @@ class TopLevel {
2152521689 * @return Signed|float|null
2152621690 */
2152721691 public static function sampleSigned(): Signed|float|null {
21528- return Signed::sample(); /*300:signed*/
21692+ return Signed::sample(); /*302:signed*/
2152921693 }
2153021694
2153121695 /**
@@ -21601,7 +21765,7 @@ class TopLevel {
2160121765 * @return SimpleModule|float|null
2160221766 */
2160321767 public static function sampleSimpleModule(): SimpleModule|float|null {
21604- return SimpleModule::sample(); /*301:simpleModule*/
21768+ return SimpleModule::sample(); /*303:simpleModule*/
2160521769 }
2160621770
2160721771 /**
@@ -21677,7 +21841,7 @@ class TopLevel {
2167721841 * @return Sizeof|float|null
2167821842 */
2167921843 public static function sampleSizeof(): Sizeof|float|null {
21680- return Sizeof::sample(); /*302:sizeof*/
21844+ return Sizeof::sample(); /*304:sizeof*/
2168121845 }
2168221846
2168321847 /**
@@ -21753,7 +21917,7 @@ class TopLevel {
2175321917 * @return Stackalloc|float|null
2175421918 */
2175521919 public static function sampleStackalloc(): Stackalloc|float|null {
21756- return Stackalloc::sample(); /*303:stackalloc*/
21920+ return Stackalloc::sample(); /*305:stackalloc*/
2175721921 }
2175821922
2175921923 /**
@@ -21829,7 +21993,7 @@ class TopLevel {
2182921993 * @return Standards|float|null
2183021994 */
2183121995 public static function sampleStandards(): Standards|float|null {
21832- return Standards::sample(); /*304:standards*/
21996+ return Standards::sample(); /*306:standards*/
2183321997 }
2183421998
2183521999 /**
@@ -21905,7 +22069,7 @@ class TopLevel {
2190522069 * @return StaticClass|float|null
2190622070 */
2190722071 public static function sampleStatic(): StaticClass|float|null {
21908- return StaticClass::sample(); /*305:static*/
22072+ return StaticClass::sample(); /*307:static*/
2190922073 }
2191022074
2191122075 /**
@@ -21981,7 +22145,7 @@ class TopLevel {
2198122145 * @return StaticAssert|float|null
2198222146 */
2198322147 public static function sampleStaticAssert(): StaticAssert|float|null {
21984- return StaticAssert::sample(); /*306:staticAssert*/
22148+ return StaticAssert::sample(); /*308:staticAssert*/
2198522149 }
2198622150
2198722151 /**
@@ -22057,7 +22221,7 @@ class TopLevel {
2205722221 * @return StaticCast|float|null
2205822222 */
2205922223 public static function sampleStaticCast(): StaticCast|float|null {
22060- return StaticCast::sample(); /*307:staticCast*/
22224+ return StaticCast::sample(); /*309:staticCast*/
2206122225 }
2206222226
2206322227 /**
@@ -22133,7 +22297,7 @@ class TopLevel {
2213322297 * @return StdDeserializer|float|null
2213422298 */
2213522299 public static function sampleStdDeserializer(): StdDeserializer|float|null {
22136- return StdDeserializer::sample(); /*308:stdDeserializer*/
22300+ return StdDeserializer::sample(); /*310:stdDeserializer*/
2213722301 }
2213822302
2213922303 /**
@@ -22209,7 +22373,7 @@ class TopLevel {
2220922373 * @return StdSerializer|float|null
2221022374 */
2221122375 public static function sampleStdSerializer(): StdSerializer|float|null {
22212- return StdSerializer::sample(); /*309:stdSerializer*/
22376+ return StdSerializer::sample(); /*311:stdSerializer*/
2221322377 }
2221422378
2221522379 /**
@@ -22285,7 +22449,7 @@ class TopLevel {
2228522449 * @return Strictfp|float|null
2228622450 */
2228722451 public static function sampleStrictfp(): Strictfp|float|null {
22288- return Strictfp::sample(); /*310:strictfp*/
22452+ return Strictfp::sample(); /*312:strictfp*/
2228922453 }
2229022454
2229122455 /**
@@ -22361,7 +22525,7 @@ class TopLevel {
2236122525 * @return StringClass|float|null
2236222526 */
2236322527 public static function sampleString(): StringClass|float|null {
22364- return StringClass::sample(); /*311:string*/
22528+ return StringClass::sample(); /*313:string*/
2236522529 }
2236622530
2236722531 /**
@@ -22437,7 +22601,7 @@ class TopLevel {
2243722601 * @return Struct|float|null
2243822602 */
2243922603 public static function sampleStruct(): Struct|float|null {
22440- return Struct::sample(); /*312:struct*/
22604+ return Struct::sample(); /*314:struct*/
2244122605 }
2244222606
2244322607 /**
@@ -22513,7 +22677,7 @@ class TopLevel {
2251322677 * @return Subscript|float|null
2251422678 */
2251522679 public static function sampleSubscript(): Subscript|float|null {
22516- return Subscript::sample(); /*313:subscript*/
22680+ return Subscript::sample(); /*315:subscript*/
2251722681 }
2251822682
2251922683 /**
@@ -22589,7 +22753,7 @@ class TopLevel {
2258922753 * @return Super|float|null
2259022754 */
2259122755 public static function sampleSuper(): Super|float|null {
22592- return Super::sample(); /*314:super*/
22756+ return Super::sample(); /*316:super*/
2259322757 }
2259422758
2259522759 /**
@@ -22665,7 +22829,7 @@ class TopLevel {
2266522829 * @return SwitchClass|float|null
2266622830 */
2266722831 public static function sampleSwitch(): SwitchClass|float|null {
22668- return SwitchClass::sample(); /*315:switch*/
22832+ return SwitchClass::sample(); /*317:switch*/
2266922833 }
2267022834
2267122835 /**
@@ -22741,7 +22905,7 @@ class TopLevel {
2274122905 * @return Symbol|float|null
2274222906 */
2274322907 public static function sampleSymbol(): Symbol|float|null {
22744- return Symbol::sample(); /*316:symbol*/
22908+ return Symbol::sample(); /*318:symbol*/
2274522909 }
2274622910
2274722911 /**
@@ -22817,7 +22981,7 @@ class TopLevel {
2281722981 * @return Synchronized|float|null
2281822982 */
2281922983 public static function sampleSynchronized(): Synchronized|float|null {
22820- return Synchronized::sample(); /*317:synchronized*/
22984+ return Synchronized::sample(); /*319:synchronized*/
2282122985 }
2282222986
2282322987 /**
@@ -22893,7 +23057,7 @@ class TopLevel {
2289323057 * @return System|float|null
2289423058 */
2289523059 public static function sampleSystem(): System|float|null {
22896- return System::sample(); /*318:system*/
23060+ return System::sample(); /*320:system*/
2289723061 }
2289823062
2289923063 /**
@@ -22969,7 +23133,7 @@ class TopLevel {
2296923133 * @return Template|float|null
2297023134 */
2297123135 public static function sampleTemplate(): Template|float|null {
22972- return Template::sample(); /*319:template*/
23136+ return Template::sample(); /*321:template*/
2297323137 }
2297423138
2297523139 /**
@@ -23045,7 +23209,7 @@ class TopLevel {
2304523209 * @return Then|float|null
2304623210 */
2304723211 public static function sampleThen(): Then|float|null {
23048- return Then::sample(); /*320:then*/
23212+ return Then::sample(); /*322:then*/
2304923213 }
2305023214
2305123215 /**
@@ -23121,7 +23285,7 @@ class TopLevel {
2312123285 * @return This|float|null
2312223286 */
2312323287 public static function sampleTopLevelThis(): This|float|null {
23124- return This::sample(); /*321:topLevelThis*/
23288+ return This::sample(); /*323:topLevelThis*/
2312523289 }
2312623290
2312723291 /**
@@ -23197,7 +23361,7 @@ class TopLevel {
2319723361 * @return ThreadLocal|float|null
2319823362 */
2319923363 public static function sampleThreadLocal(): ThreadLocal|float|null {
23200- return ThreadLocal::sample(); /*322:threadLocal*/
23364+ return ThreadLocal::sample(); /*324:threadLocal*/
2320123365 }
2320223366
2320323367 /**
@@ -23273,7 +23437,7 @@ class TopLevel {
2327323437 * @return ThrowClass|float|null
2327423438 */
2327523439 public static function sampleThrow(): ThrowClass|float|null {
23276- return ThrowClass::sample(); /*323:throw*/
23440+ return ThrowClass::sample(); /*325:throw*/
2327723441 }
2327823442
2327923443 /**
@@ -23349,7 +23513,7 @@ class TopLevel {
2334923513 * @return Throws|float|null
2335023514 */
2335123515 public static function sampleThrows(): Throws|float|null {
23352- return Throws::sample(); /*324:throws*/
23516+ return Throws::sample(); /*326:throws*/
2335323517 }
2335423518
2335523519 /**
@@ -23425,7 +23589,7 @@ class TopLevel {
2342523589 * @return TimeOnly|float|null
2342623590 */
2342723591 public static function sampleTimeOnly(): TimeOnly|float|null {
23428- return TimeOnly::sample(); /*325:timeOnly*/
23592+ return TimeOnly::sample(); /*327:timeOnly*/
2342923593 }
2343023594
2343123595 /**
@@ -23501,7 +23665,7 @@ class TopLevel {
2350123665 * @return TimeOnlyConverter|float|null
2350223666 */
2350323667 public static function sampleTimeOnlyConverter(): TimeOnlyConverter|float|null {
23504- return TimeOnlyConverter::sample(); /*326:timeOnlyConverter*/
23668+ return TimeOnlyConverter::sample(); /*328:timeOnlyConverter*/
2350523669 }
2350623670
2350723671 /**
@@ -23577,7 +23741,83 @@ class TopLevel {
2357723741 * @return TimeZone|float|null
2357823742 */
2357923743 public static function sampleTimeZone(): TimeZone|float|null {
23580- return TimeZone::sample(); /*327:timeZone*/
23744+ return TimeZone::sample(); /*329:timeZone*/
23745+ }
23746+
23747+ /**
23748+ * @param stdClass|float|null $value
23749+ * @throws Exception
23750+ * @return ToDict|float|null
23751+ */
23752+ public static function fromToDict(stdClass|float|null $value): ToDict|float|null {
23753+ if (is_null($value)) {
23754+ return $value; /*null*/
23755+ } elseif (is_object($value)) {
23756+ return ToDict::from($value); /*class*/
23757+ } elseif (is_float($value) || is_int($value)) {
23758+ return $value; /*float*/
23759+ } else {
23760+ throw new Exception('Cannot deserialize union value in TopLevel');
23761+ }
23762+ }
23763+
23764+ /**
23765+ * @throws Exception
23766+ * @return stdClass|float|null
23767+ */
23768+ public function toToDict(): stdClass|float|null {
23769+ if (TopLevel::validateToDict($this->toDict)) {
23770+ if (is_null($this->toDict)) {
23771+ return $this->toDict; /*null*/
23772+ } elseif ($this->toDict instanceof ToDict) {
23773+ return $this->toDict->to(); /*class*/
23774+ } elseif (is_float($this->toDict) || is_int($this->toDict)) {
23775+ return $this->toDict; /*float*/
23776+ } else {
23777+ throw new Exception('Union value has no matching member in TopLevel');
23778+ }
23779+ }
23780+ throw new Exception('never get to this TopLevel::toDict');
23781+ }
23782+
23783+ /**
23784+ * @param ToDict|float|null
23785+ * @return bool
23786+ * @throws Exception
23787+ */
23788+ public static function validateToDict(ToDict|float|null $value): bool {
23789+ if (is_null($value)) {
23790+ if (!is_null($value)) {
23791+ throw new Exception("Attribute Error:TopLevel::toDict");
23792+ }
23793+ } elseif ($value instanceof ToDict) {
23794+ $value->validate();
23795+ } elseif (is_float($value) || is_int($value)) {
23796+ if (!is_float($value) && !is_int($value)) {
23797+ throw new Exception("Attribute Error:TopLevel::toDict");
23798+ }
23799+ } else {
23800+ throw new Exception("Attribute Error:TopLevel::toDict");
23801+ }
23802+ return true;
23803+ }
23804+
23805+ /**
23806+ * @throws Exception
23807+ * @return ToDict|float|null
23808+ */
23809+ public function getToDict(): ToDict|float|null {
23810+ if (TopLevel::validateToDict($this->toDict)) {
23811+ return $this->toDict;
23812+ }
23813+ throw new Exception('never get to getToDict TopLevel::toDict');
23814+ }
23815+
23816+ /**
23817+ * @return ToDict|float|null
23818+ */
23819+ public static function sampleToDict(): ToDict|float|null {
23820+ return ToDict::sample(); /*330:toDict*/
2358123821 }
2358223822
2358323823 /**
@@ -23653,7 +23893,7 @@ class TopLevel {
2365323893 * @return ToJSON|float|null
2365423894 */
2365523895 public static function sampleToJSON(): ToJSON|float|null {
23656- return ToJSON::sample(); /*328:toJSON*/
23896+ return ToJSON::sample(); /*331:toJSON*/
2365723897 }
2365823898
2365923899 /**
@@ -23729,7 +23969,7 @@ class TopLevel {
2372923969 * @return TopLevelClass|float|null
2373023970 */
2373123971 public static function sampleTopLevel(): TopLevelClass|float|null {
23732- return TopLevelClass::sample(); /*329:topLevel*/
23972+ return TopLevelClass::sample(); /*332:topLevel*/
2373323973 }
2373423974
2373523975 /**
@@ -23805,7 +24045,7 @@ class TopLevel {
2380524045 * @return ToString|float|null
2380624046 */
2380724047 public static function sampleToString(): ToString|float|null {
23808- return ToString::sample(); /*330:toString*/
24048+ return ToString::sample(); /*333:toString*/
2380924049 }
2381024050
2381124051 /**
@@ -23881,7 +24121,7 @@ class TopLevel {
2388124121 * @return Transient|float|null
2388224122 */
2388324123 public static function sampleTransient(): Transient|float|null {
23884- return Transient::sample(); /*331:transient*/
24124+ return Transient::sample(); /*334:transient*/
2388524125 }
2388624126
2388724127 /**
@@ -23957,7 +24197,7 @@ class TopLevel {
2395724197 * @return TrueClass|float|null
2395824198 */
2395924199 public static function sampleTrue(): TrueClass|float|null {
23960- return TrueClass::sample(); /*332:true*/
24200+ return TrueClass::sample(); /*335:true*/
2396124201 }
2396224202
2396324203 /**
@@ -24033,7 +24273,7 @@ class TopLevel {
2403324273 * @return UnionTrueTrue|float|null
2403424274 */
2403524275 public static function sampleTopLevelTrue(): UnionTrueTrue|float|null {
24036- return UnionTrueTrue::sample(); /*333:topLevelTrue*/
24276+ return UnionTrueTrue::sample(); /*336:topLevelTrue*/
2403724277 }
2403824278
2403924279 /**
@@ -24109,7 +24349,7 @@ class TopLevel {
2410924349 * @return TryClass|float|null
2411024350 */
2411124351 public static function sampleTry(): TryClass|float|null {
24112- return TryClass::sample(); /*334:try*/
24352+ return TryClass::sample(); /*337:try*/
2411324353 }
2411424354
2411524355 /**
@@ -24185,7 +24425,7 @@ class TopLevel {
2418524425 * @return Type|float|null
2418624426 */
2418724427 public static function sampleType(): Type|float|null {
24188- return Type::sample(); /*335:type*/
24428+ return Type::sample(); /*338:type*/
2418924429 }
2419024430
2419124431 /**
@@ -24261,7 +24501,7 @@ class TopLevel {
2426124501 * @return TypeClass|float|null
2426224502 */
2426324503 public static function sampleTopLevelType(): TypeClass|float|null {
24264- return TypeClass::sample(); /*336:topLevelType*/
24504+ return TypeClass::sample(); /*339:topLevelType*/
2426524505 }
2426624506
2426724507 /**
@@ -24337,7 +24577,7 @@ class TopLevel {
2433724577 * @return Typealias|float|null
2433824578 */
2433924579 public static function sampleTypealias(): Typealias|float|null {
24340- return Typealias::sample(); /*337:typealias*/
24580+ return Typealias::sample(); /*340:typealias*/
2434124581 }
2434224582
2434324583 /**
@@ -24413,7 +24653,7 @@ class TopLevel {
2441324653 * @return Typedef|float|null
2441424654 */
2441524655 public static function sampleTypedef(): Typedef|float|null {
24416- return Typedef::sample(); /*338:typedef*/
24656+ return Typedef::sample(); /*341:typedef*/
2441724657 }
2441824658
2441924659 /**
@@ -24489,7 +24729,7 @@ class TopLevel {
2448924729 * @return Typeid|float|null
2449024730 */
2449124731 public static function sampleTypeid(): Typeid|float|null {
24492- return Typeid::sample(); /*339:typeid*/
24732+ return Typeid::sample(); /*342:typeid*/
2449324733 }
2449424734
2449524735 /**
@@ -24565,7 +24805,7 @@ class TopLevel {
2456524805 * @return Typename|float|null
2456624806 */
2456724807 public static function sampleTypename(): Typename|float|null {
24568- return Typename::sample(); /*340:typename*/
24808+ return Typename::sample(); /*343:typename*/
2456924809 }
2457024810
2457124811 /**
@@ -24641,7 +24881,7 @@ class TopLevel {
2464124881 * @return Typeof|float|null
2464224882 */
2464324883 public static function sampleTypeof(): Typeof|float|null {
24644- return Typeof::sample(); /*341:typeof*/
24884+ return Typeof::sample(); /*344:typeof*/
2464524885 }
2464624886
2464724887 /**
@@ -24717,7 +24957,7 @@ class TopLevel {
2471724957 * @return Uint|float|null
2471824958 */
2471924959 public static function sampleUint(): Uint|float|null {
24720- return Uint::sample(); /*342:uint*/
24960+ return Uint::sample(); /*345:uint*/
2472124961 }
2472224962
2472324963 /**
@@ -24793,7 +25033,7 @@ class TopLevel {
2479325033 * @return Ulong|float|null
2479425034 */
2479525035 public static function sampleUlong(): Ulong|float|null {
24796- return Ulong::sample(); /*343:ulong*/
25036+ return Ulong::sample(); /*346:ulong*/
2479725037 }
2479825038
2479925039 /**
@@ -24869,7 +25109,7 @@ class TopLevel {
2486925109 * @return Unchecked|float|null
2487025110 */
2487125111 public static function sampleUnchecked(): Unchecked|float|null {
24872- return Unchecked::sample(); /*344:unchecked*/
25112+ return Unchecked::sample(); /*347:unchecked*/
2487325113 }
2487425114
2487525115 /**
@@ -24945,7 +25185,7 @@ class TopLevel {
2494525185 * @return Undefined|float|null
2494625186 */
2494725187 public static function sampleUndefined(): Undefined|float|null {
24948- return Undefined::sample(); /*345:undefined*/
25188+ return Undefined::sample(); /*348:undefined*/
2494925189 }
2495025190
2495125191 /**
@@ -25021,7 +25261,83 @@ class TopLevel {
2502125261 * @return UnionClass|float|null
2502225262 */
2502325263 public static function sampleUnion(): UnionClass|float|null {
25024- return UnionClass::sample(); /*346:union*/
25264+ return UnionClass::sample(); /*349:union*/
25265+ }
25266+
25267+ /**
25268+ * @param stdClass|float|null $value
25269+ * @throws Exception
25270+ * @return UnmarshalJSON|float|null
25271+ */
25272+ public static function fromUnmarshalJSON(stdClass|float|null $value): UnmarshalJSON|float|null {
25273+ if (is_null($value)) {
25274+ return $value; /*null*/
25275+ } elseif (is_object($value)) {
25276+ return UnmarshalJSON::from($value); /*class*/
25277+ } elseif (is_float($value) || is_int($value)) {
25278+ return $value; /*float*/
25279+ } else {
25280+ throw new Exception('Cannot deserialize union value in TopLevel');
25281+ }
25282+ }
25283+
25284+ /**
25285+ * @throws Exception
25286+ * @return stdClass|float|null
25287+ */
25288+ public function toUnmarshalJSON(): stdClass|float|null {
25289+ if (TopLevel::validateUnmarshalJSON($this->unmarshalJSON)) {
25290+ if (is_null($this->unmarshalJSON)) {
25291+ return $this->unmarshalJSON; /*null*/
25292+ } elseif ($this->unmarshalJSON instanceof UnmarshalJSON) {
25293+ return $this->unmarshalJSON->to(); /*class*/
25294+ } elseif (is_float($this->unmarshalJSON) || is_int($this->unmarshalJSON)) {
25295+ return $this->unmarshalJSON; /*float*/
25296+ } else {
25297+ throw new Exception('Union value has no matching member in TopLevel');
25298+ }
25299+ }
25300+ throw new Exception('never get to this TopLevel::unmarshalJSON');
25301+ }
25302+
25303+ /**
25304+ * @param UnmarshalJSON|float|null
25305+ * @return bool
25306+ * @throws Exception
25307+ */
25308+ public static function validateUnmarshalJSON(UnmarshalJSON|float|null $value): bool {
25309+ if (is_null($value)) {
25310+ if (!is_null($value)) {
25311+ throw new Exception("Attribute Error:TopLevel::unmarshalJSON");
25312+ }
25313+ } elseif ($value instanceof UnmarshalJSON) {
25314+ $value->validate();
25315+ } elseif (is_float($value) || is_int($value)) {
25316+ if (!is_float($value) && !is_int($value)) {
25317+ throw new Exception("Attribute Error:TopLevel::unmarshalJSON");
25318+ }
25319+ } else {
25320+ throw new Exception("Attribute Error:TopLevel::unmarshalJSON");
25321+ }
25322+ return true;
25323+ }
25324+
25325+ /**
25326+ * @throws Exception
25327+ * @return UnmarshalJSON|float|null
25328+ */
25329+ public function getUnmarshalJSON(): UnmarshalJSON|float|null {
25330+ if (TopLevel::validateUnmarshalJSON($this->unmarshalJSON)) {
25331+ return $this->unmarshalJSON;
25332+ }
25333+ throw new Exception('never get to getUnmarshalJSON TopLevel::unmarshalJSON');
25334+ }
25335+
25336+ /**
25337+ * @return UnmarshalJSON|float|null
25338+ */
25339+ public static function sampleUnmarshalJSON(): UnmarshalJSON|float|null {
25340+ return UnmarshalJSON::sample(); /*350:unmarshalJSON*/
2502525341 }
2502625342
2502725343 /**
@@ -25097,7 +25413,7 @@ class TopLevel {
2509725413 * @return Unowned|float|null
2509825414 */
2509925415 public static function sampleUnowned(): Unowned|float|null {
25100- return Unowned::sample(); /*347:unowned*/
25416+ return Unowned::sample(); /*351:unowned*/
2510125417 }
2510225418
2510325419 /**
@@ -25173,7 +25489,7 @@ class TopLevel {
2517325489 * @return Unsafe|float|null
2517425490 */
2517525491 public static function sampleUnsafe(): Unsafe|float|null {
25176- return Unsafe::sample(); /*348:unsafe*/
25492+ return Unsafe::sample(); /*352:unsafe*/
2517725493 }
2517825494
2517925495 /**
@@ -25249,7 +25565,7 @@ class TopLevel {
2524925565 * @return Unsigned|float|null
2525025566 */
2525125567 public static function sampleUnsigned(): Unsigned|float|null {
25252- return Unsigned::sample(); /*349:unsigned*/
25568+ return Unsigned::sample(); /*353:unsigned*/
2525325569 }
2525425570
2525525571 /**
@@ -25325,7 +25641,7 @@ class TopLevel {
2532525641 * @return UseSerializers|float|null
2532625642 */
2532725643 public static function sampleUseSerializers(): UseSerializers|float|null {
25328- return UseSerializers::sample(); /*350:useSerializers*/
25644+ return UseSerializers::sample(); /*354:useSerializers*/
2532925645 }
2533025646
2533125647 /**
@@ -25401,7 +25717,7 @@ class TopLevel {
2540125717 * @return Ushort|float|null
2540225718 */
2540325719 public static function sampleUshort(): Ushort|float|null {
25404- return Ushort::sample(); /*351:ushort*/
25720+ return Ushort::sample(); /*355:ushort*/
2540525721 }
2540625722
2540725723 /**
@@ -25477,7 +25793,7 @@ class TopLevel {
2547725793 * @return Using|float|null
2547825794 */
2547925795 public static function sampleUsing(): Using|float|null {
25480- return Using::sample(); /*352:using*/
25796+ return Using::sample(); /*356:using*/
2548125797 }
2548225798
2548325799 /**
@@ -25553,7 +25869,7 @@ class TopLevel {
2555325869 * @return Utf8JSONReader|float|null
2555425870 */
2555525871 public static function sampleUtf8JSONReader(): Utf8JSONReader|float|null {
25556- return Utf8JSONReader::sample(); /*353:utf8JSONReader*/
25872+ return Utf8JSONReader::sample(); /*357:utf8JSONReader*/
2555725873 }
2555825874
2555925875 /**
@@ -25629,7 +25945,7 @@ class TopLevel {
2562925945 * @return Utf8JSONWriter|float|null
2563025946 */
2563125947 public static function sampleUtf8JSONWriter(): Utf8JSONWriter|float|null {
25632- return Utf8JSONWriter::sample(); /*354:utf8JSONWriter*/
25948+ return Utf8JSONWriter::sample(); /*358:utf8JSONWriter*/
2563325949 }
2563425950
2563525951 /**
@@ -25705,7 +26021,7 @@ class TopLevel {
2570526021 * @return UUID|float|null
2570626022 */
2570726023 public static function sampleUUID(): UUID|float|null {
25708- return UUID::sample(); /*355:uuid*/
26024+ return UUID::sample(); /*359:uuid*/
2570926025 }
2571026026
2571126027 /**
@@ -25781,7 +26097,7 @@ class TopLevel {
2578126097 * @return VarClass|float|null
2578226098 */
2578326099 public static function sampleVar(): VarClass|float|null {
25784- return VarClass::sample(); /*356:var*/
26100+ return VarClass::sample(); /*360:var*/
2578526101 }
2578626102
2578726103 /**
@@ -25857,7 +26173,7 @@ class TopLevel {
2585726173 * @return Virtual|float|null
2585826174 */
2585926175 public static function sampleVirtual(): Virtual|float|null {
25860- return Virtual::sample(); /*357:virtual*/
26176+ return Virtual::sample(); /*361:virtual*/
2586126177 }
2586226178
2586326179 /**
@@ -25933,7 +26249,7 @@ class TopLevel {
2593326249 * @return VoidClass|float|null
2593426250 */
2593526251 public static function sampleVoid(): VoidClass|float|null {
25936- return VoidClass::sample(); /*358:void*/
26252+ return VoidClass::sample(); /*362:void*/
2593726253 }
2593826254
2593926255 /**
@@ -26009,7 +26325,7 @@ class TopLevel {
2600926325 * @return Volatile|float|null
2601026326 */
2601126327 public static function sampleVolatile(): Volatile|float|null {
26012- return Volatile::sample(); /*359:volatile*/
26328+ return Volatile::sample(); /*363:volatile*/
2601326329 }
2601426330
2601526331 /**
@@ -26085,7 +26401,7 @@ class TopLevel {
2608526401 * @return WcharT|float|null
2608626402 */
2608726403 public static function sampleWcharT(): WcharT|float|null {
26088- return WcharT::sample(); /*360:wcharT*/
26404+ return WcharT::sample(); /*364:wcharT*/
2608926405 }
2609026406
2609126407 /**
@@ -26161,7 +26477,7 @@ class TopLevel {
2616126477 * @return Weak|float|null
2616226478 */
2616326479 public static function sampleWeak(): Weak|float|null {
26164- return Weak::sample(); /*361:weak*/
26480+ return Weak::sample(); /*365:weak*/
2616526481 }
2616626482
2616726483 /**
@@ -26237,7 +26553,7 @@ class TopLevel {
2623726553 * @return Where|float|null
2623826554 */
2623926555 public static function sampleWhere(): Where|float|null {
26240- return Where::sample(); /*362:where*/
26556+ return Where::sample(); /*366:where*/
2624126557 }
2624226558
2624326559 /**
@@ -26313,7 +26629,7 @@ class TopLevel {
2631326629 * @return WhileClass|float|null
2631426630 */
2631526631 public static function sampleWhile(): WhileClass|float|null {
26316- return WhileClass::sample(); /*363:while*/
26632+ return WhileClass::sample(); /*367:while*/
2631726633 }
2631826634
2631926635 /**
@@ -26389,7 +26705,7 @@ class TopLevel {
2638926705 * @return WillSet|float|null
2639026706 */
2639126707 public static function sampleWillSet(): WillSet|float|null {
26392- return WillSet::sample(); /*364:willSet*/
26708+ return WillSet::sample(); /*368:willSet*/
2639326709 }
2639426710
2639526711 /**
@@ -26465,7 +26781,7 @@ class TopLevel {
2646526781 * @return With|float|null
2646626782 */
2646726783 public static function sampleWith(): With|float|null {
26468- return With::sample(); /*365:with*/
26784+ return With::sample(); /*369:with*/
2646926785 }
2647026786
2647126787 /**
@@ -26541,7 +26857,7 @@ class TopLevel {
2654126857 * @return XorClass|float|null
2654226858 */
2654326859 public static function sampleXor(): XorClass|float|null {
26544- return XorClass::sample(); /*366:xor*/
26860+ return XorClass::sample(); /*370:xor*/
2654526861 }
2654626862
2654726863 /**
@@ -26617,7 +26933,7 @@ class TopLevel {
2661726933 * @return XorEq|float|null
2661826934 */
2661926935 public static function sampleXorEq(): XorEq|float|null {
26620- return XorEq::sample(); /*367:xorEq*/
26936+ return XorEq::sample(); /*371:xorEq*/
2662126937 }
2662226938
2662326939 /**
@@ -26693,7 +27009,7 @@ class TopLevel {
2669327009 * @return Yes|float|null
2669427010 */
2669527011 public static function sampleYes(): Yes|float|null {
26696- return Yes::sample(); /*368:yes*/
27012+ return Yes::sample(); /*372:yes*/
2669727013 }
2669827014
2669927015 /**
@@ -26769,7 +27085,7 @@ class TopLevel {
2676927085 * @return YieldClass|float|null
2677027086 */
2677127087 public static function sampleYield(): YieldClass|float|null {
26772- return YieldClass::sample(); /*369:yield*/
27088+ return YieldClass::sample(); /*373:yield*/
2677327089 }
2677427090
2677527091 /**
@@ -26899,6 +27215,7 @@ class TopLevel {
2689927215 || TopLevel::validateFormatException($this->formatException)
2690027216 || TopLevel::validateFriend($this->friend)
2690127217 || TopLevel::validateFrom($this->from)
27218+ || TopLevel::validateFromDict($this->fromDict)
2690227219 || TopLevel::validateFromJSON($this->fromJSON)
2690327220 || TopLevel::validateFunc($this->func)
2690427221 || TopLevel::validateFunction($this->function)
@@ -26960,6 +27277,7 @@ class TopLevel {
2696027277 || TopLevel::validateLong($this->long)
2696127278 || TopLevel::validateMap($this->map)
2696227279 || TopLevel::validateMapEntry($this->mapEntry)
27280+ || TopLevel::validateMarshalJSON($this->marshalJSON)
2696327281 || TopLevel::validateMetadataPropertyHandling($this->metadataPropertyHandling)
2696427282 || TopLevel::validateModule($this->module)
2696527283 || TopLevel::validateMutable($this->mutable)
@@ -27074,6 +27392,7 @@ class TopLevel {
2707427392 || TopLevel::validateTimeOnly($this->timeOnly)
2707527393 || TopLevel::validateTimeOnlyConverter($this->timeOnlyConverter)
2707627394 || TopLevel::validateTimeZone($this->timeZone)
27395+ || TopLevel::validateToDict($this->toDict)
2707727396 || TopLevel::validateToJSON($this->toJSON)
2707827397 || TopLevel::validateTopLevel($this->topLevel)
2707927398 || TopLevel::validateToString($this->toString)
@@ -27093,6 +27412,7 @@ class TopLevel {
2709327412 || TopLevel::validateUnchecked($this->unchecked)
2709427413 || TopLevel::validateUndefined($this->undefined)
2709527414 || TopLevel::validateUnion($this->union)
27415+ || TopLevel::validateUnmarshalJSON($this->unmarshalJSON)
2709627416 || TopLevel::validateUnowned($this->unowned)
2709727417 || TopLevel::validateUnsafe($this->unsafe)
2709827418 || TopLevel::validateUnsigned($this->unsigned)
@@ -27208,7 +27528,7 @@ class TopLevel {
2720827528 $out->{'del'} = $this->toDel();
2720927529 $out->{'delegate'} = $this->toDelegate();
2721027530 $out->{'delete'} = $this->toDelete();
27211- $out->{'dict'} = $this->toDict();
27531+ $out->{'dict'} = $this->purpleToDict();
2721227532 $out->{'dictionary'} = $this->toDictionary();
2721327533 $out->{'didSet'} = $this->toDidSet();
2721427534 $out->{'do'} = $this->toDo();
@@ -27246,6 +27566,7 @@ class TopLevel {
2724627566 $out->{'FormatException'} = $this->toFormatException();
2724727567 $out->{'friend'} = $this->toFriend();
2724827568 $out->{'from'} = $this->toFrom();
27569+ $out->{'from_dict'} = $this->toFromDict();
2724927570 $out->{'from_json'} = $this->toFromJSON();
2725027571 $out->{'func'} = $this->toFunc();
2725127572 $out->{'function'} = $this->toFunction();
@@ -27307,6 +27628,7 @@ class TopLevel {
2730727628 $out->{'long'} = $this->toLong();
2730827629 $out->{'map'} = $this->toMap();
2730927630 $out->{'MapEntry'} = $this->toMapEntry();
27631+ $out->{'MarshalJSON'} = $this->toMarshalJSON();
2731027632 $out->{'metadata_property_handling'} = $this->toMetadataPropertyHandling();
2731127633 $out->{'module'} = $this->toModule();
2731227634 $out->{'mutable'} = $this->toMutable();
@@ -27421,6 +27743,7 @@ class TopLevel {
2742127743 $out->{'TimeOnly'} = $this->toTimeOnly();
2742227744 $out->{'TimeOnlyConverter'} = $this->toTimeOnlyConverter();
2742327745 $out->{'TimeZone'} = $this->toTimeZone();
27746+ $out->{'to_dict'} = $this->toToDict();
2742427747 $out->{'to_json'} = $this->toToJSON();
2742527748 $out->{'top_level'} = $this->toTopLevel();
2742627749 $out->{'toString'} = $this->toToString();
@@ -27440,6 +27763,7 @@ class TopLevel {
2744027763 $out->{'unchecked'} = $this->toUnchecked();
2744127764 $out->{'undefined'} = $this->toUndefined();
2744227765 $out->{'union'} = $this->toUnion();
27766+ $out->{'UnmarshalJSON'} = $this->toUnmarshalJSON();
2744327767 $out->{'unowned'} = $this->toUnowned();
2744427768 $out->{'unsafe'} = $this->toUnsafe();
2744527769 $out->{'unsigned'} = $this->toUnsigned();
@@ -27557,7 +27881,7 @@ class TopLevel {
2755727881 ,TopLevel::fromDel($obj->{'del'})
2755827882 ,TopLevel::fromDelegate($obj->{'delegate'})
2755927883 ,TopLevel::fromDelete($obj->{'delete'})
27560- ,TopLevel::fromDict($obj->{'dict'})
27884+ ,TopLevel::purpleFromDict($obj->{'dict'})
2756127885 ,TopLevel::fromDictionary($obj->{'dictionary'})
2756227886 ,TopLevel::fromDidSet($obj->{'didSet'})
2756327887 ,TopLevel::fromDo($obj->{'do'})
@@ -27595,6 +27919,7 @@ class TopLevel {
2759527919 ,TopLevel::fromFormatException($obj->{'FormatException'})
2759627920 ,TopLevel::fromFriend($obj->{'friend'})
2759727921 ,TopLevel::fromFrom($obj->{'from'})
27922+ ,TopLevel::fromFromDict($obj->{'from_dict'})
2759827923 ,TopLevel::fromFromJSON($obj->{'from_json'})
2759927924 ,TopLevel::fromFunc($obj->{'func'})
2760027925 ,TopLevel::fromFunction($obj->{'function'})
@@ -27656,6 +27981,7 @@ class TopLevel {
2765627981 ,TopLevel::fromLong($obj->{'long'})
2765727982 ,TopLevel::fromMap($obj->{'map'})
2765827983 ,TopLevel::fromMapEntry($obj->{'MapEntry'})
27984+ ,TopLevel::fromMarshalJSON($obj->{'MarshalJSON'})
2765927985 ,TopLevel::fromMetadataPropertyHandling($obj->{'metadata_property_handling'})
2766027986 ,TopLevel::fromModule($obj->{'module'})
2766127987 ,TopLevel::fromMutable($obj->{'mutable'})
@@ -27770,6 +28096,7 @@ class TopLevel {
2777028096 ,TopLevel::fromTimeOnly($obj->{'TimeOnly'})
2777128097 ,TopLevel::fromTimeOnlyConverter($obj->{'TimeOnlyConverter'})
2777228098 ,TopLevel::fromTimeZone($obj->{'TimeZone'})
28099+ ,TopLevel::fromToDict($obj->{'to_dict'})
2777328100 ,TopLevel::fromToJSON($obj->{'to_json'})
2777428101 ,TopLevel::fromTopLevel($obj->{'top_level'})
2777528102 ,TopLevel::fromToString($obj->{'toString'})
@@ -27789,6 +28116,7 @@ class TopLevel {
2778928116 ,TopLevel::fromUnchecked($obj->{'unchecked'})
2779028117 ,TopLevel::fromUndefined($obj->{'undefined'})
2779128118 ,TopLevel::fromUnion($obj->{'union'})
28119+ ,TopLevel::fromUnmarshalJSON($obj->{'UnmarshalJSON'})
2779228120 ,TopLevel::fromUnowned($obj->{'unowned'})
2779328121 ,TopLevel::fromUnsafe($obj->{'unsafe'})
2779428122 ,TopLevel::fromUnsigned($obj->{'unsigned'})
@@ -27942,6 +28270,7 @@ class TopLevel {
2794228270 ,TopLevel::sampleFormatException()
2794328271 ,TopLevel::sampleFriend()
2794428272 ,TopLevel::sampleFrom()
28273+ ,TopLevel::sampleFromDict()
2794528274 ,TopLevel::sampleFromJSON()
2794628275 ,TopLevel::sampleFunc()
2794728276 ,TopLevel::sampleFunction()
@@ -28003,6 +28332,7 @@ class TopLevel {
2800328332 ,TopLevel::sampleLong()
2800428333 ,TopLevel::sampleMap()
2800528334 ,TopLevel::sampleMapEntry()
28335+ ,TopLevel::sampleMarshalJSON()
2800628336 ,TopLevel::sampleMetadataPropertyHandling()
2800728337 ,TopLevel::sampleModule()
2800828338 ,TopLevel::sampleMutable()
@@ -28117,6 +28447,7 @@ class TopLevel {
2811728447 ,TopLevel::sampleTimeOnly()
2811828448 ,TopLevel::sampleTimeOnlyConverter()
2811928449 ,TopLevel::sampleTimeZone()
28450+ ,TopLevel::sampleToDict()
2812028451 ,TopLevel::sampleToJSON()
2812128452 ,TopLevel::sampleTopLevel()
2812228453 ,TopLevel::sampleToString()
@@ -28136,6 +28467,7 @@ class TopLevel {
2813628467 ,TopLevel::sampleUnchecked()
2813728468 ,TopLevel::sampleUndefined()
2813828469 ,TopLevel::sampleUnion()
28470+ ,TopLevel::sampleUnmarshalJSON()
2813928471 ,TopLevel::sampleUnowned()
2814028472 ,TopLevel::sampleUnsafe()
2814128473 ,TopLevel::sampleUnsigned()
@@ -33338,6 +33670,51 @@ class From {
3333833670 }
3333933671 }
3334033672
33673+// This is an autogenerated file:FromDict
33674+
33675+class FromDict {
33676+
33677+ /**
33678+ */
33679+ public function __construct() {
33680+ }
33681+
33682+ /**
33683+ * @throws Exception
33684+ * @return bool
33685+ */
33686+ public function validate(): bool {
33687+ return true;
33688+ }
33689+
33690+ /**
33691+ * @return stdClass
33692+ * @throws Exception
33693+ */
33694+ public function to(): stdClass {
33695+ $out = new stdClass();
33696+ return $out;
33697+ }
33698+
33699+ /**
33700+ * @param stdClass $obj
33701+ * @return FromDict
33702+ * @throws Exception
33703+ */
33704+ public static function from(stdClass $obj): FromDict {
33705+ return new FromDict(
33706+ );
33707+ }
33708+
33709+ /**
33710+ * @return FromDict
33711+ */
33712+ public static function sample(): FromDict {
33713+ return new FromDict(
33714+ );
33715+ }
33716+}
33717+
3334133718 // This is an autogenerated file:FromJSON
3334233719
3334333720 class FromJSON {
@@ -36128,6 +36505,51 @@ class MapEntry {
3612836505 }
3612936506 }
3613036507
36508+// This is an autogenerated file:MarshalJSON
36509+
36510+class MarshalJSON {
36511+
36512+ /**
36513+ */
36514+ public function __construct() {
36515+ }
36516+
36517+ /**
36518+ * @throws Exception
36519+ * @return bool
36520+ */
36521+ public function validate(): bool {
36522+ return true;
36523+ }
36524+
36525+ /**
36526+ * @return stdClass
36527+ * @throws Exception
36528+ */
36529+ public function to(): stdClass {
36530+ $out = new stdClass();
36531+ return $out;
36532+ }
36533+
36534+ /**
36535+ * @param stdClass $obj
36536+ * @return MarshalJSON
36537+ * @throws Exception
36538+ */
36539+ public static function from(stdClass $obj): MarshalJSON {
36540+ return new MarshalJSON(
36541+ );
36542+ }
36543+
36544+ /**
36545+ * @return MarshalJSON
36546+ */
36547+ public static function sample(): MarshalJSON {
36548+ return new MarshalJSON(
36549+ );
36550+ }
36551+}
36552+
3613136553 // This is an autogenerated file:MetadataPropertyHandling
3613236554
3613336555 class MetadataPropertyHandling {
@@ -41078,6 +41500,51 @@ class TimeZone {
4107841500 }
4107941501 }
4108041502
41503+// This is an autogenerated file:ToDict
41504+
41505+class ToDict {
41506+
41507+ /**
41508+ */
41509+ public function __construct() {
41510+ }
41511+
41512+ /**
41513+ * @throws Exception
41514+ * @return bool
41515+ */
41516+ public function validate(): bool {
41517+ return true;
41518+ }
41519+
41520+ /**
41521+ * @return stdClass
41522+ * @throws Exception
41523+ */
41524+ public function to(): stdClass {
41525+ $out = new stdClass();
41526+ return $out;
41527+ }
41528+
41529+ /**
41530+ * @param stdClass $obj
41531+ * @return ToDict
41532+ * @throws Exception
41533+ */
41534+ public static function from(stdClass $obj): ToDict {
41535+ return new ToDict(
41536+ );
41537+ }
41538+
41539+ /**
41540+ * @return ToDict
41541+ */
41542+ public static function sample(): ToDict {
41543+ return new ToDict(
41544+ );
41545+ }
41546+}
41547+
4108141548 // This is an autogenerated file:ToJSON
4108241549
4108341550 class ToJSON {
@@ -42338,6 +42805,51 @@ class UnionClass {
4233842805 }
4233942806 }
4234042807
42808+// This is an autogenerated file:UnmarshalJSON
42809+
42810+class UnmarshalJSON {
42811+
42812+ /**
42813+ */
42814+ public function __construct() {
42815+ }
42816+
42817+ /**
42818+ * @throws Exception
42819+ * @return bool
42820+ */
42821+ public function validate(): bool {
42822+ return true;
42823+ }
42824+
42825+ /**
42826+ * @return stdClass
42827+ * @throws Exception
42828+ */
42829+ public function to(): stdClass {
42830+ $out = new stdClass();
42831+ return $out;
42832+ }
42833+
42834+ /**
42835+ * @param stdClass $obj
42836+ * @return UnmarshalJSON
42837+ * @throws Exception
42838+ */
42839+ public static function from(stdClass $obj): UnmarshalJSON {
42840+ return new UnmarshalJSON(
42841+ );
42842+ }
42843+
42844+ /**
42845+ * @return UnmarshalJSON
42846+ */
42847+ public static function sample(): UnmarshalJSON {
42848+ return new UnmarshalJSON(
42849+ );
42850+ }
42851+}
42852+
4234142853 // This is an autogenerated file:Unowned
4234242854
4234342855 class Unowned {
Mschema-pikedefault / TopLevel.pmod+104 −0
@@ -135,6 +135,7 @@ class TopLevel {
135135 UnionFormatException format_exception; // json: "FormatException"
136136 UnionFriend friend; // json: "friend"
137137 UnionFrom from; // json: "from"
138+ UnionFromDict from_dict; // json: "from_dict"
138139 UnionFromJson from_json; // json: "from_json"
139140 UnionFunc func; // json: "func"
140141 UnionFunction top_level_function; // json: "function"
@@ -196,6 +197,7 @@ class TopLevel {
196197 UnionLong long; // json: "long"
197198 UnionMap map; // json: "map"
198199 UnionMapEntry map_entry; // json: "MapEntry"
200+ UnionMarshalJson marshal_json; // json: "MarshalJSON"
199201 UnionMetadataPropertyHandling metadata_property_handling; // json: "metadata_property_handling"
200202 UnionModule module; // json: "module"
201203 UnionMutable mutable; // json: "mutable"
@@ -310,6 +312,7 @@ class TopLevel {
310312 UnionTimeOnly time_only; // json: "TimeOnly"
311313 UnionTimeOnlyConverter time_only_converter; // json: "TimeOnlyConverter"
312314 UnionTimeZone time_zone; // json: "TimeZone"
315+ UnionToDict to_dict; // json: "to_dict"
313316 UnionToJson to_json; // json: "to_json"
314317 UnionTopLevel top_level; // json: "top_level"
315318 UnionToString to_string; // json: "toString"
@@ -329,6 +332,7 @@ class TopLevel {
329332 UnionUnchecked unchecked; // json: "unchecked"
330333 UnionUndefined undefined; // json: "undefined"
331334 UnionUnionUnion union; // json: "union"
335+ UnionUnmarshalJson unmarshal_json; // json: "UnmarshalJSON"
332336 UnionUnowned unowned; // json: "unowned"
333337 UnionUnsafe unsafe; // json: "unsafe"
334338 UnionUnsigned unsigned; // json: "unsigned"
@@ -477,6 +481,7 @@ class TopLevel {
477481 "FormatException" : format_exception,
478482 "friend" : friend,
479483 "from" : from,
484+ "from_dict" : from_dict,
480485 "from_json" : from_json,
481486 "func" : func,
482487 "function" : top_level_function,
@@ -538,6 +543,7 @@ class TopLevel {
538543 "long" : long,
539544 "map" : map,
540545 "MapEntry" : map_entry,
546+ "MarshalJSON" : marshal_json,
541547 "metadata_property_handling" : metadata_property_handling,
542548 "module" : module,
543549 "mutable" : mutable,
@@ -652,6 +658,7 @@ class TopLevel {
652658 "TimeOnly" : time_only,
653659 "TimeOnlyConverter" : time_only_converter,
654660 "TimeZone" : time_zone,
661+ "to_dict" : to_dict,
655662 "to_json" : to_json,
656663 "top_level" : top_level,
657664 "toString" : to_string,
@@ -671,6 +678,7 @@ class TopLevel {
671678 "unchecked" : unchecked,
672679 "undefined" : undefined,
673680 "union" : union,
681+ "UnmarshalJSON" : unmarshal_json,
674682 "unowned" : unowned,
675683 "unsafe" : unsafe,
676684 "unsigned" : unsigned,
@@ -946,6 +954,8 @@ TopLevel TopLevel_from_JSON(mixed json) {
946954 retval.friend = json["friend"];
947955 if (arrayp(json["from"])) error("Unexpected array");
948956 retval.from = json["from"];
957+ if (arrayp(json["from_dict"])) error("Unexpected array");
958+ retval.from_dict = json["from_dict"];
949959 if (arrayp(json["from_json"])) error("Unexpected array");
950960 retval.from_json = json["from_json"];
951961 if (arrayp(json["func"])) error("Unexpected array");
@@ -1068,6 +1078,8 @@ TopLevel TopLevel_from_JSON(mixed json) {
10681078 retval.map = json["map"];
10691079 if (arrayp(json["MapEntry"])) error("Unexpected array");
10701080 retval.map_entry = json["MapEntry"];
1081+ if (arrayp(json["MarshalJSON"])) error("Unexpected array");
1082+ retval.marshal_json = json["MarshalJSON"];
10711083 if (arrayp(json["metadata_property_handling"])) error("Unexpected array");
10721084 retval.metadata_property_handling = json["metadata_property_handling"];
10731085 if (arrayp(json["module"])) error("Unexpected array");
@@ -1296,6 +1308,8 @@ TopLevel TopLevel_from_JSON(mixed json) {
12961308 retval.time_only_converter = json["TimeOnlyConverter"];
12971309 if (arrayp(json["TimeZone"])) error("Unexpected array");
12981310 retval.time_zone = json["TimeZone"];
1311+ if (arrayp(json["to_dict"])) error("Unexpected array");
1312+ retval.to_dict = json["to_dict"];
12991313 if (arrayp(json["to_json"])) error("Unexpected array");
13001314 retval.to_json = json["to_json"];
13011315 if (arrayp(json["top_level"])) error("Unexpected array");
@@ -1334,6 +1348,8 @@ TopLevel TopLevel_from_JSON(mixed json) {
13341348 retval.undefined = json["undefined"];
13351349 if (arrayp(json["union"])) error("Unexpected array");
13361350 retval.union = json["union"];
1351+ if (arrayp(json["UnmarshalJSON"])) error("Unexpected array");
1352+ retval.unmarshal_json = json["UnmarshalJSON"];
13371353 if (arrayp(json["unowned"])) error("Unexpected array");
13381354 retval.unowned = json["unowned"];
13391355 if (arrayp(json["unsafe"])) error("Unexpected array");
@@ -3540,6 +3556,28 @@ From From_from_JSON(mixed json) {
35403556 return retval;
35413557 }
35423558
3559+typedef float|FromDict UnionFromDict;
3560+
3561+UnionFromDict UnionFromDict_from_JSON(mixed json) {
3562+ return json;
3563+}
3564+
3565+class FromDict {
3566+
3567+ string encode_json() {
3568+ mapping(string:mixed) json = ([
3569+ ]);
3570+
3571+ return Standards.JSON.encode(json);
3572+ }
3573+}
3574+
3575+FromDict FromDict_from_JSON(mixed json) {
3576+ FromDict retval = FromDict();
3577+
3578+ return retval;
3579+}
3580+
35433581 typedef float|FromJson UnionFromJson;
35443582
35453583 UnionFromJson UnionFromJson_from_JSON(mixed json) {
@@ -4750,6 +4788,28 @@ MapEntry MapEntry_from_JSON(mixed json) {
47504788 return retval;
47514789 }
47524790
4791+typedef float|MarshalJson UnionMarshalJson;
4792+
4793+UnionMarshalJson UnionMarshalJson_from_JSON(mixed json) {
4794+ return json;
4795+}
4796+
4797+class MarshalJson {
4798+
4799+ string encode_json() {
4800+ mapping(string:mixed) json = ([
4801+ ]);
4802+
4803+ return Standards.JSON.encode(json);
4804+ }
4805+}
4806+
4807+MarshalJson MarshalJson_from_JSON(mixed json) {
4808+ MarshalJson retval = MarshalJson();
4809+
4810+ return retval;
4811+}
4812+
47534813 typedef float|MetadataPropertyHandling UnionMetadataPropertyHandling;
47544814
47554815 UnionMetadataPropertyHandling UnionMetadataPropertyHandling_from_JSON(mixed json) {
@@ -7016,6 +7076,28 @@ TimeZone TimeZone_from_JSON(mixed json) {
70167076 return retval;
70177077 }
70187078
7079+typedef float|ToDict UnionToDict;
7080+
7081+UnionToDict UnionToDict_from_JSON(mixed json) {
7082+ return json;
7083+}
7084+
7085+class ToDict {
7086+
7087+ string encode_json() {
7088+ mapping(string:mixed) json = ([
7089+ ]);
7090+
7091+ return Standards.JSON.encode(json);
7092+ }
7093+}
7094+
7095+ToDict ToDict_from_JSON(mixed json) {
7096+ ToDict retval = ToDict();
7097+
7098+ return retval;
7099+}
7100+
70197101 typedef float|ToJson UnionToJson;
70207102
70217103 UnionToJson UnionToJson_from_JSON(mixed json) {
@@ -8358,6 +8440,28 @@ Union Union_from_JSON(mixed json) {
83588440 return retval;
83598441 }
83608442
8443+typedef float|UnmarshalJson UnionUnmarshalJson;
8444+
8445+UnionUnmarshalJson UnionUnmarshalJson_from_JSON(mixed json) {
8446+ return json;
8447+}
8448+
8449+class UnmarshalJson {
8450+
8451+ string encode_json() {
8452+ mapping(string:mixed) json = ([
8453+ ]);
8454+
8455+ return Standards.JSON.encode(json);
8456+ }
8457+}
8458+
8459+UnmarshalJson UnmarshalJson_from_JSON(mixed json) {
8460+ UnmarshalJson retval = UnmarshalJson();
8461+
8462+ return retval;
8463+}
8464+
83618465 typedef float|Unowned UnionUnowned;
83628466
83638467 UnionUnowned UnionUnowned_from_JSON(mixed json) {
Mschema-pythondefault / quicktype.py+73 −1
@@ -2162,6 +2162,20 @@ class MapEntry:
21622162 return result
21632163
21642164
2165+@dataclass
2166+class MarshalJSON:
2167+ pass
2168+
2169+ @staticmethod
2170+ def from_dict(obj: Any) -> 'MarshalJSON':
2171+ assert isinstance(obj, dict)
2172+ return MarshalJSON()
2173+
2174+ def to_dict(self) -> dict:
2175+ result: dict = {}
2176+ return result
2177+
2178+
21652179 @dataclass
21662180 class MetadataPropertyHandling:
21672181 pass
@@ -3968,6 +3982,20 @@ class From:
39683982 return result
39693983
39703984
3985+@dataclass
3986+class FromDict:
3987+ pass
3988+
3989+ @staticmethod
3990+ def from_dict(obj: Any) -> 'FromDict':
3991+ assert isinstance(obj, dict)
3992+ return FromDict()
3993+
3994+ def to_dict(self) -> dict:
3995+ result: dict = {}
3996+ return result
3997+
3998+
39713999 @dataclass
39724000 class Global:
39734001 pass
@@ -4220,6 +4248,20 @@ class Self:
42204248 return result
42214249
42224250
4251+@dataclass
4252+class ToDict:
4253+ pass
4254+
4255+ @staticmethod
4256+ def from_dict(obj: Any) -> 'ToDict':
4257+ assert isinstance(obj, dict)
4258+ return ToDict()
4259+
4260+ def to_dict(self) -> dict:
4261+ result: dict = {}
4262+ return result
4263+
4264+
42234265 @dataclass
42244266 class UnionTrueTrue:
42254267 pass
@@ -4486,6 +4528,20 @@ class UnionClass:
44864528 return result
44874529
44884530
4531+@dataclass
4532+class UnmarshalJSON:
4533+ pass
4534+
4535+ @staticmethod
4536+ def from_dict(obj: Any) -> 'UnmarshalJSON':
4537+ assert isinstance(obj, dict)
4538+ return UnmarshalJSON()
4539+
4540+ def to_dict(self) -> dict:
4541+ result: dict = {}
4542+ return result
4543+
4544+
44894545 @dataclass
44904546 class Unowned:
44914547 pass
@@ -4890,6 +4946,7 @@ class TopLevel:
48904946 format_exception: float | FormatException | None = None
48914947 friend: float | Friend | None = None
48924948 top_level_from: float | From | None = None
4949+ top_level_from_dict: float | FromDict | None = None
48934950 from_json: float | FromJSON | None = None
48944951 func: float | Func | None = None
48954952 function: float | Function | None = None
@@ -4951,6 +5008,7 @@ class TopLevel:
49515008 long: float | Long | None = None
49525009 map: float | Map | None = None
49535010 map_entry: float | MapEntry | None = None
5011+ marshal_json: float | MarshalJSON | None = None
49545012 metadata_property_handling: float | MetadataPropertyHandling | None = None
49555013 module: float | Module | None = None
49565014 mutable: float | Mutable | None = None
@@ -5065,6 +5123,7 @@ class TopLevel:
50655123 time_only: float | TimeOnly | None = None
50665124 time_only_converter: float | TimeOnlyConverter | None = None
50675125 time_zone: float | TimeZone | None = None
5126+ top_level_to_dict: float | ToDict | None = None
50685127 to_json: float | ToJSON | None = None
50695128 top_level: float | TopLevelClass | None = None
50705129 to_string: float | ToString | None = None
@@ -5084,6 +5143,7 @@ class TopLevel:
50845143 unchecked: float | Unchecked | None = None
50855144 undefined: float | Undefined | None = None
50865145 union: float | UnionClass | None = None
5146+ unmarshal_json: float | UnmarshalJSON | None = None
50875147 unowned: float | Unowned | None = None
50885148 unsafe: float | Unsafe | None = None
50895149 unsigned: float | Unsigned | None = None
@@ -5233,6 +5293,7 @@ class TopLevel:
52335293 format_exception = from_union([from_float, FormatException.from_dict, from_none], obj.get("FormatException"))
52345294 friend = from_union([from_float, Friend.from_dict, from_none], obj.get("friend"))
52355295 top_level_from = from_union([from_float, From.from_dict, from_none], obj.get("from"))
5296+ top_level_from_dict = from_union([from_float, FromDict.from_dict, from_none], obj.get("from_dict"))
52365297 from_json = from_union([from_float, FromJSON.from_dict, from_none], obj.get("from_json"))
52375298 func = from_union([from_float, Func.from_dict, from_none], obj.get("func"))
52385299 function = from_union([from_float, Function.from_dict, from_none], obj.get("function"))
@@ -5294,6 +5355,7 @@ class TopLevel:
52945355 long = from_union([from_float, Long.from_dict, from_none], obj.get("long"))
52955356 map = from_union([from_float, Map.from_dict, from_none], obj.get("map"))
52965357 map_entry = from_union([from_float, MapEntry.from_dict, from_none], obj.get("MapEntry"))
5358+ marshal_json = from_union([from_float, MarshalJSON.from_dict, from_none], obj.get("MarshalJSON"))
52975359 metadata_property_handling = from_union([from_float, MetadataPropertyHandling.from_dict, from_none], obj.get("metadata_property_handling"))
52985360 module = from_union([from_float, Module.from_dict, from_none], obj.get("module"))
52995361 mutable = from_union([from_float, Mutable.from_dict, from_none], obj.get("mutable"))
@@ -5408,6 +5470,7 @@ class TopLevel:
54085470 time_only = from_union([from_float, TimeOnly.from_dict, from_none], obj.get("TimeOnly"))
54095471 time_only_converter = from_union([from_float, TimeOnlyConverter.from_dict, from_none], obj.get("TimeOnlyConverter"))
54105472 time_zone = from_union([from_float, TimeZone.from_dict, from_none], obj.get("TimeZone"))
5473+ top_level_to_dict = from_union([from_float, ToDict.from_dict, from_none], obj.get("to_dict"))
54115474 to_json = from_union([from_float, ToJSON.from_dict, from_none], obj.get("to_json"))
54125475 top_level = from_union([from_float, TopLevelClass.from_dict, from_none], obj.get("top_level"))
54135476 to_string = from_union([from_float, ToString.from_dict, from_none], obj.get("toString"))
@@ -5427,6 +5490,7 @@ class TopLevel:
54275490 unchecked = from_union([from_float, Unchecked.from_dict, from_none], obj.get("unchecked"))
54285491 undefined = from_union([from_float, Undefined.from_dict, from_none], obj.get("undefined"))
54295492 union = from_union([from_float, UnionClass.from_dict, from_none], obj.get("union"))
5493+ unmarshal_json = from_union([from_float, UnmarshalJSON.from_dict, from_none], obj.get("UnmarshalJSON"))
54305494 unowned = from_union([from_float, Unowned.from_dict, from_none], obj.get("unowned"))
54315495 unsafe = from_union([from_float, Unsafe.from_dict, from_none], obj.get("unsafe"))
54325496 unsigned = from_union([from_float, Unsigned.from_dict, from_none], obj.get("unsigned"))
@@ -5450,7 +5514,7 @@ class TopLevel:
54505514 xor_eq = from_union([from_float, XorEq.from_dict, from_none], obj.get("xor_eq"))
54515515 yes = from_union([from_float, Yes.from_dict, from_none], obj.get("YES"))
54525516 top_level_yield = from_union([from_float, Yield.from_dict, from_none], obj.get("yield"))
5453- return TopLevel(empty, purple_bool, complex, imaginery, abstract, alignas, alignof, top_level_and, and_eq, top_level_any, any, array, top_level_as, asm, top_level_assert, associatedtype, associativity, top_level_async, atomic, atomic_cancel, atomic_commit, atomic_noexcept, auto, top_level_await, base, bitand, bitor, top_level_bool, fluffy_bool, boolean, top_level_break, bycopy, byref, byte, calendar, case, catch, chan, char, char16_t, char32_t, checked, purple_class, top_level_class, clone, co_await, co_return, co_yield, codable, coding_key, coding_keys, compl, concept, console, const, const_cast, constexpr, constructor, top_level_continue, convenience, convert, converter, culture_info, date, date_parse_handling, date_formatter, date_only, date_only_converter, date_time, date_time_styles, debugger, decimal, declare, decltype, decode_string, decoder, decoding_error, top_level_def, default, defer, deinit, top_level_del, delegate, delete, top_level_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, top_level_elif, top_level_else, encode_quick_type, encoder, enum, enum_values, equality_contract, equatable, event, top_level_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, top_level_false, false, fileprivate, final, top_level_finally, fixed, top_level_float, top_level_for, foreach, format_exception, friend, top_level_from, from_json, func, function, get, top_level_global, go, goto, guard, hashable, hash_code, hasher, has_own_property, id, top_level_if, imp, implements, implicit, top_level_import, top_level_in, indirect, infix, init, inline, inout, instanceof, top_level_int, interface, internal, top_level_is, iso_date_time_offset_converter, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, json_any, json_coding_key, json_decoder, json_encoder, json_exception, json_generator, json_node, json_null, json_parser, json_reader, json_token_type, k_serializer, top_level_lambda, lazy, left, let, list, locale, lock, long, map, map_entry, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil, no, noexcept, nonatomic, top_level_none, none, top_level_nonlocal, nonmutating, no_such_method, top_level_not, not_eq, ns_error, ns_object, ns_string, null, top_level_null, nullptr, number, object, object_mapper, of, oneway, open, operator, optional, top_level_or, or_eq, out, override, package, params, top_level_pass, port, postfix, precedence, prefix, primitive_kind, top_level_print, printf, print_members, private, protected, protocol, top_level_protocol, public, quicktype, top_level_raise, range, readonly, ref, reg_exp, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, top_level_return, right, runtime_type, s, sbyte, sealed, sel, select, top_level_self, purple_self, sendable, serial_descriptor, serializable, serialize, serializer_provider, serial_name, set, short, signed, simple_module, sizeof, stackalloc, standards, static, static_assert, static_cast, std_deserializer, std_serializer, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, time_only, time_only_converter, time_zone, to_json, top_level, to_string, transient, true, top_level_true, top_level_try, type, top_level_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unowned, unsafe, unsigned, use_serializers, ushort, using, utf8_json_reader, utf8_json_writer, uuid, var, virtual, void, volatile, wchar_t, weak, where, top_level_while, will_set, top_level_with, xor, xor_eq, yes, top_level_yield)
5517+ return TopLevel(empty, purple_bool, complex, imaginery, abstract, alignas, alignof, top_level_and, and_eq, top_level_any, any, array, top_level_as, asm, top_level_assert, associatedtype, associativity, top_level_async, atomic, atomic_cancel, atomic_commit, atomic_noexcept, auto, top_level_await, base, bitand, bitor, top_level_bool, fluffy_bool, boolean, top_level_break, bycopy, byref, byte, calendar, case, catch, chan, char, char16_t, char32_t, checked, purple_class, top_level_class, clone, co_await, co_return, co_yield, codable, coding_key, coding_keys, compl, concept, console, const, const_cast, constexpr, constructor, top_level_continue, convenience, convert, converter, culture_info, date, date_parse_handling, date_formatter, date_only, date_only_converter, date_time, date_time_styles, debugger, decimal, declare, decltype, decode_string, decoder, decoding_error, top_level_def, default, defer, deinit, top_level_del, delegate, delete, top_level_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, top_level_elif, top_level_else, encode_quick_type, encoder, enum, enum_values, equality_contract, equatable, event, top_level_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, top_level_false, false, fileprivate, final, top_level_finally, fixed, top_level_float, top_level_for, foreach, format_exception, friend, top_level_from, top_level_from_dict, from_json, func, function, get, top_level_global, go, goto, guard, hashable, hash_code, hasher, has_own_property, id, top_level_if, imp, implements, implicit, top_level_import, top_level_in, indirect, infix, init, inline, inout, instanceof, top_level_int, interface, internal, top_level_is, iso_date_time_offset_converter, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, json_any, json_coding_key, json_decoder, json_encoder, json_exception, json_generator, json_node, json_null, json_parser, json_reader, json_token_type, k_serializer, top_level_lambda, lazy, left, let, list, locale, lock, long, map, map_entry, marshal_json, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil, no, noexcept, nonatomic, top_level_none, none, top_level_nonlocal, nonmutating, no_such_method, top_level_not, not_eq, ns_error, ns_object, ns_string, null, top_level_null, nullptr, number, object, object_mapper, of, oneway, open, operator, optional, top_level_or, or_eq, out, override, package, params, top_level_pass, port, postfix, precedence, prefix, primitive_kind, top_level_print, printf, print_members, private, protected, protocol, top_level_protocol, public, quicktype, top_level_raise, range, readonly, ref, reg_exp, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, top_level_return, right, runtime_type, s, sbyte, sealed, sel, select, top_level_self, purple_self, sendable, serial_descriptor, serializable, serialize, serializer_provider, serial_name, set, short, signed, simple_module, sizeof, stackalloc, standards, static, static_assert, static_cast, std_deserializer, std_serializer, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, time_only, time_only_converter, time_zone, top_level_to_dict, to_json, top_level, to_string, transient, true, top_level_true, top_level_try, type, top_level_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unmarshal_json, unowned, unsafe, unsigned, use_serializers, ushort, using, utf8_json_reader, utf8_json_writer, uuid, var, virtual, void, volatile, wchar_t, weak, where, top_level_while, will_set, top_level_with, xor, xor_eq, yes, top_level_yield)
54545518
54555519 def to_dict(self) -> dict:
54565520 result: dict = {}
@@ -5698,6 +5762,8 @@ class TopLevel:
56985762 result["friend"] = from_union([to_float, lambda x: to_class(Friend, x), from_none], self.friend)
56995763 if self.top_level_from is not None:
57005764 result["from"] = from_union([to_float, lambda x: to_class(From, x), from_none], self.top_level_from)
5765+ if self.top_level_from_dict is not None:
5766+ result["from_dict"] = from_union([to_float, lambda x: to_class(FromDict, x), from_none], self.top_level_from_dict)
57015767 if self.from_json is not None:
57025768 result["from_json"] = from_union([to_float, lambda x: to_class(FromJSON, x), from_none], self.from_json)
57035769 if self.func is not None:
@@ -5820,6 +5886,8 @@ class TopLevel:
58205886 result["map"] = from_union([to_float, lambda x: to_class(Map, x), from_none], self.map)
58215887 if self.map_entry is not None:
58225888 result["MapEntry"] = from_union([to_float, lambda x: to_class(MapEntry, x), from_none], self.map_entry)
5889+ if self.marshal_json is not None:
5890+ result["MarshalJSON"] = from_union([to_float, lambda x: to_class(MarshalJSON, x), from_none], self.marshal_json)
58235891 if self.metadata_property_handling is not None:
58245892 result["metadata_property_handling"] = from_union([to_float, lambda x: to_class(MetadataPropertyHandling, x), from_none], self.metadata_property_handling)
58255893 if self.module is not None:
@@ -6048,6 +6116,8 @@ class TopLevel:
60486116 result["TimeOnlyConverter"] = from_union([to_float, lambda x: to_class(TimeOnlyConverter, x), from_none], self.time_only_converter)
60496117 if self.time_zone is not None:
60506118 result["TimeZone"] = from_union([to_float, lambda x: to_class(TimeZone, x), from_none], self.time_zone)
6119+ if self.top_level_to_dict is not None:
6120+ result["to_dict"] = from_union([to_float, lambda x: to_class(ToDict, x), from_none], self.top_level_to_dict)
60516121 if self.to_json is not None:
60526122 result["to_json"] = from_union([to_float, lambda x: to_class(ToJSON, x), from_none], self.to_json)
60536123 if self.top_level is not None:
@@ -6086,6 +6156,8 @@ class TopLevel:
60866156 result["undefined"] = from_union([to_float, lambda x: to_class(Undefined, x), from_none], self.undefined)
60876157 if self.union is not None:
60886158 result["union"] = from_union([to_float, lambda x: to_class(UnionClass, x), from_none], self.union)
6159+ if self.unmarshal_json is not None:
6160+ result["UnmarshalJSON"] = from_union([to_float, lambda x: to_class(UnmarshalJSON, x), from_none], self.unmarshal_json)
60896161 if self.unowned is not None:
60906162 result["unowned"] = from_union([to_float, lambda x: to_class(Unowned, x), from_none], self.unowned)
60916163 if self.unsafe is not None:
Mschema-ruby-syntaxdefault / TopLevel.rb+240 −0
@@ -5947,6 +5947,63 @@ class UnionFrom < Dry::Struct
59475947 end
59485948 end
59495949
5950+class FromDict < Dry::Struct
5951+
5952+ def self.from_dynamic!(d)
5953+ d = Types::Hash[d]
5954+ new(
5955+ )
5956+ end
5957+
5958+ def self.from_json!(json)
5959+ from_dynamic!(JSON.parse(json))
5960+ end
5961+
5962+ def to_dynamic
5963+ {
5964+ }
5965+ end
5966+
5967+ def to_json(options = nil)
5968+ JSON.generate(to_dynamic, options)
5969+ end
5970+end
5971+
5972+class UnionFromDict < Dry::Struct
5973+ attribute :double, Types::Double.optional
5974+ attribute :from_dict, FromDict.optional
5975+
5976+ def self.from_dynamic!(d)
5977+ if schema.key(:double).type.right.valid? d
5978+ return new(double: d, from_dict: nil)
5979+ end
5980+ begin
5981+ value = FromDict.from_dynamic!(d)
5982+ if schema.key(:from_dict).type.right.valid? value
5983+ return new(from_dict: value, double: nil)
5984+ end
5985+ rescue
5986+ end
5987+ raise "Invalid union"
5988+ end
5989+
5990+ def self.from_json!(json)
5991+ from_dynamic!(JSON.parse(json))
5992+ end
5993+
5994+ def to_dynamic
5995+ if double != nil
5996+ double
5997+ elsif from_dict != nil
5998+ from_dict.to_dynamic
5999+ end
6000+ end
6001+
6002+ def to_json(options = nil)
6003+ JSON.generate(to_dynamic, options)
6004+ end
6005+end
6006+
59506007 class FromJSON < Dry::Struct
59516008
59526009 def self.from_dynamic!(d)
@@ -9310,6 +9367,63 @@ class UnionMapEntry < Dry::Struct
93109367 end
93119368 end
93129369
9370+class MarshalJSON < Dry::Struct
9371+
9372+ def self.from_dynamic!(d)
9373+ d = Types::Hash[d]
9374+ new(
9375+ )
9376+ end
9377+
9378+ def self.from_json!(json)
9379+ from_dynamic!(JSON.parse(json))
9380+ end
9381+
9382+ def to_dynamic
9383+ {
9384+ }
9385+ end
9386+
9387+ def to_json(options = nil)
9388+ JSON.generate(to_dynamic, options)
9389+ end
9390+end
9391+
9392+class UnionMarshalJSON < Dry::Struct
9393+ attribute :double, Types::Double.optional
9394+ attribute :marshal_json, MarshalJSON.optional
9395+
9396+ def self.from_dynamic!(d)
9397+ if schema.key(:double).type.right.valid? d
9398+ return new(double: d, marshal_json: nil)
9399+ end
9400+ begin
9401+ value = MarshalJSON.from_dynamic!(d)
9402+ if schema.key(:marshal_json).type.right.valid? value
9403+ return new(marshal_json: value, double: nil)
9404+ end
9405+ rescue
9406+ end
9407+ raise "Invalid union"
9408+ end
9409+
9410+ def self.from_json!(json)
9411+ from_dynamic!(JSON.parse(json))
9412+ end
9413+
9414+ def to_dynamic
9415+ if double != nil
9416+ double
9417+ elsif marshal_json != nil
9418+ marshal_json.to_dynamic
9419+ end
9420+ end
9421+
9422+ def to_json(options = nil)
9423+ JSON.generate(to_dynamic, options)
9424+ end
9425+end
9426+
93139427 class MetadataPropertyHandling < Dry::Struct
93149428
93159429 def self.from_dynamic!(d)
@@ -14611,6 +14725,63 @@ class UnionTimeZone < Dry::Struct
1461114725 end
1461214726 end
1461314727
14728+class ToDict < Dry::Struct
14729+
14730+ def self.from_dynamic!(d)
14731+ d = Types::Hash[d]
14732+ new(
14733+ )
14734+ end
14735+
14736+ def self.from_json!(json)
14737+ from_dynamic!(JSON.parse(json))
14738+ end
14739+
14740+ def to_dynamic
14741+ {
14742+ }
14743+ end
14744+
14745+ def to_json(options = nil)
14746+ JSON.generate(to_dynamic, options)
14747+ end
14748+end
14749+
14750+class UnionToDict < Dry::Struct
14751+ attribute :double, Types::Double.optional
14752+ attribute :to_dict, ToDict.optional
14753+
14754+ def self.from_dynamic!(d)
14755+ if schema.key(:double).type.right.valid? d
14756+ return new(double: d, to_dict: nil)
14757+ end
14758+ begin
14759+ value = ToDict.from_dynamic!(d)
14760+ if schema.key(:to_dict).type.right.valid? value
14761+ return new(to_dict: value, double: nil)
14762+ end
14763+ rescue
14764+ end
14765+ raise "Invalid union"
14766+ end
14767+
14768+ def self.from_json!(json)
14769+ from_dynamic!(JSON.parse(json))
14770+ end
14771+
14772+ def to_dynamic
14773+ if double != nil
14774+ double
14775+ elsif to_dict != nil
14776+ to_dict.to_dynamic
14777+ end
14778+ end
14779+
14780+ def to_json(options = nil)
14781+ JSON.generate(to_dynamic, options)
14782+ end
14783+end
14784+
1461414785 class ToString < Dry::Struct
1461514786
1461614787 def self.from_dynamic!(d)
@@ -18145,6 +18316,63 @@ class UnionUnionUnion < Dry::Struct
1814518316 end
1814618317 end
1814718318
18319+class UnmarshalJSON < Dry::Struct
18320+
18321+ def self.from_dynamic!(d)
18322+ d = Types::Hash[d]
18323+ new(
18324+ )
18325+ end
18326+
18327+ def self.from_json!(json)
18328+ from_dynamic!(JSON.parse(json))
18329+ end
18330+
18331+ def to_dynamic
18332+ {
18333+ }
18334+ end
18335+
18336+ def to_json(options = nil)
18337+ JSON.generate(to_dynamic, options)
18338+ end
18339+end
18340+
18341+class UnionUnmarshalJSON < Dry::Struct
18342+ attribute :double, Types::Double.optional
18343+ attribute :unmarshal_json, UnmarshalJSON.optional
18344+
18345+ def self.from_dynamic!(d)
18346+ if schema.key(:double).type.right.valid? d
18347+ return new(double: d, unmarshal_json: nil)
18348+ end
18349+ begin
18350+ value = UnmarshalJSON.from_dynamic!(d)
18351+ if schema.key(:unmarshal_json).type.right.valid? value
18352+ return new(unmarshal_json: value, double: nil)
18353+ end
18354+ rescue
18355+ end
18356+ raise "Invalid union"
18357+ end
18358+
18359+ def self.from_json!(json)
18360+ from_dynamic!(JSON.parse(json))
18361+ end
18362+
18363+ def to_dynamic
18364+ if double != nil
18365+ double
18366+ elsif unmarshal_json != nil
18367+ unmarshal_json.to_dynamic
18368+ end
18369+ end
18370+
18371+ def to_json(options = nil)
18372+ JSON.generate(to_dynamic, options)
18373+ end
18374+end
18375+
1814818376 class Unowned < Dry::Struct
1814918377
1815018378 def self.from_dynamic!(d)
@@ -19408,6 +19636,7 @@ class TopLevel < Dry::Struct
1940819636 attribute :format_exception, Types.Instance(UnionFormatException).optional
1940919637 attribute :friend, Types.Instance(UnionFriend).optional
1941019638 attribute :from, Types.Instance(UnionFrom).optional
19639+ attribute :from_dict, Types.Instance(UnionFromDict).optional
1941119640 attribute :from_json, Types.Instance(UnionFromJSON).optional
1941219641 attribute :func, Types.Instance(UnionFunc).optional
1941319642 attribute :function, Types.Instance(UnionFunction).optional
@@ -19469,6 +19698,7 @@ class TopLevel < Dry::Struct
1946919698 attribute :long, Types.Instance(UnionLong).optional
1947019699 attribute :map, Types.Instance(UnionMap).optional
1947119700 attribute :map_entry, Types.Instance(UnionMapEntry).optional
19701+ attribute :marshal_json, Types.Instance(UnionMarshalJSON).optional
1947219702 attribute :metadata_property_handling, Types.Instance(UnionMetadataPropertyHandling).optional
1947319703 attribute :top_level_module, Types.Instance(UnionModule).optional
1947419704 attribute :mutable, Types.Instance(UnionMutable).optional
@@ -19583,6 +19813,7 @@ class TopLevel < Dry::Struct
1958319813 attribute :time_only, Types.Instance(UnionTimeOnly).optional
1958419814 attribute :time_only_converter, Types.Instance(UnionTimeOnlyConverter).optional
1958519815 attribute :time_zone, Types.Instance(UnionTimeZone).optional
19816+ attribute :to_dict, Types.Instance(UnionToDict).optional
1958619817 attribute :top_level_to_json, Types.Instance(UnionToJSON).optional
1958719818 attribute :top_level, Types.Instance(UnionTopLevel).optional
1958819819 attribute :to_string, Types.Instance(UnionToString).optional
@@ -19602,6 +19833,7 @@ class TopLevel < Dry::Struct
1960219833 attribute :unchecked, Types.Instance(UnionUnchecked).optional
1960319834 attribute :undefined, Types.Instance(UnionUndefined).optional
1960419835 attribute :union, Types.Instance(UnionUnionUnion).optional
19836+ attribute :unmarshal_json, Types.Instance(UnionUnmarshalJSON).optional
1960519837 attribute :unowned, Types.Instance(UnionUnowned).optional
1960619838 attribute :unsafe, Types.Instance(UnionUnsafe).optional
1960719839 attribute :unsigned, Types.Instance(UnionUnsigned).optional
@@ -19751,6 +19983,7 @@ class TopLevel < Dry::Struct
1975119983 format_exception: d.key?("FormatException") ? UnionFormatException.from_dynamic!(d["FormatException"]) : nil,
1975219984 friend: d.key?("friend") ? UnionFriend.from_dynamic!(d["friend"]) : nil,
1975319985 from: d.key?("from") ? UnionFrom.from_dynamic!(d["from"]) : nil,
19986+ from_dict: d.key?("from_dict") ? UnionFromDict.from_dynamic!(d["from_dict"]) : nil,
1975419987 from_json: d.key?("from_json") ? UnionFromJSON.from_dynamic!(d["from_json"]) : nil,
1975519988 func: d.key?("func") ? UnionFunc.from_dynamic!(d["func"]) : nil,
1975619989 function: d.key?("function") ? UnionFunction.from_dynamic!(d["function"]) : nil,
@@ -19812,6 +20045,7 @@ class TopLevel < Dry::Struct
1981220045 long: d.key?("long") ? UnionLong.from_dynamic!(d["long"]) : nil,
1981320046 map: d.key?("map") ? UnionMap.from_dynamic!(d["map"]) : nil,
1981420047 map_entry: d.key?("MapEntry") ? UnionMapEntry.from_dynamic!(d["MapEntry"]) : nil,
20048+ marshal_json: d.key?("MarshalJSON") ? UnionMarshalJSON.from_dynamic!(d["MarshalJSON"]) : nil,
1981520049 metadata_property_handling: d.key?("metadata_property_handling") ? UnionMetadataPropertyHandling.from_dynamic!(d["metadata_property_handling"]) : nil,
1981620050 top_level_module: d.key?("module") ? UnionModule.from_dynamic!(d["module"]) : nil,
1981720051 mutable: d.key?("mutable") ? UnionMutable.from_dynamic!(d["mutable"]) : nil,
@@ -19926,6 +20160,7 @@ class TopLevel < Dry::Struct
1992620160 time_only: d.key?("TimeOnly") ? UnionTimeOnly.from_dynamic!(d["TimeOnly"]) : nil,
1992720161 time_only_converter: d.key?("TimeOnlyConverter") ? UnionTimeOnlyConverter.from_dynamic!(d["TimeOnlyConverter"]) : nil,
1992820162 time_zone: d.key?("TimeZone") ? UnionTimeZone.from_dynamic!(d["TimeZone"]) : nil,
20163+ to_dict: d.key?("to_dict") ? UnionToDict.from_dynamic!(d["to_dict"]) : nil,
1992920164 top_level_to_json: d.key?("to_json") ? UnionToJSON.from_dynamic!(d["to_json"]) : nil,
1993020165 top_level: d.key?("top_level") ? UnionTopLevel.from_dynamic!(d["top_level"]) : nil,
1993120166 to_string: d.key?("toString") ? UnionToString.from_dynamic!(d["toString"]) : nil,
@@ -19945,6 +20180,7 @@ class TopLevel < Dry::Struct
1994520180 unchecked: d.key?("unchecked") ? UnionUnchecked.from_dynamic!(d["unchecked"]) : nil,
1994620181 undefined: d.key?("undefined") ? UnionUndefined.from_dynamic!(d["undefined"]) : nil,
1994720182 union: d.key?("union") ? UnionUnionUnion.from_dynamic!(d["union"]) : nil,
20183+ unmarshal_json: d.key?("UnmarshalJSON") ? UnionUnmarshalJSON.from_dynamic!(d["UnmarshalJSON"]) : nil,
1994820184 unowned: d.key?("unowned") ? UnionUnowned.from_dynamic!(d["unowned"]) : nil,
1994920185 unsafe: d.key?("unsafe") ? UnionUnsafe.from_dynamic!(d["unsafe"]) : nil,
1995020186 unsigned: d.key?("unsigned") ? UnionUnsigned.from_dynamic!(d["unsigned"]) : nil,
@@ -20099,6 +20335,7 @@ class TopLevel < Dry::Struct
2009920335 "FormatException" => format_exception&.to_dynamic,
2010020336 "friend" => friend&.to_dynamic,
2010120337 "from" => from&.to_dynamic,
20338+ "from_dict" => from_dict&.to_dynamic,
2010220339 "from_json" => from_json&.to_dynamic,
2010320340 "func" => func&.to_dynamic,
2010420341 "function" => function&.to_dynamic,
@@ -20160,6 +20397,7 @@ class TopLevel < Dry::Struct
2016020397 "long" => long&.to_dynamic,
2016120398 "map" => map&.to_dynamic,
2016220399 "MapEntry" => map_entry&.to_dynamic,
20400+ "MarshalJSON" => marshal_json&.to_dynamic,
2016320401 "metadata_property_handling" => metadata_property_handling&.to_dynamic,
2016420402 "module" => top_level_module&.to_dynamic,
2016520403 "mutable" => mutable&.to_dynamic,
@@ -20274,6 +20512,7 @@ class TopLevel < Dry::Struct
2027420512 "TimeOnly" => time_only&.to_dynamic,
2027520513 "TimeOnlyConverter" => time_only_converter&.to_dynamic,
2027620514 "TimeZone" => time_zone&.to_dynamic,
20515+ "to_dict" => to_dict&.to_dynamic,
2027720516 "to_json" => top_level_to_json&.to_dynamic,
2027820517 "top_level" => top_level&.to_dynamic,
2027920518 "toString" => to_string&.to_dynamic,
@@ -20293,6 +20532,7 @@ class TopLevel < Dry::Struct
2029320532 "unchecked" => unchecked&.to_dynamic,
2029420533 "undefined" => undefined&.to_dynamic,
2029520534 "union" => union&.to_dynamic,
20535+ "UnmarshalJSON" => unmarshal_json&.to_dynamic,
2029620536 "unowned" => unowned&.to_dynamic,
2029720537 "unsafe" => unsafe&.to_dynamic,
2029820538 "unsigned" => unsigned&.to_dynamic,
Mschema-rubydefault / TopLevel.rb+240 −0
@@ -5947,6 +5947,63 @@ class UnionFrom < Dry::Struct
59475947 end
59485948 end
59495949
5950+class FromDict < Dry::Struct
5951+
5952+ def self.from_dynamic!(d)
5953+ d = Types::Hash[d]
5954+ new(
5955+ )
5956+ end
5957+
5958+ def self.from_json!(json)
5959+ from_dynamic!(JSON.parse(json))
5960+ end
5961+
5962+ def to_dynamic
5963+ {
5964+ }
5965+ end
5966+
5967+ def to_json(options = nil)
5968+ JSON.generate(to_dynamic, options)
5969+ end
5970+end
5971+
5972+class UnionFromDict < Dry::Struct
5973+ attribute :double, Types::Double.optional
5974+ attribute :from_dict, FromDict.optional
5975+
5976+ def self.from_dynamic!(d)
5977+ if schema.key(:double).type.right.valid? d
5978+ return new(double: d, from_dict: nil)
5979+ end
5980+ begin
5981+ value = FromDict.from_dynamic!(d)
5982+ if schema.key(:from_dict).type.right.valid? value
5983+ return new(from_dict: value, double: nil)
5984+ end
5985+ rescue
5986+ end
5987+ raise "Invalid union"
5988+ end
5989+
5990+ def self.from_json!(json)
5991+ from_dynamic!(JSON.parse(json))
5992+ end
5993+
5994+ def to_dynamic
5995+ if double != nil
5996+ double
5997+ elsif from_dict != nil
5998+ from_dict.to_dynamic
5999+ end
6000+ end
6001+
6002+ def to_json(options = nil)
6003+ JSON.generate(to_dynamic, options)
6004+ end
6005+end
6006+
59506007 class FromJSON < Dry::Struct
59516008
59526009 def self.from_dynamic!(d)
@@ -9310,6 +9367,63 @@ class UnionMapEntry < Dry::Struct
93109367 end
93119368 end
93129369
9370+class MarshalJSON < Dry::Struct
9371+
9372+ def self.from_dynamic!(d)
9373+ d = Types::Hash[d]
9374+ new(
9375+ )
9376+ end
9377+
9378+ def self.from_json!(json)
9379+ from_dynamic!(JSON.parse(json))
9380+ end
9381+
9382+ def to_dynamic
9383+ {
9384+ }
9385+ end
9386+
9387+ def to_json(options = nil)
9388+ JSON.generate(to_dynamic, options)
9389+ end
9390+end
9391+
9392+class UnionMarshalJSON < Dry::Struct
9393+ attribute :double, Types::Double.optional
9394+ attribute :marshal_json, MarshalJSON.optional
9395+
9396+ def self.from_dynamic!(d)
9397+ if schema.key(:double).type.right.valid? d
9398+ return new(double: d, marshal_json: nil)
9399+ end
9400+ begin
9401+ value = MarshalJSON.from_dynamic!(d)
9402+ if schema.key(:marshal_json).type.right.valid? value
9403+ return new(marshal_json: value, double: nil)
9404+ end
9405+ rescue
9406+ end
9407+ raise "Invalid union"
9408+ end
9409+
9410+ def self.from_json!(json)
9411+ from_dynamic!(JSON.parse(json))
9412+ end
9413+
9414+ def to_dynamic
9415+ if double != nil
9416+ double
9417+ elsif marshal_json != nil
9418+ marshal_json.to_dynamic
9419+ end
9420+ end
9421+
9422+ def to_json(options = nil)
9423+ JSON.generate(to_dynamic, options)
9424+ end
9425+end
9426+
93139427 class MetadataPropertyHandling < Dry::Struct
93149428
93159429 def self.from_dynamic!(d)
@@ -14611,6 +14725,63 @@ class UnionTimeZone < Dry::Struct
1461114725 end
1461214726 end
1461314727
14728+class ToDict < Dry::Struct
14729+
14730+ def self.from_dynamic!(d)
14731+ d = Types::Hash[d]
14732+ new(
14733+ )
14734+ end
14735+
14736+ def self.from_json!(json)
14737+ from_dynamic!(JSON.parse(json))
14738+ end
14739+
14740+ def to_dynamic
14741+ {
14742+ }
14743+ end
14744+
14745+ def to_json(options = nil)
14746+ JSON.generate(to_dynamic, options)
14747+ end
14748+end
14749+
14750+class UnionToDict < Dry::Struct
14751+ attribute :double, Types::Double.optional
14752+ attribute :to_dict, ToDict.optional
14753+
14754+ def self.from_dynamic!(d)
14755+ if schema.key(:double).type.right.valid? d
14756+ return new(double: d, to_dict: nil)
14757+ end
14758+ begin
14759+ value = ToDict.from_dynamic!(d)
14760+ if schema.key(:to_dict).type.right.valid? value
14761+ return new(to_dict: value, double: nil)
14762+ end
14763+ rescue
14764+ end
14765+ raise "Invalid union"
14766+ end
14767+
14768+ def self.from_json!(json)
14769+ from_dynamic!(JSON.parse(json))
14770+ end
14771+
14772+ def to_dynamic
14773+ if double != nil
14774+ double
14775+ elsif to_dict != nil
14776+ to_dict.to_dynamic
14777+ end
14778+ end
14779+
14780+ def to_json(options = nil)
14781+ JSON.generate(to_dynamic, options)
14782+ end
14783+end
14784+
1461414785 class ToString < Dry::Struct
1461514786
1461614787 def self.from_dynamic!(d)
@@ -18145,6 +18316,63 @@ class UnionUnionUnion < Dry::Struct
1814518316 end
1814618317 end
1814718318
18319+class UnmarshalJSON < Dry::Struct
18320+
18321+ def self.from_dynamic!(d)
18322+ d = Types::Hash[d]
18323+ new(
18324+ )
18325+ end
18326+
18327+ def self.from_json!(json)
18328+ from_dynamic!(JSON.parse(json))
18329+ end
18330+
18331+ def to_dynamic
18332+ {
18333+ }
18334+ end
18335+
18336+ def to_json(options = nil)
18337+ JSON.generate(to_dynamic, options)
18338+ end
18339+end
18340+
18341+class UnionUnmarshalJSON < Dry::Struct
18342+ attribute :double, Types::Double.optional
18343+ attribute :unmarshal_json, UnmarshalJSON.optional
18344+
18345+ def self.from_dynamic!(d)
18346+ if schema.key(:double).type.right.valid? d
18347+ return new(double: d, unmarshal_json: nil)
18348+ end
18349+ begin
18350+ value = UnmarshalJSON.from_dynamic!(d)
18351+ if schema.key(:unmarshal_json).type.right.valid? value
18352+ return new(unmarshal_json: value, double: nil)
18353+ end
18354+ rescue
18355+ end
18356+ raise "Invalid union"
18357+ end
18358+
18359+ def self.from_json!(json)
18360+ from_dynamic!(JSON.parse(json))
18361+ end
18362+
18363+ def to_dynamic
18364+ if double != nil
18365+ double
18366+ elsif unmarshal_json != nil
18367+ unmarshal_json.to_dynamic
18368+ end
18369+ end
18370+
18371+ def to_json(options = nil)
18372+ JSON.generate(to_dynamic, options)
18373+ end
18374+end
18375+
1814818376 class Unowned < Dry::Struct
1814918377
1815018378 def self.from_dynamic!(d)
@@ -19408,6 +19636,7 @@ class TopLevel < Dry::Struct
1940819636 attribute :format_exception, Types.Instance(UnionFormatException).optional
1940919637 attribute :friend, Types.Instance(UnionFriend).optional
1941019638 attribute :from, Types.Instance(UnionFrom).optional
19639+ attribute :from_dict, Types.Instance(UnionFromDict).optional
1941119640 attribute :from_json, Types.Instance(UnionFromJSON).optional
1941219641 attribute :func, Types.Instance(UnionFunc).optional
1941319642 attribute :function, Types.Instance(UnionFunction).optional
@@ -19469,6 +19698,7 @@ class TopLevel < Dry::Struct
1946919698 attribute :long, Types.Instance(UnionLong).optional
1947019699 attribute :map, Types.Instance(UnionMap).optional
1947119700 attribute :map_entry, Types.Instance(UnionMapEntry).optional
19701+ attribute :marshal_json, Types.Instance(UnionMarshalJSON).optional
1947219702 attribute :metadata_property_handling, Types.Instance(UnionMetadataPropertyHandling).optional
1947319703 attribute :top_level_module, Types.Instance(UnionModule).optional
1947419704 attribute :mutable, Types.Instance(UnionMutable).optional
@@ -19583,6 +19813,7 @@ class TopLevel < Dry::Struct
1958319813 attribute :time_only, Types.Instance(UnionTimeOnly).optional
1958419814 attribute :time_only_converter, Types.Instance(UnionTimeOnlyConverter).optional
1958519815 attribute :time_zone, Types.Instance(UnionTimeZone).optional
19816+ attribute :to_dict, Types.Instance(UnionToDict).optional
1958619817 attribute :top_level_to_json, Types.Instance(UnionToJSON).optional
1958719818 attribute :top_level, Types.Instance(UnionTopLevel).optional
1958819819 attribute :to_string, Types.Instance(UnionToString).optional
@@ -19602,6 +19833,7 @@ class TopLevel < Dry::Struct
1960219833 attribute :unchecked, Types.Instance(UnionUnchecked).optional
1960319834 attribute :undefined, Types.Instance(UnionUndefined).optional
1960419835 attribute :union, Types.Instance(UnionUnionUnion).optional
19836+ attribute :unmarshal_json, Types.Instance(UnionUnmarshalJSON).optional
1960519837 attribute :unowned, Types.Instance(UnionUnowned).optional
1960619838 attribute :unsafe, Types.Instance(UnionUnsafe).optional
1960719839 attribute :unsigned, Types.Instance(UnionUnsigned).optional
@@ -19751,6 +19983,7 @@ class TopLevel < Dry::Struct
1975119983 format_exception: d.key?("FormatException") ? UnionFormatException.from_dynamic!(d["FormatException"]) : nil,
1975219984 friend: d.key?("friend") ? UnionFriend.from_dynamic!(d["friend"]) : nil,
1975319985 from: d.key?("from") ? UnionFrom.from_dynamic!(d["from"]) : nil,
19986+ from_dict: d.key?("from_dict") ? UnionFromDict.from_dynamic!(d["from_dict"]) : nil,
1975419987 from_json: d.key?("from_json") ? UnionFromJSON.from_dynamic!(d["from_json"]) : nil,
1975519988 func: d.key?("func") ? UnionFunc.from_dynamic!(d["func"]) : nil,
1975619989 function: d.key?("function") ? UnionFunction.from_dynamic!(d["function"]) : nil,
@@ -19812,6 +20045,7 @@ class TopLevel < Dry::Struct
1981220045 long: d.key?("long") ? UnionLong.from_dynamic!(d["long"]) : nil,
1981320046 map: d.key?("map") ? UnionMap.from_dynamic!(d["map"]) : nil,
1981420047 map_entry: d.key?("MapEntry") ? UnionMapEntry.from_dynamic!(d["MapEntry"]) : nil,
20048+ marshal_json: d.key?("MarshalJSON") ? UnionMarshalJSON.from_dynamic!(d["MarshalJSON"]) : nil,
1981520049 metadata_property_handling: d.key?("metadata_property_handling") ? UnionMetadataPropertyHandling.from_dynamic!(d["metadata_property_handling"]) : nil,
1981620050 top_level_module: d.key?("module") ? UnionModule.from_dynamic!(d["module"]) : nil,
1981720051 mutable: d.key?("mutable") ? UnionMutable.from_dynamic!(d["mutable"]) : nil,
@@ -19926,6 +20160,7 @@ class TopLevel < Dry::Struct
1992620160 time_only: d.key?("TimeOnly") ? UnionTimeOnly.from_dynamic!(d["TimeOnly"]) : nil,
1992720161 time_only_converter: d.key?("TimeOnlyConverter") ? UnionTimeOnlyConverter.from_dynamic!(d["TimeOnlyConverter"]) : nil,
1992820162 time_zone: d.key?("TimeZone") ? UnionTimeZone.from_dynamic!(d["TimeZone"]) : nil,
20163+ to_dict: d.key?("to_dict") ? UnionToDict.from_dynamic!(d["to_dict"]) : nil,
1992920164 top_level_to_json: d.key?("to_json") ? UnionToJSON.from_dynamic!(d["to_json"]) : nil,
1993020165 top_level: d.key?("top_level") ? UnionTopLevel.from_dynamic!(d["top_level"]) : nil,
1993120166 to_string: d.key?("toString") ? UnionToString.from_dynamic!(d["toString"]) : nil,
@@ -19945,6 +20180,7 @@ class TopLevel < Dry::Struct
1994520180 unchecked: d.key?("unchecked") ? UnionUnchecked.from_dynamic!(d["unchecked"]) : nil,
1994620181 undefined: d.key?("undefined") ? UnionUndefined.from_dynamic!(d["undefined"]) : nil,
1994720182 union: d.key?("union") ? UnionUnionUnion.from_dynamic!(d["union"]) : nil,
20183+ unmarshal_json: d.key?("UnmarshalJSON") ? UnionUnmarshalJSON.from_dynamic!(d["UnmarshalJSON"]) : nil,
1994820184 unowned: d.key?("unowned") ? UnionUnowned.from_dynamic!(d["unowned"]) : nil,
1994920185 unsafe: d.key?("unsafe") ? UnionUnsafe.from_dynamic!(d["unsafe"]) : nil,
1995020186 unsigned: d.key?("unsigned") ? UnionUnsigned.from_dynamic!(d["unsigned"]) : nil,
@@ -20099,6 +20335,7 @@ class TopLevel < Dry::Struct
2009920335 "FormatException" => format_exception&.to_dynamic,
2010020336 "friend" => friend&.to_dynamic,
2010120337 "from" => from&.to_dynamic,
20338+ "from_dict" => from_dict&.to_dynamic,
2010220339 "from_json" => from_json&.to_dynamic,
2010320340 "func" => func&.to_dynamic,
2010420341 "function" => function&.to_dynamic,
@@ -20160,6 +20397,7 @@ class TopLevel < Dry::Struct
2016020397 "long" => long&.to_dynamic,
2016120398 "map" => map&.to_dynamic,
2016220399 "MapEntry" => map_entry&.to_dynamic,
20400+ "MarshalJSON" => marshal_json&.to_dynamic,
2016320401 "metadata_property_handling" => metadata_property_handling&.to_dynamic,
2016420402 "module" => top_level_module&.to_dynamic,
2016520403 "mutable" => mutable&.to_dynamic,
@@ -20274,6 +20512,7 @@ class TopLevel < Dry::Struct
2027420512 "TimeOnly" => time_only&.to_dynamic,
2027520513 "TimeOnlyConverter" => time_only_converter&.to_dynamic,
2027620514 "TimeZone" => time_zone&.to_dynamic,
20515+ "to_dict" => to_dict&.to_dynamic,
2027720516 "to_json" => top_level_to_json&.to_dynamic,
2027820517 "top_level" => top_level&.to_dynamic,
2027920518 "toString" => to_string&.to_dynamic,
@@ -20293,6 +20532,7 @@ class TopLevel < Dry::Struct
2029320532 "unchecked" => unchecked&.to_dynamic,
2029420533 "undefined" => undefined&.to_dynamic,
2029520534 "union" => union&.to_dynamic,
20535+ "UnmarshalJSON" => unmarshal_json&.to_dynamic,
2029620536 "unowned" => unowned&.to_dynamic,
2029720537 "unsafe" => unsafe&.to_dynamic,
2029820538 "unsigned" => unsigned&.to_dynamic,
Mschema-rustdefault / module_under_test.rs+58 −0
@@ -304,6 +304,8 @@ pub struct TopLevel {
304304
305305 pub from: Option<UnionFrom>,
306306
307+ pub from_dict: Option<UnionFromDict>,
308+
307309 pub from_json: Option<UnionFromJson>,
308310
309311 pub func: Option<UnionFunc>,
@@ -449,6 +451,9 @@ pub struct TopLevel {
449451 #[serde(rename = "MapEntry")]
450452 pub map_entry: Option<UnionMapEntry>,
451453
454+ #[serde(rename = "MarshalJSON")]
455+ pub marshal_json: Option<UnionMarshalJson>,
456+
452457 pub metadata_property_handling: Option<UnionMetadataPropertyHandling>,
453458
454459 pub module: Option<UnionModule>,
@@ -715,6 +720,8 @@ pub struct TopLevel {
715720 #[serde(rename = "TimeZone")]
716721 pub time_zone: Option<UnionTimeZone>,
717722
723+ pub to_dict: Option<UnionToDict>,
724+
718725 pub to_json: Option<UnionToJson>,
719726
720727 pub top_level: Option<UnionTopLevel>,
@@ -760,6 +767,9 @@ pub struct TopLevel {
760767 #[serde(rename = "union")]
761768 pub top_level_union: Option<UnionUnionUnion>,
762769
770+ #[serde(rename = "UnmarshalJSON")]
771+ pub unmarshal_json: Option<UnionUnmarshalJson>,
772+
763773 pub unowned: Option<UnionUnowned>,
764774
765775 #[serde(rename = "unsafe")]
@@ -2006,6 +2016,18 @@ pub enum UnionFrom {
20062016 pub struct From {
20072017 }
20082018
2019+#[derive(Debug, Clone, Serialize, Deserialize)]
2020+#[serde(untagged)]
2021+pub enum UnionFromDict {
2022+ Double(f64),
2023+
2024+ FromDict(FromDict),
2025+}
2026+
2027+#[derive(Debug, Clone, Serialize, Deserialize)]
2028+pub struct FromDict {
2029+}
2030+
20092031 #[derive(Debug, Clone, Serialize, Deserialize)]
20102032 #[serde(untagged)]
20112033 pub enum UnionFromJson {
@@ -2714,6 +2736,18 @@ pub enum UnionMapEntry {
27142736 pub struct MapEntry {
27152737 }
27162738
2739+#[derive(Debug, Clone, Serialize, Deserialize)]
2740+#[serde(untagged)]
2741+pub enum UnionMarshalJson {
2742+ Double(f64),
2743+
2744+ MarshalJson(MarshalJson),
2745+}
2746+
2747+#[derive(Debug, Clone, Serialize, Deserialize)]
2748+pub struct MarshalJson {
2749+}
2750+
27172751 #[derive(Debug, Clone, Serialize, Deserialize)]
27182752 #[serde(untagged)]
27192753 pub enum UnionMetadataPropertyHandling {
@@ -3998,6 +4032,18 @@ pub enum UnionTimeZone {
39984032 pub struct TimeZone {
39994033 }
40004034
4035+#[derive(Debug, Clone, Serialize, Deserialize)]
4036+#[serde(untagged)]
4037+pub enum UnionToDict {
4038+ Double(f64),
4039+
4040+ ToDict(ToDict),
4041+}
4042+
4043+#[derive(Debug, Clone, Serialize, Deserialize)]
4044+pub struct ToDict {
4045+}
4046+
40014047 #[derive(Debug, Clone, Serialize, Deserialize)]
40024048 #[serde(untagged)]
40034049 pub enum UnionToJson {
@@ -4658,6 +4704,18 @@ pub enum UnionUndefined {
46584704 pub struct Undefined {
46594705 }
46604706
4707+#[derive(Debug, Clone, Serialize, Deserialize)]
4708+#[serde(untagged)]
4709+pub enum UnionUnmarshalJson {
4710+ Double(f64),
4711+
4712+ UnmarshalJson(UnmarshalJson),
4713+}
4714+
4715+#[derive(Debug, Clone, Serialize, Deserialize)]
4716+pub struct UnmarshalJson {
4717+}
4718+
46614719 #[derive(Debug, Clone, Serialize, Deserialize)]
46624720 #[serde(untagged)]
46634721 pub enum UnionUnowned {
Mschema-schemadefault / TopLevel.schema+76 −0
@@ -372,6 +372,9 @@
372372 "from": {
373373 "$ref": "#/definitions/UnionFrom"
374374 },
375+ "from_dict": {
376+ "$ref": "#/definitions/UnionFromDict"
377+ },
375378 "from_json": {
376379 "$ref": "#/definitions/UnionFromJSON"
377380 },
@@ -555,6 +558,9 @@
555558 "MapEntry": {
556559 "$ref": "#/definitions/UnionMapEntry"
557560 },
561+ "MarshalJSON": {
562+ "$ref": "#/definitions/UnionMarshalJSON"
563+ },
558564 "metadata_property_handling": {
559565 "$ref": "#/definitions/UnionMetadataPropertyHandling"
560566 },
@@ -897,6 +903,9 @@
897903 "TimeZone": {
898904 "$ref": "#/definitions/UnionTimeZone"
899905 },
906+ "to_dict": {
907+ "$ref": "#/definitions/UnionToDict"
908+ },
900909 "to_json": {
901910 "$ref": "#/definitions/UnionToJSON"
902911 },
@@ -954,6 +963,9 @@
954963 "union": {
955964 "$ref": "#/definitions/UnionUnionUnion"
956965 },
966+ "UnmarshalJSON": {
967+ "$ref": "#/definitions/UnionUnmarshalJSON"
968+ },
957969 "unowned": {
958970 "$ref": "#/definitions/UnionUnowned"
959971 },
@@ -1217,6 +1229,11 @@
12171229 "additionalProperties": false,
12181230 "title": "MapEntry"
12191231 },
1232+ "MarshalJSON": {
1233+ "type": "object",
1234+ "additionalProperties": false,
1235+ "title": "MarshalJSON"
1236+ },
12201237 "No": {
12211238 "type": "object",
12221239 "additionalProperties": false,
@@ -1352,6 +1369,11 @@
13521369 "additionalProperties": false,
13531370 "title": "UUID"
13541371 },
1372+ "UnmarshalJSON": {
1373+ "type": "object",
1374+ "additionalProperties": false,
1375+ "title": "UnmarshalJSON"
1376+ },
13551377 "UseSerializers": {
13561378 "type": "object",
13571379 "additionalProperties": false,
@@ -1877,6 +1899,11 @@
18771899 "additionalProperties": false,
18781900 "title": "From"
18791901 },
1902+ "FromDict": {
1903+ "type": "object",
1904+ "additionalProperties": false,
1905+ "title": "FromDict"
1906+ },
18801907 "FromJSON": {
18811908 "type": "object",
18821909 "additionalProperties": false,
@@ -2547,6 +2574,11 @@
25472574 "additionalProperties": false,
25482575 "title": "ToString"
25492576 },
2577+ "ToDict": {
2578+ "type": "object",
2579+ "additionalProperties": false,
2580+ "title": "ToDict"
2581+ },
25502582 "ToJSON": {
25512583 "type": "object",
25522584 "additionalProperties": false,
@@ -3135,6 +3167,17 @@
31353167 ],
31363168 "title": "UnionMapEntry"
31373169 },
3170+ "UnionMarshalJSON": {
3171+ "anyOf": [
3172+ {
3173+ "$ref": "#/definitions/MarshalJSON"
3174+ },
3175+ {
3176+ "type": "number"
3177+ }
3178+ ],
3179+ "title": "UnionMarshalJSON"
3180+ },
31383181 "UnionNO": {
31393182 "anyOf": [
31403183 {
@@ -3432,6 +3475,17 @@
34323475 ],
34333476 "title": "UnionUUID"
34343477 },
3478+ "UnionUnmarshalJSON": {
3479+ "anyOf": [
3480+ {
3481+ "$ref": "#/definitions/UnmarshalJSON"
3482+ },
3483+ {
3484+ "type": "number"
3485+ }
3486+ ],
3487+ "title": "UnionUnmarshalJSON"
3488+ },
34353489 "UnionUseSerializers": {
34363490 "anyOf": [
34373491 {
@@ -4587,6 +4641,17 @@
45874641 ],
45884642 "title": "UnionFrom"
45894643 },
4644+ "UnionFromDict": {
4645+ "anyOf": [
4646+ {
4647+ "$ref": "#/definitions/FromDict"
4648+ },
4649+ {
4650+ "type": "number"
4651+ }
4652+ ],
4653+ "title": "UnionFromDict"
4654+ },
45904655 "UnionFromJSON": {
45914656 "anyOf": [
45924657 {
@@ -6061,6 +6126,17 @@
60616126 ],
60626127 "title": "UnionToString"
60636128 },
6129+ "UnionToDict": {
6130+ "anyOf": [
6131+ {
6132+ "$ref": "#/definitions/ToDict"
6133+ },
6134+ {
6135+ "type": "number"
6136+ }
6137+ ],
6138+ "title": "UnionToDict"
6139+ },
60646140 "UnionToJSON": {
60656141 "anyOf": [
60666142 {
Mschema-swiftdefault / quicktype.swift+300 −0
@@ -129,6 +129,7 @@ struct TopLevel: Codable {
129129 let formatException: UnionFormatException?
130130 let friend: UnionFriend?
131131 let from: UnionFrom?
132+ let fromDict: UnionFromDict?
132133 let fromJSON: UnionFromJSON?
133134 let topLevelFunc: UnionFunc?
134135 let function: UnionFunction?
@@ -190,6 +191,7 @@ struct TopLevel: Codable {
190191 let long: UnionLong?
191192 let map: UnionMap?
192193 let mapEntry: UnionMapEntry?
194+ let marshalJSON: UnionMarshalJSON?
193195 let metadataPropertyHandling: UnionMetadataPropertyHandling?
194196 let module: UnionModule?
195197 let mutable: UnionMutable?
@@ -304,6 +306,7 @@ struct TopLevel: Codable {
304306 let timeOnly: UnionTimeOnly?
305307 let timeOnlyConverter: UnionTimeOnlyConverter?
306308 let timeZone: UnionTimeZone?
309+ let toDict: UnionToDict?
307310 let toJSON: UnionToJSON?
308311 let topLevel: UnionTopLevel?
309312 let toString: UnionToString?
@@ -323,6 +326,7 @@ struct TopLevel: Codable {
323326 let unchecked: UnionUnchecked?
324327 let undefined: UnionUndefined?
325328 let union: UnionUnionUnion?
329+ let unmarshalJSON: UnionUnmarshalJSON?
326330 let topLevelUnowned: UnionUnowned?
327331 let unsafe: UnionUnsafe?
328332 let unsigned: UnionUnsigned?
@@ -470,6 +474,7 @@ struct TopLevel: Codable {
470474 case formatException = "FormatException"
471475 case friend = "friend"
472476 case from = "from"
477+ case fromDict = "from_dict"
473478 case fromJSON = "from_json"
474479 case topLevelFunc = "func"
475480 case function = "function"
@@ -531,6 +536,7 @@ struct TopLevel: Codable {
531536 case long = "long"
532537 case map = "map"
533538 case mapEntry = "MapEntry"
539+ case marshalJSON = "MarshalJSON"
534540 case metadataPropertyHandling = "metadata_property_handling"
535541 case module = "module"
536542 case mutable = "mutable"
@@ -645,6 +651,7 @@ struct TopLevel: Codable {
645651 case timeOnly = "TimeOnly"
646652 case timeOnlyConverter = "TimeOnlyConverter"
647653 case timeZone = "TimeZone"
654+ case toDict = "to_dict"
648655 case toJSON = "to_json"
649656 case topLevel = "top_level"
650657 case toString = "toString"
@@ -664,6 +671,7 @@ struct TopLevel: Codable {
664671 case unchecked = "unchecked"
665672 case undefined = "undefined"
666673 case union = "union"
674+ case unmarshalJSON = "UnmarshalJSON"
667675 case topLevelUnowned = "unowned"
668676 case unsafe = "unsafe"
669677 case unsigned = "unsigned"
@@ -831,6 +839,7 @@ extension TopLevel {
831839 formatException: UnionFormatException?? = nil,
832840 friend: UnionFriend?? = nil,
833841 from: UnionFrom?? = nil,
842+ fromDict: UnionFromDict?? = nil,
834843 fromJSON: UnionFromJSON?? = nil,
835844 topLevelFunc: UnionFunc?? = nil,
836845 function: UnionFunction?? = nil,
@@ -892,6 +901,7 @@ extension TopLevel {
892901 long: UnionLong?? = nil,
893902 map: UnionMap?? = nil,
894903 mapEntry: UnionMapEntry?? = nil,
904+ marshalJSON: UnionMarshalJSON?? = nil,
895905 metadataPropertyHandling: UnionMetadataPropertyHandling?? = nil,
896906 module: UnionModule?? = nil,
897907 mutable: UnionMutable?? = nil,
@@ -1006,6 +1016,7 @@ extension TopLevel {
10061016 timeOnly: UnionTimeOnly?? = nil,
10071017 timeOnlyConverter: UnionTimeOnlyConverter?? = nil,
10081018 timeZone: UnionTimeZone?? = nil,
1019+ toDict: UnionToDict?? = nil,
10091020 toJSON: UnionToJSON?? = nil,
10101021 topLevel: UnionTopLevel?? = nil,
10111022 toString: UnionToString?? = nil,
@@ -1025,6 +1036,7 @@ extension TopLevel {
10251036 unchecked: UnionUnchecked?? = nil,
10261037 undefined: UnionUndefined?? = nil,
10271038 union: UnionUnionUnion?? = nil,
1039+ unmarshalJSON: UnionUnmarshalJSON?? = nil,
10281040 topLevelUnowned: UnionUnowned?? = nil,
10291041 unsafe: UnionUnsafe?? = nil,
10301042 unsigned: UnionUnsigned?? = nil,
@@ -1172,6 +1184,7 @@ extension TopLevel {
11721184 formatException: formatException ?? self.formatException,
11731185 friend: friend ?? self.friend,
11741186 from: from ?? self.from,
1187+ fromDict: fromDict ?? self.fromDict,
11751188 fromJSON: fromJSON ?? self.fromJSON,
11761189 topLevelFunc: topLevelFunc ?? self.topLevelFunc,
11771190 function: function ?? self.function,
@@ -1233,6 +1246,7 @@ extension TopLevel {
12331246 long: long ?? self.long,
12341247 map: map ?? self.map,
12351248 mapEntry: mapEntry ?? self.mapEntry,
1249+ marshalJSON: marshalJSON ?? self.marshalJSON,
12361250 metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling,
12371251 module: module ?? self.module,
12381252 mutable: mutable ?? self.mutable,
@@ -1347,6 +1361,7 @@ extension TopLevel {
13471361 timeOnly: timeOnly ?? self.timeOnly,
13481362 timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter,
13491363 timeZone: timeZone ?? self.timeZone,
1364+ toDict: toDict ?? self.toDict,
13501365 toJSON: toJSON ?? self.toJSON,
13511366 topLevel: topLevel ?? self.topLevel,
13521367 toString: toString ?? self.toString,
@@ -1366,6 +1381,7 @@ extension TopLevel {
13661381 unchecked: unchecked ?? self.unchecked,
13671382 undefined: undefined ?? self.undefined,
13681383 union: union ?? self.union,
1384+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
13691385 topLevelUnowned: topLevelUnowned ?? self.topLevelUnowned,
13701386 unsafe: unsafe ?? self.unsafe,
13711387 unsigned: unsigned ?? self.unsigned,
@@ -7862,6 +7878,77 @@ extension From {
78627878 }
78637879 }
78647880
7881+enum UnionFromDict: Codable {
7882+ case double(Double)
7883+ case fromDict(FromDict)
7884+
7885+ init(from decoder: Decoder) throws {
7886+ let container = try decoder.singleValueContainer()
7887+ if let x = try? container.decode(Double.self) {
7888+ self = .double(x)
7889+ return
7890+ }
7891+ if let x = try? container.decode(FromDict.self) {
7892+ self = .fromDict(x)
7893+ return
7894+ }
7895+ throw DecodingError.typeMismatch(UnionFromDict.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionFromDict"))
7896+ }
7897+
7898+ func encode(to encoder: Encoder) throws {
7899+ var container = encoder.singleValueContainer()
7900+ switch self {
7901+ case .double(let x):
7902+ try container.encode(x)
7903+ case .fromDict(let x):
7904+ try container.encode(x)
7905+ }
7906+ }
7907+}
7908+
7909+// MARK: - FromDict
7910+struct FromDict: Codable {
7911+ private enum K: String, CodingKey { case unused }
7912+ init(from decoder: Decoder) throws {
7913+ _ = try decoder.container(keyedBy: K.self)
7914+ }
7915+ init() {
7916+ }
7917+}
7918+
7919+// MARK: FromDict convenience initializers and mutators
7920+
7921+extension FromDict {
7922+ init(data: Data) throws {
7923+ self = try newJSONDecoder().decode(FromDict.self, from: data)
7924+ }
7925+
7926+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
7927+ guard let data = json.data(using: encoding) else {
7928+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
7929+ }
7930+ try self.init(data: data)
7931+ }
7932+
7933+ init(fromURL url: URL) throws {
7934+ try self.init(data: try Data(contentsOf: url))
7935+ }
7936+
7937+ func with(
7938+ ) -> FromDict {
7939+ return FromDict(
7940+ )
7941+ }
7942+
7943+ func jsonData() throws -> Data {
7944+ return try newJSONEncoder().encode(self)
7945+ }
7946+
7947+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
7948+ return String(data: try self.jsonData(), encoding: encoding)
7949+ }
7950+}
7951+
78657952 enum UnionFromJSON: Codable {
78667953 case double(Double)
78677954 case fromJSON(FromJSON)
@@ -11128,6 +11215,77 @@ extension MapEntry {
1112811215 }
1112911216 }
1113011217
11218+enum UnionMarshalJSON: Codable {
11219+ case double(Double)
11220+ case marshalJSON(MarshalJSON)
11221+
11222+ init(from decoder: Decoder) throws {
11223+ let container = try decoder.singleValueContainer()
11224+ if let x = try? container.decode(Double.self) {
11225+ self = .double(x)
11226+ return
11227+ }
11228+ if let x = try? container.decode(MarshalJSON.self) {
11229+ self = .marshalJSON(x)
11230+ return
11231+ }
11232+ throw DecodingError.typeMismatch(UnionMarshalJSON.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionMarshalJSON"))
11233+ }
11234+
11235+ func encode(to encoder: Encoder) throws {
11236+ var container = encoder.singleValueContainer()
11237+ switch self {
11238+ case .double(let x):
11239+ try container.encode(x)
11240+ case .marshalJSON(let x):
11241+ try container.encode(x)
11242+ }
11243+ }
11244+}
11245+
11246+// MARK: - MarshalJSON
11247+struct MarshalJSON: Codable {
11248+ private enum K: String, CodingKey { case unused }
11249+ init(from decoder: Decoder) throws {
11250+ _ = try decoder.container(keyedBy: K.self)
11251+ }
11252+ init() {
11253+ }
11254+}
11255+
11256+// MARK: MarshalJSON convenience initializers and mutators
11257+
11258+extension MarshalJSON {
11259+ init(data: Data) throws {
11260+ self = try newJSONDecoder().decode(MarshalJSON.self, from: data)
11261+ }
11262+
11263+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
11264+ guard let data = json.data(using: encoding) else {
11265+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11266+ }
11267+ try self.init(data: data)
11268+ }
11269+
11270+ init(fromURL url: URL) throws {
11271+ try self.init(data: try Data(contentsOf: url))
11272+ }
11273+
11274+ func with(
11275+ ) -> MarshalJSON {
11276+ return MarshalJSON(
11277+ )
11278+ }
11279+
11280+ func jsonData() throws -> Data {
11281+ return try newJSONEncoder().encode(self)
11282+ }
11283+
11284+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
11285+ return String(data: try self.jsonData(), encoding: encoding)
11286+ }
11287+}
11288+
1113111289 enum UnionMetadataPropertyHandling: Codable {
1113211290 case double(Double)
1113311291 case metadataPropertyHandling(MetadataPropertyHandling)
@@ -17447,6 +17605,77 @@ extension TimeZoneClass {
1744717605 }
1744817606 }
1744917607
17608+enum UnionToDict: Codable {
17609+ case double(Double)
17610+ case toDict(ToDict)
17611+
17612+ init(from decoder: Decoder) throws {
17613+ let container = try decoder.singleValueContainer()
17614+ if let x = try? container.decode(Double.self) {
17615+ self = .double(x)
17616+ return
17617+ }
17618+ if let x = try? container.decode(ToDict.self) {
17619+ self = .toDict(x)
17620+ return
17621+ }
17622+ throw DecodingError.typeMismatch(UnionToDict.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionToDict"))
17623+ }
17624+
17625+ func encode(to encoder: Encoder) throws {
17626+ var container = encoder.singleValueContainer()
17627+ switch self {
17628+ case .double(let x):
17629+ try container.encode(x)
17630+ case .toDict(let x):
17631+ try container.encode(x)
17632+ }
17633+ }
17634+}
17635+
17636+// MARK: - ToDict
17637+struct ToDict: Codable {
17638+ private enum K: String, CodingKey { case unused }
17639+ init(from decoder: Decoder) throws {
17640+ _ = try decoder.container(keyedBy: K.self)
17641+ }
17642+ init() {
17643+ }
17644+}
17645+
17646+// MARK: ToDict convenience initializers and mutators
17647+
17648+extension ToDict {
17649+ init(data: Data) throws {
17650+ self = try newJSONDecoder().decode(ToDict.self, from: data)
17651+ }
17652+
17653+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17654+ guard let data = json.data(using: encoding) else {
17655+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17656+ }
17657+ try self.init(data: data)
17658+ }
17659+
17660+ init(fromURL url: URL) throws {
17661+ try self.init(data: try Data(contentsOf: url))
17662+ }
17663+
17664+ func with(
17665+ ) -> ToDict {
17666+ return ToDict(
17667+ )
17668+ }
17669+
17670+ func jsonData() throws -> Data {
17671+ return try newJSONEncoder().encode(self)
17672+ }
17673+
17674+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17675+ return String(data: try self.jsonData(), encoding: encoding)
17676+ }
17677+}
17678+
1745017679 enum UnionToJSON: Codable {
1745117680 case double(Double)
1745217681 case toJSON(ToJSON)
@@ -24192,6 +24421,77 @@ extension Union {
2419224421 }
2419324422 }
2419424423
24424+enum UnionUnmarshalJSON: Codable {
24425+ case double(Double)
24426+ case unmarshalJSON(UnmarshalJSON)
24427+
24428+ init(from decoder: Decoder) throws {
24429+ let container = try decoder.singleValueContainer()
24430+ if let x = try? container.decode(Double.self) {
24431+ self = .double(x)
24432+ return
24433+ }
24434+ if let x = try? container.decode(UnmarshalJSON.self) {
24435+ self = .unmarshalJSON(x)
24436+ return
24437+ }
24438+ throw DecodingError.typeMismatch(UnionUnmarshalJSON.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionUnmarshalJSON"))
24439+ }
24440+
24441+ func encode(to encoder: Encoder) throws {
24442+ var container = encoder.singleValueContainer()
24443+ switch self {
24444+ case .double(let x):
24445+ try container.encode(x)
24446+ case .unmarshalJSON(let x):
24447+ try container.encode(x)
24448+ }
24449+ }
24450+}
24451+
24452+// MARK: - UnmarshalJSON
24453+struct UnmarshalJSON: Codable {
24454+ private enum K: String, CodingKey { case unused }
24455+ init(from decoder: Decoder) throws {
24456+ _ = try decoder.container(keyedBy: K.self)
24457+ }
24458+ init() {
24459+ }
24460+}
24461+
24462+// MARK: UnmarshalJSON convenience initializers and mutators
24463+
24464+extension UnmarshalJSON {
24465+ init(data: Data) throws {
24466+ self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data)
24467+ }
24468+
24469+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
24470+ guard let data = json.data(using: encoding) else {
24471+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
24472+ }
24473+ try self.init(data: data)
24474+ }
24475+
24476+ init(fromURL url: URL) throws {
24477+ try self.init(data: try Data(contentsOf: url))
24478+ }
24479+
24480+ func with(
24481+ ) -> UnmarshalJSON {
24482+ return UnmarshalJSON(
24483+ )
24484+ }
24485+
24486+ func jsonData() throws -> Data {
24487+ return try newJSONEncoder().encode(self)
24488+ }
24489+
24490+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
24491+ return String(data: try self.jsonData(), encoding: encoding)
24492+ }
24493+}
24494+
2419524495 enum UnionUnsafe: Codable {
2419624496 case double(Double)
2419724497 case unsafe(Unsafe)
Mschema-typescript-effect-schemadefault / TopLevel.ts+16 −0
@@ -70,6 +70,9 @@ export class Unsafe extends S.Class<Unsafe>("Unsafe")(S.Struct({}).pipe(S.filter
7070 export class Unowned extends S.Class<Unowned>("Unowned")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
7171 ) {}
7272
73+export class UnmarshalJson extends S.Class<UnmarshalJson>("UnmarshalJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
74+) {}
75+
7376 export class Union extends S.Class<Union>("Union")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
7477 ) {}
7578
@@ -151,6 +154,9 @@ export class ToString extends S.Class<ToString>("ToString")(S.Struct({}).pipe(S.
151154 export class ToJson extends S.Class<ToJson>("ToJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
152155 ) {}
153156
157+export class ToDict extends S.Class<ToDict>("ToDict")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
158+) {}
159+
154160 export class TimeZone extends S.Class<TimeZone>("TimeZone")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
155161 ) {}
156162
@@ -484,6 +490,9 @@ export class Module extends S.Class<Module>("Module")(S.Struct({}).pipe(S.filter
484490 export class MetadataPropertyHandling extends S.Class<MetadataPropertyHandling>("MetadataPropertyHandling")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
485491 ) {}
486492
493+export class MarshalJson extends S.Class<MarshalJson>("MarshalJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
494+) {}
495+
487496 export class MapEntry extends S.Class<MapEntry>("MapEntry")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
488497 ) {}
489498
@@ -670,6 +679,9 @@ export class Func extends S.Class<Func>("Func")(S.Struct({}).pipe(S.filter(value
670679 export class FromJson extends S.Class<FromJson>("FromJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
671680 ) {}
672681
682+export class FromDict extends S.Class<FromDict>("FromDict")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
683+) {}
684+
673685 export class From extends S.Class<From>("From")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
674686 ) {}
675687
@@ -1138,6 +1150,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
11381150 "FormatException": S.optional(S.Union(S.Number, FormatException)),
11391151 "friend": S.optional(S.Union(S.Number, Friend)),
11401152 "from": S.optional(S.Union(S.Number, From)),
1153+ "from_dict": S.optional(S.Union(S.Number, FromDict)),
11411154 "from_json": S.optional(S.Union(S.Number, FromJson)),
11421155 "func": S.optional(S.Union(S.Number, Func)),
11431156 "function": S.optional(S.Union(S.Number, Function)),
@@ -1199,6 +1212,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
11991212 "long": S.optional(S.Union(S.Number, Long)),
12001213 "map": S.optional(S.Union(S.Number, Map)),
12011214 "MapEntry": S.optional(S.Union(S.Number, MapEntry)),
1215+ "MarshalJSON": S.optional(S.Union(S.Number, MarshalJson)),
12021216 "metadata_property_handling": S.optional(S.Union(S.Number, MetadataPropertyHandling)),
12031217 "module": S.optional(S.Union(S.Number, Module)),
12041218 "mutable": S.optional(S.Union(S.Number, Mutable)),
@@ -1313,6 +1327,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
13131327 "TimeOnly": S.optional(S.Union(S.Number, TimeOnly)),
13141328 "TimeOnlyConverter": S.optional(S.Union(S.Number, TimeOnlyConverter)),
13151329 "TimeZone": S.optional(S.Union(S.Number, TimeZone)),
1330+ "to_dict": S.optional(S.Union(S.Number, ToDict)),
13161331 "to_json": S.optional(S.Union(S.Number, ToJson)),
13171332 "top_level": S.optional(S.Union(S.Number, TopLevelClass)),
13181333 "toString": S.optional(S.Union(S.Number, ToString)),
@@ -1332,6 +1347,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
13321347 "unchecked": S.optional(S.Union(S.Number, Unchecked)),
13331348 "undefined": S.optional(S.Union(S.Number, Undefined)),
13341349 "union": S.optional(S.Union(S.Number, Union)),
1350+ "UnmarshalJSON": S.optional(S.Union(S.Number, UnmarshalJson)),
13351351 "unowned": S.optional(S.Union(S.Number, Unowned)),
13361352 "unsafe": S.optional(S.Union(S.Number, Unsafe)),
13371353 "unsigned": S.optional(S.Union(S.Number, Unsigned)),
Mschema-typescript-zoddefault / TopLevel.ts+20 −0
@@ -461,6 +461,10 @@ export const FromSchema = z.object({
461461 });
462462 export type From = z.infer<typeof FromSchema>;
463463
464+export const FromDictSchema = z.object({
465+});
466+export type FromDict = z.infer<typeof FromDictSchema>;
467+
464468 export const FromJsonSchema = z.object({
465469 });
466470 export type FromJson = z.infer<typeof FromJsonSchema>;
@@ -709,6 +713,10 @@ export const MapEntrySchema = z.object({
709713 });
710714 export type MapEntry = z.infer<typeof MapEntrySchema>;
711715
716+export const MarshalJsonSchema = z.object({
717+});
718+export type MarshalJson = z.infer<typeof MarshalJsonSchema>;
719+
712720 export const MetadataPropertyHandlingSchema = z.object({
713721 });
714722 export type MetadataPropertyHandling = z.infer<typeof MetadataPropertyHandlingSchema>;
@@ -1153,6 +1161,10 @@ export const TimeZoneSchema = z.object({
11531161 });
11541162 export type TimeZone = z.infer<typeof TimeZoneSchema>;
11551163
1164+export const ToDictSchema = z.object({
1165+});
1166+export type ToDict = z.infer<typeof ToDictSchema>;
1167+
11561168 export const ToJsonSchema = z.object({
11571169 });
11581170 export type ToJson = z.infer<typeof ToJsonSchema>;
@@ -1261,6 +1273,10 @@ export const UnionSchema = z.object({
12611273 });
12621274 export type Union = z.infer<typeof UnionSchema>;
12631275
1276+export const UnmarshalJsonSchema = z.object({
1277+});
1278+export type UnmarshalJson = z.infer<typeof UnmarshalJsonSchema>;
1279+
12641280 export const UnownedSchema = z.object({
12651281 });
12661282 export type Unowned = z.infer<typeof UnownedSchema>;
@@ -1476,6 +1492,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" &&
14761492 "FormatException": z.union([FormatExceptionSchema, z.number()]).optional(),
14771493 "friend": z.union([FriendSchema, z.number()]).optional(),
14781494 "from": z.union([FromSchema, z.number()]).optional(),
1495+ "from_dict": z.union([FromDictSchema, z.number()]).optional(),
14791496 "from_json": z.union([FromJsonSchema, z.number()]).optional(),
14801497 "func": z.union([FuncSchema, z.number()]).optional(),
14811498 "function": z.union([FunctionSchema, z.number()]).optional(),
@@ -1537,6 +1554,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" &&
15371554 "long": z.union([LongSchema, z.number()]).optional(),
15381555 "map": z.union([MapSchema, z.number()]).optional(),
15391556 "MapEntry": z.union([MapEntrySchema, z.number()]).optional(),
1557+ "MarshalJSON": z.union([MarshalJsonSchema, z.number()]).optional(),
15401558 "metadata_property_handling": z.union([MetadataPropertyHandlingSchema, z.number()]).optional(),
15411559 "module": z.union([ModuleSchema, z.number()]).optional(),
15421560 "mutable": z.union([MutableSchema, z.number()]).optional(),
@@ -1651,6 +1669,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" &&
16511669 "TimeOnly": z.union([TimeOnlySchema, z.number()]).optional(),
16521670 "TimeOnlyConverter": z.union([TimeOnlyConverterSchema, z.number()]).optional(),
16531671 "TimeZone": z.union([TimeZoneSchema, z.number()]).optional(),
1672+ "to_dict": z.union([ToDictSchema, z.number()]).optional(),
16541673 "to_json": z.union([ToJsonSchema, z.number()]).optional(),
16551674 "top_level": z.union([TopLevelClassSchema, z.number()]).optional(),
16561675 "toString": z.union([ToStringSchema, z.number()]).optional(),
@@ -1670,6 +1689,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" &&
16701689 "unchecked": z.union([UncheckedSchema, z.number()]).optional(),
16711690 "undefined": z.union([UndefinedSchema, z.number()]).optional(),
16721691 "union": z.union([UnionSchema, z.number()]).optional(),
1692+ "UnmarshalJSON": z.union([UnmarshalJsonSchema, z.number()]).optional(),
16731693 "unowned": z.union([UnownedSchema, z.number()]).optional(),
16741694 "unsafe": z.union([UnsafeSchema, z.number()]).optional(),
16751695 "unsigned": z.union([UnsignedSchema, z.number()]).optional(),
Mschema-typescriptdefault / TopLevel.ts+18 −2
@@ -130,6 +130,7 @@ export interface TopLevel {
130130 FormatException?: UnionFormatException;
131131 friend?: UnionFriend;
132132 from?: UnionFrom;
133+ from_dict?: UnionFromDict;
133134 from_json?: UnionFromJSON;
134135 func?: UnionFunc;
135136 function?: UnionFunction;
@@ -191,6 +192,7 @@ export interface TopLevel {
191192 long?: UnionLong;
192193 map?: UnionMap;
193194 MapEntry?: UnionMapEntry;
195+ MarshalJSON?: UnionMarshalJSON;
194196 metadata_property_handling?: UnionMetadataPropertyHandling;
195197 module?: UnionModule;
196198 mutable?: UnionMutable;
@@ -305,6 +307,7 @@ export interface TopLevel {
305307 TimeOnly?: UnionTimeOnly;
306308 TimeOnlyConverter?: UnionTimeOnlyConverter;
307309 TimeZone?: UnionTimeZone;
310+ to_dict?: UnionToDict;
308311 to_json?: UnionToJSON;
309312 top_level?: UnionTopLevel;
310313 toString?: UnionToString;
@@ -324,6 +327,7 @@ export interface TopLevel {
324327 unchecked?: UnionUnchecked;
325328 undefined?: UnionUndefined;
326329 union?: UnionUnionUnion;
330+ UnmarshalJSON?: UnionUnmarshalJSON;
327331 unowned?: UnionUnowned;
328332 unsafe?: UnionUnsafe;
329333 unsigned?: UnionUnsigned;
@@ -426,6 +430,8 @@ export type UnionLocale = object | number;
426430
427431 export type UnionMapEntry = object | number;
428432
433+export type UnionMarshalJSON = object | number;
434+
429435 export type UnionNO = object | number;
430436
431437 export type UnionNSError = object | number;
@@ -480,6 +486,8 @@ export type UnionType = object | number;
480486
481487 export type UnionUUID = object | number;
482488
489+export type UnionUnmarshalJSON = object | number;
490+
483491 export type UnionUseSerializers = object | number;
484492
485493 export type UnionUtf8JSONReader = object | number;
@@ -690,6 +698,8 @@ export type UnionFriend = object | number;
690698
691699 export type UnionFrom = object | number;
692700
701+export type UnionFromDict = object | number;
702+
693703 export type UnionFromJSON = object | number;
694704
695705 export type UnionFunc = object | number;
@@ -958,6 +968,8 @@ export type UnionThrows = object | number;
958968
959969 export type UnionToString = object | number;
960970
971+export type UnionToDict = object | number;
972+
961973 export type UnionToJSON = object | number;
962974
963975 export type UnionTopLevel = object | number;
@@ -1122,7 +1134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
11221134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
11231135 return invalidValue(l(ref || "object"), val, key, parent);
11241136 }
1125- const result: any = {};
1137+ const result: any = Object.create(null);
11261138 Object.getOwnPropertyNames(props).forEach(key => {
11271139 const prop = props[key];
11281140 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1133,7 +1145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
11331145 result[key] = transform(val[key], additional, getProps, key, ref);
11341146 }
11351147 });
1136- return result;
1148+ return Object.setPrototypeOf(result, Object.prototype);
11371149 }
11381150
11391151 if (typ === "any") return val;
@@ -1336,6 +1348,7 @@ const typeMap: any = {
13361348 { json: "FormatException", js: "FormatException", typ: u(undefined, u(m("any"), 3.14)) },
13371349 { json: "friend", js: "friend", typ: u(undefined, u(m("any"), 3.14)) },
13381350 { json: "from", js: "from", typ: u(undefined, u(m("any"), 3.14)) },
1351+ { json: "from_dict", js: "from_dict", typ: u(undefined, u(m("any"), 3.14)) },
13391352 { json: "from_json", js: "from_json", typ: u(undefined, u(m("any"), 3.14)) },
13401353 { json: "func", js: "func", typ: u(undefined, u(m("any"), 3.14)) },
13411354 { json: "function", js: "function", typ: u(undefined, u(m("any"), 3.14)) },
@@ -1397,6 +1410,7 @@ const typeMap: any = {
13971410 { json: "long", js: "long", typ: u(undefined, u(m("any"), 3.14)) },
13981411 { json: "map", js: "map", typ: u(undefined, u(m("any"), 3.14)) },
13991412 { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(m("any"), 3.14)) },
1413+ { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(m("any"), 3.14)) },
14001414 { json: "metadata_property_handling", js: "metadata_property_handling", typ: u(undefined, u(m("any"), 3.14)) },
14011415 { json: "module", js: "module", typ: u(undefined, u(m("any"), 3.14)) },
14021416 { json: "mutable", js: "mutable", typ: u(undefined, u(m("any"), 3.14)) },
@@ -1511,6 +1525,7 @@ const typeMap: any = {
15111525 { json: "TimeOnly", js: "TimeOnly", typ: u(undefined, u(m("any"), 3.14)) },
15121526 { json: "TimeOnlyConverter", js: "TimeOnlyConverter", typ: u(undefined, u(m("any"), 3.14)) },
15131527 { json: "TimeZone", js: "TimeZone", typ: u(undefined, u(m("any"), 3.14)) },
1528+ { json: "to_dict", js: "to_dict", typ: u(undefined, u(m("any"), 3.14)) },
15141529 { json: "to_json", js: "to_json", typ: u(undefined, u(m("any"), 3.14)) },
15151530 { json: "top_level", js: "top_level", typ: u(undefined, u(m("any"), 3.14)) },
15161531 { json: "toString", js: "toString", typ: u(undefined, u(m("any"), 3.14)) },
@@ -1530,6 +1545,7 @@ const typeMap: any = {
15301545 { json: "unchecked", js: "unchecked", typ: u(undefined, u(m("any"), 3.14)) },
15311546 { json: "undefined", js: "undefined", typ: u(undefined, u(m("any"), 3.14)) },
15321547 { json: "union", js: "union", typ: u(undefined, u(m("any"), 3.14)) },
1548+ { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: u(undefined, u(m("any"), 3.14)) },
15331549 { json: "unowned", js: "unowned", typ: u(undefined, u(m("any"), 3.14)) },
15341550 { json: "unsafe", js: "unsafe", typ: u(undefined, u(m("any"), 3.14)) },
15351551 { json: "unsigned", js: "unsigned", typ: u(undefined, u(m("any"), 3.14)) },
Test case

test/inputs/schema/light.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/list.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/min-max-items.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/minmax-integer.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/minmax.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/minmaxlength.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/schema/multi-type-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/mutually-recursive.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/nested-intersection-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/non-standard-ref.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/nullable-optional-one-of.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/object-type-required.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/optional-any.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/optional-const-ref.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Test case

test/inputs/schema/optional-constraints.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/optional-date-time.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/optional-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/optional-property.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/schema/pattern.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/postman-collection.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Test case

test/inputs/schema/prefix-items.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/recursive-union-flattening.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/schema/ref-id-files.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/ref-remote.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/renaming-bug.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
210210 if (val === null || typeof val !== "object" || Array.isArray(val)) {
211211 return invalidValue(l(ref || "object"), val, key, parent);
212212 }
213- const result: any = {};
213+ const result: any = Object.create(null);
214214 Object.getOwnPropertyNames(props).forEach(key => {
215215 const prop = props[key];
216216 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
221221 result[key] = transform(val[key], additional, getProps, key, ref);
222222 }
223223 });
224- return result;
224+ return Object.setPrototypeOf(result, Object.prototype);
225225 }
226226
227227 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
195195 if (val === null || typeof val !== "object" || Array.isArray(val)) {
196196 return invalidValue(l(ref || "object"), val, key, parent);
197197 }
198- const result: any = {};
198+ const result: any = Object.create(null);
199199 Object.getOwnPropertyNames(props).forEach(key => {
200200 const prop = props[key];
201201 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
206206 result[key] = transform(val[key], additional, getProps, key, ref);
207207 }
208208 });
209- return result;
209+ return Object.setPrototypeOf(result, Object.prototype);
210210 }
211211
212212 if (typ === "any") return val;
Test case

test/inputs/schema/required-draft3.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/required-non-properties.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/required.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/rust-cycle-breaker-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/schema/schema-constraints.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/simple-ref.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/strict-optional.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-array.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-primitive-array.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-primitive.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/tuple.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/unevaluated-properties.schema

4 generated files · +15 −7
Mschema-elmdefault / QuickType.elm+9 −1
@@ -88,7 +88,7 @@ encodeConfig x =
8888 Jenc.object
8989 [ ("closed", makeNullableEncoder encodeClosed x.closed)
9090 , ("name", makeNullableEncoder Jenc.string x.name)
91- , ("settings", makeNullableEncoder (Jenc.dict identity (Jenc.list encodeItem)) x.settings)
91+ , ("settings", makeNullableEncoder (makeDictEncoder identity (Jenc.list encodeItem)) x.settings)
9292 ]
9393
9494 closed : Jdec.Decoder Closed
@@ -138,6 +138,14 @@ encodeItem x =
138138
139139 --- encoder helpers
140140
141+makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value
142+makeDictEncoder f m r =
143+ r
144+ |> Dict.toList
145+ |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y))
146+ |> String.join ","
147+ |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null)
148+
141149 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
142150 makeNullableEncoder f m =
143151 case m of
Mschema-flowdefault / TopLevel.js+2 −2
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 if (val === null || typeof val !== "object" || Array.isArray(val)) {
127127 return invalidValue(l(ref || "object"), val, key, parent);
128128 }
129- const result: any = {};
129+ const result: any = Object.create(null);
130130 Object.getOwnPropertyNames(props).forEach(key => {
131131 const prop = props[key];
132132 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
137137 result[key] = transform(val[key], additional, getProps, key, ref);
138138 }
139139 });
140- return result;
140+ return Object.setPrototypeOf(result, Object.prototype);
141141 }
142142
143143 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 if (val === null || typeof val !== "object" || Array.isArray(val)) {
124124 return invalidValue(l(ref || "object"), val, key, parent);
125125 }
126- const result: any = {};
126+ const result: any = Object.create(null);
127127 Object.getOwnPropertyNames(props).forEach(key => {
128128 const prop = props[key];
129129 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 result[key] = transform(val[key], additional, getProps, key, ref);
135135 }
136136 });
137- return result;
137+ return Object.setPrototypeOf(result, Object.prototype);
138138 }
139139
140140 if (typ === "any") return val;
Test case

test/inputs/schema/unicode-codepoint-length.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/union-int-double.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/union-list.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/uuid.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/schema/vega-lite.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -6199,7 +6199,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
61996199 if (val === null || typeof val !== "object" || Array.isArray(val)) {
62006200 return invalidValue(l(ref || "object"), val, key, parent);
62016201 }
6202- const result: any = {};
6202+ const result: any = Object.create(null);
62036203 Object.getOwnPropertyNames(props).forEach(key => {
62046204 const prop = props[key];
62056205 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -6210,7 +6210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
62106210 result[key] = transform(val[key], additional, getProps, key, ref);
62116211 }
62126212 });
6213- return result;
6213+ return Object.setPrototypeOf(result, Object.prototype);
62146214 }
62156215
62166216 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -5956,7 +5956,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
59565956 if (val === null || typeof val !== "object" || Array.isArray(val)) {
59575957 return invalidValue(l(ref || "object"), val, key, parent);
59585958 }
5959- const result: any = {};
5959+ const result: any = Object.create(null);
59605960 Object.getOwnPropertyNames(props).forEach(key => {
59615961 const prop = props[key];
59625962 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -5967,7 +5967,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
59675967 result[key] = transform(val[key], additional, getProps, key, ref);
59685968 }
59695969 });
5970- return result;
5970+ return Object.setPrototypeOf(result, Object.prototype);
59715971 }
59725972
59735973 if (typ === "any") return val;
No generated files match these filters.