fix(docs): openapi labels for different bulk api variants#4223
Conversation
|
WalkthroughUpdated 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
docs/v3-openapi.yaml (1)
4828-4903: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAdd
additionalProperties: falseto eachoneOfvariant for stricter validation.The upstream Zod schema uses
.refine()to enforce exactly one offilterorrunIds, andz.never()to rejecttargetRegionon cancel. WithoutadditionalProperties: false, the OpenAPIoneOfvariants will:
- Match multiple variants when both
filterandrunIdsare present (both validate as extra properties are allowed), causing ambiguousoneOfresolution.- Accept
targetRegionon cancel variants (it would be an extra property), contradicting the Zodz.never()constraint.Adding
additionalProperties: falseto each variant aligns the OpenAPI schema with the runtime validation behavior.♻️ Proposed fix — add
additionalProperties: falseto all four variantsCreateBulkActionRequestBody: oneOf: - title: Cancel by filter type: object + additionalProperties: false required: - action - filter properties: action: type: string enum: - cancel filter: $ref: "`#/components/schemas/BulkActionFilter`" name: type: string maxLength: 255 - title: Cancel by run IDs type: object + additionalProperties: false required: - action - runIds properties: action: type: string enum: - cancel runIds: type: array minItems: 1 maxItems: 500 items: type: string name: type: string maxLength: 255 - title: Replay by filter type: object + additionalProperties: false required: - action - filter properties: action: type: string enum: - replay filter: $ref: "`#/components/schemas/BulkActionFilter`" name: type: string maxLength: 255 targetRegion: type: string description: Region identifier to replay runs in. When omitted, each replay keeps the original run's region. - title: Replay by run IDs type: object + additionalProperties: false required: - action - runIds properties: action: type: string enum: - replay runIds: type: array minItems: 1 maxItems: 500 items: type: string name: type: string maxLength: 255 targetRegion: type: string description: Region identifier to replay runs in. When omitted, each replay keeps the original run's region.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d3d9cb7c-e693-46de-96ad-72397b8327ec
📒 Files selected for processing (1)
docs/v3-openapi.yaml
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: code-quality / code-quality
- GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (1)
**/{Dockerfile*,*.{yml,yaml}}
📄 CodeRabbit inference engine (AGENTS.md)
When updating Docker image references, always use multiplatform/index digests rather than architecture-specific digests.
Files:
docs/v3-openapi.yaml
🔇 Additional comments (2)
docs/v3-openapi.yaml (2)
4830-4854: Variant titles and required selectors align well with the upstream Zod contract.The four
oneOfvariants correctly split cancel/replay by filter/run-IDs with appropriaterequiredfields, matching the discriminated union and refinement logic in the Zod schema. ThetargetRegionfield is correctly omitted from cancel variants and included only in replay variants, consistent withz.never().optional()vsz.string().optional().Also applies to: 4864-4881
4855-4863: 🗄️ Data Integrity & Integration
maxItems: 500matches the runtime limit
BULK_ACTION_MAX_RUN_IDSdefaults to500, so the OpenAPI schema matches the route handler.> Likely an incorrect or invalid review comment.
Replace Option 1 Option 2 etc with labelled variants.