fix(integrations): accept serializer nulls for optional vanta params#5015
fix(integrations): accept serializer nulls for optional vanta params#5015waleedlatif1 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Optional body fields across Adds Reviewed by Cursor Bugbot for commit 735815f. Configure here. |
Greptile SummaryFixes a validation error thrown when the workflow serializer emits
Confidence Score: 5/5The change is safe to merge: it widens validation to accept null on optional fields that were already being skipped at the URL-building layer, and all required identifiers remain strict. The fix is targeted and well-scoped — ~40 No files require special attention. The PR description correctly notes that the CrowdStrike contract has the same latent pattern, but that is out of scope here. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Workflow Serializer] -->|emits null for empty subblock| B[POST /api/tools/vanta/query]
B --> C{Contract Validation}
C -->|optional fields use .nullish| D[Parsed body with null fields]
C -->|required IDs use .string.min1| E[Reject null - 400]
D --> F[buildVantaApiRequest]
F --> G[buildVantaUrl]
G -->|null values skipped| H[Vanta API URL]
H --> I[fetchVantaWithAuth]
I --> J[Vanta REST API]
K[region is null] --> L[getVantaBaseUrl - defaults to us]
L --> J
Reviews (1): Last reviewed commit: "fix(integrations): accept serializer nul..." | Re-trigger Greptile |
|
Closing — this per-contract approach fixes symptoms file-by-file. The root cause (workflow serializer emits null for empty optional inputs) should be fixed once at the tool-execution boundary instead. Follow-up coming. |
Summary
"Invalid input: expected string, received null"when running Vanta operations with empty optional fields (e.g., List Vulnerabilities with no filters)serializer/index.ts?? null), but the Vanta query contract validated optional fields with.optional(), which accepts omission/undefined and rejects null. Operations whose optional fields are remapped in the block params fn (e.g., List Frameworks) were unaffected; operations with same-named pass-through fields (List Vulnerabilities, List Tests, List Risk Scenarios, etc.) failed.nullish(), matching the existing Daytona contract convention; the routes already skip null values when building Vanta API URLs (buildVantaUrl/splitVantaCommaList), andregionhandling intools/vanta/utils.tsnow tolerates nullframeworkId,documentId, …) intentionally stay strictNote: the CrowdStrike query contract has the same latent
.optional()pattern for its filter params — flagged for a separate follow-up since it predates this PR.Type of Change
Testing
vanta.test.tscontract tests (6) pass; existing registry suites passcheck:api-validation:strictall cleanChecklist