Repository navigation
fix: describe plain-text --body correctly in command metadata - #506
Conversation
_meta/commands.json hardcoded "Raw JSON request body" for every --body, so cf tools schemas told callers to send JSON to text/plain endpoints such as zaraz workflow update. For text/plain-only bodies, metadata now uses the same description as --help. Other bodies are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
commit: |
|
Review: 1 findings. 1 inline suggestion posted. |
|
| mean | stddev | min | max | |
|---|---|---|---|---|
| PR | 280.5 ms | 4.1 ms | 274.3 ms | 286.1 ms |
| base | 284.5 ms | 8.8 ms | 276.2 ms | 306.6 ms |
Δ (PR vs base): ↓ -4.0 ms (-1.4%)
Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.
There was a problem hiding this comment.
Superseded by the review of
c1427a39.
This review, of b941fcec
💬 Approved with comments — The fix is correct and tested. The only finding is a misplaced doc comment (SUGGESTION).
Findings: 1 suggestion (1 is an inline comment on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 suggestion
The fix is correct and tested. One doc comment now sits above the wrong declaration.
Recommendation: 💬 Optional Nits
- [SUGGESTION] Doc comment
/** generateBuilderLines. */now attaches toJSON_BODY_DESCRIPTIONinstead ofbuilderLines. (packages/cli/generator/plugin/emit/builder.ts:26)
View full review
packages/cli/generator/plugin/emit/builder.ts:26: the/**generateBuilderLines. */comment used to sit directly abovebuilderLines. The new exports were inserted between the comment and the function, so it now documentsJSON_BODY_DESCRIPTION.
✅ All other checks passed
📝 Documentation: ✅ LGTM
The changeset is a patch with an imperative title. It correctly says metadata now matches --help for text/plain bodies.
Reviewed commit: b941fcec
|
LGTM! |
There was a problem hiding this comment.
✅ Approved — The fix is correct, scoped to plain-text bodies, and covered by tests. The earlier doc-comment note is fixed and nothing else was found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
No security concerns.
📖 AGENTS.md: ✅ LGTM
The existing AGENTS.md guidance covers this change. No update is needed.
📋 Code Quality: ✅ LGTM
isPlainTextBodytreats a body as plain text only when every request content type starts withtext/plain. This matches how the generator already classifies plain-text bodies.--helpand the metadata both get the description frombodyOptionDescription. JSON, binary and mixed-media bodies keepJSON_BODY_DESCRIPTION.- The regenerated outputs change only the
--bodydescription. /** generateBuilderLines. */sits directly abovebuilderLinesagain.
⚡ Performance: ✅ LGTM
No performance concerns.
📝 Documentation: ✅ LGTM
The changeset is a patch with an imperative title, and its body matches the change.
Reviewed commit: c1427a39
Command metadata used by
cf toolsdescribes every--bodyas raw JSON,even for endpoints that send plain text. For bodies whose media types are
all
text/plain, reuse the description shown by--help, including forparameterized media types such as
text/plain;charset=UTF-8. When theschema provides no description, both help and metadata use plain-text
wording instead of asking for JSON.
Keep the existing metadata wording for JSON,
application/octet-stream,and mixed-media bodies. At the pinned OpenAPI version, regeneration updates
the help and metadata for
cf analytics-engine sql queryandcf logs query.This keeps the fix scoped to plain-text bodies, replacing the broader #505.
Validation:
pnpm checkpasses, including generation, builds, type checks, lint, and formatting.help, parameterized media types, missing and empty descriptions, mixed content
types, and unchanged JSON/binary metadata.