Skip to content

Trait codegen: less restrictive namespace check #2671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kubukoz
Copy link
Contributor

@kubukoz kubukoz commented Jun 19, 2025

Allow namespaces like smithy4s, but not smithy or smithy.api or other sub-smithy namespaces.

Background

  • What do these changes do?
  • Why are they important?

Testing

  • How did you test these changes?

Links

  • Links to additional context, if necessary
  • Issue #, if applicable (see here for a list of keywords to use for linking issues)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kubukoz kubukoz requested a review from a team as a code owner June 19, 2025 22:42
@kubukoz kubukoz requested a review from milesziemer June 19, 2025 22:42
@@ -55,8 +55,8 @@ public final class TraitCodegenSettings {
) {
this.packageName = Objects.requireNonNull(packageName);
this.smithyNamespace = Objects.requireNonNull(smithyNamespace);
if (smithyNamespace.startsWith(SMITHY_API_NAMESPACE)) {
throw new IllegalArgumentException("The `smithy` namespace is reserved.");
if (smithyNamespace.equals(SMITHY_API_NAMESPACE) || smithyNamespace.startsWith(SMITHY_API_NAMESPACE + ".")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, SMITHY_API_NAMESPACE is set to smithy. Shouldn't it just be smithy.api?

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