json-machete 0.7.6 → 0.7.8-alpha-59619cd02.0
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/index.js +8 -2
- package/index.mjs +8 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -357,7 +357,7 @@ function getCwd(path) {
|
|
|
357
357
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
358
358
|
async function dereferenceObject(obj, { cwd = process.cwd(), externalFileCache = new Map(), refMap = new Map(), root = obj, fetch = crossUndiciFetch.fetch, headers, } = {}) {
|
|
359
359
|
var _a;
|
|
360
|
-
if (typeof obj === 'object') {
|
|
360
|
+
if (obj != null && typeof obj === 'object') {
|
|
361
361
|
if (isRefObject(obj)) {
|
|
362
362
|
const $ref = obj.$ref;
|
|
363
363
|
if (refMap.has($ref)) {
|
|
@@ -585,6 +585,12 @@ async function healJSONSchema(schema) {
|
|
|
585
585
|
if (subSchema.items) {
|
|
586
586
|
subSchema.type = 'array';
|
|
587
587
|
}
|
|
588
|
+
if (subSchema.format === 'int64') {
|
|
589
|
+
subSchema.type = 'integer';
|
|
590
|
+
}
|
|
591
|
+
if (subSchema.format) {
|
|
592
|
+
subSchema.type = 'string';
|
|
593
|
+
}
|
|
588
594
|
}
|
|
589
595
|
if (subSchema.type === 'string' && !subSchema.format && (subSchema.examples || subSchema.example)) {
|
|
590
596
|
const examples = asArray(subSchema.examples || subSchema.example || []);
|
|
@@ -598,7 +604,7 @@ async function healJSONSchema(schema) {
|
|
|
598
604
|
if (subSchema.format === 'dateTime') {
|
|
599
605
|
subSchema.format = 'date-time';
|
|
600
606
|
}
|
|
601
|
-
if (subSchema.format) {
|
|
607
|
+
if (subSchema.type === 'string' && subSchema.format) {
|
|
602
608
|
if (!JSONSchemaStringFormats.includes(subSchema.format)) {
|
|
603
609
|
delete subSchema.format;
|
|
604
610
|
}
|
package/index.mjs
CHANGED
|
@@ -352,7 +352,7 @@ function getCwd(path$1) {
|
|
|
352
352
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
353
353
|
async function dereferenceObject(obj, { cwd = process.cwd(), externalFileCache = new Map(), refMap = new Map(), root = obj, fetch: fetch$1 = fetch, headers, } = {}) {
|
|
354
354
|
var _a;
|
|
355
|
-
if (typeof obj === 'object') {
|
|
355
|
+
if (obj != null && typeof obj === 'object') {
|
|
356
356
|
if (isRefObject(obj)) {
|
|
357
357
|
const $ref = obj.$ref;
|
|
358
358
|
if (refMap.has($ref)) {
|
|
@@ -580,6 +580,12 @@ async function healJSONSchema(schema) {
|
|
|
580
580
|
if (subSchema.items) {
|
|
581
581
|
subSchema.type = 'array';
|
|
582
582
|
}
|
|
583
|
+
if (subSchema.format === 'int64') {
|
|
584
|
+
subSchema.type = 'integer';
|
|
585
|
+
}
|
|
586
|
+
if (subSchema.format) {
|
|
587
|
+
subSchema.type = 'string';
|
|
588
|
+
}
|
|
583
589
|
}
|
|
584
590
|
if (subSchema.type === 'string' && !subSchema.format && (subSchema.examples || subSchema.example)) {
|
|
585
591
|
const examples = asArray(subSchema.examples || subSchema.example || []);
|
|
@@ -593,7 +599,7 @@ async function healJSONSchema(schema) {
|
|
|
593
599
|
if (subSchema.format === 'dateTime') {
|
|
594
600
|
subSchema.format = 'date-time';
|
|
595
601
|
}
|
|
596
|
-
if (subSchema.format) {
|
|
602
|
+
if (subSchema.type === 'string' && subSchema.format) {
|
|
597
603
|
if (!JSONSchemaStringFormats.includes(subSchema.format)) {
|
|
598
604
|
delete subSchema.format;
|
|
599
605
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-machete",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8-alpha-59619cd02.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@graphql-mesh/cross-helpers": "0.1.0",
|
|
7
|
-
"@graphql-mesh/utils": "0.33.
|
|
7
|
+
"@graphql-mesh/utils": "0.33.2",
|
|
8
8
|
"@graphql-tools/utils": "8.6.5",
|
|
9
9
|
"@json-schema-tools/meta-schema": "1.6.19",
|
|
10
10
|
"cross-undici-fetch": "0.1.28",
|