Cloud Endpoints adds a number of OpenAPI extensions that are used to configure the API proxy behavior.
This tool can be used to import an OpenAPI specification with cloud Cloud Endpoints extensions to generate Apigee proxies.
- default target backend via
x-google-backend.address
andx-google-backend.path_translation
- path level dynamic routing via
x-google-backend.address
andx-google-backend.path_translation
- intercept unmatched paths via
x-google-allow
- authenticate towards backend with a Google ID token e.g. for Cloud Run backends
- authenticate client via JWT through the OAS
x-google-...
security context extensions
The endpoints importer expects the following parameters:
--oas/-o the path of an OpenAPI 2.0 file in json or yaml format
--base-path/-b the basepath that should be extracted from
the OAS paths and used in the proxy
--name/-n the name of the proxy to be created
--quiet/-q (optional) skip the override confirmation
With a JSON OAS file
./import-endpoints.sh --oas ./examples/openapi_test.json --base-path /headers --name oas-import-test
With a YAML OAS file
./import-endpoints.sh --oas ./examples/openapi_test.yaml --base-path /headers --name oas-import-test