Loading
fix(api): align OpenAPI spec with engine routes and models
The OpenAPI spec had drifted from the engine: /admin/ws-auth was documented as POST with a summary copied from test-db-source, 7 routed operations were missing, and several schemas did not match what the handlers write.
Changes in engine/api/swagger-spec/dblab_openapi.yaml:
/admin/ws-auth: GET, as routed; own summary and operationId; 401 ->Error; 500 documented; dropped the 400 it never returns. Same method fix indblab_server_swagger.yaml.- Added the routed but undocumented operations:
GET /snapshot/{id},POST /snapshot/clone,POST /admin/probe-source,GET /admin/billing-status,POST /admin/activate,POST /healthz,GET /instance/logs(WebSocket). Router and spec now list the same 39 operations. - Response schemas: 401 bodies that referenced
Instance;test-db-sourcereturnsTestConnectionResponse, not an empty body;config.yamlreturns a YAML string, notConfig;POST /snapshotreturnsCreatedSnapshot;SnapshotDetails.child/rootare arrays;Retrieving.alertsis an object keyed by alert type. - Types:
Engine.billingActiveis boolean;compressRatio,expectedCloningTime,cloningTimeand the observation durations arenumber;replicationLagis integer. - Fields: added
Clone.branch/revision,Database.dbName/ownerUser,Snapshot.clones/branch/message, the missingBranchandSnapshotDetailsfields,CreateClone.extra_conf; removedClone.name,Error.detail/hintand the unusedSummaryObservationRequest. - Status codes and parameters: 401 on the 12 operations that lacked it, the 400/404 responses handlers return, no body on
DELETE /clone/{id}and reset,datasetquery onGET /snapshots, integersession_id,artifact_typeenum, required fields, an operationId on every operation. */*->application/json.
Redocly reports the spec as valid. Examples that violate their schema went from 42 to 2; both are activity: null, which Redocly does not accept through nullable + allOf.
The two commented-out 404 TODO blocks stay as they are: the engine returns 500 there. That and four other handler bugs found during the audit are tracked in #782 (closed).