u
This commit is contained in:
@@ -197,6 +197,15 @@ function renderSchemaPropertiesTable(schema, components) {
|
||||
}
|
||||
const desc = (prop.description || '').replace(/[\r\n|]+/g, ' ').trim();
|
||||
lines.push(`| \`${name}\` | ${isReq} | ${type} | ${desc} |`);
|
||||
if (prop.type === 'array' && prop.items?.properties) {
|
||||
const itemReq = new Set(prop.items.required || []);
|
||||
for (const [subName, subProp] of Object.entries(prop.items.properties)) {
|
||||
const subIsReq = itemReq.has(subName) ? 'yes' : 'no';
|
||||
const subType = subProp.type || schemaRefName(subProp) || '';
|
||||
const subDesc = (subProp.description || '').replace(/[\r\n|]+/g, ' ').trim();
|
||||
lines.push(`| \`${name}[].${subName}\` | ${subIsReq} | ${subType} | ${subDesc} |`);
|
||||
}
|
||||
}
|
||||
}
|
||||
lines.push('');
|
||||
return lines;
|
||||
@@ -557,7 +566,7 @@ function summarizeParamSchema(schema, components) {
|
||||
const sub = summarizeParamSchema(propSchema, components);
|
||||
return `${k}${optSuffix}: ${sub}`;
|
||||
}
|
||||
if (sortedProps.length === 1 && propSchema?.type) {
|
||||
if ((k === 'sku' || sortedProps.length === 1) && propSchema?.type) {
|
||||
return `${k}${optSuffix}: ${propSchema.type}`;
|
||||
}
|
||||
return `${k}${optSuffix}`;
|
||||
|
||||
Reference in New Issue
Block a user