Reputation: 930
I see on the documentation for REST API how they explain the Model architecture, but not for HTTP API. Is this because the HTTP API doesn't require models?
For example I have this data in DynamoDB:
Usually in the REST API one would perform user input validation which is part of the model (if I'm correct), I don't see that option in HTTP API. Can someone explain me how I build (or if it's needed) this model for HTTP API? For example, what if the user goes to /todos/{id}
?
Is this model concept moved to lambda or somewhere else or still lives in the gateway?
Thanks
Upvotes: 0
Views: 383
Reputation: 5747
API Gateway data transformations are not supported with HTTP APIs, but are supported with REST APIs.
You can think of API Gateway's HTTP API as a streamlined version of the REST API. HTTP APIs have fewer features than REST API. As a result, HTTP APIs are faster and cheaper. The trade-off is that you have fewer features to choose from when working with HTTP APIs.
If you want to use data transformations, you'll need to use REST API. If you'd prefer to use the cheaper/faster HTTP API, you'll need to do data transformations yourself (e.g. code you write yourself in Lambda).
Upvotes: 1
Reputation: 10333
HTTP API is more recent addition to Api Gateway, it is much simpler, cheeper and easier to use but will not support bunch of features that REST API supports. Model Validations in one of those un supported features. Here is the comparison.
All validations will reside within the application code.
Upvotes: 1