I have used the Swagger Editor to create a REST API and I have requested the server code download for Python Flask. I'm trying to deploy this out to Google Cloud Platform (I think that's the latest name? Or is it still GAE?) but I need to fill in some gaps.
I know the Swagger code works because I have deployed it locally without any issues. However, it uses the connexion library instead of Flask outright.
I'm mostly lost on how I can incorporate an app.yaml file for GCP and the right entrypoints within the generated code. In addition, I know that the generated code declares it's own app server which I don't think you need to do for GCP. Here's my current app.yaml
application: some-app-name
version: 1
runtime: python27
api_version: 1
threadsafe: yes
entrypoint: python app.py
libraries:
- name: connexion
version: "latest"
And here's my app.py
import connexion
if __name__ == '__main__':
app = connexion.App(__name__, specification_dir='./swagger/')
app.add_api('swagger.yaml', arguments={'title': 'this is my API'})
app.run(port=8080)
The primary error I'm getting now is
google.appengine.api.yaml_errors.EventError: the library "connexion" is not supported
I have a feeling that's because of the way I am declaring an app server in my app.py - it probably shouldn't be needed. How would I modify this file to still use my Swagger code but run on GCP?