bjdash / apic

One opensource tool for all your API needs.APIC is a free open-source solution that can help you in API Designing, API Testing (even during designing), API Documentation, Simulating your API response for the frontent team etc.
89 stars 20 forks source link

AWS API Gateway Integration #60

Open cajund opened 1 year ago

cajund commented 1 year ago

Hi Folks,

I'd like to generate a swagger export that includes something similar to:

x-amazon-apigateway-integration:
    type: aws_proxy
    httpMethod: POST
    payloadFormatVersion: "1.0"
    uri: 
      Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${BackendFunction.Arn}/invocations
    responses:
      default:
        statusCode: 200

Is there a way to add these non-standard tags to a request?

Thanks.

bjdash commented 1 year ago

Hi @cajund, I came across this exact same requirement last week while working on a project. I am working on adding the feature for defining additional properties and should be able to release it in a day or two.

bjdash commented 1 year ago

Added the option to define additional properties for endpoints. You can now open th endpoint and scroll down to the bottom to define additional properties for the endpoint. This now available on the webapp and the Chrome extension. I will notify here once the Edge extension and Native apps are published for Mac, Windows and Linux.

cajund commented 1 year ago

Thanks! I'll see if I can test it in the extension, in the interim.

cajund commented 1 year ago

@bjdash ,

So finally got a change to test this. Two questions:

First, the YAML output looks like this (with the quotes and the pipe):

      'x-amazon-apigateway-integration:': |
        type: aws_proxy
            httpMethod: POST
            payloadFormatVersion: "1.0"
            uri: 
              Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${BackendFunction.Arn}/invocations
            responses:
              default:
                statusCode: 200

I'll have to test this from Terraform into API Gateway, but I suspect that this may be an issue on the import. Will follow up with this soon. I am starting a new project and want to include APIC into the workflow.

Second, this block is the same for all (or a vast majority of) endpoints. Can I use a "trait" to insert this into all of them in one place?

Thanks!