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 transformation to exclude shapes based on ShapeType #1330

Closed
wants to merge 1 commit into from

Conversation

michael-mml
Copy link

Add a new transformation to support excluding shapes based on their ShapeType.

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

@michael-mml michael-mml marked this pull request as ready for review August 8, 2022 20:20
@michael-mml michael-mml requested a review from a team as a code owner August 8, 2022 20:20
@mtdowling
Copy link
Member

What's the use case for this?

@michael-mml
Copy link
Author

Our data model is populated from a variety of sources and clients are only interested in the data model itself, they do not care about the services, errors, or operations defined in our Smithy model. This transformation makes it easier to filter these out in a projection rather than tagging the unwanted shapes and using ExcludeShapesByTag transformation.

@mtdowling
Copy link
Member

I think we should add a transforms called ExcludeShapesBySelector and IncludeShapesBySelector, which would allow us to use Smithy selectors to filter out or include shapes based on type, traits, members, and more complex logic. For example, you could exclude by type using :is(service, operation). You could exclude shapes that aren't part of a specific service closure using :not([id=some.id#Service] ~> *). We could potentially make existing related transforms just wrappers around the selector based transform (e.g., ExcludeShapeByTrait).

@sugmanue
Copy link
Contributor

A more general approach was implemented in this PR. You can look at the docs for how to do either inclusion or exclusion of shapes using a selector.

@sugmanue sugmanue closed this Feb 16, 2023
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.

3 participants