This commit is contained in:
seb
2026-09-30 20:12:30 +02:00
parent e358eccca9
commit 541a34382f
9 changed files with 51 additions and 14 deletions

View File

@@ -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}`;