Skip to content

Generate all AwsQuery and AwsJson services#35

Merged
chris-armstrong merged 3 commits into
mainfrom
all-awsquery-awsjson
Jul 7, 2026
Merged

Generate all AwsQuery and AwsJson services#35
chris-armstrong merged 3 commits into
mainfrom
all-awsquery-awsjson

Conversation

@chris-armstrong

Copy link
Copy Markdown
Owner

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

  1. fix(parse,codegen): support the full AwsQuery/AwsJson model set — latent generator/parser gaps that the broader model set exposed:

    • enum/union constructors now pass through translateReserved (NoneNone_, etc.) and result/list/… type names are reserved, so generated names no longer clash with stdlib option/result constructors used in operation signatures.
    • AwsQuery deserialiser reads named long shapes as Int64 (was int); map keys use their own deserialiser for non-primitive keys.
    • add smithy.api#PrimitiveBoolean/PrimitiveLong implicit shapes + Smithy_api aliases/helpers.
    • JSON parser switched to Yojson.Safe (handles out-of-range integers, e.g. iotfleetwise's int64-max @range).
    • externalDocumentation parsed as the free-form string map it is (mailmanager uses arbitrary keys).
    • regenerates the few existing SDKs whose output changed (eventbridge, lightsail, sfn, swf).
  2. feat(sdks): make service dune generation protocol-awareservice-dune-generate.sh/service-dune-template pick query_* vs json_* serializer modules from the service's protocol trait.

  3. feat(sdks): generate all AwsQuery and AwsJson services — 129 new SDK dirs, namespace mappings in AwsGenerator.ml, registration in sdks/dune + Smaws_Clients.ml, and an updated protocol table in AGENTS.md.

Verification

  • dune build passes (all 168 client libraries).
  • dune runtest passes (110 protocol conformance tests green, 0 failures).
  • dune fmt clean.
  • The AwsQuery set: auto-scaling, cloudformation, cloudsearch, cloudwatch, docdb, elasticache, elastic-beanstalk, elastic-load-balancing(-v2), iam, neptune, rds, redshift, ses, sns (+ sts already present). The rest are AwsJson.

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
chris-armstrong merged commit 4512364 into main Jul 7, 2026
5 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant