@aws-prototyping-sdk/type-safe-api
Project description
Type Safe API
Define your APIs using Smithy or OpenAPI v3, and leverage the power of generated client and server types, infrastructure, documentation, and automatic input validation!
This package vends a projen project type which allows you to define an API using either Smithy or OpenAPI v3, and a construct which manages deploying this API in API Gateway, given an integration (eg a lambda) for every operation.
The project will generate "runtime" projects from your API definition in your desired languages, which can be utilised both client side for interacting with your API, or server side for implementing your API. The project also generates a type-safe CDK construct which ensures an integration is provided for every API operation.
Code is generated at build time, so when you change your API model, just rebuild and you'll see your changes reflected in the generated code.
Project Structure
The TypeSafeApiProject
projen project will create the following directory structure within its outdir
:
|_ model/
|_ src/
|_ main/
|_ smithy - your API definition if you chose ModelLanguage.SMITHY
|_ openapi - your API definition if you chose ModelLanguage.OPENAPI
|_ runtime/ - generated types, client, and server code in the languages you specified
|_ typescript
|_ python
|_ java
|_ infrastructure/ - generated infrastructure (you'll find only one directory in here based on your chosen infrastructure language)
|_ typescript
|_ python
|_ java
|_ documentation/ - generated documentation in the formats you specified
|_ html2
|_ html_redoc
|_ plantuml
|_ markdown
|_ library/ - generated libraries if specified
|_ typescript-react-query-hooks
Getting Started
Please see the Getting Started Guide for how to get started!
User Guides
For more information about Type Safe API, take a look at the user guides:
- Using Smithy
- Using OpenAPI
- Integrations
- Authorizers
- Lambda Handlers
- React Query Hooks
- API Keys
- Custom Integration: ECS and NLB
You can also check out the Frequently Asked Questions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aws_prototyping_sdk.type_safe_api-0.19.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f88f374a772c347dc4b98ab8f04ba4e956318c007918e58b22474742f5d518d |
|
MD5 | 4dd0af451c3ef360b76165de8fe58361 |
|
BLAKE2b-256 | 9bf4b82c892f2b720139df6bf37b924baff14a12822e1d9d2d52efaaaa75b969 |
Hashes for aws_prototyping_sdk.type_safe_api-0.19.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f0b9ca46071e1607729e4628f2864eff379a50ce208b9481d3458e55d12ef4b |
|
MD5 | 74a0d2190404656b9337c8c5d528c9c8 |
|
BLAKE2b-256 | 23db22890caf8e2086b6aab582f6dd3a02554bb2e400b8fbdb4cad67e124c446 |