feat(server): align utoipa OpenAPI spec with rest-sandbox-open-api.yaml#394
Merged
Conversation
…ml (#392) Make the coordinator's utoipa-generated OpenAPI spec fully match the hand-written spec at openapi/rest-sandbox-open-api.yaml. - Extract wire types into handlers/types.rs with ToSchema derives for all 30 OpenAPI schemas (Box, ExecRequest, Snapshot, ImageInfo, etc.) - Add #[utoipa::path] annotations to all 16 existing proxy handlers - Add 17 stub handlers (501) for unimplemented endpoints (snapshots, clone, export, import, files, images, TTY WebSocket) - Implement get_box_metrics via existing gRPC GetMetrics - Register all paths, schemas, tags, and security schemes in ApiDoc - Add SecuritySchemeAddon for BearerAuth + OAuth2 client credentials - Rename path parameter namespace → prefix to match spec - Add OpenAPI conformance test suite (6 structural tests) - Add comprehensive unit tests for types serde (37), error helpers (9), proto conversion (3), and integration tests (32)
Cargo.toml and Cargo.lock changes previously triggered tests for ALL Rust components (rust cli ffi server). This caused the pre-push hook to run CLI VM integration tests for unrelated changes like adding a dev-dependency to boxlite-server. Now: workspace-root Cargo.toml and Cargo.lock only trigger the `rust` base component. Per-crate Cargo.toml changes are already detected by the directory-prefix rules (e.g., boxlite-server/Cargo.toml matches the ^boxlite-server/ rule which emits `server`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handlers/types.rswithToSchemaderives for all 30 OpenAPI schemas#[utoipa::path]annotations to all 16 existing proxy handlersget_box_metricsvia existing gRPCGetMetricsApiDocSecuritySchemeAddonfor BearerAuth + OAuth2 client credentials flownamespace→prefixto match specCargo.lockchange detection inmake/changes.mkthat triggered unrelated CLI VM testsTest plan
cargo test -p boxlite-server— 112 tests pass (62 unit + 44 integration + 6 conformance)cargo clippy -p boxlite-server --tests -- -D warnings— zero warningscargo fmt -p boxlite-server -- --check— clean/swagger-ui/and verify all endpoints visible/api-docs/openapi.jsonagainstopenapi/rest-sandbox-open-api.yaml