I have a backend developed in FastApi using OpenAPI 3.0. It’s hosted in GCP Cloud. The FastAPI is auto-documented (Swagger UI), and it’s exposed to internet.
Now, I am deploying a GCP API Gateway in front of this service. This is the openapi.yaml that is deployed in GCP API Gateway.
swagger: '2.0'
info:
title: care-chat
description: Sample API on API Gateway with a Cloud Run backend
version: 1.0.0
schemes:
- https
produces:
- application/json
x-google-backend:
address: https://care-navigation-api-zibxv3ldca-ue.a.run.app
paths:
"/api/v1/tenants":
get:
summary: Tenant
operationId: getTenants
responses:
200:
description: "Success."
schema:
type: string
Basically I have two questions:
- Does each route/method that I have in my FasAPI need to be exposed one by one in GCP API Gateway? The FastAPI has a lot of complex objects.
- How about the documentation? Should I expose it on GCP API Gateway? And if so, how? It seems counter-intuitive to create a map for each of my FastAPI schemas. If so, I suppose that this should be integrated in my ci/cd pipeline.
1