Skip to content

docs(user-guide): fix incorrect --output defaults across resources#51

Merged
shreemaan-abhishek merged 2 commits into
masterfrom
docs/audit-output-defaults
May 26, 2026
Merged

docs(user-guide): fix incorrect --output defaults across resources#51
shreemaan-abhishek merged 2 commits into
masterfrom
docs/audit-output-defaults

Conversation

@shreemaan-abhishek
Copy link
Copy Markdown
Contributor

@shreemaan-abhishek shreemaan-abhishek commented May 26, 2026

Summary

Fixes #49.

Several docs/user-guide/*.md tables claimed --output defaults to yaml when the source code actually defaults to json (create/update) or table (get). This PR aligns the Default column and format list with the actual if format == "" blocks in pkg/cmd/<resource>/<action>/*.go.

Code defaults that the docs now reflect:

Command type Default
list table
get table (FIELD/VALUE view)
create / update json
export / config dump yaml

For create/update commands that have no tableprinter path (route, service, ssl, stream-route, proto), table is also removed from the format list since cmdutil.NewExporter rejects it as unsupported output format: table.

docs/user-guide/global-rule.md is intentionally left alone — open PR #45 fixes those three rows.

Files changed (10)

  • consumer.md, credential.md, gateway-group.md, plugin-metadata.md, proto.md, route.md, secret.md, service.md, ssl.md, stream-route.md

Skipped: bulk-operations.md (planned/unimplemented), declarative-config.md (already correct), debug.md (already correct), plugin.md (already correct).

Test plan

  • grep -n '\--output`' docs/user-guide/*.mdshows every row now matches the correspondingif format == ""block inpkg/cmd/`.
  • Spot-checked get paths (e.g. pkg/cmd/secret/get/get.go, pkg/cmd/gateway-group/get/get.go, pkg/cmd/proto/get/get.go) all fall through to tableprinter when Output == "".
  • Spot-checked create/update paths for route, service, ssl, stream-route, proto confirm no tableprinter codepath, so table was wrongly listed.
  • Docs-only change; no behavior modified.

Summary by CodeRabbit

  • Documentation
    • Updated CLI command output format defaults across multiple commands including consumer, credential, gateway-group, plugin-metadata, proto, route, secret, service, SSL, and stream-route.
    • Default formats now vary: get commands default to table, while create and update commands default to json.

Review Change Stack

The Default cell and format list for several `--output` rows didn't match
the source: `get` defaults to `table` (FIELD/VALUE view), `create`/`update`
default to `json`, and only `export`/`config dump` default to `yaml`.

Fixed across consumer, credential, gateway-group, plugin-metadata, proto,
route, secret, service, ssl and stream-route. Where create/update has no
tableprinter path (route, service, ssl, stream-route, proto), `table` is
also removed from the format list since the exporter would reject it.

global-rule.md is left for PR #45 which already fixes that file.

Refs #49.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 21d17de3-eb5c-4798-82f1-0da9ea693ab0

📥 Commits

Reviewing files that changed from the base of the PR and between 24a54d7 and 9620681.

📒 Files selected for processing (10)
  • docs/user-guide/consumer.md
  • docs/user-guide/credential.md
  • docs/user-guide/gateway-group.md
  • docs/user-guide/plugin-metadata.md
  • docs/user-guide/proto.md
  • docs/user-guide/route.md
  • docs/user-guide/secret.md
  • docs/user-guide/service.md
  • docs/user-guide/ssl.md
  • docs/user-guide/stream-route.md

📝 Walkthrough

Walkthrough

User-guide documentation for nine CLI resource commands was updated to correct the documented --output flag defaults to match actual CLI behavior: get commands now documented as defaulting to table, create and update commands now documented as defaulting to json.

Changes

CLI documentation output format defaults

Layer / File(s) Summary
Output format defaults audit across all commands
docs/user-guide/consumer.md, docs/user-guide/credential.md, docs/user-guide/gateway-group.md, docs/user-guide/plugin-metadata.md, docs/user-guide/proto.md, docs/user-guide/route.md, docs/user-guide/secret.md, docs/user-guide/service.md, docs/user-guide/ssl.md, docs/user-guide/stream-route.md
Updated --output flag documentation for get, create, and update subcommands across nine resource types. get commands documented as defaulting to table (previously yaml), and create/update commands documented as defaulting to json (previously yaml or table).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing incorrect --output defaults in user guide documentation across multiple resources.
Linked Issues check ✅ Passed The PR comprehensively addresses issue #49 by auditing and correcting --output defaults across all 10 documented resource files (consumer, credential, gateway-group, plugin-metadata, proto, route, secret, service, ssl, stream-route) to match actual code defaults.
Out of Scope Changes check ✅ Passed All changes are documentation-only updates to --output defaults in user guide files, directly aligned with the scope defined in issue #49 and PR objectives.
E2e Test Quality Review ✅ Passed PR is documentation-only (10 .md files), containing no tests, code, error handling, or concurrency. Check designed for code/test quality is not applicable.
Security Check ✅ Passed Documentation-only PR updating markdown files with corrected --output defaults; no code changes, no credential exposure, placeholder values properly used throughout all files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/audit-output-defaults

Comment @coderabbitai help to get the list of available commands and usage tips.

…efaults

# Conflicts:
#	docs/user-guide/credential.md
@shreemaan-abhishek shreemaan-abhishek merged commit 04cbe5e into master May 26, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(user-guide): audit and fix incorrect --output defaults across all resources

1 participant