--- id: adapter-to-openapi name: to_openapi projection (6-endpoint gateway doc) status: pending depends_on: [gateway-routes] scope: moderate risk: low impact: component level: implementation tags: [adapters, phase-3] --- ## Description Port `adapters/to_openapi.rs` from `/workspace/@alkdev/alknet/crates/alknet-http/src/adapters/to_openapi.rs`: generate the OpenAPI doc describing the 6 fixed gateway endpoints (search/schema/call/batch/subscribe + publish), per-caller surface discovered via /search (not preloaded), `info.version` semver tracking the gateway contract (ADR-045; minor = /publish addition), error schemas projected per ADR-023. Wire `GET /openapi.json` in the server router. Pub ops excluded from /subscribe's tool description but listed in /search; /publish documents the NDJSON body per OQ-02's resolution. ## Acceptance Criteria - [ ] Projection ported; 6-endpoint doc with correct versioning - [ ] /openapi.json serves it (integration test) - [ ] Doc validates against openapiv3 parsing - [ ] `cargo test` passes ## References - docs/architecture/http-adapters.md (§to_openapi) - docs/architecture/decisions/042-openapi-gateway-pattern.md, 045-to-openapi-gateway-spec-versioning.md, 068-gateway-publish-endpoint.md - Old source: `/workspace/@alkdev/alknet/crates/alknet-http/src/adapters/to_openapi.rs` ## Notes > Agent fills during implementation. ## Summary > Agent fills on completion.