Adding Documentation to my AWS SAM API Gateway
I deployed my SAM application with API Gateway, referencing an external file for DefinitionBody. The deployment succeeded, but in the AWS documentation, I can only see the summary, description, and the responses I defined, not the requestBody. I suspect there may be an issue with how my Swagger file is structured. How can I include the requestBody in the API Gateway documentation?
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: api/swagger-integrated.yaml
In my swagger-integrated.yaml file:
openapi: "3.0.1"
info:
title: "api-dev"
version: "v1.0"paths:
/efectos:
post:
summary: Start extraction
description: Extracts the data
parameters:
-in: body
name: payload
description: test payload
schema:
$ref: "#/components/schemas/test"
responses:
200:
description: "200 response"
content: { }
x-amazon-apigateway-integration:
uri: Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ExtractLambda.Arn}/invocations
responses:
default:
statusCode: "200"
httpMethod: "POST"
type: "aws_proxy"
Then my schema is set below in components:
components:
schemas:
test:
type: object
properties:
Envio:
type: object
properties:
proyecto:
type: string
lote:
type: integer
orden:
type: integer
magnitud:
type: integer
Fichero0:
type: object
properties:
iddocumento:
type: integer
data:
type: string
format: base64