refactor(api): extract inlined request body schemas#2837
Conversation
- Extract sandbox timeout/refresh/snapshot request bodies into named components (SandboxTimeoutRequest, SandboxRefreshRequest, SandboxSnapshotRequest) so consumers can reference them by name instead of via inlined path-derived types. - Drop pointless `items.allOf: [$ref]` wrappers on the list endpoints GET /teams, /sandboxes, /v2/sandboxes, /templates, /nodes — these caused generators to emit anonymous wrapper types for no benefit. - Regenerate API and integration test clients; switch two handlers to the new named types (old anonymous *JSONBody symbols no longer exist).
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 45c13a1. Bugbot is set up for automated code reviews on this repo. Configure here. |
❌ 6 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 5 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
Summary
POST /sandboxes/{id}/timeout,/refreshes,/snapshots) into named component schemas:SandboxTimeoutRequest,SandboxRefreshRequest,SandboxSnapshotRequest. This follows the same pattern as refactor(api): extract SandboxNetworkUpdateConfig schema #2748 (SandboxNetworkUpdateConfig) and gives consumers a stable name to reference instead of a path-derived anonymous type.items.allOf: [$ref]wrappers on five list endpoints (GET /teams,/sandboxes,/v2/sandboxes,/templates,/nodes); the wrapper caused generators to emit anonymous element types for no semantic gain.*JSONRequestBodysymbols are now type aliases to the named schemas, so existing call sites compile unchanged. Two handlers (sandbox_refresh.go,sandbox_timeout.go) used the removed*JSONBodyinner type and were switched to the new named types.Test plan
go build ./...inpackages/apigo vet ./internal/...intests/integrationmake fmt/make lint— could not run locally; local golangci-lint was built against Go 1.25 but the repo targets 1.26.3. CI will run both.🤖 Generated with Claude Code