Repository navigation
fix(api): preserve parameter shapes across CLI inputs - #12
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (82)
📒 Files selected for processing (9)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe CLI now shares parameter-path parsing and nested-value construction across data flags and stdin. Operation metadata enables schema-based typing for JSON input, while generated GET calls flatten parameters and encode selected arrays for SDK requests. README instructions were revised for setup, JSON output, code samples, listeners, and feedback. ChangesParameter parsing and SDK calls
README instructions
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant GeneratedOperation
participant loadOperationParams
participant resolveOperationParams
participant buildParams
participant toSdkParams
participant SDK
GeneratedOperation->>loadOperationParams: pass operation options and data flags
loadOperationParams->>resolveOperationParams: resolve parameters
resolveOperationParams->>buildParams: assemble bracket paths
buildParams-->>resolveOperationParams: return nested parameters
resolveOperationParams-->>loadOperationParams: return resolved parameters
loadOperationParams-->>GeneratedOperation: return loaded parameters
GeneratedOperation->>toSdkParams: adapt GET parameters
toSdkParams-->>GeneratedOperation: return SDK parameters
GeneratedOperation->>SDK: call operation
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change preserves parameter shapes across CLI inputs and no concrete merge-blocking risk was identified. 🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 8 files. (1 skipped: 1 unsupported.)
Comment |
Test coverage✅ Gate passed — all 78 files are at or above the 95% floor.
|
Summary
-dflags and JSON stdin, including nested bracket paths, indexed arrays, and Chargebee's field-first indexed format.This addresses P1–P6 in the request-parameter reference. The Node SDK bug underlying P4 still needs an upstream fix; the CLI workaround makes its generated GET commands send the intended keys.
Verification
bun test src/tests/unit/lib/api/params.test.ts src/tests/unit/lib/api/stdin-params.encoding.test.ts src/tests/unit/lib/codesample/index.test.ts src/tests/integration/stdin-params.test.ts— 86 passedbun run typecheck— passedbun run test:coverageandbun run coverage:gate /private/tmp/chargebee-params-coverage.txt— passed; all 78 covered files meet the 95% gatebun run buildandbun run build:npm— passedAdds shared parsing for
-dflags and JSON stdin, including nested paths, indexed arrays, and scalar-array shorthand. Uses operation schemas to type JSON-body values. Flattens GET parameters for SDK requests while preserving nested parameters for code samples. Updates command generation, tests, and README guidance.