fix(api): align combo body and legacy key access (#12070)

Alinha o body do combo e o acesso legado por chave, com testes atualizados (CLI api-generator + row parsers). Validado no worktree combinado. Obrigado!
This commit is contained in:
Marcelo Karval
2026-08-30 11:10:06 -03:00
committed by GitHub
parent 09428da3d9
commit 82f09f4c86
8 changed files with 91 additions and 10 deletions

View File

@@ -130,7 +130,10 @@ for (const [tag, ops] of Object.entries(byTag)) {
lines.push(` .${flag}("--${kebab(p.name)} <${p.name}>", "${escapeStr(p.description)}")`);
}
if (hasBody) {
lines.push(` .option("--body <jsonOrPath>", "JSON body or @path/to/file.json")`);
const bodyFlag = op.requestBody.required ? "requiredOption" : "option";
lines.push(
` .${bodyFlag}("--body <jsonOrPath>", "JSON body or @path/to/file.json")`
);
}
lines.push(` .action(async (opts, cmd) => {`);
lines.push(` const gOpts = cmd.optsWithGlobals();`);