@mintlify/common
Version:
Commonly shared code within Mintlify
21 lines (20 loc) • 820 B
JavaScript
export const getParametersData = (channel) => {
const parameters = channel.parameters().all();
return parameters.map((parameter) => {
var _a, _b, _c;
const id = parameter.id();
const deprecated = (_a = parameter.schema()) === null || _a === void 0 ? void 0 : _a.deprecated();
const jsonSchema = (_b = parameter.schema()) === null || _b === void 0 ? void 0 : _b['_json'];
const type = jsonSchema['type'] || undefined;
const propertiesCount = ((_c = jsonSchema['properties']) === null || _c === void 0 ? void 0 : _c.length) || undefined;
return {
id,
jsonSchema,
description: parameter.description(),
type,
propertiesCount,
required: true,
deprecated,
};
});
};