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

Add --show-traits to select command #1692

Merged
merged 1 commit into from
Mar 24, 2023
Merged

Add --show-traits to select command #1692

merged 1 commit into from
Mar 24, 2023

Conversation

mtdowling
Copy link
Member

The --show-traits option will include the serialize value of specific traits for each shape matched by the --select command. The output format is the same as the format used with --vars, but also included in the output is a 'traits' property that contains a map of trait shape IDs to trait values. --show-traits is a comma separated list of trait shape IDs, where omitting a namespace assumes the trait is in the prelude (e.g., 'required' is the same as 'smithy.api#required'). Matches are not required to have the traits defined in --show-traits, so if that is the desired filtering, the selector provided in --selector needs to ensure each shape has the required traits.

This option can be useful to answer questions like: "what are all the HTTP headers used in my service?" or "what are the default values of every shape?"

Issue #, if available:

Description of changes:

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

The --show-traits option will include the serialize value of
specific traits for each shape matched by the --select command.
The output format is the same as the format used with --vars, but
also included in the output is a 'traits' property that contains a
map of trait shape IDs to trait values. --show-traits is a comma
separated list of trait shape IDs, where omitting a namespace
assumes the trait is in the prelude (e.g., 'required' is the same as
'smithy.api#required'). Matches are not required to have the traits
defined in --show-traits, so if that is the desired filtering, the
selector provided in --selector needs to ensure each shape has the
required traits.

This option can be useful to answer questions like: "what are all the
HTTP headers used in my service?" or "what are the default values of
every shape?"
@mtdowling mtdowling requested a review from a team as a code owner March 24, 2023 05:22
@mtdowling mtdowling merged commit 7810c97 into main Mar 24, 2023
@mtdowling mtdowling deleted the add-show-traits-param branch March 30, 2023 17:36
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.

2 participants