@stoplight/elements-core 7.7.13 → 7.7.14
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/components/TryIt/Parameters/parameter-utils.d.ts +1 -1
- package/index.esm.js +3 -1
- package/index.js +3 -1
- package/index.mjs +3 -1
- package/package.json +1 -1
|
@@ -28,6 +28,6 @@ export declare function mapSchemaPropertiesToParameters(properties: {
|
|
|
28
28
|
schema: import("json-schema").JSONSchema7 | undefined;
|
|
29
29
|
examples: {
|
|
30
30
|
key: string;
|
|
31
|
-
value:
|
|
31
|
+
value: any;
|
|
32
32
|
}[] | undefined;
|
|
33
33
|
}[];
|
package/index.esm.js
CHANGED
|
@@ -1121,7 +1121,9 @@ const initialParameterValues = params => {
|
|
|
1121
1121
|
return mapValues(paramsByName, param => getInitialValueForParameter(param));
|
|
1122
1122
|
};
|
|
1123
1123
|
function mapSchemaPropertiesToParameters(properties, required) {
|
|
1124
|
-
return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples
|
|
1124
|
+
return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples && schema.examples[0]
|
|
1125
|
+
? [{ key: 'example', value: schema.examples[0] }]
|
|
1126
|
+
: undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
|
|
1125
1127
|
}
|
|
1126
1128
|
|
|
1127
1129
|
const ParameterEditor = ({ parameter, value, onChange, isOptional, onChangeOptional, canChangeOptional, validate, }) => {
|
package/index.js
CHANGED
|
@@ -1174,7 +1174,9 @@ const initialParameterValues = params => {
|
|
|
1174
1174
|
return mapValues__default["default"](paramsByName, param => getInitialValueForParameter(param));
|
|
1175
1175
|
};
|
|
1176
1176
|
function mapSchemaPropertiesToParameters(properties, required) {
|
|
1177
|
-
return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples
|
|
1177
|
+
return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples && schema.examples[0]
|
|
1178
|
+
? [{ key: 'example', value: schema.examples[0] }]
|
|
1179
|
+
: undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
|
|
1178
1180
|
}
|
|
1179
1181
|
|
|
1180
1182
|
const ParameterEditor = ({ parameter, value, onChange, isOptional, onChangeOptional, canChangeOptional, validate, }) => {
|
package/index.mjs
CHANGED
|
@@ -1121,7 +1121,9 @@ const initialParameterValues = params => {
|
|
|
1121
1121
|
return mapValues(paramsByName, param => getInitialValueForParameter(param));
|
|
1122
1122
|
};
|
|
1123
1123
|
function mapSchemaPropertiesToParameters(properties, required) {
|
|
1124
|
-
return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples
|
|
1124
|
+
return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples && schema.examples[0]
|
|
1125
|
+
? [{ key: 'example', value: schema.examples[0] }]
|
|
1126
|
+
: undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
|
|
1125
1127
|
}
|
|
1126
1128
|
|
|
1127
1129
|
const ParameterEditor = ({ parameter, value, onChange, isOptional, onChangeOptional, canChangeOptional, validate, }) => {
|