ApiGatewayDeployment - The REST API doesn't contain any methods

During deploy I’m getting this error & I couldn’t fix it until now:

ApiGatewayDeployment - The REST API doesn't contain any methods (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException

I have an API definition in my serverless.yml:

resources:
  Resources:
    ApiGatewayRestApi:
      Type: 'AWS::ApiGateway::RestApi'
      Properties:
        Name: ${self:provider.apiName}
        Body: ${file(swagger-file.yml)}

    ApiGatewayDeployment:
      Type: 'AWS::ApiGateway::Deployment'
      Properties:
        RestApiId:
          Ref: ApiGatewayRestApi
        StageName: ${self:provider.stage}

Any suggestions?

1 Like

I have the same issue now. Were you able to figure out the solution to this?