I have a serverless.yaml file using the serverless framework. I have it including a models.yaml file since it is over 1,000 lines.it gives me an error that it is unable to merge. I have tried multiple different ways to include it. Is there any way to debug this?
Error: Cannot parse "serverless.yaml": cannot merge mappings; the provided source object is unacceptable in "/mnt/c/git/Hamlethub30-BE/serverless.yaml" (18:29) 15 | resources: 16 | Resources: 17 | # ${file(./models.yaml)} 18 | <<: ${file(models.yaml)} ----------------------------------^ 19 | NetworkingStack: 20 | Type: AWS::CloudFormation::Stack
the serverless code where this is happening
` resources: Resources:
${file(./models.yaml)}
<<: ${file(models.yaml)}
NetworkingStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: nested-stacks/networking.yaml
Parameters:
Service: ${self:service}
Stage: ${self:custom.stage}`
the top of the models.yaml file:
`SubscriptionRequestModel: Type: AWS::ApiGateway::Model Properties: RestApiId: !Ref ApiGatewayRestApi ContentType: application/json Name: SubscriptionRequest Schema: | { "type": "object", "properties": { "email": { "type": "string" }, "hubId": { "type": "string" }, "assets": { "type": "array", "items": { "type": "string" } }, "hash": { "type": "string" }, "token": { "type": "string" }, "source": { "type": "string" } }, "required": ["email", "hubId", "assets"] }
SubscriptionResponseModel: Type: AWS::ApiGateway::Model Properties: `
I have tried including this as a custom variable, as a list, etc. nothing appears to work