json-schema-to-atd 0.78.0 → 0.79.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -12
- package/dist/index.mjs +12 -12
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
@@ -144,39 +144,39 @@ function jsonSchemaScalarToJtdScalar(input, _) {
|
|
144
144
|
case "Date":
|
145
145
|
return {
|
146
146
|
type: "timestamp",
|
147
|
-
|
147
|
+
isNullable: input.nullable,
|
148
148
|
metadata: meta
|
149
149
|
};
|
150
150
|
case "bigint":
|
151
151
|
case "integer":
|
152
152
|
return {
|
153
153
|
type: "int32",
|
154
|
-
|
154
|
+
isNullable: input.nullable,
|
155
155
|
metadata: meta
|
156
156
|
};
|
157
157
|
case "number":
|
158
158
|
return {
|
159
159
|
type: "float64",
|
160
|
-
|
160
|
+
isNullable: input.nullable,
|
161
161
|
metadata: meta
|
162
162
|
};
|
163
163
|
case "boolean":
|
164
164
|
return {
|
165
165
|
type: "boolean",
|
166
|
-
|
166
|
+
isNullable: input.nullable,
|
167
167
|
metadata: meta
|
168
168
|
};
|
169
169
|
case "string":
|
170
170
|
if (input.format === "date-time") {
|
171
171
|
return {
|
172
172
|
type: "timestamp",
|
173
|
-
|
173
|
+
isNullable: input.nullable,
|
174
174
|
metadata: meta
|
175
175
|
};
|
176
176
|
}
|
177
177
|
return {
|
178
178
|
type: "string",
|
179
|
-
|
179
|
+
isNullable: input.nullable,
|
180
180
|
metadata: meta
|
181
181
|
};
|
182
182
|
default:
|
@@ -186,8 +186,8 @@ function jsonSchemaScalarToJtdScalar(input, _) {
|
|
186
186
|
function jsonSchemaObjectToJtdObject(input, _) {
|
187
187
|
const result = {
|
188
188
|
properties: {},
|
189
|
-
|
190
|
-
|
189
|
+
isNullable: input.nullable,
|
190
|
+
isStrict: typeof input.additionalProperties === "boolean" ? !input.additionalProperties : void 0,
|
191
191
|
metadata: {
|
192
192
|
id: input.$id ?? input.title,
|
193
193
|
description: input.description
|
@@ -213,7 +213,7 @@ function jsonSchemaObjectToJtdObject(input, _) {
|
|
213
213
|
function jsonSchemaArrayToJtdArray(input, _) {
|
214
214
|
const result = {
|
215
215
|
elements: jsonSchemaToJtdSchema(input.items),
|
216
|
-
|
216
|
+
isNullable: input.nullable,
|
217
217
|
metadata: {
|
218
218
|
id: input.$id ?? input.title,
|
219
219
|
description: input.description
|
@@ -226,7 +226,7 @@ function jsonSchemaRecordToJtdRecord(input, _) {
|
|
226
226
|
const type = jsonSchemaToJtdSchema(input.additionalProperties);
|
227
227
|
return {
|
228
228
|
values: type,
|
229
|
-
|
229
|
+
isNullable: input.nullable,
|
230
230
|
metadata: {
|
231
231
|
id: input.$id ?? input.title,
|
232
232
|
description: input.description
|
@@ -249,7 +249,7 @@ function jsonSchemaRecordToJtdRecord(input, _) {
|
|
249
249
|
}
|
250
250
|
const result = {
|
251
251
|
values: types[0],
|
252
|
-
|
252
|
+
isNullable: input.nullable,
|
253
253
|
metadata: {
|
254
254
|
id: input.$id ?? input.title,
|
255
255
|
description: input.description
|
@@ -263,7 +263,7 @@ function jsonSchemaRefToJtdRef(input, context) {
|
|
263
263
|
const refId = parts2[parts2.length - 1];
|
264
264
|
if (!refId) return {};
|
265
265
|
return {
|
266
|
-
|
266
|
+
isNullable: input.nullable,
|
267
267
|
ref: refId
|
268
268
|
};
|
269
269
|
}
|
package/dist/index.mjs
CHANGED
@@ -142,39 +142,39 @@ function jsonSchemaScalarToJtdScalar(input, _) {
|
|
142
142
|
case "Date":
|
143
143
|
return {
|
144
144
|
type: "timestamp",
|
145
|
-
|
145
|
+
isNullable: input.nullable,
|
146
146
|
metadata: meta
|
147
147
|
};
|
148
148
|
case "bigint":
|
149
149
|
case "integer":
|
150
150
|
return {
|
151
151
|
type: "int32",
|
152
|
-
|
152
|
+
isNullable: input.nullable,
|
153
153
|
metadata: meta
|
154
154
|
};
|
155
155
|
case "number":
|
156
156
|
return {
|
157
157
|
type: "float64",
|
158
|
-
|
158
|
+
isNullable: input.nullable,
|
159
159
|
metadata: meta
|
160
160
|
};
|
161
161
|
case "boolean":
|
162
162
|
return {
|
163
163
|
type: "boolean",
|
164
|
-
|
164
|
+
isNullable: input.nullable,
|
165
165
|
metadata: meta
|
166
166
|
};
|
167
167
|
case "string":
|
168
168
|
if (input.format === "date-time") {
|
169
169
|
return {
|
170
170
|
type: "timestamp",
|
171
|
-
|
171
|
+
isNullable: input.nullable,
|
172
172
|
metadata: meta
|
173
173
|
};
|
174
174
|
}
|
175
175
|
return {
|
176
176
|
type: "string",
|
177
|
-
|
177
|
+
isNullable: input.nullable,
|
178
178
|
metadata: meta
|
179
179
|
};
|
180
180
|
default:
|
@@ -184,8 +184,8 @@ function jsonSchemaScalarToJtdScalar(input, _) {
|
|
184
184
|
function jsonSchemaObjectToJtdObject(input, _) {
|
185
185
|
const result = {
|
186
186
|
properties: {},
|
187
|
-
|
188
|
-
|
187
|
+
isNullable: input.nullable,
|
188
|
+
isStrict: typeof input.additionalProperties === "boolean" ? !input.additionalProperties : void 0,
|
189
189
|
metadata: {
|
190
190
|
id: input.$id ?? input.title,
|
191
191
|
description: input.description
|
@@ -211,7 +211,7 @@ function jsonSchemaObjectToJtdObject(input, _) {
|
|
211
211
|
function jsonSchemaArrayToJtdArray(input, _) {
|
212
212
|
const result = {
|
213
213
|
elements: jsonSchemaToJtdSchema(input.items),
|
214
|
-
|
214
|
+
isNullable: input.nullable,
|
215
215
|
metadata: {
|
216
216
|
id: input.$id ?? input.title,
|
217
217
|
description: input.description
|
@@ -224,7 +224,7 @@ function jsonSchemaRecordToJtdRecord(input, _) {
|
|
224
224
|
const type = jsonSchemaToJtdSchema(input.additionalProperties);
|
225
225
|
return {
|
226
226
|
values: type,
|
227
|
-
|
227
|
+
isNullable: input.nullable,
|
228
228
|
metadata: {
|
229
229
|
id: input.$id ?? input.title,
|
230
230
|
description: input.description
|
@@ -247,7 +247,7 @@ function jsonSchemaRecordToJtdRecord(input, _) {
|
|
247
247
|
}
|
248
248
|
const result = {
|
249
249
|
values: types[0],
|
250
|
-
|
250
|
+
isNullable: input.nullable,
|
251
251
|
metadata: {
|
252
252
|
id: input.$id ?? input.title,
|
253
253
|
description: input.description
|
@@ -261,7 +261,7 @@ function jsonSchemaRefToJtdRef(input, context) {
|
|
261
261
|
const refId = parts2[parts2.length - 1];
|
262
262
|
if (!refId) return {};
|
263
263
|
return {
|
264
|
-
|
264
|
+
isNullable: input.nullable,
|
265
265
|
ref: refId
|
266
266
|
};
|
267
267
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "json-schema-to-atd",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.79.1",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": {
|
6
6
|
"name": "joshmossas",
|
@@ -22,6 +22,6 @@
|
|
22
22
|
"dist"
|
23
23
|
],
|
24
24
|
"dependencies": {
|
25
|
-
"@arrirpc/type-defs": "0.
|
25
|
+
"@arrirpc/type-defs": "0.79.1"
|
26
26
|
}
|
27
27
|
}
|