So I’m starting work on a serverless component with AWS API gateway and AWS Lambda. I was exploring apistar 0.6 because I find interesting having Types to validate the input body the lambdas receive but I have some doubts on how both the types and the schema work:
- Is there something to ensure consistency between the schema and the type? I see schema as a generic way to define your API where you can also set constraints for the data going in. Now suppose you defined a type for that input request where I define again the input fields but with further constraints. Am I forced to keep consistency between both or there is something to generate the schema from types, or the types from a schema or to check things make sense between both?
- I don’t see anything to validate an input request against the schema you have defined in your API. Are you supposed to do this only with types?
- With the current state, I don’t see any use case for the API schema apart from describing your API, am I right? Is the validation of the request with the schema supposed to be done with an external third party package?
Sorry if my questions are not clear, kind of brainstorming here and trying to make up my mind on how this would look like in the project I’m working :).