Repository navigation
Replace docgen id usage in codegen with legacy id mapping - #3964
wty-Bryant wants to merge 3 commits into
Conversation
| } | ||
|
|
||
|
|
||
| // Namespace is derived from the codegen id (sdkId == C2J serviceId) ONLY, per Revision 2 of |
There was a problem hiding this comment.
This actually gets overridden by smithy-namespace-mapping.json, which is built from serviceAbbreviation in legacy_c2j_cpp_gen.py#L386 and passed to Gradle in smithy_cpp_gen.py#L100. The Smithy plugins for paginators, waiters and endpoint rules prefer it over getServiceName (EndpointRulesCodegenPlugin.java#L80, PaginationCodegenPlugin.java#L58, WaiterCodegenPlugin.java#L51), affecting 144 services.
So if an abbreviation changes, the C2J and Smithy halves get different names and the client won't compile. I checked by replacing the docgen ids in the models with a placeholder and regenerating: acm-pca then fails to compile with ACMPCAEndpointProvider.cpp: fatal error: 'aws/acm-pca/internal/ACMPCAEndpointRules.h' file not found.
There was a problem hiding this comment.
remove the old namespace map, the new legacy id mapping should generate the same runtime paginator/waiter/endpointresolver
| metadata.setProtocols(c2jMetadata.getProtocols()); | ||
| metadata.setAuth(c2jMetadata.getAuth()); | ||
| metadata.setNamespace(c2jMetadata.getServiceAbbreviation()); | ||
| metadata.setServiceFullName(c2jMetadata.getServiceFullName()); |
There was a problem hiding this comment.
One more docgen id read in codegen: Metadata.java#L76 pins arc-region-switch to JSON via serviceFullName.equalsIgnoreCase("ARC - Region switch"). With a placeholder serviceFullName, the client switches from AWSJsonClient to AWSRpcV2CborClient. If this display name ever changes (e.g. in the rebrand), the client would silently switch its wire protocol from JSON to CBOR. Matching on serviceId ("ARC Region switch") would keep this stable.
37ee14b to
37847db
Compare
[aws-sdk-cpp] Derive service namespace from serviceId per Service ID SEP (rev 2)
Summary
Latest serviceID SEP requires generated identifiers to come from the codegen id (serviceId/sdkId), not docgen ids (serviceFullName/serviceAbbreviation from C2j model and smithy.api#title from smithy model). Both C++ generators (c2j and smithy) derived the namespace from docgen ids; this moves it to serviceId, preserving every released namespace via one checked-in table. Codegen-only — generated/ is unchanged.
What changed
serviceId-less importexport/sdb special-cased), with a uniqueness guard. New ServiceNamespaceTable.java + pom.xml resource bundling; test updated to supply a serviceId.
ServiceNamespaceTable.java + build.gradle.kts resource bundling.
Testing