@omnigraph/openapi 0.109.26-alpha-20251230130150-bf5fbd3c8b3712dd47b7bee8773cc1a5a7eee397 → 0.109.26-alpha-20260101192804-25e4f6dc39172b18bb342385e70b5fda7eaa5f55
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.
|
@@ -311,20 +311,14 @@ async function getJSONSchemaOptionsFromOpenAPIOptions(name, { source, fallbackFo
|
|
|
311
311
|
if ('content' in requestBodyObj) {
|
|
312
312
|
// use json if available, otherwise fall back to the first type
|
|
313
313
|
const contentKeys = Object.keys(requestBodyObj.content);
|
|
314
|
-
const contentKey = contentKeys.find(contentKey => typeof contentKey === 'string' && contentKey.
|
|
314
|
+
const contentKey = contentKeys.find(contentKey => typeof contentKey === 'string' && contentKey.match('json')) || contentKeys[0];
|
|
315
315
|
const contentSchema = requestBodyObj.content[contentKey]?.schema;
|
|
316
316
|
if (contentSchema && Object.keys(contentSchema).length > 0) {
|
|
317
317
|
operationConfig.requestSchema = contentSchema;
|
|
318
318
|
}
|
|
319
319
|
const examplesObj = requestBodyObj.content[contentKey]?.examples;
|
|
320
320
|
if (examplesObj) {
|
|
321
|
-
|
|
322
|
-
if (typeof firstItem === 'object' && 'value' in firstItem) {
|
|
323
|
-
operationConfig.requestSample = firstItem.value;
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
operationConfig.requestSample = firstItem;
|
|
327
|
-
}
|
|
321
|
+
operationConfig.requestSample = Object.values(examplesObj)[0];
|
|
328
322
|
}
|
|
329
323
|
if (!operationConfig.headers?.['Content-Type'] && typeof contentKey === 'string') {
|
|
330
324
|
operationConfig.headers = operationConfig.headers || {};
|
|
@@ -306,20 +306,14 @@ export async function getJSONSchemaOptionsFromOpenAPIOptions(name, { source, fal
|
|
|
306
306
|
if ('content' in requestBodyObj) {
|
|
307
307
|
// use json if available, otherwise fall back to the first type
|
|
308
308
|
const contentKeys = Object.keys(requestBodyObj.content);
|
|
309
|
-
const contentKey = contentKeys.find(contentKey => typeof contentKey === 'string' && contentKey.
|
|
309
|
+
const contentKey = contentKeys.find(contentKey => typeof contentKey === 'string' && contentKey.match('json')) || contentKeys[0];
|
|
310
310
|
const contentSchema = requestBodyObj.content[contentKey]?.schema;
|
|
311
311
|
if (contentSchema && Object.keys(contentSchema).length > 0) {
|
|
312
312
|
operationConfig.requestSchema = contentSchema;
|
|
313
313
|
}
|
|
314
314
|
const examplesObj = requestBodyObj.content[contentKey]?.examples;
|
|
315
315
|
if (examplesObj) {
|
|
316
|
-
|
|
317
|
-
if (typeof firstItem === 'object' && 'value' in firstItem) {
|
|
318
|
-
operationConfig.requestSample = firstItem.value;
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
operationConfig.requestSample = firstItem;
|
|
322
|
-
}
|
|
316
|
+
operationConfig.requestSample = Object.values(examplesObj)[0];
|
|
323
317
|
}
|
|
324
318
|
if (!operationConfig.headers?.['Content-Type'] && typeof contentKey === 'string') {
|
|
325
319
|
operationConfig.headers = operationConfig.headers || {};
|
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-20260101192804-25e4f6dc39172b18bb342385e70b5fda7eaa5f55",
|
|
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-20260101192804-25e4f6dc39172b18bb342385e70b5fda7eaa5f55",
|
|
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-20260101192804-25e4f6dc39172b18bb342385e70b5fda7eaa5f55",
|
|
16
16
|
"change-case": "^4.1.2",
|
|
17
17
|
"json-machete": "^0.97.6",
|
|
18
18
|
"openapi-types": "^12.1.0",
|