0
votes

Is it possible to deploy Openapi YAML config to Google Endpoints if it references from multiple files, having the files stored in a folder structure?

For example:

-\ openapi.yaml
--\service1\service1.yaml
--\service2\service2.yaml
.
.
.

Let's say openapi.yaml has $ref to one or more definitions within service1.yaml and service2.yaml.

Please note that I have a big number of folders and YAMLs, and the above is just an example of what I am trying to achieve.

How can I deploy this structure as-is to Google Endpoints using service-management?

2

2 Answers

1
votes

Unfortunately, Endpoints' support for OpenAPI doesn't handle external type references. Even if it did, the path structure is not preserved during the OpenAPI upload in gcloud endpoints services deploy.

0
votes

As a workaround you could use speccy for this task. It merges your api description with all your references into on single deployable yaml file. speccy resolve openapi-template.yaml -j -o openapi.yaml You can even merge json references into your yaml file by adding the -j flag.

Speccy is a npm package, so, you would obviously need an node.js environment to use it.