yndlingsfar / serverless-openapi-integration-helper

The plugin separates x-amazon-apigateway extension syntax from your openapi3 files
MIT License
6 stars 5 forks source link

TypeScript: Resource handler returned message: "Another resource with the same parent already has this name:... #16

Open paulatwilson opened 2 years ago

paulatwilson commented 2 years ago

Hello,

We are trying to use the openapi-integration-helper with the TypeScript template of server less 3.x. We have spent nearly two days on this and continue to have the same issue:

Error:
CREATE_FAILED: ApiGatewayResourceExt (AWS::ApiGateway::Resource)
Resource handler returned message: "Another resource with the same parent already has this name: ext (Service: ApiGateway, Status Code: 409, Request ID:<snip>)" (RequestToken:<snip>, HandlerErrorCode: AlreadyExists)

There is nothing else using "ext" and it doesn't matter what we change the the URL to, it always says that is AlreadyExists. Even if I were to created a UUID v4.

The config in our serverless.ts file is:

  openApiIntegration: {
    package: true,
    inputFile: 'schema.yml',
    mapping: [
      {
        stage: ['sb','dev', 'test', 'prod'],
      },
    ],
  },
  resources: {
    Resources: {
      ApiGatewayRestApi: {
        Type: 'AWS::ApiGateway::RestApi',
        Properties: {
          DisableExecuteApiEndpoint: true,
          ApiKeySourceType: 'HEADER',
          Body: '~',
          Description: 'Some Description',
          FailOnWarnings: false,
          Name: 'ips-external-client-apis-${opt:stage, self:provider.stage}',
          EndpointConfiguration: {
            Types: ['REGIONAL'],
          },
        },
      },     
    },
  },