serverless-application-model icon indicating copy to clipboard operation
serverless-application-model copied to clipboard

basepath in swagger is ignored

Open mburket opened this issue 7 years ago • 6 comments

Description:

Steps to reproduce the issue:

  1. Create a basepath in swagger file for an API
  2. Deploy the API using SAM

Observed result: "basepath" is always ignored. This forces us to rework our existing swaggers to use the "path" field.

Expected result: Allow different import options for basePath which is described from the AWS doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html

mburket avatar Jul 25 '18 18:07 mburket

Hello, it seems it's not related to SAM because I'm experiencing the same issue when I create an API in API Gateway with a Swagger file.

mtrimbur avatar Jul 30 '18 15:07 mtrimbur

By default, basePath is ignored in swagger when an API is created. I am suggesting to add the support in SAM to allow prepend.

mburket avatar Jul 30 '18 15:07 mburket

@mburket Do you have an example of how you would like to use the prepend property, and how it could look in SAM? I'm marking this as a feature request; with more information we could put it into our backlog or someone in the community could submit a PR implementing this feature.

keetonian avatar Aug 24 '18 00:08 keetonian

@keetonian Thank you for looking into this issue. How about a new property named "DefinitionBathPath" for the resource of "AWS::Serverless::Api"? The acceptable values can be: "ignore", "prepand", "split".

mburket avatar Aug 24 '18 17:08 mburket

Any updates on this issue?

hs1945 avatar Jan 28 '20 04:01 hs1945

I can file a PR to support this feature. Could you assign this issue to me? @keetonian @praneetap

fengzixu avatar Feb 09 '22 02:02 fengzixu