-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(type-safe-api): minor improvements to readme files (#577)
Update links in model readme files, and omit generating a handler readme when no handler languages specified
- Loading branch information
Showing
6 changed files
with
134 additions
and
1,301 deletions.
There are no files selected for viewing
48 changes: 2 additions & 46 deletions
48
packages/type-safe-api/samples/type-safe-api/readme/TYPE_SAFE_API.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,5 @@ | ||
# Type Safe API | ||
|
||
This project contains an API built with [Type Safe API](https://github.com/aws/aws-pdk/tree/mainline/packages/type-safe-api). | ||
This project contains an API built with Type Safe API. | ||
|
||
## Project Structure | ||
|
||
This project consists of the following components: | ||
|
||
### Model | ||
|
||
The `model` folder contains the API model, which defines the API operations and their inputs and outputs. For more details, please refer to the [model project README](./model/README.md). | ||
|
||
### Runtime | ||
|
||
The `runtime` folder contains subprojects for each of the selected runtime languages. These projects include types as well as client and server code, generated from the model. | ||
|
||
### Infrastructure | ||
|
||
The `infrastructure` folder contains a subproject for the selected infrastructure language. This includes a CDK construct which defines the API Gateway resources to deploy the API defined by the model. | ||
|
||
### Documentation | ||
|
||
The `documentation` folder contains documentation generated from the model, for each of the selected documentation formats. | ||
|
||
## Adding Operations | ||
|
||
This section describes the steps required to add a new operation to your API. | ||
|
||
### Define the Operation | ||
|
||
The API operations are defined by the API model. Please see the [model project README](./model/README.md) for instructions for the specific model language used. | ||
|
||
### Build the Project | ||
|
||
Next, build the project using the project's build command. This will vary depending on the overall project setup, and is likely documented in the top level README. | ||
|
||
The build will trigger regeneration of the `runtime`, `infrastructure` and `documentation` projects, which will include your new operation. | ||
|
||
### Add an Integration | ||
|
||
If you are using the CDK construct defined in the `infrastructure` folder, you likely encountered a type error in your CDK project, since the construct requires an integration for every operation defined in the model. | ||
|
||
Please refer to the [Type Safe API documentation](https://github.com/aws/aws-pdk/tree/mainline/packages/type-safe-api) for details about how to add integrations in your chosen infrastructure language. | ||
|
||
### Implement the Operation | ||
|
||
Finally, you'll need to implement the operation. If using AWS Lambda for your API integrations, you can make use of the generated lambda handler wrappers from one of the `runtime` projects. These wrappers provide typed interfaces for operations, providing auto-complete in your IDE for inputs, and ensuring you return the output (or one of the errors) defined in the model. | ||
|
||
For more details about using the handler wrappers in the various supported languages, please refer to the [Type Safe API documentation](https://github.com/aws/aws-pdk/tree/mainline/packages/type-safe-api). | ||
Please refer to the [Type Safe API Documentation](https://aws.github.io/aws-pdk/developer_guides/type-safe-api/index.html) for details about the project structure and how to add operations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.