Skip to content

Feature request: optional "baseName" setting to control artifact naming #3168

Description

@f34nk
smithy --version
[0.007s][warning][cds] Cannot handle shared archive file version 0xb. Must be at least 0xd.
1.71.0

Context

Smithy code generators derive artifact names (client classes, shared types, protocol helpers etc.) from the Smithy service shape id name (the #Name portion of the configured service shape id).

For many published AWS models, that shape id does not match the product name users expect, which results in sometimes surprising artifact names.

For example:

Configured service Derived User-expected
com.amazonaws.lambda#AWSGirApiService AWSGirApiService Lambda
com.amazonaws.dynamodb#DynamoDB_20120810 DynamoDB_20120810 DynamoDB

The @aws.api#service trait sdkId and endpoint metadata (endpointPrefix, signingName) describe runtime behavior but are not used for generated artifact names today. Service rename maps in the model can disambiguate shape name conflicts but are impractical for renaming upstream AWS service jars.

Language-specific settings such as Java namespace control the package or directory root only.

There is no cross-language, documented smithy-build.json setting to supply a human-readable service name without editing the model.

Proposal

Add an optional baseName property to the Recommended properties section of "Configuring the Generator".

Semantics

  • Optional string. When unset, generators derive the name from the configured service shape id name (honoring the service rename map where applicable).
  • When set, replaces the derived stem for all service-scoped generated artifacts (client, server, shared types, protocol helpers, auth helpers), not just the client.
  • Value is the name without role suffixes (Client, _client, _types). Generators append suffixes as they do today.
  • Validation is language-specific (Java PascalCase, Erlang snake_case)

Example (Java, using existing smithy-java support)

"java-codegen": {
  "service": "com.amazonaws.lambda#AWSGirApiService",
  "namespace": "com.amazonaws.lambda",
  "baseName": "Lambda",
  "modes": ["client"]
}

Would produce com.amazonaws.lambda.client.LambdaClient instead of AWSGirApiServiceClient.

Example (Erlang, using smithy-beam support)

"erlang-client-codegen": {
  "service": "com.amazonaws.lambda#AWSGirApiService",
  "edition": "2026",
  "baseName": "aws_lambda"
}

Would produce Erlang modules such as aws_lambda_client, aws_lambda_types etc. (exact suffix rules remain language-specific).

Why platform-level guidance

  • smithy-java already implements "name" in JavaCodegenSettings but it is undocumented in the Smithy guide and in the Java client generation docs.
  • Other language generators have no equivalent setting today.
  • Documenting name as a recommended property gives users one predictable override across languages.

Out of scope

  • Automatically deriving names from AWS sdkId will be inconsistent across services.
  • Renaming individual model shapes (already handled by service rename maps).
  • Replacing namespace / package settings (those remain package-root concerns).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationThis is a problem with documentation.feature-requestA feature should be added or improved.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions