Skip to content

feat(server): align utoipa OpenAPI spec with rest-sandbox-open-api.yaml#394

Merged
DorianZheng merged 2 commits into
mainfrom
feat/server-openapi-alignment
Mar 18, 2026
Merged

feat(server): align utoipa OpenAPI spec with rest-sandbox-open-api.yaml#394
DorianZheng merged 2 commits into
mainfrom
feat/server-openapi-alignment

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

  • Extract wire types into handlers/types.rs with ToSchema derives for all 30 OpenAPI schemas
  • Add #[utoipa::path] annotations to all 16 existing proxy handlers
  • Add 17 stub handlers (501 Not Implemented) 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 flow
  • Rename path parameter namespaceprefix to match spec
  • Add OpenAPI conformance test suite verifying structural equivalence with the YAML spec
  • Add 94 new tests: type serde (37), error helpers (9), proto conversion (3), integration (32), conformance (6), plus existing tests updated
  • Fix overly broad Cargo.lock change detection in make/changes.mk that triggered unrelated CLI VM tests

Test plan

  • cargo test -p boxlite-server — 112 tests pass (62 unit + 44 integration + 6 conformance)
  • cargo clippy -p boxlite-server --tests -- -D warnings — zero warnings
  • cargo fmt -p boxlite-server -- --check — clean
  • Full pre-push test matrix passes (204 rust + 112 server tests)
  • Start coordinator, visit /swagger-ui/ and verify all endpoints visible
  • Compare /api-docs/openapi.json against openapi/rest-sandbox-open-api.yaml

…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`).
@DorianZheng DorianZheng merged commit 2f1f8b4 into main Mar 18, 2026
18 checks passed
@DorianZheng DorianZheng deleted the feat/server-openapi-alignment branch March 18, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant