First, let's define the models that we require the API gateway to receive. The following contents go in the /resources/api/api.yml file. With this, the serverless-aws-documentation plugin generates the models for use in the API gateway:
api: info: version: '2' title: Lets Poll API Documentation description: Documentation to support the Lets Poll API and generate its models. tags: - name: Name description: Lets Poll API # Now we describe all the models that we use models: - name: Poll contentType: "application/json" schema : type: "object" required: - "pollOptions" - "pollQuestion" - "pollTitle" properties: pollId: type: "string" pollTitle: type: "string" pollQuestion: type: "string" pollOptions: type: "array" items: type: ...