Skip to content
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

Expand usage of title trait #2461

Merged
merged 2 commits into from
Nov 13, 2024
Merged

Conversation

hpmellema
Copy link
Contributor

@hpmellema hpmellema commented Nov 13, 2024

Closes: #2406

Description

Expands the selector of the title trait to allow it to be applied to any non-member shape.

The title trait provides a simple name or description that can be used when referencing the shape from another context.

In a code generator this can be used to provide helpful documentation For example you could use the title trait on the following error:

@title("Indicates a failed doodad.") 
@error("client")
structure OopsieDaisyError {...}

Which could then referenced in a generated operation (notional java):

/**
  * My Cool operation that does stuff.
  * 
  * @throws OopsieDaisyError - Indicates a failed doodad.
  */
  public MyOuput myOperation(MyInput input) {...}

Notice how the title trait provides the user-friendly description to use in the operation context


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

@hpmellema hpmellema requested a review from a team as a code owner November 13, 2024 15:50
@hpmellema hpmellema merged commit 6d296d5 into smithy-lang:main Nov 13, 2024
13 checks passed
@hpmellema hpmellema deleted the expand-title branch November 13, 2024 17:34
yasmewad pushed a commit to yasmewad/smithy that referenced this pull request Nov 13, 2024
Expands the usage of the `@title` trait to allow application to any non-member shape.
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.

Allow using @title trait on members
3 participants