diff --git a/docs/architecture/http-adapters.md b/docs/architecture/http-adapters.md index 2ead72e..648e43f 100644 --- a/docs/architecture/http-adapters.md +++ b/docs/architecture/http-adapters.md @@ -514,20 +514,24 @@ number: `to_openapi` projects `error_schemas` to the gateway endpoint's response definitions. The `/call` endpoint's responses are the shared components-referenced status map: the protocol-level errors, plus any -operation-level errors (keyed by the registry's declared `http_status`; -entries whose codes lack the `HTTP_` prefix carry +operation-level errors (keyed by the registry's declared `http_status`. +Entries whose codes lack the `HTTP_` prefix carry `x-runtime-behavior: 500` — the runtime mapper is purely code-driven, -see review-001 PRJ-04): +see review-001 PRJ-04. Declarations at a protocol status from +`HTTP_`-prefixed codes are **merged oneOf** into the shared +protocol response instead of overwriting it — the runtime emits both, +see review-002 PRJ-17): ```yaml # /call endpoint responses responses: '200': { $ref: '#/components/schemas/CallOk' } # envelope { request_id, result, output } '400': { description: plain-text extractor rejection (framework body) } - '401': { $ref: '#/components/responses/Unauthorized' } + '415': { description: plain-text extractor rejection (missing Content-Type, PRJ-19) } + '401': { oneOf: [CallErrorForbidden, CallErrorInvalidOperationType] } # identity split, PRJ-20 '403': { $ref: '#/components/responses/Forbidden' } - '404': { $ref: '#/components/responses/NotFound' } - '422': { oneOf: [CallErrorInvalidInput, CallErrorInvalidOperationType] } + '404': { $ref: '#/components/responses/NotFound' } # merged oneOf when ops declare HTTP_404 (PRJ-17) + '422': { oneOf: [CallErrorInvalidInput, CallErrorInvalidOperationType] } # + plain-text extractor shape rejection (PRJ-19) '429': { ... } # only when ops declare errors at 429; x-runtime-behavior: 500 for non-HTTP_* codes '500': { oneOf: [CallErrorInternal, CallFailure] } # INTERNAL + non-HTTP_* operation codes '503': { ... } # only when ops declare errors at 503 @@ -538,7 +542,13 @@ The operation-declared errors are surfaced on the `/call` and `/publish` endpoints' responses — the gateway projects the registered operations' `error_schemas` as response definitions. This makes the adapter contract from alkcall ADR-022 faithful on the error axis — no -silent dropping of error contracts. See alkcall ADR-016. +silent dropping of error contracts. The `/batch` endpoint documents no +HTTP 500 (review-002 PRJ-21): every per-entry dispatch failure is an +in-band `results[]` entry; the only HTTP error status is the +request-level cap failure (400). `BatchResultEntry.error` references +the `BatchError` component (review-002 PRJ-16b): the serialized +`CallError` as a oneOf over the six protocol-code envelopes plus a +generic arm carrying the operation-declared codes. See alkcall ADR-016. ## Why diff --git a/src/server/adapter.rs b/src/server/adapter.rs index c092d4d..72d684f 100644 --- a/src/server/adapter.rs +++ b/src/server/adapter.rs @@ -892,9 +892,10 @@ mod tests { let text = String::from_utf8_lossy(&response); assert!(text.starts_with("HTTP/1.1 200 OK"), "got: {text}"); assert!(text.contains("application/json"), "got: {text}"); - // The 6-endpoint gateway doc with the version from the /publish addition. + // The 6-endpoint gateway doc; the version tracks the projection + // truthfulness pass. assert!(text.contains("\"/publish\""), "publish path in doc"); - assert!(text.contains("1.2.0"), "info.version 1.2.0 in doc"); + assert!(text.contains("1.3.0"), "info.version 1.3.0 in doc"); assert!(text.contains("gatewayPublish"), "publish operationId"); let _ = server_task.await;