Skip to content

Latest commit

 

History

History
 
 

projection-examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Projections

Projections are filtered and modified versions of a Smithy model intended for a specific audience or customer.

Examples


Filter out internal data

This example demonstrates how to use projections to filter internal data out of your model so you have a modified version of the model that is safe for external consumers to view.

The external projection used in this example is defined in the smithy-build.json file and filters out shapes marked with the internal trait or with the internal tag. It also filters out any shapes marked with beta tag. This allows you to filter out internal traits and routes from a version of your model intended for consumption by external customers. For example, you might use the model generated by the external projection to generate documentation for external customers.

This example also demonstrates how you can only include specific metadata fields in an external projection via the includeMetadata transform.

The model used in this example is the weather service from the quickstart guide.

Using as template

To use this example as a template run the following.

smithy init -t filter-internal-projection