openapi-explorer 2.1.637 → 2.1.640
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.
@@ -110,12 +110,12 @@ export function getTypeInfo(schema, options = {
|
|
110
110
|
});
|
111
111
|
return info;
|
112
112
|
}
|
113
|
-
export function getSampleValueByType(schemaObj, fallbackPropertyName,
|
113
|
+
export function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleIds) {
|
114
114
|
var _Object$values$0$valu, _Object$values$, _schemaObj$type;
|
115
115
|
|
116
116
|
const example = Array.isArray(schemaObj.examples) ? schemaObj.examples[0] : (_Object$values$0$valu = (_Object$values$ = Object.values(schemaObj.examples || {})[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.value) !== null && _Object$values$0$valu !== void 0 ? _Object$values$0$valu : schemaObj.example;
|
117
117
|
|
118
|
-
if (
|
118
|
+
if (skipExampleIds && typeof example === 'string' && fallbackPropertyName.match(/id$/i)) {
|
119
119
|
return '';
|
120
120
|
}
|
121
121
|
|
@@ -161,7 +161,7 @@ export function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampl
|
|
161
161
|
return null;
|
162
162
|
}
|
163
163
|
|
164
|
-
if (
|
164
|
+
if (skipExampleIds && typeValue.match(/^string/g) && fallbackPropertyName.match(/id$/i)) {
|
165
165
|
return '';
|
166
166
|
}
|
167
167
|
|
@@ -382,7 +382,7 @@ function getSimpleValueResult(schema, config, namespace, prefix, xmlAttributes,
|
|
382
382
|
return config.xml ? [xmlTagProperties] : objectExamples;
|
383
383
|
}
|
384
384
|
|
385
|
-
const value = getSampleValueByType(schema, config.propertyName, config.
|
385
|
+
const value = getSampleValueByType(schema, config.propertyName, config.skipExampleIds);
|
386
386
|
return [value];
|
387
387
|
}
|
388
388
|
|
@@ -659,7 +659,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
659
659
|
}
|
660
660
|
/* Create Example object */
|
661
661
|
|
662
|
-
export function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType,
|
662
|
+
export function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType, skipExampleIds = false) {
|
663
663
|
const mimeType = rawMimeType || 'application/json';
|
664
664
|
const finalExamples = []; // First check if examples is provided
|
665
665
|
|
@@ -755,7 +755,7 @@ export function generateExample(examples, example, schema, rawMimeType, includeR
|
|
755
755
|
const config = {
|
756
756
|
includeReadOnly,
|
757
757
|
includeWriteOnly,
|
758
|
-
|
758
|
+
skipExampleIds,
|
759
759
|
xml: mimeType.toLowerCase().includes('xml')
|
760
760
|
};
|
761
761
|
const samples = getExampleValuesFromSchema(schema, config);
|
@@ -127,12 +127,12 @@ function getTypeInfo(schema, options = {
|
|
127
127
|
return info;
|
128
128
|
}
|
129
129
|
|
130
|
-
function getSampleValueByType(schemaObj, fallbackPropertyName,
|
130
|
+
function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleIds) {
|
131
131
|
var _Object$values$0$valu, _Object$values$, _schemaObj$type;
|
132
132
|
|
133
133
|
const example = Array.isArray(schemaObj.examples) ? schemaObj.examples[0] : (_Object$values$0$valu = (_Object$values$ = Object.values(schemaObj.examples || {})[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.value) !== null && _Object$values$0$valu !== void 0 ? _Object$values$0$valu : schemaObj.example;
|
134
134
|
|
135
|
-
if (
|
135
|
+
if (skipExampleIds && typeof example === 'string' && fallbackPropertyName.match(/id$/i)) {
|
136
136
|
return '';
|
137
137
|
}
|
138
138
|
|
@@ -178,7 +178,7 @@ function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleString
|
|
178
178
|
return null;
|
179
179
|
}
|
180
180
|
|
181
|
-
if (
|
181
|
+
if (skipExampleIds && typeValue.match(/^string/g) && fallbackPropertyName.match(/id$/i)) {
|
182
182
|
return '';
|
183
183
|
}
|
184
184
|
|
@@ -400,7 +400,7 @@ function getSimpleValueResult(schema, config, namespace, prefix, xmlAttributes,
|
|
400
400
|
return config.xml ? [xmlTagProperties] : objectExamples;
|
401
401
|
}
|
402
402
|
|
403
|
-
const value = getSampleValueByType(schema, config.propertyName, config.
|
403
|
+
const value = getSampleValueByType(schema, config.propertyName, config.skipExampleIds);
|
404
404
|
return [value];
|
405
405
|
}
|
406
406
|
|
@@ -679,7 +679,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
679
679
|
/* Create Example object */
|
680
680
|
|
681
681
|
|
682
|
-
function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType,
|
682
|
+
function generateExample(examples, example, schema, rawMimeType, includeReadOnly = true, includeWriteOnly = true, outputType, skipExampleIds = false) {
|
683
683
|
const mimeType = rawMimeType || 'application/json';
|
684
684
|
const finalExamples = []; // First check if examples is provided
|
685
685
|
|
@@ -775,7 +775,7 @@ function generateExample(examples, example, schema, rawMimeType, includeReadOnly
|
|
775
775
|
const config = {
|
776
776
|
includeReadOnly,
|
777
777
|
includeWriteOnly,
|
778
|
-
|
778
|
+
skipExampleIds,
|
779
779
|
xml: mimeType.toLowerCase().includes('xml')
|
780
780
|
};
|
781
781
|
const samples = getExampleValuesFromSchema(schema, config);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "openapi-explorer",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.640",
|
4
4
|
"description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
|
5
5
|
"author": "Authress Developers <developers@authress.io>",
|
6
6
|
"type": "module",
|