Generate all AwsQuery and AwsJson services#35
Merged
Conversation
Several long-latent generator/parser gaps surfaced once the broader set of AwsQuery/AwsJson models was generated: - SafeNames: enum/union constructors now pass through translateReserved, so a constructor named None/Some/Result/Ok/Error no longer collides with the option/result constructors; added result/list/array/ref/exn/char to the reserved type-name set so generated types shadowing stdlib types are suffixed (e.g. result_) and no longer clash with the stdlib (_,_) result used in operation signatures. - AwsProtocolQuery deserialiser: named long shapes were read with int_of_string (int) but typed Int64.t; route LongShape to long_of_string. Map keys now use their own deserialiser for non-primitive (enum/structure) keys instead of a raw string. - Dependencies: add smithy.api#PrimitiveBoolean/PrimitiveLong to the implicit shapes so dependency resolution finds them; add matching primitive_boolean /primitive_long aliases and JSON/query serialiser+deserialiser helpers to Smithy_api so generated references resolve. - JSON parser: switch to Yojson.Safe (which preserves out-of-range integers as Intlit instead of raising "Int overflow") and handle Intlit in parseNumber/parseInteger; update the Trait raw-JSON type and protocol-test generator accordingly. Fixes the int64-max @range value in iotfleetwise. - externalDocumentation is a free-form string map, not just Documentation/Specification; parse the whole map (mailmanager uses arbitrary keys). Regenerates the few existing SDKs whose output is affected (eventbridge, lightsail, sfn, swf).
The dune template hardcoded json_serializers/json_deserializers, but AwsQuery services emit query_serializers/query_deserializers. service-dune-generate.sh now inspects the service shape's protocol trait (mirroring SmithyHelpers.protocol_of_traits, which sees traits in reversed document order) and substitutes the correct serializer/deserializer module names via %%serializer-module%%/%%deserializer-module%% placeholders in the template. Grep-based protocol detection is unreliable: many AwsJson models contain awsQuery strings (test shapes, the awsQueryCompatible trait), so the service shape's own traits are inspected instead.
Extends the generated SDK set from 39 to 168 services, covering every modelled service whose protocol the generator and runtime support (AwsQuery, AwsJson 1.0, AwsJson 1.1). The supported set is determined from each service shape's own protocol trait (restJson1 services are excluded even when their files contain awsQuery/json strings). - bin/AwsGenerator.ml: add namespace->module mappings for the new services. - sdks/<svc>/: new directories with generated sources and protocol-aware dune rules (15 AwsQuery services use query_serializers/query_deserializers; 152 AwsJson services use json_*). - sdks/dune + sdks/Smaws_Clients.ml: register and alias all 168 client libraries. - AGENTS.md: update the protocol support table.
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.
Summary
Extends the generated SDK set from 39 to 168 services, covering every modelled service whose protocol the generator and runtime support (AwsQuery, AwsJson 1.0, AwsJson 1.1). The supported set is determined from each service shape's own protocol trait; restJson1 services (e.g. polly, sagemaker-runtime, backup, connect, fis) are excluded even though their model files contain awsQuery/json trait strings.
Commits
fix(parse,codegen): support the full AwsQuery/AwsJson model set— latent generator/parser gaps that the broader model set exposed:translateReserved(None→None_, etc.) andresult/list/… type names are reserved, so generated names no longer clash with stdliboption/resultconstructors used in operation signatures.longshapes asInt64(wasint); map keys use their own deserialiser for non-primitive keys.smithy.api#PrimitiveBoolean/PrimitiveLongimplicit shapes +Smithy_apialiases/helpers.Yojson.Safe(handles out-of-range integers, e.g. iotfleetwise's int64-max@range).externalDocumentationparsed as the free-form string map it is (mailmanager uses arbitrary keys).feat(sdks): make service dune generation protocol-aware—service-dune-generate.sh/service-dune-templatepickquery_*vsjson_*serializer modules from the service's protocol trait.feat(sdks): generate all AwsQuery and AwsJson services— 129 new SDK dirs, namespace mappings inAwsGenerator.ml, registration insdks/dune+Smaws_Clients.ml, and an updated protocol table inAGENTS.md.Verification
dune buildpasses (all 168 client libraries).dune runtestpasses (110 protocol conformance tests green, 0 failures).dune fmtclean.