@omnigraph/openapi 0.109.26-alpha-20251222165409-cc8cf76d99560e294732f3e191afdd001aae41eb → 0.109.26-alpha-20251222190430-40d2c2a2f350d4cc8dd5c6c08b96f96834728327
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.
|
@@ -68,32 +68,7 @@ async function getJSONSchemaOptionsFromOpenAPIOptions(name, { source, fallbackFo
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
(0, json_machete_1.handleUntitledDefinitions)(oasOrSwagger);
|
|
71
|
-
|
|
72
|
-
if (map != null) {
|
|
73
|
-
for (const keyInMap in map) {
|
|
74
|
-
const val = map[keyInMap];
|
|
75
|
-
if (val.title === key) {
|
|
76
|
-
return val;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function lookFromMap(map, key) {
|
|
82
|
-
if (map != null) {
|
|
83
|
-
const val = map[key];
|
|
84
|
-
if (val == null) {
|
|
85
|
-
return lookByTitle(map, key);
|
|
86
|
-
}
|
|
87
|
-
return val;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function lookFromMaps(oas, key) {
|
|
91
|
-
return (lookFromMap(oas.components?.schemas, key) ||
|
|
92
|
-
lookFromMap(oas.definitions, key));
|
|
93
|
-
}
|
|
94
|
-
for (const [_name, schema] of Object.entries(oasOrSwagger.components?.schemas ||
|
|
95
|
-
oasOrSwagger.definitions ||
|
|
96
|
-
{})) {
|
|
71
|
+
for (const [_name, schema] of Object.entries(oasOrSwagger.components?.schemas || {})) {
|
|
97
72
|
const mapping = schema.discriminator?.mapping;
|
|
98
73
|
if (mapping) {
|
|
99
74
|
for (const [key, value] of Object.entries(mapping)) {
|
|
@@ -109,7 +84,7 @@ async function getJSONSchemaOptionsFromOpenAPIOptions(name, { source, fallbackFo
|
|
|
109
84
|
continue;
|
|
110
85
|
}
|
|
111
86
|
else {
|
|
112
|
-
const schemaObj =
|
|
87
|
+
const schemaObj = oasOrSwagger.components?.schemas?.[value];
|
|
113
88
|
if (!schemaObj) {
|
|
114
89
|
logger.warn(`Invalid discriminator mapping: ${value}`);
|
|
115
90
|
continue;
|
|
@@ -63,32 +63,7 @@ export async function getJSONSchemaOptionsFromOpenAPIOptions(name, { source, fal
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
handleUntitledDefinitions(oasOrSwagger);
|
|
66
|
-
|
|
67
|
-
if (map != null) {
|
|
68
|
-
for (const keyInMap in map) {
|
|
69
|
-
const val = map[keyInMap];
|
|
70
|
-
if (val.title === key) {
|
|
71
|
-
return val;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function lookFromMap(map, key) {
|
|
77
|
-
if (map != null) {
|
|
78
|
-
const val = map[key];
|
|
79
|
-
if (val == null) {
|
|
80
|
-
return lookByTitle(map, key);
|
|
81
|
-
}
|
|
82
|
-
return val;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function lookFromMaps(oas, key) {
|
|
86
|
-
return (lookFromMap(oas.components?.schemas, key) ||
|
|
87
|
-
lookFromMap(oas.definitions, key));
|
|
88
|
-
}
|
|
89
|
-
for (const [_name, schema] of Object.entries(oasOrSwagger.components?.schemas ||
|
|
90
|
-
oasOrSwagger.definitions ||
|
|
91
|
-
{})) {
|
|
66
|
+
for (const [_name, schema] of Object.entries(oasOrSwagger.components?.schemas || {})) {
|
|
92
67
|
const mapping = schema.discriminator?.mapping;
|
|
93
68
|
if (mapping) {
|
|
94
69
|
for (const [key, value] of Object.entries(mapping)) {
|
|
@@ -104,7 +79,7 @@ export async function getJSONSchemaOptionsFromOpenAPIOptions(name, { source, fal
|
|
|
104
79
|
continue;
|
|
105
80
|
}
|
|
106
81
|
else {
|
|
107
|
-
const schemaObj =
|
|
82
|
+
const schemaObj = oasOrSwagger.components?.schemas?.[value];
|
|
108
83
|
if (!schemaObj) {
|
|
109
84
|
logger.warn(`Invalid discriminator mapping: ${value}`);
|
|
110
85
|
continue;
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnigraph/openapi",
|
|
3
|
-
"version": "0.109.26-alpha-
|
|
3
|
+
"version": "0.109.26-alpha-20251222190430-40d2c2a2f350d4cc8dd5c6c08b96f96834728327",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@graphql-mesh/cross-helpers": "^0.4.11",
|
|
10
|
-
"@graphql-mesh/fusion-composition": "0.8.23-alpha-
|
|
10
|
+
"@graphql-mesh/fusion-composition": "0.8.23-alpha-20251222190430-40d2c2a2f350d4cc8dd5c6c08b96f96834728327",
|
|
11
11
|
"@graphql-mesh/string-interpolation": "^0.5.9",
|
|
12
12
|
"@graphql-mesh/types": "^0.104.18",
|
|
13
13
|
"@graphql-mesh/utils": "^0.104.18",
|
|
14
14
|
"@graphql-tools/utils": "^10.11.0",
|
|
15
|
-
"@omnigraph/json-schema": "0.109.20-alpha-
|
|
15
|
+
"@omnigraph/json-schema": "0.109.20-alpha-20251222190430-40d2c2a2f350d4cc8dd5c6c08b96f96834728327",
|
|
16
16
|
"change-case": "^4.1.2",
|
|
17
17
|
"json-machete": "^0.97.6",
|
|
18
18
|
"openapi-types": "^12.1.0",
|