chore: pass OpenAPI generator config via --opt flags - #1743
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
This pull request has been automatically marked as stale because it has been inactive for 14 days. It will be closed in 7 days if no further activity occurs. |
The chat-side Kotlin generator now takes its configuration through the generic `--opt key=value` flag (via the Configurable interface) instead of bespoke named flags. Update the generation script accordingly: - Convert the generate-client invocation to `--opt key=value` form. - Drop `--model-dir` (the generator hardcodes the models directory; the flag was a no-op) and its now-unused MODEL_DIR variable / argument. - classes-to-skip is space-separated (the --opt slice flag splits comma lists). - Point REFERENCE_VALUE at `master`, since the generator changes land there. Generated output is unchanged (byte-identical vs the previous generator).
The backend generator's SDK option was renamed androidSdk -> android-sdk during review before landing on master. Update the invocation to match, otherwise generate-client fails with `kotlin: unknown option "androidSdk"`.
c16aff8 to
c2f670e
Compare
WalkthroughThe OpenAPI generation script updates its defaults, removes model-directory CLI configuration, and changes client generator arguments to ChangesOpenAPI generation workflow
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@generate_openapi_v2.sh`:
- Around line 191-198: The generate_openapi_v2.sh option handling must remain
aligned with scripts/open-api-code-gen.gradle.kts: restore parsing and
forwarding of the model-dir argument, or remove the Gradle caller’s modelsDir
configuration and argument if model directories are intentionally retired.
Ensure configured model directories are neither silently ignored nor rejected
unexpectedly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 855af949-c3bf-482d-bd59-1125a3b408cf
📒 Files selected for processing (1)
generate_openapi_v2.sh
generate_openapi_v2.sh no longer accepts --model-dir (the backend generator hardcodes the models directory and never honored the flag), so the Gradle caller passing it would fail with "Unknown argument". Remove the argument and the now-unused modelsDir property.
The Gradle task's default refValue still pointed at the merged (now-deleted) feature branch, so `generateOpenApiClient` would fail at `git clone --branch`. Default to master, matching the script's own default and the intended source.
|
|
🚀 Available in v1.30.0 |



Part of AND-1306
Goal
The backend Kotlin OpenAPI generator was refactored so it takes its configuration through the generic
--opt key=valueflag (theConfigurableinterface master already uses for Swift) instead of a set of bespoke named flags. This keeps the sharedchatgenerator command free of language-specific flags. This PR updates the video client generation script to match the new interface.Implementation
generate-clientinvocation to--opt key=valueform.--opt android-sdk=<video|feeds|chat>(kebab-case; the generator validates it).--model-dir: the generator hardcodes the models directory, so the flag was a no-op. Removed the flag, itsMODEL_DIRvariable, and its argument handling.classes-to-skipis now space-separated — the--optslice flag splits comma-separated values, so a comma list would be mangled.REFERENCE_VALUEatmaster.🎨 UI Changes
N/A — build/tooling script only.
Testing
Ran the full script end-to-end against current
master: it clonesmaster, buildschat-manager, generates the video spec, and generates the Kotlin client — exit 0, valid output (apis/+models/+infrastructure/). Output matches the previous generator for the same spec; this is a tooling/invocation change with no generator behavior change.☑️Contributor Checklist
General
developbranchCode & documentation