Forum Discussion

dcee's avatar
dcee
New Contributor
7 years ago

AWS API Gateway Integration questions

Hi there

 

What's best practice regarding the base path and host when setting up an AWS integration? We want the api on AWS to run on our own domain (api.domain.io) with a v1 basepath. But, we also want to be able to use the virtual mocking functionality. Is there a conflict here?

 

Currently, the API is running on AWS using the default domain and basepath set by the automock plugin. It looks something like this (where CompanyName is the SwaggerHub organisation);

 

https://api.domain.io/CompanyName/TestApi/1.0.0/inventory

 

When we set up the integration, we set the proxy to the basepath given by the automock plugin. This is because we had issues with directing the domain name when we'd set the proxy to https://api.domain.io/v1. Also because the automock functionality stopped working when we set the base path and domain to our custom settings. 

 

Any tips?


Cheers,


Dave

 

 

1 Reply

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi Dave,

     

    If I understand your scenario correctly, you need to disable the "Update host setting" option in the API Auto Mocking configuration and then specify your actual host and basePath in the spec. In this case, "Try It Out" and AWS will use the basePath specified in the spec, but the mock will still exist separately at

    https://virtserver.swaggerhub.com/<owner>/<api>/<version>

    and can be accessed via cURL etc.