Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Resource with same path, but different http method #151

Open
Mayhem93 opened this issue Jul 14, 2020 · 0 comments
Open

Resource with same path, but different http method #151

Mayhem93 opened this issue Jul 14, 2020 · 0 comments

Comments

@Mayhem93
Copy link

Hello,

I've been using this plugin for quite some time but never had an endpoint with the same path but different method.

Looks like this plugin doesn't like having a different http method because no matter how much I tell it that these two resources are using different method, it just ignores it.

 Serverless: [AWS apigateway 201 0.15s 0 retries] createDocumentationPart({ location: { path: '/api/v1/file', type: 'RESOURCE' },
   properties: '{"description":"Upload firmware file: /api/v1/file"}',
   restApiId: 'uecdxkh0m7' })
 Serverless: [AWS apigateway 201 0.147s 0 retries] createDocumentationPart({ location: { path: '/api/v1/file/check', type: 'RESOURCE' },
   properties: '{"description":"Check firmware object: /api/v1/file"}',
   restApiId: 'uecdxkh0m7' })
 Serverless: [AWS apigateway 201 0.145s 0 retries] createDocumentationPart({ location: { path: '/api/v1/file/list', type: 'RESOURCE' },
   properties: '{"description":"List firmware object files"}',
   restApiId: 'uecdxkh0m7' })
 Serverless: [AWS apigateway 409 0.129s 0 retries] createDocumentationPart({ location: { path: '/api/v1/file', type: 'RESOURCE' },
   properties: '{"description":"Delete firmware file"}',

As seen in this log the first and the last ones use the same path, but they should have different method:

-
  path: "/api/v1/file"
  description: "Upload firmware file: /api/v1/file"
  method: "get"
-
  path: "/api/v1/file/check"
  description: "Check firmware object: /api/v1/file"
-
  path: "/api/v1/file/list"
  description: "List firmware object files"
-
  path: "/api/v1/file"
  description: "Delete firmware file"
  method: "delete"

Obviously cloudformation doesn't like that and it throws an err: Documentation part already exists for the specified location: type 'RESOURCE', path '/api/v1/file'.

So how do I go about this ? 🤔

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant