feat: expose AWS request_id response metadata for JSON and Query protocols#34
Merged
Conversation
…ocols - Add Smaws_Lib.Response module (response + request_id metadata) - Track x-amzn-requestid/x-amz-request-id in AwsJson.request_with_metadata - Extract <ResponseMetadata>/<RequestId> in AwsQuery response parser - Generate both request and request_with_metadata bindings for JSON/Query ops - Update AwsQuery response parser regression test for new tuple return type
Re-run code generation so the new request_with_metadata operation bindings and updated mli/serializer interfaces are reflected across all generated SDKs and aws.protocoltests.json/aws.protocoltests.query conformance tests.
chris-armstrong
commented
Jul 6, 2026
chris-armstrong
left a comment
Owner
Author
There was a problem hiding this comment.
Missing response metadata on error part of result, revising
…protocols
- AwsJson.request_with_metadata now returns Error(error, { request_id }),
extracting x-amzn-requestid/x-amz-request-id for both success and errors.
- AwsQuery.request_with_metadata now extracts <RequestId> from <ErrorResponse>
and returns Error(error, { request_id }).
- Update generated mli signatures to (output Response.t, error * Response.metadata) result.
- Add regression tests for JSON error metadata and Query error RequestId.
- Update STS example to use request_with_metadata and print request_id.
- Add STS GetCallerIdentityError example using invalid credentials to exercise
the error metadata path against live AWS.
chris-armstrong
added a commit
that referenced
this pull request
Jul 17, 2026
Land the restXml protocol implementation plan (`refactorings/restxml-protocol.md` + `.todo.md`), revised after a three-agent review (plan-vs-codebase audit, spec-conformance audit, guidelines/risk audit) against the current tree (AwsQuery is already on main via PRs #33/#34/#35). Key plan changes from the original draft: - Re-baseline the current-state inventory against main (AwsQuery is context-based; Protocol.t dispatch exists; AwsProtocolQuery.ml is the codegen template; appliesTo/Float/Stack.Empty fixes present; shape count 21->23). - Reclassify xmlNamespace `prefix` (G6b) as a blocker — the conformance model requires it; add service-level default namespace handling. - Resolve Q3: httpPayload on a structure emits the structure's own root element as the body (not bare members). Fix httpPayload blob = raw, not base64. - Add missing conformance-required behaviors to scope: httpResponseCode, idempotencyToken auto-fill, enum/intEnum, per-binding timestamp defaults, httpQuery/httpQueryParams precedence, greedy-label "/" non-encoding, empty-prefix httpPrefixHeaders + httpHeader precedence, list-valued httpQueryParams, null/empty handling, xmlNamespace on list/map/members, endpoint/hostLabel host-prefix substitution. - State the noErrorWrapping root (<Error>) definitively; correct the false claim that the targeted namespaces exercise it (they use the wrapped envelope; noErrorWrapping is for S3, Phase 9). - Fold the AwsQuery review failure modes into the design: skip-siblings in the error-envelope parse, Failure catch, separate RestXml.Error (not folded into the JSON-shaped AwsErrors), String.equal error dispatch, strengthened Phase 5/6 checkpoints, full-envelope error mock. - Ban the two requestCompression test IDs (out of scope; separate plan). - Resolve Q1-Q6. No restXml implementation yet; plan only.
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.
Exposes AWS request IDs returned in responses by adding a
Smaws_Lib.Responsemetadata wrapper and generatingrequest_with_metadataoperation bindings alongside the existingrequestones.Changes:
Smaws_Lib.Responsemodule (response+request_idmetadata)x-amzn-requestid/x-amz-request-idheaders in AwsJson<ResponseMetadata>/<RequestId>in AwsQuery response parsingrequestandrequest_with_metadatafor JSON and Query protocol operationsRuntime + codegen build and tests pass.